/* KirSRV theme system — neutral dark palette, lime used only as an accent. */
html[data-theme="light"]{
  color-scheme:light;
  --theme-bg:#f6f8ed;
  --theme-bg-soft:#eef4e3;
  --theme-surface:#fbfcf7;
  --theme-surface-strong:#ffffff;
  --theme-surface-soft:#f0f5e7;
  --theme-ink:#172116;
  --theme-muted:#677161;
  --theme-subtle:#899283;
  --theme-line:rgba(69,99,43,.14);
  --theme-line-strong:rgba(111,157,56,.28);
  --theme-lime:#9cdb38;
  --theme-lime-bright:#c9ef7b;
  --theme-lime-dark:#61982b;
  --theme-accent-soft:rgba(156,219,56,.13);
  --theme-shadow:0 20px 60px rgba(51,77,31,.10);
  --theme-shadow-soft:0 10px 34px rgba(51,77,31,.06);
  --theme-header:rgba(249,251,244,.86);
  --theme-focus:rgba(142,203,49,.38);
}
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#10150f;
  --bg-2:#151c13;
  --surface:#1a2218;
  --surface-2:#202a1e;
  --ink:#f1f4ef;
  --muted:#a0aaa0;
  --line:rgba(235,244,232,.09);
  --deep:#f1f4ef;
  --theme-bg:#10150f;
  --theme-bg-soft:#151c13;
  --theme-surface:#1a2218;
  --theme-surface-strong:#1f291d;
  --theme-surface-soft:#243021;
  --theme-ink:#f1f4ef;
  --theme-muted:#a7b1a4;
  --theme-subtle:#879187;
  --theme-line:rgba(230,242,225,.105);
  --theme-line-strong:rgba(171,224,94,.28);
  --theme-lime:#a6df4e;
  --theme-lime-bright:#c8ef7d;
  --theme-lime-dark:#a6df4e;
  --theme-accent-soft:rgba(166,223,78,.10);
  --theme-shadow:0 24px 72px rgba(2,8,3,.34);
  --theme-shadow-soft:0 12px 38px rgba(2,8,3,.22);
  --theme-header:rgba(20,27,19,.86);
  --theme-focus:rgba(166,223,78,.32);
}

html{background:var(--theme-bg);color:var(--theme-ink)}
body{background:var(--theme-bg);color:var(--theme-ink)}
::selection{background:var(--theme-lime-bright);color:#172116}
:focus-visible{outline-color:var(--theme-focus)}

/* Native View Transition: the new theme unfolds from the round switcher. */
::view-transition-old(root),::view-transition-new(root){animation:none;mix-blend-mode:normal}
::view-transition-old(root){z-index:1}
::view-transition-new(root){z-index:2}
html.theme-reveal-dark::view-transition-new(root),html.theme-reveal-light::view-transition-new(root){animation:theme-reveal .56s cubic-bezier(.2,.75,.2,1) both}
@keyframes theme-reveal{from{clip-path:circle(0 at var(--theme-origin-x) var(--theme-origin-y))}to{clip-path:circle(var(--theme-radius) at var(--theme-origin-x) var(--theme-origin-y))}}
html.theme-is-switching body,
html.theme-is-switching .header__inner,
html.theme-is-switching .portal-body--statistics,
html.theme-is-switching .portal-body--map,
html.theme-is-switching :is(.stats-overview,.server-number-feature,.server-number-card,.players-panel,.map-gate-card,.map-gate-visual),
html.theme-is-switching :is(.portal-card,.card,.portal-tabs,.profile-menu,.profile-btn,.mech-card,.feature-card,.join-panel,.server-card,.side-card,.steps-card,.wiki-card,.wiki-doc-article,.rules-v2-chapter){transition:background-color .38s ease,border-color .38s ease,color .38s ease,box-shadow .38s ease!important}

/* Fixed round theme switcher. */
.theme-toggle{position:fixed;z-index:1100;left:max(18px,env(safe-area-inset-left));bottom:max(18px,env(safe-area-inset-bottom));width:50px;height:50px;padding:0;display:grid;place-items:center;overflow:hidden;border:1px solid var(--theme-line-strong);border-radius:50%;background:color-mix(in srgb,var(--theme-surface-strong) 88%,transparent);color:var(--theme-ink);box-shadow:var(--theme-shadow);backdrop-filter:blur(18px) saturate(1.15);-webkit-backdrop-filter:blur(18px) saturate(1.15);cursor:pointer;isolation:isolate;transition:transform .2s ease,border-color .22s ease,box-shadow .22s ease}
.theme-toggle::before{content:"";position:absolute;inset:4px;border-radius:50%;background:linear-gradient(145deg,color-mix(in srgb,var(--theme-lime) 20%,transparent),transparent 65%);opacity:.75;z-index:-1}
.theme-toggle__halo{position:absolute;width:28px;height:28px;border-radius:50%;background:var(--theme-lime);opacity:.08;filter:blur(7px);transition:opacity .2s ease,transform .25s ease}
.theme-toggle:hover{transform:translateY(-3px) scale(1.03);border-color:color-mix(in srgb,var(--theme-lime) 55%,var(--theme-line));box-shadow:0 17px 42px color-mix(in srgb,var(--theme-lime) 15%,rgba(0,0,0,.18))}
.theme-toggle:hover .theme-toggle__halo{opacity:.18;transform:scale(1.2)}
.theme-toggle:active{transform:scale(.95)}
.theme-toggle svg{grid-area:1/1;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;transition:opacity .2s ease,transform .28s cubic-bezier(.2,.8,.2,1)}
.theme-toggle__moon{opacity:0;transform:rotate(-22deg) scale(.62)}
html[data-theme="dark"] .theme-toggle__sun{opacity:0;transform:rotate(24deg) scale(.62)}
html[data-theme="dark"] .theme-toggle__moon{opacity:1;transform:rotate(0) scale(1)}
@media(max-width:620px){.theme-toggle{left:12px;bottom:12px;width:45px;height:45px}.theme-toggle svg{width:19px;height:19px}}

/* Floating header remains the same component in both themes. */
html[data-theme="dark"] .header__inner{background:rgba(20,24,21,.84)!important;border-color:var(--theme-line)!important;box-shadow:0 12px 38px rgba(0,0,0,.28)!important;backdrop-filter:blur(22px) saturate(1.1)!important;-webkit-backdrop-filter:blur(22px) saturate(1.1)!important}
html[data-theme="dark"] .header.is-scrolled .header__inner{background:rgba(17,21,18,.93)!important;border-color:rgba(235,244,232,.10)!important}
html[data-theme="dark"] .brand{color:var(--theme-ink)}
html[data-theme="dark"] .nav a{color:#cbd2cb}
html[data-theme="dark"] .nav a:hover,html[data-theme="dark"] .nav a[aria-current="page"]{color:var(--theme-lime)}
html[data-theme="dark"] .menu-btn{background:var(--theme-surface-strong);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme="dark"] .mobile-nav{background:rgba(24,29,25,.98);border-color:var(--theme-line);box-shadow:var(--theme-shadow)}
html[data-theme="dark"] .mobile-nav a,html[data-theme="dark"] .mobile-nav button{color:var(--theme-ink)}
html[data-theme="dark"] .mobile-nav a[aria-current="page"]{background:var(--theme-accent-soft);color:var(--theme-lime)}
html[data-theme="dark"] .play-btn{background:linear-gradient(180deg,var(--theme-lime-bright),var(--theme-lime));color:#263d14;border-color:transparent}

/* Home page. */
html[data-theme="dark"] #view-home .hero{background:#0f140f}
html[data-theme="dark"] #view-home .hero__bg{filter:saturate(.78) brightness(.48) contrast(1.08)}
html[data-theme="dark"] #view-home .hero__wash{background:linear-gradient(90deg,rgba(15,20,15,.98) 0%,rgba(15,20,15,.93) 27%,rgba(15,20,15,.65) 48%,rgba(15,20,15,.24) 73%,rgba(15,20,15,.07) 100%),linear-gradient(180deg,transparent,rgba(0,0,0,.26))!important}
html[data-theme="dark"] #view-home .hero__glow{background:radial-gradient(circle,rgba(166,223,78,.16),transparent 64%)}
html[data-theme="dark"] .hero h1,html[data-theme="dark"] .section-head h2{color:var(--theme-ink)}
html[data-theme="dark"] :is(.hero__lead,.section-head p,.social-label){color:var(--theme-muted)}
html[data-theme="dark"] :is(.hero__tag,.badge,.ip-card,.socials a,.social-chip,.outline-btn){background:rgba(26,31,27,.82);border-color:var(--theme-line);color:#e3e8e2;box-shadow:var(--theme-shadow-soft)}
html[data-theme="dark"] .ip-card small{color:var(--theme-subtle)}
html[data-theme="dark"] .ip-card strong{color:var(--theme-ink)}
html[data-theme="dark"] .scroll-cue{color:#9aa49a}
html[data-theme="dark"] .home-section{background:radial-gradient(circle at 8% 12%,rgba(166,223,78,.08),transparent 28rem),#0f1310}
html[data-theme="dark"] :is(.mech-card,.feature-card,.join-panel,.server-card,.side-card,.steps-card,.help-card,.map-card){background:linear-gradient(145deg,#181d19,#131714);border-color:var(--theme-line);color:var(--theme-ink);box-shadow:var(--theme-shadow-soft)}
html[data-theme="dark"] .mech-card__img{background:linear-gradient(180deg,#202621,#171c18)}
html[data-theme="dark"] :is(.mech-card__desc,.feature-card p,.step p,.info-row span,.server-card p){color:var(--theme-muted)}
html[data-theme="dark"] :is(.step--compact,.wiki-clean-start__steps .step){background:rgba(29,34,30,.76);border-color:var(--theme-line)}
html[data-theme="dark"] .footer{background:#0c100c;color:#e0e5df;border-color:var(--theme-line)}
html[data-theme="dark"] :is(.footer__copy,.footer__meta,.footer__links a){color:#929c93}

/* Wiki and rules retain the KirSRV composition; only materials and contrast change. */
html[data-theme="dark"] :is(.wiki-hero,.wiki-clean-hero,.wiki-hub-hero,.wiki-doc-hero,.docs-hero,.rules-hero-v2){background-color:#111711;color:var(--theme-ink)}
html[data-theme="dark"] :is(.wiki-hero__bg,.docs-hero__bg){filter:brightness(.48) saturate(.72)}
html[data-theme="dark"] :is(.wiki-hero__wash,.docs-hero__wash){background:linear-gradient(90deg,rgba(17,23,17,.96),rgba(17,23,17,.76) 48%,rgba(17,23,17,.25))}
html[data-theme="dark"] :is(.wiki-clean-content,.wiki-hub-content,.wiki-doc-shell,.docs-layout,.rules-v2-content,.rules-layout){background:var(--theme-bg);color:var(--theme-ink)}
html[data-theme="dark"] :is(.wiki-card,.wiki-card--large,.wiki-clean-sidebar__card,.wiki-clean-reader,.wiki-clean-start,.wiki-clean-world,.wiki-mech-card,.wiki-page-panel,.wiki-sidebar-card,.wiki-reader__article,.wiki-reading-card,.wiki-ref-card,.wiki-command-card,.wiki-fact-link,.wiki-faq-v2,.wiki-start-v2,.wiki-world-v2,.wiki-doc-sidebar,.wiki-doc-article,.wiki-doc-section,.rules-v2-sidebar__card,.rules-v2-chapter,.rules-v2-note,.rules-v2-contact,.aside-box,.info-box,.rules-v2-item,.rules-v2-sidebar__help){background:var(--theme-surface)!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important;box-shadow:var(--theme-shadow-soft)}
html[data-theme="dark"] :is(.wiki-clean-search,.wiki-hub-search,.wiki-doc-search,.wiki-search-hero,.wiki-search-results,.wiki-doc-search-results){background:var(--theme-surface-strong);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme="dark"] :is(.wiki-sidebar-nav a,.wiki-doc-sidebar a,.rules-v2-nav a,.rule-nav a){color:#acb5ad}
html[data-theme="dark"] :is(.wiki-sidebar-nav a:hover,.wiki-sidebar-nav a.active,.wiki-doc-sidebar a:hover,.wiki-doc-sidebar a.active,.rules-v2-nav a:hover,.rules-v2-nav a.active){background:var(--theme-accent-soft);color:var(--theme-lime)}
html[data-theme="dark"] :is(.wiki-card p,.wiki-clean-reader p,.wiki-doc-article p,.wiki-doc-section p,.rules-v2-item p,.rules-v2-chapter p,.rules-hero-v2 p,.wiki-article-lead){color:var(--theme-muted)!important}
html[data-theme="dark"] :is(.wiki-breadcrumbs,.wiki-reader__meta,.wiki-clean-label,.wiki-sidebar-label,.rules-v2-label){color:var(--theme-subtle)}
html[data-theme="dark"] :is(.wiki-doc-pager a,.wiki-copy-link,.wiki-back,.wiki-reader-back,.wiki-action-row a,.wiki-inline-actions a){background:var(--theme-surface-strong);border-color:var(--theme-line);color:var(--theme-ink)}

/* Portal/account surfaces. */
html[data-theme="dark"]{
  --portal-bg:#10150f;--portal-panel:#1a2218;--portal-line:rgba(230,242,225,.105);--portal-text:#f1f4ef;
  --portal-muted:#a7b1a4;--portal-lime:#a6df4e;--portal-green:#8cc63e;--portal-shadow:0 24px 72px rgba(2,8,3,.32);
  --dash-bg:#10150f;--dash-card:#1a2218;--dash-ink:#f1f4ef;--dash-muted:#a7b1a4;--dash-line:rgba(230,242,225,.105);
  --dash-lime:#a6df4e;--dash-green:#8cc63e;--dash-dark:#f1f4ef;--dash-shadow:0 24px 72px rgba(2,8,3,.32);
}
html[data-theme="dark"] .portal-body{background:radial-gradient(circle at 12% 14%,rgba(166,223,78,.08),transparent 31rem),linear-gradient(180deg,#151c13,#0f140f);color:var(--portal-text)}
html[data-theme="dark"] .portal-body .header{background:transparent!important}
html[data-theme="dark"] :is(.portal-card,.card,.portal-tabs,.link-gate__card){background:rgba(27,35,25,.94)!important;border-color:var(--portal-line)!important;color:var(--portal-text)!important;box-shadow:var(--portal-shadow)!important}
html[data-theme="dark"] .portal-tabs a{color:#adb6ae}
html[data-theme="dark"] .portal-tabs a:hover,html[data-theme="dark"] .portal-tabs a.active{background:var(--theme-accent-soft);color:var(--theme-lime)}
html[data-theme="dark"] .portal-flash{background:var(--theme-surface-strong);border-color:var(--portal-line);color:var(--portal-text)}
html[data-theme="dark"] .portal-flash.success{background:#172319;color:#bfe594}
html[data-theme="dark"] .portal-flash.error{background:#2a1716;color:#f0aaa0}
html[data-theme="dark"] :is(.field input,.field textarea,.field select,.search input,.search select,.wall-compose textarea,.comment-compose textarea){background:#141b13!important;border-color:var(--portal-line)!important;color:var(--portal-text)!important}
html[data-theme="dark"] :is(.list-item,.wall-post,.profile-comment,.activity-summary div,.stat-tile,.identity-mini){background:#182018!important;border-color:var(--portal-line)!important;color:var(--portal-text)!important}
html[data-theme="dark"] :is(.secret-box,.admin-note,.link-gate__steps,.clean-state,.activity-bottom div,.heatmap-wrap){background:#161d15!important;border-color:var(--portal-line)!important;color:#cbd3cc!important}
html[data-theme="dark"] .profile-hero{background:linear-gradient(120deg,rgba(166,223,78,.13),rgba(75,111,69,.07) 45%,transparent),repeating-linear-gradient(45deg,rgba(238,247,234,.035) 0 1px,transparent 1px 15px),#141815}
html[data-theme="dark"] .profile-hero__head{border-color:#202620;background:#202620}
html[data-theme="dark"] .presence-pill{background:rgba(18,24,18,.82);color:#a1aaa2}
html[data-theme="dark"] .heatmap i{background:#242a25}
html[data-theme="dark"] .heatmap i.l1{background:#293524}html[data-theme="dark"] .heatmap i.l2{background:#3d592d}html[data-theme="dark"] .heatmap i.l3{background:#639735}html[data-theme="dark"] .heatmap i.l4{background:#a6df4e}
html[data-theme="dark"] .punishment{background:#2a1716;border-color:#65312b;color:#f0c2bc}
html[data-theme="dark"] .btn{background:var(--theme-surface-strong);border-color:var(--portal-line);color:var(--portal-text)}
html[data-theme="dark"] .btn.primary{background:linear-gradient(135deg,var(--theme-lime-bright),var(--theme-lime));color:#263d14}
html[data-theme="dark"] .btn.danger{background:#2d1715;color:#edaba2}

/* Profile button/dropdown. */
html[data-theme="dark"] .profile-btn{background:rgba(25,30,26,.9);border-color:var(--theme-line);color:var(--theme-ink);box-shadow:0 10px 28px rgba(0,0,0,.24)}
html[data-theme="dark"] :is(.profile-btn__head,.profile-btn__empty){background:var(--theme-surface-soft);border-color:var(--theme-line)}
html[data-theme="dark"] .profile-menu{background:#1a2218!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important;box-shadow:0 24px 64px rgba(0,0,0,.42)!important}
html[data-theme="dark"] :is(.profile-menu__who,.profile-menu__divider){border-color:var(--theme-line)!important}
html[data-theme="dark"] :is(.profile-menu__who small,.profile-menu__who span){color:var(--theme-subtle)!important}
html[data-theme="dark"] .profile-menu__item{color:#dfe5df!important}
html[data-theme="dark"] .profile-menu__item:hover{background:var(--theme-accent-soft)!important}
html[data-theme="dark"] .profile-menu__item.is-disabled{color:#737d75!important}

/* Generic fallback UI. */
html[data-theme="dark"] body.mauth-ui{background:radial-gradient(circle at 10% 8%,rgba(166,223,78,.08),transparent 30rem),var(--dash-bg);color:var(--dash-ink)}
html[data-theme="dark"] :is(.app-top,.side,.login-card,.table-wrap){background:var(--theme-surface)!important;border-color:var(--dash-line)!important;color:var(--dash-ink)!important}
html[data-theme="dark"] :is(.user-pill,.list-item,.field input,.field select,.field textarea,.search input){background:#141b13;color:var(--theme-ink);border-color:var(--dash-line)}

@media(prefers-reduced-motion:reduce){
  ::view-transition-old(root),::view-transition-new(root){animation:none!important}
  .theme-toggle,.theme-toggle *{transition:none!important}
}

/* v1.6.0 — dark-theme hardening across the whole KirSRV surface.
   Goal: preserve the original KirSRV visual hierarchy instead of tinting light cards. */
html[data-theme="dark"]{
  --bg:#0d110e;
  --bg-2:#111712;
  --surface:#171d18;
  --surface-2:#1d251f;
  --ink:#f2f5f0;
  --muted:#a9b2a8;
  --line:rgba(231,241,228,.10);
  --theme-bg:#0d110e;
  --theme-bg-soft:#111712;
  --theme-surface:#171d18;
  --theme-surface-strong:#1b221c;
  --theme-surface-soft:#202920;
  --theme-ink:#f2f5f0;
  --theme-muted:#a9b2a8;
  --theme-subtle:#858f86;
  --theme-line:rgba(231,241,228,.10);
  --theme-line-strong:rgba(168,220,91,.27);
  --theme-lime:#a4df45;
  --theme-lime-bright:#c9ef7d;
  --theme-lime-dark:#a4df45;
  --theme-accent-soft:rgba(164,223,69,.105);
  --theme-shadow:0 24px 72px rgba(0,0,0,.34);
  --theme-shadow-soft:0 12px 38px rgba(0,0,0,.20);
  --theme-header:rgba(18,23,19,.88);
}

/* Home: all compact cards must actually become dark, including selectors that use !important in styles.css. */
html[data-theme="dark"] #view-home .project-chip{
  background:linear-gradient(180deg,rgba(29,37,29,.92),rgba(21,28,22,.92))!important;
  border-color:rgba(180,224,111,.18)!important;
  color:var(--theme-ink)!important;
  box-shadow:0 10px 28px rgba(0,0,0,.22)!important;
}
html[data-theme="dark"] #view-home .project-chip__copy strong{color:var(--theme-lime)!important}
html[data-theme="dark"] #view-home .project-chip__copy small{color:#a1aca1!important}
html[data-theme="dark"] #view-home .socials--brand .social-chip{
  background:linear-gradient(180deg,rgba(29,36,30,.94),rgba(21,27,22,.94))!important;
  border-color:var(--theme-line)!important;
  color:#e9eee8!important;
  box-shadow:0 8px 24px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] #view-home .socials--brand .social-chip:hover{
  background:linear-gradient(180deg,rgba(35,44,35,.98),rgba(25,32,26,.98))!important;
  border-color:color-mix(in srgb,var(--social-accent) 45%,var(--theme-line))!important;
  box-shadow:0 13px 34px rgba(0,0,0,.25)!important;
}
html[data-theme="dark"] #view-home .social-chip__icon{
  background:rgba(234,243,231,.055)!important;
  color:#d9e2d7!important;
}
html[data-theme="dark"] #view-home .social-chip__copy strong{color:#eef2ed!important}
html[data-theme="dark"] #view-home .social-chip__copy small{color:#9aa59b!important}
html[data-theme="dark"] #view-home .social-chip__arrow{color:#b7c1b6!important}
html[data-theme="dark"] #view-home .core-ui{
  background:rgba(24,31,25,.86)!important;
  border-color:var(--theme-line)!important;
  box-shadow:0 12px 32px rgba(0,0,0,.18)!important;
}
html[data-theme="dark"] #view-home .progress{background:#2a322b!important}
html[data-theme="dark"] #view-home :is(.mini-btn,.server-card__actions button,.server-card__actions a){
  background:#1b221c!important;
  border-color:var(--theme-line)!important;
  color:#e8ede7!important;
}
html[data-theme="dark"] #view-home :is(.mini-btn.primary,.server-card__actions .primary){
  background:linear-gradient(180deg,var(--theme-lime-bright),var(--theme-lime))!important;
  color:#263d14!important;
  border-color:transparent!important;
}
html[data-theme="dark"] #view-home .step__n{
  background:rgba(164,223,69,.09)!important;
  border-color:rgba(164,223,69,.23)!important;
  color:var(--theme-lime)!important;
}

/* Footer: remove the light grey slab and make every nested action readable. */
html[data-theme="dark"] .footer--rich{
  background:linear-gradient(180deg,#0d110e 0%,#0a0e0b 100%)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] .footer__inner--rich{
  background:linear-gradient(145deg,rgba(26,33,27,.96),rgba(18,24,19,.96))!important;
  border-color:var(--theme-line)!important;
  box-shadow:0 18px 55px rgba(0,0,0,.24)!important;
  color:var(--theme-ink)!important;
}
html[data-theme="dark"] .footer__brand-block p{color:var(--theme-muted)!important}
html[data-theme="dark"] .footer__meta{
  background:rgba(164,223,69,.10)!important;
  color:#b8e674!important;
}
html[data-theme="dark"] .footer__title{color:#8f9a90!important}
html[data-theme="dark"] .footer__links a{color:#c9d1c8!important}
html[data-theme="dark"] .footer__links a:hover{color:var(--theme-lime)!important}
html[data-theme="dark"] .footer__server{
  background:linear-gradient(135deg,#1c251d,#162017)!important;
  border-color:var(--theme-line)!important;
  color:#edf2eb!important;
  box-shadow:none!important;
}
html[data-theme="dark"] .footer__server small{color:#95a095!important}
html[data-theme="dark"] .footer-social,
html[data-theme="dark"] .footer__social-mini a{
  background:#1c231d!important;
  border-color:var(--theme-line)!important;
  color:#d9e0d8!important;
}
html[data-theme="dark"] .footer-social:hover,
html[data-theme="dark"] .footer__social-mini a:hover{
  background:#242d25!important;
  border-color:color-mix(in srgb,var(--footer-social, var(--theme-lime)) 42%,var(--theme-line))!important;
}
html[data-theme="dark"] .footer-social__icon{
  background:color-mix(in srgb,var(--footer-social) 14%,#202720)!important;
}
html[data-theme="dark"] .footer__bottom{color:#7f8a80!important}

/* Dialogs / mechanics / play modal. */
html[data-theme="dark"] dialog,
html[data-theme="dark"] dialog[data-type="play"]{
  background:linear-gradient(145deg,#1b221c,#141a15)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-ink)!important;
  box-shadow:0 34px 110px rgba(0,0,0,.52)!important;
}
html[data-theme="dark"] dialog::backdrop{background:rgba(4,7,5,.66)!important;backdrop-filter:blur(8px)}
html[data-theme="dark"] dialog .dialog-head{border-color:var(--theme-line)!important}
html[data-theme="dark"] dialog .dialog-head h3{color:var(--theme-ink)!important}
html[data-theme="dark"] dialog .dialog-body{color:#abb5aa!important}
html[data-theme="dark"] dialog .dialog-close,
html[data-theme="dark"] dialog .dialog-actions :is(button,a){
  background:#202821!important;
  border-color:var(--theme-line)!important;
  color:#eef2ed!important;
}
html[data-theme="dark"] dialog .dialog-close:hover,
html[data-theme="dark"] dialog .dialog-actions :is(button,a):hover{background:#283229!important}
html[data-theme="dark"] dialog .dialog-actions .primary{background:linear-gradient(180deg,var(--theme-lime-bright),var(--theme-lime))!important;color:#263d14!important;border-color:transparent!important}
html[data-theme="dark"] .play-modal__pill{
  background:#202821!important;
  border-color:var(--theme-line)!important;
  color:#b4beb3!important;
}
html[data-theme="dark"] .play-modal__server{
  background:linear-gradient(135deg,#202a21,#182019)!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] .play-modal__server small{color:#909b91!important}
html[data-theme="dark"] .play-modal__server strong{color:#f0f4ef!important}
html[data-theme="dark"] .play-modal__version{color:#aeb8ad!important}
html[data-theme="dark"] .play-modal__step{
  background:#1d251e!important;
  border-color:var(--theme-line)!important;
}
html[data-theme="dark"] .play-modal__step span{
  background:rgba(164,223,69,.10)!important;
  border-color:rgba(164,223,69,.22)!important;
  color:var(--theme-lime)!important;
}
html[data-theme="dark"] .play-modal__step strong{color:#e9eeE8!important}
html[data-theme="dark"] .play-modal__step small{color:#96a197!important}
html[data-theme="dark"] .play-modal__actions a{background:#202821!important;color:#e8ede7!important}

/* Wiki: dark mode must cover the entire page, not only the reader card. */
html[data-theme="dark"] #view-wiki{
  background:radial-gradient(circle at 78% 8%,rgba(164,223,69,.07),transparent 28rem),linear-gradient(180deg,#0e130f,#0b100c)!important;
  color:var(--theme-ink)!important;
}
html[data-theme="dark"] #view-wiki .wiki-doc-hero{
  background:radial-gradient(circle at 78% 8%,rgba(164,223,69,.10),transparent 28%),linear-gradient(180deg,#141b15,#0f140f)!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-ink)!important;
}
html[data-theme="dark"] #view-wiki .wiki-doc-hero h1{color:var(--theme-ink)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-hero h1 span{color:var(--theme-lime)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-hero p{color:var(--theme-muted)!important}
html[data-theme="dark"] #view-wiki :is(.wiki-doc-search,.wiki-doc-search-results,.wiki-doc-search-wrap kbd,.wiki-doc-mobile-toggle){
  background:#1a221b!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-ink)!important;
  box-shadow:var(--theme-shadow-soft)!important;
}
html[data-theme="dark"] #view-wiki .wiki-doc-search input{color:var(--theme-ink)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-search input::placeholder{color:#7f8a80!important}
html[data-theme="dark"] #view-wiki .wiki-doc-search-wrap>small{color:#7f8a80!important}
html[data-theme="dark"] #view-wiki .wiki-doc-search-results a{color:#dce3da!important}
html[data-theme="dark"] #view-wiki .wiki-doc-search-results a:hover{background:var(--theme-accent-soft)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-search-results small{color:#8d978e!important}
html[data-theme="dark"] #view-wiki .wiki-doc-shell{background:transparent!important;color:var(--theme-ink)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-sidebar{
  background:rgba(23,30,24,.94)!important;
  border-color:var(--theme-line)!important;
  box-shadow:0 12px 34px rgba(0,0,0,.16)!important;
}
html[data-theme="dark"] #view-wiki .wiki-doc-sidebar__head{color:#899489!important}
html[data-theme="dark"] #view-wiki .wiki-doc-group{border-color:var(--theme-line)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-group summary{color:#9fa9a0!important}
html[data-theme="dark"] #view-wiki .wiki-doc-group a{color:#cbd3ca!important}
html[data-theme="dark"] #view-wiki .wiki-doc-group a:hover{background:#202921!important;color:#edf2eb!important}
html[data-theme="dark"] #view-wiki .wiki-doc-group a.active{background:rgba(164,223,69,.11)!important;color:var(--theme-lime)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-article{
  background:#171d18!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-ink)!important;
  box-shadow:0 20px 58px rgba(0,0,0,.19)!important;
}
html[data-theme="dark"] #view-wiki .wiki-doc-article__head{border-color:var(--theme-line)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-article :is(h2,h3,strong,b){color:var(--theme-ink)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-article :is(p,.wiki-doc-article__head p){color:var(--theme-muted)!important}
html[data-theme="dark"] #view-wiki .wiki-doc-section{
  background:transparent!important;
  border-color:var(--theme-line)!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #view-wiki .wiki-doc-cover{background:#202821!important}
html[data-theme="dark"] #view-wiki :is(.wiki-copy-link,.wiki-doc-pager a,.wiki-fact-grid>div,.wiki-fact-grid>a,.wiki-social-action,.wiki-action-row .wiki-discord-action){
  background:#1d251e!important;
  border-color:var(--theme-line)!important;
  color:#e7ece6!important;
  box-shadow:none!important;
}
html[data-theme="dark"] #view-wiki :is(.wiki-copy-link,.wiki-doc-pager a,.wiki-fact-grid>a,.wiki-social-action,.wiki-action-row .wiki-discord-action):hover{
  background:#252f26!important;
  border-color:rgba(164,223,69,.24)!important;
}
html[data-theme="dark"] #view-wiki :is(.wiki-fact-grid span,.wiki-doc-pager small,.wiki-social-action__copy small,.wiki-doc-toc>span,.wiki-doc-toc a){color:#899489!important}
html[data-theme="dark"] #view-wiki .wiki-social-action__icon,
html[data-theme="dark"] #view-wiki .wiki-social-action__arrow{
  background:#252e26!important;
  color:#c4cec3!important;
}
html[data-theme="dark"] #view-wiki .wiki-social-action--discord:hover .wiki-social-action__icon{background:rgba(88,101,242,.17)!important;color:#8d97ff!important}
html[data-theme="dark"] #view-wiki .wiki-social-action--telegram:hover .wiki-social-action__icon{background:rgba(34,158,217,.15)!important;color:#67c3ef!important}
html[data-theme="dark"] #view-wiki .wiki-social-action--tiktok:hover .wiki-social-action__icon{background:#252a26!important;color:#f0f3ef!important}

/* Rules: keep the image hero, but make the page and every utility card consistently dark. */
html[data-theme="dark"] #view-rules{background:#0d110e!important;color:var(--theme-ink)!important}
html[data-theme="dark"] #view-rules .rules-hero-v2{background:#0f140f!important;border-color:var(--theme-line)!important}
html[data-theme="dark"] #view-rules .docs-hero__bg{filter:saturate(.74) brightness(.44) contrast(1.08)!important}
html[data-theme="dark"] #view-rules .docs-hero__wash{background:linear-gradient(90deg,rgba(13,18,14,.94),rgba(13,18,14,.73) 48%,rgba(13,18,14,.24))!important}
html[data-theme="dark"] #view-rules .rules-hero-v2 h1{color:var(--theme-ink)!important}
html[data-theme="dark"] #view-rules .rules-hero-v2 p{color:#aab4aa!important}
html[data-theme="dark"] #view-rules :is(.rules-hero-v2__meta span,.rules-hero-v2__meta a){
  background:rgba(27,35,28,.88)!important;
  border-color:var(--theme-line)!important;
  color:#dfe6dd!important;
}
html[data-theme="dark"] #view-rules .rules-v2-layout{color:var(--theme-ink)!important}
html[data-theme="dark"] #view-rules .rules-v2-sidebar__card,
html[data-theme="dark"] #view-rules .rules-v2-sidebar__help,
html[data-theme="dark"] #view-rules .rules-v2-note,
html[data-theme="dark"] #view-rules .rules-v2-chapter,
html[data-theme="dark"] #view-rules .rules-v2-item{
  background:#171d18!important;
  border-color:var(--theme-line)!important;
  color:var(--theme-ink)!important;
  box-shadow:var(--theme-shadow-soft)!important;
}
html[data-theme="dark"] #view-rules .rules-v2-sidebar__help{background:linear-gradient(145deg,#192119,#141a15)!important}
html[data-theme="dark"] #view-rules .rules-v2-sidebar__help p{color:#9ca69c!important}
html[data-theme="dark"] #view-rules .rules-v2-sidebar__help a{
  background:#202821!important;
  border-color:var(--theme-line)!important;
  color:#dfe5de!important;
}
html[data-theme="dark"] #view-rules .rules-v2-nav a{color:#c2cbc1!important}
html[data-theme="dark"] #view-rules .rules-v2-nav a:hover,
html[data-theme="dark"] #view-rules .rules-v2-nav a.active{background:var(--theme-accent-soft)!important;color:var(--theme-lime)!important}
html[data-theme="dark"] #view-rules .rules-v2-note{background:linear-gradient(135deg,rgba(164,223,69,.08),#171d18 55%)!important}
html[data-theme="dark"] #view-rules :is(.rules-v2-chapter__head p,.rules-v2-item p,.rules-v2-contact p){color:#a2aca2!important}
html[data-theme="dark"] #view-rules .rules-v2-chapter__head>span,
html[data-theme="dark"] #view-rules .rules-v2-item>span{
  background:rgba(164,223,69,.09)!important;
  border-color:rgba(164,223,69,.20)!important;
  color:var(--theme-lime)!important;
}
html[data-theme="dark"] #view-rules .rules-v2-chapter--danger{
  background:linear-gradient(145deg,rgba(104,39,34,.16),#171d18 58%)!important;
  border-color:rgba(224,101,88,.22)!important;
}
html[data-theme="dark"] #view-rules .rules-v2-chapter--danger .rules-v2-chapter__head>span,
html[data-theme="dark"] #view-rules .rules-v2-chapter--danger .rules-v2-item>span{
  background:rgba(216,92,78,.11)!important;
  border-color:rgba(216,92,78,.22)!important;
  color:#e7867a!important;
}
html[data-theme="dark"] #view-rules .rules-v2-measures span{
  background:#1d251e!important;
  border-color:var(--theme-line)!important;
  color:#c8d0c7!important;
}
html[data-theme="dark"] #view-rules .rules-v2-chapter--final{background:linear-gradient(145deg,rgba(164,223,69,.055),#171d18 58%)!important}
html[data-theme="dark"] #view-rules .rules-v2-contact{background:#101a11!important;border:1px solid rgba(164,223,69,.13)!important}

/* Profile dropdown and account UI: fix unreadable pale accent states and remaining light utility surfaces. */
html[data-theme="dark"] .profile-menu__item--accent{
  background:rgba(164,223,69,.11)!important;
  color:#b9e974!important;
}
html[data-theme="dark"] .profile-menu__item--accent:hover{background:rgba(164,223,69,.17)!important}
html[data-theme="dark"] .profile-menu__item--accent span:first-child{color:#a9e05a!important}
html[data-theme="dark"] :is(.portal-body .tag,.mauth-ui .tag){background:#202821!important;color:#cbd3ca!important}
html[data-theme="dark"] :is(.portal-body .tag.gray,.mauth-ui .tag.gray){background:#202520!important;color:#9fa99f!important}
html[data-theme="dark"] :is(.portal-body .tag.red,.mauth-ui .tag.red){background:#2b1817!important;color:#eaa298!important}
html[data-theme="dark"] :is(.portal-body .tag.dark,.mauth-ui .tag.dark){background:#0f1710!important;color:#bde584!important}
html[data-theme="dark"] .portal-body .link-gate__telegram{background:#202b20!important;color:#b6e579!important}
html[data-theme="dark"] .portal-body .link-gate__step span{background:rgba(164,223,69,.10)!important;color:var(--theme-lime)!important}
html[data-theme="dark"] .portal-body .platform-badge{background:rgba(164,223,69,.10)!important;color:#b6e571!important}
html[data-theme="dark"] .portal-body .clean-state__icon{background:rgba(164,223,69,.10)!important;color:var(--theme-lime)!important}
html[data-theme="dark"] .portal-body :is(.complaint-status,.complaint-status.RESOLVED){background:#1e2b1c!important;color:#9fd36b!important}
html[data-theme="dark"] .portal-body .complaint-status.OPEN{background:#2b2516!important;color:#d8bc68!important}
html[data-theme="dark"] .portal-body .complaint-status.IN_REVIEW{background:#172532!important;color:#86b7e4!important}
html[data-theme="dark"] .portal-body .complaint-status.REJECTED{background:#2a1917!important;color:#e69a91!important}
html[data-theme="dark"] :is(.mauth-ui,.portal-body) :is(.table-wrap,.login-card,.side,.card){background:#171d18!important;border-color:var(--theme-line)!important;color:var(--theme-ink)!important}
html[data-theme="dark"] :is(.mauth-ui,.portal-body) .table th{background:#202821!important;color:#c7d0c6!important}
html[data-theme="dark"] :is(.mauth-ui,.portal-body) .hero-login{background:linear-gradient(135deg,rgba(14,18,15,.93),rgba(17,23,18,.96)),url('../images/home-hero-emerald-ruins.webp') center/cover!important}
html[data-theme="dark"] .portal-body .hero-login .login-card p{color:#9ea89f!important}

/* Small consistency fixes for placeholders, disabled states and selection controls. */
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder{color:#747f75!important}
html[data-theme="dark"] select{color-scheme:dark}
html[data-theme="dark"] :disabled{opacity:.56}

/* v1.6.0 follow-up: no light islands between home sections. */
html[data-theme="dark"] #view-home .join-section{
  background:radial-gradient(circle at 82% 18%,rgba(164,223,69,.055),transparent 24rem),#0f1310!important;
}
html[data-theme="dark"] #view-home .map-card{
  box-shadow:inset 0 0 0 1px var(--theme-line),0 16px 46px rgba(0,0,0,.20)!important;
}
