:root {
  --ink: #0a0a0c;
  --text: #f7f5f1;
  --muted: rgba(247, 245, 241, 0.66);
  --muted-2: rgba(247, 245, 241, 0.4);
  --accent: #ff9c5b;
  --accent-deep: #d9722f;
  --live: #5be8b0;
  --danger: #ff7a6b;
  --font-display: "Fraunces", serif;
  --font-body: "Inter", sans-serif;
  --font-mono: "JetBrains Mono", monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(120% 100% at 50% 0%, #2a1f17 0%, var(--ink) 62%);
  color: var(--text);
  font-family: var(--font-body);
  overflow-x: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ------------------------------------------------------------------ */
/* Ambiance plein écran : la pochette du morceau, floutée, devient le  */
/* décor de toute la page — elle change de couleur à chaque morceau.   */
/* ------------------------------------------------------------------ */
.atmosphere {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.atmosphere__layer {
  position: absolute;
  inset: -12%;
  width: 124%;
  height: 124%;
  object-fit: cover;
  filter: blur(64px) saturate(1.35) brightness(0.5);
  opacity: 0;
  transition: opacity 1.6s ease;
  will-change: opacity;
}

.atmosphere__layer.is-active { opacity: 1; }

.atmosphere__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(130% 85% at 50% 16%, rgba(10,10,12,0.08), rgba(10,10,12,0.74) 68%),
    linear-gradient(180deg, rgba(10,10,12,0.6) 0%, rgba(10,10,12,0.18) 26%, rgba(10,10,12,0.42) 70%, rgba(10,10,12,0.92) 100%);
}

/* ------------------------------------------------------------------ */
/* Composition                                                        */
/* ------------------------------------------------------------------ */
.stage {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(22px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  text-align: center;
}

.stage__top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

.live-pill__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--danger);
}

.live-pill[data-state="on"] .live-pill__dot {
  background: var(--live);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91,232,176,0.55); }
  50% { box-shadow: 0 0 0 5px rgba(91,232,176,0); }
}

.live-pill__label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-pill[data-state="on"] .live-pill__label { color: var(--live); }

.stage__station {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  max-width: 55%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stage__center {
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.cover {
  position: relative;
  width: min(70vw, 296px);
  height: min(70vw, 296px);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(255,255,255,0.10), rgba(255,255,255,0.02));
  box-shadow:
    0 32px 64px -20px rgba(0,0,0,0.6),
    0 0 0 1px rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 30px;
  transition: box-shadow 0.6s ease;
}

.stage.is-playing .cover {
  animation: breathe 4s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% {
    box-shadow: 0 32px 64px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08), 0 0 0 0 rgba(255,156,91,0);
  }
  50% {
    box-shadow: 0 32px 64px -20px rgba(0,0,0,0.6), 0 0 0 1px rgba(255,255,255,0.08), 0 0 46px 6px rgba(255,156,91,0.3);
  }
}

.cover__placeholder {
  position: absolute;
  width: 58px;
  height: 58px;
  fill: rgba(255,255,255,0.22);
}

.cover__img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.cover__img.is-loaded { opacity: 1; }

.stage__eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}

.stage__title {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-weight: 600;
  font-size: clamp(26px, 6.4vw, 38px);
  line-height: 1.14;
  margin: 0 0 8px;
  color: var(--text);
  max-width: 94%;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.stage__artist {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--muted);
  margin: 0 0 34px;
  max-width: 88%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.play {
  position: relative;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(150deg, var(--accent), var(--accent-deep));
  color: #1c0f06;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    0 16px 32px -10px rgba(255,156,91,0.55),
    inset 0 1px 0 rgba(255,255,255,0.3);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.play:hover { transform: translateY(-2px) scale(1.02); }
.play:active { transform: translateY(0) scale(0.97); }
.play:focus-visible { outline: 2px solid var(--text); outline-offset: 5px; }

.play::before {
  content: "";
  position: absolute;
  inset: -10px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,156,91,0.5);
  opacity: 0;
}

.stage.is-playing .play::before {
  animation: ping 2.4s ease-out infinite;
}

@keyframes ping {
  0% { transform: scale(0.92); opacity: 0.7; }
  100% { transform: scale(1.35); opacity: 0; }
}

.play__icon { width: 30px; height: 30px; fill: currentColor; }
.play__icon--stop { display: none; }
.play[data-state="playing"] .play__icon--play { display: none; }
.play[data-state="playing"] .play__icon--stop { display: block; }

.stage__status {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted-2);
  min-height: 14px;
  margin: 0;
}

.stage__status[data-tone="error"] { color: var(--danger); }
.stage__status[data-tone="ok"] { color: var(--live); }

@media (max-width: 340px) {
  .cover { width: 78vw; height: 78vw; }
}
