/* =====================================================================
   QUIZ MARIAGE — feuille de style
   Direction : un soir d'août sous la guirlande. Ciel indigo, ampoules
   chaudes, cartons de menu couleur craie. La guirlande n'est pas un
   décor : ses 30 ampoules SONT les 30 questions, et elles s'allument
   au fur et à mesure de la partie.
   ===================================================================== */

/* ---------------------------------------------------------------- jetons */
:root {
  --nuit:        #191a3e;
  --nuit-2:      #101128;
  --nuit-3:      #23255a;
  --ampoule:     #ffc46b;
  --ampoule-vif: #ff9b4d;
  --craie:       #fbf3e7;
  --craie-doux:  #e6dccb;
  --rose:        #f0899f;
  --juste:       #52d19a;
  --faux:        #e8596b;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --texte:   "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;

  --r:    14px;
  --r-sm: 9px;

  --lueur: 0 0 22px rgba(255, 196, 107, .55), 0 0 60px rgba(255, 155, 77, .25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(120% 80% at 50% -10%, #2a2c63 0%, var(--nuit) 45%, var(--nuit-2) 100%)
    fixed;
  color: var(--craie);
  font-family: var(--texte);
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 700;
  font-optical-sizing: auto;
  letter-spacing: -.01em;
  margin: 0;
}

/* --------------------------------------------------- LA GUIRLANDE (signature) */
.guirlande {
  position: relative;
  width: 100%;
  height: 52px;
  flex: 0 0 auto;
  pointer-events: none;
  user-select: none;
}

.guirlande__fil {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.guirlande__fil path {
  fill: none;
  stroke: rgba(251, 243, 231, .22);
  stroke-width: 1.5;
}

.ampoule {
  position: absolute;
  width: 11px;
  height: 14px;
  margin-left: -5.5px;
  border-radius: 50% 50% 46% 46% / 42% 42% 58% 58%;
  background: rgba(251, 243, 231, .13);
  box-shadow: inset 0 0 0 1px rgba(251, 243, 231, .18);
  transition: background .5s ease, box-shadow .5s ease;
}

/* ampoule d'une question déjà jouée : allumée */
.ampoule.est-allumee {
  background: linear-gradient(180deg, #fff2d5, var(--ampoule));
  box-shadow: var(--lueur);
}

/* ampoule de la question en cours : elle respire */
.ampoule.est-active {
  background: linear-gradient(180deg, #fff, var(--ampoule-vif));
  box-shadow: 0 0 26px rgba(255, 155, 77, .9), 0 0 70px rgba(255, 155, 77, .5);
  animation: respire 1.6s ease-in-out infinite;
}

@keyframes respire {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.35); }
}

/* petit frisson dans toute la guirlande au moment de la révélation */
.guirlande.frissonne .ampoule.est-allumee {
  animation: frisson .9s ease-out;
}

@keyframes frisson {
  0%   { filter: brightness(1); }
  25%  { filter: brightness(2.2); }
  55%  { filter: brightness(.7); }
  100% { filter: brightness(1); }
}

/* ------------------------------------------------------------- structure */
.page {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.contenu {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 620px;
  margin: 0 auto;
  padding: 8px 20px 32px;
}

.eyebrow {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ampoule);
  margin: 0;
}

.titre-quiz {
  font-size: clamp(34px, 9vw, 52px);
  line-height: 1.02;
  color: var(--craie);
}

.sous-titre {
  font-family: var(--display);
  font-style: italic;
  font-size: 19px;
  color: var(--craie-doux);
  margin: 6px 0 0;
}

/* ------------------------------------------------------------ le « carton » */
/* Le bloc central reprend le carton de table : papier craie, coins doux. */
.carton {
  background: var(--craie);
  color: var(--nuit);
  border-radius: var(--r);
  padding: 24px 22px;
  box-shadow: 0 24px 50px -20px rgba(0, 0, 0, .6);
}

.carton h2 { font-size: 26px; }

/* -------------------------------------------------------------- formulaire */
.champ {
  display: block;
  margin-bottom: 14px;
}

.champ span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #6a6a8a;
  margin-bottom: 6px;
}

.champ input {
  width: 100%;
  padding: 14px 15px;
  font: inherit;
  font-size: 18px;
  color: var(--nuit);
  background: #fff;
  border: 1.5px solid var(--craie-doux);
  border-radius: var(--r-sm);
}

.champ input:focus {
  outline: 3px solid var(--ampoule-vif);
  outline-offset: 1px;
  border-color: transparent;
}

/* ------------------------------------------------------------------ boutons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px 20px;
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  color: var(--nuit);
  background: linear-gradient(180deg, var(--ampoule), var(--ampoule-vif));
  border: 0;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}

.btn:hover:not(:disabled) { filter: brightness(1.07); }
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 3px solid var(--craie);
  outline-offset: 2px;
}

.btn--fantome {
  background: transparent;
  color: var(--craie);
  box-shadow: inset 0 0 0 1.5px rgba(251, 243, 231, .35);
}

.btn--danger {
  background: transparent;
  color: var(--faux);
  box-shadow: inset 0 0 0 1.5px currentColor;
}

.btn--auto { width: auto; }

/* ------------------------------------------------------- salle d'attente */
.attente {
  text-align: center;
}

.attente__pastille {
  display: inline-block;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--nuit);
  background: var(--ampoule);
  border-radius: 99px;
}

.attente__note {
  color: var(--craie-doux);
  font-size: 15px;
}

/* ----------------------------------------------------------- la question */
.entete-q {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.numero-q {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ampoule);
}

.chrono {
  font-variant-numeric: tabular-nums;
  font-size: 26px;
  font-weight: 700;
  color: var(--craie);
}

.chrono.urgent {
  color: var(--faux);
  animation: bat .5s steps(2, end) infinite;
}

@keyframes bat {
  50% { opacity: .35; }
}

.barre-chrono {
  height: 5px;
  border-radius: 99px;
  background: rgba(251, 243, 231, .15);
  overflow: hidden;
}

.barre-chrono i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--ampoule), var(--ampoule-vif));
  transform-origin: left;
}

.intitule {
  font-family: var(--display);
  font-size: clamp(22px, 5.4vw, 30px);
  line-height: 1.2;
  font-optical-sizing: auto;
  margin: 0;
}

/* -------------------------------------------------------------- réponses */
.reponses {
  display: grid;
  gap: 10px;
}

.reponse {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 16px;
  font: inherit;
  font-size: 17px;
  text-align: left;
  color: var(--craie);
  background: rgba(251, 243, 231, .07);
  border: 1.5px solid rgba(251, 243, 231, .18);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
}

.reponse:active { transform: scale(.985); }

.reponse .lib { flex: 1; }

.reponse .lettre {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  font-size: 14px;
  font-weight: 700;
  border-radius: 8px;
  background: rgba(251, 243, 231, .12);
}

.reponse.choisie {
  background: rgba(255, 196, 107, .18);
  border-color: var(--ampoule);
}

.reponse.choisie .lettre {
  background: var(--ampoule);
  color: var(--nuit);
}

.reponse.juste {
  background: rgba(82, 209, 154, .2);
  border-color: var(--juste);
}

.reponse.juste .lettre { background: var(--juste); color: var(--nuit); }

.reponse.faux {
  background: rgba(232, 89, 107, .16);
  border-color: var(--faux);
}

.reponse.faux .lettre { background: var(--faux); color: #fff; }

.reponse:disabled { cursor: default; }
.reponse.pale { opacity: .35; }

/* ------------------------------------------------------------- verdict */
.verdict {
  text-align: center;
  padding: 26px 20px;
  border-radius: var(--r);
}

.verdict--juste { background: rgba(82, 209, 154, .15); box-shadow: inset 0 0 0 1.5px var(--juste); }
.verdict--faux  { background: rgba(232, 89, 107, .12); box-shadow: inset 0 0 0 1.5px var(--faux); }
.verdict--rien  { background: rgba(251, 243, 231, .06); box-shadow: inset 0 0 0 1.5px rgba(251, 243, 231, .2); }

.verdict h2 { font-size: 30px; }

.verdict p { margin: 6px 0 0; color: var(--craie-doux); }

.verdict .gain {
  display: block;
  margin-top: 10px;
  font-size: 34px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ampoule);
}

/* ------------------------------------------------------------ classement */
.classement {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.classement li {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(251, 243, 231, .07);
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px rgba(251, 243, 231, .1);
}

.classement .rang {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: var(--craie-doux);
}

.classement .pts {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--ampoule);
}

.classement li.podium {
  background: rgba(255, 196, 107, .14);
  box-shadow: inset 0 0 0 1.5px rgba(255, 196, 107, .55);
}

.classement li.podium .rang { color: var(--ampoule); }

.classement li.moi {
  box-shadow: inset 0 0 0 2px var(--rose);
}

/* ------------------------------------------------------------------ divers */
.centre { text-align: center; }
.muet   { color: var(--craie-doux); font-size: 15px; }
.erreur { color: var(--faux); font-size: 15px; min-height: 20px; margin: 4px 0 0; }
.cache  { display: none !important; }

/* ================================================================== ÉCRAN */
/* Vue projetée : tout doit rester lisible depuis le fond de la salle. */
.ecran { padding: 0; }

.ecran .contenu {
  max-width: 1500px;
  padding: 10px 48px 40px;
  gap: 28px;
}

.ecran .intitule    { font-size: clamp(34px, 4.4vw, 62px); }
.ecran .titre-quiz  { font-size: clamp(52px, 8vw, 108px); }
.ecran .chrono      { font-size: clamp(44px, 5vw, 76px); }
.ecran .numero-q    { font-size: 18px; }

.ecran .reponses {
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.ecran .reponse {
  font-size: clamp(20px, 2vw, 30px);
  padding: 22px 24px;
  cursor: default;
}

.ecran .reponse .lettre {
  width: 46px;
  height: 46px;
  font-size: 20px;
}

.ecran .classement li {
  grid-template-columns: 76px 1fr auto;
  font-size: clamp(20px, 2vw, 30px);
  padding: 14px 22px;
}

.ecran .classement .rang { font-size: 34px; }

/* la barre de répartition des réponses, sous chaque proposition, à la révélation */
.reponse { position: relative; overflow: hidden; }

.reponse .part {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 5px;
  width: 0;
  background: var(--craie-doux);
  opacity: .5;
  transition: width .9s cubic-bezier(.2, .8, .2, 1);
}

.reponse.juste .part { background: var(--juste); opacity: .9; }

.reponse .n {
  margin-left: auto;
  padding-left: 14px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  opacity: .85;
}

/* média (photo / vidéo) */
.media {
  display: grid;
  place-items: center;
  max-height: 52vh;
  border-radius: var(--r);
  overflow: hidden;
  background: #000;
  box-shadow: 0 30px 60px -25px rgba(0, 0, 0, .8);
}

.media img,
.media video {
  display: block;
  max-width: 100%;
  max-height: 52vh;
}

.media--plein { max-height: 74vh; }
.media--plein img,
.media--plein video { max-height: 74vh; }

/* le compteur de réponses reçues */
.compteur {
  font-size: clamp(17px, 1.6vw, 24px);
  font-weight: 600;
  color: var(--craie-doux);
  text-align: center;
}

.compteur b {
  color: var(--ampoule);
  font-variant-numeric: tabular-nums;
}

/* les prénoms qui arrivent pendant l'accueil */
.arrivants {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  max-height: 40vh;
  overflow: hidden;
}

.arrivants span {
  padding: 9px 18px;
  font-size: clamp(16px, 1.5vw, 24px);
  font-weight: 600;
  color: var(--nuit);
  background: var(--craie);
  border-radius: 99px;
  animation: arrive .5s cubic-bezier(.2, 1.4, .4, 1) both;
}

@keyframes arrive {
  from { opacity: 0; transform: translateY(14px) scale(.85); }
}

/* le gagnant */
.gagnant {
  text-align: center;
  padding: 40px 20px;
}

.gagnant__nom {
  font-family: var(--display);
  font-size: clamp(48px, 8vw, 110px);
  line-height: 1.05;
  color: var(--ampoule);
  text-shadow: 0 0 60px rgba(255, 155, 77, .5);
}

.gagnant__lot {
  font-family: var(--display);
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 34px);
  color: var(--craie-doux);
  margin-top: 14px;
}

/* ================================================================== ADMIN */
.admin .contenu {
  max-width: 980px;
  justify-content: flex-start;
  padding-top: 18px;
}

.admin__barre {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  background: rgba(251, 243, 231, .06);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px rgba(251, 243, 231, .12);
}

.admin__phase {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--nuit);
  background: var(--ampoule);
  border-radius: 99px;
}

.admin__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.admin__actions .btn { width: auto; flex: 1 1 190px; }

.admin__grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 760px) {
  .admin__grille { grid-template-columns: 1fr; }
}

.bloc {
  padding: 18px;
  background: rgba(251, 243, 231, .05);
  border-radius: var(--r);
  box-shadow: inset 0 0 0 1px rgba(251, 243, 231, .12);
}

.bloc h3 {
  font-size: 13px;
  font-family: var(--texte);
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--craie-doux);
  margin-bottom: 12px;
}

.solution {
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: rgba(82, 209, 154, .16);
  box-shadow: inset 0 0 0 1.5px var(--juste);
  font-weight: 600;
}

.tableau {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.tableau th,
.tableau td {
  padding: 8px 6px;
  text-align: left;
  border-bottom: 1px solid rgba(251, 243, 231, .12);
}

.tableau th {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--craie-doux);
}

.tableau td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ============================================================== confettis */
#confettis {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 90;
}

/* ============================================================== affiche QR */
.affiche {
  background: var(--craie);
  color: var(--nuit);
}

.affiche .page { min-height: auto; }

.affiche__carte {
  width: 190mm;
  max-width: 100%;
  margin: 0 auto;
  padding: 22mm 16mm;
  text-align: center;
}

.affiche__carte h1 {
  font-size: 44px;
  color: var(--nuit);
}

.affiche__qr {
  display: grid;
  place-items: center;
  width: 78mm;
  height: 78mm;
  margin: 10mm auto;
  border: 2px solid var(--nuit);
  border-radius: 10px;
  overflow: hidden;
}

.affiche__qr img { width: 100%; height: 100%; object-fit: contain; }

.affiche__url {
  font-family: var(--texte);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .02em;
  word-break: break-all;
}

.affiche__etapes {
  display: grid;
  gap: 8px;
  max-width: 120mm;
  margin: 8mm auto 0;
  text-align: left;
  color: #4a4a68;
}

@media print {
  .affiche .noprint { display: none !important; }
  body.affiche { background: #fff; }
}

/* ======================================================== accessibilité */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
