/* ═══════════════════════════════════════════════════════════════════════════
   games-modes.css — Shared styles for alternative game-mode screens
   Pairs with js/games.js and js/dartboard-glyph.js
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Layout shell: board + scoreboard side-by-side on desktop ───────────── */
.gmode-screen {
  display: flex; flex-direction: column; gap: 14px;
}

.gmode-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.gmode-header .mode-title {
  font-size: 20px; font-weight: 900; letter-spacing: -0.01em;
}
.gmode-header-sub {
  font-size: 12px; color: var(--text-2); font-weight: 600;
  margin-top: 2px;
}
.gmode-exit {
  padding: 6px 12px; font-size: 12px; font-weight: 700;
  border-radius: 8px;
  background: rgba(18,21,23,0.05);
  color: var(--text-2);
  border: 1px solid var(--border-2);
  cursor: pointer;
}
.gmode-exit:hover {
  background: rgba(18,21,23,0.08);
  color: var(--text);
  border-color: var(--border-3);
}

.gmode-rule {
  font-size: 12px; color: var(--text-2);
  padding: 8px 12px;
  background: rgba(153,35,26,0.06);
  border: 1px solid rgba(153,35,26,0.15);
  border-radius: 8px;
  line-height: 1.5;
}

.gmode-body {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 16px;
}
@media (max-width: 720px) {
  .gmode-body { grid-template-columns: 1fr; gap: 14px; }
}

.gmode-visual {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 14px;
  min-height: 240px;
}
.gmode-visual-caption {
  font-size: 11px; color: var(--text-2); text-align: center;
  font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
}
.gmode-visual-target {
  font-size: 32px; font-weight: 900; color: var(--blue-2);
  line-height: 1;
}
.gmode-visual-target .sm {
  display: block; font-size: 12px; color: var(--text-2);
  font-weight: 700; margin-top: 4px; letter-spacing: 0.05em;
  text-transform: uppercase;
}

.gmode-side {
  display: flex; flex-direction: column; gap: 12px;
}

/* ── Scoreboard list ──────────────────────────────────────────────────── */
.gmode-board {
  display: flex; flex-direction: column; gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 6px;
}
.gmode-board-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  transition: background .12s;
  position: relative;
}
.gmode-board-row.is-active {
  background: rgba(153,35,26,0.10);
  box-shadow: inset 3px 0 0 var(--blue-2);
}
.gmode-board-row.is-out {
  opacity: 0.35;
}
.gmode-board-row.is-done {
  opacity: 0.55;
}
.gmode-board-row.is-winner {
  background: rgba(153,35,26,0.10);
  box-shadow: inset 3px 0 0 var(--green-2);
}
.gmode-board-name {
  font-weight: 700; font-size: 14px; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.gmode-board-name .meta {
  display: block; font-size: 11px; color: var(--text-2);
  font-weight: 600; margin-top: 1px;
}
.gmode-board-value {
  font-size: 18px; font-weight: 900;
  min-width: 44px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.gmode-board-value.sm { font-size: 13px; font-weight: 700; min-width: 0; }
.gmode-board-badge {
  font-size: 9px; font-weight: 900; letter-spacing: 0.06em;
  padding: 2px 6px; border-radius: 5px;
  background: var(--blue-bg); color: var(--blue-2);
  text-transform: uppercase;
}

/* ── Input zone: shared between modes ─────────────────────────────────── */
.gmode-input {
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 12px;
}
.gmode-input-title {
  font-size: 12px; font-weight: 800; color: var(--text);
  letter-spacing: 0.04em;
}
.gmode-input-title strong { color: var(--blue-2); }
.gmode-input-note {
  font-size: 11px; color: var(--text-2); line-height: 1.45;
  margin-top: -4px;
}

/* Buttons specific to alt modes */
.gmode-action-grid {
  display: grid; gap: 8px;
}
.gmode-action-grid.cols-2 { grid-template-columns: 1fr 1fr; }
.gmode-action-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.gmode-action-grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

.gmode-btn {
  padding: 12px 10px; border-radius: 10px;
  font-weight: 800; font-size: 14px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .08s;
  font-family: inherit;
}
.gmode-btn:hover:not(:disabled) {
  border-color: var(--blue-2);
  background: var(--surface-3);
}
.gmode-btn:active { transform: scale(0.98); }
.gmode-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.gmode-btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: var(--shadow-blue);
}
.gmode-btn-primary:hover:not(:disabled) {
  background: var(--blue-2);
  border-color: var(--blue-2);
}
.gmode-btn-danger {
  background: var(--red-bg);
  border-color: rgba(213,55,42,0.35);
  color: var(--red-2);
}
.gmode-btn-danger:hover:not(:disabled) {
  background: rgba(213,55,42,0.22);
  border-color: var(--red-2);
}
.gmode-btn-success {
  background: var(--green-bg);
  border-color: rgba(153,35,26,0.35);
  color: var(--green-2);
}
.gmode-btn-success:hover:not(:disabled) {
  background: rgba(153,35,26,0.22);
  border-color: var(--green-2);
}
.gmode-btn-sm { padding: 8px 10px; font-size: 12px; }
.gmode-btn-lg { padding: 16px 12px; font-size: 16px; }

/* ── Cricket / Shanghai table ─────────────────────────────────────────── */
.gmode-table {
  width: 100%; border-collapse: collapse;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.gmode-table th {
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em;
  padding: 8px 6px; text-align: center;
  color: var(--text-2);
  border-bottom: 1px solid var(--border-2);
}
.gmode-table th.is-active {
  color: var(--blue-2);
}
.gmode-table td {
  padding: 6px 6px; text-align: center;
  border-bottom: 1px solid var(--border);
}
.gmode-table td.label {
  text-align: left; font-weight: 700; padding-left: 10px;
  color: var(--text);
}
.gmode-table tr.is-closed td {
  opacity: 0.4;
  text-decoration: line-through;
}
.gmode-table tr.totals-row td {
  background: var(--surface-2);
  font-weight: 800; font-size: 15px;
  border-top: 2px solid var(--border-2);
  border-bottom: none;
}
.gmode-mark {
  display: inline-block; min-width: 16px; text-align: center;
  font-family: 'Georgia', serif;
  font-weight: 900; font-size: 17px; line-height: 1;
}
.gmode-mark.m-open  { color: var(--green-2); }
.gmode-mark.m-part  { color: var(--text); }

/* ── Challenge chip (Halve-It) ────────────────────────────────────────── */
.gmode-chip-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  font-size: 13px;
}
.gmode-chip-row.is-current {
  background: rgba(153,35,26,0.10);
  border-color: rgba(153,35,26,0.40);
  box-shadow: inset 0 0 0 1px rgba(153,35,26,0.20);
}
.gmode-chip-row.is-past { opacity: 0.5; }
.gmode-chip-label {
  flex: 1; font-weight: 700;
}
.gmode-chip-label .sub {
  display: block; font-size: 11px; color: var(--text-2); font-weight: 600; margin-top: 1px;
}
.gmode-chip-hits {
  font-size: 12px; font-weight: 800; color: var(--text-2);
  font-variant-numeric: tabular-nums;
}
.gmode-chip-hits.is-halved {
  color: var(--red-2);
}
.gmode-chip-hits.is-scored {
  color: var(--green-2);
}

/* ── Challenge history pills (Halve-It per-player breakdown) ──────────── */
.gmode-hist {
  display: flex; gap: 3px; flex-wrap: wrap; margin-top: 4px;
}
.gmode-hist-pill {
  font-size: 10px; font-weight: 700;
  padding: 2px 5px; border-radius: 4px;
  background: rgba(153,35,26,0.15); color: var(--green-2);
  font-variant-numeric: tabular-nums;
  display: inline-flex; align-items: center; gap: 3px;
}
.gmode-hist-pill.is-halved {
  background: rgba(213,55,42,0.18); color: var(--red-2);
}
.gmode-hist-pill.is-pending {
  background: var(--surface-3); color: var(--text-2);
}

/* ── Segment / number selector grid ───────────────────────────────────── */
.gmode-number-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
}
.gmode-number-btn {
  aspect-ratio: 1;
  border-radius: 9px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border-2);
  font-weight: 900; font-size: 16px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .1s;
  font-family: inherit;
}
.gmode-number-btn:hover:not(:disabled) {
  border-color: var(--blue-2);
  background: var(--surface-3);
  transform: translateY(-1px);
}
.gmode-number-btn:active { transform: scale(0.96); }
.gmode-number-btn:disabled { opacity: 0.25; cursor: not-allowed; }
.gmode-number-btn.is-selected {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ── Cricket input: number + S/D/T ────────────────────────────────────── */
.ckt-input-row {
  display: grid;
  grid-template-columns: 52px repeat(3, 1fr);
  gap: 5px;
  align-items: center;
  margin-bottom: 4px;
}
.ckt-input-label {
  font-weight: 800; font-size: 12px;
  text-align: center;
  padding: 8px 0;
  color: var(--text);
}
.ckt-input-label.is-closed { color: var(--text-3); text-decoration: line-through; }
.ckt-sdt-btn {
  padding: 8px 0;
  border-radius: 7px;
  font-weight: 800; font-size: 13px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all .1s;
  font-family: inherit;
}
.ckt-sdt-btn:hover:not(:disabled) {
  border-color: var(--blue-2);
  background: var(--surface-3);
}
.ckt-sdt-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Shanghai: per-dart entry ─────────────────────────────────────────── */
.sh-dart-row {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
}
.sh-dart-btn {
  padding: 10px 0;
  border-radius: 8px;
  font-weight: 800; font-size: 13px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
  transition: all .1s;
}
.sh-dart-btn:hover { border-color: var(--blue-2); }
.sh-dart-btn.is-miss { color: var(--text-3); }
.sh-dart-btn.is-single { color: var(--text); }
.sh-dart-btn.is-double { color: var(--red-2); background: rgba(213,55,42,0.08); border-color: rgba(213,55,42,0.25); }
.sh-dart-btn.is-treble { color: var(--green-2); background: rgba(153,35,26,0.08); border-color: rgba(153,35,26,0.25); }
.sh-visit-slots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 8px;
}
.sh-visit-slot {
  padding: 10px; border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-3);
  font-size: 13px; font-weight: 800; text-align: center;
  color: var(--text-3);
}
.sh-visit-slot.filled {
  border-style: solid; border-color: var(--border-3);
  color: var(--text);
}
.sh-visit-slot.is-double { color: var(--red-2); border-color: rgba(213,55,42,0.4); background: rgba(213,55,42,0.06); }
.sh-visit-slot.is-treble { color: var(--green-2); border-color: rgba(153,35,26,0.4); background: rgba(153,35,26,0.06); }

/* ── Mode picker: icon cards ──────────────────────────────────────────── */
.gm-mode-card-icon {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px;
  border-radius: 9px;
  background: rgba(18,21,23,0.04);
  border: 1px solid rgba(18,21,23,0.07);
  color: inherit;
  flex-shrink: 0;
  margin-bottom: 4px;
}

/* ── Result screen ────────────────────────────────────────────────────── */
.gmode-result {
  max-width: 520px; margin: auto;
  display: flex; flex-direction: column; gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 16px;
}
.gmode-result-title {
  font-size: 22px; font-weight: 900;
  text-align: center;
  background: var(--grad-text);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.gmode-result-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  gap: 10px;
}
.gmode-result-row.is-first {
  background: rgba(168,115,12,0.10);
  border-color: rgba(168,115,12,0.40);
}
.gmode-result-rank {
  font-size: 11px; font-weight: 900; letter-spacing: 0.08em;
  padding: 3px 8px; border-radius: 5px;
  background: var(--surface-3);
  color: var(--text-2);
  text-transform: uppercase;
  flex-shrink: 0; min-width: 32px; text-align: center;
}
.gmode-result-row.is-first .gmode-result-rank {
  background: rgba(168,115,12,0.22);
  color: var(--amber-2);
}
.gmode-result-name { flex: 1; font-weight: 800; font-size: 15px; }
.gmode-result-value { font-size: 13px; color: var(--text-2); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Colour legend inline ─────────────────────────────────────────────── */
.gmode-colour-legend {
  display: inline-flex; gap: 6px; align-items: center;
  font-size: 11px; color: var(--text-2); font-weight: 600;
}

/* ── TRB link/badge chip add-ons ──────────────────────────────────────── */
.gm-chip.is-linked {
  border-color: rgba(153,35,26,0.4);
  background: rgba(153,35,26,0.08);
}
.gm-chip-trb {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(153,35,26,0.18);
  color: var(--blue-2, #99231a);
  font-variant-numeric: tabular-nums;
}
.gm-chip-link {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--text-2);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  font-family: inherit;
  transition: all .12s;
}
.gm-chip-link:hover {
  border-color: var(--blue-2);
  color: var(--blue-2);
  background: rgba(153,35,26,0.08);
}

/* ── Killer: 3-dart visit slots ────────────────────────────────────────── */
.killer-visit-slots {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  margin-bottom: 10px;
}
.killer-dart-slot {
  padding: 10px 6px; border-radius: 8px;
  background: var(--surface-2);
  border: 1px dashed var(--border-3);
  font-size: 12px; font-weight: 800; text-align: center;
  color: var(--text-3);
  line-height: 1.2;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.killer-dart-slot.is-current {
  border-style: solid;
  border-color: var(--blue-2);
  background: rgba(153,35,26,0.08);
  color: var(--blue-2);
}
.killer-dart-slot.filled {
  border-style: solid; border-color: var(--border-3);
  color: var(--text);
}
.killer-dart-slot.filled.is-own {
  color: var(--amber-2);
  border-color: rgba(168,115,12,0.4);
  background: rgba(168,115,12,0.08);
}
.killer-dart-slot.filled.is-kill {
  color: var(--red-2);
  border-color: rgba(213,55,42,0.4);
  background: rgba(213,55,42,0.08);
}

/* ═══════════════════════════════════════════════════════════════════════════
   THE BIG FISH (solo practice mode)
   Visual style mirrors the X01 player card: dark gradient bg via .card,
   gradient top bar via .player-card::before, big score via .pc-score,
   green checkout banner via .checkout-banner, 3-cell stats via .pc-stats.
   Big Fish only adds:
     - .bf-mode-pill        — amber "BIG FISH" tag in card header
     - .bf-attempt-line     — "Attempt #N · Checkout 170" subhead
     - .bf-attempt-meta     — "This attempt: N darts · Visit M" line
     - .bf-alt-routes       — secondary route chips below the CO banner
     - .bf-success-pill     — "1/2 checked out · 50%" rate summary
     - .bf-visit-log /-row  — colour-coded attempt log
   Layout follows .match-grid--solo so responsive stacking at ≤700px
   is inherited from the canonical match-grid rules in style.css.
   ═══════════════════════════════════════════════════════════════════════════ */

.bf-match-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.bf-match-grid {
  margin-top: 4px;
}

/* Card header tweaks */
.bf-mode-pill {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(168,115,12,0.12);
  border: 1px solid rgba(168,115,12,0.35);
  color: #a8730c;
  text-transform: uppercase;
}
.bf-attempt-line {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 700;
  margin-top: -4px;
  letter-spacing: 0.02em;
}
.bf-attempt-line-sep {
  opacity: 0.4;
  margin: 0 6px;
}

/* "This attempt: 3 darts · Visit 2" line under the score */
.bf-attempt-meta {
  display: flex;
  gap: 10px;
  justify-content: center;
  font-size: 12px;
  color: var(--text-2);
  margin-top: -4px;
}
.bf-attempt-meta strong { color: var(--text); font-weight: 800; }
.bf-attempt-meta-sep { opacity: 0.4; }

/* The .player-card already centres .pc-score via flex direction column;
   for Big Fish we want the score visually centred (it's the focal point)
   so override its alignment within the bf-player-card. */
.bf-player-card .pc-score {
  text-align: center;
  font-size: 76px;
}

/* Alt-routes block sits beneath the green checkout-banner */
.bf-alt-routes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: -4px;
}
.bf-alt-routes-title {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: rgba(18,21,23,0.35);
  text-transform: uppercase;
  margin-bottom: 2px;
}
.bf-alt-route {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-radius: 7px;
  background: rgba(18,21,23,0.03);
  border: 1px solid rgba(18,21,23,0.06);
}
.bf-alt-route-label {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.05em;
  color: rgba(18,21,23,0.5);
  min-width: 36px;
}
.bf-alt-route-text {
  flex: 1;
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}
.bf-alt-route-darts {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-3);
}

/* "1 / 2 checked out · 50%" — small inline summary */
.bf-success-pill {
  align-self: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  background: rgba(18,21,23,0.04);
  border: 1px solid rgba(18,21,23,0.06);
  padding: 5px 10px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.bf-success-pill strong { color: #1e7a3e; font-weight: 900; }
.bf-success-pill-sep { opacity: 0.4; margin: 0 4px; }

/* Visit log — uses .visit-log base styling, adds row colouring */
.bf-visit-log {
  max-height: 160px;
}
.bf-visit-log-empty {
  font-size: 11px;
  color: var(--text-3);
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}
.bf-visit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  border-radius: 5px;
  font-size: 12px;
}
.bf-visit-row.is-co {
  background: rgba(153,35,26,0.06);
  color: #99231a;
}
.bf-visit-row.is-co .bf-visit-text { font-weight: 700; }
.bf-visit-row.is-bust {
  background: rgba(18,21,23,0.02);
  color: var(--text-3);
}
.bf-visit-num {
  font-size: 10px;
  font-weight: 900;
  color: rgba(18,21,23,0.4);
  min-width: 26px;
}
.bf-visit-text { flex: 1; }

/* Ctrl card — stays minimal: no fast/per-dart toggle, no numpad */
.bf-ctrl-card {
  /* inherits .card .ctrl-card visuals */
}

/* ── Mobile: card already stacks via .match-grid--solo @ ≤700px in
   style.css. The canonical solo CSS leaves the card in column 1 of a
   2-col grid (the spacer column 2 is display:none-ed), creating awkward
   whitespace. Force full width for Big Fish. */
@media (max-width: 700px) {
  .bf-match-grid > .bf-player-card { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .bf-player-card .pc-score { font-size: 56px; }
}
@media (max-width: 380px) {
  .bf-player-card .pc-score { font-size: 48px; }
}
