/* Board layout: a play stage that fills the screen, player rails above and below the board, overlays, home hero. */
.play { padding: 0; position: relative; height: 100dvh; min-height: 0; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; }
.play .hud { position: relative; z-index: 3; display: flex; align-items: center; gap: var(--s-2); padding: max(8px, env(safe-area-inset-top)) 10px 6px; flex: 0 0 auto; }
.stage { position: relative; flex: 1 1 auto; min-height: 0; display: grid; place-items: center; padding: 6px; }
.stage-canvas { display: block; image-rendering: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 6px; }
.stage[data-layered] .stage-canvas { position: absolute; }
/* player rails: one per side; the active one glows */
.rail { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); padding: 6px 12px; min-height: 52px; flex: 0 0 auto; }
.rail-bottom { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.seat { --pc: var(--accent); display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--surface) 80%, transparent); border: 2px solid transparent; font-weight: 700; transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base); max-width: 48vw; }
.seat .avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--pc); display: grid; place-items: center; color: #fff; font-size: .8rem; font-weight: 800; box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25); flex: 0 0 auto; }
.seat .who { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.seat .who b { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat .who small { font-size: .68rem; color: var(--ink-2); letter-spacing: .06em; text-transform: uppercase; }
.seat[data-active="true"] { border-color: var(--pc); box-shadow: 0 0 0 1px var(--pc), 0 0 18px color-mix(in oklab, var(--pc) 45%, transparent); transform: scale(1.02); }
.seat[data-thinking="true"] .who small::after { content: "…"; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 33% { content: "."; } 66% { content: ".."; } 100% { content: "..."; } }
.turn-hint { font-size: .85rem; color: var(--ink-2); text-align: center; flex: 1; }
/* overlays on the stage */
.overlay { position: absolute; inset: 0; z-index: 4; display: grid; place-items: center; background: color-mix(in oklab, var(--bg) 70%, transparent); backdrop-filter: blur(4px); animation: fade var(--t-base); text-align: center; padding: var(--gutter); }
.overlay h2 { font-family: var(--font-display); font-size: clamp(2rem, 9vw, 3.2rem); letter-spacing: .04em; text-transform: uppercase; }
.overlay .stack { align-items: center; }
.sound-hint { position: absolute; bottom: max(14px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); font-size: .8rem; color: var(--ink-2); background: color-mix(in oklab, var(--surface) 80%, transparent); padding: 6px 12px; border-radius: var(--r-pill); pointer-events: none; z-index: 5; }
/* home hero */
.board-home { justify-content: center; gap: var(--s-5); }
.title-wrap { text-align: center; }
.title { font-family: var(--font-display); font-size: clamp(2.6rem, 13vw, 5rem); line-height: .95; letter-spacing: .02em; color: var(--accent); text-shadow: 0 0 12px color-mix(in oklab, var(--accent) 60%, transparent), 0 0 40px color-mix(in oklab, var(--accent) 30%, transparent); }
.tagline { color: var(--ink-2); margin-top: 8px; }
.modes { display: grid; gap: 8px; }
.mode { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 16px; border-radius: var(--r-md); background: var(--surface); border: 2px solid transparent; text-align: left; min-height: 56px; transition: border-color var(--t-fast), transform var(--t-fast); }
.mode b { font-size: 1.05rem; } .mode span { font-size: .82rem; color: var(--ink-2); }
.mode[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 0 18px color-mix(in oklab, var(--accent) 35%, transparent); }
.mode:active { transform: scale(.98); }
.seg-line { display: flex; gap: 6px; }
.seg-line [role="radio"] { flex: 1; height: 44px; border-radius: var(--r-pill); background: var(--surface-2); font-weight: 700; font-size: .9rem; color: var(--ink-2); }
.seg-line [aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }
.picker { display: flex; flex-direction: column; gap: 6px; }
.picker-label { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); font-weight: 700; padding-left: 4px; }
.home-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; }
.cta { font-size: 1.15rem; height: 56px; letter-spacing: .06em; text-transform: uppercase; box-shadow: 0 0 24px color-mix(in oklab, var(--accent) 45%, transparent); }
.topbar { display: flex; align-items: center; gap: 6px; }
.best-line { display: flex; justify-content: center; gap: 18px; color: var(--ink-2); font-size: .9rem; }
.best-line b { color: var(--ink); }
.hud-pill { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; border-radius: var(--r-pill); background: color-mix(in oklab, var(--surface) 75%, transparent); backdrop-filter: blur(6px); font-weight: 700; font-size: .95rem; letter-spacing: .04em; }
.hud-pill small { font-weight: 600; color: var(--ink-2); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
/* player setup rows on home: colour swatch + name + human/AI toggle */
.seats { display: flex; flex-direction: column; gap: 6px; }
.seat-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; padding: 6px 8px; border-radius: var(--r-md); background: var(--surface); }
.seat-row .seat-name { flex: 1 1 110px; min-width: 0; }
.seat-row .seat-name small { color: var(--ink-2); font-weight: 600; }
.seat-row .row { flex: 0 0 auto; gap: 6px; margin-left: auto; }
.seat-row .swatch { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--pc); box-shadow: inset 0 -3px 0 rgb(0 0 0 / .25), 0 0 10px color-mix(in oklab, var(--pc) 40%, transparent); }
.seat-row .seat-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat-row .seg [role="radio"] { height: 32px; padding: 0 10px; font-size: .82rem; }
.seat-row[data-off="true"] { opacity: .45; }
/* result */
.result-verdict { text-align: center; color: var(--ink-2); font-weight: 700; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: var(--s-2); }
.result-actions .btn-primary { grid-column: 1 / -1; }
@container screen (min-width: 640px) { .board-home { max-width: 560px; margin-inline: auto; width: 100%; } }
/* desktop: board gets the height, rails move beside it */
@media (min-width: 900px) and (min-aspect-ratio: 5/4) {
  .play { display: grid; grid-template-columns: 1fr minmax(0, 100dvh) 1fr; grid-template-rows: auto 1fr; grid-template-areas: "hud hud hud" "left stage right"; }
  .play .hud { grid-area: hud; }
  .play .stage { grid-area: stage; padding: 10px; }
  .play .rail-top { grid-area: left; flex-direction: column; justify-content: center; align-items: flex-end; padding: 20px; }
  .play .rail-bottom { grid-area: right; flex-direction: column; justify-content: center; align-items: flex-start; padding: 20px; }
  .seat { max-width: none; height: 52px; }
  .play .rail .turn-hint { display: none; }
  .seat .avatar { width: 36px; height: 36px; }
}
