:root{--radius:14px;--tap:48px;--font:system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--mono:ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;--ease:.18s ease;--rail:0px;--good:#1f8a4c;--good-bg:#e3f4ea;--bad:#c2362f;--bad-bg:#fbe7e5;--syn-tag:#b4235a;--syn-attr:#8a5a00;--syn-string:#1a7f37;--syn-comment:#5f6673;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}:root[data-mode=dark]{--good:#5fd08d;--good-bg:#183324;--bad:#ff8a80;--bad-bg:#3a1d1b;--syn-tag:#ff86b0;--syn-attr:#f0b35b;--syn-string:#72d892;--syn-comment:#8d95a3;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}:root,:root[data-palette=indigo]{--bg:#f6f6fb;--surface:#fff;--text:#1b1b2f;--muted:#5b5d72;--border:#e2e2ee;--code-bg:#efeff7;--brand:#4f46e5;--brand-ink:#fff;--accent:#ff7a1a;--accent-ink:#1b1b2f}:root[data-mode=dark],:root[data-palette=indigo][data-mode=dark]{--bg:#0f1020;--surface:#1a1b30;--text:#ececf7;--muted:#a5a7c0;--border:#2a2c45;--code-bg:#23253d;--brand:#8b85ff;--brand-ink:#0f1020;--accent:#ff8a33;--accent-ink:#0f1020}:root[data-palette=green]{--bg:#f7f6f2;--surface:#fff;--text:#1c1d1f;--muted:#5d6168;--border:#e3e1da;--code-bg:#f0efe9;--brand:#0e7c66;--brand-ink:#fff;--accent:#f2a900;--accent-ink:#1c1d1f}:root[data-palette=green][data-mode=dark]{--bg:#121416;--surface:#1c1f22;--text:#eceae4;--muted:#a3a7ad;--border:#2d3135;--code-bg:#24282c;--brand:#2fb393;--brand-ink:#0b1a16;--accent:#f2a900;--accent-ink:#1c1d1f}:root[data-palette=pitch]{--bg:#f2f5f9;--surface:#fff;--text:#0e1726;--muted:#536173;--border:#dce3ec;--code-bg:#eaeef5;--brand:#1a3a9e;--brand-ink:#fff;--accent:#b8f23a;--accent-ink:#0e1726}:root[data-palette=pitch][data-mode=dark]{--bg:#0a0f1e;--surface:#141b30;--text:#e8edf7;--muted:#9aa6bd;--border:#243052;--code-bg:#1c2540;--brand:#b8f23a;--brand-ink:#0a0f1e;--accent:#3d7bff;--accent-ink:#fff}:root[data-calm]{--accent:var(--brand);--accent-ink:var(--brand-ink);--ease:0s linear}@media (prefers-reduced-motion:reduce){:root{--ease:0s linear}}*{box-sizing:border-box}html,body{margin:0}body{background:var(--bg);color:var(--text);font:16px/1.55 var(--font);-webkit-text-size-adjust:100%}a{color:var(--brand)}h1{margin:.25rem 0 .5rem;font-size:1.5rem;line-height:1.25}.muted{color:var(--muted)}.small{font-size:.875rem}.app{flex-direction:column;min-height:100dvh;display:flex}.topbar{z-index:2;background:var(--bg);border-bottom:1px solid var(--border);align-items:center;padding:10px 16px;display:flex;position:sticky;top:0}.brand{color:var(--text);align-items:center;gap:10px;text-decoration:none;display:flex}.brand-mark{background:var(--brand);width:34px;height:34px;color:var(--brand-ink);border-radius:10px;place-items:center;font-size:.9rem;font-weight:800;display:grid}.brand-name{font-weight:700}.brand-sub{color:var(--brand)}.screen{width:100%;max-width:720px;padding:16px 16px calc(84px + env(safe-area-inset-bottom));flex:1;margin:0 auto}.tabbar{z-index:2;padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:var(--surface);border-top:1px solid var(--border);justify-content:space-around;display:flex;position:fixed;bottom:0;left:0;right:0}.tab{min-width:72px;min-height:var(--tap);color:var(--muted);border-radius:10px;flex-direction:column;justify-content:center;align-items:center;font-size:.75rem;text-decoration:none;display:flex}.tab-icon{margin-bottom:2px;font-size:1.25rem;line-height:1}.tab.active{color:var(--brand);font-weight:700}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);margin-bottom:12px;padding:16px}.pill{background:var(--code-bg);color:var(--muted);white-space:nowrap;border-radius:999px;padding:2px 10px;font-size:.75rem;display:inline-block}.hero{align-items:center;gap:14px;margin:4px 0 18px;display:flex}.mascot{font-size:2.6rem;line-height:1;animation:2.4s ease-in-out infinite bob}:root[data-calm] .mascot{animation:none}@keyframes bob{50%{transform:translateY(-4px)}}.lesson-list{margin:0;padding:0;list-style:none}.lesson-card{min-height:var(--tap);color:inherit;transition:transform var(--ease);align-items:center;gap:14px;text-decoration:none;display:flex}.lesson-card:active{transform:scale(.98)}.lesson-num{background:var(--brand);width:36px;height:36px;color:var(--brand-ink);border-radius:50%;flex:none;place-items:center;font-weight:700;display:grid}.lesson-text{flex-direction:column;flex:1;min-width:0;display:flex}.back{min-height:var(--tap);line-height:var(--tap);text-decoration:none;display:inline-block}.prose>:first-child,.prose>.md:first-child>:first-child{margin-top:0}.prose>:last-child,.prose>.md:last-child>:last-child{margin-bottom:0}.live-wrap{margin:16px -16px;container-type:inline-size}.live-block{border-block:1px solid var(--border)}.live-head{background:var(--surface);justify-content:space-between;align-items:center;min-height:48px;padding:0 16px;display:flex}@container (width>=640px){.live-block{grid-template-columns:minmax(0,1fr) minmax(0,1fr);display:grid}.live-out{border-left:1px solid var(--border);flex-direction:column;display:flex}.live-out .live-preview{flex:1;height:auto;min-height:240px}.live-out .tree-panel{flex:1}}.live-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:.8rem;font-weight:700}.live-reset{min-height:var(--tap);min-width:var(--tap);color:var(--brand);font:inherit;cursor:pointer;background:0 0;border:0;margin-right:-8px;padding:0 8px;font-weight:700}.symbol-bar{background:var(--surface);border-top:1px solid var(--border);gap:6px;padding:6px 16px;display:flex;overflow-x:auto}.symbol-bar button{min-width:44px;min-height:var(--tap);border:1px solid var(--border);background:var(--code-bg);color:var(--text);font:700 1.15rem var(--mono);cursor:pointer;touch-action:manipulation;border-radius:10px;flex:1 0 auto}.symbol-bar button:active{background:var(--border)}@media (hover:hover) and (pointer:fine){.symbol-bar{display:none}}.code-editor,.live-fallback{min-height:96px}.live-fallback{border-radius:0;margin:0;padding:10px 16px;font-size:15px;line-height:1.6}.live-switch button{min-width:72px}.tree-panel{background:var(--surface);border-top:1px solid var(--border);margin:0;padding:8px 12px 12px}.tree,.tree ul{margin:0;padding:0;list-style:none}.tree ul{border-left:2px solid var(--border);margin-left:18px;padding-left:8px}.tree-node{width:100%;min-height:var(--tap);color:var(--text);font:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;border:2px solid #0000;border-radius:10px;align-items:center;gap:8px;padding:0 8px;display:flex}.tree-node.on{border-color:var(--accent);background:color-mix(in srgb, var(--accent) 18%, transparent)}.tree-tag{background:var(--brand);color:var(--brand-ink);font:700 .95rem var(--mono);border-radius:6px;flex:none;padding:2px 10px}.tree-text{text-overflow:ellipsis;white-space:nowrap;min-width:0;font:.95rem var(--mono);color:var(--muted);overflow:hidden}.tree-warn{color:var(--bad);margin:10px 4px 0}.live-preview{border:0;border-top:1px solid var(--border);background:#fff;width:100%;height:200px;display:block}.prose h1{font-size:1.4rem}.prose h2{font-size:1.15rem}.prose{max-width:68ch}.card.prose{max-width:none}.card.prose>:not(.live-wrap){max-width:68ch}.prose blockquote{border-left:4px solid var(--accent);background:var(--code-bg);border-radius:6px;margin:12px 0;padding:8px 12px}.prose table{border-collapse:collapse;width:100%;margin:12px 0;font-size:.95rem}.prose th,.prose td{text-align:left;border-bottom:1px solid var(--border);vertical-align:top;padding:8px 10px}.prose th{color:var(--muted);font-weight:600}.prose details{border:1px solid var(--border);background:var(--surface);border-radius:10px;margin:8px 0 16px}.prose summary{min-height:var(--tap);color:var(--brand);cursor:pointer;align-items:center;padding:0 14px;font-weight:700;display:flex}.prose details[open] summary{border-bottom:1px solid var(--border)}.prose details>:not(summary){margin:12px 14px}.prose code,.code{font-family:var(--mono);font-size:.9em}.prose :not(pre)>code{background:var(--code-bg);border-radius:4px;padding:1px 5px}.prose pre,.code{background:var(--code-bg);white-space:pre;border-radius:10px;padding:12px;overflow-x:auto}.pill-good{background:var(--good-bg);color:var(--good);font-weight:600}.pill-brand{color:var(--brand);font-weight:600}.btn{min-height:var(--tap);font:inherit;text-align:center;cursor:pointer;transition:transform var(--ease);border:2px solid #0000;border-radius:12px;justify-content:center;align-items:center;padding:0 20px;font-weight:700;text-decoration:none;display:inline-flex}.btn:active:not(:disabled){transform:scale(.97)}.btn:disabled{opacity:.4;cursor:default}.btn-primary{background:var(--brand);color:var(--brand-ink)}.btn-ghost{background:var(--surface);color:var(--text);border-color:var(--border)}.player-head{justify-content:space-between;align-items:center;gap:12px;display:flex}.steps{gap:4px;margin:0 0 14px;display:flex}.steps span{background:var(--border);height:6px;transition:background var(--ease);border-radius:999px;flex:1}.steps span.done{background:var(--brand)}.steps span.current{background:color-mix(in srgb, var(--brand) 55%, var(--border))}.lesson-section{outline:none}.lesson-section:focus-visible{outline:3px solid var(--accent)}.player-nav{bottom:calc(60px + env(safe-area-inset-bottom));background:var(--bg);grid-template-columns:1fr 2fr;gap:10px;padding:10px 0;display:grid;position:sticky}.done-card{text-align:center;outline:none;padding:28px 20px}.done-icon{background:var(--good-bg);width:72px;height:72px;color:var(--good);border-radius:50%;place-items:center;margin:0 auto 8px;font-size:2.2rem;font-weight:800;display:grid}.done-icon.pop{animation:.42s ease-out pop}@keyframes pop{0%{opacity:0;transform:scale(.4)}70%{transform:scale(1.12)}to{transform:scale(1)}}@media (prefers-reduced-motion:reduce){.done-icon.pop{animation:none}}:root[data-calm] .done-icon.pop{animation:none}.done-actions{gap:10px;max-width:360px;margin:18px auto 0;display:grid}.visually-hidden{clip:rect(0 0 0 0);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.pill-accent{background:var(--accent);color:var(--accent-ink);font-weight:700}.challenge-num{background:var(--accent);color:var(--accent-ink);font-size:1.1rem}.eyebrow{text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin:0 0 4px;font-size:.8rem;font-weight:700}.challenge h2{margin:0 0 8px;font-size:1.1rem}.checks-head{justify-content:space-between;align-items:baseline;gap:12px;display:flex}.checks{gap:4px;margin:0;padding:0;list-style:none;display:grid}.checks li{align-items:center;gap:12px;min-height:44px;line-height:1.4;display:flex}.check-mark{border:2px solid var(--border);width:26px;height:26px;color:var(--good-bg);border-radius:50%;flex:none;place-items:center;font-size:.9rem;font-weight:800;display:grid}.checks li.ok .check-mark{background:var(--good);border-color:var(--good)}.checks code,.hints code{font-family:var(--mono);background:var(--code-bg);border-radius:4px;padding:1px 5px;font-size:.9em}.hints{gap:10px;margin:0 0 12px;padding-left:22px;display:grid}.hints:empty{display:none}.hint-btn{width:100%}.player-nav.single{grid-template-columns:1fr}.clash{max-width:640px}.clash-intro h1{margin-top:0}.clash-stats{grid-template-columns:1fr 1fr;gap:10px;margin:16px 0;display:grid}.clash-stats>div{background:var(--code-bg);border-radius:12px;flex-direction:column;padding:12px;display:flex}.stat-num{font-size:1.6rem;font-weight:800;line-height:1.2}.clash-start{width:100%;font-size:1.1rem}.clash-top{justify-content:space-between;align-items:center;min-height:36px;display:flex}.clash-score{text-align:center;background:var(--brand);min-width:56px;color:var(--brand-ink);border-radius:999px;padding:2px 12px;font-weight:800}.clash-timer{background:var(--border);border-radius:999px;height:10px;margin:6px 0 12px;overflow:hidden}.clash-timer-fill{border-radius:inherit;background:var(--brand);height:100%;transition:width .1s linear}.clash-timer-fill.low{background:var(--bad)}:root[data-calm] .clash-timer-fill{transition:none}@media (prefers-reduced-motion:reduce){.clash-timer-fill{transition:none}}.clash-prompt{font-size:1.1rem;font-weight:600}.clash-prompt p{margin:0 0 10px}.clash-code{margin:0 0 12px;font-size:.95rem}.clash-options{gap:10px;display:grid}.clash-option{border:2px solid var(--border);background:var(--surface);min-height:52px;color:var(--text);font:inherit;text-align:left;cursor:pointer;touch-action:manipulation;border-radius:12px;padding:10px 14px}.clash-option.mono{font-family:var(--mono)}.clash-option:active:not(:disabled){border-color:var(--brand)}.clash-option:disabled{cursor:default;color:var(--text)}.clash-option.correct{border-color:var(--good);background:var(--good-bg);font-weight:700}.clash-option.wrong{border-color:var(--bad);background:var(--bad-bg)}.clash-option.faded{opacity:.55}.clash-feedback{border-width:2px}.clash-feedback.good{border-color:var(--good)}.clash-feedback.bad{border-color:var(--bad)}.clash-verdict{margin:0 0 4px;font-size:1.15rem;font-weight:800}.clash-feedback.good .clash-verdict{color:var(--good)}.clash-feedback.bad .clash-verdict{color:var(--bad)}.clash-next{width:100%;margin-top:4px}.clash-final{color:var(--brand);margin:0;font-size:3rem;font-weight:800;line-height:1.1}.clash-best{margin:8px 0 0}.clash-best.new{color:var(--good);font-weight:800}.clash-outcome{margin:0 0 8px;font-size:1.5rem;font-weight:800}.clash-outcome.win{color:var(--good)}.clash-versus{justify-content:center;align-items:center;gap:16px;margin:4px 0;display:flex}.clash-versus>div{background:var(--code-bg);border-radius:12px;flex-direction:column;align-items:center;min-width:96px;padding:10px;display:flex}.clash-versus>div:first-child .stat-num{color:var(--brand)}.clash-share-note{text-align:left;color:var(--muted);margin:0}.clash-share-link{width:100%;min-height:var(--tap);border:1px solid var(--border);background:var(--code-bg);color:var(--text);font:.85rem var(--mono);border-radius:10px;margin-top:6px;padding:0 12px;display:block}.clash-review-title{margin:0 0 8px;font-size:1.1rem}.clash-review{gap:12px;margin:0;padding:0;list-style:none;display:grid}.clash-review li{align-items:flex-start;gap:12px;display:flex}.clash-review-text{flex-direction:column;gap:2px;min-width:0;display:flex}.clash-review li.ok .check-mark{background:var(--good);border-color:var(--good)}.clash-review li.miss .check-mark{border-color:var(--bad);color:var(--bad)}.clash-review code{font-family:var(--mono);background:var(--code-bg);border-radius:4px;padding:1px 5px;font-size:.9em}.q-list{margin:0;padding:0;list-style:none}.q-meta{flex-wrap:wrap;gap:6px;margin-bottom:10px;display:flex}.options{gap:8px;margin:10px 0;padding:0;list-style:none;display:grid}.options li{border:1px solid var(--border);font-family:var(--mono);border-radius:10px;padding:10px 12px;font-size:.9rem}.options li.correct{border-color:var(--good);background:var(--good-bg)}.setting{justify-content:space-between;align-items:center;gap:12px;display:flex}.setting p{margin:2px 0 0}.segmented{background:var(--code-bg);border-radius:10px;padding:3px;display:flex}.segmented button{min-height:40px;color:var(--muted);font:inherit;background:0 0;border:0;border-radius:8px;padding:0 12px;font-size:.875rem}.segmented button.on{background:var(--surface);color:var(--text);font-weight:600}.switch{appearance:none;background:var(--border);cursor:pointer;width:48px;height:28px;transition:background var(--ease);border-radius:999px;flex:none;position:relative}.switch:after{content:"";width:22px;height:22px;transition:transform var(--ease);background:#fff;border-radius:50%;position:absolute;top:3px;left:3px}.switch:checked{background:var(--brand)}.switch:checked:after{transform:translate(20px)}.options li.wrong{border-color:var(--bad);background:var(--bad-bg)}.xp-badge{background:var(--accent);color:var(--accent-ink);border-radius:999px;padding:2px 10px;font-size:.8rem;font-weight:700;display:inline-block}.palette-grid{grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px;display:grid}.palette-option{min-height:var(--tap);border:2px solid var(--border);background:var(--surface);color:var(--text);font:inherit;text-align:left;cursor:pointer;border-radius:10px;flex-direction:column;align-items:flex-start;gap:6px;padding:10px;font-size:.8rem;display:flex}.palette-option.on{border-color:var(--brand);font-weight:700}.swatches{gap:4px;display:flex}.swatches span{border:1px solid #0000001f;border-radius:50%;width:18px;height:18px}@media (width>=768px){:root{--rail:88px}.topbar{padding-left:calc(var(--rail) + 24px)}.tabbar{width:var(--rail);border-top:0;border-right:1px solid var(--border);flex-direction:column;justify-content:flex-start;gap:6px;padding:72px 8px 16px;top:0;bottom:0;right:auto}.tab{width:100%;min-width:0;padding:10px 0}.tab.active{background:var(--code-bg)}.screen{max-width:960px;padding:28px 32px 48px calc(var(--rail) + 32px)}h1{font-size:1.85rem}.lesson-list{grid-template-columns:repeat(2,1fr);gap:14px;display:grid}.lesson-list .card{height:100%;margin-bottom:0}.q-list{grid-template-columns:repeat(2,1fr);align-items:start;gap:14px;display:grid}.q-list .card{margin-bottom:0}.lesson,.clash,.settings-list{margin-inline:auto}.lesson{max-width:760px}.clash{max-width:720px}.live-wrap{margin:16px 0}.live-block{border:1px solid var(--border);border-radius:10px;overflow:hidden}.player-nav{grid-template-columns:160px 220px;justify-content:space-between;bottom:0}.player-nav.single{grid-template-columns:320px;justify-content:end}.settings-list{max-width:640px}a.card:hover{border-color:color-mix(in srgb, var(--brand) 35%, var(--border))}.clash-options{grid-template-columns:1fr 1fr}}@media (width>=1100px){:root{--rail:232px}.topbar{width:var(--rail);z-index:3;background:0 0;border-bottom:0;padding:16px 20px;position:fixed;top:0;left:0}.tabbar{padding:76px 12px 16px}.tab{flex-direction:row;justify-content:flex-start;gap:12px;padding:10px 14px;font-size:.95rem}.tab-icon{margin:0}.screen{max-width:calc(1120px + var(--rail));padding:40px 48px 64px calc(var(--rail) + 48px)}.lesson-list{grid-template-columns:repeat(3,1fr)}.lesson.challenge{max-width:1120px}.challenge-grid{grid-template-columns:minmax(0,1fr) 340px;align-items:start;gap:16px;display:grid}.challenge-side{max-height:calc(100dvh - 32px);position:sticky;top:16px;overflow-y:auto}.challenge-side .player-nav{background:0 0;grid-template-columns:1fr;padding:0;position:static}}:focus-visible{outline:3px solid var(--accent);outline-offset:2px}
