/* Quintet game screens (milestone 3, plain). The club look arrives in milestone 7. */
body.ingame .back { display: none; }
body.ingame #app { padding: 0; max-width: 560px; }
.game.phone {
  height: 100dvh; overflow: hidden; overscroll-behavior: none;
  display: flex; flex-direction: column; gap: 6px; padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
.topbar { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: .9rem; }
.topbar .sc { color: var(--c); white-space: nowrap; }
.topbar .sc b { font-weight: 700; }
.topbar .deck { margin-left: auto; color: var(--muted); white-space: nowrap; }
.statusline { display: flex; justify-content: space-between; gap: 8px; font-size: .9rem; min-height: 24px; align-items: center; }
.statusline.mine > span:first-child { color: var(--teal); font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.statusline .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.board {
  --side: min(100%, calc(100dvh - 44px - 24px - 100px - 64px - 44px));
  aspect-ratio: 1;
  display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr); gap: 2px; padding: 4px;
  background: var(--walnut); border-radius: 10px; border: 2px solid #5a3d1f;
  width: var(--side); height: auto; margin: 0 auto; flex: none;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.cell {
  position: relative; border: 0; padding: 0; border-radius: 4px; background: var(--cream); color: #1b1622;
  display: grid; place-items: center; cursor: pointer; min-width: 0; min-height: 0; overflow: visible;
  transition: opacity .15s; font: inherit;
}
.cell .ix { font-weight: 800; font-size: clamp(10px, 3.6vw, 16px); line-height: 1; white-space: nowrap; }
.cell .ix i { font-style: normal; font-size: .85em; margin-left: 1px; }
.cell.corner { background: #3a2a14; color: var(--brass); cursor: default; }
.cell.corner .star { font-size: clamp(14px, 5vw, 26px); }
.sS { color: #1b1622; } .sH { color: #d7263d; } .sD { color: #2b6fd6; } .sC { color: #1e8f4e; }
.chip {
  position: absolute; inset: 8%; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .3), 0 1px 2px rgba(0, 0, 0, .4);
}
.chip.c0 { background: var(--ruby); } .chip.c1 { background: var(--sapphire); } .chip.c2 { background: var(--emerald); }
.chip.locked { box-shadow: 0 0 0 2px var(--brass), inset 0 -2px 0 rgba(0, 0, 0, .3); }
.chip .mini { font-size: clamp(7px, 2.2vw, 11px); color: rgba(255, 255, 255, .92); font-weight: 700; position: relative; z-index: 1; }
/* Shape marks for colour-blind players: Ruby dot, Sapphire ring, Emerald bar */
.chip.c0::after { content: ''; position: absolute; top: 12%; width: 18%; height: 18%; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.chip.c1::after { content: ''; position: absolute; inset: 16%; border: 2px solid rgba(255, 255, 255, .35); border-radius: 50%; }
.chip.c2::after { content: ''; position: absolute; left: 22%; right: 22%; bottom: 14%; height: 2px; background: rgba(255, 255, 255, .5); }
.cell.dim { opacity: .4; }
.cell.target { box-shadow: 0 0 0 2px var(--teal), 0 0 10px var(--teal); z-index: 1; }
.cell.target.bounce { box-shadow: 0 0 0 2px var(--coral), 0 0 10px var(--coral); }
.cell.planning.target { box-shadow: 0 0 0 2px rgba(55, 214, 192, .55); }
.cell.last::before { content: ''; position: absolute; inset: 1px; border: 2px solid #fff; border-radius: 50%; z-index: 2; pointer-events: none; }
.ghostchip { position: absolute; inset: 10%; border-radius: 50%; opacity: .65; border: 2px dashed #fff; }
.ghostchip.c0 { background: var(--ruby); } .ghostchip.c1 { background: var(--sapphire); } .ghostchip.c2 { background: var(--emerald); }
.glove { position: absolute; font-size: clamp(14px, 5vw, 24px); z-index: 3; filter: drop-shadow(0 1px 2px #000); }
.cell.ghost-out .chip { opacity: .5; }

.game .hand { flex-wrap: nowrap; display: flex; gap: 6px; justify-content: center; min-height: 92px; align-items: flex-end; padding-top: 14px; flex: none; }
.hcard {
  flex: 0 1 52px; min-width: 40px; height: 76px; border-radius: 9px; border: 0; background: var(--cream);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4); transition: transform .12s; position: relative; padding: 0; font: inherit;
}
.hcard .hr { font-size: 1.25rem; font-weight: 800; line-height: 1; }
.hcard .hs { font-size: 1.2rem; line-height: 1; }
.hcard.jack { background: linear-gradient(160deg, #f4ead2, #e8d3a0); color: #2a1438; }
.hcard .jr { font-weight: 800; font-size: 1.1rem; }
.hcard .jr i { font-style: normal; }
.hcard .jp { font-size: .6rem; font-weight: 800; letter-spacing: .02em; }
.hcard.bouncer .jp { color: #b3262b; }
.hcard.sel { transform: translateY(-16px) scale(1.1); box-shadow: 0 0 0 3px var(--teal), 0 8px 16px rgba(0, 0, 0, .5); }
.hcard.dead::after { content: 'Dead'; position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: .6rem; background: var(--coral); color: #fff; padding: 1px 5px; border-radius: 6px; }
.hcard.dead, .hcard.blocked { filter: grayscale(.7); opacity: .75; }
.actions { min-height: 60px; display: flex; align-items: center; justify-content: center; flex: none; }
.actions .btn.big { min-height: 56px; }
.plan { color: var(--muted); font-size: .9rem; text-align: center; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.results { position: fixed; inset: 0; background: rgba(5, 6, 14, .72); display: grid; place-items: center; z-index: 40; padding: 16px; }
.rcard { background: #171b36; border: 1px solid var(--border); border-radius: 22px; padding: 24px; max-width: 420px; width: 100%; text-align: center; }
.rcard h1 { color: var(--brass); }
.rbtns { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.rbtns.col { flex-direction: column; }

/* ---------- TV game ---------- */
.tvgame { flex-direction: row; gap: 40px; padding: 40px 60px; align-items: stretch; }
.tvleft, .tvright { width: 400px; display: flex; flex-direction: column; gap: 24px; }
.tvboard { --side: 1000px; gap: 4px; padding: 8px; border-width: 4px; border-radius: 18px; }
.tvboard .cell { border-radius: 8px; cursor: default; }
.tvboard .cell .ix { font-size: 36px; }
.tvboard .cell.corner .star { font-size: 56px; }
.tvboard .chip .mini { font-size: 20px; }
.tvboard .chip.locked { box-shadow: 0 0 0 5px var(--brass); }
.tvboard .chip.c1::after { border-width: 4px; }
.tvboard .chip.c2::after { height: 4px; }
.tvboard .cell.last::before { border-width: 5px; }
.tvpanel { background: rgba(42, 20, 56, .55); border: 3px solid var(--sc); border-radius: 26px; padding: 24px; flex: 1; display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.tvpanel h2 { color: var(--sc); font-size: 54px; margin: 0; }
.tvpanel .q { font-size: 34px; }
.tvpanel .q b { color: var(--brass); font-size: 48px; }
.tvps { display: flex; flex-direction: column; gap: 8px; flex: 1; min-height: 0; overflow: hidden; }
.tvp { display: flex; align-items: center; gap: 14px; font-size: 32px; padding: 6px 12px; border-radius: 14px; }
.tvp .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tvp .nm small { font-size: 20px; color: var(--muted); }
.tvp .hc { color: var(--muted); }
.tvp.on { background: rgba(232, 184, 74, .18); box-shadow: 0 0 0 3px var(--brass); }
.tvp.off { opacity: .45; }
.tvp .dot { width: 26px; height: 26px; }
.lastp { display: flex; align-items: center; gap: 16px; font-size: 28px; }
.tvcard { flex: none; width: 90px; height: 128px; cursor: default; }
.tvcard .hr { font-size: 44px; } .tvcard .hs { font-size: 40px; } .tvcard .jp { font-size: 16px; } .tvcard .jr { font-size: 36px; }
.tvinfo { font-size: 32px; display: flex; flex-direction: column; gap: 10px; }
.tvgame.three .tvpanel { padding: 16px 20px; gap: 8px; }
.tvgame.three .tvpanel h2 { font-size: 40px; }
.tvgame.three .tvp { font-size: 28px; }
.tvgame.three .tvcard { width: 64px; height: 92px; }
html.tv .results .rcard { transform: scale(calc(var(--k) * 2)); }
html.tv .results .rcard .btn:focus-visible, html.tv .results .rcard .btn:focus { outline: 3px solid var(--brass); }
