/* Live TV — matches gwd-mission-control design system (dark cosmos + cyan accent) */
:root {
  --bg-deep: #0B1426;
  --bg-card: #16203A;
  --bg-elev: #1E2A4A;
  --border: #2A3658;
  --border-hover: #4A5C8E;

  --fg-primary: #F0F4FA;
  --fg-secondary: #B8C2D9;
  --fg-tertiary: #7C8AAB;

  --accent:      #00E5FF;
  --accent-soft: #66F2FF;
  --accent-deep: #007F8C;

  --success: #00FFA3;
  --warning: #FFB020;
  --danger:  #FF3860;

  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', 'Consolas', monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.livetv {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--fg-primary);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Starfield */
.starfield { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.starfield .layer { position: absolute; inset: 0; }
.starfield .layer::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    radial-gradient(1px 1px at 20px 30px, rgba(255,255,255,0.4), transparent),
    radial-gradient(1px 1px at 60px 70px, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 100px 50px, rgba(255,255,255,0.5), transparent),
    radial-gradient(1px 1px at 140px 90px, rgba(255,255,255,0.3), transparent),
    radial-gradient(1px 1px at 180px 20px, rgba(255,255,255,0.4), transparent);
  background-repeat: repeat; background-size: 220px 120px; opacity: 0.6;
}
.starfield .s1::before { animation: drift 120s linear infinite; }
.starfield .s2::before { background-size: 320px 180px; opacity: 0.35; animation: drift 200s linear infinite; }
.starfield .s3::before { background-size: 480px 260px; opacity: 0.2; animation: drift 300s linear infinite; }
@keyframes drift { from { transform: translateY(0); } to { transform: translateY(-200px); } }

.skip-link {
  position: absolute; top: -40px; left: 8px; padding: 8px 12px;
  background: var(--accent); color: var(--bg-deep); border-radius: 4px;
  text-decoration: none; font-weight: 600; z-index: 100;
}
.skip-link:focus { top: 8px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 32px;
  background: rgba(11, 20, 38, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.wordmark { font-size: 22px; font-weight: 700; color: var(--fg-primary); text-decoration: none; }
.wordmark .dot { color: var(--accent); }
.header-meta { font-size: 12px; color: var(--fg-tertiary); }
.header-meta::before { content: ''; display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 8px; box-shadow: 0 0 8px var(--accent); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 0.6; } 50% { opacity: 1; } }

main.page { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 48px 24px; }

/* Hero */
.hero { padding: 32px 0 24px; text-align: center; }
.kicker {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 3px;
  color: var(--accent); text-transform: uppercase;
  display: inline-block; padding: 4px 12px;
  border: 1px solid var(--accent); border-radius: 999px;
  background: rgba(0, 229, 255, 0.06);
}
.hero-title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  margin: 20px 0 12px;
  background: linear-gradient(135deg, var(--fg-primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.1;
}
.hero-sub { max-width: 720px; margin: 0 auto; font-size: 16px; color: var(--fg-secondary); }

/* Player section */
.player-section {
  margin: 32px 0;
  display: grid; grid-template-columns: 1fr 320px; gap: 20px;
}
@media (max-width: 900px) { .player-section { grid-template-columns: 1fr; } }

.player-frame {
  position: relative;
  background: #000;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.15), 0 0 40px rgba(0, 229, 255, 0.06);
}
.player-status {
  position: absolute; top: 12px; left: 12px; right: 12px;
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-tertiary);
  background: rgba(11, 20, 38, 0.85);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 8px;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.player-status.is-visible { opacity: 1; }
#video { width: 100%; height: 100%; display: block; }
.player-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px;
  background: linear-gradient(180deg, rgba(11, 20, 38, 0.4) 0%, rgba(11, 20, 38, 0.7) 100%);
  color: var(--fg-secondary);
  font-family: var(--font-mono);
  z-index: 1;
  pointer-events: none;
  transition: opacity 0.3s;
}
.player-overlay.is-hidden { opacity: 0; }
.overlay-icon { font-size: 64px; color: var(--accent); text-shadow: 0 0 20px rgba(0, 229, 255, 0.5); }
.overlay-text { font-size: 13px; letter-spacing: 1px; }

.now-playing {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.np-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 2px; text-transform: uppercase;
  color: var(--accent);
}
.np-name { font-size: 18px; font-weight: 600; line-height: 1.3; }
.np-meta { font-family: var(--font-mono); font-size: 12px; color: var(--fg-tertiary); }
.np-stop {
  margin-top: auto;
  background: transparent;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 8px 12px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.np-stop:hover { background: var(--danger); color: #fff; }

/* Filters */
.filters {
  margin: 24px 0 16px;
  display: grid; gap: 12px;
}
.search {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-primary);
  padding: 12px 16px;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 15px;
  transition: border-color 0.2s;
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(0, 229, 255, 0.15); }
.search::placeholder { color: var(--fg-tertiary); }

.group-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.gtab {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--fg-secondary);
  padding: 6px 12px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.2s;
}
.gtab:hover { border-color: var(--border-hover); color: var(--fg-primary); }
.gtab.is-active {
  background: var(--accent);
  color: var(--bg-deep);
  border-color: var(--accent);
  font-weight: 600;
}

/* Grid */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.4), 0 8px 24px rgba(0, 0, 0, 0.5); }
.card.is-playing { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), 0 0 24px rgba(0, 229, 255, 0.3); }
.card.is-playing::after {
  content: '● NOW PLAYING';
  position: absolute; top: 8px; right: 8px;
  font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 1px; color: var(--bg-deep);
  background: var(--accent);
  padding: 2px 6px; border-radius: 3px;
  z-index: 2;
}
.card-logo {
  width: 100%; aspect-ratio: 16/9;
  background: var(--bg-elev);
  display: flex; align-items: center; justify-content: center;
  object-fit: contain;
  padding: 8px;
  border-bottom: 1px solid var(--border);
}
.card-logo:not([src]), .card-logo[src=""] {
  background: var(--bg-elev);
}
.card-logo-fallback {
  font-family: var(--font-mono); font-size: 20px; font-weight: 700;
  color: var(--fg-tertiary);
}
.card-body { padding: 10px 12px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card-name { font-size: 13px; font-weight: 600; line-height: 1.25; color: var(--fg-primary); }
.card-meta { font-family: var(--font-mono); font-size: 10px; color: var(--fg-tertiary); letter-spacing: 0.5px; text-transform: uppercase; }

/* Status line */
.status-line {
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-tertiary);
  text-align: center; margin: 24px 0 8px;
}
.empty {
  grid-column: 1 / -1;
  text-align: center; padding: 40px 20px;
  color: var(--fg-tertiary);
  font-family: var(--font-mono); font-size: 13px;
}

/* Footer */
.site-footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 24px;
  margin-top: 48px;
  border-top: 1px solid var(--border);
  background: rgba(11, 20, 38, 0.92);
  font-family: var(--font-mono); font-size: 12px; color: var(--fg-tertiary);
}
.site-footer .timestamp { color: var(--accent); }
