:root {
  --bg: #080a0f;
  --bg-elev: #10141e;
  --bg-card: #131826;
  --bg-card-hover: #192033;
  --bg-active: #21181c;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
  --fg: #eef2f8;
  --fg-soft: #b6c0d2;
  --dim: #7b869e;
  --accent: #ff6b4a;
  --accent-soft: rgba(255, 107, 74, 0.16);
  --cyan: #38d9c0;
  --cyan-soft: rgba(56, 217, 192, 0.14);
  --violet: #a78bfa;
  --violet-soft: rgba(167, 139, 250, 0.15);
  --amber: #f0b44c;
  --amber-soft: rgba(240, 180, 76, 0.15);
  --danger: #e5484d;
  --radius: 12px;
  --radius-sm: 8px;
  --dock-h: 84px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(ellipse 70% 40% at 15% -10%, rgba(255, 107, 74, 0.11), transparent 60%),
    radial-gradient(ellipse 60% 35% at 88% -8%, rgba(56, 217, 192, 0.08), transparent 55%);
  background-attachment: fixed;
  min-height: 100vh;
  overflow-x: clip;
  -webkit-tap-highlight-color: transparent;
}

button, a, .station-card, .featured-card {
  touch-action: manipulation;
}

/* ---------------- Top Bar ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(8, 10, 15, 0.86);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  box-shadow: 0 4px 16px rgba(255, 107, 74, 0.22);
  flex-shrink: 0;
  display: block;
}

.brand h1 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.brand h1 span {
  color: var(--accent);
  font-weight: 800;
}

.archive-meta {
  font-size: 11.5px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.tabs {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}

.tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 500 13px/1 var(--font);
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.tab:hover { color: var(--fg); }

.tab.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--fg);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------------- Buttons & Inputs ---------------- */

.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--fg);
  font: 500 12.5px/1 var(--font);
  padding: 8px 13px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
}

.btn:active { transform: translateY(1px); }

.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.btn-accent {
  background: var(--accent-soft);
  border-color: rgba(255, 107, 74, 0.35);
  color: #ffd3c7;
}

.btn-accent:hover {
  background: rgba(255, 107, 74, 0.25);
  border-color: var(--accent);
  color: #fff;
}

.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-xs { padding: 4px 8px; font-size: 11px; border-radius: 6px; }

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.input, .select {
  background: var(--bg-elev);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font: 13px/1.2 var(--font);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}

.input:focus, .select:focus {
  border-color: rgba(255, 107, 74, 0.55);
  background: #141926;
}

.input::placeholder { color: var(--dim); }
.input-sm, .select-sm { padding: 6px 10px; font-size: 12.5px; }
.select-xs { padding: 5px 8px; font-size: 11.5px; }

/* ---------------- Main Shell ---------------- */

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px 22px calc(var(--dock-h) + 36px);
}

.view { display: none; }
.view.active { display: block; }

.radio-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.radio-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-toggle {
  display: inline-flex;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
}

.mode-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 500 12px/1 var(--font);
  padding: 6px 11px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
}

.mode-btn:hover { color: var(--fg); }

.mode-btn.active {
  background: var(--accent-soft);
  color: #ffd3c7;
}

.mode-btn-ingame.active {
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.34), rgba(168, 85, 247, 0.32));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 107, 74, 0.45);
}

.ingame-opts {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ingame-opts.hidden {
  display: none;
}

.chip-mini {
  padding: 5px 9px;
  font-size: 11.5px;
  font-weight: 550;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.04);
}

.chip-mini:hover {
  color: #fff;
  border-color: rgba(255, 107, 74, 0.45);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin: 26px 0 12px;
  flex-wrap: wrap;
}

.section-head:first-child { margin-top: 2px; }

.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.muted {
  margin: 2px 0 0;
  color: var(--dim);
  font-size: 12.5px;
}

.count-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  font-variant-numeric: tabular-nums;
}

/* ---------------- Radio Cards ---------------- */

.featured-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.featured-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 107, 74, 0.16), transparent 55%),
    var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  transition: transform 0.14s, border-color 0.15s, box-shadow 0.15s;
}

.featured-card:nth-child(2) {
  background:
    radial-gradient(circle at 90% 10%, rgba(56, 217, 192, 0.14), transparent 55%),
    var(--bg-card);
}

.featured-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.featured-card.on {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(255, 107, 74, 0.3), 0 10px 30px rgba(255, 107, 74, 0.12);
}

.featured-card .card-kicker {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}

.featured-card:nth-child(2) .card-kicker { color: var(--cyan); }

.featured-card .card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 4px;
}

.featured-card .card-sub {
  font-size: 12.5px;
  color: var(--fg-soft);
  font-variant-numeric: tabular-nums;
}

.featured-play {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line-strong);
  color: var(--fg);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.featured-card:hover .featured-play,
.featured-card.on .featured-play {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: scale(1.06);
}

.station-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 11px;
}

.station-card {
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: border-color 0.14s, background 0.14s, transform 0.12s;
}

.station-body {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.station-art {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: #0d111a;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.station-art-fallback {
  width: 58px;
  height: 58px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 107, 74, 0.18), rgba(56, 217, 192, 0.14));
  color: var(--fg);
  font: 700 17px/1 var(--font);
  letter-spacing: 0.04em;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.station-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.station-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.station-card.on {
  border-color: var(--accent);
  background: var(--bg-active);
  box-shadow: inset 3px 0 0 var(--accent);
}

.station-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2.5px 7px;
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}

.badge-music { background: var(--accent-soft); color: #ff9a82; }
.badge-podcasts { background: rgba(244, 114, 182, 0.16); color: #f9a8d4; }
.badge-talk { background: var(--amber-soft); color: var(--amber); }
.badge-clubs { background: var(--violet-soft); color: var(--violet); }
.badge-world { background: var(--cyan-soft); color: var(--cyan); }
.badge-score { background: rgba(255, 255, 255, 0.08); color: var(--fg-soft); }

.station-dur {
  font: 500 11.5px/1 var(--mono);
  color: var(--fg-soft);
  flex-shrink: 0;
}

.station-name {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--fg);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-stats {
  font-size: 12px;
  color: var(--dim);
  font-variant-numeric: tabular-nums;
}

.station-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.station-actions {
  display: flex;
  gap: 5px;
}

.mini-btn {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--fg-soft);
  font: 500 11px/1 var(--font);
  padding: 5px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.mini-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--line-strong);
  color: var(--fg);
}

.mini-btn-live {
  border-color: rgba(56, 217, 192, 0.35);
  color: var(--cyan);
}

.mini-btn-live:hover {
  background: var(--cyan-soft);
  border-color: var(--cyan);
  color: #fff;
}

.skeleton-card {
  height: 96px;
  border-radius: 14px;
  background: linear-gradient(90deg, var(--bg-card) 25%, #1a2234 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------------- Library View ---------------- */

.toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--fg-soft);
  font: 500 12.5px/1 var(--font);
  padding: 7px 13px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.chip:hover {
  border-color: var(--line-strong);
  color: var(--fg);
}

.chip.active {
  background: var(--accent-soft);
  border-color: rgba(255, 107, 74, 0.55);
  color: #fff;
}

.chip-toggle.active {
  background: var(--cyan-soft);
  border-color: rgba(56, 217, 192, 0.55);
  color: var(--cyan);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.search-wrap {
  flex: 1 1 220px;
  min-width: 180px;
}

.search-wrap .input { width: 100%; }

.toggle-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-soft);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
  padding: 0 4px;
}

.toggle-check input { accent-color: var(--accent); }

.results-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 2px;
}

.results-left, .results-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.track-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.track-table th,
.track-table td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
}

.track-table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  background: rgba(255, 255, 255, 0.02);
}

.track-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}

.track-table tbody tr:last-child td { border-bottom: 0; }
.track-table tbody tr:hover { background: rgba(255, 255, 255, 0.035); }

.track-table tbody tr.playing {
  background: var(--bg-active);
}

.track-table tbody tr.playing td:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
  color: var(--accent);
  font-weight: 700;
}

.col-idx { width: 48px; color: var(--dim); font: 12px var(--mono); }
.col-st { width: 185px; }
.col-dur { width: 82px; font: 12.5px var(--mono); }
.col-ch { width: 72px; }
.col-act { width: 42px; text-align: right; }

.track-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.track-title-stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.track-name {
  font-weight: 550;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-artist {
  font-size: 11.5px;
  color: var(--fg-soft);
  letter-spacing: 0.02em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-meta-mobile {
  display: none;
  font-size: 11px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.track-name.positional {
  color: var(--dim);
  font-weight: 450;
}

.cached-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cyan);
  flex-shrink: 0;
  opacity: 0.8;
}

.station-pill {
  appearance: none;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.04);
  color: var(--fg-soft);
  font: 500 11.5px/1 var(--font);
  padding: 3px 9px 3px 4px;
  border-radius: 999px;
  cursor: pointer;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}

.station-pill-noicon {
  padding-left: 9px;
}

.mini-art {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.station-pill:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-soft);
}

.ch-pill {
  font: 600 11px/1 var(--mono);
  padding: 3px 7px;
  border-radius: 999px;
  display: inline-block;
}

.ch-2 { background: var(--cyan-soft); color: var(--cyan); }
.ch-1 { background: var(--amber-soft); color: var(--amber); }
.ch-0 { background: rgba(255, 255, 255, 0.06); color: var(--dim); }

.row-dl {
  color: var(--dim);
  opacity: 0;
  padding: 4px;
  border-radius: 6px;
  display: inline-flex;
  transition: opacity 0.12s, color 0.12s, background 0.12s;
}

.track-table tbody tr:hover .row-dl,
.track-table tbody tr.playing .row-dl {
  opacity: 1;
}

.row-dl:hover {
  color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
}

.empty {
  text-align: center !important;
  color: var(--dim);
  padding: 42px 16px !important;
}

/* ---------------- Reference View ---------------- */

.ref-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
}

.ref-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.ref-panel h3 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 650;
}

.pill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ref-pill {
  font-size: 12px;
  color: var(--fg-soft);
  background: var(--bg-card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 11px;
  transition: border-color 0.12s, color 0.12s;
}

.ref-pill-btn {
  cursor: pointer;
}

.ref-pill-btn:hover {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent-soft);
}

.ref-pill.variant {
  opacity: 0.65;
  border-style: dashed;
}

.pill-count {
  color: var(--dim);
  font: 11px var(--mono);
  margin-left: 5px;
}

.shortcuts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px 14px;
  margin-top: 10px;
  color: var(--fg-soft);
  font-size: 12.5px;
}

kbd {
  display: inline-block;
  min-width: 24px;
  text-align: center;
  padding: 2px 6px;
  margin-right: 6px;
  font: 600 11px/1.3 var(--mono);
  color: var(--fg);
  background: var(--bg-card);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
}

/* ---------------- Player Dock ---------------- */

.player-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  z-index: 40;
  min-height: var(--dock-h);
  background: rgba(11, 14, 22, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line-strong);
  padding: 10px 22px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 1.6fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 18px;
}

.dock-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.dock-art-wrap {
  position: relative;
  width: 46px;
  height: 46px;
  flex-shrink: 0;
}

.dock-art {
  width: 46px;
  height: 46px;
  border-radius: 9px;
  object-fit: cover;
  border: 1px solid var(--line-strong);
  background: var(--bg-card);
  display: block;
}

.eq-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 9px;
  background: rgba(8, 10, 15, 0.56);
  border: 0;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 12px 10px;
}

.eq-overlay.playing {
  opacity: 1;
}

.eq {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2.5px;
}

.eq span {
  width: 2.5px;
  height: 4px;
  border-radius: 2px;
  background: var(--dim);
  transition: background 0.2s, height 0.2s;
}

.eq.playing span {
  background: var(--accent);
  animation: eq-bounce 0.9s ease-in-out infinite alternate;
}

.eq.playing span:nth-child(1) { animation-delay: 0s; }
.eq.playing span:nth-child(2) { animation-delay: 0.22s; }
.eq.playing span:nth-child(3) { animation-delay: 0.44s; }
.eq.playing span:nth-child(4) { animation-delay: 0.14s; }

@keyframes eq-bounce {
  from { height: 4px; }
  to { height: 15px; }
}

.now-info {
  flex: 1 1 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.now-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

#title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-artist {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-soft);
  letter-spacing: 0.025em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-artist:empty {
  display: none;
}

.now-meta {
  font-size: 11.5px;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.now-meta.status-loading { color: var(--accent); }
.now-meta.status-error { color: var(--danger); }

.live-badge,
.seg-badge,
.dj-badge,
.xfade-badge {
  display: none;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.09em;
  padding: 2px 6px;
  border-radius: 4px;
  flex-shrink: 0;
  white-space: nowrap;
}

.live-badge { color: #fff; background: var(--danger); }
.dj-badge { color: #1a1204; background: var(--amber); }
.xfade-badge { color: #051c19; background: var(--cyan); }

.seg-badge.on { display: inline-block; }
.seg-badge.seg-ad { color: #1c1203; background: #fbbf24; }
.seg-badge.seg-news { color: #fff; background: #ef4444; animation: live-pulse 1.8s ease-in-out infinite; }
.seg-badge.seg-ident { color: #041d22; background: #22d3ee; }
.seg-badge.seg-solo { color: #fff; background: #a855f7; }
.seg-badge.seg-talk { color: #fff; background: #f97316; }
.seg-badge.seg-night { color: #e9d5ff; background: linear-gradient(135deg, #4f46e5, #9333ea); }

.live-badge.on,
.dj-badge.on,
.xfade-badge.on {
  display: inline-block;
  animation: live-pulse 1.8s ease-in-out infinite;
}

@keyframes live-pulse {
  50% { opacity: 0.55; }
}

.dock-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.transport {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-soft);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.14s, background 0.14s;
}

.icon-btn:hover:not(:disabled) {
  color: var(--fg);
  background: rgba(255, 255, 255, 0.08);
}

.icon-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

.play-btn {
  appearance: none;
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--fg);
  color: #090b10;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.12s, background 0.14s;
}

.play-btn:hover { transform: scale(1.06); background: #fff; }
.play-btn:active { transform: scale(0.98); }

.spinner {
  width: 17px;
  height: 17px;
  border: 2.5px solid rgba(9, 11, 16, 0.25);
  border-top-color: #090b10;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.scrub-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
}

.time {
  font: 11px/1 var(--mono);
  color: var(--dim);
  min-width: 40px;
  text-align: center;
}

.scrub-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  height: 16px;
}

.scrub-markers {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 8px;
  transform: translateY(-50%);
  pointer-events: none;
  overflow: hidden;
  border-radius: 999px;
}

.mk-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(240, 180, 76, 0.34);
  border-radius: 2px;
}

.mk-tick {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 1px;
}

.mk-intro { background: var(--cyan); }
.mk-outro { background: var(--accent); }
.mk-track {
  position: absolute;
  top: 1px;
  bottom: 1px;
  width: 1px;
  background: rgba(255, 255, 255, 0.34);
}

.scrub {
  position: relative;
  z-index: 1;
}

.scrub, .vol-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  outline: none;
  cursor: pointer;
}

.scrub::-webkit-slider-thumb,
.vol-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--fg);
  border: 2px solid var(--accent);
  cursor: pointer;
  transition: transform 0.1s;
}

.scrub::-webkit-slider-thumb:hover,
.vol-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.scrub:disabled {
  cursor: default;
  opacity: 0.78;
}
.scrub:disabled::-webkit-slider-thumb {
  opacity: 0;
  width: 0;
  height: 0;
  border: 0;
}
.scrub:disabled::-moz-range-thumb {
  opacity: 0;
  width: 0;
  height: 0;
  border: 0;
}

.dock-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 110px;
}

.dl-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

@media (max-width: 860px) {
  :root { --dock-h: 136px; }

  .topbar-inner {
    padding: 10px 14px;
    gap: 10px;
  }

  .brand {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
  }

  .brand > div {
    min-width: 0;
    overflow: hidden;
  }

  .archive-meta {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .tabs {
    order: 3;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .tab {
    text-align: center;
    padding: 9px 8px;
    font-size: 12.5px;
  }

  .shell {
    padding: 14px 12px calc(var(--dock-h) + 30px + env(safe-area-inset-bottom));
  }

  .radio-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
    max-width: 100%;
    min-width: 0;
  }

  .toolbar {
    max-width: 100%;
    min-width: 0;
  }

  .chip-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 0 2px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .chip-row::-webkit-scrollbar { display: none; }

  .chip {
    flex-shrink: 0;
    padding: 8px 13px;
  }

  .radio-controls {
    width: 100%;
    gap: 8px;
  }

  .radio-controls .input {
    flex: 1 1 100%;
    width: 100%;
  }

  .mode-toggle {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .mode-btn {
    padding: 8px 10px;
    text-align: center;
  }

  .featured-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .featured-card {
    padding: 14px 16px;
  }

  .station-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 9px;
  }

  .mini-btn {
    padding: 7px 11px;
    font-size: 11.5px;
  }

  .col-idx,
  .col-st,
  .col-ch {
    display: none;
  }

  .track-meta-mobile {
    display: block;
  }

  .track-table th,
  .track-table td {
    padding: 10px 10px;
  }

  .col-dur {
    width: 56px;
    text-align: right;
    font-size: 12px;
    color: var(--fg-soft);
  }

  .col-act {
    width: 38px;
    padding-left: 4px !important;
  }

  .row-dl {
    opacity: 0.72;
    padding: 7px;
  }

  /* Compact two-row mobile player dock */
  .player-dock {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "left right"
      "center center";
    gap: 8px 10px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  }

  .dock-left {
    grid-area: left;
    gap: 10px;
  }

  .dock-art-wrap,
  .dock-art {
    width: 42px;
    height: 42px;
  }

  .dock-right {
    grid-area: right;
    gap: 6px;
  }

  .dock-center {
    grid-area: center;
    width: 100%;
    flex-direction: column-reverse;
    gap: 6px;
  }

  .transport {
    gap: 18px;
  }

  .icon-btn {
    width: 38px;
    height: 38px;
  }

  .play-btn {
    width: 42px;
    height: 42px;
  }

  .scrub {
    height: 5px;
  }

  .scrub::-webkit-slider-thumb {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 600px) {
  :root { --dock-h: 152px; }

  .brand-icon {
    width: 34px;
    height: 34px;
  }

  .brand h1 {
    font-size: 14px;
  }

  #btn-random-station span:last-child {
    display: none;
  }

  #btn-random-station::after {
    content: "Random";
  }

  .input,
  .select {
    font-size: 16px; /* Prevents iOS Safari auto-zoom on focus */
  }

  .select-xs {
    font-size: 13px;
  }

  .filter-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .filter-row > * {
    min-width: 0;
    max-width: 100%;
  }

  .filter-row .select,
  .filter-row .input {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .search-wrap {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .filter-row .toggle-check {
    grid-column: 1 / -1;
    padding: 4px 2px;
  }

  .station-grid {
    grid-template-columns: 1fr;
  }

  .vol-wrap {
    width: auto;
  }

  .vol-slider {
    display: none; /* Phones use hardware volume buttons */
  }

  .dl-group .select-xs {
    display: none;
  }
}


/* ---------------- Global Live, Party & Settings Drawer ---------------- */

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon-sq {
  padding: 8px 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-party {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(168, 85, 247, 0.14);
  border: 1px solid rgba(168, 85, 247, 0.36);
  color: #e9d5ff;
  font: 600 12.5px/1 var(--font);
  cursor: pointer;
  transition: background 0.14s, border-color 0.14s, color 0.14s, transform 0.1s;
}

.btn-party:hover {
  background: rgba(168, 85, 247, 0.24);
  border-color: rgba(168, 85, 247, 0.62);
  color: #fff;
}

.btn-party.in-party {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.34), rgba(236, 72, 153, 0.34));
  border-color: rgba(236, 72, 153, 0.58);
  color: #fff;
  box-shadow: 0 0 18px rgba(168, 85, 247, 0.28);
}

.mode-btn-global {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.dot-global {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22d3ee;
  opacity: 0.55;
  flex-shrink: 0;
}

.mode-btn-global.active {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.32), rgba(59, 130, 246, 0.34));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.52);
}

.mode-btn-global.active .dot-global {
  background: #38f6ff;
  opacity: 1;
  box-shadow: 0 0 8px #22d3ee;
  animation: live-pulse 1.6s ease-in-out infinite;
}

.sync-pill {
  display: none;
  appearance: none;
  border: 1px solid rgba(34, 211, 238, 0.45);
  background: rgba(6, 182, 212, 0.18);
  color: #67e8f9;
  font: 800 9.5px/1 var(--font);
  letter-spacing: 0.08em;
  padding: 3px 6px;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  white-space: nowrap;
}

.sync-pill.on {
  display: inline-block;
}

.sync-pill.party-sync {
  border-color: rgba(168, 85, 247, 0.55);
  background: rgba(168, 85, 247, 0.24);
  color: #f3e8ff;
}

.sync-pill:hover {
  filter: brightness(1.18);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 12, 0.65);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 80;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(410px, 100vw);
  max-width: 100vw;
  background: rgba(13, 16, 26, 0.98);
  border-left: 1px solid var(--line-strong);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.55);
  z-index: 90;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.drawer[hidden],
.drawer-backdrop[hidden] {
  display: none;
}

.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.02);
}

.drawer-tabs {
  display: inline-flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  padding: 3px;
  border-radius: 9px;
  border: 1px solid var(--line);
}

.drawer-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font: 600 12.5px/1 var(--font);
  padding: 7px 13px;
  border-radius: 6px;
  cursor: pointer;
}

.drawer-tab.active {
  background: var(--accent-soft);
  color: #fff;
}

.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-pane {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.drawer-pane.active {
  display: flex;
}

.panel-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.panel-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
}

.panel-card h4 {
  margin: 0 0 2px;
  font-size: 13.5px;
  font-weight: 650;
}

.field-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--fg-soft);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inline-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-row .input {
  flex: 1 1 auto;
  min-width: 0;
}

.code-input {
  text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: 0.1em;
}

.btn-full {
  width: 100%;
  justify-content: center;
  margin-top: 4px;
}

.btn-danger-ghost {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.36);
  color: #fca5a5;
}

.btn-danger-ghost:hover {
  background: rgba(239, 68, 68, 0.24);
  color: #fff;
}

.party-banner {
  background:
    radial-gradient(circle at 95% 10%, rgba(168, 85, 247, 0.22), transparent 60%),
    rgba(255, 255, 255, 0.03);
  border-color: rgba(168, 85, 247, 0.35);
}

.party-banner-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.party-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #c084fc;
}

.party-code {
  font: 800 22px/1.1 var(--mono);
  letter-spacing: 0.12em;
  color: #fff;
  margin-top: 2px;
}

.role-pill {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.2);
  border: 1px solid rgba(251, 191, 36, 0.45);
  color: #fde68a;
}

.role-pill.member {
  background: rgba(34, 211, 238, 0.16);
  border-color: rgba(34, 211, 238, 0.4);
  color: #a5f3fc;
}

.party-banner-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 6px;
}

.party-now-sync {
  font-size: 11.5px;
  color: var(--fg-soft);
  margin-top: 4px;
}

.panel-subhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.member-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line);
}

.member-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.member-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  flex-shrink: 0;
}

.member-dot.off {
  background: #64748b;
}

.member-name {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #fde68a;
  flex-shrink: 0;
}

.member-tag.you {
  background: rgba(255, 255, 255, 0.1);
  color: var(--fg-soft);
}

.member-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.switch-row,
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12.5px;
}

.switch-row:first-of-type,
.setting-row:first-of-type {
  border-top: 0;
  padding-top: 2px;
}

.switch-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

.weather-subrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 2px 0 6px;
  font-size: 11.5px;
}
.weather-subrow[hidden] {
  display: none;
}

.party-msg {
  font-size: 12px;
  color: #67e8f9;
  min-height: 16px;
}

.party-msg.err {
  color: #fca5a5;
}

@media (max-width: 640px) {
  .mode-toggle {
    flex-wrap: wrap;
    max-width: 100%;
  }

  .mode-btn {
    padding: 6px 8px;
    font-size: 11.5px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .btn-party,
  .btn-wheel {
    padding: 6px 8px;
    font-size: 11.5px;
  }

  .btn-kbd {
    display: none;
  }
}

/* ======================== IN-GAME GTA VI RADIO WHEEL ======================== */

.btn-wheel {
  background: linear-gradient(135deg, rgba(255, 75, 114, 0.2), rgba(34, 211, 238, 0.2));
  color: #fff;
  border: 1px solid rgba(255, 120, 150, 0.42);
  gap: 6px;
}

.btn-wheel:hover {
  background: linear-gradient(135deg, rgba(255, 75, 114, 0.34), rgba(34, 211, 238, 0.3));
  border-color: rgba(255, 140, 168, 0.68);
  box-shadow: 0 0 18px rgba(255, 75, 114, 0.28);
}

.btn-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 17px;
  padding: 0 4px;
  border-radius: 4px;
  font: 700 10px/1 var(--mono);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dock-art-wrap {
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.dock-art-wrap:hover {
  transform: scale(1.05);
  box-shadow: 0 0 0 2px rgba(255, 75, 114, 0.55);
}

.wheel-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  opacity: 0;
  transition: opacity 0.16s ease;
  user-select: none;
  -webkit-user-select: none;
  touch-action: none;
}

.wheel-overlay[hidden] {
  display: none;
}

.wheel-overlay.open {
  opacity: 1;
}

.wheel-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 48%, rgba(16, 18, 30, 0.56) 0%, rgba(4, 6, 12, 0.88) 72%);
  backdrop-filter: blur(10px) saturate(1.15);
  -webkit-backdrop-filter: blur(10px) saturate(1.15);
}

.wheel-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 100%;
  max-height: 100%;
  transform: scale(0.92);
  transition: transform 0.17s cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel-overlay.open .wheel-stage {
  transform: scale(1);
}

.wheel-topbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 100%;
}

.wheel-set-pills {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(12, 15, 25, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.wheel-set-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--fg-soft);
  font: 600 12px/1 var(--font);
  padding: 7px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.14s, color 0.14s;
  white-space: nowrap;
}

.wheel-set-btn:hover {
  color: #fff;
}

.wheel-set-btn.active {
  background: linear-gradient(135deg, rgba(255, 75, 114, 0.34), rgba(34, 211, 238, 0.28));
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 140, 168, 0.48);
}

.wheel-close-btn {
  background: rgba(12, 15, 25, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #fff;
  width: 34px;
  height: 34px;
}

.wheel-dial {
  --wheel-size: clamp(296px, min(92vw, 72vh), 560px);
  --slot-sz: clamp(30px, calc(var(--wheel-size) * 0.086), 48px);
  position: relative;
  width: var(--wheel-size);
  height: var(--wheel-size);
  flex-shrink: 0;
  touch-action: none;
}

.wheel-dial[data-density="medium"] {
  --slot-sz: clamp(36px, calc(var(--wheel-size) * 0.104), 56px);
}

.wheel-dial[data-density="roomy"] {
  --slot-sz: clamp(42px, calc(var(--wheel-size) * 0.118), 64px);
}

.wheel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.wheel-ring-outer {
  fill: none;
  stroke: rgba(255, 75, 114, 0.08);
  stroke-width: 102;
}

.wheel-ring-track {
  fill: none;
  stroke: rgba(8, 10, 18, 0.84);
  stroke-width: 96;
}

.wheel-ring-outer-border {
  fill: none;
  stroke: rgba(255, 255, 255, 0.14);
  stroke-width: 1.5;
}

.wheel-ring-inner-border {
  fill: none;
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1.25;
}

.wheel-tick {
  stroke: rgba(255, 255, 255, 0.075);
  stroke-width: 1;
}

.wheel-tuned-arc {
  fill: rgba(34, 211, 238, 0.16);
  stroke: rgba(34, 211, 238, 0.55);
  stroke-width: 1.5;
}

.wheel-hover-arc {
  fill: rgba(255, 75, 114, 0.26);
  transition: opacity 0.1s ease;
}

.wheel-hover-arc.is-off {
  fill: rgba(148, 163, 184, 0.22);
}

.wheel-hover-rim {
  fill: none;
  stroke: url(#wheel-vice-grad);
  stroke-width: 4.5;
  stroke-linecap: round;
  filter: url(#wheel-glow);
}

.wheel-hover-rim.is-off {
  stroke: #94a3b8;
  filter: none;
}

.wheel-hub-ring {
  fill: rgba(7, 9, 16, 0.88);
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.5;
}

.wheel-pointer {
  transition: transform 0.09s cubic-bezier(0.22, 1, 0.36, 1);
}

.wheel-slots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.wheel-slot {
  position: absolute;
  width: var(--slot-sz);
  height: var(--slot-sz);
  margin: 0;
  padding: 0;
  transform: translate(-50%, -50%) scale(1);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.18);
  background: rgba(15, 19, 32, 0.94);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.55);
  cursor: pointer;
  pointer-events: auto;
  overflow: visible;
  display: grid;
  place-items: center;
  transition: transform 0.11s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.11s, box-shadow 0.11s, filter 0.11s;
  filter: brightness(0.84) saturate(0.92);
}

.wheel-slot-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.wheel-slot-fallback {
  font: 800 calc(var(--slot-sz) * 0.34) / 1 var(--font);
  letter-spacing: 0.03em;
  color: #e2e8f0;
  pointer-events: none;
}

.wheel-slot.is-off {
  background: linear-gradient(135deg, rgba(30, 35, 50, 0.96), rgba(15, 18, 28, 0.98));
  color: #cbd5e1;
}

.wheel-slot.is-tuned {
  border-color: #22d3ee;
  box-shadow: 0 0 0 2px rgba(34, 211, 238, 0.35), 0 4px 14px rgba(0, 0, 0, 0.6);
  filter: brightness(1) saturate(1.05);
  z-index: 6;
}

.wheel-slot.is-selected {
  transform: translate(-50%, -50%) scale(1.32);
  border-color: #fff;
  box-shadow:
    0 0 0 2.5px rgba(255, 75, 114, 0.9),
    0 0 24px rgba(255, 75, 114, 0.65),
    0 6px 20px rgba(0, 0, 0, 0.72);
  filter: brightness(1.08) saturate(1.12);
  z-index: 20;
}

.wheel-slot.is-off.is-selected {
  box-shadow:
    0 0 0 2.5px rgba(148, 163, 184, 0.9),
    0 0 18px rgba(148, 163, 184, 0.45),
    0 6px 20px rgba(0, 0, 0, 0.72);
}

.wheel-slot-fav-dot {
  position: absolute;
  top: -3px;
  right: -3px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #fbbf24;
  color: #1c1203;
  font-size: 9px;
  line-height: 13px;
  text-align: center;
  font-weight: 900;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.7);
  pointer-events: none;
}

.wheel-hub {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58%;
  height: 58%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 18px;
  gap: 4px;
  pointer-events: auto;
  overflow: hidden;
}

.wheel-hub-art-wrap {
  width: clamp(46px, calc(var(--wheel-size) * 0.135), 76px);
  height: clamp(46px, calc(var(--wheel-size) * 0.135), 76px);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.22);
  background: rgba(16, 20, 34, 0.95);
  box-shadow: 0 0 28px rgba(255, 75, 114, 0.24), 0 6px 18px rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
  margin-bottom: 2px;
}

.wheel-hub-art {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wheel-hub-off-emblem {
  color: #94a3b8;
  display: grid;
  place-items: center;
}

.wheel-hub-off-emblem[hidden] {
  display: none;
}

.wheel-hub-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 16px;
}

.wheel-hub-badge {
  font: 800 9px/1 var(--font);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2.5px 6px;
  border-radius: 4px;
}

.wheel-hub-badge.live {
  background: rgba(6, 182, 212, 0.24);
  color: #67e8f9;
  border: 1px solid rgba(34, 211, 238, 0.45);
}

.wheel-hub-badge.tuned {
  background: rgba(255, 75, 114, 0.24);
  color: #fda4af;
  border: 1px solid rgba(255, 75, 114, 0.48);
}

.wheel-hub-badge.seg {
  background: rgba(251, 191, 36, 0.22);
  color: #fde68a;
  border: 1px solid rgba(251, 191, 36, 0.45);
}

.wheel-hub-name {
  font-size: clamp(13px, calc(var(--wheel-size) * 0.036), 20px);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  line-height: 1.1;
  max-width: 96%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-hub-genre {
  font-size: clamp(10px, calc(var(--wheel-size) * 0.021), 12px);
  color: var(--dim);
  max-width: 94%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-hub-now {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  max-width: 94%;
  margin-top: 2px;
  min-height: 28px;
}

.wheel-hub-track {
  font-size: clamp(11px, calc(var(--wheel-size) * 0.024), 13.5px);
  font-weight: 650;
  color: #f8fafc;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-hub-artist {
  font-size: clamp(10px, calc(var(--wheel-size) * 0.021), 12px);
  color: #94a3b8;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wheel-hub-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 4px;
}

.wheel-hub-btn {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.07);
  color: var(--fg-soft);
  font: 600 11px/1 var(--font);
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
}

.wheel-hub-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.wheel-hub-btn.is-fav {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fde68a;
}

.wheel-hub-btn-tune {
  background: linear-gradient(135deg, #ff4b72, #ff7a45);
  border-color: transparent;
  color: #fff;
  font-weight: 700;
}

.wheel-hub-btn-tune:hover {
  filter: brightness(1.1);
}

.wheel-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 14px;
  font-size: 11.5px;
  color: rgba(226, 232, 240, 0.72);
  text-align: center;
  padding: 4px 10px;
}

.wheel-hints kbd {
  font: 700 10.5px/1 var(--mono);
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
}

@media (max-width: 640px) {
  .wheel-set-btn {
    padding: 6px 9px;
    font-size: 11px;
  }

  .wheel-hub {
    padding: 10px 12px;
    gap: 2px;
  }

  .wheel-hub-actions {
    margin-top: 2px;
  }

  .wheel-hub-btn {
    padding: 4px 8px;
    font-size: 10.5px;
  }

  .wheel-hints {
    font-size: 10.5px;
    gap: 6px 10px;
  }
}
