:root {
  color-scheme: dark;
  --bg: #100d20;
  --line: #403459;
  --text: #f7f3ff;
  --muted: #c3b9d8;
  --cyan: #56e2ff;
  --violet: #aa8bff;
  --pink: #f39cdd;
  --gold: #f5c978;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 280px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 6% 14%, #123348 0%, transparent 39%),
    radial-gradient(ellipse at 90% 72%, #28164a 0%, transparent 54%),
    var(--bg);
}
.shell { width: min(960px, calc(100% - 36px)); margin-inline: auto; }
a { color: inherit; }
button, input { font: inherit; }
button {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--line);
  border-radius: 10px;
  --accent: var(--cyan);
  background: #28203f;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
  touch-action: manipulation;
  transition: background-color .17s, border-color .17s, box-shadow .2s, filter .15s;
}
button:hover { border-color: color-mix(in srgb, var(--accent) 68%, #403459); background-color: #33264c; }
button:active { filter: brightness(1.22); }
.radio button:is(:active, :has(.ripple)) {
  border-color: var(--accent);
  box-shadow: 0 0 14px color-mix(in srgb, var(--accent) 44%, transparent), inset 0 0 12px color-mix(in srgb, var(--accent) 22%, transparent);
}
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
button[aria-pressed="true"], .station-row .current {
  border-color: color-mix(in srgb, var(--accent) 78%, #403459);
  background: linear-gradient(125deg, color-mix(in srgb, var(--accent) 22%, #19132b), #2d2149);
  box-shadow: inset 0 0 14px color-mix(in srgb, var(--accent) 12%, transparent);
}
.ripple {
  pointer-events: none;
  position: absolute;
  inset: var(--y) auto auto var(--x);
  width: var(--d);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 48%, transparent), transparent 70%);
  animation: ripple .48s ease-out forwards;
}
@keyframes ripple { from { transform: translate(-50%, -50%) scale(0); } to { transform: translate(-50%, -50%) scale(1); opacity: 0; } }
.site-header { background: #100c20ee; border-bottom: 1px solid #382a50; }
.header-inner, .footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; }
.header-inner { min-height: 62px; }
.brand { font-size: 19px; font-weight: 900; text-decoration: none; letter-spacing: .02em; white-space: nowrap; }
.brand b, .brand span { color: var(--cyan); }
.back-link { padding: 8px 12px; border: 1px solid var(--line); border-radius: 20px; font-size: 12px; color: #dfd6f4; text-decoration: none; }
.external-arrow { display: inline-block; transform: rotate(-35deg); }
.back-link:hover { border-color: var(--cyan); }
main { padding-block: 30px; }
.radio {
  background: radial-gradient(ellipse at 100% 0%, #45235855, transparent 52%),
    linear-gradient(145deg, #191b31, #1a142d 70%);
  border: 1px solid #493b62;
  border-radius: 22px;
  padding: clamp(13px, 2.8vw, 27px);
  box-shadow: 0 20px 60px #080611a6, 0 0 25px #8b52d315;
}
.radio-header, .face-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.radio-header { padding-bottom: 12px; border-bottom: 1px solid #68538159; margin-bottom: 10px; }
h1, h2 { margin: 0; line-height: 1.1; }
h1 { font-size: clamp(25px, 4vw, 40px); font-weight: 900; letter-spacing: -.045em; }
h1 span {
  color: var(--violet);
  background: linear-gradient(100deg, var(--cyan), var(--violet) 58%, var(--pink));
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.art-caption { color: var(--gold); }
.flip { --accent: var(--violet); color: #d9c5ff; }
h2 { font-size: clamp(18px, 3vw, 25px); letter-spacing: -.025em; }
.header-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.header-actions button, .flip { padding-inline: 12px; font-size: 13px; font-weight: 650; background-color: #221a36; }
.header-actions button:hover, .flip:hover { background: #34264e; }
#favorites { min-inline-size: 111px; }
#favorites { --accent: var(--pink); }
#favorites[aria-expanded="true"] { border-color: var(--pink); color: var(--pink); }
.settings-panel { display: flex; flex-wrap: wrap; align-items: center; column-gap: 20px; padding: 2px 10px; margin-bottom: 6px; background: #151025; border-radius: 10px; font-size: 13px; }
.settings-panel label { min-height: 44px; display: flex; align-items: center; gap: 7px; cursor: pointer; }
input { accent-color: var(--cyan); }
.face-frame { perspective: 1100px; }
.deck { display: grid; transform-style: preserve-3d; transition: transform .62s cubic-bezier(.21,.67,.28,1); }
.deck.reversed { transform: rotateY(180deg); }
.face { grid-area: 1 / 1; min-width: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.genres-face { transform: rotateY(180deg); }
.face-heading { margin-bottom: 7px; }
.band-menu { display: grid; gap: 6px; }
.retro-menu { grid-template-columns: repeat(2,minmax(0,1fr)); }
.genre-menu { grid-template-columns: repeat(6,minmax(0,1fr)); }
.band-menu button { font-size: 13px; font-weight: 750; padding: 5px 4px; }
.band-menu small { color: #ded6ee; font-size: 10px; font-weight: 500; margin-inline-start: 4px; }
[data-band="rock"], [data-band="metal"] { --accent: var(--violet); }
[data-band="pop"], [data-band="variety"] { --accent: var(--pink); }
.equalizer { display: flex; align-items: flex-end; gap: 3px; height: 11px; margin: 7px 0 8px; }
.radio:not(.visualize) .equalizer { display: none; }
.equalizer i {
  flex: 1;
  height: 100%;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(to top, hsl(var(--hue) 75% 54%), hsl(var(--hue) 97% 76%));
  opacity: .54;
  transform: scaleY(var(--quiet));
  transform-origin: bottom;
}
.radio.is-playing .equalizer i { opacity: 1; box-shadow: 0 0 6px hsl(var(--hue) 90% 68% / .5); }
.radio.is-playing.visualize .equalizer i { animation: signal var(--speed) ease-in-out var(--phase) infinite alternate; }
@keyframes signal { 0% { transform: scaleY(var(--quiet)); } 64% { transform: scaleY(1); } 100% { transform: scaleY(.36); } }
.retro-layout { display: grid; grid-template-columns: minmax(148px, 23%) minmax(0, 1fr); gap: 10px; }
.artwork { display: grid; place-content: center; justify-items: center; gap: 11px; border-radius: 12px; border: 1px solid #493c66; background: radial-gradient(circle, #393265, #19162d 75%); }
.art-ring { display: grid; place-items: center; width: 94px; aspect-ratio: 1; border: 3px solid #e0af5c; border-radius: 50%; box-shadow: 0 0 0 6px #efbc671a, inset 0 0 0 5px #25213f; font-size: 30px; letter-spacing: -.09em; }
.art-ring span { color: var(--gold); margin-inline: 2px; font-size: 21px; }
.art-caption { font-size: 9px; letter-spacing: .27em; font-weight: 800; }
.station-list { margin: 0; padding: 5px; list-style: none; height: 200px; overflow: auto; overflow-x: hidden; scrollbar-color: #655682 #191328; scrollbar-gutter: stable; background: #151123; border: 1px solid #3f3356; border-radius: 11px; overscroll-behavior: contain; }
.station-list li + li { margin-top: 4px; }
.station-row { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: stretch; gap: 4px; }
.station-row button { border-radius: 6px; border-color: transparent; background-color: #211a33; }
.station-row button:hover { background-color: #332649; }
.station-row .saved { color: var(--pink); }
.station-select { display: flex; align-items: center; gap: 9px; text-align: start; padding: 5px 9px; font-size: 14px; overflow-wrap: anywhere; }
.station-select[aria-disabled="true"] { color: var(--muted); cursor: default; }
.station-select .signal { flex-shrink: 0; color: var(--cyan); }
.station-select .row-text { min-width: 0; }
.station-select small { display: block; color: #c1b4d9; font-size: 11px; }
.station-select .bitrate { margin-inline-start: auto; color: #c1b4d9; white-space: nowrap; font-size: 11px; }
.favorite-toggle { --accent: var(--pink); padding: 0; color: #ddd0ef; font-size: 20px; }
.empty { color: var(--muted); padding: 9px; font-size: 13px; }
.now-playing { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px; padding: 10px 12px; background: #171127; border: 1px solid var(--line); border-radius: 10px; min-height: 45px; overflow-wrap: anywhere; }
.now-details { flex: 1 1 290px; min-width: 0; }
.track { color: #d5c9ec; margin-top: 3px; font-size: 13px; }
#status { margin: 0; color: #cabce3; font-size: 12px; }
.controls { display: flex; align-items: center; justify-content: space-between; gap: 8px 22px; margin-top: 10px; }
.transport, .volume { display: flex; align-items: center; gap: 8px; }
.wave, .play { display: grid; place-items: center; width: 44px; padding: 0; border-radius: 50%; font-size: 18px; }
.play { width: 55px; height: 55px; background: linear-gradient(145deg, #168eb3, #5e3cad 75%); border-color: #8adff4; box-shadow: 0 2px 16px #26c2f047, inset 0 0 10px #b4ecf433; }
.play-icon, .skip-icon::before { display: block; width: 0; height: 0; border-block: 7px solid transparent; border-left: 11px solid currentColor; }
.play.requested .play-icon { width: 12px; height: 14px; border: 0; border-inline: 4px solid currentColor; }
.skip-icon { position: relative; display: flex; align-items: center; gap: 2px; }
.skip-icon::before { content: ""; border-block-width: 5px; border-left-width: 8px; }
.skip-icon::after { content: ""; width: 2px; height: 10px; border-radius: 1px; background: currentColor; }
#previous .skip-icon { transform: scaleX(-1); }
.volume { width: min(420px, 55%); color: #d5c9ec; font-size: 12px; }
.volume input { flex: 1; min-width: 45px; height: 30px; cursor: pointer; }
.volume output { min-width: 31px; text-align: end; }
.footer { border-top: 1px solid #382a50; color: #bcafd1; padding: 16px 0; font-size: 12px; }
@media (max-width: 720px) {
  .genre-menu { grid-template-columns: repeat(3,minmax(0,1fr)); }
  main { padding-block: 15px; }
}
@media (max-width: 510px) {
  .shell { width: calc(100% - 20px); }
  .radio { border-radius: 14px; }
  .artwork { display: none; }
  .retro-layout { display: block; }
  .band-menu small { display: block; margin: 2px 0 0; }
  .controls { flex-wrap: wrap; justify-content: center; }
  .volume { width: 100%; }
  .station-select .bitrate { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .deck, button { transition: none; }
  .ripple, .radio.is-playing.visualize .equalizer i { animation: none; }
  .ripple { display: none; }
}
