:root {
  --bg: #0f172a;
  --card: #1e293b;
  --primary: #e11d48;
  --primary-hover: #be123c;
  --secondary: #3b82f6;
  --text: #f8fafc;
  --muted: #94a3b8;
  --success: #10b981;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }

body {
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  padding: 20px;
}

.app-container { width: 100%; max-width: 600px; }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.badge {
  background: #334155;
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: bold;
  letter-spacing: 1px;
}

.card {
  background: var(--card);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.hidden { display: none !important; }

h2 { margin-bottom: 16px; }
h3 { margin: 16px 0 10px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; margin-bottom: 6px; color: var(--muted); }

input[type="text"] {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid #475569;
  background: #0f172a;
  color: white;
  font-size: 16px;
}

.btn {
  padding: 12px 20px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  font-size: 15px;
  transition: opacity 0.2s, transform 0.1s;
}
.btn:active { transform: scale(0.98); }
.btn.primary { background: var(--primary); color: white; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.secondary { background: var(--secondary); color: white; }
.full-width { width: 100%; }

.divider { text-align: center; margin: 15px 0; color: var(--muted); font-size: 14px; }
.join-row, .search-bar { display: flex; gap: 10px; }
.join-row input { text-transform: uppercase; }

/* Boîte de scène de film */
.scene-box {
  background: linear-gradient(135deg, #31102f, #1e1b4b);
  border: 1px solid #4c1d95;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 20px;
}
.genre-tag {
  display: inline-block;
  background: var(--primary);
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: bold;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.scene-text { font-size: 18px; font-weight: 500; line-height: 1.4; }

/* Liste des musiques recherchées */
.tracks-list { margin-top: 15px; display: flex; flex-direction: column; gap: 10px; }
.track-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #0f172a;
  padding: 10px;
  border-radius: 10px;
}
.track-item img { width: 50px; height: 50px; border-radius: 6px; }
.track-info { flex: 1; overflow: hidden; }
.track-info strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-info span { color: var(--muted); font-size: 14px; }

/* Lecteur étape 2 */
.player-box { text-align: center; margin-bottom: 20px; }
.album-cover { width: 160px; height: 160px; border-radius: 12px; margin: 12px 0; box-shadow: 0 6px 16px rgba(0,0,0,0.5); }
.artist-name { color: var(--muted); margin-bottom: 12px; }
audio { width: 100%; margin-top: 8px; }

/* Grille de vote */
.vote-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 10px; }
.vote-btn {
  padding: 12px;
  background: #334155;
  color: white;
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
}
.vote-btn.selected { border-color: var(--success); background: #064e3b; }

/* Pastilles des joueurs */
.chips-container { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.chip { padding: 6px 12px; border-radius: 99px; font-size: 13px; background: #334155; }
.chip.done { background: var(--success); color: #052e16; font-weight: bold; }

/* Liste des joueurs et révélation */
.players-list { list-style: none; margin: 15px 0; }
.players-list li {
  display: flex;
  justify-content: space-between;
  padding: 12px;
  background: #0f172a;
  margin-bottom: 8px;
  border-radius: 8px;
}
.reveal-card {
  background: #0f172a;
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 10px;
  border-left: 4px solid var(--primary);
}
.success-msg { color: var(--success); text-align: center; font-weight: bold; padding: 20px 0; }
.wait-msg { color: var(--muted); text-align: center; margin-top: 12px; }

/* =========================================
   ANIMATION ROULETTE CASINO (GENRE DU FILM)
   ========================================= */

/* Pendant que la roulette tourne */
.genre-tag.rolling {
  background: #f59e0b; /* Couleur dorée casino */
  color: #0f172a;
  transform: scale(1.08);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.7);
  transition: transform 0.1s ease;
}

/* Quand la roulette s'arrête sur le genre gagnant */
.genre-tag.winner {
  background: var(--primary);
  color: white;
  animation: jackpotPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 0 25px rgba(225, 29, 72, 0.9);
}

@keyframes jackpotPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}