:root {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #000000 !important;
  --bg2: #050505 !important;
  --card: #0b0b0d !important;
  --card2: #151517 !important;
  --line: rgba(255, 255, 255, .12) !important;
  --txt: #f7f7f8 !important;
  --dim: #b6b7bb !important;
  --dim2: #8d8f94 !important;
  --upi-ink: #f7f7f8;
  --upi-navy: #78e3b5;
  --upi-ice: #000000;
  --upi-soft: #151517;
  --upi-border: rgba(255, 255, 255, .12);
  --shop-ice: #000000;
  --shop-surface: #0b0b0d;
  --shop-surface-soft: #151517;
  --shop-ink: #f7f7f8;
  --shop-text: #dedfe1;
  --shop-muted: #b6b7bb;
  --shop-line: rgba(255, 255, 255, .12);
  --shop-line-strong: rgba(255, 255, 255, .2);
  --upi-bg: #000000;
  --upi-bg-2: #050505;
  --upi-card: #0b0b0d;
  --upi-card-2: #151517;
  --upi-line: rgba(255, 255, 255, .12);
  --upi-text: #f7f7f8;
  --upi-muted: #b6b7bb;
  --upi-blue: #78e3b5;
  --upi-shadow: 0 20px 46px rgba(0, 0, 0, .64);
}

.upi-theme-toggle,
#upi-theme-toggle {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 100000;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(26, 90, 111, .18);
  border-radius: 12px;
  background: rgba(255, 255, 255, .92);
  color: #153f50;
  box-shadow: 0 10px 25px rgba(25, 91, 111, .16);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  backdrop-filter: blur(12px);
}

.upi-theme-toggle:hover,
.upi-theme-toggle:focus-visible,
#upi-theme-toggle:hover,
#upi-theme-toggle:focus-visible {
  border-color: #39a8c7;
  transform: translateY(-1px);
  outline: none;
}

html[data-theme="dark"] .upi-theme-toggle,
html[data-theme="dark"] #upi-theme-toggle {
  border-color: var(--upi-line);
  background: rgba(8, 8, 9, .96);
  color: var(--upi-text);
  box-shadow: var(--upi-shadow);
}

body.in-game #upi-theme-toggle {
  top: 58px;
}

/* No launcher/loja o tema faz parte da barra de ações. Assim ele ocupa seu
   próprio espaço e nunca cobre o botão de sair ou o avatar do usuário. */
#dashboard-screen .tb-right .upi-theme-toggle-inline,
#dashboard-screen .tb-right #upi-theme-toggle.upi-theme-toggle-inline {
  position: relative;
  inset: auto;
  z-index: auto;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .88);
  box-shadow: 0 8px 20px rgba(48, 121, 145, .07);
  backdrop-filter: none;
}

html[data-theme="dark"] body {
  background: #000 !important;
  color: var(--upi-text);
}

html[data-theme="dark"] #dashboard-screen,
html[data-theme="dark"] .dashboard-screen,
html[data-theme="dark"] .dashboard-shell,
html[data-theme="dark"] .app-shell,
html[data-theme="dark"] .page-shell {
  --upi-bg: #000;
  --upi-surface: #0b0b0d;
  --upi-surface-strong: #151517;
  --upi-ink: #f7f7f8;
  --upi-muted: #b6b7bb;
  --upi-line: rgba(255, 255, 255, .12);
  --upi-blue: #78e3b5;
  --upi-blue-deep: #78e3b5;
  --upi-mint-soft: rgba(120, 227, 181, .1);
  --upi-sky-soft: rgba(255, 255, 255, .055);
  --bg: var(--upi-bg);
  --bg-soft: var(--upi-bg-2);
  --card: var(--upi-card);
  --card-soft: var(--upi-card-2);
  --surface: var(--upi-card);
  --surface-2: var(--upi-card-2);
  --line: var(--upi-line);
  --border: var(--upi-line);
  --text: var(--upi-text);
  --text-main: var(--upi-text);
  --muted: var(--upi-muted);
  --text-muted: var(--upi-muted);
  background: var(--upi-bg) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen .panel,
html[data-theme="dark"] #dashboard-screen .card,
html[data-theme="dark"] #dashboard-screen .dashboard-card,
html[data-theme="dark"] #dashboard-screen .dash-card,
html[data-theme="dark"] #dashboard-screen .menu-card,
html[data-theme="dark"] #dashboard-screen .sidebar,
html[data-theme="dark"] #dashboard-screen .topbar,
html[data-theme="dark"] #dashboard-screen .modal-content,
html[data-theme="dark"] #dashboard-screen input,
html[data-theme="dark"] #dashboard-screen select,
html[data-theme="dark"] #dashboard-screen textarea {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
  box-shadow: none;
}

html[data-theme="dark"] #dashboard-screen p,
html[data-theme="dark"] #dashboard-screen small,
html[data-theme="dark"] #dashboard-screen .muted,
html[data-theme="dark"] #dashboard-screen .subtitle,
html[data-theme="dark"] #dashboard-screen .description {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] .upi-shop-v2 {
  --shop-bg: var(--upi-bg);
  --shop-bg-2: var(--upi-bg-2);
  --shop-surface: var(--upi-card);
  --shop-surface-soft: var(--upi-card-2);
  --shop-card: var(--upi-card);
  --shop-border: var(--upi-line);
  --shop-text: var(--upi-text);
  --shop-muted: var(--upi-muted);
  background: var(--upi-bg) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .upi-shop-v2 .shop-header,
html[data-theme="dark"] .upi-shop-v2 .shop-panel,
html[data-theme="dark"] .upi-shop-v2 .shop-card,
html[data-theme="dark"] .upi-shop-v2 .package-card,
html[data-theme="dark"] .upi-shop-v2 .admin-card,
html[data-theme="dark"] .upi-shop-v2 input,
html[data-theme="dark"] .upi-shop-v2 select,
html[data-theme="dark"] .upi-shop-v2 textarea {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] body.upi-admin-page {
  --admin-bg: var(--upi-bg) !important;
  --admin-bg-soft: var(--upi-bg-2) !important;
  --admin-surface: var(--upi-card) !important;
  --admin-surface-2: var(--upi-card-2) !important;
  --admin-card: var(--upi-card) !important;
  --admin-line: var(--upi-line) !important;
  --admin-border: var(--upi-line) !important;
  --admin-text: var(--upi-text) !important;
  --admin-muted: var(--upi-muted) !important;
  background: var(--upi-bg) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] body.upi-admin-page header,
html[data-theme="dark"] body.upi-admin-page main > section,
html[data-theme="dark"] body.upi-admin-page .card,
html[data-theme="dark"] body.upi-admin-page .panel,
html[data-theme="dark"] body.upi-admin-page .admin-card,
html[data-theme="dark"] body.upi-admin-page input,
html[data-theme="dark"] body.upi-admin-page select,
html[data-theme="dark"] body.upi-admin-page textarea,
html[data-theme="dark"] body.upi-admin-page table {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] body.upi-admin-page .side {
  border-color: var(--upi-line) !important;
  background: radial-gradient(circle at 8% 5%, rgba(67, 199, 142, .08), transparent 10rem), linear-gradient(180deg, #0b0b0d, #000) !important;
  box-shadow: 12px 0 35px rgba(0, 18, 27, .18) !important;
}

html[data-theme="dark"] body.upi-admin-page .brand,
html[data-theme="dark"] body.upi-admin-page .side .foot,
html[data-theme="dark"] body.upi-admin-page .pagehead {
  border-color: var(--upi-line) !important;
}

html[data-theme="dark"] body.upi-admin-page .brand .shield,
html[data-theme="dark"] body.upi-admin-page .kpi,
html[data-theme="dark"] body.upi-admin-page .pcard,
html[data-theme="dark"] body.upi-admin-page .links a,
html[data-theme="dark"] body.upi-admin-page .cl,
html[data-theme="dark"] body.upi-admin-page .mon {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
  box-shadow: var(--upi-shadow) !important;
}

html[data-theme="dark"] body.upi-admin-page .side nav a {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] body.upi-admin-page .side nav a:hover,
html[data-theme="dark"] body.upi-admin-page .side nav a.on,
html[data-theme="dark"] body.upi-admin-page .side nav a .n {
  border-color: rgba(139, 216, 231, .24) !important;
  background: var(--upi-card-2) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] body.upi-admin-page :is(.brand b, .pagehead h1, .pagehead h2, .card h2, .kpi b, .prow b, .pk-name) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] body.upi-admin-page :is(.brand span, .side .grp, .side .foot label, .pagehead p, .kpi span, .kpi small, .prow, .hint, .sub) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] body.upi-admin-page :is(input[type="text"], input[type="number"], input[type="password"], input[type="datetime-local"], select, textarea, #gv-pkg, .skey input) {
  border-color: var(--upi-line) !important;
  background: var(--upi-card-2) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] body.upi-admin-page :is(.btn, .mini, .re, .secret button, .addrow button, .cl-actions button, .pagehead .re) {
  border-color: var(--upi-line) !important;
  background: var(--upi-card-2) !important;
  color: var(--upi-blue) !important;
}

html[data-theme="dark"] body.upi-admin-page :is(th, tr:hover td) {
  border-color: var(--upi-line) !important;
  background: var(--upi-card-2) !important;
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] body.upi-admin-page td {
  border-color: var(--upi-line) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page #dashboard-screen .sidebar,
html[data-theme="dark"] .shop-page #dashboard-screen .topbar,
html[data-theme="dark"] .shop-page #dashboard-screen .sb-event,
html[data-theme="dark"] .shop-page #dashboard-screen .cur,
html[data-theme="dark"] .shop-page #dashboard-screen .iconbtn,
html[data-theme="dark"] .shop-page .pk-card,
html[data-theme="dark"] .shop-page .cat-h .ic,
html[data-theme="dark"] .shop-page .pix-tag,
html[data-theme="dark"] .shop-page .shop-head > div:last-child {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page #dashboard-screen .nav a {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] .shop-page #dashboard-screen .nav a:hover,
html[data-theme="dark"] .shop-page #dashboard-screen .nav a.on {
  border-color: rgba(139, 216, 231, .24) !important;
  background: var(--upi-card-2) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page .shop-head {
  border-color: var(--upi-line) !important;
  background: linear-gradient(90deg, rgba(23, 63, 78, .98) 0%, rgba(23, 63, 78, .92) 43%, rgba(23, 63, 78, .22) 72%), url('/assets/brand/ultimate-poke-idle/shop-banner-eeveelutions.webp') 78% 48% / cover no-repeat !important;
}

html[data-theme="dark"] .shop-page :is(.shop-head h1, .pk-name, .cat-h, .welcome .t2) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page :is(.shop-head p, .pk-desc, .welcome .t1) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] .shop-page :is(.cat-h .ct, .loot, .eggprev, .pk-price) {
  border-color: var(--upi-line) !important;
  background: var(--upi-card-2) !important;
  color: #c8e2e8 !important;
}

html[data-theme="dark"] .shop-page .pk-head {
  border-color: var(--upi-line) !important;
  background: radial-gradient(circle at 52% 60%, rgba(67, 199, 142, .14), transparent 39%), linear-gradient(145deg, #151517, #0b0b0d) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.sidebar, .topbar, .upi-quick, .mon, .news, .act, .pcard, .pokemon-card, .upi-account-data, .upi-community-grid > *, .rkl .rk, .upi-community-card .erow, .upi-event-bonus, .upi-event-scope-chip, .pa-dialog, .pa-wallet, .pa-tab, .pa-toolbar input, .pa-toolbar select, .pa-sell-panel input, .pa-actions button, .pa-sellable, .pa-history-row, .pa-confirm-card, .pa-pagination button) {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.welcome .t2, .section-h h3, .upi-quick b, .news h5, .act p b, .pcard .nm, .block h3, .rk .nm, .erow .nm, .pokemon-card .card-head strong, .pokemon-card .card-head > span, .pokemon-card .card-hp .lab b, .upi-account-stats .act p b, .upi-community-grid .head h3, .pa-heading h2, .pa-wallet strong, .pa-name, .pa-sell-panel h3) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.welcome .t1, .upi-quick small, .news p, .act p, .pcard .lv, .erow .tm, .pokemon-card .card-head small, .pokemon-card .card-meta code, .pokemon-card .card-hp .lab, .upi-account-stats .act p span, .pa-heading small, .pa-wallet span, .pa-meta, .pa-sell-panel p, .pa-sell-panel label) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #auth-screen,
html[data-theme="dark"] #character-creation-screen,
html[data-theme="dark"] #boot-screen,
html[data-theme="dark"] .auth-screen,
html[data-theme="dark"] .character-creation-screen {
  color: var(--upi-text);
}

html[data-theme="dark"] #auth-screen .auth-card,
html[data-theme="dark"] #character-creation-screen .creation-card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .dialog-content,
html[data-theme="dark"] .toast {
  border-color: var(--upi-line) !important;
  background: var(--upi-card) !important;
  color: var(--upi-text) !important;
}

/* Dashboard: o fundo editorial e seus cards usam gradientes, portanto trocar
   apenas background-color não remove a camada clara original. */
html[data-theme="dark"] body #dashboard-screen {
  background: #000 !important;
}

html[data-theme="dark"] #dashboard-screen::before {
  background:
    linear-gradient(145deg, rgba(0, 0, 0, .96), rgba(5, 5, 5, .94) 48%, rgba(0, 0, 0, .97)),
    url('/assets/brand/ultimate-poke-idle/login-hero-eeveelutions.webp') center / cover no-repeat !important;
}

html[data-theme="dark"] #dashboard-screen .sidebar {
  background:
    radial-gradient(circle at 14% 4%, rgba(89, 210, 190, .06), transparent 24%),
    linear-gradient(180deg, rgba(8, 8, 9, .99), rgba(0, 0, 0, .99)) !important;
  box-shadow: 18px 0 48px rgba(0, 0, 0, .54) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-nav-section, .upi-passport, .upi-journey-card, .upi-account-data) {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, var(--upi-card), var(--upi-card-2)) !important;
  color: var(--upi-text) !important;
  box-shadow: var(--upi-shadow) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.nav a, .upi-nav-label, .upi-passport-top, .upi-card-copy small, .upi-card-copy em, .upi-section-kicker, #dsh-teamcount) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.nav a:hover, .nav a.on) {
  border-color: rgba(120, 227, 181, .24) !important;
  background: linear-gradient(135deg, #1a1a1d, #101012) !important;
  color: var(--upi-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-card-copy b, .upi-passport .nm, .section-h h3) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen .upi-card-copy i {
  color: var(--upi-blue) !important;
}

html[data-theme="dark"] #dashboard-screen .tb-right :is(.cur, .iconbtn, .upi-theme-toggle-inline),
html[data-theme="dark"] #dashboard-screen .pstats .s,
html[data-theme="dark"] #dashboard-screen .av2,
html[data-theme="dark"] #dashboard-screen #dsh-event-time {
  border-color: var(--upi-line) !important;
  background: #0b0b0d !important;
  color: var(--upi-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #dashboard-screen .tb-right :is(.cur, .iconbtn, .upi-theme-toggle-inline):hover {
  border-color: rgba(120, 227, 181, .38) !important;
  background: #18181a !important;
}

html[data-theme="dark"] #dashboard-screen #dsh-event-time {
  color: #78e3b5 !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-sidebar-companion, .upi-achievement-launch, .av) {
  border-color: var(--upi-line) !important;
  background: #0b0b0d !important;
  color: var(--upi-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-sidebar-companion, .upi-achievement-launch) :is(b, strong) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-sidebar-companion, .upi-achievement-launch) :is(span, small) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .upi-hero-grid .hero .sc {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .88), rgba(0, 0, 0, .62) 48%, rgba(0, 0, 0, .18) 78%),
    linear-gradient(0deg, rgba(0, 0, 0, .5), transparent 66%) !important;
}

html[data-theme="dark"] #dashboard-screen .journey-play::before {
  background: none !important;
}

html[data-theme="dark"] #dashboard-screen .upi-account-scene {
  border-color: var(--upi-line) !important;
  background:
    linear-gradient(135deg, rgba(0, 0, 0, .91), rgba(5, 5, 5, .72)),
    url('/assets/brand/ultimate-poke-idle/shop-banner-eeveelutions.webp') center / cover !important;
}

html[data-theme="dark"] #dashboard-screen .upi-account-scene::after {
  background: linear-gradient(0deg, rgba(0, 0, 0, .66), transparent) !important;
}

html[data-theme="dark"] #dashboard-screen :is(#dsh-account2, .upi-sync-pill, .empty-ball) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: #78e3b5 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card.empty strong {
  color: var(--upi-text) !important;
}

/* Cards da equipe: OLED tambem nas superficies internas e sem reflexo
   diagonal sobre a arte. */
html[data-theme="dark"] #dashboard-screen .pokemon-card {
  box-shadow: 0 18px 38px rgba(0, 0, 0, .62), inset 0 0 0 1px rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card:hover {
  box-shadow: 0 26px 48px rgba(0, 0, 0, .72), 0 0 0 2px color-mix(in srgb, var(--card-accent) 18%, transparent) !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card .card-foil {
  background: none !important;
  opacity: 0 !important;
  animation: none !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card .card-art {
  border-color: var(--upi-line) !important;
  background:
    radial-gradient(ellipse at 50% 78%, color-mix(in srgb, var(--card-accent) 14%, transparent), transparent 43%),
    #050505 !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card .card-art::after {
  background: radial-gradient(ellipse, rgba(255, 255, 255, .11), transparent 68%) !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card :is(.card-genetics span, .card-hp, .card-moves span) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card .card-hp .bar {
  background: #29292d !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card .card-genetics small {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .pokemon-card .card-genetics b {
  color: #78e3b5 !important;
}

/* Quadro de atualizacoes do dashboard. */
html[data-theme="dark"] #dashboard-screen :is(.upi-updates-panel, .upi-updates-head, .upi-updates-foot) {
  border-color: var(--upi-line) !important;
  background: #050505 !important;
  color: var(--upi-text) !important;
  box-shadow: var(--upi-shadow) !important;
}

html[data-theme="dark"] #dashboard-screen .upi-update-row {
  border-color: var(--upi-line) !important;
  background: #0b0b0d !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-updates-head h3, .upi-update-row b) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-updates-head small, .upi-update-row .upi-update-date, .upi-update-row p, .upi-updates-foot) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .upi-update-row em {
  background: rgba(120, 227, 181, .14) !important;
  color: #78e3b5 !important;
}

html[data-theme="dark"] #dashboard-screen .upi-updates-empty {
  background: #151517 !important;
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .upi-updates-list {
  scrollbar-color: #78e3b5 rgba(255, 255, 255, .08);
}

html[data-theme="dark"] :is(.shop-page .sheet .x, #dashboard-screen .pa-close, #ac-ov .ac-close, .wm-close) {
  border-color: var(--upi-line) !important;
  background: #151517 url('/assets/brand/ultimate-poke-idle/portal-icons/close.svg') center / 25px no-repeat !important;
  box-shadow: none !important;
}

html[data-theme="dark"] :is(#dashboard-screen .upi-event-details-close, #ach-ov .ach-close, #dashboard-screen .upi-updates-close) {
  border-color: var(--upi-line) !important;
  background-color: #151517 !important;
  color: var(--upi-text) !important;
  box-shadow: none !important;
}

/* Login: a folha autoral é carregada depois do tema compartilhado, então os
   seletores reais (.card e .abar) precisam de uma regra explícita. */
html[data-theme="dark"] #auth-screen {
  --auth-ink: var(--upi-text);
  --auth-muted: var(--upi-muted);
  --auth-paper: rgba(8, 8, 9, .97);
  --auth-line: var(--upi-line);
}

html[data-theme="dark"] #auth-screen .card {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, rgba(12, 12, 14, .98), rgba(3, 3, 4, .98)) !important;
  color: var(--upi-text) !important;
  box-shadow: 0 32px 72px rgba(0, 0, 0, .68), inset 0 1px 0 rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] #auth-screen :is(.field, .field:focus-within) {
  border-color: var(--upi-line) !important;
  background: var(--upi-card-2) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #auth-screen .field::before {
  background: linear-gradient(145deg, #242426, #163a2c) !important;
}

html[data-theme="dark"] #auth-screen :is(.hd h1, .field input, .abar #auth-online, .abar .right a, .abar .right a strong) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #auth-screen :is(.hd2, .row, .row label, .abar small, .abar-brand) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #auth-screen :is(.abar .mid, .abar .right) {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, rgba(13, 13, 15, .98), rgba(5, 5, 6, .98)) !important;
  color: var(--upi-text) !important;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .54) !important;
}

html[data-theme="light"] #auth-screen :is(.abar .mid, .abar .right, .abar #auth-online, .abar .right a, .abar .right a strong) {
  color: #244e61 !important;
}

html[data-theme="light"] #auth-screen :is(.abar small, .abar-brand) {
  color: #688797 !important;
}

/* Game Pass injetado dinamicamente. */
html[data-theme="dark"] .gp-overlay {
  --gp-ink: #f7f7f8;
  --gp-muted: #b6b7bb;
  --gp-line: rgba(255, 255, 255, .12);
  --gp-blue: #79c9ed;
  --gp-blue-deep: #8bd8e7;
  --gp-green: #69d8ad;
  --gp-green-deep: #7be0b6;
}

html[data-theme="dark"] .gp-dialog {
  border-color: var(--gp-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
  color: var(--gp-ink) !important;
}

html[data-theme="dark"] .gp-dialog :is(.gp-card, .gp-season, .gp-premium-banner, .gp-pass-head, .gp-tier-row, .gp-reward, .gp-pager, .gp-mission, .gp-claim-all) {
  border-color: var(--gp-line) !important;
  background: #0b0b0d !important;
  color: var(--gp-ink) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .gp-dialog :is(.gp-season, .gp-premium-banner, .gp-claim-all, .gp-reward.is-premium) {
  background: linear-gradient(120deg, #151517, #10271f) !important;
}

html[data-theme="dark"] .gp-dialog :is(.gp-tier-row.is-locked, .gp-reward.is-locked, .gp-button.is-secondary, .gp-button.is-claimed, .gp-button.is-locked, .gp-season-state, .gp-premium-icon, .gp-reward-icon) {
  border-color: var(--gp-line) !important;
  background: #151517 !important;
  color: var(--gp-ink) !important;
}

/* Central Social e a fazenda DOM legada. */
html[data-theme="dark"] .sw-overlay {
  --sw-ink: #f7f7f8;
  --sw-muted: #b6b7bb;
  --sw-blue: #79c9ed;
  --sw-green: #69d8ad;
  --sw-deep: #8bd8e7;
  --sw-line: rgba(255, 255, 255, .12);
  --sw-soft: #151517;
}

html[data-theme="dark"] .sw-dialog {
  border-color: var(--sw-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
  color: var(--sw-ink) !important;
}

html[data-theme="dark"] .sw-dialog :is(.sw-tabs, .sw-card, .sw-row, .sw-field, .sw-profile-head, .sw-mon, .sw-point, .sw-spot-top, .sw-world-hero, .sw-buff-product, .sw-buff-target-picker, .sw-private-world, .sw-invite-guide) {
  border-color: var(--sw-line) !important;
  background: #0b0b0d !important;
  color: var(--sw-ink) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .sw-dialog :is(.sw-tab:hover, .sw-tab.is-active, .sw-button.is-secondary, .sw-button.is-danger, .sw-refresh, .sw-private-state, .sw-capacity, .sw-buff-pill) {
  border-color: var(--sw-line) !important;
  background: #151517 !important;
  color: var(--sw-ink) !important;
}

html[data-theme="dark"] .pf-panel .pf-dialog {
  border-color: var(--upi-line) !important;
  background: #050505 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .pf-panel :is(.pf-action, .pf-section, .pf-mon, .pf-field, .pf-btn.secondary, .pf-shop article, .pf-transfer, .pf-bag-panel, .pf-modal-lead, .pf-balance, .pf-back) {
  border-color: var(--upi-line) !important;
  background: #0b0b0d !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .pf-panel :is(.pf-note, .pf-sale small, .pf-selected-item small, .pf-shop p, .pf-shop-meta, .pf-status) {
  color: var(--upi-muted) !important;
}

/* Leilão: superfícies e textos precisam trocar juntos. */
html[data-theme="dark"] #dashboard-screen .pa-overlay {
  background: rgba(0, 0, 0, .92) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-dialog, .pa-card, .pa-listing-row, .pa-sell-panel, .pa-empty, .pa-loading, .pa-details-card, .pa-trade-dialog) {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #050505) !important;
  color: var(--upi-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-media, .pa-pokemon-id, .pa-card-genetics, .pa-iv-stat, .pa-simple-note, .pa-details-data dl > div, .pa-details-media) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen .pa-tab.is-active {
  border-color: rgba(120, 227, 181, .42) !important;
  background: linear-gradient(135deg, #1a1a1d, #10271f) !important;
  color: #f4ffff !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-kind, .pa-card-genetics p, .pa-iv-stat small, .pa-refresh-status, .pa-empty, .pa-loading) {
  color: var(--upi-muted) !important;
}

/* Leilao V84: cobre as fichas geneticas/cartas e a busca avancada adicionadas depois do tema. */
html[data-theme="dark"] #dashboard-screen :is(.pa-genetics, .pa-card-facts, .pa-complete-details, .pa-advanced-filters:not([hidden]), .pa-details-card > footer) {
  border-color: var(--upi-line) !important;
  background: #09090b !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-genetics > header, .pa-card-facts > header) {
  border-color: transparent !important;
  background: transparent !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-iv-stat, .pa-score-strip > span, .pa-card-facts > div > span, .pa-complete-details dl > div, .pa-detail-stat-grid > span, .pa-advanced-filters input, .pa-advanced-filters select, .pa-advanced-actions button, .pa-details-card > footer button) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-genetics > header span, .pa-genetics > header b, .pa-genetics > p strong, .pa-iv-stat b, .pa-score-strip b, .pa-card-facts > header, .pa-card-facts b, .pa-complete-details h4, .pa-complete-details h5, .pa-complete-details dd, .pa-detail-stat-grid b, .pa-advanced-heading span) {
  color: #78e3b5 !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-genetics > p, .pa-genetics > p em, .pa-iv-stat small, .pa-score-strip small, .pa-card-facts small, .pa-complete-details dt, .pa-detail-stat-grid small, .pa-advanced-heading small, .pa-advanced-items p, .pa-advanced-filters label) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .pa-details-data .pa-genetics > p {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
}

html[data-theme="dark"] #dashboard-screen :is(.pa-refresh-status, .pa-iv-badge, .pa-fav) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen .pa-iv-badge em {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .pa-toolbar button {
  border-color: var(--upi-line) !important;
  background-color: #151517 !important;
}

html[data-theme="dark"] #dashboard-screen .pa-advanced-actions button:last-child,
html[data-theme="dark"] #dashboard-screen .pa-toolbar .pa-advanced-toggle.is-active,
html[data-theme="dark"] #dashboard-screen .pa-details-card > footer .pa-primary {
  border-color: rgba(120, 227, 181, .45) !important;
  background: linear-gradient(135deg, #146f66, #168656) !important;
  color: #fff !important;
}

/* Minha Conta usa !important na paleta clara original. */
html[data-theme="dark"] #ac-ov .ac-card {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
  color: var(--upi-text) !important;
  box-shadow: 0 38px 110px rgba(0, 0, 0, .76) !important;
}

html[data-theme="dark"] #ac-ov :is(.ac-hero, .ac-tabs, #ac-body, .ac-row, .ac-section, table, .ac-empty) {
  border-color: var(--upi-line) !important;
  background: #0b0b0d !important;
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #ac-ov :is(.ac-tabs button, input, select, textarea) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #ac-ov .ac-tabs button.on {
  border-color: rgba(120, 227, 181, .4) !important;
  background: linear-gradient(135deg, #1a1a1d, #10271f) !important;
  color: #f4ffff !important;
}

html[data-theme="dark"] #ac-ov :is(h2, h3, .ac-row b, td) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #ac-ov :is(.ac-hero small, .ac-helper, th, .ac-empty) {
  color: var(--upi-muted) !important;
}

/* Detalhes do evento: evita o híbrido card escuro + texto escuro. */
html[data-theme="dark"] #dashboard-screen .upi-event-details-dialog {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
  color: var(--upi-text) !important;
  box-shadow: var(--upi-shadow) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-event-details-head, .upi-event-details-body, .upi-event-scope, .upi-event-details-time, .upi-event-bonus-empty) {
  border-color: var(--upi-line) !important;
  background: #0b0b0d !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-event-details-copy h2, .upi-event-details-section-head h3, .upi-event-scope h3, .upi-event-bonus-copy strong, .upi-event-scope-chip b) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] #dashboard-screen :is(.upi-event-details-copy p, .upi-event-bonus-copy small, .upi-event-scope-chip small, .upi-event-scope > p) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] #dashboard-screen .upi-event-details-actions {
  background: linear-gradient(transparent, #000 28%) !important;
}

/* Loja Pix: quantidade personalizada e resumo permaneciam claros. */
html[data-theme="dark"] .shop-page :is(.custom-buy, .custom-controls) {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #050505) !important;
  color: var(--upi-text) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .shop-page :is(.custom-copy h2, .custom-copy p b, .custom-summary b, .custom-summary strong, #custom-diamond-count) {
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page :is(.custom-copy p, .custom-controls label, .custom-summary small) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] .shop-page :is(.custom-stepper input, .custom-stepper button, .custom-quick button) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page .sheet {
  border-color: var(--upi-line) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
  color: var(--upi-text) !important;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .78) !important;
}

html[data-theme="dark"] .shop-page .sheet :is(input, textarea, .paybtn, .stp button) {
  border-color: var(--upi-line) !important;
  background: #151517 !important;
  color: var(--upi-text) !important;
}

html[data-theme="dark"] .shop-page .sheet :is(.cap, .msg, label, .cl .nm small, .paybtn small) {
  color: var(--upi-muted) !important;
}

html[data-theme="dark"] .shop-page .sheet :is(h2, .cl .nm b, .cart-total, .paybtn b) {
  color: var(--upi-text) !important;
}

/* Maestria era fixa no escuro. No tema claro, o cabeçalho continua como
   acento, enquanto todo o conteúdo passa a usar superfícies claras. */
html[data-theme="light"] #mastery-tree-overlay {
  --mt-ink: #17394d;
  --mt-muted: #688797;
  background: rgba(15, 59, 75, .36) !important;
  color: var(--mt-ink);
}

html[data-theme="light"] .mastery-shell {
  border-color: rgba(47, 159, 166, .3) !important;
  background: linear-gradient(145deg, #f8fdff, #edf9f6) !important;
  box-shadow: 0 28px 90px rgba(16, 66, 84, .26) !important;
}

html[data-theme="light"] .mastery-header {
  color: #fff;
  background: linear-gradient(105deg, #176985, #278c9c 58%, #2d9f78) !important;
}

html[data-theme="light"] .mastery-header :is(.mastery-progress-copy strong, .mastery-title p) {
  color: #e8ffff !important;
}

html[data-theme="light"] .mastery-progress-track {
  background: rgba(7, 52, 67, .64) !important;
}

html[data-theme="light"] :is(.mastery-branch, .mastery-status-card) {
  border-color: rgba(var(--branch-rgb, 76, 215, 192), .3) !important;
  background: linear-gradient(180deg, rgba(var(--branch-rgb, 76, 215, 192), .12), #fff 170px) !important;
  color: var(--mt-ink) !important;
  box-shadow: 0 14px 34px rgba(31, 103, 124, .1) !important;
}

html[data-theme="light"] .mastery-node {
  border-color: rgba(49, 131, 151, .18) !important;
  background: #f8fcfd !important;
  color: var(--mt-ink) !important;
}

html[data-theme="light"] .mastery-node[data-state="purchased"] {
  background: linear-gradient(110deg, rgba(var(--branch-rgb), .15), #f8fcfd) !important;
}

html[data-theme="light"] :is(.mastery-branch-copy h3, .mastery-node-copy strong, .mastery-status-card strong) {
  color: var(--mt-ink) !important;
}

html[data-theme="light"] :is(.mastery-branch-copy p, .mastery-node-copy span, .mastery-node-cost, .mastery-status) {
  color: var(--mt-muted) !important;
}

html[data-theme="light"] .mastery-node-icon {
  background: #e8f5f5 !important;
}

/* Fazenda de produção: versão clara do shell DOM. */
html[data-theme="light"] .pfarm-overlay {
  background: rgba(15, 59, 75, .38) !important;
  color: #17394d !important;
}

html[data-theme="light"] .pfarm-shell {
  border-color: rgba(52, 177, 174, .62) !important;
  background:
    linear-gradient(rgba(248, 253, 255, .95), rgba(238, 250, 247, .97)),
    url('/assets/maps/PlayerFarm/map.webp') center / cover !important;
  box-shadow: 0 30px 90px rgba(18, 72, 88, .28) !important;
}

html[data-theme="light"] .pfarm-layout {
  background: rgba(244, 252, 252, .94) !important;
}

html[data-theme="light"] .pfarm-nav {
  border-color: rgba(48, 147, 159, .16) !important;
  background: rgba(235, 248, 249, .94) !important;
}

html[data-theme="light"] .pfarm-nav button {
  color: #557484 !important;
}

html[data-theme="light"] .pfarm-nav button:hover {
  border-color: rgba(45, 157, 158, .32) !important;
  background: #e0f4f3 !important;
  color: #174f62 !important;
}

html[data-theme="light"] .pfarm-content {
  scrollbar-color: #5bb6b1 #edf7f7;
}

html[data-theme="light"] :is(.pfarm-card, .pfarm-section, .pfarm-plot) {
  border-color: rgba(45, 144, 156, .2) !important;
  background: linear-gradient(145deg, #fff, #eef9f6) !important;
  color: #17394d !important;
  box-shadow: 0 8px 22px rgba(30, 98, 116, .08) !important;
}

html[data-theme="light"] :is(.pfarm-card h3, .pfarm-card h4, .pfarm-section-head h3) {
  color: #17394d !important;
}

html[data-theme="light"] :is(.pfarm-card p, .pfarm-section-head p, .pfarm-stat) {
  color: #688797 !important;
}

html[data-theme="light"] .pfarm-card-icon {
  background: #e5f5f2 !important;
}

html[data-theme="light"] .pfarm-license {
  border-color: rgba(45, 151, 159, .34) !important;
  background: linear-gradient(145deg, #f8fdff, #eef9f6) !important;
  color: #17394d !important;
  box-shadow: 0 30px 90px rgba(18, 72, 88, .28) !important;
}

html[data-theme="light"] .pfarm-license-stat {
  border-color: rgba(45, 151, 159, .18) !important;
  background: #fff !important;
}

html[data-theme="light"] .pfarm-license :is(.pfarm-license-body h2, .pfarm-license-stat strong) {
  color: #17394d !important;
}

html[data-theme="light"] .pfarm-license :is(.pfarm-license-body > p, .pfarm-license-stat small, .pfarm-stock-copy) {
  color: #688797 !important;
}

/* Arena PvP era fixa no escuro. */
html[data-theme="light"] #upi-competition {
  background: rgba(15, 59, 75, .38) !important;
}

html[data-theme="light"] #upi-competition .pcmp-card {
  border-color: rgba(45, 151, 159, .26) !important;
  background: linear-gradient(145deg, #f8fdff, #eef9f6) !important;
  color: #17394d !important;
  box-shadow: 0 28px 80px rgba(18, 72, 88, .28) !important;
}

html[data-theme="light"] #upi-competition .pcmp-hero {
  background: linear-gradient(105deg, #176985, #278c9c 58%, #2d9f78) !important;
  color: #fff !important;
}

html[data-theme="light"] #upi-competition .pcmp-tabs {
  border-color: rgba(45, 151, 159, .16) !important;
}

html[data-theme="light"] #upi-competition .pcmp-tabs button {
  border-color: rgba(45, 151, 159, .18) !important;
  background: #eef8f8 !important;
  color: #557484 !important;
}

html[data-theme="light"] #upi-competition .pcmp-tabs button.on {
  border-color: #42bfa1 !important;
  background: #dff7ee !important;
  color: #176954 !important;
}

html[data-theme="light"] #upi-competition :is(.pcmp-row, .pcmp-side) {
  border-color: rgba(45, 151, 159, .16) !important;
  background: #fff !important;
  color: #17394d !important;
}

html[data-theme="light"] #upi-competition :is(.pcmp-side p, .pcmp-empty) {
  color: #688797 !important;
}

/* Tema OLED: preto real nas grandes superfícies; cor fica reservada para
   foco, progresso, estados e ações pequenas. */
html[data-theme="dark"] :is(.gp-overlay, .sw-overlay, #ac-ov) {
  background: rgba(0, 0, 0, .92) !important;
}

html[data-theme="dark"] #mastery-tree-overlay {
  --mt-ink: #f7f7f8;
  --mt-muted: #b6b7bb;
  --mt-panel: rgba(8, 8, 9, .96);
  --mt-panel-2: rgba(15, 15, 17, .94);
  background: rgba(0, 0, 0, .92) !important;
}

html[data-theme="dark"] .mastery-shell {
  border-color: rgba(255, 255, 255, .14) !important;
  background: linear-gradient(145deg, #050505, #000) !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .82), inset 0 0 0 1px rgba(255, 255, 255, .04) !important;
}

html[data-theme="dark"] .mastery-header {
  border-color: rgba(255, 255, 255, .1) !important;
  background: linear-gradient(105deg, #101012, #050505 58%, #0b1712) !important;
}

html[data-theme="dark"] :is(.mastery-title-icon, .mastery-points, .mastery-close, .mastery-status-card, .mastery-node-icon, .mastery-tooltip) {
  border-color: rgba(255, 255, 255, .12) !important;
  background: #0b0b0d !important;
}

html[data-theme="dark"] .mastery-branch {
  background: linear-gradient(180deg, rgba(var(--branch-rgb), .075), #080809 170px) !important;
}

html[data-theme="dark"] .mastery-node {
  border-color: rgba(255, 255, 255, .11) !important;
  background: #111113 !important;
}

html[data-theme="dark"] .mastery-node[data-state="purchased"] {
  background: linear-gradient(110deg, rgba(var(--branch-rgb), .14), #111113) !important;
}

html[data-theme="dark"] .pfarm-overlay {
  --pf-navy: #000;
  --pf-deep: #050505;
  --pf-panel: #0b0b0d;
  --pf-panel-2: #151517;
  --pf-paper: #f7f7f8;
  --pf-muted: #b6b7bb;
  background: rgba(0, 0, 0, .92) !important;
}

html[data-theme="dark"] .pfarm-shell {
  border-color: rgba(255, 255, 255, .14) !important;
  background:
    linear-gradient(rgba(3, 3, 4, .97), rgba(0, 0, 0, .99)),
    url('/assets/maps/PlayerFarm/map.webp') center / cover !important;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, .9), 0 30px 110px rgba(0, 0, 0, .78), inset 0 1px rgba(255, 255, 255, .08) !important;
}

html[data-theme="dark"] .pfarm-topbar {
  border-color: rgba(255, 255, 255, .1) !important;
  background: linear-gradient(105deg, #101012, #050505 64%, #0b1712) !important;
}

html[data-theme="dark"] :is(.pfarm-brand, .pfarm-wallet, .pfarm-number, .pfarm-icon-button, .pfarm-pill, .pfarm-card-icon, .pfarm-plant, .pfarm-progress, .pfarm-field select, .pfarm-field input, .pfarm-recipe, .pfarm-queue, .pfarm-person, .pfarm-item-row, .pfarm-branch-title, .pfarm-node, .pfarm-check, .pfarm-license-stat, .pfarm-toast) {
  border-color: rgba(255, 255, 255, .12) !important;
  background: #0b0b0d !important;
  color: #f7f7f8 !important;
}

html[data-theme="dark"] .pfarm-nav {
  border-color: rgba(255, 255, 255, .1) !important;
  background: #050505 !important;
}

html[data-theme="dark"] .pfarm-nav button:hover,
html[data-theme="dark"] .pfarm-nav button:focus-visible {
  border-color: rgba(120, 227, 181, .32) !important;
  background: #18181a !important;
}

html[data-theme="dark"] .pfarm-nav button.is-active {
  border-color: rgba(120, 227, 181, .5) !important;
  background: linear-gradient(100deg, #18181a, #10271f) !important;
}

html[data-theme="dark"] .pfarm-content {
  background: #000 !important;
}

html[data-theme="dark"] .pfarm-hero {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .97), rgba(5, 5, 5, .84) 54%, rgba(0, 0, 0, .38)),
    url('/assets/maps/PlayerFarm/map.webp') center 58% / cover !important;
}

html[data-theme="dark"] :is(.pfarm-card, .pfarm-section, .pfarm-plot, .pfarm-berry-choice > span, .pfarm-license) {
  border-color: rgba(255, 255, 255, .12) !important;
  background: linear-gradient(145deg, #111113, #080809) !important;
  color: #f7f7f8 !important;
}

html[data-theme="dark"] .pfarm-license-map {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, .96), rgba(0, 0, 0, .48)),
    url('/assets/maps/PlayerFarm/map.webp') center / cover !important;
}

html[data-theme="dark"] :is(.pfarm-card p, .pfarm-section-head p, .pfarm-stat, .pfarm-field, .pfarm-row-copy span, .pfarm-node p, .pfarm-license-body > p, .pfarm-license-stat small, .pfarm-stock-copy) {
  color: #b6b7bb !important;
}

html[data-theme="dark"] #upi-competition {
  background: rgba(0, 0, 0, .92) !important;
}

html[data-theme="dark"] #upi-competition .pcmp-card {
  border-color: rgba(255, 255, 255, .14) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
  color: #f7f7f8 !important;
  box-shadow: 0 28px 90px rgba(0, 0, 0, .82) !important;
}

html[data-theme="dark"] #upi-competition .pcmp-hero {
  background: linear-gradient(105deg, #151517, #050505 62%, #0b1712) !important;
}

html[data-theme="dark"] #upi-competition :is(.pcmp-tabs button, .pcmp-row, .pcmp-side) {
  border-color: rgba(255, 255, 255, .12) !important;
  background: #0b0b0d !important;
  color: #f7f7f8 !important;
}

html[data-theme="dark"] #upi-competition .pcmp-tabs button.on {
  border-color: rgba(120, 227, 181, .48) !important;
  background: #18181a !important;
  color: #78e3b5 !important;
}

html[data-theme="dark"] #upi-competition :is(p, .pcmp-empty) {
  color: #b6b7bb !important;
}

html[data-theme="dark"] .clan-ui-overlay {
  --cu-ink: #f7f7f8;
  --cu-muted: #b6b7bb;
  --cu-line: rgba(255, 255, 255, .12);
  --cu-soft: #151517;
  background: rgba(0, 0, 0, .92) !important;
}

html[data-theme="dark"] .clan-ui-dialog {
  border-color: rgba(255, 255, 255, .14) !important;
  background: linear-gradient(145deg, #0b0b0d, #000) !important;
}

html[data-theme="dark"] .clan-ui-tabs {
  background: rgba(5, 5, 5, .96) !important;
}

html[data-theme="dark"] :is(.clan-ui-refresh, .clan-ui-card, .clan-ui-input, .clan-ui-button.is-secondary, .clan-ui-button.is-danger, .clan-ui-mission, .clan-ui-member, .clan-ui-account-icon, .clan-ui-bonus-icon, .clan-ui-boss-mark, .clan-ui-avatar, .clan-ui-clan-mark, .clan-ui-logo-preview, .clan-ui-boss-stat, .clan-ui-boss-reward, .clan-ui-next-guardian, .clan-ui-history-entry) {
  border-color: rgba(255, 255, 255, .12) !important;
  background: #0b0b0d !important;
  color: #f7f7f8 !important;
}

html[data-theme="dark"] :is(.clan-ui-create-copy, .clan-ui-boss) {
  background: linear-gradient(145deg, #111113, #080809) !important;
}

html[data-theme="dark"] :is(.clan-ui-tab:hover, .clan-ui-tab:focus-visible, .clan-ui-tab.is-active) {
  border-color: rgba(120, 227, 181, .4) !important;
  background: #18181a !important;
}

html[data-theme="dark"] .clan-ui-progress {
  background: #050505 !important;
}

html[data-theme="dark"] ::selection {
  background: rgba(105, 216, 173, .34);
  color: #fff;
}

@media (max-width: 640px) {
  .upi-theme-toggle,
  #upi-theme-toggle {
    top: 8px;
    right: 8px;
    width: 38px;
    height: 38px;
  }

  #dashboard-screen .tb-right .upi-theme-toggle-inline,
  #dashboard-screen .tb-right #upi-theme-toggle.upi-theme-toggle-inline {
    position: relative;
    inset: auto;
    width: 42px;
    height: 42px;
    flex-basis: 42px;
  }
}
