:root{--bg: #0b0d1c;--surface: #151a33;--line: #2a3057;--ink: #eef1ff;--muted: #9aa3cc;--accent: #7c8cff;--accent-ink: #0b0d1c;--good: #4fd18b;--bad: #ff6b7a;--lit: #ffcf5a;color-scheme:dark}:root{--pad-bg: var(--bg);--pad-surface: var(--surface);--pad-ink: var(--ink);--pad-muted: var(--muted);--pad-line: var(--line);--pad-accent: var(--accent);--pad-accent-strong: var(--accent);--pad-accent-ink: var(--accent-ink);--pad-tile: var(--line)}@media(prefers-color-scheme:light){:root{--bg: #f5f6fb;--surface: #ffffff;--line: #dfe3f2;--ink: #161a2e;--muted: #5d6488;--accent: #4353d6;--accent-ink: #ffffff;--good: #138a4c;--bad: #c8283b;--lit: #c47f00;color-scheme:light}}*{box-sizing:border-box}html,body{height:100%;margin:0}body{display:flex;flex-direction:column;background:var(--bg);color:var(--ink);font:16px/1.5 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;overscroll-behavior:none;touch-action:manipulation}.hud{font-variant-numeric:tabular-nums;font-weight:700}.room-code{font:inherit;font-size:1.3rem;font-weight:700;letter-spacing:.15em;text-align:center;text-transform:uppercase;width:8em;padding:8px 10px;color:inherit;background:transparent;border:2px solid currentColor;border-radius:10px}.board{margin:0 max(12px,env(safe-area-inset-left)) 6px;color:var(--muted);font-size:.9rem;font-variant-numeric:tabular-nums}.board[hidden]{display:none}.pause{padding:4px 12px;font-size:.9rem}.pause[hidden]{display:none}.best{font-weight:700}.best:empty{display:none}button{font:inherit;font-weight:700;padding:12px 28px;color:var(--accent-ink);background:var(--accent);border:0;border-radius:999px;cursor:pointer}button:hover{filter:brightness(1.08)}.links{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 16px;margin:4px 0 0}.link{padding:0;color:var(--muted);background:none;font-weight:400;text-decoration:underline}.link:hover{color:var(--ink)}.tabs{display:flex;gap:4px;margin:0 max(12px,env(safe-area-inset-left)) 8px max(12px,env(safe-area-inset-right));padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:999px;overflow-x:auto;scrollbar-width:none}.tabs .tab{flex:1;padding:8px 10px;color:var(--muted);background:none;font-size:.95rem;white-space:nowrap}.tabs .tab[aria-current=true]{color:var(--accent-ink);background:var(--accent)}body:not([data-mode=arcade]) .pause{display:none}.gear{padding:4px 10px;font-size:1.15rem;color:var(--ink);background:none}main{flex:1;min-height:0;display:grid;grid-template-columns:minmax(0,1.25fr) minmax(320px,1fr);gap:12px;margin:0 max(12px,env(safe-area-inset-left)) max(12px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-right))}@media(max-width:820px),(max-aspect-ratio:1/1){main{grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);gap:8px}}.tree-pane,.mode-pane{min-height:0;background:var(--surface);border:1px solid var(--line);border-radius:16px}.tree-pane{display:flex;align-items:center;justify-content:center;padding:6px}.mode-pane{display:flex;flex-direction:column;overflow:hidden;padding:14px}.mode-scroll{flex:1;min-height:0;display:flex;flex-direction:column;overflow:auto}.tree{display:block;width:100%;height:100%;max-height:100%;user-select:none;-webkit-user-select:none}@media(max-width:820px),(max-aspect-ratio:1/1){.tree{height:auto;max-height:36vh}.tree-pane{padding:2px}.tabs .tab{padding:7px 4px;font-size:.88rem}}.tree .legend text{fill:var(--muted);font:600 26px system-ui,sans-serif}.tree .edge{stroke:var(--muted);stroke-width:3.5;stroke-linecap:round;transition:stroke .12s}.tree .edge.dot{stroke-dasharray:.5 9;stroke-width:5}.tree .edge.dash{stroke-dasharray:14 9;stroke-linecap:butt}.tree .edge.empty{opacity:.35}.tree .edge.on{stroke:var(--lit);stroke-width:6}.tree .edge.dot.on{stroke-width:8}.tree .node circle{fill:var(--bg);stroke:var(--ink);stroke-width:3;transition:fill .12s,stroke .12s}.tree .node .hit{fill:transparent;stroke:none}.tree .node text{fill:var(--ink);font-family:Georgia,Times New Roman,serif;text-anchor:middle;pointer-events:none}.tree .node.root text{font-family:system-ui,sans-serif;font-weight:700}.tree .node[data-ch]{cursor:pointer}.tree .node.empty circle{stroke:var(--muted);opacity:.4}.tree .node.unknown{opacity:.3}.tree .node.on circle{stroke:var(--lit)}.tree .node.here circle:not(.hit){fill:var(--lit);stroke:var(--lit)}.tree .node.here text{fill:var(--bg);font-weight:700}.tree .node.here.unknown,.tree .node.on.unknown{opacity:1}.tree .node.good circle:not(.hit){animation:flash-good .9s ease-out}.tree .node.bad circle:not(.hit){animation:flash-bad .9s ease-out}@keyframes flash-good{0%,40%{fill:var(--good);stroke:var(--good)}}@keyframes flash-bad{0%,40%{fill:var(--bad);stroke:var(--bad)}}.mode{display:flex;flex-direction:column;gap:10px}.mode[hidden]{display:none}.mode h2,.mode h3,.mode p{margin:0}.muted{color:var(--muted)}.good{color:var(--good)}.bad{color:var(--bad)}.row{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}button.small{padding:6px 14px;font-size:.9rem;color:var(--ink);background:var(--line)}button.primary{align-self:flex-start}button:disabled{opacity:.35;cursor:default}.choice{display:inline-flex;padding:3px;border:1px solid var(--line);border-radius:999px}.choice button{padding:5px 12px;font-size:.85rem;color:var(--muted);background:none}.choice button[aria-checked=true]{color:var(--ink);background:var(--line)}.readout{display:flex;align-items:baseline;gap:18px}.big-char{font:700 4rem/1 Georgia,serif;min-width:1ch}.big-code,.target-code,.meet-code{font-size:2rem;font-weight:700;letter-spacing:.1em;color:var(--lit)}.typed{min-height:1.5em;font:700 1.4rem/1.3 ui-monospace,monospace;letter-spacing:.08em;word-break:break-all}.lesson-head{display:flex;align-items:center;gap:10px}.lesson-title{flex:1;text-align:center;font-size:1.2rem}.lesson-body{display:flex;flex-direction:column;gap:10px}.step{min-width:40px}.meet-row{display:flex;flex-wrap:wrap;gap:10px}.meet{display:flex;align-items:baseline;gap:14px;padding:10px 18px;color:var(--ink);background:var(--bg);border:2px solid var(--line);border-radius:14px}.meet-char{font:700 2.6rem/1 Georgia,serif}.quiz{display:flex;flex-direction:column;gap:10px}.quiz-status{flex:1;font-weight:700}.quiz-feedback{min-height:1.6em;font-size:1.15rem;font-weight:700;white-space:pre-wrap}.answers{display:grid;grid-template-columns:repeat(auto-fill,minmax(52px,1fr));gap:6px}.answer{padding:10px 0;font:700 1.35rem/1.2 Georgia,serif;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:10px}.word-row{display:flex;gap:8px}.word-input{flex:1;min-width:0;padding:10px 14px;font:700 1.2rem/1.2 ui-monospace,monospace;letter-spacing:.1em;text-transform:uppercase;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:10px}.target{font:700 3.2rem/1.1 Georgia,serif;letter-spacing:.08em}.target .done{color:var(--good)}.target .now{text-decoration:underline;text-decoration-color:var(--lit);text-underline-offset:8px}.keypad{flex:none;display:flex;gap:10px;padding-top:12px}.keypad[hidden]{display:none}.key{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:108px;border-radius:20px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:none;transition:transform .05s}.key small{font-weight:400;font-size:.75rem;opacity:.8}.key-face{font-size:1.6rem;letter-spacing:.1em}.key.dot .key-face,.key.dash .key-face{font-size:2.6rem;line-height:1}.key.down{transform:scale(.97);background:var(--lit);filter:none}.keypad[data-style=straight] .dot,.keypad[data-style=straight] .dash,.keypad[data-style=buttons] .straight{display:none}.mode.arcade{flex:1;min-height:0}.arcade-box{position:relative;flex:1;min-height:220px}.arcade-canvas{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%}.cover{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--surface) 85%,transparent);border-radius:12px}.cover[hidden]{display:none}.cover-card{display:flex;flex-direction:column;align-items:center;gap:10px;max-width:34ch;text-align:center}.cover-card button.primary{align-self:center}.settings{display:flex;flex-direction:column;gap:6px;text-align:left}.setting{display:grid;grid-template-columns:9.5em 1fr 5.5em;align-items:center;gap:10px;margin-top:6px}.setting select{grid-column:2 / 4;font:inherit;padding:6px}.setting.check{grid-template-columns:auto 1fr}.settings small{margin-left:calc(9.5em + 10px);line-height:1.3}@media(max-width:520px){.setting{grid-template-columns:1fr 5em}.setting>span{grid-column:1 / 3}.setting select{grid-column:1 / 3}.settings small{margin-left:0}}html:not(.has-pad-guide) [data-pad-guide-open]{display:none}.tree-pane{position:relative}.tree-scroll{width:100%;height:100%;display:flex;align-items:center}.zoom{display:none;position:absolute;right:8px;bottom:8px;padding:4px 10px;font-size:.78rem;opacity:.9}@media(max-width:820px),(max-aspect-ratio:1/1){.zoom{display:block}.tree-pane.zoomed .tree-scroll{overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;display:block}.tree-pane.zoomed .tree-scroll::-webkit-scrollbar{display:none}.tree-pane.zoomed .tree{width:auto;height:min(40vh,400px);max-width:none;max-height:none}.tree-pane.zoomed{padding-bottom:34px}.tabs .tab{padding:7px 2px;font-size:.82rem}}.wire-lobby,.wire-line{display:flex;flex-direction:column;gap:10px}.wire-lobby[hidden],.wire-line[hidden]{display:none}.wire-line h3{font-size:.95rem;color:var(--muted)}.wire-line .row h3{flex:1;color:var(--ink);font-size:1.1rem}.tiles{display:flex;flex-wrap:wrap;gap:6px;min-height:52px}.tile{display:inline-flex;flex-direction:column;align-items:center;justify-content:center;min-width:44px;height:52px;padding:0 6px;font:700 1.4rem/1 Georgia,serif;color:var(--muted);background:var(--bg);border:2px solid var(--line);border-radius:10px}.tile.now{border-color:var(--lit);color:var(--lit)}.tile.right{color:var(--good);border-color:var(--good)}.tile.wrong{color:var(--bad);border-color:var(--bad)}.tile.shown{color:var(--ink)}.tile-code{font:600 .7rem/1 system-ui,sans-serif;letter-spacing:.08em;color:var(--muted);margin-top:4px}.tile-gap{width:14px}@media(max-width:820px),(max-aspect-ratio:1/1){.key{min-height:84px}.mode-pane{padding:10px 12px}}@media(max-width:820px),(max-aspect-ratio:1/1){.tile{min-width:38px;height:46px;font-size:1.25rem}.wire-line{gap:8px}}
