: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}@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 .win-line{stroke:var(--gold);stroke-width:9;stroke-linecap:round;opacity:.9;pointer-events:none}.board .win-line.draw{stroke-dasharray:1;animation:draw-line .5s ease-out .25s both}@keyframes draw-line{0%{stroke-dashoffset:1}to{stroke-dashoffset:0}}.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.win .body{stroke:var(--gold);stroke-width:4}.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 .win-line{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}.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}
