/* Connect Four Blitz: page-specific styles on top of ../arcade-common/pz.css */
body { --accent: #5b7bff; --accent2: #c05bff; }
body[data-tod="day"] { --accent: #3d63ff; --accent2: #a845f0; --boardbg: #e8f0ff; }
.hint.tiny { font-size: .8rem; margin-top: 8px; }
.hero-card .menu-art { max-height: 290px; width: 100%; object-fit: contain; background: transparent; }

/* disc style picker */
.skins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.skins button { border: 2px solid var(--line); background: var(--card2); border-radius: 14px; padding: 8px 4px 6px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-height: 76px; color: var(--ink); font-weight: 700; font-size: .75rem; min-width: 0; }
.skins button canvas { width: 46px; height: 46px; display: block; }
.skins button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--glow); background: var(--card); }
.skins button span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
@media (max-width: 380px) { .skins { gap: 5px; } .skins button { padding: 6px 2px 5px; font-size: .7rem; } .skins button canvas { width: 40px; height: 40px; } }

/* shared lobby inside the right card: drop its own card chrome and the duplicate name field */
.lobbybox > .card { background: transparent; border: 0; box-shadow: none; padding: 0; }
.lobbybox > .card > h2 { display: none; }
.lobbybox #pzLobbyJoin > .field { display: none; }
.lobbybox .btn.go { margin-top: 4px; }

/* game screen */
.gamegrid { display: grid; gap: 10px; justify-items: center; grid-template-columns: minmax(0, 1fr); grid-template-areas: "players" "status" "board" "actions"; --bw: min(100%, 560px, calc((100dvh - 262px) * .98)); }
.players { grid-area: players; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: min(100%, 560px); }
.statuswrap { grid-area: status; width: min(100%, 560px); display: grid; gap: 6px; }
.boardwrap { grid-area: board; width: var(--bw); min-width: 240px; }
.actions { grid-area: actions; display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; width: min(100%, 560px); }
.actions .btn { min-width: 112px; }
#board { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; border-radius: 14px; cursor: pointer; }
#board:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
#board.wait { cursor: default; }

.pc { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 16px; background: var(--card); border: 2px solid var(--line); box-shadow: var(--shadow); min-width: 0; position: relative; transition: border-color .2s, box-shadow .2s, opacity .2s; }
.pc.turn { border-color: var(--seatc); box-shadow: 0 0 0 4px color-mix(in srgb, var(--seatc) 28%, transparent), var(--shadow); }
.pc.away { opacity: .6; }
.pc#pc0 { --seatc: #ff5d73; } .pc#pc1 { --seatc: #ffc547; }
.pdisc { width: 44px; height: 44px; flex: none; }
.pn { min-width: 0; flex: 1; }
.pn b { display: block; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pn small { display: block; color: var(--muted); font-size: .75rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.1em; }
.sc { font-size: 1.5rem; font-weight: 800; min-width: 1.4ch; text-align: center; font-variant-numeric: tabular-nums; }
.status { font-size: .98rem; }
.tbar { height: 8px; border-radius: 99px; background: var(--card2); border: 1px solid var(--line); overflow: hidden; opacity: 0; transition: opacity .2s; }
.tbar.on { opacity: 1; }
.tbar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--go1), var(--accent)); transform-origin: left; border-radius: 99px; }
.tbar.low i { background: linear-gradient(90deg, #ff5d73, #ff9a3d); }

/* wide screens: board on the left, panel on the right */
@media (min-width: 1000px) and (min-height: 620px) {
  .gamegrid { grid-template-columns: minmax(0, auto) 330px; grid-template-areas: "board players" "board status" "board actions" "board ."; grid-template-rows: max-content max-content max-content 1fr; align-content: start; align-items: start; justify-content: center; gap: 14px 28px; --bw: min(660px, calc(100dvh - 120px)); }
  .players { grid-template-columns: 1fr; width: 100%; margin-top: 40px; }
  .statuswrap, .actions { width: 100%; }
  .actions { justify-content: flex-start; }
  .boardwrap { grid-row: 1 / span 4; }
}
/* phones held sideways (short and wide): the board takes the full height */
@media (orientation: landscape) and (max-height: 560px) {
  .gamegrid { grid-template-columns: minmax(0, auto) minmax(190px, 300px); grid-template-areas: "board players" "board status" "board actions" "board ."; grid-template-rows: max-content max-content max-content 1fr; justify-content: center; align-content: start; align-items: start; gap: 8px 14px; --bw: calc((100dvh - 70px) * .98); }
  .players { grid-template-columns: 1fr; width: 100%; gap: 6px; }
  .statuswrap, .actions { width: 100%; }
  .actions { justify-content: flex-start; }
  .boardwrap { grid-row: 1 / span 4; min-width: 0; }
  .pc { padding: 5px 8px; } .pdisc { width: 34px; height: 34px; } .status { min-height: 38px; font-size: .88rem; padding: 6px 8px; }
  .top { padding-top: max(4px, env(safe-area-inset-top)); padding-bottom: 4px; } .icon-btn { width: 38px; height: 38px; }
  main { padding-top: 0; }
}
@media (max-width: 380px) { .pc { padding: 6px 7px; gap: 6px; } .pdisc { width: 36px; height: 36px; } .pn b { font-size: .85rem; } .sc { font-size: 1.25rem; } }

/* header: fit one row down to 320 px */
.top { gap: 6px; }
.brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-size: clamp(.9rem, 4vw, 1.5rem); letter-spacing: -.03em; }
.brand i { font-style: normal; }
@media (max-width: 480px) { .brand i { display: none; } .back { padding: 10px 8px; } .seg button { padding: 6px 8px; min-height: 34px; } .icon-btn { width: 40px; height: 40px; } }
@media (max-width: 360px) { .seg button[data-tod="auto"] { display: none; } }
@media (max-width: 480px) { .pn b { font-size: .88rem; } .pdisc { width: 38px; height: 38px; } .sc { font-size: 1.3rem; } }

/* touch targets: 44 px minimum */
.btn.small { min-height: 44px; }
.chips button { min-height: 44px; }
.seg button { min-height: 44px; min-width: 44px; justify-content: center; }
.icon-btn { width: 44px; height: 44px; }
@media (max-width: 480px) { .seg button { padding: 6px 8px; min-height: 44px; } .icon-btn { width: 44px; height: 44px; } }

.back { min-width: 44px; justify-content: center; }

/* waiting for a friend: show only the room */
.waiting .tabs, .waiting #timerLabel, .waiting #timerPick, .waiting #timerHint { display: none; }
