:root {
  color-scheme: dark;
  --bg: #10151f;
  --panel: rgba(23, 30, 43, 0.82);
  --panel-strong: rgba(32, 41, 56, 0.8);
  --ink: #f8fbff;
  --muted: #93a0b3;
  --line: #303b4d;
  --accent: #72f0d1;
  --accent-soft: #153d37;
  --like: #55d98b;
  --dislike: #ff788a;
  font-family: Inter, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: var(--bg);
  color: var(--ink);
  position: fixed;
  inset: 0;
  touch-action: manipulation;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: url("/static/logo-watermark.svg?v=20260610-5") center / min(82vw, 460px) auto no-repeat;
  opacity: 0.09;
  filter: saturate(1.05);
}

button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

button:focus-visible {
  outline: 3px solid rgba(114, 240, 209, 0.42);
  outline-offset: 4px;
}

.shell {
  position: relative;
  z-index: 1;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  padding: max(18px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.splash,
.player {
  width: min(100%, 560px);
  margin: 0 auto;
}

.splash {
  min-height: calc(100dvh - 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  text-align: center;
  transition: opacity 420ms ease, transform 420ms ease, filter 420ms ease;
}

.splash.leaving {
  opacity: 0;
  transform: scale(1.04);
  filter: blur(10px);
}

.splash-copy {
  display: grid;
  gap: 10px;
  justify-items: center;
}

.brand-logo {
  display: block;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 22px rgba(0, 0, 0, 0.22));
}

.splash-brand-logo {
  width: min(46vw, 190px);
  margin-bottom: 2px;
}

.header-brand-logo {
  width: 78px;
  height: 70px;
  object-position: left center;
}

.splash-copy h1 {
  margin: 0;
  font-size: clamp(2.1rem, 10vw, 4.25rem);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.splash-note {
  margin: 0;
  max-width: 22rem;
  color: rgba(248, 251, 255, 0.72);
  font-size: 0.96rem;
  line-height: 1.45;
}

.splash-visual {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  align-items: end;
  gap: 6px;
  width: min(240px, 72vw);
  height: 44px;
}

.splash-visual span {
  height: 100%;
  border-radius: 999px;
  background: var(--accent);
  opacity: 0.9;
  transform-origin: center bottom;
  animation: splash-wave 900ms ease-in-out infinite;
}

.splash-visual span:nth-child(1) { animation-delay: 0ms; height: 34%; }
.splash-visual span:nth-child(2) { animation-delay: 70ms; height: 58%; }
.splash-visual span:nth-child(3) { animation-delay: 150ms; height: 42%; }
.splash-visual span:nth-child(4) { animation-delay: 220ms; height: 76%; }
.splash-visual span:nth-child(5) { animation-delay: 120ms; height: 48%; }
.splash-visual span:nth-child(6) { animation-delay: 200ms; height: 64%; }
.splash-visual span:nth-child(7) { animation-delay: 40ms; height: 28%; }

@keyframes splash-wave {
  0%, 100% { transform: scaleY(0.42); opacity: 0.45; }
  40% { transform: scaleY(1.05); opacity: 1; }
}

.start-button {
  min-width: min(100%, 240px);
  min-height: 52px;
  border: 1px solid rgba(114, 240, 209, 0.42);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(33, 54, 63, 0.95), rgba(20, 29, 36, 0.95));
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.start-button:active {
  transform: translateY(1px);
}

.player {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 0;
}

.station-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px 10px;
}

.station-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.track-row p,
.credit {
  margin: 0;
  color: var(--muted);
}

.live-badge {
  border: 1px solid rgba(255, 120, 138, 0.38);
  border-radius: 999px;
  color: var(--dislike);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
  background: rgba(23, 30, 43, 0.58);
  backdrop-filter: blur(14px);
}

.mute-button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 30, 43, 0.72);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  backdrop-filter: blur(14px);
}

.mute-button.active {
  background: #173e2a;
  border-color: rgba(85, 217, 139, 0.55);
  color: var(--like);
}

.mute-button svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-off {
  display: none;
}

.mute-button.active .sound-on {
  display: none;
}

.mute-button.active .sound-off {
  display: block;
}

.live-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--dislike);
  box-shadow: 0 0 0 5px rgba(255, 120, 138, 0.12);
}

.playlist {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1.35fr) minmax(0, 1fr);
  align-content: stretch;
  gap: 10px;
  min-height: 0;
}

.track-row {
  min-width: 0;
  padding: 17px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.track-row.previous,
.track-row.next {
  min-height: 0;
  height: 100%;
}

.track-row p {
  margin-bottom: 8px;
  font-size: 0.69rem;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.track-row h1,
.track-row h2 {
  margin: 0;
  overflow-wrap: anywhere;
  letter-spacing: 0;
  text-wrap: balance;
}

.track-row h2 {
  font-size: clamp(1rem, 5vw, 1.35rem);
  line-height: 1.2;
  color: #c5ceda;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.track-row.current {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
  min-height: 0;
  height: 100%;
  border-color: rgba(114, 240, 209, 0.42);
  background: var(--panel-strong);
  overflow: hidden;
}

.track-row.current p {
  color: var(--accent);
}

.track-row h1 {
  font-size: clamp(1.8rem, 8.3vw, 3.4rem);
  line-height: 0.96;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.music-thread {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  align-items: center;
  gap: 5px;
  height: 24px;
  margin-bottom: 16px;
}

.music-thread span {
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  animation: pulse 920ms ease-in-out infinite;
}

.music-thread span:nth-child(2) { animation-delay: 80ms; }
.music-thread span:nth-child(3) { animation-delay: 180ms; }
.music-thread span:nth-child(4) { animation-delay: 40ms; }
.music-thread span:nth-child(5) { animation-delay: 260ms; }
.music-thread span:nth-child(6) { animation-delay: 120ms; }
.music-thread span:nth-child(7) { animation-delay: 340ms; }
.music-thread span:nth-child(8) { animation-delay: 210ms; }
.music-thread span:nth-child(9) { animation-delay: 20ms; }

@keyframes pulse {
  0%, 100% { transform: scaleY(0.25); opacity: 0.45; }
  40% { transform: scaleY(2.1); opacity: 1; }
}

.station-switch {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.station-toggle {
  width: min(100%, 420px);
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(23, 30, 43, 0.72);
  color: var(--muted);
  backdrop-filter: blur(14px);
  padding: 4px;
  position: relative;
  overflow: hidden;
}

.station-toggle-track {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  height: 52px;
}

.station-toggle-label {
  position: relative;
  z-index: 1;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: center;
  padding: 0 10px;
  transition: color 180ms ease;
}

.station-toggle-thumb {
  position: absolute;
  top: 0;
  left: 4px;
  width: calc(50% - 8px);
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(33, 54, 63, 0.98), rgba(20, 29, 36, 0.98));
  border: 1px solid rgba(114, 240, 209, 0.34);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  transition: transform 220ms ease;
}

.station-toggle[data-station="atlas-ramp"] .station-toggle-thumb {
  transform: translateX(calc(100% + 8px));
}

.station-toggle[data-station="pure-shower"] .station-toggle-label.left,
.station-toggle[data-station="atlas-ramp"] .station-toggle-label.right {
  color: var(--ink);
}

.credit {
  padding-top: 10px;
  font-size: 0.68rem;
  text-align: center;
}

@media (max-width: 430px) {
  .shell {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
  }

  .splash,
  .player {
    width: 100%;
  }

  .station-header {
    gap: 12px;
    padding-bottom: 8px;
  }

  .station-actions {
    gap: 8px;
  }

  .header-brand-logo {
    width: 66px;
    height: auto;
  }

  .mute-button {
    width: 40px;
    height: 40px;
  }

  .live-badge {
    padding: 6px 10px;
    font-size: 0.67rem;
    gap: 6px;
  }

  .track-row {
    padding: 13px 14px;
  }

  .track-row p {
    margin-bottom: 5px;
    font-size: 0.62rem;
    letter-spacing: 0.1em;
  }

  .track-row.previous,
  .track-row.next {
    min-height: 0;
  }

  .track-row.current {
    min-height: 0;
  }

  .track-row h1 {
    font-size: clamp(1.42rem, 6.8vw, 2.2rem);
    line-height: 0.98;
  }

  .track-row h2 {
    font-size: clamp(0.86rem, 4.4vw, 1.02rem);
  }

  .music-thread {
    height: 20px;
    gap: 4px;
    margin-bottom: 14px;
  }

  .music-thread span {
    height: 7px;
  }

  .station-switch {
    padding-top: 8px;
  }

  .station-toggle {
    min-height: 50px;
  }

  .station-toggle-track {
    height: 42px;
  }

  .station-toggle-label {
    font-size: 0.63rem;
  }

  .credit {
    padding-top: 6px;
    font-size: 0.6rem;
  }
}

@media (max-height: 720px) {
  .track-row h1 {
    font-size: clamp(1.55rem, 7.4vw, 2.7rem);
  }
}
