/* /card scoring screens: start, setup, result, game view, full time.
   Built on tokens.css + card.css primitives. Mobile-first (360-430px), centred in the 480px app column. */

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ── Start ─────────────────────────────────────────────── */
.start-title { font-size: clamp(30px, 8.5vw, 38px); font-weight: 600; line-height: 1.08; letter-spacing: -0.02em; margin-top: 14px; }
.choices { display: grid; gap: 12px; margin-top: 6px; }
.choice {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card);
  box-shadow: var(--shadow-card); padding: 20px 18px; color: var(--ink);
  transition: transform .1s ease, border-color .15s ease;
}
.choice:hover { border-color: var(--turq); }
.choice:active { transform: scale(0.985); }
.choice__icon { flex: none; width: 52px; height: 52px; border-radius: 16px; display: flex; align-items: center; justify-content: center; background: var(--surface-tint); color: var(--turq-ink); }
.choice:first-child .choice__icon { background: var(--grad-turq); color: var(--navy-deep); }
.choice__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.choice__title { font-weight: 800; font-size: 17px; letter-spacing: -0.01em; line-height: 1.2; }
.choice__sub { font-size: 13.5px; color: var(--mid); line-height: 1.45; }
.choice__chev, .resume__chev { flex: none; color: var(--faint); display: flex; }
.start-note { text-align: center; color: var(--faint); font-size: 12.5px; font-weight: 600; margin-top: 22px; }

.resume { padding: 6px 8px 6px 6px; border-color: var(--turq); background: var(--surface-tint); }
.resume__main { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; background: none; border: none; text-align: left; padding: 12px 10px; font-weight: 800; font-size: 16px; color: var(--ink); }
.resume__reset { display: block; margin-left: auto; font-size: 12.5px; color: var(--mid); font-weight: 600; text-decoration: underline; padding: 2px 10px 8px; }

/* ── Setup / result ────────────────────────────────────── */
.back-link { display: inline-flex; align-items: center; gap: 6px; background: none; border: none; color: var(--mid); font-weight: 700; font-size: 14px; padding: 10px 4px 2px; }
.setup-form { padding: 18px 16px 16px; }
.setup-form .segment { overflow-x: auto; }
.team-field__row { display: grid; grid-template-columns: 1fr 56px; gap: 10px; }
.badge-in { padding-left: 4px; padding-right: 4px; text-transform: uppercase; }
.opt { font-weight: 500; color: var(--faint); }
.period-in { max-width: 110px; text-align: left; padding-left: 16px; }
.setup-form .btn--block { margin-top: 6px; }
.setup-form .form-error { margin-bottom: 8px; }

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.score-col { display: flex; flex-direction: column; gap: 8px; min-width: 0; background: var(--surface-tint); border-radius: var(--r-inner); padding: 12px 10px; }
.score-col__team { font-weight: 800; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--mid); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.score-col__fields { display: flex; gap: 8px; }
.score-in { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.score-in__lbl { font-size: 11px; font-weight: 700; color: var(--faint); text-align: center; }
.input--big { font-size: 26px; padding: 12px 4px; font-weight: 900; }
.score-col__total { text-align: center; font-weight: 900; font-size: 18px; color: var(--turq-ink); font-variant-numeric: tabular-nums; }
.more { margin: 2px 0 14px; }
.more summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--turq-ink); padding: 6px 2px; list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '+'; display: inline-block; width: 18px; font-weight: 800; }
.more[open] summary::before { content: '\2212'; }
.more__body { margin-top: 10px; }
.more__body .field { margin-bottom: 4px; }

/* ── Game view ─────────────────────────────────────────── */
[data-screen="game"] .gm-hdr { display: flex; align-items: center; gap: 8px; padding: 6px 0 14px; }
.icbtn { width: 38px; height: 38px; border-radius: 12px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 42, 68, 0.06); }
.gm-title { flex: 1; min-width: 0; }
.gm-t1 { font-weight: 800; font-size: 15px; letter-spacing: -0.01em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-t2 { font-size: 11px; color: var(--faint); font-weight: 600; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.undo { display: flex; align-items: center; gap: 7px; flex: none; background: var(--turq); border: none; color: var(--navy-deep); font-weight: 800; font-size: 13px; border-radius: var(--r-pill); padding: 9px 13px; box-shadow: 0 4px 12px -5px rgba(0, 168, 150, 0.5); }
.undo > span:first-child { display: flex; }
.undo .badge { background: var(--navy-deep); color: var(--turq-bright); font-size: 10px; font-weight: 800; min-width: 17px; height: 17px; border-radius: 9px; display: flex; align-items: center; justify-content: center; padding: 0 4px; font-variant-numeric: tabular-nums; }
.undo:disabled { background: var(--inset); color: var(--faint); box-shadow: none; cursor: default; }
.undo:disabled .badge { background: var(--line-strong); color: var(--faint); }

/* timer */
.timer { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 14px 16px 13px; box-shadow: var(--shadow-card); }
.timer-row { display: flex; align-items: center; gap: 12px; }
.clock { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.qchip { font-weight: 800; font-size: 13px; letter-spacing: 0.06em; color: var(--turq-ink); background: var(--inset); border-radius: 9px; padding: 6px 10px; flex: none; }
.time { font-weight: 800; font-size: 34px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1; }
.tcol { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.rem { font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.ctrl { display: flex; align-items: center; gap: 8px; flex: none; }
.pause { width: 46px; height: 46px; border-radius: 50%; background: var(--turq); color: var(--navy-deep); border: none; display: flex; align-items: center; justify-content: center; box-shadow: 0 6px 16px -5px rgba(0, 168, 150, 0.5); transition: transform .1s; }
.pause:active { transform: scale(0.93); }
.next { display: flex; flex-direction: column; align-items: center; gap: 2px; background: none; border: 1px solid var(--line-strong); border-radius: 14px; padding: 8px 12px; color: var(--ink); min-width: 62px; }
.next .nl { font-weight: 800; font-size: 11px; white-space: nowrap; }
.pbar-wrap { margin-top: 13px; }
.pbar-meta { display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); font-weight: 600; font-variant-numeric: tabular-nums; margin-bottom: 5px; }
.pbar { height: 5px; border-radius: 100px; background: var(--inset); overflow: hidden; }
.pbar .fill { height: 100%; width: 0; border-radius: 100px; background: linear-gradient(90deg, var(--turq-ink), var(--turq)); transition: width .25s linear; }
.timer.is-zero .time { animation: zeropulse 1.4s ease-in-out infinite; color: var(--danger); }
.timer.is-zero .rem { color: var(--danger); }
@keyframes zeropulse { 50% { opacity: .45; } }

/* grid scoreboard (board-only colours: the plates are physical white/turquoise in both themes) */
.board {
  --plate-edge: #C3CED5; --pts-edge: #00A294;
  margin-top: 14px; background: var(--grad-board); border-radius: var(--r-card);
  padding: 13px 14px 16px; box-shadow: var(--shadow-raised); color: #F8F9FA;
}
.board-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; gap: 8px; }
.live { display: flex; align-items: center; gap: 7px; }
.live .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--turq-bright); animation: blink 1.6s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.live .lb { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--turq-bright); font-weight: 800; }
.board .hint { font-size: 10px; color: rgba(248, 249, 250, 0.6); font-weight: 600; text-align: right; }

.sb-grid { --pw: 54px; display: grid; grid-template-columns: minmax(0, 1fr) repeat(var(--cols, 3), var(--pw)); gap: 11px 8px; align-items: center; }
.sb-grid[data-cols="2"] { --pw: 84px; }
.sb-grid[data-cols="4"] { --pw: 50px; gap: 11px 6px; }
.sb-head { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 800; text-align: center; color: rgba(248, 249, 250, 0.62); }
.sb-head.team { text-align: left; }
.sb-head.pts { color: var(--turq-bright); }
.sb-team { font-weight: 800; font-size: 15px; letter-spacing: 0.02em; text-transform: uppercase; color: #F8F9FA; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-grid[data-cols="4"] .sb-team { font-size: 13px; letter-spacing: 0.01em; }

.plate { position: relative; height: 46px; border-radius: 11px; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 21px; font-variant-numeric: tabular-nums; font-family: inherit; }
.plate::before { content: ''; position: absolute; top: -3px; left: 50%; transform: translateX(-50%); width: 5px; height: 5px; border-radius: 50%; background: rgba(248, 249, 250, 0.35); }
.plate.tap { background: linear-gradient(180deg, #FFFFFF, #EEF2F4); color: var(--navy-deep); border: none; box-shadow: 0 4px 0 var(--plate-edge), 0 7px 12px -4px rgba(0, 0, 0, 0.4); transition: transform .08s ease, box-shadow .08s ease; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.plate.tap:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--plate-edge), 0 3px 7px -3px rgba(0, 0, 0, 0.4); }
.plate.tap:focus-visible { outline: 2px solid var(--turq-bright); outline-offset: 3px; }
.plate.pts { background: linear-gradient(180deg, var(--turq-bright), var(--turq)); color: var(--navy-deep); box-shadow: 0 4px 0 var(--pts-edge), 0 7px 12px -4px rgba(0, 0, 0, 0.4); }
.plate.pts::before { background: rgba(8, 27, 46, 0.3); }
.plate span { display: inline-block; }
.bump { animation: bump .32s ease; }
@keyframes bump { 0% { transform: scale(1); } 38% { transform: scale(1.22); } 100% { transform: scale(1); } }

.period-line { margin: 12px 4px 0; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--mid); font-variant-numeric: tabular-nums; line-height: 1.6; }

/* ── Full time ─────────────────────────────────────────── */
.ft { margin-top: 4px; background: var(--grad-board); color: #F8F9FA; border-radius: var(--r-card); padding: 22px 18px 18px; box-shadow: var(--shadow-raised); text-align: center; }
.ft .eyebrow { color: var(--turq-bright); margin: 0 0 16px; text-align: center; }
.ft__board { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: start; gap: 8px; }
.ft__team { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.ft__name { font-weight: 800; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ft__score { font-weight: 900; font-size: 64px; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--turq-bright); }
.ft__bd { font-size: 13px; font-weight: 700; color: rgba(248, 249, 250, 0.6); font-variant-numeric: tabular-nums; min-height: 1em; }
.ft__dash { font-size: 28px; font-weight: 700; color: rgba(248, 249, 250, 0.35); padding-top: 28px; }
.ft .period-line { color: rgba(248, 249, 250, 0.6); margin: 14px 0 18px; }
.ft .btn { margin-top: 0; }
.ft__back { margin-top: 10px; background: transparent; color: rgba(248, 249, 250, 0.75); }

/* ── Sheet extras ──────────────────────────────────────── */
.sheet__actions { display: grid; gap: 10px; }
.sheet h3 { color: var(--ink); }

/* narrow phones */
@media (max-width: 380px) {
  .time { font-size: 30px; }
  .next { padding: 8px 9px; min-width: 56px; }
  .timer { padding-left: 13px; padding-right: 13px; }
  .board { padding-left: 12px; padding-right: 12px; }
  .ft__score { font-size: 54px; }
}
@media (min-width: 768px) {
  .start-title { font-size: 40px; }
}
.start-note--app { margin-top: 8px; color: var(--mid); font-weight: 500; line-height: 1.5; }
.start-note--app a { color: var(--turq-ink); font-weight: 700; }
