html:has(body.tunes-page) {
  height: auto;
  min-height: 100%;
}

body.tunes-page {
  height: auto;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

body.tunes-page main {
  flex: 1 0 auto;
}

body.tunes-page #tunes-audio {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

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

.tunes {
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 56px) 20px 72px;
}

.tunes-note {
  margin: 0 0 1rem;
  color: var(--muted, #bcd1ee);
}

.tunes-deck {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 1.25rem;
  padding: 1.1rem;
  border-radius: 20px;
  border: 1px solid rgba(152, 186, 227, 0.22);
  background:
    radial-gradient(520px 240px at 100% 0%, rgba(138, 180, 255, 0.14), transparent 60%),
    rgba(8, 14, 24, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.28);
}

.tunes-deck[data-tone="lofi"] {
  border-color: rgba(231, 197, 154, 0.45);
}

.tunes-deck[data-tone="edm"] {
  border-color: rgba(138, 180, 255, 0.5);
}

.tunes-deck[data-tone="mixes"] {
  border-color: rgba(201, 182, 239, 0.5);
}

.tunes-stations {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.tunes-station {
  display: grid;
  gap: 0.2rem;
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(152, 186, 227, 0.22);
  background: rgba(21, 39, 60, 0.55);
  color: var(--text, #e8eef9);
  font: inherit;
  cursor: pointer;
}

.tunes-station:hover:not(:disabled) {
  border-color: rgba(152, 186, 227, 0.5);
}

.tunes-station.is-current {
  background: rgba(21, 39, 60, 0.9);
}

.tunes-station--lofi.is-current {
  border-color: #e7c59a;
}

.tunes-station--edm.is-current {
  border-color: #8ab4ff;
}

.tunes-station--mixes.is-current {
  border-color: #c9b6ef;
}

.tunes-station:disabled,
.tunes-station.is-locked {
  cursor: not-allowed;
  color: rgba(188, 209, 238, 0.55);
  background: rgba(12, 16, 24, 0.55);
  border-style: dashed;
}

.tunes-station:focus-visible,
.tunes-btn:focus-visible,
.tunes-progress input:focus-visible,
.tunes-volume input:focus-visible {
  outline: 2px solid var(--accent, #8ab4ff);
  outline-offset: 2px;
}

.tunes-station__name {
  font-weight: 800;
  letter-spacing: 0.01em;
}

.tunes-station__meta {
  font-size: 0.82rem;
  color: var(--muted, #bcd1ee);
}

.tunes-station.is-locked .tunes-station__meta {
  color: rgba(188, 209, 238, 0.7);
}

.tunes-station__blurb {
  font-size: 0.78rem;
  line-height: 1.4;
  color: rgba(232, 238, 249, 0.72);
}

.tunes-stage {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 0.75rem;
  padding: 0.4rem 0.2rem 0.2rem;
}

.tunes-kicker {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent, #8ab4ff);
}

.tunes-title {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.2;
  font-weight: 800;
}

.tunes-bars {
  display: flex;
  align-items: flex-end;
  gap: 5px;
  height: 28px;
}

.tunes-bars span {
  display: block;
  width: 5px;
  height: 8px;
  border-radius: 99px;
  background: rgba(138, 180, 255, 0.45);
}

.tunes-deck.is-playing .tunes-bars span {
  animation: tunes-eq 0.9s ease-in-out infinite;
}

.tunes-deck.is-playing .tunes-bars span:nth-child(2) { animation-delay: 0.1s; }
.tunes-deck.is-playing .tunes-bars span:nth-child(3) { animation-delay: 0.2s; }
.tunes-deck.is-playing .tunes-bars span:nth-child(4) { animation-delay: 0.05s; }
.tunes-deck.is-playing .tunes-bars span:nth-child(5) { animation-delay: 0.18s; }
.tunes-deck.is-playing .tunes-bars span:nth-child(6) { animation-delay: 0.28s; }
.tunes-deck.is-playing .tunes-bars span:nth-child(7) { animation-delay: 0.12s; }

@keyframes tunes-eq {
  0%, 100% { height: 8px; }
  50% { height: 26px; }
}

.tunes-meter {
  height: 8px;
  border-radius: 99px;
  background: rgba(152, 186, 227, 0.2);
  overflow: hidden;
}

.tunes-meter > span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #8ab4ff, #e7c59a);
}

.tunes-volume input {
  width: 100%;
  accent-color: #8ab4ff;
}

.tunes-times {
  display: flex;
  justify-content: space-between;
  margin-top: 0.25rem;
  font-variant-numeric: tabular-nums;
  font-size: 0.82rem;
  color: var(--muted, #bcd1ee);
}

.tunes-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
}

.tunes-btn {
  border: 1px solid rgba(152, 186, 227, 0.35);
  background: rgba(21, 39, 60, 0.8);
  color: var(--text, #e8eef9);
  font: inherit;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}

.tunes-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tunes-btn--play {
  min-width: 5.5rem;
  background: linear-gradient(160deg, #8ab4ff, #5981b1);
  color: #071018;
  border-color: transparent;
}

.tunes-volume {
  flex: 1 1 120px;
  min-width: 120px;
  margin: 0;
}

.tunes-status {
  margin: 0;
  color: var(--muted, #bcd1ee);
  font-size: 0.88rem;
}

@media (max-width: 760px) {
  .tunes-deck {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tunes-deck.is-playing .tunes-bars span {
    animation: none;
    height: 16px;
  }
}
