/* Copyright (c) 2026 Yoda Games. All rights reserved.
   Darts — the scoreboard around the board (js/ui/scoreboard.js): the bar (New game, the mode,
   sound, Settings), a card per player (.pcard: what is left, big; the average, darts and last
   visit; .is-turn: the one throwing, in gold; .is-cpu: the computer's blue), this visit's three
   darts and total (#visit), the helper line (the checkout route as gold chips) and, on wide
   screens, the leg's visits (#log). Wide: the panel's column, the cards stacked; tall: the cards
   side by side over the board, this visit and the helper under it. */

/* ── Bar ── */
#bar { display: flex; align-items: center; gap: 8px; min-width: 0; }
#btn-new { height: var(--btn); min-height: 0; padding: 0 16px; flex: none; }
/* a bar too narrow for the mode (js/main.js: under 350 px): it is left out, and the computer's card
   names its level instead */
#app.no-mode .mode-label { visibility: hidden; }
.nm-short { display: none; }
#app.no-mode .nm-long { display: none; }
#app.no-mode .nm-short { display: inline; }
/* a straight-out finish (js/ui/scoreboard.js; never in the bar, whose end gets cut off): on your
   card in the wide layout (a column wide), on the helper line in the tall one (cards side by side) */
.pc-rule, .h-rule { display: none; }
#app.mode-wide .pc-rule, #app.mode-tall .h-rule { display: inline; }
.mode-label { flex: 1 1 auto; min-width: 0; display: grid; gap: 1px; padding: 0 2px; line-height: 1.2; }
.mode-label b, .mode-label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mode-label b { font-size: 14px; font-weight: 800; color: var(--ink); }
.mode-label span { font-size: 13px; font-weight: 600; color: var(--muted); }
#btn-sound .off { display: none; }
#btn-sound.is-off .on { display: none; }
#btn-sound.is-off .off { display: inline; }
#btn-sound.is-off svg { stroke: var(--muted); }
#btn-sound.is-off svg .fill { fill: var(--muted); }

/* ── Player cards ── */
.cards { display: grid; gap: var(--gap); min-width: 0; }
#app.mode-tall .cards.n2 { grid-template-columns: 1fr 1fr; }
#app.mode-wide .cards { grid-auto-rows: var(--card-h); }
.pcard {
  position: relative;
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 2px;
  padding: 8px 12px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1.5px solid var(--line-soft);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.pcard.is-turn { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(255, 215, 0, 0.35), 0 0 18px rgba(255, 215, 0, 0.12); }
.pcard.is-cpu.is-turn { border-color: var(--cpu); box-shadow: 0 0 0 1px rgba(124, 200, 255, 0.35), 0 0 18px rgba(124, 200, 255, 0.12); }
.pcard.is-atc { grid-template-rows: auto 1fr auto; }
.pc-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.pc-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); }
.pcard.is-turn .pc-name { color: var(--gold-soft); }
.pcard.is-cpu.is-turn .pc-name { color: var(--cpu); }
.pcard.is-turn .pc-name::before { content: ''; display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 50%; background: currentColor; vertical-align: 1px; animation: turn-dot 1.4s ease-in-out infinite; }
@keyframes turn-dot { 50% { opacity: 0.35; } }
.pc-legs { display: inline-flex; gap: 4px; flex: none; }
.pc-legs i { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--gold-soft); }
.pc-legs i.on { background: var(--gold); border-color: var(--gold); }
.pc-step { font-size: 13px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.pc-body { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
/* the numbers in Inter, not the site's Orbitron: its slashed zero reads as Ø (501, 40) */
.pc-big { font-weight: 900; font-size: 36px; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.pc-big small { display: block; font-family: Inter, sans-serif; font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
.pc-stats { display: grid; gap: 1px; text-align: right; font-size: 13px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pc-stats b { color: var(--ink); font-weight: 800; }
.pc-stats .bad, .bad { color: var(--bad); }
.pc-pips { display: grid; grid-template-columns: repeat(21, minmax(0, 1fr)); gap: 2px; margin-top: 4px; }
.pc-pips i { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.12); }
.pc-pips i.on { background: var(--gold); }
.pc-pips i.now { background: #fff; box-shadow: 0 0 6px rgba(255, 255, 255, 0.6); }
#app.mode-wide .pc-big { font-size: 48px; }
#app.mode-wide .pc-stats { font-size: 14px; }
#app.mode-wide .cards.n1 .pc-big { font-size: 58px; }
#app.mode-tall .cards.n1 .pc-big { font-size: 42px; }
.pcard.is-atc .pc-big { display: flex; align-items: baseline; gap: 8px; }
.pcard.is-atc .pc-big small { margin: 0; }
#app.narrow .pc-big { font-size: 32px; }
#app.narrow .pcard { padding: 7px 10px; }
#app.narrow .pc-stats { font-size: 12.5px; }
#app.narrow .pc-name { font-size: 12px; letter-spacing: 0.3px; }
#app.narrow .pcard.is-turn .pc-name::before { margin-right: 4px; }
#app.narrow .pc-legs { gap: 3px; }
#app.narrow .pc-legs i { width: 9px; height: 9px; }
/* the narrowest cards (a 360 px phone in the shell, 320 px): "CPU · NORMAL" next to best of 5's
   three leg dots still fits, unclipped, on the computer's turn */
#app.narrow.no-mode .pcard { padding-left: 8px; padding-right: 8px; }
#app.narrow.no-mode .pc-head { gap: 4px; }
#app.narrow.no-mode .pcard.is-turn .pc-name::before { margin-right: 3px; }
#app.narrow.no-mode .nm-short { font-size: 11px; letter-spacing: 0; }
#app.narrow.no-mode .pc-legs { gap: 2px; }
#app.narrow.no-mode .pc-legs i { width: 8px; height: 8px; }

/* ── This visit: who, three darts, the total ── */
#visit { display: grid; grid-template-columns: minmax(52px, auto) repeat(3, minmax(0, 1fr)) minmax(58px, auto); gap: 6px; min-width: 0; }
.v-who { align-self: center; font-size: 12px; font-weight: 800; letter-spacing: 0.6px; text-transform: uppercase; color: var(--gold-soft); text-align: center; line-height: 1.15; }
.v-who.is-cpu { color: var(--cpu); }
.v-slot {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 0; border-radius: 11px;
  background: rgba(255, 255, 255, 0.07); border: 1.5px solid var(--line-soft);
  font-size: 19px; font-weight: 800; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums;
}
.v-slot small { font-size: 11.5px; font-weight: 700; color: var(--muted); }
.v-slot.is-empty { background: transparent; border-style: dashed; border-color: rgba(255, 255, 255, 0.14); }
.v-slot.is-next { border-color: rgba(255, 215, 0, 0.7); animation: slot-next 1.6s ease-in-out infinite; }
@keyframes slot-next { 50% { border-color: rgba(255, 215, 0, 0.25); } }
.v-slot.is-t { color: var(--gold-soft); border-color: rgba(255, 215, 0, 0.5); }
.v-slot.is-d { color: var(--mint); border-color: rgba(126, 240, 166, 0.45); }
.v-slot.is-miss { color: var(--muted); }
.v-slot.is-bust { text-decoration: line-through; text-decoration-color: var(--bad); opacity: 0.75; }
.v-total {
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 0 8px;
  border-radius: 11px; background: rgba(255, 215, 0, 0.1); border: 1.5px solid rgba(255, 215, 0, 0.4);
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.v-total.is-empty { background: transparent; border-style: dashed; border-color: rgba(255, 215, 0, 0.22); }
.v-total b { font-size: 22px; font-weight: 900; color: var(--gold-soft); }
.v-total b.bad { font-family: Inter, sans-serif; font-size: 16px; color: var(--bad); text-transform: uppercase; }
.v-total small { font-size: 11px; font-weight: 700; color: var(--muted); }
#app.mode-wide .v-slot { font-size: 21px; }
#app.mode-wide .v-total b { font-size: 24px; }

/* ── Helper line ── */
.helper { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 15px; color: var(--ink); }
#app.mode-wide .helper { justify-content: flex-start; padding: 0 4px; font-size: 16px; }
.h-lbl { font-size: 12px; font-weight: 800; letter-spacing: 0.8px; text-transform: uppercase; color: var(--gold-soft); margin-right: 2px; }
.h-dart { padding: 3px 9px; border-radius: 9px; background: rgba(255, 215, 0, 0.14); border: 1px solid rgba(255, 215, 0, 0.55); color: #fff3c4; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; }
.h-msg { overflow: hidden; text-overflow: ellipsis; }
.h-dim { color: var(--muted); }
.h-cpu { color: var(--cpu); }

/* ── This leg's visits (wide) ── */
.log { min-height: 0; overflow-y: auto; overscroll-behavior: contain; border-radius: 14px; background: rgba(255, 255, 255, 0.035); border: 1px solid rgba(255, 255, 255, 0.08); padding: 4px 0; }
.log li { display: grid; grid-template-columns: 82px minmax(0, 1fr) 46px 46px; align-items: center; gap: 6px; padding: 5px 12px; font-size: 14px; font-variant-numeric: tabular-nums; }
.log li + li { border-top: 1px solid rgba(255, 255, 255, 0.06); }
.log .lg-who { font-size: 12px; font-weight: 800; letter-spacing: 0.5px; text-transform: uppercase; color: var(--gold-soft); }
.log .lg-who.is-cpu { color: var(--cpu); }
.log .lg-darts { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log b { text-align: right; font-weight: 800; }
.log .lg-rem { text-align: right; color: var(--muted); }
.log .lg-empty { display: block; color: var(--muted); font-size: 14px; padding: 8px 12px; }
.cards.n1 ~ .log li { grid-template-columns: minmax(0, 1fr) 46px 56px; }
