/* Illustrated theme worlds share the existing palette, navigation and responsive layout. */
.world-hero,.world-backdrop{display:none}
:root[data-theme="cyberpunk"]{color-scheme:dark;--accent:#57e3f5;--accent-rgb:87,227,245;--accent-dark:#35afc3;--accent-ink:#96eff8;--secondary:#ee8cd8;--secondary-rgb:238,140,216;--bg:#09111f;--text:#e5f0f6;--ink:#e5f0f6;--muted:#a6bacb;--line:rgba(94,203,226,.23);--panel:rgba(15,27,43,.97);--panel-solid:#111e30;--surface:#111e30;--soft:rgba(87,227,245,.1);--accent-soft:#173040;--shadow:0 24px 65px #0005}
:root[data-theme="woodland"]{color-scheme:dark;--accent:#91c5a0;--accent-rgb:145,197,160;--accent-dark:#80b994;--accent-ink:#b6d8bc;--secondary:#c5b67b;--secondary-rgb:197,182,123;--bg:#1a3024;--text:#e8f0e5;--ink:#e8f0e5;--muted:#b5c9b8;--line:rgba(167,198,172,.28);--panel:rgba(40,68,51,.97);--panel-solid:#284433;--surface:#284433;--soft:rgba(145,197,160,.09);--accent-soft:#34553f;--shadow:0 24px 65px #0005}
:root[data-theme="cyberpunk"] body{background:radial-gradient(ellipse at 90% 10%,#7c286522,transparent 38rem),radial-gradient(ellipse at 8% 68%,#19758322,transparent 42rem),#09111f}
:root[data-theme="cyberpunk"] body::before{opacity:.24;background-image:linear-gradient(#57e3f524 1px,transparent 1px),linear-gradient(90deg,#57e3f524 1px,transparent 1px);background-size:64px 64px}
:root[data-theme="woodland"] body{background:radial-gradient(ellipse at 70% 4%,#85aa7c20,transparent 36rem),radial-gradient(ellipse at 5% 67%,#6a90651a,transparent 40rem),#1a3024}
:root[data-theme="woodland"] body::before{opacity:.12;background-image:radial-gradient(ellipse at center,#89ac9544 0 1px,transparent 2px);background-size:36px 42px}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.auth-tabs,.auth-language,.auth-method-tabs,.user-sidebar,.question-card,.concept-card,.unit-card,.topic-button,.how-card,.data-card,.concept-orbit,.daily-challenge,.daily-choice,.account-nav-button,.user-shell,.world-card,.field-card,.theme-card,.app-sidebar,.placement-test,.knowledge-tree,.tree-toolbar,.tree-root,.tree-topic,.tree-unit>details>summary,.tree-course>details>summary,.search-wrap,.example,.secondary,.back-control,.browse-mode-switch,.field input,.field select,.field textarea,.compact-select,.lesson-video,.result,.math-calculator,.mistake-card,.mistake-original,.mistake-transfer,.story-card,.story-detail,.guest-signin){background:var(--panel-solid);color:var(--text);border-color:var(--line)}
:root[data-theme="cyberpunk"] :is(.field input[readonly],input,select,textarea,.daily-level-row select,.math-calculator input,.calculator-keys button,.calculator-mode button){background:#0c1727;color:var(--text);border-color:var(--line)}
:root[data-theme="cyberpunk"] :is(.auth-gate,.auth-card,.admin-shell,.workspace){background-color:var(--panel-solid);color:var(--text)}
:root[data-theme="cyberpunk"] :is(.primary,.auth-submit,.admin-primary,.calculator-equals){background:linear-gradient(135deg,#57e3f5,#7bf0e1);color:#08202c}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.subject.active,.account-nav-button[aria-current="page"],.account-nav-button[aria-pressed="true"],.study-option.selected,.user-tab.active){background:var(--soft);color:var(--accent-ink);border-color:var(--accent)}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.role-chip,.stat-chip,.daily-badge,.tree-node-icon,.tree-leaf-dot,.course-kicker,.unit-code,.theme-state,.phone-help,.guest-entry p,.phone-create-account){color:var(--muted)}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.auth-heading,.auth-subtitle,.field label,.account-email){color:var(--text)}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.auth-link,.user-tab.active,.theme-card.selected .theme-state,.theme-card.selected){color:var(--accent-ink)}
:root[data-theme="cyberpunk"] .daily-choice.correct,:root[data-theme="cyberpunk"] .daily-answer.success{background:#143a32;color:#c5f3de;border-color:#66b797}
:root[data-theme="cyberpunk"] .daily-choice.incorrect,:root[data-theme="cyberpunk"] .daily-answer.review{background:#3b263b;color:#ffd2e8;border-color:#c387ab}
:root[data-theme="cyberpunk"] :is(.auth-message.error,.admin-notice.error){background:#382132;color:#ffd2e8;border-color:#9d627e}
:root[data-theme="cyberpunk"] :is(.auth-message.success,.admin-notice.success){background:#143a32;color:#c5f3de;border-color:#66b797}
:root[data-theme="cyberpunk"] :is(.lang-btn,.auth-language button,[data-preference-language]){background:#142d3a!important;color:#cff8ff!important}
:root[data-theme="cyberpunk"] :is(.lang-btn.active,.auth-language button.active,[data-preference-language][aria-pressed="true"]){background:#57e3f5!important;color:#08202c!important}
/* Keep the course rail dark: light-theme gradients wash out neon labels. */
:root[data-theme="cyberpunk"] .sidebar{background:#111e30;color:var(--text);border-color:var(--line)}
:root[data-theme="cyberpunk"] .sidebar::after{background:linear-gradient(to bottom,#57e3f538,#ee8cd820,transparent)}
:root[data-theme="cyberpunk"] .side-title{color:#e5f0f6}
:root[data-theme="cyberpunk"] .side-note{color:#b8cbdc;border-color:#315064}
:root[data-theme="cyberpunk"] .subject{color:#d5e6f2;column-gap:12px;line-height:1.4}
:root[data-theme="cyberpunk"] .subject>span:first-child{min-width:0;overflow-wrap:anywhere}
:root[data-theme="cyberpunk"] .subject:hover{background:#193247;color:#f1f9fc}
:root[data-theme="cyberpunk"] .subject.active{background:#1a3d50;color:#a8f3fb;box-shadow:inset 3px 0 0 #57e3f5}
:root[data-theme="cyberpunk"] .subject .count{flex:0 0 auto;align-self:center;background:#21384b;color:#d5e6f2;border-color:#476478;min-width:28px;line-height:1.35}
:root[data-theme="cyberpunk"] .subject.active .count{background:#57e3f5;color:#08202c;border-color:#57e3f5}
/* Twilight forest: moonlit text on softly lit deep-green surfaces. */
:root[data-theme="woodland"] :is(.auth-gate,.auth-card,.auth-loading-card,.admin-shell,.workspace,.sidebar){background:var(--panel-solid);color:var(--text);border-color:var(--line)}
:root[data-theme="woodland"] .auth-gate{background:radial-gradient(ellipse at 75% 15%,#85aa7c20,transparent 34rem),var(--bg)}
:root[data-theme="woodland"] :is(input,select,textarea,.field input[readonly],.daily-level-row select,.math-calculator input,.calculator-keys button,.calculator-mode button){background:#203929;color:var(--text);border-color:var(--line)}
:root[data-theme="woodland"] :is(input,textarea)::placeholder{color:var(--muted);opacity:.85}
:root[data-theme="woodland"] :is(.primary,.auth-submit,.admin-primary,.calculator-equals){background:linear-gradient(135deg,#91c5a0,#80b994);color:#08170e;box-shadow:0 8px 24px #0005}
:root[data-theme="woodland"] :is(.logo,.auth-logo,.profile-avatar,.mistake-filters button.active){color:#08170e}
:root[data-theme="woodland"] :is(.auth-tab,.auth-method-tab,.logout-button){color:var(--muted)}
:root[data-theme="woodland"] :is(.auth-tab.active,.auth-method-tab.active){color:var(--accent-ink);background:var(--soft)}
:root[data-theme="woodland"] :is(.daily-choice.correct,.daily-answer.success,.auth-message.success,.admin-notice.success,.mistake-meta .mistake-mastered){background:#153225;color:#c0e4ca;border-color:#639b76}
:root[data-theme="woodland"] :is(.daily-choice.incorrect,.daily-answer.review,.auth-message.error,.admin-notice.error){background:#302122;color:#f0c6c8;border-color:#b87b81}
:root[data-theme="woodland"] .mistake-feedback.wrong{background:#302b1b;color:#e9d9ac;border-color:#97834e}
:root[data-theme="woodland"] :is(.lang-btn,.auth-language button,[data-preference-language]){background:#34553f!important;color:var(--text)!important}
:root[data-theme="woodland"] :is(.lang-btn.active,.auth-language button.active,[data-preference-language][aria-pressed="true"]){background:var(--accent)!important;color:#08170e!important}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) .photo-composition{display:none}
:root[data-theme="cyberpunk"] .cyberpunk-hero,:root[data-theme="woodland"] .woodland-hero,:root[data-theme="summernight"] .summernight-hero{display:block;position:relative;width:100%;min-width:0;max-width:540px;align-self:center;overflow:hidden;border:1px solid var(--line);border-radius:30px;box-shadow:var(--shadow);isolation:isolate}
.world-hero img{display:block;width:100%;height:auto}.world-hero-label{position:absolute;top:22px;left:28px;font:9px ui-monospace,monospace;letter-spacing:.18em;color:#b9e6ef}
.woodland-hero .world-hero-label{color:#adc6b5;top:24px;left:26px}
.cyberpunk-hero .world-hero-motion{position:absolute;inset:0;background:linear-gradient(transparent 0 45%,#57e3f51c 50%,transparent 55%);background-size:100% 180%;animation:world-scan 12s linear infinite;pointer-events:none}
.woodland-hero .world-hero-motion{position:absolute;left:55%;top:22%;width:3px;height:3px;border-radius:50%;background:#cbd69a;box-shadow:-100px 110px 8px 1px #afbd7b80,42px 130px 7px 1px #c2ce9980,100px 26px 8px 1px #cbd69a80;animation:world-fireflies 9s ease-in-out infinite;pointer-events:none}
:root[data-theme="cyberpunk"] .cyberpunk-backdrop,:root[data-theme="woodland"] .woodland-backdrop,:root[data-theme="summernight"] .summernight-backdrop{display:block;position:fixed;inset:0;z-index:0;pointer-events:none;overflow:hidden}
.world-backdrop-art{position:absolute;inset:0}
.cyberpunk-backdrop .world-backdrop-art{background:linear-gradient(90deg,#57e3f520 1px,transparent 1px),linear-gradient(#57e3f520 1px,transparent 1px);background-size:90px 90px;position:absolute;top:65%;left:-15%;right:-15%;bottom:-30%;transform:perspective(400px) rotateX(52deg);opacity:.24}
.woodland-backdrop .world-backdrop-art{background:url("images/woodland/scene.svg?v=53") bottom center/cover no-repeat;opacity:.22;top:40%}
.world-backdrop i{position:absolute;left:var(--x);top:var(--y);animation-delay:var(--delay);animation-duration:var(--duration);animation-iteration-count:infinite;animation-timing-function:ease-in-out}
.cyberpunk-backdrop i{width:2px;height:16px;background:#57e3f5;opacity:.2;box-shadow:0 0 10px #57e3f5;animation-name:world-signal}
.woodland-backdrop i{width:7px;height:4px;background:#658372;border-radius:100% 0 100% 0;opacity:.22;animation-name:world-leaf}
.woodland-backdrop i:nth-child(3n){width:3px;height:3px;border-radius:50%;background:#afbd7b;box-shadow:0 0 8px 1px #afbd7b44;animation-name:world-fireflies}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(button,a)[data-world-theme]{background-image:var(--world-icon)!important;background-repeat:no-repeat!important;background-size:28px 28px!important;background-position:12px center!important;padding-left:50px!important;transition:box-shadow .2s ease,border-color .2s ease}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(button,a)[data-world-theme]:hover:not(:disabled){border-color:var(--accent);box-shadow:0 0 16px var(--soft)}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) .app-sidebar :is(button,a)[data-world-theme]::before{content:none!important}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) .subject[data-world-theme]{min-height:54px;text-align:left}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.lang-btn,.browse-mode-toggle,.sidebar-close,#calculatorClose,.calculator-keys button,.calculator-mode button,#enrollmentClose,[data-field-step])[data-world-theme]{background-size:14px 14px!important;background-position:right 3px bottom 3px!important;padding-left:10px!important}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(.daily-choice,.study-option,.tree-topic,.unit-card,.topic-button)[data-world-theme]{background-position:right 10px top 10px!important;background-size:22px 22px!important;padding-left:initial!important;padding-right:40px!important}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) .theme-card[data-world-theme]{background-size:24px 24px!important;background-position:right 10px top 10px!important;padding-left:0!important}
:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) [data-field-index][data-world-theme]{background-size:14px 14px!important;background-position:right 3px bottom 3px!important;padding-left:0!important}
.theme-card[data-theme-choice="cyberpunk"] .theme-preview{background:url("images/cyberpunk/scene.svg") center/cover no-repeat #09111f}
.theme-card[data-theme-choice="woodland"] .theme-preview{background:url("images/woodland/scene.svg?v=53") center/cover no-repeat #1a3024}
:is(.theme-card[data-theme-choice="cyberpunk"],.theme-card[data-theme-choice="woodland"],.theme-card[data-theme-choice="summernight"]) .theme-preview>*{opacity:0}
@keyframes world-scan{from{background-position:0 180%}to{background-position:0 -180%}}
@keyframes world-fireflies{0%,100%{opacity:.2;transform:translate(0,0)}50%{opacity:.7;transform:translate(10px,-14px)}}
@keyframes world-signal{0%,100%{opacity:.1;transform:translateY(0)}50%{opacity:.3;transform:translateY(-24px)}}
@keyframes world-leaf{0%,100%{transform:translate(0,0) rotate(-25deg)}50%{transform:translate(16px,20px) rotate(35deg)}}
@media(max-width:760px){:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) .world-hero{max-width:460px;margin:0 auto}.world-hero-label{font-size:8px;left:18px;top:15px}.woodland-hero .world-hero-label{font-size:8px;left:18px;top:15px}.world-backdrop{opacity:.55}.world-backdrop i:nth-child(n+7){display:none}}
@media(prefers-reduced-motion:reduce){.world-backdrop i,.world-hero-motion{animation:none!important}:root:is([data-theme="cyberpunk"],[data-theme="woodland"],[data-theme="summernight"]) :is(button,a)[data-world-theme]{transition:none}}

/* Summer night: moonlit blues and warm firefly gold, with readable opaque cards. */
:root[data-theme="summernight"]{color-scheme:dark;--accent:#a8dcd5;--accent-rgb:168,220,213;--accent-dark:#8ec6c4;--accent-ink:#c2ece5;--secondary:#f0d594;--secondary-rgb:240,213,148;--bg:#24344f;--text:#ecf2f6;--ink:#ecf2f6;--muted:#b9c9dc;--line:rgba(177,204,221,.28);--panel:rgba(49,69,98,.97);--panel-solid:#314562;--surface:#314562;--soft:rgba(168,220,213,.1);--accent-soft:#354d68;--shadow:0 24px 65px #14213755}
:root[data-theme="summernight"] body{background:radial-gradient(ellipse at 80% 8%,#efd99a17,transparent 34rem),radial-gradient(ellipse at 4% 65%,#9fd8d51a,transparent 40rem),var(--bg)}
:root[data-theme="summernight"] body::before{opacity:.16;background-image:radial-gradient(circle,#f4e5b8 0 1px,transparent 1.6px),radial-gradient(circle,#bcdce5 0 .7px,transparent 1.3px);background-size:97px 83px,157px 143px;background-position:0 0,38px 27px}
.summernight-hero .world-hero-label{color:#e2e9eb;top:24px;left:26px;text-shadow:0 1px 4px #24344f}
.summernight-hero .world-hero-motion{position:absolute;left:45%;top:68%;width:4px;height:4px;border-radius:50%;background:#f7e7a5;box-shadow:-130px -10px 8px 2px #f7e7a570,62px 22px 9px 2px #f7e7a570,150px -27px 8px 2px #f7e7a570;animation:summernight-drift 10s ease-in-out infinite;pointer-events:none}
.summernight-backdrop .world-backdrop-art{background:url("images/summernight/scene.svg") bottom center/cover no-repeat;opacity:.17;top:36%}
.summernight-backdrop i{width:3px;height:3px;border-radius:50%;background:#f0d594;box-shadow:0 0 9px 2px #f0d59450;animation-name:summernight-drift}
.summernight-backdrop i:nth-child(3n){background:#c6e7ed;box-shadow:0 0 5px #c6e7ed50;animation-name:summernight-twinkle}
.theme-card[data-theme-choice="summernight"] .theme-preview{background:url("images/summernight/scene.svg") center/cover no-repeat #24344f}
@keyframes summernight-drift{0%,100%{opacity:.18;transform:translate(0,0)}35%{opacity:.65;transform:translate(10px,-12px)}70%{opacity:.32;transform:translate(-6px,-20px)}}
@keyframes summernight-twinkle{0%,100%{opacity:.2}50%{opacity:.6}}
@media(max-width:760px){.summernight-hero .world-hero-label{font-size:8px;left:18px;top:15px}}
:root[data-theme="summernight"] :is(.auth-gate,.auth-card,.auth-loading-card,.admin-shell,.workspace,.sidebar){background:var(--panel-solid);color:var(--text);border-color:var(--line)}
:root[data-theme="summernight"] .auth-gate{background:radial-gradient(ellipse at 75% 15%,#b6d5ea20,transparent 34rem),var(--bg)}
:root[data-theme="summernight"] :is(input,select,textarea,.field input[readonly],.daily-level-row select,.math-calculator input,.calculator-keys button,.calculator-mode button){background:#293c59;color:var(--text);border-color:var(--line)}
:root[data-theme="summernight"] :is(input,textarea)::placeholder{color:var(--muted);opacity:.85}
:root[data-theme="summernight"] :is(.primary,.auth-submit,.admin-primary,.calculator-equals){background:linear-gradient(135deg,#a8dcd5,#8ec6c4);color:#152b3b;box-shadow:0 8px 24px #0005}
:root[data-theme="summernight"] :is(.logo,.auth-logo,.profile-avatar,.mistake-filters button.active){color:#152b3b}
:root[data-theme="summernight"] :is(.auth-tab,.auth-method-tab,.logout-button){color:var(--muted)}
:root[data-theme="summernight"] :is(.auth-tab.active,.auth-method-tab.active){color:var(--accent-ink);background:var(--soft)}
:root[data-theme="summernight"] :is(.daily-choice.correct,.daily-answer.success,.auth-message.success,.admin-notice.success,.mistake-meta .mistake-mastered){background:#244f4b;color:#c5ebe3;border-color:#7caaa1}
:root[data-theme="summernight"] :is(.daily-choice.incorrect,.daily-answer.review,.auth-message.error,.admin-notice.error){background:#493648;color:#f8d4df;border-color:#c08da3}
:root[data-theme="summernight"] .mistake-feedback.wrong{background:#4b4332;color:#f2e2b8;border-color:#b69c61}
:root[data-theme="summernight"] :is(.lang-btn,.auth-language button,[data-preference-language]){background:#354d68!important;color:var(--text)!important}
:root[data-theme="summernight"] :is(.lang-btn.active,.auth-language button.active,[data-preference-language][aria-pressed="true"]){background:var(--accent)!important;color:#152b3b!important}
