:root {
  --bg: #110e0b;
  --panel: #1a1511;
  --panel-2: #221b15;
  --line: #3a2f24;
  --text: #efe3d2;
  --muted: #a8957e;
  --accent: #f5a52a;
  --accent-ink: #1a1007;
  --warn: #f2b84b;
  --error: #ff7a6b;
  --radius: 10px;
  --mono: "IBM Plex Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 20% -10%, #2a1c10 0%, var(--bg) 60%);
  color: var(--text);
  font: 15px/1.5 var(--mono);
  min-height: 100vh;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--line);
}
h1 { margin: 0; font-size: 22px; letter-spacing: 0.04em; color: var(--accent); }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.clock { font-size: 20px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.clock .label { color: var(--muted); font-size: 12px; }
#utc-date { color: var(--muted); font-size: 15px; margin-right: 4px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  padding: 20px clamp(16px, 4vw, 40px);
  max-width: 1400px;
  margin: 0 auto;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  min-width: 0;
}
.card.wide { grid-column: 1 / -1; }
h2 { margin: 0 0 14px; font-size: 15px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
h3 { margin: 18px 0 8px; font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.badge { font-size: 11px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }

.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-bottom: 16px; }
.station {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel-2);
  cursor: pointer;
}
.station input { accent-color: var(--accent); }
.station:has(input:checked) { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.station small { color: var(--muted); display: block; font-size: 12px; }

.field-label { display: block; color: var(--muted); font-size: 13px; margin: 6px 0 6px; }
input[type="text"], input:not([type]), input[type="number"], input[inputmode] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
  font-variant-numeric: tabular-nums;
}
input:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.seed-row { display: flex; gap: 8px; }
.seed-row input { flex: 1; min-width: 0; }

fieldset { border: 0; margin: 14px 0 0; padding: 0; }
legend { color: var(--muted); font-size: 13px; margin-bottom: 6px; padding: 0; }
.check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
.check input { accent-color: var(--accent); }

button {
  font: inherit;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  white-space: nowrap;
}
button:hover:not(:disabled) { border-color: var(--accent); }
button:disabled { opacity: 0.45; cursor: not-allowed; }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
button.primary:hover:not(:disabled) { filter: brightness(1.08); }
.buttons { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 12px; }
.hint { color: var(--muted); font-size: 12.5px; margin: 8px 0 0; min-height: 1em; }

.onair {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}
.onair-kind { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.onair-title { font-size: 18px; margin: 4px 0 12px; min-height: 2.9em; overflow-wrap: anywhere; }
.onair-times { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; margin-top: 6px; }
.progress { height: 6px; background: var(--panel-2); border-radius: 3px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--accent); transition: width 0.25s linear; }
.live.on .onair { border-color: var(--accent); }
.live.on #live-badge { color: var(--accent); }

.live-controls { display: flex; align-items: center; gap: 14px; margin-top: 14px; flex-wrap: wrap; }
.volume { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; }
.volume input { accent-color: var(--accent); width: 140px; }

.upnext { list-style: none; margin: 0; padding: 0; font-size: 13px; }
.upnext li { display: grid; grid-template-columns: 4.5em 1fr; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.upnext time { color: var(--muted); font-variant-numeric: tabular-nums; }
.upnext .song { color: var(--accent); }
.upnext span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.status { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.status.error { color: var(--error); }
.results { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.results a {
  color: var(--accent-ink); background: var(--accent);
  padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600;
}
.results a.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); font-weight: 400; }

.tracklist {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
  white-space: pre;
}

.foot { color: var(--muted); font-size: 12px; text-align: center; padding: 8px 16px 28px; }

@media (max-width: 520px) {
  .top { flex-direction: column; align-items: flex-start; }
  .seed-row { flex-wrap: wrap; }
  .seed-row input { flex-basis: 100%; }
  .seed-row button { flex: 1; }
}

.options { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 4px 14px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 10px;
  font: inherit;
}
select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.game-clock { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; float: right; }
