/* ==========================================================================
   Sportzfy Play — broadcast control-room design system

   Two rules govern colour:
     · brand pink  = identity + anything you can interact with
     · tally red   = on air, and nothing else
   The tally bar (card left edge, hero chip, player LIVE pill) is the one
   moving element on the page. Everything else holds still.
   ========================================================================== */

:root,
#sportzfy-app {
  --ink-900: #06080e;
  --ink-850: #090c13;
  --ink-800: #0c1017;
  --ink-700: #141a24;
  --ink-600: #1d242f;

  --brand: #ff2e7e;
  --brand-hi: #ff5c99;
  --brand-wash: rgba(255, 46, 126, 0.12);
  --brand-glow: rgba(255, 46, 126, 0.32);

  --tally: #ff2d2d;
  --tally-glow: rgba(255, 45, 45, 0.45);

  --text: #f3f5f9;
  --text-dim: #8b93a3;
  --text-faint: #5b6373;

  --hair: rgba(255, 255, 255, 0.07);
  --hair-hi: rgba(255, 255, 255, 0.14);

  --font-display: 'Archivo', 'Inter', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-pill: 999px;

  --gutter: 4%;
  --header-h: 72px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --t-fast: 140ms var(--ease);
  --t: 240ms var(--ease);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Form controls opt out of inheritance by default. Every component below sets
   its own family, so this only has to beat the UA and the Blogger host. */
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

body,
#sportzfy-app {
  background-color: var(--ink-900);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#sportzfy-app {
  min-height: 100vh;
  position: relative;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* Broadcast rail: condensed, uppercase, wide-tracked. Used for every label
   that names a thing rather than saying it. */
.rail {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}

/* Counts and durations are data. They align. */
.tabular {
  font-variant-numeric: tabular-nums;
}

/* ---- Blogger host resets ------------------------------------------------ */

body.sportzfy-blogger .header,
body.sportzfy-blogger .tabs-outer,
body.sportzfy-blogger .breadcrumbs,
body.sportzfy-blogger .blog-pager,
body.sportzfy-blogger .post-footer,
body.sportzfy-blogger .comments,
body.sportzfy-blogger .sidebar,
body.sportzfy-blogger .footer {
  display: none !important;
}

body.sportzfy-blogger .main,
body.sportzfy-blogger .main-inner,
body.sportzfy-blogger .column-center-inner,
body.sportzfy-blogger .section,
body.sportzfy-blogger .widget {
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
  background: transparent !important;
}

body.sportzfy-blogger {
  margin: 0;
  padding: 0;
  background: #06080e !important;
}

body.sportzfy-blogger #sportzfy-app a {
  color: inherit;
  text-decoration: none;
}

body.sportzfy-blogger #sportzfy-app img {
  border: 0;
  padding: 0;
  background: transparent;
}

#sportzfy-app [class*='fa-solid'],
#sportzfy-app [class*='fa-regular'] {
  font-family: 'Font Awesome 6 Free' !important;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
}

#sportzfy-app [class*='fa-regular'] {
  font-weight: 400;
}

#sportzfy-app [class*='fa-brands'] {
  font-family: 'Font Awesome 6 Brands' !important;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--ink-900);
}

::-webkit-scrollbar-thumb {
  background: var(--ink-700);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--brand);
}

/* ---- Views -------------------------------------------------------------- */

.view {
  display: none;
  min-height: 100vh;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.view.active {
  display: block;
  animation: view-in 320ms var(--ease) both;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---- Preloader ---------------------------------------------------------- */

#fctv-preloader {
  position: fixed;
  inset: 0;
  background-color: var(--ink-900);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 26px;
  transition: opacity 500ms var(--ease), visibility 500ms;
}

#fctv-preloader.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.preloader-brand {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.4rem, 4vw, 2rem);
  letter-spacing: -0.01em;
}

.preloader-brand span {
  color: var(--brand);
}

.preloader-track-line {
  width: min(240px, 60vw);
  height: 2px;
  background: var(--hair);
  overflow: hidden;
  position: relative;
}

.preloader-progress-glow {
  position: absolute;
  inset-block: 0;
  left: -40%;
  width: 40%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: preloader-sweep 1.15s linear infinite;
}

@keyframes preloader-sweep {
  from {
    left: -40%;
  }
  to {
    left: 100%;
  }
}

/* ---- Navbar ------------------------------------------------------------- */

.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  min-height: var(--header-h);
  padding: 0 var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: linear-gradient(to bottom, rgba(6, 8, 14, 0.92), rgba(6, 8, 14, 0));
  transition: background var(--t), border-color var(--t);
  border-bottom: 1px solid transparent;
}

.navbar.scrolled {
  background: rgba(6, 8, 14, 0.86);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--hair);
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  flex-shrink: 0;
}

.brand-icon {
  width: 34px;
  height: 34px;
  background: var(--brand);
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
}

.brand-text {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.brand-text span {
  color: var(--brand);
}

.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

.nav-desktop-item {
  font-family: var(--font-display);
  font-stretch: 87%;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  background: none;
  border: none;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}

.nav-desktop-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.nav-desktop-item.active {
  color: var(--text);
}

.nav-desktop-item.active::after {
  content: '';
  display: block;
  height: 2px;
  margin-top: 5px;
  border-radius: 2px;
  background: var(--brand);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 1 auto;
  min-width: 0;
}

.search-wrapper {
  position: relative;
  width: clamp(180px, 22vw, 280px);
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--hair);
  border-radius: var(--r-pill);
  padding: 9px 16px 9px 38px;
  color: var(--text);
  font-size: 0.875rem;
  outline: none;
  transition: border-color var(--t-fast), background var(--t-fast), box-shadow var(--t-fast);
}

.search-input::placeholder {
  color: var(--text-faint);
}

.search-input:focus {
  border-color: var(--brand);
  background: var(--brand-wash);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.search-wrapper i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-faint);
  font-size: 0.8125rem;
  pointer-events: none;
}

.channel-count-badge {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  border: 1px solid var(--hair);
  padding: 6px 11px;
  border-radius: var(--r-sm);
  white-space: nowrap;
}

/* ---- Hero: a channel slate, not a movie poster -------------------------- */

.hero {
  position: relative;
  min-height: 46vh;
  display: flex;
  align-items: flex-end;
  padding: calc(var(--header-h) + 40px) var(--gutter) 44px;
  overflow: hidden;
  margin-bottom: 40px;
}

/* Ambient wash tinted by the featured channel itself, set from JS. */
.hero-wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(90% 130% at 14% 110%, var(--hero-tint, #1b2230) 0%, transparent 62%),
    radial-gradient(60% 100% at 88% 0%, rgba(255, 46, 126, 0.09) 0%, transparent 70%);
}

.hero-wash::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--ink-900) 100%);
}

/* The channel's own mark, oversized and quiet, instead of stock photography.
   Source logos usually carry a solid background, so the mark is dissolved into
   the wash rather than sitting on it as a rectangle. */
.hero-watermark {
  position: absolute;
  right: -4%;
  top: 50%;
  transform: translateY(-50%);
  height: 130%;
  max-width: 44%;
  object-fit: contain;
  opacity: 0.1;
  filter: grayscale(1) contrast(0.9) blur(1px);
  z-index: 0;
  pointer-events: none;
  -webkit-mask-image: radial-gradient(closest-side, #000 30%, transparent 78%);
  mask-image: radial-gradient(closest-side, #000 30%, transparent 78%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 840px;
  width: 100%;
}

.on-air {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text);
  margin-bottom: 18px;
}

.tally-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tally);
  box-shadow: 0 0 10px var(--tally-glow);
  flex-shrink: 0;
}

.on-air .tally-dot {
  animation: tally-breathe 2.4s var(--ease) infinite;
}

@keyframes tally-breathe {
  0% {
    opacity: 1;
    box-shadow: 0 0 0 0 var(--tally-glow);
  }
  60% {
    opacity: 0.75;
    box-shadow: 0 0 0 7px rgba(255, 45, 45, 0);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 0 0 rgba(255, 45, 45, 0);
  }
}

.hero-slate {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-logo-chip {
  width: 88px;
  height: 88px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  padding: 12px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hair);
}

.hero-logo-chip img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.hero-title {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.625rem, 3.6vw, 3rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.hero-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 26px;
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.hero-meta .sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--text-faint);
}

.btn {
  border: none;
  font-family: var(--font-display);
  font-stretch: 87%;
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: var(--r-pill);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}

.btn-play {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 8px 24px -6px var(--brand-glow);
}

.btn-play:hover {
  background: var(--brand-hi);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px var(--brand-glow);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--hair-hi);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.06);
}

/* ---- Shelves ------------------------------------------------------------ */

.section-row {
  margin-bottom: 42px;
  padding-left: var(--gutter);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding-right: var(--gutter);
}

.section-title {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.section-title i {
  color: var(--brand);
  font-size: 0.75rem;
}

/* The rule separates; the count is real data. Neither is decoration. */
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--hair);
}

.section-count {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

button.section-count {
  cursor: pointer;
  transition: color var(--t-fast);
}

button.section-count i {
  font-size: 0.5625rem;
  transition: transform var(--t-fast);
}

button.section-count:hover {
  color: var(--brand);
}

button.section-count:hover i {
  transform: translateX(2px);
}

.carousel-container {
  position: relative;
}

.carousel {
  display: flex;
  overflow-x: auto;
  gap: 14px;
  padding-bottom: 6px;
  padding-right: var(--gutter);
  scroll-behavior: smooth;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: rgba(12, 16, 23, 0.92);
  border: 1px solid var(--hair-hi);
  color: var(--text);
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 20;
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
  backdrop-filter: blur(8px);
  font-size: 0.875rem;
}

.scroll-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  transform: translateY(-50%) scale(1.06);
}

.scroll-left {
  left: -20px;
}

.scroll-right {
  right: calc(var(--gutter) - 20px);
}

/* ---- Card: a tuner tile ------------------------------------------------- */

.card {
  flex: 0 0 216px;
  scroll-snap-align: start;
  position: relative;
  background: var(--ink-800);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--t), border-color var(--t), background var(--t);
}

/* The tally bar. Grey until you reach for the channel, then it goes on air. */
.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--hair-hi);
  transition: background var(--t-fast);
  z-index: 4;
}

.card:hover,
.card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--hair-hi);
  background: var(--ink-700);
}

.card:hover::before,
.card:focus-visible::before {
  background: var(--tally);
  animation: tally-flicker 1.6s var(--ease) infinite;
}

@keyframes tally-flicker {
  0% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
  100% {
    opacity: 1;
  }
}

.card-banner {
  position: relative;
  aspect-ratio: 16 / 10;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(120% 120% at 50% 0%, var(--ink-700) 0%, var(--ink-800) 100%);
}

/* Every logo sits on the same chip, so an opaque white mark reads as
   deliberate rather than as a sticker dropped on a dark card. */
.card-logo-chip {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: var(--r-sm);
  background: rgba(255, 255, 255, 0.04);
}

/* A generated initials mark is artwork in its own right — it fills the tile. */
.card-logo-chip.is-fallback {
  padding: 0;
  background: none;
  overflow: hidden;
}

.card-logo {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.card-logo-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--r-sm);
}

.play-overlay {
  position: absolute;
  inset: 0;
  background: rgba(6, 8, 14, 0.66);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity var(--t);
  z-index: 3;
}

.play-overlay i {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 0.9375rem;
  padding-left: 3px;
  transform: scale(0.8);
  transition: transform var(--t);
}

.card:hover .play-overlay,
.card:focus-visible .play-overlay {
  opacity: 1;
}

.card:hover .play-overlay i,
.card:focus-visible .play-overlay i {
  transform: scale(1);
}

.card-info {
  padding: 11px 12px 12px;
  border-top: 1px solid var(--hair);
}

.card-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* The junk that used to clutter the title — country prefix, quality suffix —
   becomes structure here. */
.card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  min-height: 18px;
}

.card-origin {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.625rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-flag {
  font-size: 0.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.card-quality {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  border: 1px solid var(--hair-hi);
  border-radius: 3px;
  padding: 2px 4px;
}

/* ---- Browse ------------------------------------------------------------- */

.browse-header {
  padding: calc(var(--header-h) + 32px) var(--gutter) 0;
}

.browse-title {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 14px;
  flex-wrap: wrap;
}

.result-count {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  border: 1px solid var(--brand);
  border-radius: var(--r-sm);
  padding: 4px 9px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 22px;
  padding: 24px var(--gutter) 6px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 9px;
  min-width: 0;
}

.filter-label {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.625rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 13px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair);
  background: var(--ink-800);
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
  white-space: nowrap;
}

.filter-chip:hover {
  color: var(--text);
  border-color: var(--hair-hi);
}

.filter-chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.filter-select {
  min-width: 240px;
  max-width: 340px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hair);
  background: var(--ink-800);
  color: var(--text);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
}

.filter-select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-glow);
}

.filter-reset {
  padding: 10px 16px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hair);
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.filter-reset:hover {
  color: var(--text);
  border-color: var(--hair-hi);
}

.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 16px;
  padding: 24px var(--gutter) 40px;
}

.channel-grid .card {
  flex: auto;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-dim);
  padding: 80px 20px;
}

.empty-state i {
  font-size: 2rem;
  margin-bottom: 18px;
  color: var(--text-faint);
  display: block;
}

.empty-state p {
  font-size: 0.9375rem;
  margin-bottom: 20px;
}

.grid-note {
  grid-column: 1 / -1;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-faint);
  font-size: 0.8125rem;
}

/* ---- Player ------------------------------------------------------------- */

.player-container {
  padding: calc(var(--header-h) + 28px) var(--gutter) 40px;
  max-width: 1600px;
  margin: 0 auto;
}

.player-wrapper {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  position: relative;
  border: 1px solid var(--hair);
  box-shadow: 0 30px 70px -20px rgba(0, 0, 0, 0.8);
  margin-bottom: 22px;
}

.player-wrapper.is-fullscreen {
  border-radius: 0;
  border: 0;
  aspect-ratio: auto;
  height: 100%;
}

#iptv-video {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  object-fit: contain;
  background: #000;
}

/* Slate stands in for a poster. A stretched 320px logo never was one. */
.player-slate {
  position: absolute;
  inset: 0;
  z-index: 8;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 20px;
  background: radial-gradient(70% 95% at 50% 42%, var(--slate-tint, #171d28) 0%, #05070c 72%);
}

.player-slate[hidden] {
  display: none;
}

.slate-logo {
  width: clamp(84px, 11vw, 132px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 16px;
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hair);
}

.slate-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.slate-name {
  font-family: var(--font-display);
  font-stretch: 125%;
  font-weight: 800;
  font-size: clamp(1rem, 2vw, 1.625rem);
  letter-spacing: -0.02em;
  text-align: center;
  padding: 0 24px;
}

.slate-status {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-dim);
}

/* A stall mid-match. The picture stays up; only the spinner arrives. */
.player-buffer {
  position: absolute;
  inset: 0;
  z-index: 11;
  display: grid;
  place-items: center;
  pointer-events: none;
}

/* Failure. Says what happened, then what to do about it. */
.player-status {
  position: absolute;
  inset: 0;
  z-index: 16;
  display: none;
  align-content: center;
  justify-items: center;
  gap: 16px;
  padding: 24px;
  text-align: center;
  background: rgba(4, 6, 11, 0.86);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.player-status.show {
  display: grid;
}

.player-status-text {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 700;
  font-size: clamp(1.0625rem, 1.6vw, 1.375rem);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--text);
  max-width: 26ch;
  text-wrap: balance;
}

.player-status-hint {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--text-dim);
  max-width: 42ch;
  margin-top: -6px;
  text-wrap: balance;
}

.player-status-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.player-status .btn {
  padding: 11px 20px;
  font-size: 0.75rem;
}

.loading-spinner {
  width: 42px;
  height: 42px;
  border: 2px solid var(--hair-hi);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

.loading-spinner.is-small {
  width: 13px;
  height: 13px;
  border-width: 1.5px;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Controls */

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 48px 14px 12px;
  background: linear-gradient(to top, rgba(3, 5, 9, 0.94) 0%, rgba(3, 5, 9, 0.5) 55%, transparent 100%);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity var(--t), transform var(--t);
}

.player-wrapper.controls-visible .player-controls {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.pc-btn {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: none;
  background: transparent;
  color: var(--text);
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 0.9375rem;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}

.pc-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pc-spacer {
  flex: 1;
}

.pc-volume {
  display: flex;
  align-items: center;
}

.pc-volume input[type='range'] {
  width: 0;
  opacity: 0;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
  transition: width var(--t), opacity var(--t), margin var(--t);
}

.pc-volume:hover input[type='range'],
.pc-volume:focus-within input[type='range'] {
  width: 76px;
  opacity: 1;
  margin: 0 10px 0 4px;
}

/* The LIVE pill is the player's tally light. Its three states are the three
   things a live stream can actually be doing. */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 12px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  border: 1px solid var(--hair-hi);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: default;
  flex-shrink: 0;
}

.live-pill[data-state='live'] .tally-dot {
  animation: tally-breathe 2.4s var(--ease) infinite;
}

.live-pill[data-state='buffering'] .tally-dot {
  background: var(--text-faint);
  box-shadow: none;
  animation: tally-flicker 900ms linear infinite;
}

.live-pill[data-state='behind'] {
  cursor: pointer;
  border-color: var(--brand);
  color: var(--brand);
}

.live-pill[data-state='behind'] .tally-dot {
  background: var(--text-faint);
  box-shadow: none;
}

.live-pill[data-state='behind']:hover {
  background: var(--brand-wash);
}

.pc-server {
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
  padding: 0 10px;
  white-space: nowrap;
}

.pc-menu {
  position: relative;
  flex-shrink: 0;
}

.pc-menu-btn {
  height: 30px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  border: 1px solid var(--hair-hi);
  background: transparent;
  color: var(--text);
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background var(--t-fast);
}

.pc-menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pc-menu-list {
  position: absolute;
  bottom: calc(100% + 10px);
  right: 0;
  min-width: 150px;
  max-height: 260px;
  overflow-y: auto;
  background: var(--ink-800);
  border: 1px solid var(--hair-hi);
  border-radius: var(--r-md);
  padding: 6px;
  display: none;
  box-shadow: 0 20px 44px rgba(0, 0, 0, 0.65);
}

.pc-menu.open .pc-menu-list {
  display: block;
}

.pc-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 9px 10px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 600;
  text-align: left;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast);
}

.pc-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

.pc-menu-item[aria-checked='true'] {
  color: var(--brand);
}

.pc-menu-item[aria-checked='true']::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.625rem;
}

/* ---- Stream meta panel -------------------------------------------------- */

.stream-meta-panel {
  background: var(--ink-800);
  border: 1px solid var(--hair);
  border-radius: var(--r-lg);
  padding: 22px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 44px;
}

.channel-id {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}

.channel-id img {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 9px;
}

.channel-id h1 {
  font-family: var(--font-display);
  font-stretch: 112%;
  font-weight: 800;
  font-size: clamp(1.125rem, 2.2vw, 1.625rem);
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 7px;
}

.channel-tags {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 600;
  font-size: 0.6875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.channel-tags .tag {
  border: 1px solid var(--hair);
  border-radius: var(--r-sm);
  padding: 4px 8px;
}

.player-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.action-btn {
  background: transparent;
  border: 1px solid var(--hair-hi);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-stretch: 87%;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.action-btn.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* ---- Ads ---------------------------------------------------------------- */

#sportzfy-app .ad-native-slot {
  margin: 0 var(--gutter) 32px;
  min-height: 90px;
  overflow: hidden;
  border-radius: var(--r-md);
}

/* ---- Mobile nav --------------------------------------------------------- */

.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(9, 12, 19, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--hair);
  z-index: 1000;
  padding-bottom: env(safe-area-inset-bottom);
}

.mobile-nav-inner {
  display: flex;
  justify-content: space-around;
  padding: 8px 0 6px;
}

.m-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text-faint);
  font-family: var(--font-display);
  font-stretch: 75%;
  font-weight: 700;
  font-size: 0.5625rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  background: none;
  border: none;
  min-width: 0;
  flex: 1;
  padding: 6px 2px;
  transition: color var(--t-fast);
}

.m-nav-item i {
  font-size: 1rem;
  transition: transform var(--t);
}

.m-nav-item.active {
  color: var(--brand);
}

.m-nav-item.active i {
  transform: translateY(-2px);
}

/* ---- Responsive --------------------------------------------------------- */

@media (max-width: 1100px) {
  .nav-links {
    display: none;
  }
}

@media (max-width: 768px) {
  :root,
  #sportzfy-app {
    --gutter: 5%;
    --header-h: 64px;
  }

  .channel-count-badge {
    display: none;
  }

  .search-wrapper {
    width: clamp(140px, 44vw, 240px);
  }

  .mobile-nav {
    display: block;
  }

  .hero {
    min-height: 0;
    padding: calc(var(--header-h) + 26px) var(--gutter) 30px;
    margin-bottom: 30px;
  }

  .hero-watermark {
    height: 88%;
    max-width: 62%;
    opacity: 0.05;
  }

  .hero-slate {
    gap: 14px;
    margin-bottom: 16px;
  }

  .hero-logo-chip {
    width: 62px;
    height: 62px;
    padding: 9px;
  }

  .hero-meta {
    margin-bottom: 20px;
  }

  .card {
    flex: 0 0 156px;
  }

  .channel-grid {
    grid-template-columns: repeat(auto-fill, minmax(144px, 1fr));
    gap: 12px;
  }

  .scroll-btn {
    display: none !important;
  }

  .player-container {
    padding: calc(var(--header-h) + 12px) 0 40px;
  }

  .player-wrapper {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
    margin-bottom: 18px;
  }

  .stream-meta-panel {
    margin-inline: var(--gutter);
    padding: 18px;
  }

  .pc-server {
    display: none;
  }

  .pc-volume input[type='range'] {
    display: none;
  }

  .action-btn .btn-text {
    display: none;
  }

  .action-btn {
    width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  /* Filters must not eat the first screen. Countries scroll under the thumb;
     category and reset share a line. */
  .filter-bar {
    row-gap: 14px;
    column-gap: 10px;
    padding: 18px var(--gutter) 4px;
  }

  .filter-group:first-child {
    flex: 1 0 100%;
  }

  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-group:nth-child(2) {
    flex: 1 1 auto;
    min-width: 0;
  }

  .filter-select {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .filter-reset {
    flex: 0 0 auto;
  }
}

@media (max-width: 480px) {
  .brand-text {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
