:root{--color-x: #2563eb;--color-o: #e11d48;--color-win: #fde047;--color-grid: #c7bfe6;--color-bg: #ffffff;--color-text: #1f2033;--app-bg: linear-gradient(165deg, #dbeafe 0%, #ede9fe 46%, #fce7f3 100%);--board-panel: rgba(255, 255, 255, .55);--cell-bg: #ffffff;--tile-shadow: 0 6px 0 rgba(99, 91, 160, .12), 0 10px 22px rgba(99, 91, 160, .14);--tile-shadow-press: 0 2px 0 rgba(99, 91, 160, .14), 0 4px 10px rgba(99, 91, 160, .16);--font-round: ui-rounded, "SF Pro Rounded", "Hiragino Maru Gothic ProN", "Baloo 2", "Nunito", "Quicksand", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--pill-x: #2563eb;--pill-o: #e11d48}*{box-sizing:border-box}html,body{margin:0;height:100%}body{background:var(--app-bg);background-attachment:fixed;color:var(--color-text);font-family:var(--font-round);-webkit-touch-callout:none;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.app{min-height:100dvh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:clamp(14px,2.4vh,26px);padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-left)) max(20px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-right))}@media (max-height: 720px),(max-width: 519px){.app{justify-content:flex-start}}.scorebar{display:flex;justify-content:center;align-items:center;gap:clamp(6px,2.4vw,14px);font-size:clamp(16px,2.4vh,20px);font-weight:800;padding:6px 10px;background:var(--board-panel);border-radius:999px}.score{display:inline-flex;align-items:baseline;gap:5px;padding:2px 10px;border-radius:999px}.score b{font-weight:900;font-variant-numeric:tabular-nums;color:var(--color-text)}.score--x{color:var(--color-x)}.score--o{color:var(--color-o)}.score--d{color:var(--color-text)}.status{min-height:1.5em;display:flex;align-items:center;justify-content:center;text-align:center;line-height:1.15}.turn{font-size:clamp(18px,2.8vh,24px);font-weight:800;padding:8px 20px;border-radius:999px;color:#fff}.turn--x{background:var(--pill-x)}.turn--o{background:var(--pill-o)}.banner{font-size:clamp(30px,5.4vh,46px);font-weight:900;padding:4px 8px;animation:banner-bounce .62s cubic-bezier(.34,1.56,.64,1) both}@keyframes banner-bounce{0%{opacity:0;transform:scale(.4) rotate(-6deg)}55%{transform:scale(1.12) rotate(2deg)}to{opacity:1;transform:scale(1) rotate(0)}}.banner--x{color:var(--color-x)}.banner--o{color:var(--color-o)}.banner--draw{color:var(--color-text)}.board{--board-size: min(94vw, 66vh, 560px);width:var(--board-size);height:var(--board-size);display:grid;grid-template-columns:repeat(3,1fr);grid-template-rows:repeat(3,1fr);gap:clamp(8px,2.4vw,14px);padding:clamp(8px,2.4vw,14px);background:var(--board-panel);border-radius:clamp(20px,6vw,32px);box-shadow:0 10px 30px #635ba02e}.cell{min-width:44px;min-height:44px;border:0;margin:0;padding:0;background:var(--cell-bg);color:var(--color-text);font-family:inherit;font-size:min(17vw,12vh,116px);font-weight:900;line-height:1;border-radius:clamp(14px,4vw,22px);box-shadow:var(--tile-shadow);cursor:pointer;transition:transform .11s ease,box-shadow .11s ease,background-color .11s ease;-webkit-user-select:none;user-select:none}@media (hover: hover){.cell:hover:enabled{transform:translateY(-2px)}}.cell .mark{display:inline-block;animation:mark-pop .3s cubic-bezier(.34,1.56,.64,1) both}@keyframes mark-pop{0%{opacity:0;transform:scale(.2) rotate(-12deg)}60%{transform:scale(1.18) rotate(4deg)}to{opacity:1;transform:scale(1) rotate(0)}}.cell--x{color:var(--color-x)}.cell--o{color:var(--color-o)}.cell:active:enabled{transform:translateY(2px) scale(.97);box-shadow:var(--tile-shadow-press)}.cell:disabled{cursor:default}.cell--win{background:var(--color-win);animation:win-cheer .9s ease-in-out 0s 2 both}.cell--win .mark{color:#1f2033}@keyframes win-cheer{0%,to{transform:scale(1)}40%{transform:scale(1.08) rotate(-2deg)}70%{transform:scale(1.04) rotate(2deg)}}.cell--win:active:enabled{background:var(--color-win)}.new-game{min-height:56px;min-width:220px;padding:14px 34px;font-family:inherit;font-size:22px;font-weight:900;letter-spacing:.01em;color:#fff;background:linear-gradient(180deg,#8b5cf6,#7c3aed);border:0;border-radius:999px;box-shadow:0 6px #5b21b6,0 12px 20px #5b21b652;cursor:pointer;transition:transform 90ms ease,box-shadow 90ms ease}.new-game:active{transform:translateY(4px);box-shadow:0 2px #5b21b6,0 5px 12px #5b21b64d}@media (orientation: landscape){.board{--board-size: min(66vh, 72vw, 520px)}}@media (orientation: landscape) and (max-height: 500px){.app{gap:8px;justify-content:flex-start}.board{--board-size: min(58vh, 46vw, 360px)}.seat-rail{margin:0}.new-game{min-height:48px}}@media (prefers-reduced-motion: reduce){.cell .mark,.banner,.cell--win{animation:none}}:root{--color-surface: #ffffff;--color-surface-sunken: #f3f4f6;--color-border: #d1d5db;--color-border-strong: #787e88;--color-text-secondary: #4b5563;--color-text-muted: #5b616b;--color-primary: #1f2937;--color-on-primary: #ffffff;--color-danger: #b91c1c;--color-danger-fill: #b91c1c;--color-focus: #2563eb;--color-scrim: rgba(17, 24, 39, .45);--pw-weak: #b91c1c;--pw-fair: #b45309;--pw-strong: #15803d}@media (prefers-color-scheme: dark){:root:not([data-theme=light]){--color-bg: #0f1419;--color-text: #f1f5f9;--color-x: #6ba3de;--color-o: #f0836f;--color-grid: #33404f;--color-surface: #1a2230;--color-surface-sunken: #10161f;--color-border: #33404f;--color-border-strong: #71808f;--color-text-secondary: #c2cdda;--color-text-muted: #9aa7b4;--color-primary: #e8eef5;--color-on-primary: #0f1419;--color-danger: #f87171;--color-danger-fill: #dc2626;--color-focus: #60a5fa;--color-scrim: rgba(0, 0, 0, .6);--pw-weak: #f87171;--pw-fair: #fbbf24;--pw-strong: #4ade80}}[data-theme=dark]{--color-bg: #0f1419;--color-text: #f1f5f9;--color-x: #6ba3de;--color-o: #f0836f;--color-grid: #33404f;--color-surface: #1a2230;--color-surface-sunken: #10161f;--color-border: #33404f;--color-border-strong: #71808f;--color-text-secondary: #c2cdda;--color-text-muted: #9aa7b4;--color-primary: #e8eef5;--color-on-primary: #0f1419;--color-danger: #f87171;--color-danger-fill: #dc2626;--color-focus: #60a5fa;--color-scrim: rgba(0, 0, 0, .6);--pw-weak: #f87171;--pw-fair: #fbbf24;--pw-strong: #4ade80}@media (prefers-color-scheme: dark){:root:not([data-theme=light]){--color-x: #7cb2f5;--color-o: #ff8fa3;--color-win: #facc15;--app-bg: linear-gradient(165deg, #131a2e 0%, #191325 52%, #0f1419 100%);--board-panel: rgba(255, 255, 255, .05);--cell-bg: #1a2230;--tile-shadow: 0 6px 0 rgba(0, 0, 0, .28), 0 10px 22px rgba(0, 0, 0, .4);--tile-shadow-press: 0 2px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .42)}}[data-theme=dark]{--color-x: #7cb2f5;--color-o: #ff8fa3;--color-win: #facc15;--app-bg: linear-gradient(165deg, #131a2e 0%, #191325 52%, #0f1419 100%);--board-panel: rgba(255, 255, 255, .05);--cell-bg: #1a2230;--tile-shadow: 0 6px 0 rgba(0, 0, 0, .28), 0 10px 22px rgba(0, 0, 0, .4);--tile-shadow-press: 0 2px 0 rgba(0, 0, 0, .3), 0 4px 10px rgba(0, 0, 0, .42)}[data-theme=dark] .cell--win .mark,:root:not([data-theme=light]) .cell--win .mark{color:#1f2033}:focus-visible{outline:3px solid var(--color-focus);outline-offset:3px}.topbar{width:100%;max-width:640px;min-height:56px;display:flex;align-items:center;gap:8px}.topbar .scorebar{flex:1 1 auto}.topbar-slot{flex:0 0 auto;display:flex;align-items:center;min-width:44px}.topbar-left{justify-content:flex-start}.topbar-right{justify-content:flex-end}.account{position:relative}.account-chip{min-height:44px;min-width:44px;display:inline-flex;align-items:center;gap:8px;padding:0 12px;border:1px solid var(--color-border);border-radius:999px;background:var(--color-surface);color:var(--color-text);font-family:inherit;font-size:15px;font-weight:600;cursor:pointer}.account-chip--loading{background:var(--color-surface-sunken);border-style:dashed}.account-chip:active{background:var(--color-surface-sunken)}.account-glyph{font-size:20px;line-height:1;color:var(--color-text-secondary)}.account-avatar{width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--color-surface-sunken);color:var(--color-text);font-size:14px;font-weight:700}.account-name{max-width:10ch;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.account-caret{font-size:12px;color:var(--color-text-secondary)}.account-menu-scrim{position:fixed;top:0;right:0;bottom:0;left:0;z-index:20}.account-menu{position:absolute;top:calc(100% + 8px);left:0;z-index:21;min-width:220px;background:var(--color-surface);border:1px solid var(--color-border);border-radius:12px;box-shadow:0 12px 32px #0000002e;overflow:hidden}.account-menu-head{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--color-border)}.account-menu-id{display:flex;flex-direction:column;line-height:1.25}.account-menu-name{font-size:16px;font-weight:700;color:var(--color-text)}.account-menu-sub{font-size:13px;color:var(--color-text-secondary)}.account-menu-row{width:100%;min-height:48px;padding:0 14px;display:flex;align-items:center;border:0;background:var(--color-surface);color:var(--color-text);font-family:inherit;font-size:16px;font-weight:600;text-align:left;cursor:pointer}.account-menu-row:active{background:var(--color-surface-sunken)}.account-menu-row--danger{color:var(--color-danger)}.auth-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:var(--color-scrim);display:flex;align-items:center;justify-content:center;padding:16px}.auth-sheet{width:100%;max-width:400px;background:var(--color-surface);color:var(--color-text);border-radius:16px;padding:20px;box-shadow:0 20px 48px #00000047;animation:auth-pop .15s ease-out}@keyframes auth-pop{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}.auth-sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}.auth-title{margin:0;font-size:22px;font-weight:800}.auth-close{width:44px;height:44px;border:0;background:transparent;color:var(--color-text-secondary);font-size:20px;cursor:pointer;border-radius:8px}.auth-close:active{background:var(--color-surface-sunken)}.auth-form{display:flex;flex-direction:column}.auth-label{font-size:14px;font-weight:600;color:var(--color-text-secondary);margin:12px 0 6px}.auth-input{height:48px;width:100%;padding:12px 16px;font-family:inherit;font-size:16px;color:var(--color-text);background:var(--color-surface-sunken);border:1px solid var(--color-border-strong);border-radius:8px}.auth-password{position:relative;display:flex;align-items:center}.auth-password .auth-input{padding-right:64px}.auth-show{position:absolute;right:4px;height:44px;min-width:56px;border:0;background:transparent;color:var(--color-focus);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer;border-radius:8px}.auth-hint{margin:6px 0 0;font-size:13px;color:var(--color-text-muted)}.auth-field-err{margin:6px 0 0;font-size:13px;font-weight:600;color:var(--color-danger)}.pw-strength{display:flex;align-items:center;gap:10px;margin-top:8px}.pw-strength-bars{display:flex;gap:4px;flex:0 0 auto}.pw-seg{width:40px;height:6px;border-radius:3px;background:var(--color-border)}.pw-seg--on.pw-seg--1{background:var(--pw-weak)}.pw-seg--on.pw-seg--2{background:var(--pw-fair)}.pw-seg--on.pw-seg--3{background:var(--pw-strong)}.pw-strength-label{font-size:13px;font-weight:600;color:var(--color-text-secondary)}.auth-banner{margin:14px 0 0;padding:10px 12px;font-size:14px;font-weight:600;color:var(--color-danger);background:var(--color-surface-sunken);border-radius:8px}.auth-primary{height:48px;margin-top:18px;border:0;border-radius:8px;background:var(--color-primary);color:var(--color-on-primary);font-family:inherit;font-size:16px;font-weight:600;cursor:pointer}.auth-primary:disabled{opacity:.6;cursor:default}.auth-footer{margin:16px 0 0;text-align:center;font-size:14px;color:var(--color-text-secondary)}.auth-link{min-height:44px;padding:0 4px;border:0;background:transparent;color:var(--color-focus);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer}@media (max-width: 519px){.account-signin-label{display:none}.account-name{max-width:8ch}.auth-backdrop{align-items:flex-end;padding:0}.auth-sheet{max-width:none;border-bottom-left-radius:0;border-bottom-right-radius:0;padding-bottom:max(20px,env(safe-area-inset-bottom));animation:auth-slide .16s ease-out}@keyframes auth-slide{0%{transform:translateY(100%)}to{transform:translateY(0)}}}@media (prefers-reduced-motion: reduce){.auth-sheet{animation:none}}.seat-rail{width:100%;max-width:640px;display:flex;gap:10px;margin:4px 0 2px}.seat-plate{position:relative;flex:1 1 0;min-width:0;min-height:60px;display:flex;align-items:stretch;background:var(--color-surface);border:2px solid var(--color-border);border-radius:16px;box-shadow:0 4px 12px #635ba01a;overflow:hidden}.seat-plate--x{border-color:color-mix(in srgb,var(--color-x) 45%,var(--color-border))}.seat-plate--o{border-color:color-mix(in srgb,var(--color-o) 45%,var(--color-border))}.seat-accent{flex:0 0 5px;align-self:stretch}.seat-plate--x .seat-accent{background:var(--color-x)}.seat-plate--o .seat-accent{background:var(--color-o)}.seat-body{flex:1 1 auto;min-width:0;display:flex;align-items:center;gap:10px;padding:8px 10px;border:0;background:transparent;color:var(--color-text);font-family:inherit;text-align:left;cursor:pointer}.seat-body:disabled{cursor:default}.seat-glyph{flex:0 0 auto;font-size:24px;font-weight:700;line-height:1}.seat-plate--x .seat-glyph{color:var(--color-x)}.seat-plate--o .seat-glyph{color:var(--color-o)}.seat-avatar{flex:0 0 auto;width:28px;height:28px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:var(--color-surface-sunken);color:var(--color-text);font-size:14px;font-weight:700;border:1.5px solid var(--color-border-strong)}.seat-avatar--transient{border-style:dashed}.seat-id{display:flex;flex-direction:column;min-width:0;line-height:1.2}.seat-name{font-size:16px;font-weight:700;color:var(--color-text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.seat-body:disabled .seat-name,.seat-plate--locked .seat-name{font-weight:700}.seat-sub{font-size:12px;font-weight:600;color:var(--color-text-muted)}.seat-hint{font-size:13px;color:var(--color-text-muted)}.seat-lock{margin-left:auto;font-size:14px}.seat-plate--locked .seat-hint{color:var(--color-text-muted)}.seat-pill{align-self:center;margin-right:8px;min-height:44px;padding:0 12px;border:1px solid var(--color-border-strong);border-radius:8px;background:var(--color-surface);color:var(--color-text);font-family:inherit;font-size:14px;font-weight:600;white-space:nowrap;cursor:pointer}.seat-pill:active{background:var(--color-surface-sunken)}.seat-release{align-self:center;margin-right:6px;width:44px;height:44px;flex:0 0 44px;border:0;border-radius:8px;background:transparent;color:var(--color-text-secondary);font-size:20px;cursor:pointer}.seat-release:active{background:var(--color-surface-sunken)}.seat-sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;background:var(--color-scrim);display:flex;align-items:flex-end;justify-content:center}.seat-sheet{width:100%;max-width:520px;background:var(--color-surface);color:var(--color-text);border-top-left-radius:18px;border-top-right-radius:18px;padding:12px 20px max(20px,env(safe-area-inset-bottom));box-shadow:0 -12px 40px #00000047;animation:seat-slide-up .16s ease-out}@keyframes seat-slide-up{0%{transform:translateY(100%)}to{transform:translateY(0)}}.seat-sheet-grab{display:block;width:40px;height:4px;margin:4px auto 10px;border-radius:2px;background:var(--color-border-strong)}.seat-sheet-head{display:flex;align-items:center;justify-content:space-between}.seat-sheet-title{margin:0;font-size:18px;font-weight:700;display:flex;align-items:center;gap:8px}.seat-sheet-glyph{font-weight:700}.seat-sheet-glyph--x{color:var(--color-x)}.seat-sheet-glyph--o{color:var(--color-o)}.seat-sheet-sub{margin:4px 0 0;font-size:14px;color:var(--color-text-secondary)}.seat-sheet-foot{margin:14px 0 0;font-size:13px;color:var(--color-text-muted)}.stats-sheet{width:100%;max-width:460px;max-height:84vh;overflow-y:auto;background:var(--color-surface);color:var(--color-text);border-radius:16px;padding:20px;box-shadow:0 20px 48px #00000047;animation:auth-pop .15s ease-out}.stats-wells{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-top:8px}.stats-well{display:flex;flex-direction:column;align-items:center;gap:2px;padding:12px 4px;background:var(--color-surface-sunken);border-radius:12px}.stats-num{font-size:32px;font-weight:800;font-variant-numeric:tabular-nums;color:var(--color-text)}.stats-label{font-size:13px;font-weight:600;color:var(--color-text-secondary)}.stats-section{margin:18px 0 8px;font-size:14px;font-weight:700;color:var(--color-text)}.stats-h2h-head,.stats-h2h-row{display:grid;grid-template-columns:1fr 40px 40px 40px 56px;align-items:center;gap:4px}.stats-h2h-head{padding:0 8px 6px;font-size:13px;font-weight:600;color:var(--color-text-secondary)}.stats-h2h-head span:not(:first-child),.stats-h2h-row span:not(.stats-opp){text-align:right;font-variant-numeric:tabular-nums}.stats-h2h-rows{list-style:none;margin:0;padding:0}.stats-h2h-row{width:100%;min-height:44px;padding:0 8px;border:0;border-top:1px solid var(--color-border);background:transparent;color:var(--color-text);font-family:inherit;font-size:15px;cursor:pointer}.stats-h2h-row:active{background:var(--color-surface-sunken)}.stats-opp{text-align:left;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.stats-back{min-height:44px;padding:0 4px;border:0;background:transparent;color:var(--color-focus);font-family:inherit;font-size:14px;font-weight:600;cursor:pointer}.stats-focus-line{font-size:18px;font-weight:700;font-variant-numeric:tabular-nums;color:var(--color-text)}.stats-empty{text-align:center;padding:24px 8px}.stats-empty-title{margin:0;font-size:16px;font-weight:700;color:var(--color-text)}.stats-empty-sub{margin:6px 0 0;font-size:14px;color:var(--color-text-secondary)}.stats-error{text-align:center;padding:20px 8px}.stats-error-msg{font-size:15px;color:var(--color-text)}.stats-skeleton{display:flex;flex-direction:column;gap:10px;margin-top:16px}.stats-skel-row{height:44px;border-radius:8px;background:var(--color-surface-sunken);animation:stats-shimmer 1.2s ease-in-out infinite}@keyframes stats-shimmer{0%,to{opacity:1}50%{opacity:.55}}@media (orientation: landscape) and (min-width: 720px){.seat-rail{max-width:640px}}@media (prefers-reduced-motion: reduce){.seat-sheet,.stats-sheet,.stats-skel-row{animation:none}}
