/* Palette mariage : ivoire, vert profond, touches dorees.
   Tout est pense telephone d'abord : grandes cibles tactiles, texte lisible
   dans une salle mal eclairee, aucune animation qui ferait ramer un vieux
   telephone sur un wifi sature. */

:root {
  --ivory:      #faf6f0;
  --ivory-2:    #f2ebe0;
  --ink:        #22301f;
  --ink-soft:   #5a6b58;
  --green:      #2f4a35;
  --green-deep: #1e3223;
  --gold:       #b08d4f;
  --gold-soft:  #e6d5b0;
  --rose:       #b95f78;
  --blue:       #4a6fa5;
  --line:       rgba(34, 48, 31, 0.14);
  --shadow:     0 2px 10px rgba(30, 50, 35, 0.08);
  --radius:     16px;
}

* { box-sizing: border-box; }

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

body {
  background: linear-gradient(170deg, var(--ivory) 0%, var(--ivory-2) 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

.wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

/* ---------- Titres ---------- */
.display {
  font-family: "Didot", "Playfair Display", Georgia, "Times New Roman", serif;
  font-weight: 400;
  letter-spacing: 0.01em;
}

h1.display {
  font-size: clamp(28px, 8vw, 40px);
  margin: 0 0 4px;
  text-align: center;
  color: var(--green-deep);
}

.subtitle {
  text-align: center;
  color: var(--ink-soft);
  margin: 0 0 28px;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rule {
  width: 64px;
  height: 1px;
  background: var(--gold);
  border: 0;
  margin: 18px auto 26px;
}

/* ---------- Blocs ---------- */
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card--quiet { background: rgba(255, 255, 255, 0.6); box-shadow: none; }

.label {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0 0 10px;
  font-weight: 600;
}

.muted { color: var(--ink-soft); }
.center { text-align: center; }
.small { font-size: 14px; }

/* ---------- Boutons ---------- */
.btn {
  display: block;
  width: 100%;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
  font-size: 17px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: transform 0.06s ease, opacity 0.15s ease;
}

.btn:active { transform: scale(0.985); }
.btn:disabled { opacity: 0.45; cursor: default; }

.btn--ghost {
  background: transparent;
  color: var(--green);
}

.btn--danger { background: #a2402f; border-color: #a2402f; }
.btn--small { padding: 10px 14px; font-size: 15px; width: auto; display: inline-block; }

/* ---------- Choix de reponse : les 3 gros boutons ---------- */
.choices { display: grid; gap: 14px; margin-top: 22px; }

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 84px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-family: "Didot", "Playfair Display", Georgia, serif;
  font-size: clamp(20px, 6vw, 26px);
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, border-color 0.15s ease, background 0.15s ease;
}

.choice:active { transform: scale(0.98); }

/* Chaque choix porte sa propre couleur dans --c, ce qui evite la bataille de
   specificite d'avant : les etats « selectionne » et « bonne reponse » se
   contentent de reutiliser --c au lieu d'imposer une couleur fixe.
   --c-text : la couleur du texte sur fond blanc (assombrie pour le jaune,
   illisible sinon). --on-c : le texte une fois le bouton rempli. */
.choice[data-choice="marion"] {
  --c: #e0b02c;
  --c-soft: rgba(224, 176, 44, 0.55);
  --c-text: #9c7409;
  --on-c: #3a2c05;
}

.choice[data-choice="desaccord"] {
  --c: #767c86;
  --c-soft: rgba(118, 124, 134, 0.45);
  --c-text: #5b6068;
  --on-c: #fff;
}

.choice[data-choice="guillaume"] {
  --c: #2f6b40;
  --c-soft: rgba(47, 107, 64, 0.45);
  --c-text: #2f6b40;
  --on-c: #fff;
}

.choice[data-choice] {
  border-color: var(--c-soft);
  color: var(--c-text);
}

/* Selectionne : le bouton se remplit de sa propre couleur. */
.choice[aria-pressed="true"] {
  background: var(--c);
  border-color: var(--c);
  color: var(--on-c);
}

/* Bonne reponse : meme remplissage. Comme « Guillaume » est desormais vert,
   la couleur seule ne suffit plus a signaler la bonne reponse — c'est
   l'etiquette « Bonne reponse » qui la designe. */
.choice.choice--correct {
  background: var(--c);
  border-color: var(--c);
  color: var(--on-c);
  box-shadow: 0 0 0 3px rgba(34, 48, 31, 0.12);
}

.choice.choice--wrong { opacity: 0.35; }


.choice__tag {
  position: absolute;
  top: 8px;
  right: 12px;
  font-family: "Avenir Next", system-ui, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.85;
}

/* ---------- Liste d'equipes ---------- */
.team-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }

.team-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.team-item:active { background: var(--ivory-2); }
.team-item__meta { color: var(--ink-soft); font-size: 13px; white-space: nowrap; }

/* ---------- Classement ---------- */
.board { width: 100%; border-collapse: collapse; }
.board td { padding: 11px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.board tr:last-child td { border-bottom: 0; }
.board .rank { width: 44px; color: var(--gold); font-family: "Didot", Georgia, serif; font-size: 20px; }
.board .pts  { text-align: right; white-space: nowrap; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.board tr.is-you td { background: rgba(176, 141, 79, 0.1); font-weight: 600; }
.board tr.is-you .pts { color: var(--ink); }

/* ---------- Divers ---------- */
.field {
  width: 100%;
  padding: 15px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 17px;
  color: var(--ink);
  margin-bottom: 12px;
}

.field:focus { outline: 2px solid var(--gold-soft); outline-offset: 1px; }

.pill {
  display: inline-block;
  flex: none;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #6b5320;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
}

.error {
  background: #fbe9e6;
  border: 1px solid #e0b4ab;
  color: #8c3a2a;
  padding: 12px 14px;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 15px;
}

.progress { display: flex; gap: 4px; margin-bottom: 18px; }
.progress__step { flex: 1; height: 3px; border-radius: 2px; background: var(--line); }
.progress__step.done { background: var(--gold); }
.progress__step.now  { background: var(--green); }

.footer-note { text-align: center; margin-top: 26px; font-size: 13px; color: var(--ink-soft); }
.footer-note button { background: none; border: 0; color: var(--ink-soft); text-decoration: underline; font: inherit; cursor: pointer; padding: 0; }

.big-status {
  font-family: "Didot", Georgia, serif;
  font-size: clamp(24px, 7vw, 32px);
  text-align: center;
  margin: 6px 0 4px;
}

/* Ligne d'attente du salon : plus petite, pour tenir sur une seule ligne
   même sur les petits téléphones une fois les points affichés. */
.big-status--waiting {
  font-size: clamp(17px, 4.8vw, 21px);
}

/* Largeur fixe : sans cela le texte se recentre à chaque point qui apparaît,
   et finit par passer sur deux lignes. Le `text-align: left` colle les points
   au mot qui précède. */
.waiting-dots::after {
  content: '';
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: dots 1.4s steps(4, end) infinite;
}

@keyframes dots {
  0%   { content: ''; }
  25%  { content: '.'; }
  50%  { content: '..'; }
  75%  { content: '...'; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ---------- Boutons de désignation, côté régie ----------
   Mêmes couleurs que côté invité pour que l'animateur retrouve ses repères,
   mais en plus compact : la régie tient sur un écran de téléphone. */
.choices--admin { gap: 8px; margin-top: 0; }

.choice--mini {
  min-height: 52px;
  font-size: clamp(16px, 4.5vw, 19px);
  border-radius: 12px;
  box-shadow: none;
}

/* Bloc de réponse non cliquable, réutilisant l'apparence d'un bouton rempli. */
.choice--static {
  cursor: default;
  width: 100%;
  margin: 0;
}

/* Liseré discret rappelant le résultat, en plus du texte. */
.verdict { border-left: 4px solid var(--line); }
.verdict--win  { border-left-color: #2f6b40; }
.verdict--lose { border-left-color: rgba(34, 48, 31, 0.18); }

/* Réponses figées : les choix non retenus s'effacent, celui de l'équipe reste
   bien lisible pendant que l'animateur interroge les mariés. */
.choices--locked .choice:not([aria-pressed="true"]) { opacity: 0.4; }

/* ---------- Bandeau du haut, côté invité ----------
   Trois colonnes : le bouton à gauche, un cache de même largeur à droite.
   Sans ce cache, le nom d'équipe serait décentré de la largeur du bouton. */
.topbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
}

.topbar__team {
  flex: 1;
  min-width: 0;         /* autorise l'ellipse sur les noms d'équipe longs */
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.topbar__team #team-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar__spacer { flex: none; width: 44px; }

.leave-btn {
  flex: none;
  width: 44px;
  height: 44px;          /* cible tactile confortable */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.leave-btn:active { background: var(--ivory-2); }
