/* ==========================================================================
   VectorTV — Main Stylesheet
   Design Direction: BBC iPlayer-inspired dark broadcast UI with modern retro accents
   Subdomain: tv.vectorstudios.uk
   ========================================================================== */

:root {
  --bg-base: #0a0b0e;
  --bg-surface: #121319;
  --bg-card: #181a24;
  --bg-card-hover: #222533;
  --bg-card-active: #282c3d;
  --bg-tile-dark: #12131a;
  --bg-tile-light: #f4f5f8;
  --bg-tile-any: #1b1c27;
  
  --text-main: #ffffff;
  --text-muted: #a0a4b8;
  --text-dim: #6d7285;
  --text-dark: #121318;
  
  --brand-pink: #f01247;
  --brand-pink-glow: rgba(240, 18, 71, 0.4);
  --brand-cyan: #00d2ff;
  --brand-cyan-glow: rgba(0, 210, 255, 0.35);
  --brand-amber: #ffaa00;
  --brand-green: #00e676;
  --brand-red: #ff334b;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-active: #f01247;
  
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-full: 9999px;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 25px var(--brand-pink-glow);
  --shadow-player: 0 20px 50px rgba(0, 0, 0, 0.85);
  
  --transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

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

html {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Core Visibility Rules (Default for Desktop) */
.hidden {
  display: none !important;
}

.mobile-only {
  display: none !important;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background: radial-gradient(circle at 50% 0%, #151824 0%, #0a0b0e 70%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  color: inherit;
}

/* ==========================================================================
   Header & Navigation (BBC Top Bar + Secondary Broadcast Navigation)
   ========================================================================== */

.top-global-bar {
  background: #000000;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 8px 24px;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 100;
}

.global-bar-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.vector-studios-brand {
  font-weight: 800;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.vector-studios-brand .brand-badge {
  background: #ffffff;
  color: #000000;
  padding: 1px 6px;
  font-weight: 900;
  border-radius: 2px;
  font-size: 0.75rem;
}

.global-links {
  display: flex;
  align-items: center;
  gap: 16px;
  list-style: none;
}

.global-links a {
  color: var(--text-muted);
  transition: var(--transition);
  font-weight: 500;
}

.global-links a:hover {
  color: #ffffff;
}

.global-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.live-clock-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-variant-numeric: tabular-nums;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.live-clock-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-green);
  box-shadow: 0 0 8px var(--brand-green);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Primary Broadcast Header */
.main-broadcast-header {
  background: rgba(18, 19, 25, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 12px 24px;
}

.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.brand-logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site-logo-img {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.site-logo-text {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  color: #ffffff;
  display: flex;
  align-items: baseline;
}

.site-logo-text .tv-highlight {
  color: var(--brand-pink);
  margin-left: 2px;
  font-weight: 800;
  text-shadow: 0 0 16px var(--brand-pink-glow);
}

.primary-nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-item-link {
  padding: 8px 16px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  transition: var(--transition);
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-item-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
}

.nav-item-link.active {
  color: #ffffff;
  background: rgba(240, 18, 71, 0.15);
}

.nav-item-link.active::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 16px;
  right: 16px;
  height: 3px;
  background: var(--brand-pink);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--brand-pink);
}

.weather-nav-badge {
  background: #0077b6;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  margin-left: 4px;
}

/* Secondary Breadcrumb / Channel Header Bar */
.broadcast-subbar {
  background: #0d0e14;
  border-bottom: 1px solid var(--border-subtle);
  padding: 8px 24px;
  font-size: 0.85rem;
  color: var(--text-dim);
}

.subbar-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
}

.breadcrumb-trail a {
  color: var(--text-muted);
}

.breadcrumb-trail a:hover {
  color: #ffffff;
}

.breadcrumb-separator {
  color: var(--text-dim);
  font-size: 0.8rem;
}

.breadcrumb-active {
  color: var(--brand-pink);
  font-weight: 600;
}

/* ==========================================================================
   Main Content Layout
   ========================================================================== */

main {
  flex: 1;
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 60px;
}

/* ==========================================================================
   Video Player Section (16:9 Broadcast Container)
   ========================================================================== */

.player-stage {
  margin-bottom: 24px;
}

.player-wrapper {
  position: relative;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background-color: #000000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-player);
  border: 1px solid var(--border-card);
}

.broadcast-video {
  width: 100%;
  height: 100%;
  object-fit: contain !important;
  display: block;
  background: #000;
  pointer-events: none;
}

/* Fullscreen handling across all browsers and devices to prevent any logo or video cropping */
:fullscreen .broadcast-video,
:-webkit-full-screen .broadcast-video,
:-moz-full-screen .broadcast-video,
:-ms-fullscreen .broadcast-video,
.player-wrapper:fullscreen .broadcast-video {
  width: 100% !important;
  height: 100% !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  object-fit: contain !important;
  pointer-events: none;
}

:fullscreen .player-wrapper,
:-webkit-full-screen .player-wrapper,
:-moz-full-screen .player-wrapper,
:-ms-fullscreen .player-wrapper,
.player-wrapper:fullscreen {
  max-width: none !important;
  width: 100vw !important;
  height: 100vh !important;
  border-radius: 0 !important;
  border: none !important;
  background: #000000 !important;
  aspect-ratio: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Transparent Click/Tap Target covering the video area to reliably show controls */
.video-click-target {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
  cursor: pointer;
  background: rgba(0, 0, 0, 0.001);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* Custom Live Player Controls Bar (No seek bar) */
.player-controls-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.6) 60%, transparent 100%);
  padding: 24px 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 25;
}

.player-controls-overlay.show-controls {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.player-controls-overlay.hide-controls {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Mouse hover for desktop computers with true pointer (prevents mobile sticky hover) */
@media (hover: hover) and (pointer: fine) {
  .player-wrapper:hover .player-controls-overlay:not(.hide-controls) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

/* Live progress bar visual (indicates live stream, not scrubbable) */
.live-stream-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.live-stream-bar .live-bar-fill {
  width: 100%;
  height: 100%;
  background: var(--brand-pink);
  box-shadow: 0 0 10px var(--brand-pink);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ctrl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  transition: var(--transition);
  font-size: 1.1rem;
}

.ctrl-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.ctrl-btn:active {
  transform: translateY(1px);
}

.ctrl-play-btn {
  background: var(--brand-pink);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 16px var(--brand-pink-glow);
}

.ctrl-play-btn:hover {
  background: #ff2257;
  transform: scale(1.05);
}

/* Live Badge */
.live-indicator-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(240, 18, 71, 0.2);
  border: 1px solid var(--brand-pink);
  color: #ffffff;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.live-dot-pulse {
  width: 8px;
  height: 8px;
  background: var(--brand-pink);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--brand-pink);
  animation: live-blink 1.5s infinite;
}

@keyframes live-blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.2; transform: scale(0.7); }
}

/* Volume Slider */
.volume-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.volume-slider {
  -webkit-appearance: none;
  width: 80px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  transition: width 0.2s;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.channel-quick-switch {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Overlays (Initial Click-to-Play, Tuning, Error, Off-air, Inactivity) */
.player-slate-overlay {
  position: absolute;
  inset: 0;
  background: rgba(10, 11, 15, 0.92);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  z-index: 30;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.player-slate-overlay.hidden {
  display: none !important;
}

/* Initial Start Screen */
.slate-hero-logo {
  max-width: 140px;
  height: auto;
  margin-bottom: 20px;
  filter: drop-shadow(0 4px 16px rgba(0, 0, 0, 0.6));
}

.slate-title {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 8px;
  color: #ffffff;
}

.slate-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 480px;
  line-height: 1.5;
  margin-bottom: 24px;
}

.btn-big-play {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--brand-pink);
  color: #ffffff;
  font-weight: 700;
  font-size: 1.15rem;
  padding: 14px 32px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-glow);
  transition: var(--transition);
}

.btn-big-play:hover {
  background: #ff2257;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 30px var(--brand-pink);
}

/* Tuning Spinner */
.tuning-spinner {
  width: 56px;
  height: 56px;
  border: 4px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--brand-pink);
  border-right-color: var(--brand-cyan);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

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

.tuning-status-text {
  font-size: 1.3rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.tuning-hint {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
}

.tuning-countdown {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Off-air Slate */
.off-air-badge {
  background: var(--brand-amber);
  color: #000;
  font-weight: 800;
  font-size: 0.85rem;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
  margin-bottom: 12px;
}

/* Error Slate */
.error-icon {
  font-size: 3rem;
  color: var(--brand-amber);
  margin-bottom: 16px;
}

.btn-retry {
  background: #ffffff;
  color: #000000;
  font-weight: 700;
  font-size: 1rem;
  padding: 10px 24px;
  border-radius: var(--radius-md);
  margin-top: 20px;
  transition: var(--transition);
}

.btn-retry:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

/* ==========================================================================
   Broadcast Metadata Section (Directly underneath Player, matching screenshots)
   ========================================================================== */

.player-metadata-panel {
  max-width: 1280px;
  margin: 0 auto 32px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.metadata-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.show-title-group {
  flex: 1;
  min-width: 280px;
}

.current-show-title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 6px;
}

.channel-subtitle-row {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-muted);
  font-size: 1rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 8px;
}

/* BBC iPlayer signature accent underline */
.channel-subtitle-row::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 48px;
  height: 3px;
  background: var(--brand-pink);
  border-radius: 2px;
}

.channel-pill-tag {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.metadata-badges-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.status-badge.live {
  background: rgba(0, 230, 118, 0.15);
  color: var(--brand-green);
  border: 1px solid rgba(0, 230, 118, 0.3);
}

.status-badge.time {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.status-badge.genre {
  background: rgba(0, 210, 255, 0.12);
  color: var(--brand-cyan);
  border: 1px solid rgba(0, 210, 255, 0.25);
}

.current-show-desc {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 900px;
}

.metadata-actions-row {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 14px;
  font-size: 0.85rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}

.btn-meta-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  font-weight: 500;
}

.btn-meta-action:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

/* ==========================================================================
   Channel Selector Row / Carousel (Underneath Player, exactly like screenshots)
   ========================================================================== */

.channel-selector-section {
  max-width: 1280px;
  margin: 0 auto 40px;
}

.section-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-count-badge {
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.1);
  padding: 3px 8px;
  border-radius: var(--radius-full);
  color: var(--text-muted);
}

.category-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.filter-tab {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  transition: var(--transition);
  white-space: nowrap;
}

.filter-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.filter-tab.active {
  background: var(--brand-pink);
  color: #ffffff;
  box-shadow: 0 0 12px var(--brand-pink-glow);
}

/* Horizontal Channel Carousel / Grid */
.channel-carousel-container {
  position: relative;
}

.channel-cards-track {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

/* Channel Card */
.channel-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  text-align: left;
}

.channel-card:hover {
  transform: translateY(-4px);
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

.channel-card.active-channel {
  border-color: var(--brand-pink);
  background: var(--bg-card-active);
  box-shadow: 0 0 20px var(--brand-pink-glow);
}

.channel-card.active-channel::after {
  content: "WATCHING NOW";
  position: absolute;
  top: -10px;
  right: 12px;
  background: var(--brand-pink);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.5px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--brand-pink);
}

/* Channel Logo Tile (CRITICAL contrast handling for VH1 and all logos) */
.logo-tile-box {
  width: 100%;
  height: 90px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

/* Specific contrast modes defined in channels.json */
.logo-tile-box.tile-dark {
  background: var(--bg-tile-dark);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Channel 12 (VH1) dark logo requires light tile */
.logo-tile-box.tile-light {
  background: var(--bg-tile-light);
  border: 1px solid #ffffff;
  box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.logo-tile-box.tile-any {
  background: var(--bg-tile-any);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.channel-logo-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain !important;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.3));
}

/* Graceful Logo Fallback (if image fails) */
.logo-fallback-badge {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;
}

.logo-fallback-badge .badge-ch-num {
  font-size: 1.4rem;
  font-weight: 900;
  color: var(--brand-pink);
}

.logo-fallback-badge .badge-ch-name {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #ffffff;
}

/* Channel Info Text inside Card */
.card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-ch-number {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--brand-cyan);
}

.card-ch-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
}

.card-now-playing {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.card-time-slot {
  font-size: 0.75rem;
  color: var(--text-dim);
}

.card-next-playing {
  font-size: 0.75rem;
  color: var(--text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  align-items: center;
  gap: 5px;
}

.card-next-label {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

.card-next-title {
  color: #cbd5e1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  flex: 1;
}

.card-next-time {
  color: var(--text-dim);
  font-size: 0.7rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Retro London Weather Promo Banner (Section 6)
   ========================================================================== */

.weather-promo-card {
  max-width: 1280px;
  margin: 0 auto 40px;
  background: linear-gradient(135deg, #09203f 0%, #537895 100%);
  border-radius: var(--radius-lg);
  padding: 24px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 10px 30px rgba(9, 32, 63, 0.4);
  flex-wrap: wrap;
}

.weather-promo-content {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
  min-width: 280px;
}

.weather-radar-icon {
  width: 56px;
  height: 56px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
}

.weather-text-group h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 4px;
  color: #ffffff;
}

.weather-text-group p {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.4;
}

.btn-weather-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #ffffff;
  color: #09203f;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  white-space: nowrap;
}

.btn-weather-link:hover {
  background: #f0f4f8;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   TV Guide Page Layout (guide.html)
   ========================================================================== */

.guide-page-container {
  max-width: 1400px;
  margin: 0 auto;
}

.guide-hero-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 16px;
}

.guide-search-box {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 8px 14px;
  gap: 8px;
  width: 280px;
}

.guide-search-box input {
  background: none;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 0.9rem;
  width: 100%;
}

/* Now & Next Summary Section */
.now-next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.now-next-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  gap: 14px;
  transition: var(--transition);
}

.now-next-card:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: var(--bg-card-hover);
}

.now-next-logo-wrap {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  flex-shrink: 0;
}

.now-next-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.now-next-ch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.now-next-ch-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.now-block, .next-block {
  display: flex;
  flex-direction: column;
}

.slot-tag {
  font-size: 0.7rem;
  font-weight: 800;
  color: var(--brand-pink);
  text-transform: uppercase;
}

.slot-title {
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slot-time {
  font-size: 0.75rem;
  color: var(--text-dim);
}

/* ==========================================================================
   Broadcast EPG Timeline Grid (Side-by-side horizontal matching Screenshot 4)
   ========================================================================== */

.epg-broadcast-container {
  background: var(--bg-surface);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  margin-bottom: 40px;
}

.epg-toolbar {
  padding: 12px 18px;
  background: #0e0f16;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.epg-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* 48-Hour Day Tabs (Today, Tomorrow, Day 3) */
.epg-day-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.epg-day-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  font-family: inherit;
}

.epg-day-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.epg-day-btn.active {
  background: var(--brand-pink);
  color: #ffffff;
  border-color: var(--brand-pink);
  box-shadow: 0 0 12px var(--brand-pink-glow);
}

.day-sub-label {
  font-size: 0.72rem;
  opacity: 0.8;
  font-weight: 500;
}

.epg-day-btn.active .day-sub-label {
  opacity: 0.95;
}

/* Time Jump Dropdown */
.epg-jump-wrapper {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 0 10px;
  gap: 6px;
}

.jump-icon {
  font-size: 0.85rem;
}

.epg-time-jump-select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 4px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
}

.epg-time-jump-select option {
  background: #12131b;
  color: #ffffff;
}

/* Now Button */
.epg-now-btn {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #10b981;
  font-size: 0.8rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
}

.epg-now-btn:hover {
  background: rgba(16, 185, 129, 0.28);
  transform: translateY(-1px);
}

.epg-range-badge {
  font-size: 0.75rem;
  color: var(--text-dim);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-variant-numeric: tabular-nums;
}

.epg-date-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
}

.epg-nav-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.epg-nav-btn {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: var(--transition);
}

.epg-nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.epg-scroll-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.epg-scroll-viewport::-webkit-scrollbar {
  height: 8px;
}

.epg-scroll-viewport::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

/* Time Ruler Header */
.epg-timeline-header-row {
  display: flex;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  background: #0a0b10;
  position: sticky;
  top: 0;
  z-index: 20;
}

.epg-header-spacer {
  width: 220px;
  min-width: 220px;
  position: sticky;
  left: 0;
  background: #0a0b10;
  z-index: 25;
  border-right: 1px solid var(--border-card);
  padding: 10px 16px;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.epg-time-slots-container {
  display: flex;
}

.epg-time-slot-header {
  padding: 8px 12px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  text-align: left;
  flex-shrink: 0;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  position: relative;
}

.epg-time-slot-header.epg-day-boundary {
  border-left: 2px solid var(--brand-pink) !important;
  background: rgba(240, 18, 71, 0.08);
}

.epg-slot-date-pill {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--brand-cyan);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.epg-slot-time-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  line-height: 1.2;
}

/* Channel Rows */
.epg-row {
  display: flex;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 72px;
}

.epg-row:hover {
  background: rgba(255, 255, 255, 0.015);
}

.epg-channel-col {
  width: 220px;
  min-width: 220px;
  position: sticky;
  left: 0;
  background: #12131b;
  z-index: 15;
  border-right: 1px solid var(--border-card);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.4);
}

.epg-mini-tile {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  padding: 4px;
  flex-shrink: 0;
}

.epg-col-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.epg-col-name {
  font-weight: 800;
  font-size: 0.9rem;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-col-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-cyan);
}

/* Horizontal Track (Side by Side Programmes) */
.epg-track {
  display: flex;
  flex-shrink: 0;
  align-items: stretch;
}

.epg-card-block {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.025);
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
  box-sizing: border-box;
}

.epg-card-block:hover {
  background: rgba(240, 18, 71, 0.18);
  border-left-color: var(--brand-pink);
  z-index: 5;
}

.epg-card-current {
  background: rgba(240, 18, 71, 0.08);
  border-top: 2px solid var(--brand-pink);
}

.epg-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.epg-card-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.epg-ep-pill {
  color: var(--brand-cyan);
  font-weight: 800;
}

.epg-ep-name {
  color: var(--text-muted);
  font-weight: 500;
}

.epg-card-time {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 3px;
}

/* Footer Licensing Row */
.footer-license-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  margin: 10px 0;
  flex-wrap: wrap;
}

.footer-prs-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.05);
}

.footer-mplc-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.05);
}

.footer-license-logos {
  display: flex;
  align-items: center;
  gap: 16px;
}

.footer-license-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.footer-trademark-disclaimer {
  font-size: 0.75rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 6px 0 0;
  text-align: left;
}

/* ==========================================================================
   IPTV & External Streaming Instructions Styling
   ========================================================================== */

.iptv-instructions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin: 24px 0;
}

.iptv-step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.iptv-step-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.iptv-step-card ol {
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.iptv-step-card ol li {
  margin-bottom: 8px;
}

.iptv-step-card ol li strong {
  color: #ffffff;
}

.url-code-box {
  background: #0a0b0e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 0;
  font-family: monospace;
  font-size: 0.85rem;
  color: var(--brand-cyan);
  overflow-x: auto;
  max-width: 100%;
  box-sizing: border-box;
}

.url-code-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  user-select: all;
  min-width: 0;
  flex: 1;
}

/* Step Code Box for numbered instructions */
.step-code-box {
  background: #0a0b0e;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0 2px 0;
  max-width: 100%;
  box-sizing: border-box;
}

.step-code-url {
  font-family: monospace;
  font-size: 0.8rem;
  color: var(--brand-cyan);
  word-break: break-all;
  overflow-wrap: anywhere;
  user-select: all;
  min-width: 0;
  flex: 1;
  line-height: 1.4;
}

.btn-copy-url,
.btn-copy-mini {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  flex-shrink: 0;
}

.btn-copy-mini {
  font-size: 0.72rem;
  padding: 3px 8px;
}

.btn-copy-url:hover,
.btn-copy-mini:hover,
.btn-copy-url:active,
.btn-copy-mini:active {
  background: var(--brand-pink);
  border-color: var(--brand-pink);
}

.iptv-step-card ol li {
  min-width: 0;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.iptv-step-card code,
.about-card-section code {
  word-break: break-all;
  overflow-wrap: anywhere;
  white-space: normal;
  max-width: 100%;
}

.iptv-channels-table-wrapper {
  overflow-x: auto;
  margin-top: 20px;
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
}

.iptv-channels-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.iptv-channels-table th {
  background: rgba(0, 0, 0, 0.5);
  color: var(--text-muted);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-card);
  white-space: nowrap;
}

.iptv-channels-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.iptv-channels-table th:first-child,
.iptv-channels-table td:first-child {
  width: 95px;
  min-width: 90px;
  white-space: nowrap;
}

.iptv-channels-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.iptv-badge-pill {
  display: inline-block;
  white-space: nowrap;
  background: rgba(0, 210, 255, 0.15);
  color: var(--brand-cyan);
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
}


.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none !important;
}

.modal-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8);
  position: relative;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 800;
}

.modal-close-btn {
  font-size: 1.4rem;
  color: var(--text-muted);
  transition: var(--transition);
}

.modal-close-btn:hover {
  color: #ffffff;
}

/* ==========================================================================
   About Page Layout (about.html)
   ========================================================================== */

.about-page-container {
  max-width: 960px;
  margin: 0 auto;
}

.about-hero {
  text-align: center;
  margin-bottom: 48px;
}

.about-hero h1 {
  font-size: 2.6rem;
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}

.about-card-section {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 24px;
}

.about-card-section h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: #ffffff;
}

.about-card-section p {
  color: var(--text-muted);
  line-height: 1.7;
  margin-bottom: 16px;
}

.about-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.about-feature-box {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 20px;
}

.about-feature-box h4 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand-pink);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: #000000;
  border-top: 1px solid var(--border-subtle);
  padding: 40px 24px 30px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: auto;
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  flex-wrap: wrap;
}

.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 20px;
  color: var(--text-dim);
  font-size: 0.8rem;
  flex-wrap: wrap;
  gap: 12px;
}

/* ==========================================================================
   Responsive Adaptations & Mobile Overhaul (BBC iPlayer Mobile Experience)
   ========================================================================== */

/* Utility Visibility Rules */
.hidden {
  display: none !important;
}

@media (min-width: 769px) {
  .mobile-only {
    display: none !important;
  }
}

@media (max-width: 900px) and (min-width: 769px) {
  .top-global-bar .global-links {
    display: none;
  }
  
  .current-show-title {
    font-size: 1.5rem;
  }
  
  .channel-cards-track {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
  
  .logo-tile-box {
    height: 70px;
  }
}

/* ==========================================================================
   Mobile Devices (< 769px) — Strict BBC iPlayer Smartphone Experience
   ========================================================================== */
@media (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }

  .top-global-bar {
    padding: 6px 14px;
  }

  .top-global-bar .global-links {
    display: none !important;
  }

  /* Reset main padding so video player can be full-bleed edge-to-edge */
  main {
    padding: 0 0 32px 0 !important;
    margin: 0 !important;
    max-width: 100vw !important;
    overflow-x: hidden;
  }

  /* ------------------------------------------------------------------------
     1. Mobile Broadcast Header (BBC iPlayer Header - Screenshots 1 & 3)
     ------------------------------------------------------------------------ */
  .mobile-broadcast-header {
    display: flex !important;
    flex-direction: column;
    background: #0c0d12;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    width: 100%;
  }

  .mobile-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    height: 52px;
  }

  .mobile-brand-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    line-height: 1;
  }

  .mobile-brand-vector {
    font-weight: 900;
    font-size: 1.35rem;
    letter-spacing: -0.5px;
    color: #ffffff;
  }

  .mobile-brand-tv {
    font-weight: 900;
    font-size: 1.35rem;
    color: var(--brand-pink);
    margin-left: 2px;
    text-shadow: 0 0 10px var(--brand-pink-glow);
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-live-clock {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 8px;
    border-radius: var(--radius-full);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-menu-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: var(--transition);
  }

  .mobile-menu-btn:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.96);
  }

  /* ------------------------------------------------------------------------
     Channel Switcher Pill Strip (Direct BBC iPlayer layout from Screenshot 3)
     ------------------------------------------------------------------------ */
  .mobile-channels-strip-wrapper {
    background: #07080b;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    width: 100%;
    overflow: hidden;
  }

  .mobile-channels-strip {
    display: flex;
    gap: 6px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .mobile-channels-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-ch-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    padding: 0 14px;
    border-radius: 16px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #b0b4c5;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mobile-ch-tab:hover,
  .mobile-ch-tab:focus {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
  }

  .mobile-ch-tab.active {
    background: var(--brand-pink) !important;
    color: #ffffff !important;
    border-color: var(--brand-pink) !important;
    box-shadow: 0 0 12px var(--brand-pink-glow);
    font-weight: 800;
  }

  /* ------------------------------------------------------------------------
     Genre / Category Filter Bar (Screenshot 3)
     ------------------------------------------------------------------------ */
  .mobile-genres-strip {
    display: flex;
    gap: 6px;
    padding: 6px 12px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: #0c0d12;
    white-space: nowrap;
  }

  .mobile-genres-strip::-webkit-scrollbar {
    display: none;
  }

  .mobile-genre-pill {
    display: inline-flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-dim);
    background: transparent;
    border: 1px solid transparent;
    flex-shrink: 0;
    cursor: pointer;
    transition: all 0.15s ease;
  }

  .mobile-genre-pill:active {
    color: #ffffff;
  }

  .mobile-genre-pill.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.16);
    font-weight: 700;
  }

  /* ------------------------------------------------------------------------
     2. Edge-to-Edge 16:9 Video Player (Screenshot 2)
     ------------------------------------------------------------------------ */
  .player-stage {
    padding: 0 !important;
    margin: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    border-radius: 0 !important;
  }

  .player-wrapper {
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    aspect-ratio: 16 / 9;
    box-shadow: none !important;
  }

  .broadcast-video {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    pointer-events: none !important;
  }

  .video-click-target {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100% !important;
    height: 100% !important;
    z-index: 15 !important;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.001) !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Overlays on Mobile */
  .player-slate-overlay {
    padding: 16px;
    z-index: 30 !important;
  }

  .slate-hero-logo {
    max-width: 80px;
    margin-bottom: 10px;
  }

  .slate-title {
    font-size: 1.25rem;
    margin-bottom: 6px;
  }

  .slate-subtitle {
    font-size: 0.85rem;
    max-width: 90%;
    margin-bottom: 14px;
    line-height: 1.35;
  }

  .btn-big-play {
    font-size: 0.95rem;
    padding: 10px 22px;
  }

  /* Controls Overlay on Mobile */
  .player-controls-overlay {
    padding: 12px 10px 8px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: 25 !important;
  }

  .player-controls-overlay.show-controls {
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .player-controls-overlay.hide-controls {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  .live-stream-bar {
    height: 3px;
    margin-bottom: 6px;
  }

  .controls-row {
    gap: 8px;
  }

  .controls-left, .controls-right {
    gap: 8px;
  }

  .ctrl-btn {
    width: 36px;
    height: 36px;
    font-size: 0.95rem;
  }

  .ctrl-play-btn {
    width: 38px;
    height: 38px;
  }

  .volume-slider {
    width: 50px;
  }

  /* ------------------------------------------------------------------------
     3. 2-Column NOW WATCHING & ON NEXT Card (Screenshots 2 & 3)
     ------------------------------------------------------------------------ */
  .mobile-now-next-card {
    display: flex !important;
    flex-direction: column;
    gap: 10px;
    background: #11131a;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 14px 16px;
    width: 100%;
    box-sizing: border-box;
  }

  .mnn-row {
    display: grid;
    grid-template-columns: 88px 1fr;
    gap: 12px;
    align-items: start;
  }

  .mnn-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .mnn-label {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-dim);
  }

  .mnn-time {
    font-size: 0.95rem;
    font-weight: 800;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
  }

  .mnn-next-row .mnn-time {
    color: var(--text-muted);
  }

  .mnn-right {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
  }

  .mnn-title {
    font-size: 1.12rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.25;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .mnn-next-row .mnn-title {
    font-size: 0.98rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
  }

  .mnn-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mnn-next-row .mnn-sub {
    color: var(--text-dim);
  }

  .mnn-divider {
    height: 1px;
    background: rgba(255, 255, 255, 0.07);
    width: 100%;
    margin: 2px 0;
  }

  .mnn-schedule-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-pink);
    text-decoration: none;
    margin-top: 6px;
    width: fit-content;
    transition: var(--transition);
  }

  .mnn-schedule-link:active {
    color: #ff3b68;
    transform: translateX(2px);
  }

  .mnn-cal-icon {
    font-size: 0.85rem;
  }

  /* ------------------------------------------------------------------------
     4. Channel Selector Section / Featured Carousel (Screenshot 2)
     ------------------------------------------------------------------------ */
  .channel-selector-section {
    padding: 16px 0 8px 0 !important;
    margin: 0 !important;
    width: 100%;
  }

  .section-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px 12px 16px;
    margin: 0;
  }

  .section-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
  }

  #mobileFeaturedTitle {
    display: inline !important;
    font-size: 1.12rem;
    font-weight: 800;
    color: #ffffff;
  }

  .mobile-view-all-link {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--brand-pink);
    text-decoration: none;
  }

  .channel-carousel-container {
    padding: 0;
    margin: 0;
    overflow: hidden;
  }

  /* Horizontal swipe channel cards track */
  .channel-cards-track {
    display: flex !important;
    flex-wrap: nowrap !important;
    grid-template-columns: none !important;
    gap: 12px !important;
    overflow-x: auto !important;
    padding: 4px 16px 14px 16px !important;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .channel-cards-track::-webkit-scrollbar {
    display: none;
  }

  .channel-card {
    flex: 0 0 155px !important;
    width: 155px !important;
    max-width: 155px !important;
    scroll-snap-align: start;
    margin: 0;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
  }

  .logo-tile-box {
    height: 74px !important;
    padding: 8px;
  }

  .channel-logo-img {
    max-height: 54px;
    max-width: 90%;
    width: auto;
    height: auto;
    object-fit: contain !important;
  }

  .card-info {
    padding: 10px;
    gap: 4px;
  }

  .card-title-row {
    font-size: 0.78rem;
  }

  .card-ch-number {
    font-size: 0.68rem;
    padding: 1px 5px;
  }

  .card-ch-name {
    font-size: 0.8rem;
  }

  .card-now-playing {
    font-size: 0.8rem;
    line-height: 1.25;
    -webkit-line-clamp: 2;
  }

  .card-time-slot {
    font-size: 0.7rem;
  }

  .card-next-playing {
    font-size: 0.72rem;
  }

  /* ------------------------------------------------------------------------
     5. Mobile Off-Canvas Drawer (Screenshots 1 & 3 Menu)
     ------------------------------------------------------------------------ */
  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999 !important;
    display: block;
    animation: fadeInBackdrop 0.2s ease forwards;
  }

  @keyframes fadeInBackdrop {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  .mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 84vw;
    max-width: 320px;
    background: #10121a;
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 100000 !important;
    display: flex !important;
    flex-direction: column;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.85);
    overflow-y: auto;
    animation: slideInDrawer 0.25s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  }

  @keyframes slideInDrawer {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
  }

  .mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .mobile-drawer-close {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
  }

  .mobile-drawer-close:active {
    background: rgba(255, 255, 255, 0.2);
  }

  .mobile-drawer-links {
    list-style: none;
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .mobile-drawer-links li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #e0e2ec;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: var(--transition);
  }

  .mobile-drawer-links li a:active {
    background: rgba(255, 255, 255, 0.08);
  }

  .mobile-drawer-links li a.active {
    color: #ffffff;
    background: rgba(240, 18, 71, 0.15);
    font-weight: 700;
    border-left: 3px solid var(--brand-pink);
  }

  /* ------------------------------------------------------------------------
     6. Retro Weather Banner & Footer Adaptations
     ------------------------------------------------------------------------ */
  .weather-promo-card {
    margin: 16px 14px !important;
    padding: 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .weather-promo-content {
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .weather-radar-icon {
    font-size: 2rem !important;
  }

  .weather-text-group h3 {
    font-size: 1.05rem !important;
  }

  .weather-text-group p {
    font-size: 0.82rem !important;
    line-height: 1.35 !important;
  }

  .btn-weather-link {
    width: 100% !important;
    text-align: center !important;
    justify-content: center !important;
    box-sizing: border-box;
    font-size: 0.85rem !important;
    padding: 10px 16px !important;
  }

  .site-footer {
    padding: 28px 16px 20px !important;
  }

  .footer-columns {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .footer-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  /* ------------------------------------------------------------------------
     7. TV Guide & Stats Pages Mobile Polishing
     ------------------------------------------------------------------------ */
  /* Mobile Navigation for standard header on subpages (guide, stats, about) */
  .main-broadcast-header {
    padding: 10px 14px !important;
  }
  .nav-container {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .primary-nav-links {
    display: flex !important;
    overflow-x: auto !important;
    white-space: nowrap !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    width: 100% !important;
    padding-bottom: 2px !important;
  }
  .primary-nav-links::-webkit-scrollbar {
    display: none !important;
  }
  .broadcast-subbar {
    padding: 8px 14px !important;
  }
  .subbar-inner {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 4px !important;
  }

  /* Guide Page Mobile Adaptations */
  .guide-page-container {
    padding: 14px 12px 30px !important;
  }
  .guide-hero-bar {
    padding: 14px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .guide-hero-bar > div:last-child {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .guide-search-box {
    width: 100% !important;
  }
  .epg-toolbar {
    padding: 10px 12px !important;
    gap: 10px !important;
  }
  .epg-toolbar-left {
    width: 100% !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 8px !important;
  }
  .epg-day-tabs {
    width: 100% !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
  }
  .epg-day-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .guide-filter-controls,
  .guide-day-jump-bar {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }

  .guide-filter-controls::-webkit-scrollbar,
  .guide-day-jump-bar::-webkit-scrollbar {
    display: none;
  }

  .stats-grid,
  .stats-hardware-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* ------------------------------------------------------------------------
     8. About Page (about.html) Mobile Optimizations
     ------------------------------------------------------------------------ */
  .about-page-container {
    padding: 14px 14px 44px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .about-hero {
    margin-bottom: 24px !important;
  }

  .about-hero h1 {
    font-size: 1.85rem !important;
  }

  .about-card-section {
    padding: 18px 14px !important;
    border-radius: var(--radius-md) !important;
    margin-bottom: 16px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .about-features-grid,
  .iptv-instructions-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
    margin: 16px 0 !important;
  }

  .iptv-step-card {
    padding: 16px 12px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .iptv-step-card ol {
    padding-left: 18px !important;
  }

  .step-code-box,
  .url-code-box {
    padding: 8px 10px !important;
    gap: 8px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .step-code-url,
  .url-code-text {
    font-size: 0.74rem !important;
  }
}


