:root{--bg:#f6f1e7;--surface:#fffaf0;--surface-2:#efe7d8;--ink:#2b2622;--muted:#776d63;--line:#d8ccb8;--cell:#fffdf8;--cell-start:#f0e4cb;--cell-stroke:#2b2622;--seat0:#2f7d6d;--seat0-soft:#cfe7df;--seat1:#c2412d;--seat1-soft:#f6d5cc;--ok:#2e8b57;--partial:#b7860b;--bad:#d0342c;--pending:#3466c2;--pending-soft:#d6e2f8;--shadow:0 1px 2px #00000014, 0 4px 16px #0000000f;--radius:14px;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:root{--bg:#1c1a17;--surface:#26231f;--surface-2:#322e29;--ink:#f1ebe1;--muted:#a99f93;--line:#463f37;--cell:#2e2a25;--cell-start:#3d3529;--cell-stroke:#b8ad9f;--seat0:#5cbfa8;--seat0-soft:#23463f;--seat1:#f07a63;--seat1-soft:#4f2c25;--ok:#5cc98a;--partial:#e6b84a;--bad:#ff6b5e;--pending:#7fa6ff;--pending-soft:#2b3a5c;--shadow:0 1px 2px #0006, 0 4px 16px #0000004d;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}*{box-sizing:border-box}html,body{background:var(--bg);color:var(--ink);-webkit-tap-highlight-color:transparent;overscroll-behavior-y:none;margin:0;font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;font-size:16px;line-height:1.4}#app{max-width:540px;min-height:100dvh;padding:max(10px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));flex-direction:column;margin:0 auto;display:flex}button{font:inherit;color:inherit;cursor:pointer;border:1px solid var(--line);background:var(--surface);touch-action:manipulation;border-radius:10px;min-height:44px;padding:10px 14px}button:disabled{opacity:.45;cursor:default}button.primary{background:var(--ink);color:var(--bg);border-color:var(--ink);font-weight:650}button.link{min-height:0;color:var(--muted);text-underline-offset:3px;background:0 0;border:none;padding:6px 4px;text-decoration:underline}input[type=text]{font:inherit;color:inherit;background:var(--surface);border:1px solid var(--line);border-radius:10px;width:100%;min-height:44px;padding:10px 12px}h1,h2,h3{margin:0;line-height:1.15}.topbar{align-items:center;gap:8px;min-height:44px;margin-bottom:6px;display:flex}.topbar .brand{letter-spacing:.02em;background:0 0;border:none;padding:0 4px;font-size:20px;font-weight:800}.topbar .spacer{flex:1}.topbar button.icon{min-width:44px;color:var(--muted);background:0 0;border:none;padding:8px;font-size:15px}.players{grid-template-columns:1fr 1fr;gap:8px;display:grid}.player{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);border:2px solid #0000;min-width:0;padding:8px 12px;position:relative}.player.turn.seat0{border-color:var(--seat0)}.player.turn.seat1{border-color:var(--seat1)}.player .name-row{align-items:center;gap:6px;min-width:0;display:flex}.player .swatch{border-radius:50%;flex:none;width:10px;height:10px}.player.seat0 .swatch{background:var(--seat0)}.player.seat1 .swatch{background:var(--seat1)}.player .name{text-overflow:ellipsis;white-space:nowrap;text-align:left;background:0 0;border:none;min-height:0;padding:0;font-weight:600;overflow:hidden}.player .name.editable{-webkit-text-decoration:underline dotted var(--muted);text-decoration:underline dotted var(--muted);text-underline-offset:3px}.player .score{font-variant-numeric:tabular-nums;font-size:28px;font-weight:750}.player .meta{color:var(--muted);align-items:center;gap:6px;font-size:12px;display:flex}.presence{background:var(--line);border-radius:50%;width:8px;height:8px;display:inline-block}.presence.on{background:var(--ok)}.player form{gap:4px;display:flex}.player form input,.player form button{min-height:34px;padding:4px 8px}.board-wrap{justify-content:center;margin:10px 0 4px;display:flex}svg.board{touch-action:none;-webkit-user-select:none;user-select:none;width:100%;max-width:460px;max-height:50dvh}.board .cell polygon{fill:var(--cell);stroke:var(--cell-stroke);stroke-width:2.5px}.board .cell.start polygon{fill:var(--cell-start)}.board .cell.empty.can-place polygon{cursor:pointer}.board .cell.empty.blocked polygon{fill:var(--surface-2);stroke:var(--line)}.board .cell.last.seat0 polygon{fill:var(--seat0-soft)}.board .cell.last.seat1 polygon{fill:var(--seat1-soft)}.board .cell.selected polygon{fill:var(--pending-soft);stroke:var(--pending);stroke-width:4px;stroke-dasharray:10 6}.board .cell.pending polygon{fill:var(--pending-soft);stroke:var(--pending);stroke-width:4px}.board .cell.in-path polygon{stroke-width:4px}.board .cell.in-path.ok polygon{stroke:var(--ok)}.board .cell.in-path.partial polygon{stroke:var(--partial)}.board .cell.in-path.invalid polygon{stroke:var(--bad)}.board .cell text{fill:var(--ink);text-anchor:middle;dominant-baseline:central;pointer-events:none;font-family:ui-rounded,SF Pro Rounded,Segoe UI,system-ui,sans-serif;font-size:44px;font-weight:800}.board .cell.pending text{fill:var(--pending)}.board .cell .placed-ring{fill:none;stroke-width:3px}.board .cell.seat0 .placed-ring{stroke:var(--seat0)}.board .cell.seat1 .placed-ring{stroke:var(--seat1)}.board .trace{fill:none;stroke-width:9px;stroke-linecap:round;stroke-linejoin:round;opacity:.45;pointer-events:none}.board .trace.ok{stroke:var(--ok)}.board .trace.partial,.board .trace.empty{stroke:var(--partial)}.board .trace.invalid{stroke:var(--bad)}.board .trace.history{stroke:var(--pending)}.board .trace-start{pointer-events:none;opacity:.6;fill:var(--partial)}.board .trace-start.ok{fill:var(--ok)}.board .trace-start.invalid{fill:var(--bad)}.board .trace-start.history{fill:var(--pending)}.panel{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);flex-direction:column;gap:10px;padding:12px;display:flex}.panel .hint{color:var(--muted);text-align:center;margin:2px 0}.panel .word{text-align:center;letter-spacing:.08em;min-height:36px;font-family:ui-rounded,SF Pro Rounded,Segoe UI,system-ui,sans-serif;font-size:28px;font-weight:800}.panel .word.ok{color:var(--ok)}.panel .word.partial{color:var(--partial)}.panel .word.invalid{color:var(--bad)}.panel .status{text-align:center;color:var(--muted);min-height:20px;font-size:14px}.panel .status.invalid{color:var(--bad)}.row{gap:8px;display:flex}.row>button{flex:1}.row>button.primary{flex:2}.error{color:var(--bad);text-align:center;font-size:14px}.sheet-backdrop{z-index:10;background:#0000004d;justify-content:center;align-items:flex-end;display:flex;position:fixed;inset:0}.sheet{background:var(--surface);width:100%;max-width:540px;padding:14px 14px max(14px, env(safe-area-inset-bottom));border-radius:18px 18px 0 0;box-shadow:0 -4px 24px #0003}.sheet h3{text-align:center;color:var(--muted);margin-bottom:10px;font-size:15px;font-weight:600}.letters{grid-template-columns:repeat(7,1fr);gap:6px;display:grid}.letters button{background:var(--cell);min-height:48px;padding:0;font-size:22px;font-weight:750}.letters button:active{background:var(--pending-soft)}.sheet .row{margin-top:10px}.history{margin-top:12px}.history h3{color:var(--muted);margin-bottom:6px;font-size:14px;font-weight:600}.history ol{flex-direction:column;gap:2px;margin:0;padding:0;list-style:none;display:flex}.history li button,.history li .item{text-align:left;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;width:100%;min-height:36px;padding:6px 8px;display:flex}.history li button.active{background:var(--pending-soft)}.history .who{background:var(--line);border-radius:50%;flex:none;width:10px;height:10px}.history .who.seat0{background:var(--seat0)}.history .who.seat1{background:var(--seat1)}.history .w{letter-spacing:.04em;flex:1;font-weight:700}.history .pts{color:var(--muted);font-variant-numeric:tabular-nums}.home{flex-direction:column;gap:18px;padding-top:24px;display:flex}.home .hero{text-align:center}.home .hero h1{letter-spacing:.02em;font-size:48px;font-weight:850}.home .hero p{color:var(--muted);margin:6px 0 0}.home .actions{flex-direction:column;gap:10px;display:flex}.home .actions button{min-height:54px;font-size:17px}.card{background:var(--surface);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px}.card h2{margin-bottom:8px;font-size:16px}.rules ul{margin:0;padding-left:20px}.rules li{margin:4px 0}.games-list{flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;display:flex}.games-list button{text-align:left;justify-content:space-between;gap:8px;width:100%;display:flex}.games-list .sub{color:var(--muted);font-size:14px}.invite{border:2px dashed var(--line);border-radius:var(--radius);text-align:center;flex-direction:column;gap:8px;margin-bottom:8px;padding:12px;display:flex}.invite .url{color:var(--muted);word-break:break-all;font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px}.banner{text-align:center;color:var(--muted);padding:6px;font-size:14px}.banner.warn{color:var(--bad)}.toast{left:50%;bottom:max(20px, env(safe-area-inset-bottom));background:var(--ink);color:var(--bg);z-index:20;box-shadow:var(--shadow);border-radius:999px;padding:10px 16px;font-size:14px;position:fixed;transform:translate(-50%)}.center{text-align:center}.muted{color:var(--muted)}
