/* The four palettes are shared by every page, including dialogs and admin. */
:root,[data-theme=gray],.theme-demo{--bg:#202226;--panel:#2b2e33;--panel2:#353940;--text:#f2f3f5;--muted:#b8bdc7;--line:#525864;--accent:#ff7880;--accent-hover:#ff9399;--soft:#3e252c;--header:#202226f5;--on-accent:#230307;--error:#ffabb0;color-scheme:dark}
:root[data-theme=oled],.theme-demo[data-preview-theme=oled]{--bg:#000000;--panel:#070707;--panel2:#121212;--text:#f1f2f2;--muted:#a5a8ad;--line:#303237;--accent:#ff6b72;--accent-hover:#ff858b;--soft:#23090c;--header:#000000f5;--on-accent:#100003;--error:#ff858b;color-scheme:dark}
:root[data-theme=white],.theme-demo[data-preview-theme=white]{--bg:#ffffff;--panel:#f6f7f9;--panel2:#e9ecf0;--text:#1b2028;--muted:#535d6c;--line:#c6cdd7;--accent:#b82030;--accent-hover:#941927;--soft:#fdebef;--header:#fffffff5;--on-accent:#ffffff;--error:#a4172a;color-scheme:light}
:root[data-theme=tactical],.theme-demo[data-preview-theme=tactical]{--bg:#161b15;--panel:#20271c;--panel2:#2c3525;--text:#e7ebdf;--muted:#b0bda3;--line:#4c5a40;--accent:#b5ce89;--accent-hover:#cbdfa8;--soft:#303d24;--header:#161b15f5;--on-accent:#15200a;--error:#ffb4a6;color-scheme:dark}
body{background:var(--bg);color:var(--text)}
.button{color:var(--on-accent)}.button.outline{color:var(--text)}
.account-error,.field-error,.admin-main .form-error,.danger{color:var(--error)!important}
.hero .button.outline{color:#f1f2f2;border-color:#7d8286}.hero .button.outline:hover{background:#202226}
.hero h1 span,.hero-meta:before{color:var(--accent)}
:root[data-theme=white] .hero h1 span,:root[data-theme=white] .hero-meta:before{color:#ff7880}
:root[data-theme=oled] .featured-game{background:#070707}
:root[data-theme=tactical] .header{border-bottom-color:var(--accent)}
:root[data-theme=tactical] .eyebrow,:root[data-theme=tactical] .tag{letter-spacing:1.6px}
input,select,textarea{accent-color:var(--accent)}
input:-webkit-autofill{-webkit-text-fill-color:var(--text);box-shadow:0 0 0 1000px var(--panel2) inset}
.appearance-card{margin:24px 0;scroll-margin-top:24px}
.appearance-heading{display:flex;justify-content:space-between;align-items:start;gap:20px}
.appearance-heading h2{margin:10px 0}
.appearance-heading>span{font:11px monospace;color:var(--muted);white-space:nowrap;margin-top:7px}
.theme-options{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-top:24px}
.theme-option{position:relative;min-width:0;text-align:left;padding:10px 10px 15px;border:1px solid var(--line);border-radius:9px;background:var(--bg);color:var(--text);display:flex;flex-direction:column;gap:9px}
.theme-option[aria-pressed=true]{border:2px solid var(--accent);padding:9px 9px 14px;box-shadow:0 0 0 3px var(--soft)}
.theme-option[aria-pressed=true]:hover{border-color:var(--accent)}
.theme-option:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
.theme-option strong{font-size:14px;margin:3px 3px 0}.theme-option small{font:11px/1.6 Arial,sans-serif;color:var(--muted);margin:0 3px;flex:1}
.theme-option-state{font:11px/1.5 Arial,sans-serif;color:var(--muted);margin:3px 3px 0}
.theme-option[aria-pressed=true] .theme-option-state{color:var(--accent);font-weight:700}
.theme-option[aria-pressed=true] .theme-option-state:before{content:'✓ ';font-weight:700}
.theme-preview{height:87px;display:block;border:1px solid var(--preview-line);border-radius:5px;background:var(--preview-bg);padding:12px;overflow:hidden}
.theme-preview:before{content:'';display:block;width:36%;height:5px;background:var(--preview-accent);border-radius:2px;margin-bottom:11px}
.theme-preview-body{display:flex;gap:7px;height:33px}.theme-preview-body:before{content:'';width:37%;height:100%;border:1px solid var(--preview-line);background:var(--preview-panel);border-radius:3px}.theme-preview-body:after{content:'';flex:1;background:linear-gradient(var(--preview-text),var(--preview-text)) 0 2px/85% 4px no-repeat,linear-gradient(var(--preview-line),var(--preview-line)) 0 12px/100% 3px no-repeat,linear-gradient(var(--preview-line),var(--preview-line)) 0 21px/62% 3px no-repeat}
[data-theme-choice=oled]{--preview-bg:#000;--preview-panel:#070707;--preview-line:#303237;--preview-text:#f1f2f2;--preview-accent:#ff6b72}
[data-theme-choice=white]{--preview-bg:#fff;--preview-panel:#f6f7f9;--preview-line:#c6cdd7;--preview-text:#1b2028;--preview-accent:#b82030}
[data-theme-choice=gray]{--preview-bg:#202226;--preview-panel:#2b2e33;--preview-line:#525864;--preview-text:#f2f3f5;--preview-accent:#ff7880}
[data-theme-choice=tactical]{--preview-bg:#161b15;--preview-panel:#20271c;--preview-line:#4c5a40;--preview-text:#e7ebdf;--preview-accent:#b5ce89}
#theme-status{min-height:2.8em;margin-bottom:0;font-size:12px;line-height:1.5;overflow-wrap:anywhere}#theme-status[data-error=true]{color:var(--error)}
.theme-notice{position:fixed;z-index:60;bottom:20px;left:50%;transform:translateX(-50%);max-width:calc(100% - 32px);width:max-content;padding:14px 20px;border:1px solid var(--line);border-radius:8px;background:var(--panel);color:var(--text);box-shadow:0 12px 40px #0004;font-size:12px;line-height:1.6}.theme-notice[hidden]{display:none}
@media(max-width:850px){.theme-options{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}}
@media(max-width:430px){.appearance-heading{display:block}.appearance-heading>span{display:none}.theme-options{gap:10px}.theme-option strong{font-size:13px}.theme-preview{height:77px;padding:10px}.theme-option small{font-size:10px}.header-actions [data-theme-cycle]:not(.icon-button){max-width:150px;white-space:normal}.appearance-card{padding:20px}}
/* Nothing starts hidden: slow scripts and reduced-motion users retain all content. */
@media(prefers-reduced-motion:no-preference){
  html{scroll-behavior:smooth}
  html,body,.header,.footer,.account-card,.editor-panel,.info-card,.platforms,.game-card,.day,.join-strip,dialog,.theme-option,input,select,textarea{transition:background-color .24s ease,color .2s ease,border-color .2s ease,box-shadow .2s ease,transform .2s ease}
  main>.hero,main>.page-intro,main>.platforms,main>.home-lower,main>.games-grid,main>.week-grid,.auth-layout:not([hidden]),#member-panel:not([hidden]),.admin-panel:not([hidden]){animation:surface-enter .32s ease-out both}
  .game-card{animation:card-enter .3s ease-out backwards}.game-card:nth-child(2){animation-delay:35ms}.game-card:nth-child(3){animation-delay:70ms}.game-card:nth-child(4){animation-delay:105ms}.game-card:nth-child(5){animation-delay:140ms}.game-card:nth-child(6){animation-delay:175ms}
  dialog[open]{animation:dialog-enter .2s ease-out}dialog[open]::backdrop{animation:backdrop-enter .2s ease-out}
  details[open]>.profile-grid,details[open]>form,details[open]>p{animation:surface-enter .2s ease-out}
  .button:active:not(:disabled),.theme-option:active:not(:disabled){transform:translateY(1px)}
  @media(hover:hover){.theme-option:hover:not(:disabled){transform:translateY(-2px)}.platform:hover .external{transform:translate(2px,-2px)}.platform .external{transition:transform .2s ease}}
}
@keyframes surface-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes card-enter{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}
@keyframes dialog-enter{from{opacity:0;transform:translateY(8px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
@keyframes backdrop-enter{from{opacity:0}to{opacity:1}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.theme-option:hover:not(:disabled),.game-card:hover{transform:none}}
/* Boosty palettes. Flat, opaque panels keep text legible over scenic backgrounds. */
:root[data-theme=staff],.theme-demo[data-preview-theme=staff]{--bg:#0d1315;--panel:#172023;--panel2:#253135;--text:#f7f2e8;--muted:#c7c2b7;--line:#56615e;--accent:#efbd72;--accent-hover:#ffda9c;--soft:#343026;--header:#0d1315f5;--on-accent:#241807;--error:#ffb8af;--scene:url('/assets/themes/staff.webp');color-scheme:dark}
:root[data-theme=neon],.theme-demo[data-preview-theme=neon]{--bg:#07101b;--panel:#0d1928;--panel2:#18253b;--text:#edf8ff;--muted:#b9c7e1;--line:#425477;--accent:#6de2f4;--accent-hover:#a4f0fc;--soft:#12334a;--header:#07101bf5;--on-accent:#051e29;--error:#ffa8cf;--scene:url('/assets/themes/neon.webp');color-scheme:dark}
:root[data-theme=ruined-city],.theme-demo[data-preview-theme=ruined-city]{--bg:#191714;--panel:#25231f;--panel2:#343029;--text:#f4eee4;--muted:#c8bdae;--line:#625749;--accent:#e8b36b;--accent-hover:#f4ca8d;--soft:#3c3020;--header:#191714f5;--on-accent:#261a0c;--error:#ffb4aa;--scene:url('/assets/themes/ruined-city.webp');color-scheme:dark}
:root[data-theme=cold-night],.theme-demo[data-preview-theme=cold-night]{--bg:#091321;--panel:#122137;--panel2:#1c3048;--text:#eaf5ff;--muted:#b1c6da;--line:#405f7b;--accent:#90d9f0;--accent-hover:#b5edff;--soft:#17354b;--header:#091321f5;--on-accent:#092237;--error:#ffb8c1;--scene:url('/assets/themes/cold-night.webp');color-scheme:dark}
:root[data-theme=mars],.theme-demo[data-preview-theme=mars]{--bg:#211310;--panel:#2e1c18;--panel2:#402820;--text:#fff0e5;--muted:#d2b7a9;--line:#6b4d40;--accent:#ffae83;--accent-hover:#ffc5a5;--soft:#4b2a20;--header:#211310f5;--on-accent:#2e1207;--error:#ffb7b7;--scene:url('/assets/themes/mars-v2.webp');color-scheme:dark}
:root:is([data-theme=orbit],[data-theme=watchpost],[data-theme=citadel],[data-theme=staff],[data-theme=neon],[data-theme=ruined-city],[data-theme=cold-night],[data-theme=mars]) body{background-color:var(--bg);isolation:isolate}
:root:is([data-theme=orbit],[data-theme=watchpost],[data-theme=citadel],[data-theme=staff],[data-theme=neon],[data-theme=ruined-city],[data-theme=cold-night],[data-theme=mars]) body:before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;background-image:linear-gradient(#000b,#000c),var(--scene);background-position:center;background-size:cover;background-repeat:no-repeat}
:root:is([data-theme=orbit],[data-theme=watchpost],[data-theme=citadel],[data-theme=staff],[data-theme=neon],[data-theme=ruined-city],[data-theme=cold-night],[data-theme=mars]) .page-intro,:root:is([data-theme=orbit],[data-theme=watchpost],[data-theme=citadel],[data-theme=staff],[data-theme=neon],[data-theme=ruined-city],[data-theme=cold-night],[data-theme=mars]) .profile-head{text-shadow:0 2px 12px #000a}
:root:is([data-theme=orbit],[data-theme=watchpost],[data-theme=citadel],[data-theme=staff],[data-theme=neon],[data-theme=ruined-city],[data-theme=cold-night],[data-theme=mars]) .account-card,:root:is([data-theme=orbit],[data-theme=watchpost],[data-theme=citadel],[data-theme=staff],[data-theme=neon],[data-theme=ruined-city],[data-theme=cold-night],[data-theme=mars]) .game-card{box-shadow:0 14px 40px #0002}
.theme-premium .theme-scene{position:relative;padding:0;height:110px;flex:none;border-color:var(--line);background:#17202b}
.theme-scene:before{display:none}.theme-scene img{width:100%;height:100%;object-fit:cover;display:block}
.theme-tier-badge{position:absolute;bottom:7px;left:7px;background:#080b11eb;color:#f4f5f6;border:1px solid #ffffff50;border-radius:4px;padding:4px 7px;font:10px/1.4 Arial,sans-serif}
.theme-option[data-locked=true]{border-style:dashed}
.theme-option[data-locked=true] .theme-option-state:before{content:'▣ ';font-size:12px}
.theme-option[data-locked=true] .theme-option-state{color:var(--muted)}
.theme-premium:disabled{opacity:.65}
.profile-boosty-card{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:0;border:1px solid var(--line);background:var(--panel);border-radius:12px;overflow:hidden;margin:0 0 24px}
.profile-boosty-card[hidden]{display:none}
.profile-cover-art{background:#09090a;display:grid;place-items:center;min-width:0;aspect-ratio:1586/992;position:relative}
.profile-cover-art img{display:block;width:100%;height:auto;object-fit:contain;max-width:100%}
.profile-cover-art img[hidden]{display:none}
#profile-cover-fallback{padding:22px;color:#b8bdc7;font-size:12px;text-align:center}
.profile-tier-copy{padding:clamp(20px,3vw,32px);display:flex;flex-direction:column;justify-content:center;align-items:flex-start;min-width:0}
.profile-tier-copy h2{font-family:SiteSans,Arial,sans-serif;font-size:clamp(25px,3vw,38px);margin:12px 0 8px;line-height:1.2}
.profile-tier-copy p{color:var(--muted);font-size:13px;line-height:1.8;margin:8px 0}
.profile-tier-copy .account-text{margin:10px 0 0;line-height:1.6}
@media(max-width:650px){.profile-boosty-card{grid-template-columns:minmax(0,1fr)}.profile-tier-copy{padding:22px}.theme-premium .theme-scene{height:95px}}
@media(max-width:360px){.theme-options{grid-template-columns:minmax(0,1fr)}.theme-premium .theme-scene{height:135px}}

#profile-cover-loading{position:absolute;inset:0;display:grid;place-items:center;background:#09090a;color:#b8bdc7;font-size:12px}#profile-cover-loading[hidden]{display:none}

:root[data-theme=staff] body:before{background-image:linear-gradient(#0003,#0006),var(--scene)}

/* Цитадель: авторская векторная архитектура, индиго и матовое золото. */
:root[data-theme=citadel],.theme-demo[data-preview-theme=citadel]{--bg:#101017;--panel:#191923;--panel2:#262633;--text:#fff7e7;--muted:#c9c3d1;--line:#5c5365;--accent:#edc780;--accent-hover:#ffe2a3;--soft:#373025;--header:#101017f5;--on-accent:#211809;--error:#ffb5b5;--scene:url('/assets/themes/citadel.svg');color-scheme:dark}
:root[data-theme=citadel] body:before{background-image:linear-gradient(#10101730,#10101780),var(--scene)}
:root[data-theme=citadel] .profile-head{border-bottom:1px solid #edc78060;padding-bottom:24px}
:root[data-theme=citadel] .owner-card{background:linear-gradient(120deg,#332a22,#1c1a30);border-color:#b18b52;box-shadow:0 18px 60px #0005}
:root[data-theme=citadel] .brand-mark{color:#edc780;text-shadow:0 0 28px #dfbb7045}
:root[data-theme=citadel] .theme-option[aria-pressed=true]{box-shadow:0 0 0 1px #edc780,0 6px 28px #edc78018}

:root[data-theme=watchpost],.theme-demo[data-preview-theme=watchpost]{--bg:#0c181c;--panel:#13262d;--panel2:#1b343c;--text:#edf5f4;--muted:#aecacb;--line:#426269;--accent:#9edbd1;--accent-hover:#c2f0e6;--soft:#193b3e;--header:#0c181cf5;--on-accent:#0a2626;--error:#ffb3af;--scene:url('/assets/themes/watchpost.webp');color-scheme:dark}
:root[data-theme=orbit],.theme-demo[data-preview-theme=orbit]{--bg:#15120e;--panel:#252017;--panel2:#372d21;--text:#faf0df;--muted:#cdbfa8;--line:#6c573e;--accent:#f4c079;--accent-hover:#ffdb9b;--soft:#40311c;--header:#15120ef5;--on-accent:#281704;--error:#ffb1a1;--scene:url('/assets/themes/orbit.webp');color-scheme:dark}
:root:is([data-theme=watchpost],[data-theme=orbit]) body:before{background-image:linear-gradient(#0003,#0006),var(--scene)}
