:root {
  --bg: #0b1426;
  --bg-2: #101d36;
  --card: #15233f;
  --card-edge: #26375c;
  --text: #f6f1e7;
  --muted: #b9c2d6;
  --gold: #ffd479;
  --red: #ff6b6b;
  --green: #5be49b;
  --warn: #ffc857;
  --focus: #ffe9a8;
  --radius: 16px;
  color-scheme: dark;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(120% 60% at 50% 0%, var(--bg-2), var(--bg) 70%) fixed, var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main, .site-header, .site-footer {
  width: 100%;
  max-width: 40rem;
  margin: 0 auto;
  padding-inline: 16px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

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

/* String of lights. Decorative only. */
.lights {
  height: 22px;
  background:
    radial-gradient(circle at 12px 8px, var(--red) 0 5px, transparent 6px) 0 0 / 96px 22px repeat-x,
    radial-gradient(circle at 36px 12px, var(--green) 0 5px, transparent 6px) 0 0 / 96px 22px repeat-x,
    radial-gradient(circle at 60px 8px, var(--gold) 0 5px, transparent 6px) 0 0 / 96px 22px repeat-x,
    radial-gradient(circle at 84px 12px, #7fb4ff 0 5px, transparent 6px) 0 0 / 96px 22px repeat-x;
  animation: twinkle 2.4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .7; } to { opacity: 1; } }

.site-header { text-align: center; padding-top: 12px; padding-bottom: 8px; }
.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 9vw, 2.75rem);
  line-height: 1.1;
  letter-spacing: .01em;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(255, 212, 121, .35);
}
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 1rem; letter-spacing: .08em; text-transform: uppercase; }
.location { margin: 2px 0 0; color: var(--gold, #ffd479); font-size: .95rem; letter-spacing: .04em; }

.card {
  background: var(--card);
  border: 1px solid var(--card-edge);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 14px 0;
}
.card h2 { margin: 0 0 8px; font-size: 1.15rem; color: var(--gold); }

.muted { color: var(--muted); }
.small { font-size: .9rem; }

/* Status: icon and text, never color alone */
.status-card { text-align: center; }
.status-pill {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0; padding: 10px 18px;
  border-radius: 999px;
  border: 2px solid var(--card-edge);
  font-weight: 700; font-size: 1.2rem;
}
.status-icon { font-size: 1.1em; line-height: 1; }
.status-pill[data-tone="live"] { border-color: var(--green); }
.status-pill[data-tone="live"] .status-icon::before { content: "●"; color: var(--green); }
.status-pill[data-tone="off"] .status-icon::before { content: "○"; color: var(--muted); }
.status-pill[data-tone="warn"] { border-color: var(--warn); }
.status-pill[data-tone="warn"] .status-icon::before { content: "!"; color: var(--warn); font-weight: 900; }
.status-pill[data-tone="neutral"] .status-icon::before { content: "★"; color: var(--gold); }
.status-detail { margin: 10px 0 0; color: var(--muted); }

.listen-main { margin: 0; font-size: 1.15rem; }
.listen-main strong { color: var(--text); white-space: nowrap; }
.listen-main strong.unset { color: var(--muted); font-weight: 600; white-space: normal; }

/* Now playing */
.track-title { margin: 0; font-size: 1.35rem; font-weight: 700; overflow-wrap: anywhere; }
.track-artist { margin: 2px 0 0; color: var(--muted); overflow-wrap: anywhere; }
.progress { margin-top: 12px; }
.progress-bar {
  height: 8px; border-radius: 999px; overflow: hidden;
  background: #22345a;
}
.progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--red), var(--gold)); }
.rating { display: flex; gap: 10px; margin-top: 12px; }
.rate-btn {
  min-width: 52px; min-height: 44px; padding: 0 12px; font-size: 1.35rem; line-height: 1;
  background: transparent; color: var(--text); border: 1px solid var(--card-edge); border-radius: 999px; cursor: pointer;
}
.rate-btn:hover { background: var(--bg-2); border-color: var(--muted); }
.rate-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.rating-thanks { margin: 12px 0 0; color: var(--muted); font-size: .95rem; }
.progress-times { display: flex; justify-content: space-between; font-size: .9rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }

.next-list { margin: 0; padding-left: 1.5em; }
.next-list li { padding: 6px 0; border-bottom: 1px solid var(--card-edge); overflow-wrap: anywhere; }
.next-list li:last-child { border-bottom: 0; }
.next-list .artist { color: var(--muted); }
#next-note { margin: 0; }
.next-list:not([hidden]) + #next-note:not(:empty) { margin-top: 8px; }

/* Search */
.search-form label { display: block; margin-bottom: 6px; color: var(--muted); }
.search-row { display: flex; gap: 8px; }
.search-row input {
  flex: 1; min-width: 0; min-height: 48px;
  padding: 10px 12px;
  font: inherit; color: var(--text);
  background: var(--bg);
  border: 2px solid var(--card-edge); border-radius: 12px;
}
.search-row input:focus-visible { border-color: var(--focus); outline-offset: 1px; }
.search-row button {
  min-height: 48px; padding: 0 18px;
  font: inherit; font-weight: 700;
  color: #1b1200; background: var(--gold);
  border: 0; border-radius: 12px; cursor: pointer;
}
#search-status { margin: 10px 0 0; }
#search-status:empty { display: none; }
.search-results { list-style: none; margin: 8px 0 0; padding: 0; }
.search-results li { padding: 10px 0; border-top: 1px solid var(--card-edge); }
.search-results .r-title { font-weight: 700; overflow-wrap: anywhere; }
.search-results .r-artist { color: var(--muted); }
.search-results .r-when { margin: 4px 0 0; }
.search-results .r-when[data-kind="now"] { color: var(--green); font-weight: 700; }

/* Schedule */
.countdown { margin: 0 0 8px; font-size: 1.1rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.countdown:empty { display: none; }
.schedule-list { list-style: none; margin: 0 0 8px; padding: 0; }
.schedule-list li { padding: 6px 0; border-bottom: 1px solid var(--card-edge); }
.schedule-list li[aria-current="date"] { color: var(--gold); font-weight: 700; }

.schedule-summary { list-style: none; margin: 0 0 12px; padding: 10px 12px; background: var(--bg); border-radius: 12px; }
.schedule-summary li { padding: 2px 0; }
.schedule-summary li:first-child { font-weight: 700; color: var(--gold); }
.schedule-subhead { margin: 0 0 4px; font-size: 1rem; color: var(--muted); font-weight: 600; }
#schedule-more:empty { display: none; }

.social-card p { margin: 0 0 12px; }
.button-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 18px;
  color: #fff; background: #1d5fd1;
  border-radius: 12px; font-weight: 700; text-decoration: none;
}
.button-link:hover { background: #2a6ee6; }

.site-footer { text-align: center; padding-bottom: 32px; color: var(--muted); }
.freshness { color: var(--warn); font-weight: 600; }

.dev-banner {
  background: #7a1f1f; color: #fff; text-align: center;
  padding: 6px 12px; font-weight: 700; font-size: .9rem;
}

@media (prefers-reduced-motion: reduce) {
  .lights { animation: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

@media (forced-colors: active) {
  .status-pill, .card { border: 1px solid CanvasText; }
  .progress-fill { background: Highlight; }
}
