:root {
  color-scheme: dark;
  --pink: #ff4295;
  --pink-soft: #d82f78;
  --ink: #16070e;
  --panel: rgba(27, 8, 16, 0.94);
  --panel-2: rgba(20, 5, 12, 0.82);
  --text: #f4eaf0;
  --muted: #8e747f;
  --line: rgba(255, 255, 255, 0.07);
}

* { box-sizing: border-box; }

html, body { min-height: 100%; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 25%, rgba(153, 29, 80, 0.42), transparent 38%),
    radial-gradient(circle at 83% 78%, rgba(111, 17, 61, 0.34), transparent 35%),
    linear-gradient(135deg, #35101e 0%, #19080f 48%, #3a1023 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 18px;
}

.player-card {
  position: relative;
  width: min(760px, 100%);
  padding: 44px 54px 28px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 18px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.025), transparent 34%),
    var(--panel);
  box-shadow:
    0 42px 90px rgba(0, 0, 0, 0.52),
    0 0 52px rgba(255, 49, 137, 0.07),
    inset 0 1px rgba(255, 255, 255, 0.025);
  backdrop-filter: blur(20px);
}

.brand { text-align: center; margin-bottom: 42px; }
.brand-name { font-size: 25px; letter-spacing: 0.36em; font-weight: 300; }
.brand-tagline { margin-top: 5px; font-size: 8px; letter-spacing: 0.42em; color: #79646e; }
.eyebrow { color: var(--pink); font-size: 10px; letter-spacing: 0.3em; text-align: center; }

h1 {
  margin: 15px auto 8px;
  max-width: 590px;
  text-align: center;
  font-size: clamp(22px, 4vw, 34px);
  line-height: 1.15;
  letter-spacing: 0.075em;
  font-weight: 480;
}

.subtitle {
  margin: 0 auto;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.visualizer {
  height: 58px;
  margin: 23px auto 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.visualizer i {
  display: block;
  width: 3px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(to top, #9f1f59, #ff5aaa);
  box-shadow: 0 0 12px rgba(255, 66, 149, 0.35);
  animation: pulse 1.15s ease-in-out infinite alternate;
  transform-origin: center;
}

.visualizer i:nth-child(2n) { animation-delay: -0.42s; }
.visualizer i:nth-child(3n) { animation-delay: -0.77s; }
.visualizer i:nth-child(5n) { animation-delay: -0.21s; }
body.paused .visualizer i { animation-play-state: paused; height: 4px; opacity: 0.45; }

@keyframes pulse {
  from { height: 5px; opacity: 0.45; }
  to { height: 45px; opacity: 1; }
}

.timeline-wrap { padding: 4px 0 0; }

.timeline {
  --progress: 0%;
  width: 100%;
  height: 5px;
  appearance: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(to right, var(--pink) var(--progress), rgba(255,255,255,0.085) var(--progress));
  outline: none;
}

.timeline::-webkit-slider-thumb {
  appearance: none;
  width: 15px;
  height: 15px;
  border: 3px solid #220a14;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 16px rgba(255, 66, 149, 0.8);
}
.timeline::-moz-range-thumb {
  width: 10px;
  height: 10px;
  border: 3px solid #220a14;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 16px rgba(255, 66, 149, 0.8);
}

.time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  color: #8b737e;
  font-size: 10px;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.controls {
  display: grid;
  grid-template-columns: 58px 1fr 112px;
  gap: 12px;
  align-items: center;
  margin-top: 27px;
}

button, input { font: inherit; }
button { border: 0; }

.control-button,
.join-button,
.volume-box {
  min-height: 52px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.control-button {
  color: var(--pink);
  cursor: pointer;
  font-size: 18px;
  transition: transform 160ms ease, background 160ms ease;
}
.control-button:hover { transform: translateY(-1px); background: rgba(45, 10, 26, 0.95); }

.join-button {
  cursor: pointer;
  color: #17050d;
  font-size: 11px;
  font-weight: 760;
  letter-spacing: 0.29em;
  background: linear-gradient(100deg, #ff3890, #ff5aaa);
  box-shadow: 0 0 24px rgba(255, 56, 144, 0.28);
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}
.join-button:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 0 34px rgba(255, 56, 144, 0.4); }
.join-button.active {
  color: #eab8ce;
  background: rgba(36, 8, 20, 0.95);
  box-shadow: inset 0 0 0 1px rgba(255, 66, 149, 0.16);
}

.volume-box {
  padding: 9px 12px;
  display: grid;
  align-content: center;
  gap: 7px;
  color: #7d6570;
  font-size: 8px;
  letter-spacing: 0.18em;
}
.volume-box input { width: 100%; accent-color: var(--pink); cursor: pointer; }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}

.stat {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 10px;
  background: rgba(17, 4, 10, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.025);
}
.stat.right { text-align: right; justify-content: flex-end; }
.stat strong { display: block; font-size: 18px; font-weight: 520; letter-spacing: 0.1em; }
.stat small { display: block; margin-top: 6px; color: #735e68; font-size: 8px; letter-spacing: 0.18em; }

.status-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 14px rgba(255, 66, 149, 0.95);
}
.status-dot.small { width: 6px; height: 6px; }

footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 28px;
  color: #6d5962;
  font-size: 8px;
  letter-spacing: 0.18em;
}

.offline .status-dot { background: #84505f; box-shadow: none; }
.offline #networkStatus { color: #9d6c7b; }

@media (max-width: 650px) {
  .player-card { padding: 34px 20px 24px; border-radius: 14px; }
  .brand { margin-bottom: 32px; }
  .controls { grid-template-columns: 52px 1fr; }
  .volume-box { grid-column: 1 / -1; }
  .stats { grid-template-columns: 1fr; }
  .stat.right { text-align: left; justify-content: flex-start; }
}

/* v1.3 playlist selector */
.mix-picker {
  margin: 24px 0 4px;
  padding: 14px;
  border: 1px solid rgba(255, 66, 149, 0.13);
  border-radius: 11px;
  background:
    linear-gradient(120deg, rgba(255, 66, 149, 0.055), transparent 46%),
    rgba(15, 3, 9, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.018);
}

.mix-picker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 2px 9px;
  color: #8f707d;
  font-size: 8px;
  letter-spacing: 0.2em;
}

.mix-picker-head strong {
  color: var(--pink);
  font-size: 9px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mix-picker-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 122px;
  gap: 9px;
}

.select-shell {
  position: relative;
  min-width: 0;
}

.select-shell::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 15px;
  color: var(--pink);
  font-size: 15px;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-58%);
}

.mix-picker select,
.next-mix-button {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  border-radius: 8px;
  outline: none;
}

.mix-picker select {
  appearance: none;
  padding: 0 42px 0 14px;
  overflow: hidden;
  color: #eedde5;
  background: rgba(29, 7, 17, 0.95);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.075em;
  text-overflow: ellipsis;
  cursor: pointer;
}

.mix-picker select:focus {
  border-color: rgba(255, 66, 149, 0.48);
  box-shadow: 0 0 0 3px rgba(255, 66, 149, 0.08);
}

.mix-picker select option {
  color: #f4eaf0;
  background: #210a14;
}

.next-mix-button {
  color: #d795b2;
  background: rgba(37, 8, 21, 0.88);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, color 160ms ease;
}

.next-mix-button:hover:not(:disabled) {
  color: #ffd8e9;
  border-color: rgba(255, 66, 149, 0.34);
  transform: translateY(-1px);
}

.mix-picker select:disabled,
.next-mix-button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.mix-picker > small {
  display: block;
  margin: 9px 2px 0;
  color: #664f5a;
  font-size: 7px;
  letter-spacing: 0.13em;
}

@media (max-width: 650px) {
  .mix-picker-controls { grid-template-columns: 1fr; }
  .next-mix-button { height: 40px; }
}
