/* Curling TV components. Plain CSS on the system's tokens; class prefix ctv-. Loaded after tokens.css. */

/* Display styles run wide (Archivo width 125); scores use tabular figures. */
.display-tv, .display-xl, .display-l, .display-m { font-stretch: 125%; text-wrap: balance; }
.title { font-stretch: 112%; }
.score-xl, .score, .end { font-variant-numeric: tabular-nums; font-stretch: 100%; }
.label { text-transform: uppercase; }

/* ---------- Button: a pill, like a stone ---------- */
.ctv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5); border-radius: var(--radius-stone);
  font-family: var(--font-text); font-size: 16px; font-weight: 700; line-height: 1;
  border: 2px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform var(--nudge) var(--curl), box-shadow var(--nudge) var(--curl), background-color var(--nudge) var(--curl);
}
.ctv-btn svg { width: 20px; height: 20px; flex: none; }
.ctv-btn--primary { background: var(--handle); color: var(--on-handle); }
.ctv-btn--secondary { background: transparent; color: var(--granite); border-color: var(--line-strong); }
.ctv-btn--quiet { background: var(--ice-sunk); color: var(--granite); }
.ctv-btn--danger { background: transparent; color: var(--danger); border-color: var(--line-strong); }
.ctv-btn:hover { box-shadow: var(--shadow-hairline); }
.ctv-btn:active { transform: scale(0.97); }
.ctv-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ctv-btn:disabled, .ctv-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
/* Apple TV: the focused control lifts. Large sizes. */
.ctv-btn--tv { min-height: 72px; padding: 0 var(--space-6); font-size: 28px; gap: var(--space-3); }
.ctv-btn--tv svg { width: 30px; height: 30px; }
.ctv-btn.is-lifted { transform: scale(1.06); box-shadow: var(--shadow-lift); background: var(--handle); color: var(--on-handle); border-color: transparent; }

/* ---------- Badge: state, never decoration ---------- */
.ctv-badge {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--radius-stone);
  font-family: var(--font-text); font-size: 12px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  background: var(--ice-sunk); color: var(--granite);
}
.ctv-badge--live { background: var(--hog); color: var(--on-hog); }
.ctv-badge--live::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--on-hog); animation: ctv-onair 1.6s var(--curl) infinite; }
.ctv-badge--official { background: var(--gold); color: var(--on-gold); }
.ctv-badge--ad { background: var(--granite); color: var(--ice); }
.ctv-badge--final { background: transparent; color: var(--granite-muted); box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.ctv-badge--ok { color: var(--ok); }
@keyframes ctv-onair { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@media (prefers-reduced-motion: reduce) { .ctv-badge--live::before { animation: none; } }

/* ---------- Stone dot: which colour a team throws ---------- */
.ctv-stone { width: 14px; height: 14px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1.7px var(--granite-stone); }
.ctv-stone--red { background: var(--stone-red); }
.ctv-stone--yellow { background: var(--stone-yellow); }

/* ---------- Game card ---------- */
.ctv-game {
  display: flex; flex-direction: column; gap: var(--space-3); min-width: 0;
  padding: var(--space-4); border-radius: var(--radius-sheet); background: var(--frost); box-shadow: var(--shadow-hairline);
  color: var(--granite); font-family: var(--font-text);
}
.ctv-game__meta { display: flex; align-items: center; gap: var(--space-2); }
.ctv-game__sheet { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--granite-muted); }
.ctv-game__end { margin-left: auto; font-size: 13px; font-weight: 500; color: var(--granite-muted); }
.ctv-game__team { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto auto; align-items: center; gap: var(--space-2); }
.ctv-game__name { font-family: var(--font-display); font-stretch: 112%; font-size: 20px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctv-game__hammer { width: 18px; height: 18px; color: var(--granite-muted); }
.ctv-game__score { font-family: var(--font-display); font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; min-width: 1.2em; text-align: right; }
.ctv-game__team.is-trailing .ctv-game__name, .ctv-game__team.is-trailing .ctv-game__score { color: var(--granite-muted); }
.ctv-game__foot { font-size: 13px; color: var(--granite-muted); }

/* ---------- Scoreboard (linescore) ---------- */
.ctv-scoreboard { overflow-x: auto; border-radius: var(--radius-sheet); background: var(--frost); box-shadow: var(--shadow-hairline); }
.ctv-scoreboard table { border-collapse: collapse; width: 100%; font-family: var(--font-display); font-variant-numeric: tabular-nums; color: var(--granite); }
.ctv-scoreboard th, .ctv-scoreboard td { padding: 10px 8px; text-align: center; font-size: 18px; font-weight: 800; border-bottom: 1px solid var(--line); min-width: 32px; }
.ctv-scoreboard thead th { background: var(--ice-sunk); font-family: var(--font-text); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: var(--granite-muted); border-bottom: 0; }
.ctv-scoreboard tbody tr:last-child td, .ctv-scoreboard tbody tr:last-child th { border-bottom: 0; }
.ctv-scoreboard .ctv-scoreboard__team { text-align: left; font-family: var(--font-text); font-size: 16px; font-weight: 700; white-space: nowrap; padding-left: var(--space-4); }
.ctv-scoreboard .ctv-scoreboard__team span { display: inline-flex; align-items: center; gap: var(--space-2); }
.ctv-scoreboard .is-zero { color: var(--granite-subtle); font-weight: 500; }
.ctv-scoreboard .is-current { background: var(--handle-wash); }
.ctv-scoreboard .ctv-scoreboard__total { font-size: 26px; padding-right: var(--space-4); border-left: 1px solid var(--line); }
.ctv-scoreboard .ctv-scoreboard__hammer { width: 16px; height: 16px; vertical-align: -2px; }

/* ---------- Tabs: the sections of the app ---------- */
.ctv-tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--radius-stone); background: var(--ice-sunk); max-width: 100%; overflow-x: auto; }
.ctv-tabs a, .ctv-tabs button {
  display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: 0 var(--space-4); border: 0; border-radius: var(--radius-stone);
  background: transparent; color: var(--granite-muted); font-family: var(--font-text); font-size: 15px; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.ctv-tabs [aria-current="page"], .ctv-tabs [aria-selected="true"] { background: var(--granite); color: var(--ice); }
.ctv-tabs :focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- Text field ---------- */
.ctv-field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-text); min-width: 0; }
.ctv-field label { font-size: 13px; font-weight: 700; color: var(--granite); }
.ctv-field input {
  min-height: 48px; padding: 0 var(--space-4); border-radius: var(--radius-sheet); border: 1.5px solid var(--line-strong);
  background: var(--frost); color: var(--granite); font: 400 16px/1.2 var(--font-text);
}
.ctv-field input::placeholder { color: var(--granite-subtle); }
.ctv-field input:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.ctv-field__hint { font-size: 13px; color: var(--granite-muted); }
.ctv-field.is-invalid input { border-color: var(--danger); }
.ctv-field.is-invalid .ctv-field__hint { color: var(--danger); }

/* ---------- Sign-in code (Apple TV) ---------- */
.ctv-code { display: flex; align-items: center; gap: var(--space-3); }
.ctv-code span {
  display: grid; place-items: center; width: 1.2em; height: 1.5em; border-radius: var(--radius-sheet-tv);
  background: var(--frost); box-shadow: var(--shadow-hairline); color: var(--granite);
  font-family: var(--font-mono); font-weight: 700; font-size: 56px;
}
.ctv-code i { width: 24px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 0 var(--space-2); }

/* ---------- Ad bar: over a playing ad ---------- */
.ctv-adbar {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--space-4);
  background: rgba(16, 19, 22, 0.86); color: #F1F4F3; font-family: var(--font-text); font-size: 14px;
}
.ctv-adbar__who { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ctv-adbar__time { margin-left: auto; font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; }
.ctv-adbar .ctv-badge--ad { background: var(--handle); color: var(--on-handle); }
.ctv-scoreboard thead .ctv-scoreboard__total { font-size: 12px; }
