:root{--bg: #12100e;--surface: #1d1a17;--surface-hover: #27231f;--border: #332d27;--text: #f3eee7;--muted: #a89e92;--accent: #e8b04b;--accent-text: #2a1b02;--gold: #ffcf5c;--danger: #ff6b5e;--wood-light: #f0c987;--wood: #dcaa62;--wood-dark: #a8763a;--line: #3b2612;--p1: #26231f;--p1-light: #6b655e;--p1-dark: #050404;--p2: #f4f0e8;--p2-light: #ffffff;--p2-dark: #bdb4a6;--mark: #e5483b;--radius: 14px;color-scheme:dark}*,*:before,*:after{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font:16px/1.45 system-ui,-apple-system,Segoe UI,Roboto,sans-serif;-webkit-font-smoothing:antialiased;-webkit-tap-highlight-color:transparent}html.playing .pl-info,html.playing .pl-lang-hint{display:none}html.playing,html.playing body{overflow:hidden;overscroll-behavior:none}@media(display-mode:standalone){html .pl-info,html .pl-lang-hint{display:none}}button,select,input{font:inherit;color:inherit}button{cursor:pointer}a{color:inherit}h1,h2,p{margin:0}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}:focus-visible{outline:3px solid var(--gold);outline-offset:2px}.app{max-width:480px;margin:0 auto;height:var(--app-height, 100dvh);display:flex;flex-direction:column}.screen{flex:1;min-height:0;display:flex;flex-direction:column;padding:max(12px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left))}.scroll{flex:1;min-height:0;overflow-y:auto;scrollbar-width:none;display:flex;flex-direction:column;gap:10px}.grow{flex:1}.muted{color:var(--muted)}.small{font-size:13px}.link{color:var(--accent);font-weight:600;text-align:center;padding:8px}.topbar{display:flex;align-items:center;gap:8px;min-height:48px}.topbar h1{flex:1;font-size:17px;font-weight:650;text-align:center}.topbar h1 small{display:block;font-size:12px;font-weight:500;color:var(--muted)}.topbar-actions{min-width:44px}.icon-btn{width:44px;height:44px;flex:none;border-radius:12px;border:1px solid var(--border);background:var(--surface);display:grid;place-items:center}.icon-btn svg{width:20px;height:20px}.btn{min-height:52px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);font-weight:600;font-size:16px;padding:0 18px;display:inline-flex;align-items:center;justify-content:center;text-decoration:none}.btn:active{background:var(--surface-hover)}.btn:disabled{opacity:.45;cursor:default}.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.btn-row{display:flex;gap:10px}.btn-row>*{flex:1}.btn-row.three{gap:8px}.btn-row.three .btn{padding:0 8px}.dock{margin-top:auto;padding-top:12px;display:flex;flex-direction:column;gap:10px}.links{display:flex;justify-content:center}.links a{color:var(--muted);min-height:44px;display:inline-flex;align-items:center;padding:0 12px;font-size:14px;text-decoration:none}.hero{text-align:center;padding:10px 0 6px}.hero h1{margin:12px 0 2px;font-size:30px;letter-spacing:-.02em}.hero p{color:var(--muted);font-size:15px}.logo{width:132px;height:auto;display:block;margin:0 auto}.logo-board{fill:var(--wood)}.logo-lines{fill:none;stroke:var(--line);stroke-width:2;opacity:.8}.logo-five{stroke:var(--gold);stroke-width:5;stroke-linecap:round;opacity:.9}.logo-p1{fill:var(--p1);stroke:var(--p1-dark);stroke-width:1.5}.logo-p2{fill:var(--p2);stroke:var(--p2-dark);stroke-width:1.5}.modes{display:flex;flex-direction:column;gap:10px;margin-top:8px}.mode{display:flex;align-items:center;gap:14px;padding:14px;text-align:left;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);min-height:64px;width:100%}.mode b{display:block}.mode-text span{color:var(--muted);font-size:13px}.mode.selected{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}.mode.soon{opacity:.5;cursor:default}.levels{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;padding:4px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.levels button{min-height:44px;border:0;border-radius:10px;background:transparent;font-size:14px;font-weight:600;color:var(--muted)}.levels button.on{background:var(--surface-hover);color:var(--text);box-shadow:inset 0 0 0 1px var(--border)}.levels button:disabled{opacity:.4;cursor:default}.colours{display:grid;grid-template-columns:auto repeat(3,1fr);align-items:center;gap:6px;padding:4px 4px 4px 12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.colours>span{font-size:13px;color:var(--muted);padding-right:4px}.colours button{min-height:40px;border:0;border-radius:10px;background:transparent;font-size:13px;font-weight:600;color:var(--muted);display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:0 4px}.colours button.on{background:var(--surface-hover);color:var(--text);box-shadow:inset 0 0 0 1px var(--border)}.colours .chip{width:16px;height:16px}.players{display:flex;align-items:center;gap:10px;margin:6px 0 8px}.pl{flex:1;min-width:0;display:flex;align-items:center;gap:10px;padding:10px 12px;border-radius:var(--radius);border:1px solid var(--border);background:var(--surface);transition:border-color .2s,box-shadow .2s}.pl.p2{flex-direction:row-reverse;text-align:right}.pl.turn{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}.pl-text{min-width:0}.pl .nm{color:var(--text);font-weight:600;font-size:15px;line-height:1.2}.pl .sub{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.vs{color:var(--muted);font-size:12px;font-weight:700}.chip{width:26px;height:26px;flex:none;border-radius:50%;display:inline-block;vertical-align:middle;position:relative}.chip.p1{background:radial-gradient(circle at 36% 30%,var(--p1-light),var(--p1) 45%,var(--p1-dark));box-shadow:0 0 0 1px #ffffff29}.chip.p2{background:radial-gradient(circle at 36% 30%,var(--p2-light),var(--p2) 60%,var(--p2-dark))}.board-wrap{flex:1;min-height:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.movebar{display:flex;justify-content:space-between;width:100%;font-size:13px;color:var(--muted);padding:0 4px}.board-box{flex:1;min-height:0;width:calc(100% + 20px);margin:0 -10px;max-height:500px;container-type:size;display:grid;place-items:center}.board{width:min(100cqw,100cqh);border-radius:10px;height:auto;aspect-ratio:1;display:block;user-select:none;-webkit-user-select:none;touch-action:manipulation;filter:drop-shadow(0 10px 24px rgba(0,0,0,.45))}.board .wood{fill:url(#wood);stroke:var(--wood-dark);stroke-width:2}.board .lines{fill:none;stroke:var(--line);stroke-width:1.6;opacity:.85}.board .star{fill:var(--line)}.board:focus{outline:none}.board:focus-visible .wood{stroke:var(--gold);stroke-width:5}.board .hit{fill:transparent}.board .hit.free{cursor:pointer}.board .cross line{stroke:var(--accent);stroke-width:3;opacity:.7;pointer-events:none}.board .ghost{pointer-events:none;stroke-width:2}.board .ghost.p1{fill:var(--p1);stroke:var(--p1-dark)}.board .ghost.p2{fill:var(--p2);stroke:var(--p2-dark)}.board .ghost.hover{opacity:.35}.board .ghost.preview{opacity:.75;stroke:var(--gold);stroke-width:4;animation:breathe 1.2s ease-in-out infinite}@keyframes breathe{50%{opacity:.5}}.board .last{fill:var(--mark);pointer-events:none}.board .frame{fill:none;stroke:var(--line);stroke-width:2.4;opacity:.85}.board .coord text{fill:var(--line);font-size:15px;font-weight:600;text-anchor:middle;opacity:.75}.board .area{pointer-events:none}.board .area.p1{fill:var(--p1);opacity:.7}.board .area.p2{fill:var(--p2);opacity:.85;stroke:var(--p2-dark);stroke-width:1}.board .gone{pointer-events:none;animation:gone .45s ease-out both}.board .gone.p1{fill:var(--p1)}.board .gone.p2{fill:var(--p2)}@keyframes gone{0%{opacity:.9}to{opacity:0}}.board .mark-atari{fill:none;stroke:var(--danger);stroke-width:3.5;stroke-dasharray:6 4;pointer-events:none}.board .mark-target{fill:var(--accent);stroke:var(--accent-text);stroke-width:1.5;pointer-events:none}.board .mark-label{font-size:20px;font-weight:700;text-anchor:middle;fill:var(--line);pointer-events:none}.board .mark-label.free{paint-order:stroke;stroke:var(--wood-light);stroke-width:6px}.board .mark-label.on-black{fill:#fff}.board .mark-label.on-white{fill:#111}.board [class^=mark-] circle{stroke-width:4;pointer-events:none}.board [class^=mark-] text{font-size:20px;font-weight:800;text-anchor:middle;pointer-events:none}.board .mark-hint circle,.board .mark-better circle{fill:#50c87859;stroke:#2f9e58}.board .mark-hint circle{animation:breathe 1.2s ease-in-out infinite}.board .mark-better text,.board .mark-good text{fill:#155c30}.board .mark-good circle{fill:#50c87873;stroke:#2f9e58}.board .mark-bad circle,.board .mark-mistake circle{fill:#e5483b4d;stroke:var(--mark)}.board .mark-mistake text{fill:var(--mark)}.stone{pointer-events:none}.stone .shadow{fill:#28140059}.stone .body{stroke-width:1}.stone.p1 .body{fill:url(#stone-1);stroke:#000}.stone.p2 .body{fill:url(#stone-2);stroke:var(--p2-dark)}.stone .shine{fill:#fff;opacity:.18}.stone.p2 .shine{opacity:.5}.stone.dead{opacity:.55}.stone .dead-cross{stroke:var(--mark);stroke-width:4;stroke-linecap:round}.stone.drop{transform-box:fill-box;transform-origin:center;animation:drop .2s cubic-bezier(.3,1.3,.5,1) both}@keyframes drop{0%{transform:scale(1.35);opacity:0}}@media(prefers-reduced-motion:reduce){.stone,.board .ghost,.board .gone,.board .mark-hint circle{animation:none!important}}.status{text-align:center;min-height:44px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:15px}.status b{color:var(--text)}.status .confirm-hint b{color:var(--gold)}.think{display:inline-flex;gap:4px;margin-left:6px}.think i{width:6px;height:6px;border-radius:50%;background:var(--accent);animation:blink 1s infinite}.think i:nth-child(2){animation-delay:.15s}.think i:nth-child(3){animation-delay:.3s}@keyframes blink{50%{opacity:.2}}.sheet{margin-top:auto;background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:16px 16px 14px;display:flex;flex-direction:column;gap:12px;box-shadow:0 -10px 30px #00000059}.sheet h2{font-size:26px;text-align:center}.sheet .meta{text-align:center;color:var(--muted);font-size:14px;margin-top:-8px}.stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.stats div{background:var(--bg);border-radius:12px;padding:10px 6px;text-align:center}.stats b{display:block;font-size:20px}.stats span{font-size:12px;color:var(--muted)}.play.ended .board-box{max-height:320px}.play.ended .movebar,.play.ended .status{display:none}.prose{gap:12px;line-height:1.55}.prose h2{font-size:17px;margin-top:8px}.prose ul{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:6px}.label{font-size:12px;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);margin:12px 2px 0;font-weight:600}.setting{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:56px;padding:8px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--border)}.setting small{display:block;color:var(--muted);font-size:12px;margin-top:2px}.setting small .chip{width:20px;height:20px}.setting input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent);flex:none}.setting select{padding:6px 8px;border-radius:8px;border:1px solid var(--border);background:var(--surface-hover);max-width:50%}.consent{position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom,0px));z-index:10;max-width:456px;margin:0 auto;padding:14px;border-radius:14px;background:var(--surface);border:1px solid var(--border);box-shadow:0 12px 30px #0006;font-size:14px}.consent a{color:var(--accent)}.consent .row{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:10px}@media(max-height:700px){.hero{padding:0}.logo{width:96px}.hero h1{font-size:24px;margin-top:6px}.mode{min-height:56px;padding:10px 12px}.players{margin:2px 0 6px}.pl{padding:6px 10px}.movebar{display:none}}.legal-links{margin:4px 0}.rank-card{display:flex;align-items:center;justify-content:space-between;gap:12px;width:100%;padding:14px 16px;border-radius:var(--radius);border:1px solid var(--border);background:linear-gradient(135deg,var(--surface-hover),var(--surface));text-align:left}.rank b{display:block;font-size:26px;line-height:1.1;color:var(--gold)}.rank small,.rank-side small{display:block;color:var(--muted);font-size:12px}.rank-side{text-align:right;font-size:14px;font-weight:600}.next{display:flex;flex-direction:column;gap:8px}.next .label{margin-top:4px}.next-card{display:flex;flex-direction:column;gap:2px;width:100%;padding:12px 14px;border-radius:var(--radius);border:1px solid var(--border);border-left:4px solid var(--accent);background:var(--surface);text-align:left}.next-card span{color:var(--muted);font-size:13px}.next-card.problems{border-left-color:#6fb3d2}.next-card.level{border-left-color:#8bc48a}.logo-eye{fill:var(--line);opacity:.5}.levels.five{grid-template-columns:repeat(5,1fr)}.levels.two{grid-template-columns:repeat(2,1fr)}.level-text{color:var(--muted);font-size:13px;margin:-2px 4px 0;min-height:2.9em}.level-text b{color:var(--text)}.scroll>.label{margin-bottom:-4px}.btn-row.four{gap:6px}.btn-row.four .btn{padding:0 4px;font-size:15px}.status .notice{color:var(--gold);font-size:14px;line-height:1.3}.sheet.scoring{gap:8px}.score-line{display:flex;justify-content:space-around;font-size:20px;font-weight:700}.score-line span{display:inline-flex;align-items:center;gap:8px}.score-line .chip{width:22px;height:22px}.play.counting .board-box{max-height:320px}.tsumego,.exercise{flex:1;min-height:0;display:flex;flex-direction:column;gap:10px}.feedback{min-height:48px;padding:10px 12px;border-radius:12px;background:var(--surface);border:1px solid var(--border);font-size:15px;line-height:1.35;display:flex;align-items:center;gap:8px}.feedback.empty{visibility:hidden}.feedback.wrong{border-color:var(--danger)}.feedback.solved{border-color:#2f9e58;color:#9be2b2}.prompt{font-size:15px;line-height:1.4}.board-box.small{flex:none;height:min(70vw,300px)}.lesson-intro{gap:12px;line-height:1.5;font-size:16px}.lesson-done{align-items:center;justify-content:center;text-align:center;gap:12px}.done-badge{width:84px;height:84px;border-radius:50%;display:grid;place-items:center;font-size:44px;font-weight:800;color:var(--accent-text);background:var(--accent)}.steps{display:flex;gap:4px;margin:2px 0 10px}.steps i{flex:1;height:5px;border-radius:3px;background:var(--border)}.steps i.done{background:var(--accent)}.steps i.now{background:var(--gold);opacity:.6}.choices{display:flex;flex-direction:column;gap:8px}.choices .btn.right{border-color:#2f9e58;background:#2f9e5833}.choices .btn.wrong{border-color:var(--danger)}.solved-line{display:flex;align-items:center;justify-content:center;gap:10px;font-weight:600}.stars{display:inline-flex;gap:2px}.stars i{width:12px;height:12px;background:var(--border);clip-path:polygon(50% 0,61% 35%,98% 35%,68% 57%,79% 91%,50% 70%,21% 91%,32% 57%,2% 35%,39% 35%)}.stars i.on{background:var(--gold)}.solved-line .stars i{width:22px;height:22px}.tiles{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}.tile{aspect-ratio:1;border-radius:12px;border:1px solid var(--border);background:var(--surface);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px}.tile.done{border-color:var(--accent)}.tile b{font-size:17px}.tile .stars i{width:9px;height:9px}.lessons{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.lesson-row{width:100%;min-height:48px;display:flex;align-items:center;gap:12px;padding:8px 12px;border-radius:12px;border:1px solid var(--border);background:var(--surface);text-align:left}.lesson-row .num{width:28px;height:28px;flex:none;border-radius:50%;display:grid;place-items:center;font-size:13px;font-weight:700;background:var(--surface-hover);color:var(--muted)}.lesson-row.done .num{background:var(--accent);color:var(--accent-text)}.grades{display:grid;grid-template-columns:1fr 1fr;gap:8px}.grade-card{display:flex;flex-direction:column;gap:4px;padding:12px;border-radius:12px;border:1px solid var(--border);background:var(--surface);text-align:left}.grade-card span{color:var(--muted);font-size:12px}.grade-card .bar{display:block;height:5px;border-radius:3px;background:var(--border);overflow:hidden}.grade-card .bar i{display:block;height:100%;background:var(--accent)}.review-text{min-height:44px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;text-align:center;font-size:14px;color:var(--muted)}.review-text progress{width:70%;accent-color:var(--accent)}.moments{display:flex;gap:6px;flex-wrap:wrap;justify-content:center}.moment{min-height:40px;padding:4px 10px;border-radius:10px;border:1px solid var(--border);background:var(--surface);font-size:13px;font-weight:600;display:inline-flex;flex-direction:column;align-items:center;line-height:1.15}.moment small{color:var(--danger);font-size:11px}.moment.on{border-color:var(--accent);box-shadow:0 0 0 1px var(--accent) inset}.btn svg{width:22px;height:22px}.share{position:relative}.share-note{position:absolute;top:calc(100% + 6px);right:0;z-index:21;white-space:nowrap;padding:6px 10px;border-radius:10px;border:1px solid var(--border);background:var(--surface);font-size:13px;box-shadow:0 10px 30px #0006}.share-note:empty{display:none}
