/* Kouizit, styles communs.
 *
 * Parti pris visuel, volontairement distinct de Kahoot :
 * - fond encre profonde plutôt que violet saturé ;
 * - palette de réponses corail / turquoise / ambre / prune, et non
 *   le rouge-bleu-jaune-vert primaire ;
 * - repères par lettres A B C D, et non par formes géométriques ;
 * - typographie large, pensée pour la vidéoprojection. */

:root {
  --fond: #0f1729;
  --fond-carte: #1b2740;
  --fond-champ: #253352;
  --encre: #f2f5fa;
  --encre-douce: #98a4bf;
  --accent: #3ec9a7;
  --accent-sombre: #2aa085;
  --ok: #3ec9a7;
  --erreur: #ef5d60;

  /* Réponses : quatre teintes franches, distinguables aussi en daltonisme. */
  --r1: #ef5d60;
  --r2: #2f9bd6;
  --r3: #f2a541;
  --r4: #8e6cc4;

  --rayon: 16px;
  --ombre: 0 10px 30px rgba(0, 0, 0, 0.35);
}

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

html, body { height: 100%; }

body {
  background:
    radial-gradient(1200px 600px at 50% -10%, #1c2b4a 0%, transparent 60%),
    var(--fond);
  color: var(--encre);
  font-family: "Avenir Next", Avenir, "Segoe UI", system-ui, sans-serif;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.ecran {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.4rem;
  padding: 1.5rem;
  text-align: center;
}

.marque {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.marque span { color: var(--accent); }

h1 { font-size: clamp(1.7rem, 4vw, 2.8rem); font-weight: 800; letter-spacing: -0.01em; }
h2 { font-size: clamp(1.2rem, 3vw, 1.8rem); font-weight: 700; }

.sous-titre { color: var(--encre-douce); max-width: 36rem; }

.carte {
  background: var(--fond-carte);
  border-radius: var(--rayon);
  box-shadow: var(--ombre);
  padding: 1.8rem;
  width: min(100%, 30rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  text-align: left;
}

label { font-weight: 600; font-size: 0.95rem; color: var(--encre-douce); }

.bouton {
  display: inline-block;
  background: var(--accent);
  color: #0d1b17;
  border: none;
  border-radius: var(--rayon);
  padding: 0.9rem 1.8rem;
  font-size: 1.05rem;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: transform 0.08s ease, background 0.15s ease, opacity 0.15s ease;
}
.bouton:hover { background: var(--accent-sombre); }
.bouton:active { transform: scale(0.98); }
.bouton:disabled { opacity: 0.4; cursor: default; }
.bouton.secondaire {
  background: transparent;
  color: var(--encre);
  border: 2px solid var(--fond-champ);
}
.bouton.secondaire:hover { border-color: var(--accent); background: transparent; }
.bouton.danger { background: var(--erreur); color: white; }
.bouton.petit { padding: 0.5rem 1rem; font-size: 0.9rem; border-radius: 10px; }

input[type="text"], input[type="tel"], input[type="password"],
input[type="number"], textarea, select {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1.05rem;
  font-family: inherit;
  border-radius: 12px;
  border: 2px solid transparent;
  background: var(--fond-champ);
  color: var(--encre);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
textarea { resize: vertical; min-height: 3.4rem; }

.centre { text-align: center; }

.pin-geant {
  font-size: clamp(3rem, 9vw, 6rem);
  font-weight: 900;
  letter-spacing: 0.16em;
  background: var(--fond-carte);
  box-shadow: var(--ombre);
  padding: 0.4rem 1.6rem 0.4rem 1.9rem;
  border-radius: var(--rayon);
}

.qr { width: min(46vw, 220px); border-radius: 12px; background: white; padding: 8px; }

.joueurs-lobby {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  justify-content: center;
  max-width: 60rem;
}
.joueurs-lobby .pion {
  background: var(--fond-carte);
  border-radius: 999px;
  padding: 0.45rem 1.1rem;
  font-weight: 600;
}

/* Grille de réponses, commune à l'animateur et au joueur. */
.reponses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
  width: min(100%, 62rem);
}
@media (max-width: 560px) { .reponses { grid-template-columns: 1fr; } }

.reponse {
  border: none;
  border-radius: var(--rayon);
  color: white;
  font-family: inherit;
  font-size: clamp(1rem, 2.2vw, 1.4rem);
  font-weight: 700;
  padding: 1.1rem 1rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  min-height: 4.4rem;
  transition: opacity 0.2s ease, transform 0.08s ease;
}
.reponse:active { transform: scale(0.98); }
.reponse .lettre {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 10px;
  min-width: 2.3rem;
  height: 2.3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.reponse[data-i="0"] { background: var(--r1); }
.reponse[data-i="1"] { background: var(--r2); }
.reponse[data-i="2"] { background: var(--r3); color: #21160a; }
.reponse[data-i="2"] .lettre { background: rgba(255, 255, 255, 0.35); }
.reponse[data-i="3"] { background: var(--r4); }
.reponse.eteinte { opacity: 0.22; }
.reponse.bonne { outline: 4px solid var(--accent); outline-offset: 2px; }

.chrono {
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  font-weight: 900;
  background: var(--fond-carte);
  border-radius: 50%;
  width: 4.6rem;
  height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chrono.urgent { color: var(--erreur); }

.entete-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 62rem);
  gap: 1rem;
}
.progression { color: var(--encre-douce); font-weight: 600; }

.stats-barres {
  display: flex;
  gap: 1.2rem;
  align-items: flex-end;
  height: 10rem;
}
.stats-barres .barre {
  width: clamp(3rem, 8vw, 5.4rem);
  border-radius: 10px 10px 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  color: white;
  font-weight: 800;
  padding-top: 0.3rem;
  min-height: 1.9rem;
  transition: height 0.4s ease;
}

.classement { width: min(100%, 30rem); display: flex; flex-direction: column; gap: 0.5rem; }
.classement .ligne {
  display: flex;
  justify-content: space-between;
  background: var(--fond-carte);
  border-radius: 12px;
  padding: 0.7rem 1.2rem;
  font-weight: 600;
}
.classement .ligne .score { color: var(--accent); font-weight: 800; }

.podium { display: flex; align-items: flex-end; gap: 1rem; }
.podium .marche {
  background: var(--fond-carte);
  border-radius: var(--rayon) var(--rayon) 0 0;
  width: clamp(6rem, 20vw, 11rem);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 0.8rem 0.5rem;
  gap: 0.3rem;
}
.podium .rang { font-size: 2rem; font-weight: 900; color: var(--accent); }
.podium .nom { font-weight: 700; word-break: break-word; }
.podium .points { color: var(--encre-douce); }

.resultat-perso {
  font-size: 1.3rem;
  font-weight: 800;
  border-radius: var(--rayon);
  padding: 1.3rem 1.8rem;
}
.resultat-perso.correct { background: var(--ok); color: #0d1b17; }
.resultat-perso.incorrect { background: var(--erreur); color: white; }
.resultat-perso.absent { background: var(--fond-carte); }

.explication { color: var(--encre-douce); max-width: 42rem; }

.erreur-msg { color: var(--erreur); font-weight: 600; min-height: 1.4rem; font-size: 0.95rem; }
.succes-msg { color: var(--accent); font-weight: 600; min-height: 1.4rem; font-size: 0.95rem; }

.pied {
  position: fixed;
  bottom: 0.6rem;
  left: 0;
  right: 0;
  text-align: center;
  color: var(--encre-douce);
  font-size: 0.8rem;
}

.cache { display: none !important; }
