/* Thumb-friendly play surfaces. Off-board gestures intentionally stay available. */
.arcade-game { width:100%; max-width:440px; min-width:0; min-height:100%; margin:auto; padding:12px; display:flex; flex-direction:column; align-items:center; gap:12px; }
.arcade-game > * { min-width:0; max-width:100%; }
.arcade-game .match-stage { min-width:0; max-width:100%; }
.arcade-game canvas { max-width:100%; flex-shrink:0; border-radius:18px; border:1px solid #ffffff20; box-shadow:0 16px 40px #0003; }
.in-game-header { gap:8px; min-height:48px; }
.in-game-header h2 { font-family:Inter,-apple-system,sans-serif; font-size:18px; font-weight:800; color:#f5f3ff; }
.in-game-header p { color:#b9c5cf; font-size:12px; }
.arcade-icon, .arcade-button { min-height:44px; min-width:44px; border-radius:12px; background:#ffffff0c; color:#e7edf4; border:1px solid #ffffff17; padding:10px 14px; font-size:14px; font-weight:650; touch-action:manipulation; }
.arcade-icon { display:grid; place-items:center; padding:10px; flex-shrink:0; }
.arcade-button:active:not(:disabled), .arcade-icon:active { background:#ffffff20; transform:translateY(1px); }
.arcade-button:disabled { opacity:.42; }
.arcade-primary { background:#c4b5fd; color:#24143f; border-color:transparent; }
.arcade-primary:active:not(:disabled) { background:#ddd6fe; }
.arcade-controls { display:flex; width:100%; gap:8px; align-items:center; justify-content:center; }
.arcade-controls > button { flex:1; }
.arcade-trackpad { width:100%; min-height:64px; border:1px dashed #ffffff30; border-radius:16px; display:flex; flex-direction:column; justify-content:center; text-align:center; padding:10px; background:linear-gradient(120deg,#a78bfa0d,#22d3ee08); color:#c4ced9; font-size:12px; user-select:none; }
.arcade-trackpad strong { color:#eee9ff; font-size:14px; margin-bottom:3px; }
.arcade-rules { width:100%; font-size:13px; color:#bfccd3; background:#ffffff06; border:1px solid #ffffff12; border-radius:14px; }
.arcade-rules summary { min-height:44px; padding:12px 14px; cursor:pointer; font-weight:650; color:#e4e8ee; }
.arcade-rules p { margin:0; padding:0 14px 14px; line-height:1.6; }
.arcade-sheet { position:fixed; z-index:60; inset:0; background:#07131de8; backdrop-filter:blur(8px); display:flex; align-items:center; justify-content:center; padding:24px max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left)); overflow:auto; touch-action:pan-y; }
.arcade-sheet-card { background:#16252e; border:1px solid #ffffff22; border-radius:24px; padding:24px; width:min(100%,360px); box-shadow:0 24px 80px #0005; margin:auto; }
.arcade-sheet-card h2 { font-size:25px; font-weight:800; letter-spacing:-.6px; margin:0 0 12px; }
.arcade-sheet-card p { color:#c3cfd8; font-size:14px; line-height:1.7; margin:0 0 20px; }
.arcade-sheet-card button { width:100%; margin-top:8px; }
.arcade-kicker { font-size:11px; text-transform:uppercase; letter-spacing:1.5px; color:#c4b5fd; font-weight:750; margin-bottom:12px; }
.arcade-turn { width:100%; padding:14px 16px; border-radius:16px; background:#ffffff08; border:1px solid #ffffff15; color:#bfccd3; font-size:14px; text-align:center; }
.arcade-turn.is-mine { border-color:#86efac50; background:#86efac12; color:#bbf7d0; font-weight:700; }
.arcade-turn small { display:block; color:#bfccd3; font-weight:400; font-size:12px; margin-top:4px; }
.arcade-stats { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; padding:10px 14px; border-radius:14px; background:#ffffff08; font-size:12px; color:#bfccd3; }
.arcade-next { display:grid; gap:2px; }
.arcade-next i { width:9px; height:9px; border-radius:2px; }
.ttt-board { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; width:100%; max-width:360px; }
.connect-board { width:100%; display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:3px; padding:8px; border:1px solid #818cf83b; border-radius:20px; background:#1e244d; }
.connect-column { min-width:0; display:flex; flex-direction:column; gap:5px; padding:0 1px 3px; border-radius:20px; color:#cbd5e1; }
.connect-column:enabled:active { background:#ffffff15; }
.connect-column .column-label { height:34px; display:grid; place-items:center; font-size:12px; font-weight:700; }
.connect-token { width:100%; aspect-ratio:1; border-radius:50%; display:grid; place-items:center; font-size:12px; font-weight:800; border:2px solid #ffffff0d; background:#0f172a; }
.connect-token.red { background:#f87171; color:#641c23; border-color:#fca5a5; }
.connect-token.yellow { background:#facc15; color:#5c4108; border-color:#fde68a; }
.connect-token.is-win { outline:2px solid white; outline-offset:1px; }
.connect-token.last-move:not(.is-win), .ttt-cell.last-move { box-shadow:inset 0 0 0 2px #fff9; }
body.games-page .connect-column:disabled, body.games-page .ttt-cell:disabled, body.games-page .fleet-cell:disabled { opacity:1; }
.connect-column:disabled .column-label { opacity:.55; }
.fleet-grid { width:100%; max-width:390px; margin:auto; display:grid; grid-template-columns:18px repeat(8,minmax(0,1fr)); gap:3px; }
.fleet-grid.is-small { max-width:280px; gap:2px; }
.fleet-label { display:grid; place-items:center; font-size:10px; color:#b0bdce; min-height:18px; }
.fleet-cell { min-width:0; min-height:0; padding:0; aspect-ratio:1; display:grid; place-items:center; border:1px solid #ffffff1a; border-radius:5px; background:#192936; color:#a8bacb; font-size:14px; }
.fleet-cell.ship { background:#7c3aed5c; }
.fleet-cell.preview { background:#a78bfa60; border:2px solid #ddd6fe; }
.fleet-cell.hit { background:#be394b; color:white; }
.fleet-cell.miss { background:#304354; }
.fleet-cell.pending { background:#755a1c; color:#fde68a; }
.fleet-cell.selected { background:#69552a; color:#fff4c6; box-shadow:inset 0 0 0 3px #fde68a; }
.fleet-actions { width:100%; display:flex; flex-wrap:wrap; gap:8px; }
.fleet-actions > button { flex:1; }
.fleet-actions > button:last-child { flex:0 0 48px; }
.fleet-actions .arcade-button { font-size:13px; white-space:nowrap; }
.fleet-confirm { width:100%; min-height:48px; }
.fleet-status { min-height:40px; color:#c3cfd8; font-size:13px; line-height:1.5; text-align:center; }
/* Setup fits short phones; disabled water cells must still allow vertical scrolling. */
.battleship-game { gap:8px; padding-top:8px; }
body.game-active .battleship-game .in-game-header { padding:6px; top:0; }
.battleship-game .fleet-cell { touch-action:pan-y pinch-zoom; }
.fleet-setup { width:100%; display:grid; gap:8px; }
.fleet-setup-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; color:#dbe5ef; }
.fleet-setup-heading h3 { margin:0; font-size:14px; font-weight:700; }
.fleet-setup-heading span { font-size:12px; white-space:nowrap; color:#c4b5fd; }
.fleet-setup-confirm { position:sticky; bottom:0; z-index:20; display:grid; gap:6px; padding:8px 0; border-top:1px solid #ffffff15; background:#0f1f1a; }
.fleet-setup-confirm .fleet-status { min-height:0; margin:0; color:#dbe5ef; }
body.games-page .fleet-confirm { min-height:48px; font-size:16px; font-weight:750; line-height:1.3; background:#c4b5fd; color:#24143f; }
body.games-page .fleet-confirm:disabled { opacity:1; background:#3d4653; color:#cbd5e1; }
.fleet-opponent-ready { margin:0; color:#bbf7d0; font-size:12px; text-align:center; }
@media (max-width:360px) { .arcade-game { padding:10px; gap:10px; } .arcade-button { padding:10px; } .in-game-header h2 { font-size:16px; } }
@media (orientation:landscape) and (max-height:500px) and (min-width:560px) {
  .action-game { max-width:760px; display:grid; grid-template-columns:minmax(170px,1fr) minmax(220px,1fr); align-content:start; align-items:start; gap:10px; padding:10px; }
  .action-game > .in-game-header { grid-column:1 / -1; }
  .action-game > canvas, .action-game > .match-stage { grid-column:1; grid-row:2 / span 5; justify-self:center; }
  .action-game > :not(.in-game-header):not(canvas):not(.match-stage):not(.arcade-sheet) { grid-column:2; }
  .action-game > .match-stage { text-align:center; }
}
@media (prefers-reduced-motion:reduce) { .animate-win,.animate-turn-pulse,.animate-pulse,.animate-float,.animate-pulse-glow,.animate-hit-pop { animation:none!important; } }
/* Reserve off-board gestures as well as the canvas before Safari starts scrolling. */
body.game-active #game-root:has(.action-game):not(:has(.arcade-sheet,.mp-modal-backdrop)) { touch-action:none; }
.action-game { touch-action:none; -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; }
.action-game:has(.arcade-sheet,.mp-modal-backdrop) { touch-action:auto; }
.arcade-trackpad { touch-action:none; -webkit-user-select:none; }
.arcade-keyboard-hint { width:100%; margin:0; padding:10px 12px; border-radius:12px; background:#ffffff08; color:#cbd5e1; font-size:12px; line-height:1.7; text-align:center; }
.arcade-keyboard-hint strong { color:#eee9ff; }
.arcade-sheet-card .arcade-trackpad { margin-bottom:12px; }
.in-game-header > .text-center { flex:1; min-width:0; }
