/* lyrics-engine.css - Styles pour les jeux "Retrouve les paroles" */

.container { max-width: 800px; margin: 0 auto; padding: 0 16px 60px; }

/* ── Hero (identique aux autres quiz) ── */
.lyrics-hero {
  text-align: center;
  padding: 40px 20px 30px;
}
.lyrics-hero-emoji { font-size: 3.5rem; margin-bottom: 12px; }
.lyrics-hero h1 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 900; color: var(--text); line-height: 1.2; margin-bottom: 10px; }
.lyrics-hero p { font-size: .92rem; font-weight: 700; color: var(--text-muted); line-height: 1.6; max-width: 480px; margin: 0 auto; }

/* ── Ecran selection de niveau ── */
#screen-levels { text-align: center; }
.levels-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 24px; padding: 32px 24px; box-shadow: var(--card-shadow);
}
.levels-card h2 { font-size: 1.1rem; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.levels-card .levels-sub { font-size: .85rem; font-weight: 700; color: var(--text-muted); margin-bottom: 24px; }
.levels-grid { display: flex; flex-direction: column; gap: 10px; }
.level-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 16px 20px; border: 2px solid var(--card-border); border-radius: 16px;
  background: #fafafa; cursor: pointer; transition: all .2s; text-align: left;
}
.level-btn:hover { background: #fdf2f8; border-color: #f0a8cc; transform: translateX(4px); }
.level-btn .level-num {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #e84393, #fd79a8);
  color: white; font-weight: 900; font-size: .95rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.level-btn .level-info { flex: 1; }
.level-btn .level-title { font-size: .95rem; font-weight: 900; color: var(--text); margin-bottom: 2px; }
.level-btn .level-artist { font-size: .78rem; font-weight: 700; color: var(--text-muted); }
.level-btn .level-diff { font-size: .7rem; font-weight: 800; padding: 4px 10px; border-radius: 50px; background: #f0f0f0; color: #888; flex-shrink: 0; }

/* ══════════════════════════════════════════════════════
   ECRAN DE JEU
   ══════════════════════════════════════════════════════ */
#screen-game { display: none; }

/* ── Jokers ── */
.game-jokers {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.jokers-label {
  font-size: .7rem;
  font-weight: 800;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-right: 4px;
}
.joker-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 2px solid #eee;
  border-radius: 50px;
  background: var(--card-bg);
  font-size: .78rem;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
  transition: all .18s;
  font-family: inherit;
}
.joker-btn:hover { border-color: var(--accent-light); color: var(--accent); background: #fdf2f8; }
.joker-btn .joker-icon { font-size: 1rem; }
.joker-btn.locked {
  opacity: .5;
  pointer-events: none;
  border-color: #eee;
  color: var(--text-dim);
}
.joker-btn.locked .joker-text { display: none; }
.joker-btn .joker-countdown {
  font-size: .72rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--text-dim);
}
.joker-btn:not(.locked) .joker-countdown { display: none; }
.joker-btn.used {
  opacity: .35;
  pointer-events: none;
  border-color: #eee;
  color: var(--text-dim);
}
.joker-btn.used .joker-icon { opacity: .5; }
.joker-btn.used .joker-text { text-decoration: line-through; }

/* ── Barre de progression (comme quiz-engine) ── */
.lyrics-progress-wrap { margin-bottom: 20px; }
.lyrics-progress { height: 6px; background: #eee; border-radius: 50px; overflow: hidden; }
.lyrics-progress-fill { height: 100%; background: linear-gradient(90deg, #e84393, #fd79a8); border-radius: 50px; transition: width .3s ease; width: 0%; }
.lyrics-progress-label { font-size: .72rem; font-weight: 800; color: var(--text-dim); text-align: right; margin-top: 6px; }

/* ── Barre input + score + timer (sticky) ── */
.game-bar {
  position: sticky;
  top: 56px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 16px;
  margin-bottom: 16px;
  box-shadow: var(--card-shadow);
}

.lyrics-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f6f7fb;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 10px 14px;
  transition: all .15s;
  min-width: 0;
}
.lyrics-input-wrap:focus-within { border-color: var(--accent-light); background: #fdf2f8; }
.lyrics-input {
  flex: 1; border: none; outline: none; min-width: 0;
  font-size: 1rem; font-weight: 800; color: var(--text); background: transparent;
}
.lyrics-input::placeholder { color: var(--text-dim); font-weight: 700; }
.lyrics-input-hint { font-size: .78rem; font-weight: 800; color: #00b894; white-space: nowrap; }
.lyrics-input-wrap.flash { border-color: #55efc4; background: #edfff8; }

.game-score {
  font-size: 1rem; font-weight: 900; color: var(--text);
  white-space: nowrap; flex-shrink: 0;
}
.game-score .score-label { font-size: .65rem; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: .3px; }

.game-timer {
  font-size: 1.2rem; font-weight: 900; color: var(--accent);
  font-variant-numeric: tabular-nums; white-space: nowrap; flex-shrink: 0;
}
.game-timer.warning { color: #e17055; animation: timerPulse 1s infinite; }
@keyframes timerPulse { 0%,100%{opacity:1} 50%{opacity:.5} }

/* Info chanson + champs devinette */
.game-song-info {
  font-size: .85rem; font-weight: 800; color: var(--text-muted);
  margin-bottom: 12px;
}
.game-hint { margin-bottom: 10px; }

.game-guess-row {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.game-guess {
  flex: 1; min-width: 120px;
  display: flex; align-items: center; gap: 8px;
  background: #f6f7fb; border: 2px solid #eee; border-radius: 12px;
  padding: 8px 12px; transition: all .2s;
}
.game-guess .guess-label {
  font-size: .68rem; font-weight: 800; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: .3px; white-space: nowrap;
}
.game-guess .guess-val {
  font-size: .88rem; font-weight: 900; color: var(--text-dim);
}
.game-guess.found {
  background: #edfff8; border-color: #55efc4;
}
.game-guess.found .guess-val { color: #00b894; }

/* ── Grille des paroles ── */
.lyrics-grid {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 24px; padding: 28px 24px; box-shadow: var(--card-shadow);
  line-height: 2.2;
}
.lyrics-line { margin-bottom: 4px; }
.lyrics-word {
  display: inline-block; min-width: 20px; height: 1.6em;
  margin: 1px 2px; padding: 0 5px; border-radius: 6px;
  background: #e8e8e8; vertical-align: middle; transition: all .25s;
  font-size: clamp(.82rem, 2.5vw, .95rem); font-weight: 800;
  color: transparent; text-align: center;
}
.lyrics-word.has-hint { position: relative; }
.lyrics-word.has-hint::before {
  content: attr(data-hint);
  position: absolute;
  left: 2px; top: 50%;
  transform: translateY(-50%);
  font-size: .65em;
  font-weight: 900;
  color: var(--accent-light);
  pointer-events: none;
}
.lyrics-word.found.has-hint::before { display: none; }

.lyrics-word.found {
  background: linear-gradient(135deg, #fde8f0, #fce4ec);
  color: #e84393; animation: wordPop .3s cubic-bezier(.34,1.56,.64,1);
}
.lyrics-word.revealed { background: #f5f5f5; color: #aaa; }
.lyrics-break { display: block; height: 12px; }
@keyframes wordPop { from{transform:scale(1.3)} to{transform:scale(1)} }

/* ── Boutons ── */
.btn-giveup {
  background: transparent; border: none; font-size: .8rem; font-weight: 800;
  color: var(--text-dim); cursor: pointer; padding: 8px 16px;
  transition: color .15s; font-family: inherit;
}
.btn-giveup:hover { color: #e17055; }

.btn-finish-wrap { text-align: center; margin-top: 20px; display: none; }
.btn-finish {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 36px; background: linear-gradient(135deg, #e84393, #fd79a8);
  color: #fff; border: none; border-radius: 50px;
  font-size: 1rem; font-weight: 900; cursor: pointer; font-family: inherit;
  box-shadow: 0 6px 20px rgba(232,67,147,.35); transition: all .18s;
}
.btn-finish:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(232,67,147,.45); }

/* ══════════════════════════════════════════════════════
   ECRAN RESULTAT
   ══════════════════════════════════════════════════════ */
#screen-result { display: none; text-align: center; }
.lyrics-result-card {
  background: var(--card-bg); border: 1px solid var(--card-border);
  border-radius: 24px; padding: 40px 28px; box-shadow: var(--card-shadow);
  animation: fadeIn .5s ease;
}
@keyframes fadeIn { from{opacity:0;transform:translateY(12px)} to{opacity:1;transform:translateY(0)} }
.lyrics-result-emoji { font-size: 5rem; margin-bottom: 14px; }
.lyrics-result-title { font-size: 1.8rem; font-weight: 900; color: var(--text); margin-bottom: 6px; }
.lyrics-result-pct { font-size: 3rem; font-weight: 900; color: var(--accent); margin-bottom: 8px; }
.lyrics-result-sub { font-size: 1rem; font-weight: 800; color: var(--text-muted); margin-bottom: 24px; }
.lyrics-result-stats { display: flex; justify-content: center; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.lyrics-result-stat { background: #fafafa; border-radius: 16px; padding: 14px 20px; text-align: center; min-width: 100px; }
.lyrics-result-stat .val { font-size: 1.3rem; font-weight: 900; color: var(--text); }
.lyrics-result-stat .lbl { font-size: .72rem; font-weight: 800; color: var(--text-dim); text-transform: uppercase; letter-spacing: .5px; margin-top: 4px; }
.lyrics-result-actions { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 4px; }
.btn-lyrics-restart {
  background: linear-gradient(135deg, #6c5ce7, #a29bfe); color: #fff; border: none;
  padding: 12px 28px; border-radius: 50px; font-size: .95rem; font-weight: 900;
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
  transition: all .18s; font-family: inherit; box-shadow: 0 6px 20px rgba(108,92,231,.35);
}
.btn-lyrics-restart:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(108,92,231,.45); }
.btn-lyrics-back {
  background: transparent; border: 2px solid #e0e0e0; padding: 10px 24px;
  border-radius: 50px; font-size: .88rem; font-weight: 800; color: var(--text-muted);
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.btn-lyrics-back:hover { border-color: #ccc; color: var(--text); }

/* ── Responsive ── */
@media (max-width: 640px) {
  .lyrics-grid { padding: 20px 16px; }
  .lyrics-hero { padding: 24px 16px 20px; }
  .levels-card { padding: 24px 16px; }
  .lyrics-result-card { padding: 28px 16px; }
  .game-card { top: 50px; padding: 14px 16px; }
  .game-song-row { gap: 8px; }
  .game-song-info { font-size: .82rem; }
}
