* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  background: transparent;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Rajdhani', sans-serif;
}

:root {
  --c-viewer: #22d3ee;
  --c-subscriber: #7dd3fc;
  --c-vip: #60a5fa;
  --c-moderator: #34d1c9;
  --c-headmod: #22c55e;
  --c-bot: #94a3b8;
  --c-broadcaster: #c084fc;
  --c-mention: #4dabff;
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
}

.bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Coordonnées mesurées par analyse de pixels sur background.png (1670×942) ── */

/* Titre/artiste Spotify — le cadre, le logo, l'icône note, "En écoute..." et les barres sont
   déjà dessinés dans background.png ; on ne remplace que ces deux lignes de texte placeholder,
   avec un fond opaque dessous pour couvrir le texte d'origine. */
/* Un seul fond derrière titre + artiste + barres, pour ne pas laisser de trous entre les patchs
   individuels (les anciennes barres/texte du fond ne doivent jamais réapparaître). */
.spotify-backdrop {
  position: absolute;
  left: 84.19%;
  width: 13.42%;
  top: 11.25%;
  height: 5.10%;
  background: rgb(2,13,44);
}

.spotify-patch {
  position: absolute;
  left: 84.19%;
  width: 13.42%;
  background: transparent;
  display: flex;
  align-items: center;
  overflow: hidden;
}
#spotifyTitlePatch { top: 11.1%;  height: 2.5%; }
#spotifyArtistPatch { top: 13.1%; height: 2.5%; }

#spotifyTitle {
  font-size: 1.05vw; font-weight: 800; color: #fff; letter-spacing: .01em;
  text-shadow: 0 0 6px rgba(96,165,250,.5);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}
#spotifyArtist {
  font-size: 0.85vw; font-weight: 700; color: #bfe0ff; letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%;
}

/* Pochette d'album — remplace l'icône note dessinée dans le fond quand une pochette existe. */
.spotify-art-box {
  position: absolute;
  left: 80.0%;
  top: 10.08%;
  width: 3.47%;
  height: 6.16%;
  background: rgb(2,13,44);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
#spotifyArt { width: 100%; height: 100%; object-fit: cover; }
#spotifyArtFallback { width: 55%; height: 55%; color: #60a5fa; }

/* Barres Spotify — pas un égaliseur qui saute dans tous les sens : une ligne de progression du
   morceau (rempli = déjà joué), qui avance de gauche à droite et revient à zéro au morceau suivant. */
.spotify-bars {
  position: absolute;
  left: 86.53%;
  top: 14.44%;
  width: 9.58%;
  height: 1.91%;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  background: transparent;
}
.spotify-bars .bar {
  flex: 1;
  min-width: 0;
  border-radius: 1px;
  background: rgba(59,130,246,.28);
  transition: background .2s linear;
  transform-origin: bottom;
  animation-name: bar-bounce;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
  animation-play-state: paused;
}
.spotify-bars.playing .bar { animation-play-state: running; }
.spotify-bars .bar.filled {
  background: #60a5fa;
  box-shadow: 0 0 3px rgba(96,165,250,.7);
}
@keyframes bar-bounce {
  from { transform: scaleY(0.55); }
  to   { transform: scaleY(1.25); }
}

.chat-frame {
  position: absolute;
  left: 75.33%;
  top: 25.16%;
  width: 22.87%;
  height: 59.02%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  padding: 14px 18px;
  overflow: hidden;
}

.stat {
  position: absolute;
  top: 88.7%;
  height: 7.3%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  padding-left: 8.5%;
  color: #fff;
}

.stat-follower { left: 20.8%; width: 17.8%; }
.stat-sub      { left: 41%;   width: 17.5%; }
.stat-cheer    { left: 61.3%; width: 17.4%; }

.stat-label {
  font-size: 0.85vw;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: rgba(255,255,255,.85);
  text-shadow: 0 0 6px rgba(0,0,0,.6);
}

.stat-value {
  font-size: 1.25vw;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0 8px rgba(43,127,255,.6);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Chat custom (HUD, fond transparent, pas de bulle) ── */

.chat-msg {
  opacity: 0;
  transform: translateX(28px);
  animation: chatPop .5s ease forwards;
}

@keyframes chatPop {
  0%   { opacity: 0; transform: translateX(30px); filter: brightness(1); }
  55%  { opacity: 1; transform: translateX(-3px); filter: brightness(1.7); }
  100% { opacity: 1; transform: translateX(0);    filter: brightness(1); }
}

.chat-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  line-height: 1.35;
}

.chat-name {
  font-weight: 800;
  font-size: 1vw;
  letter-spacing: .01em;
  text-shadow: 0 0 8px currentColor;
  white-space: nowrap;
}

.chat-role-badge {
  margin-right: 2px;
  font-size: 0.9em;
}

.chat-sep {
  color: rgba(255,255,255,.35);
  font-size: .8vw;
}

.chat-text {
  color: #eaf6ff;
  font-size: 0.95vw;
  font-weight: 600;
  text-shadow: 0 0 6px rgba(80,180,255,.35);
  word-break: break-word;
}

.chat-mention .chat-text { color: #cfeaff; }

.chat-msg.role-bot .chat-text { font-style: italic; opacity: .8; }
.chat-msg.role-bot .chat-name { text-shadow: none; }

.chat-msg.role-headmod .chat-name { text-shadow: 0 0 10px currentColor, 0 0 2px #fff; }
.chat-mention-word {
  color: var(--c-mention);
  font-weight: 800;
  text-shadow: 0 0 10px var(--c-mention);
}

.chat-emote {
  height: 1.5em;
  vertical-align: middle;
  margin: 0 2px;
}
