/* The Sports section (src/components/sports-view.ts): a home in the Movies
   home's language, and three levels under it, each a title over lines of
   cards: rows of match cards that glide as the Movies rows do (the stage
   up and down, a row's spacer sideways, transform only), and grids of
   sport (with its icon), country (with its flag), competition or station
   cards, the focused card in the same ring. The cards are glass tint without a blur:
   behind them is a still gradient, which a blur would only redraw (and at
   4K, at a cost). */

.sports-view {
  position: relative;
  height: 1080px;
  overflow: hidden;
  color: var(--text-primary);
  background:
    radial-gradient(1100px 620px at 88% -8%, rgba(var(--accent-rgb-legacy), 0.16), transparent 70%),
    radial-gradient(900px 560px at -6% 108%, rgba(var(--accent-rgb-legacy), 0.08), transparent 70%),
    var(--bg-primary);
}

body.tabbar-docked #view-sports .sports-view {
  height: 984px;
}

.sp-home {
  position: relative;
  height: 100%;
  overflow: hidden;
}

/* Title and lines move as one piece: past the first line the header
   leaves the screen and the lines have it to themselves. */
.sp-stage {
  position: relative;
  transition: transform 220ms cubic-bezier(0.2, 0, 0, 1);
  will-change: transform;
}

/* Its height is set inline: the parts below (HEADER_* in sports-view.ts). */
.sp-header {
  position: relative;
  padding: 28px 0 0 80px;
  box-sizing: border-box;
}

.sp-kicker {
  height: 34px;
  font-size: calc(22px * var(--font-scale));
  font-weight: 600;
  line-height: 30px;
  color: var(--accent);
}

.sp-title {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 0;
  font-size: calc(40px * var(--font-scale));
  font-weight: 700;
  line-height: 48px;
  color: var(--text-primary);
}

.sp-subtitle {
  height: 36px;
  font-size: calc(24px * var(--font-scale));
  line-height: 36px;
  color: var(--text-secondary);
}

/* The home's filter button, right of the title: a quiet glass pill with
   the sliders icon; a dot on it while a sport is hidden. Up from the
   grid's first line reaches it. */
.sp-filter {
  position: absolute;
  top: 30px;
  right: 80px;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 20px 0 16px;
  border: 2px solid var(--glass-edge);
  border-radius: 22px;
  background: var(--glass-tint);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font: inherit;
  font-size: calc(20px * var(--font-scale));
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
}

.sp-filter svg {
  width: 22px;
  height: 22px;
}

.sp-filter.is-set::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.sp-filter.focused {
  border-color: var(--catalog-focus);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 var(--glass-highlight), 0 0 16px var(--accent-glow);
}

/* A row: a heading and a track 330px tall (18px above the cards for the
   ring, 280px of card, room below for the ring's shadow). 372px a row:
   ROW_STRIDE in sports-view.ts. */
.sp-row {
  height: 372px;
}

.sp-row.is-mounted {
  will-change: transform;
}

.sp-row-title {
  margin: 0 0 6px 80px;
  font-size: calc(26px * var(--font-scale));
  font-weight: 600;
  line-height: 36px;
  color: var(--text-primary);
}

/* The clip window and what moves are different boxes, as on the Movies
   rows: the track clips, its spacer slides. The first card stands at
   92px, where the Movies rows' first poster does. */
.sp-row-track {
  position: relative;
  height: 330px;
  padding: 18px 0 0 62px;
  box-sizing: border-box;
  overflow: hidden;
}

.sp-row-spacer {
  position: relative;
  height: 300px;
  margin-left: 30px;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}

.sports-view.sp-holding .sp-stage,
.sports-view.sp-holding .sp-row-spacer {
  transition: none;
}

/* A match: when, the two teams over each other, the competition and the
   station. Glass tint and edge, a faint accent light from the top. */
.sp-card {
  position: absolute;
  top: 0;
  height: 280px;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 20px;
  box-sizing: border-box;
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb-legacy), 0.12), rgba(var(--accent-rgb-legacy), 0.02) 55%),
    var(--glass-tint);
  box-shadow: inset 0 1px 0 var(--glass-highlight), inset 0 0 0 1px var(--glass-edge);
  cursor: pointer;
  transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
}

/* The ring, painted once and faded in, as the Movies cards' (.gh-card). */
.sp-card::before {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: -3px;
  border: 3px solid var(--catalog-focus);
  border-radius: 17px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1);
}

.sp-card.focused {
  transform: scale(1.04);
}

.sp-card.focused::before {
  opacity: 1;
}

.sp-card-when {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 44px;
  font-size: calc(24px * var(--font-scale));
  font-weight: 600;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* The sport's icon at the card's top right, the size of the one on the
   home's sport cards (44px, the line's height), quiet; the LIVE pill and
   its minutes keep to the line's left with room to spare. */
.sp-card-sport {
  flex-shrink: 0;
  margin-left: auto;
  width: 44px;
  height: 44px;
  color: var(--text-secondary);
  opacity: 0.8;
}

.sp-card-sport .sp-sport-glyph {
  display: block;
  width: 44px;
  height: 44px;
}

.sp-time {
  color: var(--text-primary);
}

.sp-when-day {
  color: var(--text-secondary);
}

.sp-soon {
  color: var(--accent);
}

.sp-when-note {
  font-size: calc(21px * var(--font-scale));
  font-weight: 500;
  color: var(--text-secondary);
}

/* LIVE: the Guide's red, as a quiet pill (no pulse). */
.sp-live {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--danger);
  font-size: calc(17px * var(--font-scale));
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
}

.sp-card-teams {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

/* A team on its line: its two colours, then its name; "vs" on a line
   of its own between the two, so they never read as one name. */
.sp-team-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.sp-vs-row {
  height: 28px;
}

.sp-team {
  min-width: 0;
  font-size: calc(32px * var(--font-scale));
  font-weight: 600;
  line-height: 42px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-vs {
  flex-shrink: 0;
  font-size: calc(20px * var(--font-scale));
  font-weight: 600;
  line-height: 28px;
  color: var(--text-muted);
}

/* The two colours: two small blocks with a faint edge, so white and
   black both stand off the card. An empty slot keeps a name without
   colours in line with the other. */
.sp-colours {
  flex-shrink: 0;
  display: inline-flex;
  gap: 3px;
  width: 19px;
  height: 22px;
  margin-right: 12px;
}

.sp-colours > i {
  display: block;
  width: 8px;
  height: 22px;
  border-radius: 2px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

/* The page's title: the same, scaled to its type. */
.sp-page-title .sp-page-team {
  display: inline-flex;
  align-items: center;
}

.sp-page-title .sp-colours {
  width: 29px;
  height: 36px;
  gap: 5px;
  margin-right: 16px;
}

.sp-page-title .sp-colours > i {
  width: 12px;
  height: 36px;
  border-radius: 3px;
}

.sp-page-title .sp-vs {
  margin: 0 18px;
  font-size: calc(30px * var(--font-scale));
  line-height: inherit;
}

.sp-card-comp,
.sp-card-station {
  font-size: calc(20px * var(--font-scale));
  line-height: 28px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sp-card-comp {
  color: var(--text-secondary);
}

.sp-card-station {
  color: var(--text-muted);
}

.sp-card.focused .sp-card-station {
  color: var(--text-secondary);
}

.sp-card-station.is-none {
  font-style: italic;
}

/* A grid of sports, countries, competitions or stations: four landscape cards a line, 16:9,
   placed by sports-view.ts (left, width and height inline) where the rows'
   first card stands. */
.sp-tiles.is-mounted {
  will-change: transform;
}

.sp-tiles-track {
  position: relative;
  margin-left: 92px;
}

.sp-tile {
  position: absolute;
  top: 18px;
  display: flex;
  flex-direction: column;
  padding: 22px 28px 24px;
  box-sizing: border-box;
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb-legacy), 0.12), rgba(var(--accent-rgb-legacy), 0.02) 55%),
    var(--glass-tint);
  box-shadow: inset 0 1px 0 var(--glass-highlight), inset 0 0 0 1px var(--glass-edge);
  cursor: pointer;
  transition: transform 120ms cubic-bezier(0.2, 0, 0, 1);
}

.sp-tile::before {
  content: "";
  position: absolute;
  top: -3px;
  right: -3px;
  bottom: -3px;
  left: -3px;
  border: 3px solid var(--catalog-focus);
  border-radius: 17px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 20px var(--accent-glow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1);
}

.sp-tile.focused {
  transform: scale(1.04);
}

.sp-tile.focused::before {
  opacity: 1;
}

/* "All <sport>": the accent laid over, as on the Watch button. */
.sp-tile.is-all {
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb-legacy), 0.34), rgba(var(--accent-rgb-legacy), 0.1) 60%),
    var(--glass-tint);
}

.sp-tile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 36px;
}

.sp-tile-count {
  height: 30px;
  font-size: calc(21px * var(--font-scale));
  font-weight: 500;
  line-height: 30px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sp-tile-name {
  margin-top: auto;
  font-size: calc(34px * var(--font-scale));
  font-weight: 700;
  line-height: 42px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* A flag, 48x36 (4:3), its corners rounded and a 1px edge drawn over the
   picture so a flag with white at its edge still stands off the card. */
.sp-flag {
  position: relative;
  flex-shrink: 0;
  width: 48px;
  height: 36px;
  border-radius: 5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.sp-flag::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.sp-flag-img {
  display: block;
  width: 48px;
  height: 36px;
}

.sp-tile.is-empty .sp-tile-count {
  color: var(--text-muted);
}

/* International and Europe: a neutral mark in the flag's frame. */
.sp-flag.sp-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
}

.sp-mark-glyph {
  width: 28px;
  height: 28px;
}

/* A sport (the home's grid): its icon at the top, the matches beside it. */
.sp-tile.is-sport .sp-tile-head {
  height: 44px;
}

.sp-sport-glyph {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  color: var(--text-primary);
}

/* No match this week: still a way in, said quietly. */
.sp-tile.is-empty .sp-sport-glyph {
  color: var(--text-secondary);
}

/* A sport station of a country with no match this week: what it shows now,
   its name, and Watch on the focused one. */
.sp-tile-now {
  margin-top: 10px;
  font-size: calc(22px * var(--font-scale));
  line-height: 30px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Its logo left of its name, at the card's foot. */
.sp-tile-station {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: auto;
  min-width: 0;
}

.sp-station-tile .sp-tile-name {
  margin-top: 0;
  min-width: 0;
  font-size: calc(30px * var(--font-scale));
  line-height: 38px;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* A station's logo as Live draws it, 56px; its initial when it has none or
   it fails to load. */
.sp-logo {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sp-logo-img {
  max-width: 56px;
  max-height: 56px;
  border-radius: 4px;
  object-fit: contain;
}

.sp-logo-letter {
  width: 56px;
  height: 56px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(28px * var(--font-scale));
  font-weight: 600;
  line-height: 1;
  color: var(--accent);
}

.sp-tile-watch {
  margin-left: auto;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  background: linear-gradient(var(--glass-accent), var(--glass-accent)), var(--glass-tint);
  font-size: calc(20px * var(--font-scale));
  font-weight: 600;
  line-height: 36px;
  color: #fff;
  opacity: 0;
  transition: opacity 120ms cubic-bezier(0.2, 0, 0, 1);
}

.sp-tile.focused .sp-tile-watch {
  opacity: 1;
}

.sp-tile.is-empty .sp-tile-name {
  color: var(--text-secondary);
}

.sp-empty,
.sp-page-none {
  padding: 24px 80px;
  font-size: calc(24px * var(--font-scale));
  color: var(--text-secondary);
}

/* The match page, in place of the rows. */
.sp-page {
  height: 100%;
  overflow-y: auto;
  padding: 48px 80px;
  box-sizing: border-box;
}

.sp-page-head {
  padding-top: 24px;
}

.sp-page-comp {
  font-size: calc(22px * var(--font-scale));
  font-weight: 600;
  color: var(--accent);
}

.sp-page-title {
  max-width: 1500px;
  margin: 12px 0 0;
  font-size: calc(56px * var(--font-scale));
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
}

.sp-page-when {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-top: 16px;
  font-size: calc(24px * var(--font-scale));
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.sp-page-state {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sp-stations-title {
  margin: 48px 0 16px;
  font-size: calc(26px * var(--font-scale));
  font-weight: 600;
  line-height: 36px;
  color: var(--text-primary);
}

.sp-stations {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 1500px;
}

.sp-station {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 24px 28px;
  border: 3px solid transparent;
  border-radius: 14px;
  background:
    linear-gradient(165deg, rgba(var(--accent-rgb-legacy), 0.1), rgba(var(--accent-rgb-legacy), 0.02) 55%),
    var(--glass-tint);
  box-shadow: inset 0 1px 0 var(--glass-highlight), inset 0 0 0 1px var(--glass-edge);
}

.sp-station.selected {
  border-color: rgba(var(--accent-rgb-legacy), 0.45);
}

.sp-station-info {
  flex: 1;
  min-width: 0;
}

.sp-station-name {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: calc(28px * var(--font-scale));
  font-weight: 600;
  color: var(--text-primary);
}

/* A team's own channel, listed after the feeds that name the match. */
.sp-station-note {
  flex-shrink: 0;
  padding: 2px 10px;
  border-radius: 6px;
  background: rgba(var(--accent-rgb-legacy), 0.16);
  font-size: calc(18px * var(--font-scale));
  font-weight: 600;
  line-height: 24px;
  color: var(--text-secondary);
}

.sp-station-now {
  display: flex;
  gap: 14px;
  margin-top: 8px;
  font-size: calc(22px * var(--font-scale));
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
}

.sp-station-time {
  flex-shrink: 0;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.sp-station-programme {
  overflow: hidden;
  text-overflow: ellipsis;
}

.sp-station-else {
  margin-top: 8px;
  font-size: calc(21px * var(--font-scale));
  color: var(--warning);
}

.sp-station-actions {
  flex-shrink: 0;
  display: flex;
  gap: 16px;
}

/* The app's glass buttons (.gh-btn): Watch with the accent laid over. */
.sp-button {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 60px;
  padding: 0 28px;
  box-sizing: border-box;
  border: 3px solid var(--glass-edge);
  border-radius: 8px;
  background: var(--glass-tint);
  box-shadow: inset 0 1px 0 var(--glass-highlight);
  font-size: calc(22px * var(--font-scale));
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.sp-watch {
  background: linear-gradient(var(--glass-accent), var(--glass-accent)), var(--glass-tint);
  border-color: var(--glass-edge);
  color: #fff;
}

.sp-button.focused {
  border-color: var(--catalog-focus);
  outline: 3px solid var(--catalog-focus);
  outline-offset: 2px;
}

.sp-watch.focused {
  border-color: var(--text-primary);
  outline-color: rgba(255, 255, 255, 0.45);
}

.sp-button .epg-bell-glyph {
  width: 24px;
  height: 24px;
}

@media (prefers-reduced-motion: reduce) {
  .sp-stage,
  .sp-row-spacer,
  .sp-card,
  .sp-card::before,
  .sp-tile,
  .sp-tile::before,
  .sp-tile-watch {
    transition: none;
  }
}

/* The Guide's mark on a programme that is a match. */
.epg-match-glyph {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--accent);
}

.epg-tl-time .epg-match-glyph {
  width: 13px;
  height: 13px;
}
