/* Blind test d'anniversaire : thème commun (écran de jeu et mobiles) */
:root {
  --nuit: #13062c;
  --nuit-2: #24104f;
  --nuit-3: #3a1a72;
  --encre: #fff;
  --doux: rgba(255, 255, 255, .72);
  --pale: rgba(255, 255, 255, .12);
  --verre: rgba(255, 255, 255, .08);
  --bord: rgba(255, 255, 255, .16);
  --or: #ffd54a;
  --vert: #2ee59d;
  --rouge: #ff4d6d;
  --r0: #ff4f7b; /* couleurs des 4 réponses */
  --r1: #13c2d6;
  --r2: #8b5cf6;
  --r3: #ffa51f;
  --titre: 'Bungee', 'Fredoka', system-ui, sans-serif;
  --texte: 'Fredoka', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --ombre: 0 10px 30px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--texte);
  color: var(--encre);
  background: radial-gradient(120% 90% at 50% 0%, var(--nuit-3) 0%, var(--nuit-2) 38%, var(--nuit) 100%) fixed;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

/* fond animé : trois halos qui dérivent */
.fond { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.fond i { position: absolute; width: 55vmax; height: 55vmax; border-radius: 50%; filter: blur(70px); opacity: .45; }
.fond i:nth-child(1) { background: #ff3d8b; left: -18vmax; top: -12vmax; animation: derive1 22s ease-in-out infinite alternate; }
.fond i:nth-child(2) { background: #2bd4ff; right: -22vmax; top: 20vh; animation: derive2 26s ease-in-out infinite alternate; opacity: .3; }
.fond i:nth-child(3) { background: #7c3aed; left: 25vw; bottom: -30vmax; animation: derive3 30s ease-in-out infinite alternate; }
@keyframes derive1 { to { transform: translate(18vw, 14vh) scale(1.15); } }
@keyframes derive2 { to { transform: translate(-16vw, -10vh) scale(.9); } }
@keyframes derive3 { to { transform: translate(-12vw, -18vh) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { .fond i { animation: none; } }

/* boutons « à enfoncer » */
.bouton {
  --c: #ff4f7b; --c2: #c2264f;
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  border: 0; border-radius: 16px; padding: .75em 1.4em;
  background: var(--c); color: #fff; font-weight: 700; font-size: 1.05rem; letter-spacing: .01em;
  box-shadow: 0 5px 0 var(--c2), 0 10px 22px rgba(0, 0, 0, .3);
  transform: translateY(0); transition: transform .08s, box-shadow .08s, filter .2s;
  text-decoration: none; white-space: nowrap;
}
.bouton:hover { filter: brightness(1.08); }
.bouton:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--c2), 0 4px 10px rgba(0, 0, 0, .3); }
.bouton:disabled { filter: grayscale(.8) brightness(.7); cursor: not-allowed; transform: none; }
.bouton.vert { --c: #19c37d; --c2: #0e8a57; }
.bouton.cyan { --c: #13a9d6; --c2: #0b6f8f; }
.bouton.violet { --c: #7c4dff; --c2: #5128c9; }
.bouton.or { --c: #ffb020; --c2: #c27a00; color: #3a2200; }
.bouton.fantome { --c: rgba(255, 255, 255, .1); --c2: rgba(0, 0, 0, .25); box-shadow: 0 3px 0 var(--c2); }
.bouton.grand { font-size: 1.35rem; padding: .85em 1.8em; border-radius: 20px; }
.bouton.petit { font-size: .9rem; padding: .45em .9em; border-radius: 12px; box-shadow: 0 3px 0 var(--c2); }

.carte {
  background: var(--verre); border: 1px solid var(--bord); border-radius: 22px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); box-shadow: var(--ombre);
}

.logo { font-family: var(--titre); letter-spacing: .02em; line-height: 1; display: inline-flex; align-items: center; gap: .35em; }
.logo .disque { width: 1.15em; height: 1.15em; flex: none; animation: tourne 3.2s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* tuiles de réponse : couleur + pictogramme */
.tuile { --c: var(--r0); position: relative; display: flex; align-items: center; gap: .6em; border: 0; border-radius: 18px;
  background: var(--c); color: #fff; font-weight: 700; text-align: left; box-shadow: inset 0 -6px 0 rgba(0, 0, 0, .18), 0 8px 18px rgba(0, 0, 0, .28); }
.tuile.t0 { --c: var(--r0); }
.tuile.t1 { --c: var(--r1); }
.tuile.t2 { --c: var(--r2); }
.tuile.t3 { --c: var(--r3); }
.tuile .picto { width: 1.6em; height: 1.6em; flex: none; filter: drop-shadow(0 2px 0 rgba(0, 0, 0, .2)); }
.tuile .libelle { flex: 1; min-width: 0; overflow-wrap: anywhere; text-shadow: 0 2px 0 rgba(0, 0, 0, .15); }

.puce { display: inline-flex; align-items: center; gap: .35em; padding: .3em .75em; border-radius: 999px; background: var(--pale); font-weight: 600; }

/* équipe */
.pastille-equipe { --c: #a3e635; display: inline-flex; align-items: center; gap: .4em; padding: .3em .8em .3em .4em; border-radius: 999px;
  background: color-mix(in srgb, var(--c) 22%, transparent); border: 2px solid var(--c); font-weight: 700; }
.pastille-equipe .emoji { display: grid; place-items: center; width: 1.7em; height: 1.7em; border-radius: 50%; background: var(--c); }

/* confettis */
.confettis { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* petites animations réutilisées */
@keyframes surgir { 0% { transform: scale(.3); opacity: 0; } 60% { transform: scale(1.12); opacity: 1; } 100% { transform: scale(1); } }
@keyframes monter { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes secouer { 10%, 90% { transform: translateX(-2px); } 20%, 80% { transform: translateX(4px); } 30%, 50%, 70% { transform: translateX(-8px); } 40%, 60% { transform: translateX(8px); } }
@keyframes pulser { 50% { transform: scale(1.06); } }
@keyframes flotter { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-10px) rotate(4deg); } }
@keyframes briller { 0%, 100% { filter: drop-shadow(0 0 6px rgba(255, 213, 74, .6)); } 50% { filter: drop-shadow(0 0 22px rgba(255, 213, 74, 1)); } }
.surgir { animation: surgir .5s cubic-bezier(.2, .9, .3, 1.3) both; }
.monter { animation: monter .5s ease-out both; }
.secouer { animation: secouer .6s both; }

/* égaliseur */
.egaliseur { display: flex; align-items: flex-end; gap: 6px; height: 60px; }
.egaliseur span { width: 10px; border-radius: 4px; background: linear-gradient(to top, var(--r0), var(--or)); animation: eq 1s ease-in-out infinite; }
.egaliseur span:nth-child(2n) { animation-duration: .8s; background: linear-gradient(to top, var(--r1), #a5f3fc); }
.egaliseur span:nth-child(3n) { animation-duration: 1.25s; background: linear-gradient(to top, var(--r2), #f0abfc); }
.egaliseur span:nth-child(4n) { animation-delay: -.4s; }
.egaliseur span:nth-child(5n) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 18%; } 50% { height: 100%; } }
.egaliseur.calme span { animation-play-state: paused; height: 18%; }

.toasts { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: grid; gap: 8px; z-index: 60; width: min(560px, 92vw); }
.toast { background: rgba(20, 8, 45, .95); border: 1px solid var(--bord); border-radius: 14px; padding: .7em 1em; box-shadow: var(--ombre); animation: monter .3s ease-out both; font-weight: 500; }
.toast.erreur { border-color: var(--rouge); }

.connexion { position: fixed; top: 10px; right: 10px; z-index: 70; background: var(--rouge); color: #fff; border-radius: 999px; padding: .3em .9em; font-weight: 600; font-size: .9rem; box-shadow: var(--ombre); }
