body{--canvas:#f4f3fc;--surface:#fff;--text:#28334b;--muted:#626d85;--accent:#6d50ce;--accent-soft:#efeaff;--sidebar:#101a2c;--lime:#caf780;--edge:#dce0ef;--hero:#242345;--hero-text:#eeeafc;--feedback:#eef6e5}
body[data-theme="forest"]{--canvas:#edf5ef;--surface:#fbfdf9;--text:#183f36;--muted:#4f7167;--accent:#207662;--accent-soft:#e0f1e6;--sidebar:#123a31;--lime:#bce58b;--edge:#cbded1;--hero:#164d40;--hero-text:#e7f5e6;--feedback:#e5f3de}
body[data-theme="sunset"]{--canvas:#faf0e6;--surface:#fffaf4;--text:#503a33;--muted:#806250;--accent:#ac4c32;--accent-soft:#fbe6d5;--sidebar:#3d2728;--lime:#ffd088;--edge:#e8d3c6;--hero:#734033;--hero-text:#ffedda;--feedback:#edf2d6}
body[data-theme="night"]{--canvas:#141d2d;--surface:#202c40;--text:#e8edf9;--muted:#b7c6dc;--accent:#78cfc4;--accent-soft:#273f50;--sidebar:#0c1320;--lime:#9de4ca;--edge:#40536c;--hero:#293859;--hero-text:#e4eef9;--feedback:#284b40}
body{background:var(--canvas);color:var(--text)}aside{background:var(--sidebar)}.card,.stat{background:var(--surface);border-color:var(--edge)}.card p,.quiet{color:var(--muted)}button{background:var(--surface);color:var(--text);border-color:var(--edge)}button:hover{background:var(--accent-soft);border-color:var(--accent)}.primary{background:var(--accent);color:var(--surface);border-color:var(--accent)}.primary:hover{background:var(--accent);filter:brightness(.94)}.hero{background:var(--hero);color:var(--hero-text)}.hero p{color:var(--hero-text)}.kicker,.brand-dot{color:var(--lime)}.olympiad-cta,.nav .olympiad-nav{background:var(--lime)!important;color:var(--sidebar)!important;border-color:var(--lime)!important}.score-hud{background:var(--surface);border-color:var(--edge)}.hud-metric{background:transparent;color:var(--muted)}.hud-primary{background:var(--accent-soft);color:var(--accent)}.mission-strip{background:var(--accent-soft);border-color:var(--edge)}.mission-strip h3,.mission-strip p{color:var(--text)}.mission-icon,.score-feedback,.score-line{color:var(--accent)!important}.tag{background:var(--accent-soft);color:var(--text)}.ai-note{background:var(--accent-soft);color:var(--text);border-color:var(--accent)}.ai-note p,.ai-footnote{color:var(--muted)}.hintbox,.notes,.skill{border-color:var(--edge)}input,textarea,select,.answerline input,.filters select,.filters input,.route-choice select{background:var(--surface);color:var(--text);border-color:var(--edge)}.trap-card{background:var(--accent-soft);border-color:var(--accent)}.proposed-answer,.lamp-choice{background:var(--surface);color:var(--text);border-color:var(--edge)}.game-verdict,.proposed-answer span{color:var(--muted)}.game-verdict>b{color:var(--text)}.lamp-choice.selected{background:var(--accent-soft);border-color:var(--accent)}.lamp-choice.is-correct{background:#eaf7e9;color:#244c2f}.lamp-choice.is-wrong{background:#fff1e7;color:#79462e}.feedback{background:var(--feedback);color:var(--text)}.feedback.bad{background:var(--accent-soft);border-color:#c48250}.nextbox,.notice{background:var(--accent-soft);color:var(--text);border-color:var(--edge)}.visual{background:#f6f8f4;color:#263744}.visual svg text{fill:#263744}.visual p{color:#526878}.cellgrid button{background:#fff;color:#253d37;border-color:#ccd6cf}.cellgrid button.on{background:#c8e9a3;color:#143f2d}.profile-badge{font-size:14px;color:#d7e5f1;overflow-wrap:anywhere;margin-top:14px}.profile-greeting{padding:16px 2px 0;color:var(--muted);font-size:16px}.profile-greeting b{color:var(--text)}.profile-greeting>span{color:var(--accent)}.theme-choice{margin:22px 0}.theme-choice h2{font-size:20px;margin:12px 0}.theme-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px}.theme-tile{padding:12px 9px;text-align:left;display:grid;gap:5px;position:relative}.theme-tile b{font-size:15px}.theme-tile small{font-size:11px;color:var(--muted)}.theme-tile[aria-pressed="true"]{outline:2px solid var(--accent);outline-offset:2px}.theme-swatch{height:10px;border-radius:4px;background:linear-gradient(90deg,#7053c7 55%,#caf780 55%)}.forest .theme-swatch{background:linear-gradient(90deg,#237660 55%,#bce58b 55%)}.sunset .theme-swatch{background:linear-gradient(90deg,#ac4c32 55%,#ffd088 55%)}.night .theme-swatch{background:linear-gradient(90deg,#18243a 55%,#78cfc4 55%)}.auth-tabs{display:flex;gap:8px;flex-wrap:wrap}.auth-tabs [aria-pressed="true"]{border-color:var(--accent);background:var(--accent-soft)}#profileAuth,#renameProfile{display:grid;gap:9px}#profileAuth input,#renameProfile input{width:100%;padding:12px;border:1px solid var(--edge);border-radius:8px}#profileAuth .quiet{margin:0 0 8px}.reaction-caption{display:block;font-size:12px;color:var(--muted);margin-top:8px}.metric-blink{animation:metricBlink .55s ease-out}.reaction-good{animation:reactionGood .55s ease-out}.reaction-check{animation:reactionCheck .4s ease-out}.color-pop{animation:colorPop .35s ease-out}@keyframes metricBlink{40%{background:var(--accent-soft);box-shadow:0 0 0 3px var(--accent)}}@keyframes reactionGood{45%{transform:translateY(-3px);box-shadow:0 3px 14px #739e7140}}@keyframes reactionCheck{25%{transform:translateX(2px)}65%{transform:translateX(-2px)}}@keyframes colorPop{45%{transform:translateY(-3px)}}@media(max-width:600px){.theme-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}.profile-badge{margin-top:6px;font-size:12px}}

.hero button:not(.olympiad-cta){background:var(--surface);color:var(--text);border-color:var(--edge)}

.profile-greeting{overflow-wrap:anywhere}#rememberedProfiles button{max-width:100%;overflow-wrap:anywhere}
.field-notice:empty{display:none}.field-notice{padding:10px 12px;border-left:3px solid var(--accent);background:var(--accent-soft);border-radius:6px;color:var(--text);font-size:14px;overflow-wrap:anywhere}.field-notice p{margin:0 0 8px}.field-notice button{font-size:13px;padding:7px 10px;margin:3px 6px 0 0;min-height:38px}input[aria-invalid="true"]{border-color:#bd713f!important;box-shadow:0 0 0 1px #bd713f}#profileAuth[aria-busy="true"]{opacity:.85}
.portal-back{display:block;margin:0 0 20px;color:inherit;font-size:13px;text-decoration:none;opacity:.8}.portal-back:hover{text-decoration:underline;opacity:1}.portal-back:focus-visible{outline:2px solid currentColor;outline-offset:4px}
