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

html, body {
  height: 100%;
  overflow: hidden;
  background: #000;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}

header {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 10;
  padding: calc(1.25rem + env(safe-area-inset-top)) calc(1.5rem + env(safe-area-inset-right)) 1.25rem 1.5rem;
}

.logo {
  display: inline-block;
  line-height: 0;
  filter: drop-shadow(0 1px 8px rgba(0, 0, 0, 0.7));
}

.logo img {
  height: 2.25rem;
  width: auto;
  display: block;
}

.video-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  height: 100dvh; /* track iOS Safari's collapsing toolbar */
  background: #000;
}

.video-container video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.app-store-badge {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  right: calc(2rem + env(safe-area-inset-right));
  z-index: 10;
  transition: opacity 0.2s, transform 0.2s;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.app-store-badge:hover {
  opacity: 0.85;
  transform: scale(1.05);
}

/* Sign-up link to the TV3 web app, sitting just left of the App Store
   badge and matching its height. */
.auth-link {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  right: calc(2rem + 150px + 0.75rem + env(safe-area-inset-right));
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  height: 50px;
  padding: 0 1.25rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  white-space: nowrap;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: background 0.2s ease, transform 0.2s ease;
}

.auth-link:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.05);
}

.auth-link-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
}

.mute-btn,
.fs-btn {
  position: fixed;
  bottom: calc(2rem + env(safe-area-inset-bottom));
  left: calc(2rem + env(safe-area-inset-left));
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
  transition: opacity 0.4s ease, transform 0.2s ease, background 0.2s ease;
}

.fs-btn {
  left: calc(5.75rem + env(safe-area-inset-left));
}

.mute-btn:hover,
.fs-btn:hover {
  background: rgba(0, 0, 0, 0.65);
  transform: scale(1.05);
}

.mute-btn svg,
.fs-btn svg {
  width: 1.5rem;
  height: 1.5rem;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 2;
}

.fs-btn svg {
  fill: none;
}

/* Show the correct speaker icon for the current mute state. */
.mute-btn .icon-muted { display: none; }
.mute-btn.is-muted .icon-unmuted { display: none; }
.mute-btn.is-muted .icon-muted { display: block; }

/* Show the correct icon for the current fullscreen state. */
.fs-btn .icon-compress { display: none; }
.fs-btn.is-fullscreen .icon-expand { display: none; }
.fs-btn.is-fullscreen .icon-compress { display: block; }

/* Fade the buttons away after inactivity. */
.controls-hidden .mute-btn,
.controls-hidden .fs-btn {
  opacity: 0;
  pointer-events: none;
}

.loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.8));
  animation: pulse 1.4s ease-in-out infinite;
}

.loader img {
  display: block;
  width: min(60vw, 320px);
  height: auto;
}

.loader.hidden {
  display: none;
}

@keyframes pulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* Unobtrusive corner note shown when the stream stalls mid-watch,
   instead of covering the video with the centered logo. Lives inside
   .video-container so it rotates along with faux-landscape mode. */
.net-status {
  position: absolute;
  top: calc(1.25rem + env(safe-area-inset-top));
  left: 1.5rem;
  z-index: 5;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.55);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.net-status.hidden {
  display: none;
}

/* "Now playing" lower-third over the homepage video, fed by the schedule
   API. Fades with the rest of the controls. */
.now-playing {
  position: absolute;
  left: 1.5rem;
  bottom: calc(6rem + env(safe-area-inset-bottom));
  z-index: 5;
  max-width: min(26rem, calc(100% - 3rem));
  padding: 0.85rem 1.1rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  transition: opacity 0.4s ease;
}

.now-playing.hidden {
  display: none;
}

.controls-hidden .now-playing {
  opacity: 0;
}

.now-playing-kicker {
  color: #fe2164;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.3rem;
}

.now-playing-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.25;
}

.now-playing-sub {
  font-size: 0.85rem;
  opacity: 0.75;
  margin-top: 0.2rem;
}

.now-playing-sub.hidden {
  display: none;
}

.now-playing-progress {
  margin-top: 0.65rem;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.now-playing-progress.hidden {
  display: none;
}

.now-playing-progress-fill {
  height: 100%;
  width: 0;
  background: #fe2164;
  transition: width 1s linear;
}

@media (max-width: 768px) {
  .now-playing {
    left: 1rem;
    bottom: calc(5rem + env(safe-area-inset-bottom));
    max-width: calc(100% - 2rem);
  }
}

@media (max-width: 768px) {
  .mute-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: calc(1rem + env(safe-area-inset-left));
  }

  .fs-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    left: calc(4.75rem + env(safe-area-inset-left));
  }

  .app-store-badge {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    right: calc(1rem + env(safe-area-inset-right));
  }

  .auth-link {
    bottom: calc(1rem + env(safe-area-inset-bottom));
    right: calc(1rem + 130px + 0.5rem + env(safe-area-inset-right));
    height: 43px;
    padding: 0 1rem;
    font-size: 0.85rem;
  }

  .app-store-badge img {
    width: 130px;
    height: auto;
  }
}

/* On portrait phones a cropped 16:9 stream shows only a sliver;
   letterbox it so the whole frame fits the screen. */
@media (max-width: 768px) and (orientation: portrait) {
  .video-container video {
    object-fit: contain;
  }
}

html.page,
html.page body {
  height: auto;
  overflow: auto;
}

.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 6rem 1.5rem 4rem;
  line-height: 1.6;
}

.page-content h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.page-content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
}

.page-content p,
.page-content ul {
  margin-bottom: 1rem;
}

.page-content ul {
  padding-left: 1.25rem;
}

.page-content a {
  color: #8ab4ff;
}

.page-content .meta {
  opacity: 0.7;
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ---------- Show pages ---------- */

html.show,
html.show body {
  height: auto;
  overflow: auto;
}

.show-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  padding: 1.25rem 1.5rem;
}

.show-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 6rem 1.5rem 4rem;
}

.show-hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(60px) brightness(0.4) saturate(1.3);
  transform: scale(1.2);
}

.show-hero-scrim {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.35) 35%, #000 100%),
    radial-gradient(120% 90% at 15% 30%, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.65) 70%);
}

.show-hero {
  width: 100%;
}

.show-hero-content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.show-hero-top {
  display: flex;
  align-items: center;
  gap: 3.5rem;
}

.show-cover {
  flex: 0 0 auto;
  width: min(38vw, 320px);
  height: min(38vw, 320px);
  border-radius: 20px;
  object-fit: cover;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.show-hero-text {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.show-kicker {
  color: #fe2164;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.show-hero-text h1 {
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.show-tagline {
  font-size: 1.15rem;
  opacity: 0.85;
  max-width: 46ch;
  margin-bottom: 1.25rem;
}

.show-desc-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  margin-bottom: 1.25rem;
  color: #fff;
  opacity: 0.75;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.show-desc-toggle:hover {
  opacity: 1;
}

.show-desc-chevron {
  width: 1rem;
  height: 1rem;
  transition: transform 0.25s ease;
}

.show-desc-toggle[aria-expanded="true"] .show-desc-chevron {
  transform: rotate(180deg);
}

.show-desc-panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.35s ease;
}

.show-desc-panel.is-open {
  grid-template-rows: 1fr;
}

.show-desc-panel-inner {
  overflow: hidden;
  min-height: 0;
}

.show-description {
  max-width: 56ch;
  opacity: 0.85;
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

.show-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 2rem;
}

.show-rating {
  color: #ffd166;
  font-weight: 600;
  text-decoration: none;
}

a.show-rating:hover {
  text-decoration: underline;
}

.show-meta-dim {
  color: #fff;
  opacity: 0.7;
  font-weight: 400;
}

.show-meta-sep {
  opacity: 0.5;
}

.show-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: #fe2164;
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 1rem 1.75rem;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(254, 33, 100, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.show-cta:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 40px rgba(254, 33, 100, 0.55);
  filter: brightness(1.08);
}

.show-cta-icon {
  width: 1.15rem;
  height: 1.15rem;
  fill: currentColor;
}

.show-live-spotlight {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.show-live-spotlight.is-empty {
  display: none;
}

.show-live-card {
  position: relative;
  padding: 1.5rem 1.75rem;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(254, 33, 100, 0.2), rgba(254, 33, 100, 0.05));
  border: 1px solid rgba(254, 33, 100, 0.5);
  box-shadow: 0 0 40px rgba(254, 33, 100, 0.15);
}

.show-live-card.is-live {
  border-color: rgba(254, 33, 100, 0.9);
  box-shadow: 0 0 55px rgba(254, 33, 100, 0.4);
}

.show-live-card.is-past {
  display: none;
}

.show-live-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fe2164;
  margin-bottom: 0.6rem;
}

.show-live-card-badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: #fe2164;
  animation: pulse 1.4s ease-in-out infinite;
}

.show-live-card-title {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.show-live-card-time {
  font-size: 0.95rem;
  opacity: 0.8;
}

.show-schedule {
  width: 100%;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.show-schedule-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.show-schedule-tz {
  font-size: 0.8rem;
  font-weight: 500;
  opacity: 0.55;
  white-space: nowrap;
}

.show-schedule-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.show-schedule-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.2s ease, box-shadow 0.2s ease;
}

.show-schedule-item.is-live {
  background: rgba(254, 33, 100, 0.14);
  box-shadow: 0 0 0 1px rgba(254, 33, 100, 0.4) inset;
}

.show-schedule-time {
  flex: 0 0 auto;
  width: 9.5rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  opacity: 0.7;
}

.show-schedule-info {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.show-schedule-title {
  font-weight: 600;
  font-size: 0.95rem;
}

.show-schedule-content {
  font-size: 0.85rem;
  opacity: 0.65;
}

.show-schedule-live {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #fe2164;
}

.show-schedule-item.is-live .show-schedule-live {
  display: inline-flex;
}

.show-schedule-live::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #fe2164;
  animation: pulse 1.4s ease-in-out infinite;
}

.show-info {
  position: relative;
  background: #000;
  padding-bottom: 2rem;
}

.show-info-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  line-height: 1.7;
}

.show-info-inner h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 2.5rem 0 1rem;
}

.show-info-inner h2:first-child {
  margin-top: 0;
}

.show-info-inner p {
  margin-bottom: 1.1rem;
  opacity: 0.9;
}

.show-info-inner .show-cta-secondary {
  margin-top: 1.5rem;
}

@media (max-width: 780px) {
  .show-hero {
    min-height: auto;
    padding: 7rem 1.25rem 3rem;
  }

  .show-hero-content {
    gap: 2rem;
  }

  .show-hero-top {
    flex-direction: column;
    text-align: center;
    gap: 1.75rem;
  }

  .show-hero-text {
    width: 100%;
  }

  .show-cover {
    width: min(55vw, 240px);
    height: min(55vw, 240px);
  }

  .show-tagline {
    margin-left: auto;
    margin-right: auto;
  }

  .show-desc-toggle {
    margin-left: auto;
    margin-right: auto;
  }

  .show-description {
    margin-left: auto;
    margin-right: auto;
  }

  .show-meta {
    justify-content: center;
  }

  .show-cta {
    width: 100%;
    justify-content: center;
  }

  .show-schedule {
    max-width: 100%;
    text-align: left;
  }

  .show-schedule-item {
    flex-wrap: wrap;
  }

  .show-schedule-time {
    width: auto;
  }
}