:root {
  color-scheme: dark;
  --bg: #050711;
  --panel: rgba(12, 16, 35, 0.86);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --text: #f5f7ff;
  --muted: #969eb6;
  --accent: #29dcff;
  --accent-2: #8057ff;
  --accent-3: #e05bff;
  --line: rgba(255, 255, 255, 0.1);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.46);
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--bg); }

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 12%, rgba(0, 194, 255, 0.18), transparent 31rem),
    radial-gradient(circle at 88% 18%, rgba(183, 73, 255, 0.2), transparent 34rem),
    radial-gradient(circle at 54% 88%, rgba(59, 75, 255, 0.11), transparent 30rem),
    linear-gradient(145deg, #03040a 0%, #080d21 55%, #090511 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.38;
  background-image:
    radial-gradient(circle, rgba(255,255,255,.42) 0 1px, transparent 1.5px),
    linear-gradient(rgba(255,255,255,.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.014) 1px, transparent 1px);
  background-size: 89px 89px, 48px 48px, 48px 48px;
  background-position: 11px 7px, 0 0, 0 0;
  mask-image: linear-gradient(to bottom, black, transparent 90%);
}

button, input { font: inherit; }

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0 28px;
  position: relative;
}

.brand { display: flex; align-items: center; gap: 16px; margin-bottom: 24px; }

.brand-logo { width: 78px; height: 78px; object-fit: contain; flex: 0 0 auto; filter: drop-shadow(0 8px 19px rgba(33, 183, 255, .2)); }
.brand-copy { min-width: 0; }

.eyebrow, .section-label {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand h1 { margin: 0; font-size: clamp(1.55rem, 4vw, 2.1rem); line-height: 1; letter-spacing: -0.045em; }
.tagline { margin: 5px 0 0; color: var(--muted); font-size: 0.9rem; }

.live-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border: 1px solid rgba(41,220,255,.28);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(41,220,255,.08);
  font-size: .72rem;
  font-weight: 850;
  letter-spacing: .14em;
}

.live-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px rgba(41,220,255,.11); animation: pulse 1.8s infinite; }

.player-card {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  min-height: 490px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.artwork {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 45%, rgba(40, 137, 255, .23), transparent 43%),
    radial-gradient(circle at 72% 26%, rgba(216, 78, 255, .2), transparent 34%),
    linear-gradient(145deg, #071426, #110a2a 68%, #060a18);
}

.artwork::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(to top, rgba(5,7,17,.48), transparent 48%); }
.orb { position: absolute; border-radius: 50%; filter: blur(2px); }
.orb-one { width: 300px; height: 300px; left: -110px; top: -65px; background: radial-gradient(circle at 60% 60%, rgba(22,207,255,.58), rgba(22,207,255,.02) 70%); }
.orb-two { width: 330px; height: 330px; right: -140px; bottom: -105px; background: radial-gradient(circle at 35% 35%, rgba(206,80,255,.58), rgba(140,115,255,.02) 68%); }

.hero-logo {
  position: relative;
  z-index: 2;
  width: min(400px, 84%);
  height: auto;
  object-fit: contain;
  transform: translateY(-24px);
  filter: drop-shadow(0 28px 45px rgba(0,0,0,.55)) drop-shadow(0 0 28px rgba(71,128,255,.2));
  transition: transform .5s ease, filter .5s ease;
}

body.is-playing .hero-logo { transform: translateY(-28px) scale(1.015); filter: drop-shadow(0 32px 50px rgba(0,0,0,.58)) drop-shadow(0 0 40px rgba(71,128,255,.36)); }

.starfield { position: absolute; z-index: 1; inset: 5% 5% 22%; pointer-events: none; }
.starfield span { position: absolute; width: 4px; height: 4px; border-radius: 50%; background: #fff; box-shadow: 0 0 8px 2px rgba(117,220,255,.55); opacity: .5; animation: star-twinkle 3.8s ease-in-out infinite, star-drift 11s ease-in-out infinite alternate; }
.starfield span::before, .starfield span::after { content: ""; position: absolute; inset: 50% auto auto 50%; background: currentColor; transform: translate(-50%, -50%); opacity: .55; }
.starfield span::before { width: 11px; height: 1px; }
.starfield span::after { width: 1px; height: 11px; }
.starfield span:nth-child(1) { left: 8%; top: 18%; color: #b9f6ff; animation-delay: -1.2s, -3s; }
.starfield span:nth-child(2) { left: 20%; top: 7%; width: 3px; height: 3px; color: #fff; animation-delay: -2.8s, -6s; }
.starfield span:nth-child(3) { left: 35%; top: 24%; color: #cbbcff; animation-delay: -.4s, -8s; }
.starfield span:nth-child(4) { right: 24%; top: 9%; width: 5px; height: 5px; color: #8deaff; animation-delay: -3.1s, -1s; }
.starfield span:nth-child(5) { right: 8%; top: 28%; color: #f3a7ff; animation-delay: -1.8s, -5s; }
.starfield span:nth-child(6) { left: 10%; top: 57%; width: 3px; height: 3px; color: #fff; animation-delay: -3.5s, -9s; }
.starfield span:nth-child(7) { left: 28%; top: 70%; color: #89dcff; animation-delay: -.9s, -2s; }
.starfield span:nth-child(8) { right: 32%; top: 66%; width: 3px; height: 3px; color: #d2c5ff; animation-delay: -2.1s, -7s; }
.starfield span:nth-child(9) { right: 11%; top: 59%; color: #ff9ee8; animation-delay: -1.4s, -4s; }
.starfield span:nth-child(10) { left: 44%; top: 5%; width: 2px; height: 2px; color: #fff; animation-delay: -3.7s, -8s; }
.starfield span:nth-child(11) { left: 3%; top: 40%; width: 2px; height: 2px; color: #a1eeff; animation-delay: -2.4s, -5s; }
.starfield span:nth-child(12) { right: 3%; top: 44%; width: 3px; height: 3px; color: #b8a6ff; animation-delay: -.6s, -9s; }
.starfield span:nth-child(13) { left: 48%; top: 78%; width: 2px; height: 2px; color: #fff; animation-delay: -3.3s, -3s; }
.starfield span:nth-child(14) { right: 46%; top: 36%; width: 3px; height: 3px; color: #f2a4ff; animation-delay: -1.6s, -6s; }

.audio-meter {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: min(88%, 390px);
  height: 82px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  padding: 13px 16px 10px;
  border: 1px solid rgba(95,213,255,.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8,14,35,.18), rgba(4,8,23,.72));
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 14px 35px rgba(0,0,0,.22);
  pointer-events: none;
  overflow: hidden;
}
.audio-meter::after { content: ""; position: absolute; inset: auto 10% 7px; height: 1px; background: linear-gradient(90deg, transparent, rgba(71,224,255,.5), rgba(197,84,255,.5), transparent); }
.audio-meter span {
  --level: .1;
  flex: 1 1 0;
  max-width: 10px;
  min-width: 3px;
  height: 100%;
  border-radius: 5px 5px 2px 2px;
  background: linear-gradient(to top, #24d9ff 0%, #5a9dff 35%, #9b65ff 68%, #f05bda 100%);
  box-shadow: 0 0 calc(5px + 8px * var(--level)) rgba(88,178,255,.6);
  opacity: calc(.28 + var(--level) * .72);
  transform: scaleY(var(--level));
  transform-origin: bottom;
  transition: transform 70ms linear, opacity 120ms ease, box-shadow 120ms ease;
}
.audio-meter span:nth-child(3n+2) { filter: hue-rotate(12deg); }
.audio-meter span:nth-child(4n) { filter: hue-rotate(-12deg); }

.now-playing { display: flex; flex-direction: column; padding: clamp(34px, 6vw, 64px); }
.track-heading {
  display: grid;
  justify-items: center;
  align-self: flex-start;
  width: fit-content;
  max-width: 100%;
  margin-top: 18px;
}
.now-playing h2 { width: fit-content; max-width: 15ch; min-height: 2.3em; margin: 0; font-size: clamp(2rem, 5vw, 3.6rem); line-height: 1.03; letter-spacing: -0.055em; text-wrap: balance; }
.artist { margin: 0; color: var(--muted); font-size: 1.05rem; }
.dj-sky {
  position: relative;
  isolation: isolate;
  width: fit-content;
  margin-top: 8px;
  padding: .3em .68em;
  border-radius: 999px;
  color: transparent;
  font-family: inherit;
  font-size: clamp(1.3rem, 2.75vw, 1.58rem);
  font-weight: 800;
  font-style: normal;
  line-height: 1;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #51f3ff 0%, #418cff 34%, #9d6cff 67%, #ef5cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 14px rgba(81,243,255,.25), 0 0 22px rgba(157,108,255,.2);
}
.dj-sky::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1.5px;
  border-radius: inherit;
  background: linear-gradient(105deg, #51f3ff 0%, #418cff 34%, #9d6cff 67%, #ef5cff 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
}
.controls { display: flex; align-items: center; gap: 25px; margin-top: auto; padding-top: 35px; }

.play-button {
  flex: 0 0 auto;
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #091018;
  background: var(--accent);
  background: linear-gradient(145deg, var(--accent), #55a8ff);
  box-shadow: 0 12px 35px rgba(41,220,255,.26);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}
.play-button:hover { transform: scale(1.04); box-shadow: 0 15px 42px rgba(41,220,255,.38); }
.play-button:focus-visible { outline: 3px solid white; outline-offset: 4px; }
.play-icon { width: 0; height: 0; margin-left: 5px; border-top: 11px solid transparent; border-bottom: 11px solid transparent; border-left: 17px solid currentColor; }
.play-button[aria-pressed="true"] .play-icon { width: 18px; height: 22px; margin: 0; border: 0; background: linear-gradient(90deg, currentColor 0 35%, transparent 35% 65%, currentColor 65%); }

.volume-wrap { flex: 1; min-width: 0; }
.volume-wrap label { display: block; margin-bottom: 10px; color: var(--muted); font-size: .72rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.volume-row { display: flex; align-items: center; gap: 10px; }
.volume-row input { width: 100%; accent-color: var(--accent); cursor: pointer; }
.volume-row output { min-width: 39px; color: var(--muted); font-variant-numeric: tabular-nums; font-size: .78rem; text-align: right; }
.status-line { display: flex; justify-content: space-between; gap: 12px; margin-top: 30px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.connection { display: flex; align-items: center; gap: 8px; }
.connection i { width: 7px; height: 7px; border-radius: 50%; background: #f4ba64; }
.connection.connected i { background: var(--accent); }
.connection.error i { background: #ff6f7d; }

.history-card { margin-top: 20px; padding: 26px 30px; border: 1px solid var(--line); border-radius: 24px; background: rgba(19,24,39,.62); backdrop-filter: blur(18px); }
.history-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; }
.history-heading h2 { margin: 4px 0 0; font-size: 1.3rem; letter-spacing: -.025em; }
.history-heading > span { color: var(--muted); font-size: .76rem; }
.history-list { margin: 22px 0 0; padding: 0; list-style: none; }
.history-list li:not(.empty) { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); }
.history-list li::before { content: counter(list-item, decimal-leading-zero); color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.history-track strong { display: block; font-size: .9rem; font-weight: 680; }
.history-track span, .history-time, .empty { color: var(--muted); font-size: .78rem; }
.empty { padding: 16px 0 5px; }
.empty::before { display: none; }

footer { display: flex; justify-content: center; gap: 10px; padding-top: 28px; color: #697188; font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; }
footer .dot { color: var(--accent); }

@keyframes pulse { 50% { opacity: .45; transform: scale(.82); } }
@keyframes star-twinkle { 0%, 100% { opacity: .22; transform: scale(.72); } 48% { opacity: .95; transform: scale(1.22); } 62% { opacity: .62; transform: scale(.92); } }
@keyframes star-drift { to { margin: 7px 0 0 5px; } }

@media (max-width: 760px) {
  .shell { width: min(100% - 20px, 620px); padding-top: 22px; }
  .brand { gap: 12px; }
  .brand-logo { width: 62px; height: 62px; }
  .eyebrow { display: none; }
  .live-pill { padding: 7px 10px; font-size: .64rem; }
  .player-card { grid-template-columns: 1fr; border-radius: 24px; }
  .artwork { min-height: 310px; }
  .hero-logo { width: min(340px, 82%); transform: translateY(-20px); }
  body.is-playing .hero-logo { transform: translateY(-23px) scale(1.012); }
  .audio-meter { bottom: 12px; width: 88%; height: 65px; gap: 3px; padding: 10px 12px 8px; border-radius: 15px; }
  .starfield { inset: 4% 4% 23%; }
  .now-playing { min-height: 400px; padding: 32px 26px; }
  .track-heading { margin-top: 14px; }
  .now-playing h2 { min-height: 0; max-width: none; }
  .controls { margin-top: 34px; }
  .play-button { width: 68px; height: 68px; }
  .history-card { padding: 22px 20px; border-radius: 20px; }
}

@media (max-width: 430px) {
  .tagline { font-size: .78rem; }
  .artwork { min-height: 270px; }
  .hero-logo { width: min(310px, 88%); }
  .audio-meter { height: 58px; gap: 2px; padding-inline: 10px; }
  .audio-meter span:nth-child(3n) { display: none; }
  .starfield span:nth-child(n+11) { display: none; }
  .now-playing { min-height: 365px; }
  .now-playing h2 { font-size: 2rem; }
  .status-line { flex-direction: column; }
  .history-list li:not(.empty) { grid-template-columns: 23px 1fr; }
  .history-time { display: none; }
  footer { flex-wrap: wrap; line-height: 1.7; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; }
  .starfield span { opacity: .42; }
  .audio-meter span { transition-duration: 180ms; }
}
