/* Joseph Harris */

:root{color-scheme:dark;--bg:#0b1220;--panel:#172235;--outline:#2c3b52;--text:#edf3ff;--muted:#a3b0c3;--accent:#ff944d;--secondary:#69d4d2;--shadow:0 20px 55px #03091666;font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
*{box-sizing:border-box}body{min-height:100vh;margin:0;background:radial-gradient(ellipse at top,#24334e 0%,#0b1220 58%);color:var(--text)}button,input{font:inherit}button{cursor:pointer}.app{max-width:780px;margin:0 auto;padding:48px 20px 24px}.page-header{text-align:center;margin-bottom:30px}.eyebrow{text-transform:uppercase;letter-spacing:.17em;font-size:.69rem;font-weight:800;color:var(--accent);margin:0 0 9px}h1{font-size:clamp(2.7rem,8vw,4.2rem);letter-spacing:-.065em;line-height:1.1;margin:0}.accent{color:var(--accent)}.subtitle{line-height:1.6;color:var(--muted);margin:14px auto 0;max-width:480px}.panel{border:1px solid var(--outline);border-radius:22px;background:linear-gradient(160deg,#19263a,#131d2d);box-shadow:var(--shadow);padding:25px;margin-bottom:20px}.section-heading{display:flex;align-items:baseline;justify-content:space-between;gap:20px}.section-heading h2,.game h2{margin:0;font-size:1.18rem}.section-heading p{margin:0;font-size:.8rem;color:var(--muted)}fieldset{border:0;padding:0;margin:21px 0 0}legend{color:var(--muted);font-weight:700;font-size:.83rem;margin-bottom:10px}.segmented,.symbols{display:grid;gap:10px}.segmented{grid-template-columns:repeat(2,minmax(0,1fr))}.symbols{grid-template-columns:repeat(4,minmax(0,1fr))}label{position:relative;cursor:pointer}label input{position:absolute;width:100%;height:100%;opacity:0;cursor:pointer;margin:0}label span{display:flex;align-items:center;justify-content:center;border:1px solid var(--outline);background:#111b2b;border-radius:12px;min-height:45px;font-size:.88rem;font-weight:700;transition:background .15s,border-color .15s,transform .15s}label input:checked+span{background:#423021;border-color:var(--accent);color:#ffbe87}label input:focus-visible+span{outline:3px solid var(--secondary);outline-offset:3px}.symbols span{font-size:1.8rem;line-height:1}.symbols label:hover span,.segmented label:hover span{border-color:#8191a8}.player-preview{display:flex;justify-content:space-between;align-items:center;gap:12px;border-top:1px solid var(--outline);padding-top:21px;margin-top:22px}.player-chip{display:flex;align-items:center;gap:11px;flex:1}.player-chip:last-child{justify-content:flex-end}.player-chip small{display:block;color:var(--muted);font-size:.78rem;margin-bottom:3px}.player-chip strong{font-size:1.13rem}.avatar{border-radius:12px;width:45px;height:45px;display:grid;place-items:center;background:#174246;color:var(--secondary);flex-shrink:0}.human-avatar{background:#473321;color:#ffb16e;font-size:1.6rem}.versus{font-size:.7rem;letter-spacing:.1em;font-weight:900;color:var(--muted)}.game{padding:26px 25px 21px}.game-topline{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:24px}.game-topline h2{font-size:1.25rem}.reset{border:1px solid #715039;color:#ffc393;background:#38271f;border-radius:10px;padding:10px 13px;font-weight:750;white-space:nowrap}.reset:hover{background:#533625}.reset:focus-visible,.cell:focus-visible{outline:3px solid var(--secondary);outline-offset:3px}.board{width:min(100%,390px);margin:auto;display:grid;grid-template-columns:repeat(3,1fr);gap:10px}.cell{aspect-ratio:1;border:1px solid #3a4b63;border-radius:16px;background:#233249;color:var(--accent);display:grid;place-items:center;font-size:clamp(3rem,12vw,5rem);font-weight:800;line-height:1;transition:transform .15s,background .15s}.cell:not(:disabled):hover{background:#30445f;transform:translateY(-2px)}.cell[data-owner="1"]{color:var(--secondary)}.cell.win{background:#285c54;border-color:#6fdfbc}.cell:disabled{cursor:default}.game-tip{text-align:center;color:var(--muted);font-size:.78rem;margin:18px 0 0}footer{text-align:center;font-size:.77rem;color:#8091a9;padding:15px}@media(max-width:540px){.app{padding:27px 13px}.panel{padding:19px;border-radius:18px}.section-heading{display:block}.section-heading p{margin-top:6px}.cell{border-radius:11px}.board{gap:7px}.game-topline{align-items:flex-start}.reset{font-size:.8rem;padding:9px}.player-chip{gap:7px}.avatar{width:40px;height:40px}.versus{font-size:.65rem}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{transition:none!important;animation:none!important}}

/* Canvas rendering: the grid and every mark are drawn by game.js. */
.board-canvas{display:block;width:min(100%,390px);height:auto;aspect-ratio:1;margin:0 auto;cursor:pointer;touch-action:manipulation;border-radius:16px}
.board-canvas:focus-visible{outline:3px solid var(--secondary);outline-offset:5px}
.symbols canvas{width:36px;height:36px;display:block}
.player-chip strong{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px}
.player-chip strong canvas{display:block;width:34px;height:34px}
.avatar canvas{display:block;width:29px;height:29px}
.symbols label input:disabled+span{opacity:.35;cursor:not-allowed}
@media(max-width:540px){.board-canvas{border-radius:12px}}
