/* ======================================================
   VARIABLES & RESET
====================================================== */
:root {
  --bg:        #0a0a0f;
  --surface:   #13131c;
  --border:    #2a2a3d;
  --accent:    #e8ff57;       /* jaune-lime vif */
  --accent2:   #ff4fd8;       /* rose électrique */
  --text:      #f0f0f5;
  --muted:     #6b6b8a;
  --radius:    16px;
  --transition: 0.3s cubic-bezier(.4,0,.2,1);
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Space Mono', monospace;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-x: hidden;
}

/* ======================================================
   FOND ANIMÉ (grille + grain)
====================================================== */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(232,255,87,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232,255,87,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

/* ======================================================
   CARTE PRINCIPALE
====================================================== */
.card {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: clamp(2rem, 5vw, 3.5rem);
  width: 100%;
  max-width: 540px;
  box-shadow:
    0 0 0 1px rgba(232,255,87,.07),
    0 32px 80px rgba(0,0,0,.6),
    inset 0 1px 0 rgba(255,255,255,.05);
}

/* ======================================================
   EN-TÊTE
====================================================== */
.header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.badge {
  display: inline-block;
  font-family: 'Space Mono', monospace;
  font-size: .65rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 99px;
  padding: .25rem .8rem;
  margin-bottom: 1.2rem;
  opacity: .85;
}

h1 {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.1;
  letter-spacing: -.02em;
}

h1 span {
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin-top: .6rem;
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ======================================================
   VISUALISEUR D'ONDES (animation CSS)
====================================================== */
.visualizer {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
  height: 56px;
  margin: 2rem 0;
  opacity: 0;
  transition: opacity var(--transition);
}

.visualizer.active { opacity: 1; }

.bar {
  width: 4px;
  background: var(--accent);
  border-radius: 2px;
  animation: wave 1.2s ease-in-out infinite alternate;
}

.bar:nth-child(1)  { animation-delay: 0s;    height: 20%; }
.bar:nth-child(2)  { animation-delay: .1s;   height: 45%; }
.bar:nth-child(3)  { animation-delay: .2s;   height: 70%; }
.bar:nth-child(4)  { animation-delay: .05s;  height: 55%; }
.bar:nth-child(5)  { animation-delay: .3s;   height: 90%; }
.bar:nth-child(6)  { animation-delay: .15s;  height: 65%; }
.bar:nth-child(7)  { animation-delay: .25s;  height: 40%; }
.bar:nth-child(8)  { animation-delay: .08s;  height: 80%; }
.bar:nth-child(9)  { animation-delay: .35s;  height: 30%; }
.bar:nth-child(10) { animation-delay: .18s;  height: 60%; }
.bar:nth-child(11) { animation-delay: .28s;  height: 75%; }
.bar:nth-child(12) { animation-delay: .12s;  height: 50%; }

@keyframes wave {
  0%   { transform: scaleY(.3); opacity: .6; }
  100% { transform: scaleY(1);  opacity: 1;  }
}

/* ======================================================
   INFOS RADIO EN COURS
====================================================== */
.now-playing {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  margin-bottom: 2rem;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  transition: border-color var(--transition);
}

.now-playing.playing {
  border-color: rgba(232,255,87,.3);
}

.np-label {
  font-size: .65rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: .4rem;
}

.np-name {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.np-genre {
  font-size: .75rem;
  color: var(--accent2);
  margin-top: .25rem;
  font-style: italic;
}

.np-idle {
  color: var(--muted);
  font-size: .85rem;
}

/* ======================================================
   BOUTONS
====================================================== */
.btn-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  flex: 1;
  min-width: 130px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .85rem 1.4rem;
  border: none;
  border-radius: var(--radius);
  font-family: 'Space Mono', monospace;
  font-size: .82rem;
  font-weight: 400;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), background var(--transition);
  position: relative;
  overflow: hidden;
}

/* Ripple au clic */
.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity .15s;
}
.btn:active::after { opacity: .08; }

.btn:hover  { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

/* Bouton principal — Play */
.btn-play {
  background: var(--accent);
  color: #0a0a0f;
  box-shadow: 0 4px 24px rgba(232,255,87,.25);
}
.btn-play:hover {
  background: #f0ff6a;
  box-shadow: 0 8px 32px rgba(232,255,87,.4);
}
.btn-play:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

/* Bouton secondaire — Changer */
.btn-next {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-next:hover {
  border-color: var(--accent2);
  color: var(--accent2);
  box-shadow: 0 4px 24px rgba(255,79,216,.12);
}
.btn-next:disabled {
  opacity: .4;
  cursor: not-allowed;
  transform: none;
}

/* Bouton retour ♥️Music */
.btn-music {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  margin-top: 1.5rem;
  padding: .85rem 1.4rem;
  background: linear-gradient(135deg, rgba(255,79,216,.15), rgba(232,255,87,.10));
  color: var(--text);
  border: 1px solid rgba(255,79,216,.35);
  border-radius: var(--radius);
  font-family: 'Space Mono', monospace;
  font-size: .82rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
}
.btn-music::after {
  content: '';
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  transition: opacity .15s;
}
.btn-music:active::after { opacity: .06; }
.btn-music:hover {
  transform: translateY(-2px);
  border-color: var(--accent2);
  box-shadow: 0 8px 32px rgba(255,79,216,.2);
  color: var(--accent2);
}

/* Icônes SVG inline */
.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  fill: currentColor;
}

/* ======================================================
   ÉTAT DE CHARGEMENT (spinner)
====================================================== */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(10,10,15,.3);
  border-top-color: #0a0a0f;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ======================================================
   MENTION RGPD / DONNÉES TIERS
====================================================== */
.rgpd {
  margin-top: 2rem;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .72rem;
  line-height: 1.7;
  color: var(--muted);
  background: rgba(255,255,255,.015);
}

.rgpd strong { color: var(--text); }

.rgpd a {
  color: var(--accent2);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.rgpd a:hover { opacity: .8; }

/* ======================================================
   PIED DE PAGE
====================================================== */
footer {
  position: relative;
  z-index: 1;
  margin-top: 2rem;
  font-size: .7rem;
  color: var(--muted);
  text-align: center;
}

/* ======================================================
   RESPONSIVE
====================================================== */
@media (max-width: 480px) {
  .btn-group { flex-direction: column; }
}
