:root {
  --bg-primary: #0a0a0c;
  --bg-card: #141418;
  --bg-card-hover: #1a1a20;
  --bg-card-active: #1c1e2a;
  --border: #222230;
  --border-active: #3b82f6;
  --text-primary: #e8e8ed;
  --text-secondary: #8888a0;
  --text-muted: #555568;
  --accent: #1d9bf0;
  --accent-glow: rgba(29, 155, 240, 0.15);
  --live-color: #22c55e;
  --live-glow: rgba(34, 197, 94, 0.25);
  --upcoming-color: #f59e0b;
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-display);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.page-grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  z-index: 9999;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

/* Header */
header {
  margin-bottom: 2rem;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.logo-icon {
  font-size: 1.8rem;
  color: var(--text-primary);
}

h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.75rem;
  letter-spacing: -0.02em;
}

.subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-family: var(--font-mono);
  font-weight: 400;
}

#local-clock {
  color: var(--accent);
}

/* Toggle */
.toggle-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.65rem;
  cursor: pointer;
  user-select: none;
}

.toggle-label {
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  transition: color 0.15s;
}

.toggle-row:hover .toggle-label {
  color: var(--text-secondary);
}

.toggle-row input {
  display: none;
}

.toggle-switch {
  position: relative;
  width: 36px;
  height: 20px;
  background: var(--border);
  border-radius: 10px;
  transition: background 0.2s;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: all 0.2s;
}

.toggle-row input:checked + .toggle-switch {
  background: var(--accent);
}

.toggle-row input:checked + .toggle-switch::after {
  left: 19px;
  background: #fff;
}

/* Dashboard link (hidden by default) */
.dashboard-link {
  display: none;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  transition: all 0.15s;
  text-decoration: none;
  flex-shrink: 0;
  font-size: 0.75rem;
}

.dashboard-link:hover {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
}

body.show-dashboard .dashboard-link {
  display: flex;
}

.dashboard-divider {
  display: none;
  width: 1px;
  height: 14px;
  background: var(--border);
  margin: 0 0.5rem;
  flex-shrink: 0;
}

.dashboard-chip-icon {
  display: none;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  transition: all 0.15s;
  flex-shrink: 0;
  font-size: 0.6rem;
  cursor: pointer;
}

.dashboard-chip-icon:hover {
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.18);
}

body.show-dashboard .dashboard-divider {
  display: inline-block;
}

body.show-dashboard .dashboard-chip-icon {
  display: inline-flex;
}

/* Live Now Banner */
.now-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: 12px;
  padding: 0.85rem 1.25rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  font-weight: 500;
  animation: bannerSlide 0.4s ease-out;
}

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

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--live-color);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 var(--live-glow); }
  50% { box-shadow: 0 0 0 8px transparent; }
}

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

#now-text a {
  color: var(--live-color);
  text-decoration: none;
  font-weight: 600;
}

#now-text a:hover {
  text-decoration: underline;
}

/* Schedule Grid */
.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 2.5rem;
}

.day-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem 1.25rem;
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.day-card:hover {
  background: var(--bg-card-hover);
  border-color: #333340;
}

.day-card.is-today {
  border-color: var(--border-active);
  background: var(--bg-card-active);
  box-shadow: 0 0 20px var(--accent-glow), inset 0 1px 0 rgba(29, 155, 240, 0.08);
}

.day-card.is-live {
  border-color: var(--live-color);
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.06), var(--bg-card));
  box-shadow: 0 0 24px var(--live-glow);
}

.day-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.day-card.is-today .day-label,
.day-card.is-live .day-label {
  color: var(--text-secondary);
}

.day-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.host-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1.05rem;
  transition: color 0.15s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.host-link:hover {
  color: var(--accent);
}

.day-card.is-live .host-link {
  color: var(--live-color);
}

.time-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--text-secondary);
}

.time-local {
  color: var(--accent);
  font-weight: 600;
}

.time-sep {
  color: var(--text-muted);
}

.time-ct {
  color: var(--text-muted);
}

.day-status {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.status-badge {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  white-space: nowrap;
}

.status-badge.live {
  background: rgba(34, 197, 94, 0.15);
  color: var(--live-color);
  animation: pulse-badge 2s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.status-badge.upcoming {
  background: rgba(245, 158, 11, 0.12);
  color: var(--upcoming-color);
}

.status-badge.today {
  background: var(--accent-glow);
  color: var(--accent);
}

.profile-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
  transition: all 0.15s;
  text-decoration: none;
  flex-shrink: 0;
}

.profile-link:hover {
  color: var(--accent);
  background: var(--accent-glow);
}

/* Additional Hosts */
.additional-hosts {
  margin-bottom: 2rem;
}

.additional-hosts h2 {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

.host-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.4rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.15s;
}

.chip:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent);
  color: var(--accent);
}

.chip i {
  font-size: 0.7rem;
}

/* Footer */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-family: var(--font-mono);
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

/* Mobile adjustments */
@media (max-width: 520px) {
  .container {
    padding: 1.5rem 1rem 3rem;
  }

  h1 {
    font-size: 1.4rem;
  }

  .day-card {
    grid-template-columns: 4.5rem 1fr auto;
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .day-label {
    font-size: 0.68rem;
  }

  .host-link {
    font-size: 0.95rem;
  }

  .time-row {
    font-size: 0.72rem;
  }

  .status-badge {
    font-size: 0.62rem;
    padding: 0.2rem 0.45rem;
  }
}
