/* ==========================================================================
   css/components/voice-games.css
   Split from app.html (build 2026.10.08.9-beta), original lines 3879-4008.
   Rules are in their ORIGINAL order; load order is defined in index.html.
   ========================================================================== */
/* -- Voice games (chess / ttt / connect 4) ----------------------- */
.vg-panel { position:fixed; left:50%; top:50%; transform:translate(-50%,-54%); z-index:940;
  background:var(--bg-elevated); border:1px solid var(--border-strong); border-radius:14px;
  box-shadow:0 18px 48px rgba(0,0,0,.5); padding:14px 16px 12px; min-width:300px; max-width:92vw; }
/* Mounted in the voice-stage spotlight: the game IS the activity tile. The spotlight
   is a flex-centering box, so static positioning centers it; cap to the region. */
.vg-panel.in-stage { position:static; transform:none; z-index:auto; max-height:100%; max-width:100%; overflow:auto; }
.vg-head { display:flex; align-items:center; gap:10px; margin-bottom:6px; }
.vg-title { font-family:var(--font-display,'Space Grotesk',sans-serif); font-size:15px; font-weight:800; color:var(--text-primary); }
.vg-players { flex:1; font-size:12px; color:var(--text-secondary); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.vg-vs { color:var(--text-muted); font-weight:700; padding:0 6px; }
.vg-seat { display:inline-flex; align-items:center; gap:5px; vertical-align:middle; max-width:44%; }
.vg-seat-ava { width:18px; height:18px; border-radius:50%; overflow:hidden; background:var(--bg-surface); border:2px solid var(--border); display:inline-flex; align-items:center; justify-content:center; font-size:9px; font-weight:800; color:var(--text-primary); flex-shrink:0; }
.vg-seat-ava img { width:100%; height:100%; object-fit:cover; }
.vg-seat-name { font-weight:700; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.vg-seat-wait { color:var(--text-muted); }
.vg-close { background:none; border:none; color:var(--text-muted); font-size:20px; line-height:1; cursor:pointer; padding:0 2px; }
.vg-close:hover { color:var(--red,#ed4245); }
.vg-status { font-size:12.5px; font-weight:600; color:var(--text-muted); margin-bottom:10px; }
.vg-status.my-turn { color:var(--green,#3ba55d); }
.vg-status.done { color:var(--accent); }
/* A running game sits in the voice grid as a normal tile (click to open into the
   spotlight). The panel is mounted INSIDE the tile and fills it. */
.voice-tile-game { position:relative; overflow:hidden; display:flex; }
.vg-panel.in-tile { position:static; transform:none; inset:auto; width:100%; height:100%;
  min-width:0; max-width:none; padding:0; margin:0; background:none; border:none; box-shadow:none; z-index:auto;
  display:flex; flex-direction:column; align-items:center; justify-content:flex-start; overflow:auto; }
/* Compact the live board so it fits inside its grid tile (its own "panel" among the users).
   zoom keeps click targets aligned, unlike transform:scale. Expand for the big view. */
.vg-panel.in-tile .vg-head { width:100%; box-sizing:border-box; padding:4px 8px; }
.vg-panel.in-tile .vg-title { font-size:12px; }
.vg-panel.in-tile .vg-players { font-size:10px; }
.vg-panel.in-tile .vg-status { font-size:11px; padding:2px 0; }
/* Board scale is computed per panel by VoiceGames._fitBoard (inline zoom) - a fixed
   0.62 here both overflowed small tiles and fought the measurement. 0 until it runs
   so a full-size board never flashes before the first fit. */
.vg-panel.in-tile .vg-board:not([style*="zoom"]) { visibility:hidden; }
.vg-panel.in-tile .vg-spec { display:none; }
.vg-panel.in-tile .vg-foot { padding:4px 0 8px; }
.vg-panel.in-tile .vg-2048-hint { display:none; }
.voice-tile-game { cursor:default; }
.vg-tile-card { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:3px; padding:10px; text-align:center; pointer-events:none; }
.vg-tile-icon { font-size:30px; line-height:1; color:var(--accent); margin-bottom:2px; }
.vg-tile-name { font-size:14px; font-weight:800; color:var(--text-primary); font-family:var(--font-display,'Space Grotesk',sans-serif); }
.vg-tile-players { font-size:12px; color:var(--text-secondary); }
.vg-tile-status { font-size:12px; font-weight:700; color:var(--text-muted); }
.vg-tile-status.my-turn { color:var(--accent); }
.vg-tile-watch { pointer-events:auto; cursor:pointer; margin-top:8px; display:inline-flex; align-items:center; gap:7px;
  background:var(--accent); color:#fff; border:none; border-radius:10px; padding:8px 18px; font-size:13px; font-weight:700;
  font-family:var(--font-body,'DM Sans',sans-serif); transition:filter .15s; }
.vg-tile-watch:hover { filter:brightness(1.12); }
.vg-tile-open { font-size:10.5px; color:var(--text-muted); margin-top:6px; }

/* Spectators: everyone in the call who isn't in one of the two seats. */
.vg-spec { margin-top:10px; border-top:1px solid var(--border); padding-top:9px; }
.vg-spec-label { font-size:10px; font-weight:700; letter-spacing:.8px; text-transform:uppercase; color:var(--text-muted); margin-bottom:6px; }
.vg-spec-list { display:flex; flex-wrap:wrap; gap:5px; max-height:64px; overflow-y:auto; }
.vg-spec-chip { font-size:11.5px; font-weight:600; color:var(--text-secondary); background:var(--bg-surface); border:1px solid var(--border); border-radius:999px; padding:2px 9px; white-space:nowrap; }
.vg-spec-chip[data-me] { color:var(--accent); border-color:var(--accent); }
.vg-foot { display:flex; justify-content:center; gap:8px; margin-top:10px; }
.vg-btn { border:none; border-radius:8px; padding:7px 16px; font-size:13px; font-weight:700; cursor:pointer; background:var(--bg-surface); color:var(--text-primary); }
.vg-btn.primary { background:var(--accent); color:#fff; }
.vg-ttt { display:grid; grid-template-columns:repeat(3,72px); grid-template-rows:repeat(3,72px); gap:6px; }
.vg-cell { background:var(--bg-surface); border:1px solid var(--border); border-radius:10px; font-size:34px; font-weight:800; color:var(--text-primary); cursor:pointer; display:flex; align-items:center; justify-content:center; }
.vg-cell:not(.filled):not(:disabled):hover { background:var(--bg-hover); border-color:var(--accent); }
.vg-cell:disabled { cursor:default; }
.vg-c4 { display:flex; gap:4px; background:var(--bg-surface); border:1px solid var(--border); border-radius:12px; padding:8px; }
.vg-c4col { display:flex; flex-direction:column; gap:4px; border-radius:8px; padding:2px; }
.vg-c4col.open { cursor:pointer; }
.vg-c4col.open:hover { background:var(--bg-hover); }
.vg-c4cell { width:40px; height:40px; border-radius:50%; background:var(--bg-void); border:1px solid var(--border); }
.vg-c4cell.pa { background:#e5484d; border-color:transparent; }
.vg-c4cell.pb { background:#f5d90a; border-color:transparent; }
/* Ultimate Tic-Tac-Toe - fixed (auto) tracks so cells stay square + aligned */
.vg-uttt { display:grid; grid-template-columns:repeat(3,auto); gap:9px; width:max-content; margin:0 auto; background:var(--bg-surface); border:1px solid var(--border); border-radius:14px; padding:9px; }
.vg-uttt-mini { position:relative; display:grid; grid-template-columns:repeat(3,auto); grid-template-rows:repeat(3,auto); gap:3px; padding:4px; border-radius:9px; background:var(--bg-void); }
.vg-uttt-mini.hot { box-shadow:0 0 0 2px var(--accent) inset; }              /* the board you MUST play in */
.vg-uttt-mini.free { box-shadow:0 0 0 1px var(--border-strong) inset; }      /* play-anywhere: subtle */
.vg-uttt-cell { width:30px; height:30px; border:none; border-radius:5px; background:var(--bg-surface); font-size:18px; font-weight:800; line-height:1; padding:0; cursor:pointer; color:var(--text-primary); display:flex; align-items:center; justify-content:center; }
.vg-uttt-mini.playable .vg-uttt-cell:not([disabled]):hover { background:var(--bg-hover); }
.vg-uttt-cell.c-a { color:#e5484d; }
.vg-uttt-cell.c-b { color:#f5d90a; }
.vg-uttt-cell[disabled] { cursor:default; }
.vg-uttt-mini.won .vg-uttt-cell { opacity:.22; }
.vg-uttt-overlay { position:absolute; inset:2px; display:flex; align-items:center; justify-content:center; font-size:44px; font-weight:900; border-radius:7px; pointer-events:none; }
.vg-uttt-overlay.o-a { color:#e5484d; background:rgba(229,72,77,.14); }
.vg-uttt-overlay.o-b { color:#f5d90a; background:rgba(245,217,10,.14); }
.vg-uttt-overlay.o-draw { color:var(--text-muted); background:rgba(255,255,255,.05); }
/* Scale the board up in the spotlight so it fills the stage instead of floating */
.vg-panel.in-stage .vg-uttt { gap:13px; padding:12px; }
.vg-panel.in-stage .vg-uttt-mini { gap:4px; padding:6px; }
.vg-panel.in-stage .vg-uttt-cell { width:48px; height:48px; font-size:30px; }
.vg-panel.in-stage .vg-uttt-overlay { font-size:70px; }
/* 2048 - tiles are absolutely positioned and SLIDE (transform transition) between moves. */
.vg-2048 { position:relative; width:272px; height:272px; background:#bbada0; border-radius:10px; }
.vg-2048-bg { position:absolute; inset:0; display:grid; grid-template-columns:repeat(4,58px); grid-template-rows:repeat(4,58px); gap:8px; padding:8px; }
.vg-2048-bgcell { border-radius:6px; background:rgba(238,228,218,0.35); }
.vg-2048-tile { position:absolute; top:0; left:0; width:58px; height:58px; transition:transform .12s ease; will-change:transform; }
.vg-2048-tinner { width:100%; height:100%; border-radius:6px; display:flex; align-items:center; justify-content:center; font-weight:800; font-family:var(--font-display,'Space Grotesk',sans-serif); }
/* Pop the INNER (scale) so it doesn't fight the tile's translate; delayed so it lands after the slide. */
.vg-2048-tile.pop .vg-2048-tinner { animation:vg2048Pop .16s ease .1s both; }
@keyframes vg2048Pop { 0%{ transform:scale(.62); } 60%{ transform:scale(1.08); } 100%{ transform:scale(1); } }
.vg-2048-ctrl { display:flex; flex-direction:column; align-items:center; gap:6px; margin-top:12px; }
.vg-2048-btn { width:44px; height:34px; border-radius:8px; border:1px solid var(--border-strong); background:var(--bg-elevated); color:var(--text-primary); font-size:15px; cursor:pointer; display:flex; align-items:center; justify-content:center; }
.vg-2048-btn:hover:not(:disabled) { background:var(--bg-hover); }
.vg-2048-btn:disabled { opacity:.4; cursor:default; }
.vg-2048-hint { font-size:11px; color:var(--text-muted); margin-top:2px; }
.vg-chess { display:grid; grid-template-columns:repeat(8,46px); grid-template-rows:repeat(8,46px); border:2px solid var(--border-strong); border-radius:8px; overflow:hidden; }
.vg-sq { display:flex; align-items:center; justify-content:center; position:relative; }
.vg-sq.l { background:#e8dcc8; } .vg-sq.d { background:#9a7550; }
.vg-sq.own { cursor:pointer; }
.vg-sq.sel { outline:3px solid var(--accent); outline-offset:-3px; }
.vg-sq.tgt { cursor:pointer; }
.vg-sq.tgt::after { content:''; position:absolute; width:14px; height:14px; border-radius:50%; background:var(--accent); opacity:.75; }
.vg-pc { font-size:34px; line-height:1; }
.vg-pc.w { color:#fff;}
.vg-pc.b { color:#1a1a1a;}
@media (max-width:600px) {
  .vg-chess { grid-template-columns:repeat(8,38px); grid-template-rows:repeat(8,38px); }
  .vg-pc { font-size:27px; } .vg-c4cell { width:32px; height:32px; }
}
.vcchat-attach, .vcchat-send { background:none; border:none; color:var(--text-muted); cursor:pointer; padding:7px; display:flex; align-items:center; border-radius:8px; flex-shrink:0; }
.vcchat-attach:hover, .vcchat-send:hover { color:var(--text-primary); background:var(--bg-hover); }
.vcchat-send { color:var(--accent); }
.voice-prejoin-chat { display:flex; align-items:center; justify-content:center; width:44px; height:44px; border-radius:10px; background:var(--bg-elevated); border:1px solid var(--border-strong); color:var(--text-secondary); cursor:pointer; }
.voice-prejoin-chat:hover { color:var(--text-primary); border-color:var(--accent); }
@media (max-width:720px) { .vcchat { width:100%; } .channel-area.vcchat-open #messagesArea { padding-right:0; display:none; } }
@keyframes dmp-slide { from { transform:translateX(28px); opacity:0 } to { transform:none; opacity:1 } }
/* Docked as a full-height right panel (reads as part of the app, not a floating card). */
