:root{--bg:#f4f6fb;--surface:#fff;--text:#141a2b;--muted:#5b6478;--border:#dde2ee;--accent:#2459e0;--accent-text:#fff;--sea:#cfe3f5;--sea-hover:#b5d3ee;--sea-line:#9fc2e3;--ship:#5b6478;--sunk:#8a1c1f;--hit:#e5383b;--miss:#6f86a3;--ghost:#9fd8a8;--ghost-bad:#f2a5a5;--online:#1f9d55;--error:#c62828;--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}@media (prefers-color-scheme:dark){:root:not([data-theme=light]){--bg:#0e1424;--surface:#182036;--text:#e8ecf6;--muted:#9aa3b8;--border:#2a3450;--accent:#4f7dff;--sea:#15284a;--sea-hover:#1d3762;--sea-line:#0b1730;--ship:#9aa3b8;--sunk:#c0392b;--miss:#5d7393;--ghost:#2f6b3b;--ghost-bad:#7a2a2a;--online:#3ecf7f;--error:#ff6b6b;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}}:root[data-theme=dark]{--bg:#0e1424;--surface:#182036;--text:#e8ecf6;--muted:#9aa3b8;--border:#2a3450;--accent:#4f7dff;--sea:#15284a;--sea-hover:#1d3762;--sea-line:#0b1730;--ship:#9aa3b8;--sunk:#c0392b;--miss:#5d7393;--ghost:#2f6b3b;--ghost-bad:#7a2a2a;--online:#3ecf7f;--error:#ff6b6b;--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;padding:0}body{background:var(--bg);color:var(--text);-webkit-font-smoothing:antialiased;font-family:system-ui,-apple-system,Segoe UI,Roboto,sans-serif;line-height:1.5}h2{margin:0 0 4px;font-size:1.35rem}.header{justify-content:space-between;align-items:center;max-width:640px;margin:0 auto;padding:16px;display:flex}.all-games{color:var(--muted);font-size:.875rem;text-decoration:none}.all-games:hover{color:var(--text)}.logo-mark{background:var(--ship);width:22px;height:8px;box-shadow:0 6px 0 -2px var(--sea-line);border-radius:999px}.logo{color:var(--text);align-items:center;gap:6px;font-size:1.1rem;font-weight:700;text-decoration:none;display:inline-flex}.main{max-width:640px;margin:0 auto;padding:8px 16px 48px}.card{background:var(--surface);border:1px solid var(--border);border-radius:16px;flex-direction:column;align-items:flex-start;gap:12px;max-width:420px;margin:24px auto 0;padding:24px;display:flex}.gate input{width:100%}.muted{color:var(--muted);margin:0}.small{font-size:.875rem}.center{text-align:center;margin-left:auto;margin-right:auto}.error{color:var(--error);margin:0}.actions{flex-wrap:wrap;gap:8px;display:flex}input{font:inherit;border:1px solid var(--border);background:var(--bg);color:var(--text);border-radius:10px;min-width:0;padding:10px 12px;font-size:max(1rem,16px)}input:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.button{font:inherit;border:1px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;border-radius:10px;justify-content:center;align-items:center;padding:10px 18px;font-weight:600;text-decoration:none;transition:transform .12s ease-out,background-color .12s ease-out;display:inline-flex}.button:active:not(:disabled){transform:scale(.97)}.button:disabled{opacity:.6;cursor:default}.button.subtle{color:var(--muted);background:0 0;border-color:#0000;font-weight:500}.button.danger{background:var(--error);border-color:var(--error);color:#fff}.button.primary{background:var(--accent);border-color:var(--accent);color:var(--accent-text)}.button:focus-visible{outline:2px solid var(--accent);outline-offset:2px}.game{flex-direction:column;align-items:center;gap:12px;display:flex}.players{flex-wrap:wrap;justify-content:center;gap:8px;display:flex}.player{border:2px solid var(--border);background:var(--surface);border-radius:999px;align-items:center;gap:6px;padding:5px 10px;font-size:.9375rem;font-weight:600;transition:border-color .15s ease-out;display:inline-flex}.player.turn{border-color:var(--accent)}.presence{color:var(--muted);align-items:center;gap:4px;font-size:.75rem;font-weight:500;display:inline-flex}.presence:before{content:"";background:var(--muted);border-radius:50%;width:7px;height:7px}.presence.online:before{background:var(--online)}.presence.not-joined:before{border:1px solid var(--muted);background:0 0}.status{min-height:1.9rem;margin:4px 0 0;font-size:1.25rem;font-weight:700}.status.my-turn{color:var(--accent)}.share{gap:8px;width:100%;max-width:480px;display:flex}.share input{flex:1}.boards{flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:20px;display:flex}.grid-wrap{--cell:min(calc((100vw - 32px - 9 * var(--grid-gap) - 2 * var(--grid-gap)) / 10), 38px);--grid-gap:2px;flex-direction:column;align-items:center;gap:6px;display:flex}.grid-wrap.small{--cell:min(calc((100vw - 32px - 11 * var(--grid-gap)) / 10 * .62), 24px)}.grid-label{color:var(--muted);text-transform:uppercase;letter-spacing:.04em;font-size:.8125rem;font-weight:600}.grid{grid-template-columns:repeat(10, var(--cell));gap:var(--grid-gap);padding:var(--grid-gap);background:var(--sea-line);touch-action:manipulation;border-radius:10px;display:grid}.cell{all:unset;box-sizing:border-box;width:var(--cell);height:var(--cell);background:var(--sea);-webkit-tap-highlight-color:transparent;border-radius:3px;position:relative}button.cell:not(:disabled){cursor:crosshair}@media (hover:hover) and (pointer:fine){button.cell:not(:disabled):hover{background:var(--sea-hover)}}button.cell:focus-visible{outline:2px solid var(--accent);outline-offset:1px;z-index:1}.cell.ship:before{content:"";background:var(--ship);position:absolute;inset:18%}.cell.ship-h:before{left:-2px;right:-2px}.cell.ship-v:before{top:-2px;bottom:-2px}.cell.ship-h.ship-start:before{border-radius:999px 0 0 999px;left:12%}.cell.ship-h.ship-end:before{border-radius:0 999px 999px 0;right:12%}.cell.ship-v.ship-start:before{border-radius:999px 999px 0 0;top:12%}.cell.ship-v.ship-end:before{border-radius:0 0 999px 999px;bottom:12%}.cell.sunk:before{background:var(--sunk)}.cell.shot-miss:after{content:"";background:var(--miss);border-radius:50%;position:absolute;inset:38%}.cell.shot-hit:after,.cell.shot-sunk:after{content:"";background:var(--hit);border-radius:50%;position:absolute;inset:26%;box-shadow:0 0 0 2px #ffffff40}.cell.last{outline:2px solid var(--accent);outline-offset:-2px;animation:.6s ease-out ping}@keyframes ping{0%{transform:scale(1.25)}}.cell.ghost,button.cell.ghost:hover{background:var(--ghost)}.cell.ghost.invalid,button.cell.ghost.invalid:hover{background:var(--ghost-bad)}.last-shot{margin-top:-8px;font-size:.9375rem}@media (prefers-reduced-motion:reduce){.cell.last{animation:none}}.fleet-status{color:var(--muted);flex-wrap:wrap;justify-content:center;gap:4px 10px;max-width:400px;margin:8px 0 0;padding:0;font-size:.8125rem;list-style:none;display:flex}.fleet-status .sunk{opacity:.6;text-decoration:line-through}.place{flex-direction:column;align-items:center;gap:12px;width:100%;display:flex}.ships{flex-wrap:wrap;justify-content:center;gap:6px;display:flex}.ship-chip{font:inherit;border:2px solid var(--border);background:var(--surface);color:var(--text);cursor:pointer;border-radius:999px;align-items:center;gap:6px;padding:6px 10px;font-size:.875rem;display:inline-flex}.ship-chip.selected{border-color:var(--accent)}.ship-chip.placed:not(.selected){opacity:.55}.ship-bar{background:var(--ship);border-radius:999px;height:8px}.button.wide{min-width:200px}.toast{left:50%;bottom:calc(24px + env(safe-area-inset-bottom));background:var(--text);color:var(--bg);border-radius:10px;max-width:calc(100vw - 32px);padding:10px 16px;font-weight:600;animation:.18s ease-out toast-in;position:fixed;transform:translate(-50%)}@keyframes toast-in{0%{opacity:0;transform:translate(-50%,8px)}}@media (max-width:420px){.header{padding:12px 16px 4px}.status{font-size:1.125rem}.card{padding:20px}}@media (max-width:360px){.presence{gap:0;font-size:0}}
