:root {
  color-scheme: dark;
  font-family: "DM Sans", sans-serif;
  background: #111312;
  color: #f0f0eb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #8c928d;
  --line: #2b302d;
  --accent: #d3fb64;
  --panel: #191c1a;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 82% 1%, rgb(211 251 100 / 7%), transparent 29rem),
    #111312;
}

button, select { font: inherit; }

.page-shell {
  width: min(100% - 48px, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #111312;
  background: var(--accent);
  font: 700 20px "Space Grotesk", sans-serif;
}

.brand-name {
  font: 700 22px "Space Grotesk", sans-serif;
  letter-spacing: -1.3px;
}

.brand-dot { color: var(--accent); }

.live-indicator, .eyebrow, .result-count, footer {
  font-family: "DM Mono", monospace;
  letter-spacing: .09em;
}

.live-indicator {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #b6bcb7;
  font-size: 10px;
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px rgb(211 251 100 / 70%);
}

.intro { padding: 72px 0 43px; }

.eyebrow {
  margin: 0 0 15px;
  color: var(--accent);
  font-size: 10px;
}

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 16px;
  font: 600 clamp(42px, 7vw, 72px)/.99 "Space Grotesk", sans-serif;
  letter-spacing: -.065em;
}

h1 span { color: #888f89; }

.intro-copy {
  margin: 0;
  color: #a4aaa5;
  font-size: 15px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 70px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.controls label {
  color: var(--muted);
  font-size: 12px;
}

select, .refresh-button, .pagination button {
  min-height: 38px;
  border: 1px solid #373d39;
  border-radius: 6px;
  color: #e8ebe6;
  background: #1b1f1c;
}

select {
  min-width: 160px;
  padding: 0 32px 0 11px;
}

.refresh-button, .pagination button {
  padding: 0 13px;
  cursor: pointer;
  transition: border-color .2s, color .2s, background .2s;
}

.refresh-button:hover, .pagination button:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}

.refresh-button span {
  margin-right: 5px;
  color: var(--accent);
  font-size: 18px;
  vertical-align: -1px;
}

.update-status {
  margin: 0 0 0 auto;
  color: var(--muted);
  font-size: 11px;
}

.playlist-section { padding-top: 45px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 22px;
}

.section-heading .eyebrow { margin-bottom: 9px; }

h2 {
  margin: 0;
  font: 600 27px "Space Grotesk", sans-serif;
  letter-spacing: -.04em;
}

.result-count {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
}

.latest-track {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 19px 21px;
  border: 1px solid #3b4730;
  border-radius: 10px;
  background: linear-gradient(110deg, #20271c, #191c1a 72%);
}

.latest-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 8px;
  color: var(--accent);
  background: #2a3421;
  font-size: 24px;
}

.latest-label {
  margin: 0 0 5px;
  color: var(--accent);
  font: 10px "DM Mono", monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.latest-title {
  margin: 0;
  font: 600 20px "Space Grotesk", sans-serif;
  letter-spacing: -.03em;
}

.latest-artist {
  margin: 3px 0 0;
  color: #a8aea8;
  font-size: 13px;
}

.latest-station {
  align-self: start;
  color: #c3c9c3;
  font: 10px "DM Mono", monospace;
  text-align: right;
}

.track-list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgb(25 28 26 / 72%);
}

.track-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 120px 130px 48px;
  align-items: center;
  gap: 14px;
  min-height: 75px;
  padding: 12px 19px;
  border-bottom: 1px solid var(--line);
}

.track-row:last-child { border-bottom: 0; }

.track-number {
  color: #626963;
  font: 11px "DM Mono", monospace;
}

.track-info { min-width: 0; }

.track-title {
  overflow: hidden;
  margin: 0 0 4px;
  color: #eff1ec;
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-artist {
  overflow: hidden;
  margin: 0;
  color: #919891;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-station, .track-time, .track-duration {
  color: #929991;
  font: 10px "DM Mono", monospace;
}

.track-station {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-time { text-align: right; }
.track-duration { color: #737a74; text-align: right; }

.empty-state {
  padding: 70px 20px;
  border: 1px dashed #363d38;
  border-radius: 9px;
  color: var(--muted);
  text-align: center;
}

.empty-icon { color: var(--accent); font-size: 30px; }
.empty-state h3 { margin: 12px 0 6px; color: #e5e9e3; font: 600 18px "Space Grotesk", sans-serif; }
.empty-state p { margin: 0; font-size: 13px; }

.error-state {
  margin-top: 15px;
  padding: 14px 16px;
  border: 1px solid #69443c;
  border-radius: 7px;
  color: #f0b4a4;
  background: #2a1c19;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 22px 0 55px;
}

.pagination button { min-height: 34px; font-size: 12px; }
.pagination button:disabled { cursor: default; opacity: .4; }
#page-label { color: #a8aea8; font: 11px "DM Mono", monospace; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding: 20px 0 26px;
  border-top: 1px solid var(--line);
  color: #6f766f;
  font-size: 9px;
}

[hidden] { display: none !important; }

@media (max-width: 640px) {
  .page-shell { width: min(100% - 32px, 1040px); }
  .topbar { height: 72px; }
  .intro { padding: 56px 0 34px; }
  .controls { flex-wrap: wrap; gap: 9px; padding: 13px 0; }
  .controls label { width: 100%; }
  select { flex: 1; min-width: 130px; }
  .update-status { width: 100%; margin: 2px 0 0; }
  .playlist-section { padding-top: 35px; }
  .latest-track { grid-template-columns: 44px 1fr; gap: 12px; padding: 15px; }
  .latest-icon { width: 42px; height: 42px; }
  .latest-station { grid-column: 2; text-align: left; }
  .track-row { grid-template-columns: 27px minmax(0, 1fr) 66px; gap: 9px; padding: 12px; }
  .track-station { display: none; }
  .track-time { font-size: 9px; }
  .track-duration { grid-column: 2; text-align: left; }
  footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
