/* ── pulse.css — Mode Pulse (game page + home panel) ── */

/* ═══════════════════════════════════════════════════════
   1. VARIABLES
   ═══════════════════════════════════════════════════════ */
:root {
  --pulse-accent:   #a855f7;
  --pulse-accent2:  #7c3aed;
  --pulse-glow:     rgba(168, 85, 247, .35);
  --pulse-green:    #22c55e;
  --pulse-red:      #ef4444;
  --pulse-skip:     #9aa3b2;
  --pulse-bg:       #111827;
  --pulse-card:     #1a2235;
  --pulse-border:   rgba(255,255,255,.08);
  --pulse-text:     #e2e8f0;
  --pulse-muted:    #9aa3b2;
}

/* ═══════════════════════════════════════════════════════
   2. RESET / BASE
   ═══════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--pulse-bg);
  color: var(--pulse-text);
  font-family: 'Poppins', sans-serif;
  min-height: 100dvh;
}

/* ═══════════════════════════════════════════════════════
   3. HEADER
   ═══════════════════════════════════════════════════════ */
.pulse-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  border-bottom: 1px solid var(--pulse-border);
  background: rgba(17, 24, 39, .9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.pulse-logo {
  font-family: 'Bungee', sans-serif;
  font-size: 1.4rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: .5px;
}

.pulse-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--pulse-accent);
  object-fit: cover;
}

.pulse-username {
  font-size: .85rem;
  color: #fff;
}

.pulse-login-btn {
  padding: 6px 16px;
  background: var(--pulse-accent);
  color: #fff;
  border-radius: 20px;
  font-size: .82rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.pulse-login-btn:hover { background: var(--pulse-accent2); }

/* ═══════════════════════════════════════════════════════
   4. LAYOUT PRINCIPAL
   ═══════════════════════════════════════════════════════ */
.pulse-main {
  max-width: 560px;
  margin: 0 auto;
  padding: 32px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ═══════════════════════════════════════════════════════
   5. TITRE
   ═══════════════════════════════════════════════════════ */
.pulse-title-row {
  text-align: center;
}

.pulse-badge-day {
  display: inline-block;
  background: var(--pulse-glow);
  border: 1px solid var(--pulse-accent);
  color: var(--pulse-accent);
  font-size: .75rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  letter-spacing: .5px;
}

.pulse-title {
  font-family: 'Bungee', sans-serif;
  font-size: 2.4rem;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1;
  margin-bottom: 8px;
}

.pulse-icon { filter: drop-shadow(0 0 8px var(--pulse-accent)); }

.pulse-subtitle {
  color: var(--pulse-muted);
  font-size: .88rem;
}

/* ═══════════════════════════════════════════════════════
   5b. INDICE (genre + vues YouTube)
   ═══════════════════════════════════════════════════════ */
.pulse-hint {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 16px;
  background: var(--pulse-card);
  border: 1px solid rgba(168, 85, 247, .35);
  border-radius: 14px;
  box-shadow: 0 0 16px rgba(168, 85, 247, .08);
  animation: pulse-hint-in .35s ease-out;
}
@keyframes pulse-hint-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.pulse-hint-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--pulse-muted);
}

.pulse-hint-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pulse-hint-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--pulse-border);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--pulse-text);
  white-space: nowrap;
}
.pulse-hint-chip i { font-size: .95rem; color: var(--pulse-accent); }
.pulse-hint-chip i.pulse-hint-yt { color: #ff0033; }

@media (max-width: 480px) {
  .pulse-hint { padding: 10px 12px; }
  .pulse-hint-chip { font-size: .8rem; padding: 4px 10px; }
}

/* Indices progressifs (débloqués au fil des essais) */
.pulse-hint-flag {
  width: 20px;
  height: 14px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .15);
}
.pulse-hint-mask { gap: 10px; flex-wrap: wrap; white-space: normal; justify-content: center; }
.pulse-mask-word { display: inline-flex; align-items: center; gap: 3px; }
.pulse-mask-word i {
  width: 9px;
  height: 12px;
  border-radius: 2px;
  background: rgba(168, 85, 247, .25);
  border: 1px solid rgba(168, 85, 247, .6);
}
.pulse-mask-dash {
  font-weight: 800;
  font-size: .8rem;
  line-height: 1;
  color: var(--pulse-text);
  margin: 0 1px;
}
.pulse-mask-word em {
  font-style: normal;
  font-size: .72rem;
  color: var(--pulse-muted);
  margin-left: 2px;
}
.pulse-hint-locked {
  opacity: .45;
  border-style: dashed;
  font-weight: 500;
}
.pulse-hint-locked i { color: var(--pulse-muted); font-size: .8rem; }
.pulse-hint-new { animation: pulse-hint-unlock .7s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pulse-hint-unlock {
  0%   { opacity: 0; transform: scale(.6); box-shadow: 0 0 0 0 rgba(168, 85, 247, .7); }
  60%  { opacity: 1; transform: scale(1.08); box-shadow: 0 0 0 8px rgba(168, 85, 247, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(168, 85, 247, 0); }
}
@media (max-width: 480px) {
  .pulse-mask-word i { width: 7px; height: 10px; }
}

/* ═══════════════════════════════════════════════════════
   6. BARRE D'EXTRAITS
   ═══════════════════════════════════════════════════════ */
.pulse-extracts-bar {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
}

.pulse-extract-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.pulse-extract-block {
  border-radius: 6px;
  width: 48px;
  transition: background .3s, box-shadow .3s;
  background: rgba(255,255,255,.06);
  border: 2px solid transparent;
}

.pulse-extract-block.active {
  border-color: var(--pulse-accent);
  box-shadow: 0 0 12px var(--pulse-glow);
}

.pulse-extract-block.correct {
  background: var(--pulse-green);
  border-color: var(--pulse-green);
}

.pulse-extract-block.wrong {
  background: var(--pulse-red);
  border-color: var(--pulse-red);
}

.pulse-extract-block.skip {
  background: var(--pulse-skip);
  border-color: var(--pulse-skip);
}

.pulse-extract-label-s {
  font-size: .65rem;
  color: var(--pulse-muted);
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   7. ÉCRANS (loading / play / result / already)
   ═══════════════════════════════════════════════════════ */
.pulse-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  width: 100%;
}

/* Spinner */
.pulse-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(168,85,247,.3);
  border-top-color: var(--pulse-accent);
  border-radius: 50%;
  animation: pulse-spin .8s linear infinite;
}
@keyframes pulse-spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════
   8. ZONE PLAY
   ═══════════════════════════════════════════════════════ */
.pulse-play-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.pulse-play-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--pulse-accent), var(--pulse-accent2));
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 0 var(--pulse-glow);
  transition: transform .15s, box-shadow .15s;
}

.pulse-play-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 0 24px var(--pulse-glow);
}

.pulse-play-btn.playing {
  animation: pulse-ring 1.4s ease-out infinite;
}

@keyframes pulse-ring {
  0%  { box-shadow: 0 0 0 0 var(--pulse-glow); }
  70% { box-shadow: 0 0 0 18px rgba(168,85,247,0); }
  100%{ box-shadow: 0 0 0 0 rgba(168,85,247,0); }
}

.pulse-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,.08);
  border-radius: 3px;
  overflow: hidden;
}

.pulse-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--pulse-accent2), var(--pulse-accent));
  border-radius: 3px;
  transition: width .05s linear;
}

.pulse-extract-label {
  font-size: .8rem;
  color: var(--pulse-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Volume */
.pulse-extract-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}
.pulse-volume-row {
  position: absolute;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  padding: 5px 10px;
}
.pulse-vol-icon {
  font-size: 14px;
  opacity: 0.6;
  user-select: none;
}
#pulseVolume {
  width: 72px;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  accent-color: var(--pulse-accent);
  background: rgba(255,255,255,.12);
  border-radius: 99px;
  outline: none;
  cursor: pointer;
}
#pulseVolume::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pulse-accent);
  cursor: pointer;
  box-shadow: 0 0 4px var(--pulse-glow);
  transition: transform .15s;
}
#pulseVolume::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}
#pulseVolume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--pulse-accent);
  border: none;
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════
   9. INPUT RÉPONSE
   ═══════════════════════════════════════════════════════ */
.pulse-input-zone {
  width: 100%;
  position: relative;
}

.pulse-input-wrap {
  display: flex;
  gap: 8px;
}

.pulse-answer-input {
  flex: 1;
  height: 48px;
  font-size: 14px;
  padding: 0 16px;
  background: #ffffff;
  color: #111;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.pulse-answer-input:focus {
  border-color: rgba(168, 85, 247, 0.5);
}
.pulse-answer-input::placeholder { color: #888; }

.pulse-submit-btn {
  padding: 12px 20px;
  background: var(--pulse-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, transform .1s;
}
.pulse-submit-btn:hover { background: var(--pulse-accent2); transform: translateY(-1px); }
.pulse-submit-btn:active { transform: translateY(0); }

/* Suggestions autocomplete */
.pulse-suggestions {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #1e2d45;
  border: 1px solid var(--pulse-border);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.pulse-suggestion-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: .88rem;
  transition: background .15s;
}
.pulse-suggestion-item:hover,
.pulse-suggestion-item.focused { background: rgba(168,85,247,.15); }

/* ═══════════════════════════════════════════════════════
   10. LISTE DES TENTATIVES
   ═══════════════════════════════════════════════════════ */
.pulse-attempts-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pulse-attempt-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: .88rem;
  border: 1px solid transparent;
}

.pulse-attempt-item.wrong {
  background: rgba(239,68,68,.1);
  border-color: rgba(239,68,68,.3);
  color: #fca5a5;
}

.pulse-attempt-item.skip {
  background: rgba(154,163,178,.08);
  border-color: rgba(154,163,178,.2);
  color: var(--pulse-muted);
}

.pulse-attempt-icon { font-size: 1rem; flex-shrink: 0; }
.pulse-attempt-text { flex: 1; }

/* ═══════════════════════════════════════════════════════
   11. BOUTON SKIP
   ═══════════════════════════════════════════════════════ */
.pulse-skip-row { width: 100%; display: flex; justify-content: center; }

.pulse-skip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 20px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  color: #111;
  background: #f0f0f0;
  width: fit-content;
  transition: background 0.15s ease;
}
.pulse-skip-btn:hover {
  background: #e0e0e0;
}

/* ═══════════════════════════════════════════════════════
   12. ÉCRAN RÉSULTAT
   ═══════════════════════════════════════════════════════ */
.pulse-result-icon {
  font-size: 3.5rem;
  line-height: 1;
}

.pulse-result-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
}

.pulse-result-song {
  text-align: center;
  font-size: 1.1rem;
  color: var(--pulse-muted);
  line-height: 1.5;
}
.pulse-result-song strong { color: var(--pulse-text); }

.pulse-result-score-big {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--pulse-accent);
  text-shadow: 0 0 20px var(--pulse-glow);
}

.pulse-result-extraits {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: .9rem;
  color: var(--pulse-muted);
}

.pulse-next-info {
  font-size: .82rem;
  color: var(--pulse-muted);
  text-align: center;
}
.pulse-next-info strong { color: var(--pulse-accent); }

.pulse-home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  padding: 7px 20px;
  border-radius: 10px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  align-self: center;
  font-family: 'Inter', sans-serif;
  white-space: nowrap;
  cursor: pointer;
  color: #111;
  background: #f0f0f0;
  text-decoration: none;
  width: fit-content;
  transition: background 0.15s ease, transform 0.15s ease;
}
.pulse-home-btn:hover {
  background: #e0e0e0;
  transform: translateY(-1px);
}

/* Boutons icônes (download / copy) */
.pulse-result-card {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  background: var(--pulse-card);
  border: 1px solid var(--pulse-border);
  border-radius: 16px;
}

.pulse-share-actions {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  gap: 6px;
}

.pulse-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.25);
  color: #fff;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  outline: none;
  box-shadow: none;
  transition: background .15s, color .15s, border-color .15s;
}
.pulse-icon-btn:hover {
  background: rgba(168,85,247,.35);
  border-color: rgba(168,85,247,.7);
  color: #fff;
}
.pulse-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

/* Avertissement anti-spoil (sous la carte de partage, hors capture) */
.pulse-spoil-warning {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 9px 14px;
  background: rgba(251, 191, 36, .08);
  border: 1px solid rgba(251, 191, 36, .3);
  border-radius: 10px;
  color: #fcd34d;
  font-size: .8rem;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}
.pulse-spoil-icon { flex-shrink: 0; font-size: .95rem; }

/* ═══════════════════════════════════════════════════════
   13. TOAST
   ═══════════════════════════════════════════════════════ */
.pulse-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1e293b;
  border: 1px solid var(--pulse-accent);
  color: var(--pulse-text);
  padding: 12px 24px;
  border-radius: 24px;
  font-size: .9rem;
  font-weight: 600;
  z-index: 999;
  transition: transform .3s ease, opacity .3s ease;
  opacity: 0;
  pointer-events: none;
}
.pulse-toast.visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ═══════════════════════════════════════════════════════
   14. HOME PANEL — styles spécifiques Pulse
       (réutilise les classes .survie-panel-* existantes)
   ═══════════════════════════════════════════════════════ */

/* Score dégressif dans le panel home */
.pulse-score-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
  font-size: .82rem;
}

.pulse-score-table th,
.pulse-score-table td {
  padding: 6px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255,255,255,.05);
}

.pulse-score-table th {
  color: var(--pulse-muted);
  font-weight: 600;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.pulse-score-table td:last-child {
  color: var(--pulse-accent);
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
}

.pulse-score-table tr:first-child td:last-child { color: #ffd166; }

/* Bouton lancer Pulse (réutilise .survie-launch-btn mais couleur différente) */
.pulse-launch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--pulse-accent), var(--pulse-accent2));
  color: #fff;
  border-radius: 24px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: filter .2s, transform .15s;
  margin-top: 12px;
}
.pulse-launch-btn:hover { filter: brightness(1.15); transform: translateY(-2px); }

/* Score hebdo leaderboard — points au lieu de streaks */
.pulse-lb-points {
  font-family: 'Poppins', sans-serif;
  font-size: .85rem;
  font-weight: 700;
  color: var(--pulse-accent);
}
.pulse-lb-points.gold   { color: #ffd166; }
.pulse-lb-points.silver { color: #c0c0c0; }
.pulse-lb-points.bronze { color: #cd7f32; }

/* ═══════════════════════════════════════════════════════
   15. RESPONSIVE
   ═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .pulse-extract-row {
    flex-direction: column;
    gap: 8px;
  }
  .pulse-volume-row {
    position: static;
    padding: 4px 10px;
  }
  #pulseVolume {
    width: 100px;
  }
}
@media (max-width: 480px) {
  .pulse-main { padding: 20px 12px 48px; gap: 20px; }
  .pulse-title { font-size: 1.9rem; }
  .pulse-play-btn { width: 68px; height: 68px; font-size: 1.7rem; }
  .pulse-input-wrap { flex-direction: column; }
  .pulse-answer-input { font-size: 16px; width: 100%; flex: 0 0 48px; padding: 0 18px; }
  .pulse-submit-btn { width: 100%; height: 48px; font-size: 1.05rem; }
  .pulse-extract-block { width: 38px; }
  /* Header compact sur mobile */
  .pulse-header { padding: 10px 14px; }
  .pulse-header-right { gap: 6px; }
  .pulse-training-link { padding: .3rem .5rem; gap: 0; }
  .pulse-training-label { display: none; }
  .pulse-training-emoji { font-size: 1.1rem; }
}

/* ═══════════════════════════════════════════════════════
   16. FOOTER LINK
   ═══════════════════════════════════════════════════════ */
.footer-mode-link--pulse {
  border-color: rgba(168, 85, 247, 0.3);
  color: #c084fc;
}

.footer-mode-link--pulse:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.25);
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════
   MODAL AUTH
   ═══════════════════════════════════════════════════════ */
.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
}

.auth-modal-box {
  position: relative;
  z-index: 10000;
  background: linear-gradient(180deg, #141a2a, #0f1423);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 40px 32px 32px;
  width: min(420px, 92vw);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
  text-align: center;
  overflow: hidden;
}

.auth-modal-close {
  all: unset;
  position: absolute;
  top: 14px;
  right: 16px;
  color: #9aa3b2;
  font-size: 22px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s, color 0.15s;
  z-index: 1;
}
.auth-modal-close:hover { opacity: 1; }

.auth-modal-title {
  font-family: 'Poppins', sans-serif;
  font-size: 22px;
  font-weight: 700;
  color: #a855f7;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.auth-modal-subtitle {
  font-size: 14px;
  color: #9aa3b2;
  margin: 0 0 28px;
}

.auth-modal-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.15s, opacity 0.15s;
  cursor: pointer;
}
.auth-btn:hover { transform: translateY(-1px); opacity: 0.9; }

.auth-btn-google  { background: #fff; color: #1e1b4b; }
.auth-btn-twitch  { background: #9146ff; color: #fff; }
.auth-btn-discord { background: #5865f2; color: #fff; border: none; }
.auth-btn-discord:hover { background: #4752c4; }

.auth-modal-cancel {
  all: unset;
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  margin-top: 12px !important;
  padding: 12px !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 12px !important;
  color: #fff !important;
  background: transparent !important;
  font-size: 0.82rem !important;
  font-weight: 500 !important;
  letter-spacing: 0.05em !important;
  text-transform: uppercase !important;
  text-align: center !important;
  cursor: pointer !important;
}
.auth-modal-cancel:hover { background: rgba(255,255,255,0.05) !important; }

/* ═══════════════════════════════════════════════════════
   MODE ENTRAÎNEMENT
   ═══════════════════════════════════════════════════════ */

/* Badge training (vert) */
.training-badge {
  background: rgba(34, 197, 94, .15);
  border-color: #22c55e;
  color: #22c55e;
}

/* Bouton "Chanson suivante →" */
.training-next-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px 28px;
  background: linear-gradient(135deg, var(--pulse-accent), var(--pulse-accent2));
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 1rem;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: filter .2s, transform .15s;
  align-self: center;
}
.training-next-btn:hover {
  filter: brightness(1.15);
  transform: translateY(-2px);
}
.training-next-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
  transform: none;
}

/* Lien entraînement dans le header */
.pulse-training-link {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .35rem .9rem;
  border: 1px solid rgba(167,139,250,.7);
  border-radius: 999px;
  background: rgba(167,139,250,.18);
  color: #ddd6fe;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: .02em;
  transition: background .2s, border-color .2s, color .2s, box-shadow .2s;
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(167,139,250,.15);
}
.pulse-training-link:hover {
  background: rgba(167,139,250,.30);
  border-color: rgba(167,139,250,.9);
  color: #fff;
  box-shadow: 0 0 14px rgba(167,139,250,.3);
}
.pulse-training-emoji { font-size: 1rem; line-height: 1; }
.pulse-training-label { font-size: .8rem; }

/* Compteur de progression "Chanson X / 10" */
.training-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pulse-muted);
  letter-spacing: 0.4px;
}
#training-count {
  color: var(--pulse-accent);
}
.training-progress-sep {
  opacity: 0.35;
  margin: 0 1px;
}

/* Écran limite quotidienne training */
.pulse-training-limit-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 32px 24px;
  background: var(--pulse-card);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 20px;
  text-align: center;
}
.pulse-training-limit-card .pulse-result-icon {
  font-size: 3rem;
}
.pulse-training-limit-card h2 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fbbf24;
  line-height: 1.3;
}
.pulse-training-limit-card p {
  color: var(--pulse-muted);
  font-size: 0.88rem;
  line-height: 1.6;
}

/* ═══════════════════════════════════════════════════════
   HISTORIQUE DES CHANSONS D'ENTRAÎNEMENT
   ═══════════════════════════════════════════════════════ */
.training-history {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.training-history:empty { display: none; }

.training-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--pulse-muted);
  padding: 0 4px;
}
.training-history-score { color: var(--pulse-accent); }

.training-history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.training-history-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--pulse-card);
  border: 1px solid var(--pulse-border);
  border-left: 3px solid var(--pulse-green);
  border-radius: 10px;
}
.training-history-item.lost { border-left-color: var(--pulse-red); }

.thi-num {
  width: 18px;
  flex-shrink: 0;
  text-align: center;
  font-size: .78rem;
  font-weight: 700;
  color: var(--pulse-muted);
}

.thi-cover {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  object-fit: cover;
  flex-shrink: 0;
  background: #111827;
}

.thi-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.3;
}
.thi-text strong,
.thi-text span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thi-text strong { font-size: .9rem; color: #fff; }
.thi-text span   { font-size: .78rem; color: var(--pulse-muted); }

.thi-badge {
  flex-shrink: 0;
  font-size: .78rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}
.thi-badge.won  { background: rgba(34,197,94,.15); color: #4ade80; }
.thi-badge.lost { background: rgba(239,68,68,.15); color: #f87171; }

/* ═══════════════════════════════════════════════════════
   RÉÉCOUTE DE L'EXTRAIT COMPLET (fin de partie)
   ═══════════════════════════════════════════════════════ */
.pulse-song-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: 100%;
}
.pulse-song-row .pulse-result-song { min-width: 0; }

.pulse-replay-btn {
  --p: 0;
  position: relative;
  flex-shrink: 0;
  padding: 0;
  border: none;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
  transition: transform .15s, box-shadow .15s, filter .15s;
}
.pulse-replay-btn i { position: relative; z-index: 1; }
.pulse-replay-btn i.fa-play { margin-left: 2px; }
.pulse-replay-btn:hover { transform: translateY(-1px) scale(1.04); filter: brightness(1.12); }

/* Rond (liste des chansons) : violet plein + anneau de progression */
.pulse-replay-btn:not(.pulse-replay-pill) {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(168, 85, 247, .35) 0);
  box-shadow: 0 0 12px var(--pulse-glow);
}
.pulse-replay-btn:not(.pulse-replay-pill)::before {
  content: '';
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pulse-accent), var(--pulse-accent2));
}
.pulse-replay-btn:not(.pulse-replay-pill) i { font-size: .8rem; }

/* Pilule avec texte (cartes résultat / déjà joué) : barre de progression intégrée */
.pulse-replay-pill {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  border-radius: 999px;
  font-size: .88rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--pulse-accent), var(--pulse-accent2));
  box-shadow: 0 4px 16px var(--pulse-glow);
  overflow: hidden;
}
.pulse-replay-pill::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: calc(var(--p) * 100%);
  background: #fff;
  opacity: .85;
}
.pulse-replay-pill i { font-size: .8rem; }
.pulse-replay-pill span { position: relative; z-index: 1; }

.training-history-item .pulse-replay-btn:not(.pulse-replay-pill) { margin-left: 4px; }

/* ═══════════════════════════════════════════════════════
   MENU HAMBURGER (mobile) — même rendu que les autres pages
   ═══════════════════════════════════════════════════════ */
.hamburger-btn {
  display: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font-size: 20px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s;
  z-index: 998;
}
.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hamburger-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 999;
}
.hamburger-overlay.open {
  display: block;
}

.hamburger-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100vh;
  background: #111827;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  padding: 20px 0 32px;
  overflow-y: auto;
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
.hamburger-panel.open {
  transform: translateX(0);
}

.hamburger-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 20px 20px;
  border-bottom: 2px solid rgba(99, 120, 255, 0.5);
}
.hamburger-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}
.hamburger-username {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hamburger-links {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 12px;
  flex: 1;
}
.hamburger-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  color: #e8eefc;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-left: 3px solid transparent;
  transition:
    background 0.15s,
    border-left 0.15s;
}
.hamburger-link:last-child {
  border-bottom: none;
}
.hamburger-link:hover {
  background: rgba(99, 120, 255, 0.08);
  border-left: 3px solid rgba(99, 120, 255, 0.6);
  color: #fff;
}
.hamburger-logout {
  color: #9aa3b2;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
  border-left: 3px solid transparent;
}
.hamburger-logout:hover {
  color: #fff;
  background: rgba(255, 80, 80, 0.08);
  border-left: 3px solid rgba(255, 80, 80, 0.5);
}
.hamburger-suggest {
  margin-top: 8px;
}
.hamburger-login {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 12px 16px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}
.hamburger-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 20px 20px 0;
}
.hamburger-lang .lang-btn {
  background: transparent;
  border: none;
  outline: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 12px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  padding: 0 5px;
}
.hamburger-lang .lang-btn.active {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.hamburger-lang .lang-sep {
  color: rgba(255, 255, 255, 0.2);
  font-size: 11px;
  pointer-events: none;
}

/* Mobile : SongClash à gauche, S'entraîner + ☰ à droite.
   Avatar / pseudo / connexion passent dans le menu. */
@media (max-width: 768px) {
  .hamburger-btn {
    display: flex;
  }
  .pulse-header .pulse-avatar,
  .pulse-header .pulse-username,
  .pulse-header .pulse-login-btn {
    display: none;
  }
  .pulse-header {
    padding: 10px 12px;
  }
  .pulse-logo {
    font-size: 1.1rem;
  }
  .pulse-header-right {
    gap: 8px;
  }
}
/* Réécouter : vert émeraude plein, pour ne pas se confondre avec le bouton
   violet « Chanson suivante » du training. Sans halo ni ombre sur le texte
   (lisibilité). */
.pulse-replay-pill {
  background: linear-gradient(135deg, #10b981, #059669);
  border: none;
  color: #fff;
  box-shadow: none;
  text-shadow: none;
}
.pulse-replay-pill span,
.pulse-replay-pill i { text-shadow: none; }
.pulse-replay-pill:hover,
.pulse-replay-pill.playing {
  filter: none;
  background: linear-gradient(135deg, #34d399, #059669);
  box-shadow: none;
}
.pulse-replay-pill::after { background: rgba(255, 255, 255, .9); }

/* Tentatives : la réponse tapée reste affichée (repère visuel, façon Heardle) */
.pulse-attempt-item { min-width: 0; }
.pulse-attempt-item .pulse-attempt-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pulse-attempt-item.wrong .pulse-attempt-text.is-guess {
  color: #fecaca;
  font-weight: 600;
}
.pulse-attempt-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.pulse-attempt-item.wrong .pulse-attempt-tag {
  color: #fca5a5;
  background: rgba(239, 68, 68, .16);
  border: 1px solid rgba(239, 68, 68, .35);
}
.pulse-attempt-item.skip .pulse-attempt-tag {
  color: var(--pulse-muted);
  background: rgba(154, 163, 178, .1);
  border: 1px solid rgba(154, 163, 178, .25);
}
