/* Plus que Vainqueur — plateau de jeu de nuit, or de couronne, laurier pour la victoire.
   Mise en page : une colonne façon écran de téléphone, centrée sur grand écran. */
:root {
  --nuit: #0f1a2b;
  --nuit-2: #162539;
  --nuit-3: #1e3150;
  --trait: #2b3f5f;
  --or: #e9b949;
  --or-vif: #f6cf6a;
  --or-pale: #f7e4b2;
  --texte: #f4efe4;
  --texte-2: #a7b3c7;
  --laurier: #5cc08a;
  --braise: #e8664f;
  --f-titre: "DM Serif Display", "Georgia", "Times New Roman", serif;
  --f-texte: "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; background: var(--nuit);
  background-image: radial-gradient(120% 60% at 50% -10%, #1f3556 0%, transparent 60%);
  background-attachment: fixed; color: var(--texte); font-family: var(--f-texte); font-size: 16px; line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
#app {
  max-width: 520px; margin: 0 auto; min-height: 100%;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(12px + env(safe-area-inset-top, 0px)) calc(24px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 18px;
}
h1, h2, h3 { font-family: var(--f-titre); font-weight: 400; margin: 0; text-wrap: balance; line-height: 1.15; }
h1 { font-size: 2.1rem; } h2 { font-size: 1.55rem; } h3 { font-size: 1.2rem; }
p { margin: 0; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--or-vif); outline-offset: 3px; }
.etiquette { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--texte-2); font-weight: 700; }
.discret { color: var(--texte-2); font-size: .92rem; }
.petit-texte { font-size: .8rem; }
.centre { text-align: center; }
.or { color: var(--or); }
.nombres { font-variant-numeric: tabular-nums; }
.rangee { display: flex; gap: 8px; align-items: center; }
.cale { width: 44px; flex: none; }
.h3 { display: block; font-family: var(--f-titre); font-weight: 400; font-size: 1.15rem; line-height: 1.2; }
.p { display: block; font-size: .86rem; color: var(--texte-2); }

/* ---------- Barre du haut ---------- */
.barre { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.titre-barre { font-size: 1.2rem; flex: 1; text-align: center; }
.btn-icone { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--trait); background: var(--nuit-2); display: grid; place-items: center; flex: none; }
.btn-icone svg { width: 20px; height: 20px; }
.chip-compte { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px; border-radius: 99px; border: 1px solid var(--trait); background: var(--nuit-2); font-weight: 700; font-size: .9rem; max-width: 52%; }
.chip-compte span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge-plus { font-size: .74rem; font-weight: 800; letter-spacing: .06em; color: var(--nuit); background: var(--or); padding: 3px 9px; border-radius: 99px; }

/* ---------- Accueil ---------- */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.logo { width: 120px; height: 120px; }
.logo.petit { width: 72px; height: 72px; }
.hero h1 { font-size: 2.3rem; }
.hero h1 em { font-style: normal; color: var(--or); }
.verset { font-family: var(--f-titre); font-size: 1rem; color: var(--or-pale); max-width: 34ch; }
.verset cite { display: block; font-family: var(--f-texte); font-style: normal; font-size: .76rem; color: var(--texte-2); margin-top: 4px; letter-spacing: .06em; }
.modes { display: grid; gap: 10px; }
.mode { display: grid; grid-template-columns: 50px 1fr; align-items: center; gap: 14px; text-align: left; width: 100%; padding: 14px 16px; border-radius: var(--r); background: var(--nuit-2); border: 1px solid var(--trait); transition: transform .15s, border-color .15s; }
.mode:hover { border-color: var(--or); }
.mode:active { transform: scale(.98); }
.mode .ico { width: 50px; height: 50px; border-radius: 12px; display: grid; place-items: center; background: var(--nuit-3); color: var(--or); }
.mode .ico svg { width: 26px; height: 26px; }
.mode.principal { background: linear-gradient(135deg, #24395c, #172840); border-color: #3a5480; }
.quota { text-align: center; font-size: .88rem; color: var(--texte-2); }
.lien { background: none; border: 0; color: var(--texte-2); text-decoration: underline; text-underline-offset: 3px; padding: 4px; font-size: .9rem; }
.lien.or { color: var(--or); font-weight: 700; }
.jour { display: flex; gap: 14px; align-items: center; padding: 12px 16px; border-radius: var(--r); border: 1px dashed #4a5f80; width: 100%; text-align: left; background: transparent; }
.jour .num { font-family: var(--f-titre); font-size: 1.8rem; color: var(--or); line-height: 1; min-width: 2ch; text-align: center; }
.jour.fait { opacity: .7; }
.invitation { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--or); background: rgba(233,185,73,.1); text-align: left; margin-bottom: 8px; }

/* ---------- Formulaires et listes ---------- */
.champ { display: grid; gap: 8px; }
.champ label { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 8px; }
.champ input { width: 100%; padding: 13px 15px; border-radius: 12px; border: 1px solid var(--trait); background: var(--nuit-2); color: var(--texte); font: inherit; }
.champ input:focus { border-color: var(--or); outline: none; }
.code-input { font-size: 1.5rem !important; letter-spacing: .35em; text-align: center; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.ligne-form { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: end; }
.message { padding: 12px 14px; border-radius: 12px; font-size: .92rem; }
.message.erreur { background: rgba(232,102,79,.12); border: 1px solid var(--braise); }
.message.info { background: rgba(92,192,138,.1); border: 1px solid var(--laurier); }
.niveaux { display: flex; gap: 8px; flex-wrap: wrap; }
.puce { padding: 8px 14px; border-radius: 99px; border: 1px solid var(--trait); background: var(--nuit-2); font-size: .88rem; font-weight: 600; }
.puce[aria-pressed="true"] { background: var(--or); color: var(--nuit); border-color: var(--or); }
.choix-liste { display: grid; gap: 8px; }
.option-ligne { display: flex; flex-direction: column; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--trait); background: var(--nuit-2); }
.option-ligne[aria-pressed="true"] { border: 2px solid var(--or); padding: 11px 13px; background: #1c2f4b; }
.joueurs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pastille { width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: none; }
.liste { list-style: none; margin: 0; padding: 0; display: grid; }
.liste li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 2px; border-bottom: 1px solid var(--trait); min-width: 0; }
.liste li > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; }
.point { width: 9px; height: 9px; border-radius: 50%; background: var(--trait); display: inline-block; flex: none; }
.point.vert { background: var(--laurier); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; padding: 15px 20px; border-radius: 99px; border: 0; font-weight: 800; font-size: 1rem; background: var(--or); color: var(--nuit); text-decoration: none; text-align: center; }
.btn:hover { background: var(--or-vif); }
.btn.second { background: transparent; color: var(--texte); border: 1px solid var(--trait); }
.btn.second:hover { border-color: var(--or); }
.btn.petit { width: auto; padding: 9px 14px; font-size: .86rem; }
.btn:disabled { opacity: .5; cursor: default; }
.actions { display: grid; gap: 10px; }

/* ---------- Règles ---------- */
.regle { display: grid; gap: 6px; padding: 16px; border-radius: var(--r); background: var(--nuit-2); border: 1px solid var(--trait); }
.ref { font-size: .85rem; color: var(--or-pale); }

/* ---------- Salon ---------- */
.code-salon { display: grid; justify-items: center; gap: 8px; text-align: center; }
.code { display: inline-flex; align-items: center; gap: 12px; font-family: var(--f-titre); font-size: 2.4rem; letter-spacing: .14em; color: var(--or); background: var(--nuit-2); border: 1px dashed var(--or); border-radius: 14px; padding: 8px 18px; }
.code svg { color: var(--texte-2); }
.recherche { display: grid; place-items: center; }
.tourne { animation: tourne 3s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }

/* ---------- Jeu : en-tête et tableau des scores ---------- */
.jeu { display: flex; flex-direction: column; gap: 14px; }
.hud { display: flex; align-items: center; gap: 10px; }
.hud-titre { flex: 1; display: grid; justify-items: center; text-align: center; }
.valeur { font-family: var(--f-titre); color: var(--or); font-size: 1.05rem; }
.tableau { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tableau[data-n="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tableau:empty { display: none; }
.joueur { position: relative; display: grid; gap: 2px; padding: 8px 8px 9px; border-radius: 12px; background: var(--nuit-2); border: 1px solid var(--trait); min-width: 0; border-top: 3px solid var(--c); transition: transform .2s, box-shadow .2s; }
.joueur .nom { font-size: .74rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 2px; color: var(--texte-2); }
.joueur.moi .nom { color: var(--texte); }
.joueur .sc { font-family: var(--f-titre); font-size: 1.35rem; line-height: 1.1; display: flex; align-items: center; gap: 2px; }
.joueur .sc svg { color: var(--laurier); }
.mini-jauge { height: 4px; border-radius: 2px; background: var(--trait); overflow: hidden; }
.mini-jauge i { display: block; height: 100%; background: var(--c); }
.joueur.buzz { box-shadow: 0 0 0 2px var(--c), 0 0 22px -2px var(--c); transform: translateY(-2px); }
.joueur.actif { box-shadow: 0 0 0 2px var(--c); }
.joueur.qualifie { background: #183a2e; }
.joueur.elimine { opacity: .4; }
.joueur.elimine .sc svg { color: var(--braise); }

/* ---------- Annonces d'étape ---------- */
.annonce { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 18px 8px; }
.annonce h1 { font-size: 2.3rem; color: var(--or); }
.annonce p { max-width: 36ch; }
.duel-noms { font-family: var(--f-titre); font-size: 1.5rem; }
.duel-noms em { font-style: normal; color: var(--texte-2); font-size: 1rem; margin: 0 6px; }

/* ---------- Question ---------- */
.carte-question { background: var(--nuit-2); border: 1px solid var(--trait); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.carte-question h2 { font-size: 1.4rem; }
.enonce .mot { opacity: 0; transition: opacity .15s; }
.enonce .mot.vu { opacity: 1; }
.jauge { width: 100%; height: 6px; border-radius: 3px; background: var(--trait); overflow: hidden; }
.jauge.fine { height: 3px; }
.jauge i { display: block; height: 100%; width: 100%; background: var(--or); border-radius: 3px; }
.jauge.urgent i { background: var(--braise); }
.statut-buzz { display: grid; gap: 8px; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--c); background: var(--nuit-2); text-align: center; }
.statut-buzz strong { color: var(--c); }
.statut-buzz .jauge i { background: var(--c); }
.erreur-flash { text-align: center; color: var(--braise); font-weight: 600; font-size: .92rem; }

/* Buzzer */
.zone-buzz { display: grid; justify-items: center; gap: 8px; padding-top: 6px; }
.buzzer {
  width: min(62vw, 220px); aspect-ratio: 1; max-width: 100%; border-radius: 50%; border: 0;
  background: radial-gradient(circle at 35% 30%, #ffe08a, var(--c) 55%, #8a6414 100%);
  color: #2a1c02; font-weight: 900; font-size: 1.7rem; letter-spacing: .08em;
  box-shadow: 0 10px 0 #6b4c0d, 0 18px 30px rgba(0,0,0,.45); transition: transform .08s, box-shadow .08s;
}
.buzzer:active:not(:disabled) { transform: translateY(8px); box-shadow: 0 2px 0 #6b4c0d, 0 6px 14px rgba(0,0,0,.4); }
.buzzer:disabled { filter: grayscale(.8) brightness(.6); font-size: 1rem; cursor: default; padding: 20px; }
.pads { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pad { display: grid; place-items: center; gap: 4px; min-height: 104px; border-radius: 16px; border: 0; background: var(--c); color: #111a28; font-weight: 800; box-shadow: 0 6px 0 rgba(0,0,0,.35); }
.pad b { font-size: 1.3rem; letter-spacing: .08em; }
.pad:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 1px 0 rgba(0,0,0,.35); }
.pad:disabled { opacity: .35; cursor: default; }

/* Réponses en forme de plateau télé */
.reponses { display: grid; gap: 9px; }
.rep {
  --coin: 14px; display: grid; grid-template-columns: 32px 1fr; align-items: center; gap: 12px;
  width: 100%; text-align: left; padding: 12px 20px; min-height: 54px; border: 0; background: var(--nuit-3); color: var(--texte); font-weight: 600;
  clip-path: polygon(var(--coin) 0, calc(100% - var(--coin)) 0, 100% 50%, calc(100% - var(--coin)) 100%, var(--coin) 100%, 0 50%);
  transition: background .2s, transform .1s;
}
.rep:not(:disabled):hover { background: #284066; }
.rep:not(:disabled):active { transform: scale(.98); }
.rep .lettre { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: var(--nuit); color: var(--or); }
.reponses.passif .rep { cursor: default; }
.rep.bonne { background: var(--laurier); color: #062314; }
.rep.bonne .lettre { background: #0b3a22; color: #c8f2da; }
.rep.mauvaise { background: var(--braise); color: #2b0c06; }
.rep.mauvaise .lettre { background: #4a160c; color: #ffd6cc; }
.rep.estompe { opacity: .45; }
.rep.barree span:last-child { text-decoration: line-through; opacity: .5; }
.retour { border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; background: var(--nuit-2); border: 1px solid var(--trait); }
.retour strong { font-family: var(--f-titre); font-size: 1.2rem; font-weight: 400; }
.retour.ok strong { color: var(--laurier); }
.retour.ko strong { color: var(--braise); }

/* 4 évangiles */
.grille-themes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.theme { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--r); text-align: left; background: var(--nuit-2); border: 1px solid var(--trait); min-height: 104px; }
.theme:not(:disabled):hover { border-color: var(--or); }
.theme .glyphe { color: var(--or); width: 26px; height: 26px; }
.theme.pris { opacity: .4; }
.theme:disabled { cursor: default; }
.tete4 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.serie { display: flex; gap: 6px; }
.serie i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--or); }
.serie i.on { background: var(--or); }
.chrono4 { text-align: right; font-weight: 800; font-size: .9rem; color: var(--texte-2); margin-top: -8px; }

/* ---------- Résultat ---------- */
.resultat { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.gros-score { font-family: var(--f-titre); font-size: 4rem; line-height: 1; color: var(--or); font-variant-numeric: tabular-nums; }
.gros-score small { font-size: 1.6rem; color: var(--texte-2); }
.podium { list-style: none; margin: 0; padding: 0; width: 100%; display: grid; gap: 8px; }
.podium li { display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--nuit-2); border: 1px solid var(--trait); border-left: 4px solid var(--c); text-align: left; }
.podium li:first-child { background: #2a3a26; border-color: var(--or); border-left-color: var(--c); }
.podium li.moi .qui { font-weight: 800; }
.podium .place { font-family: var(--f-titre); font-size: 1.5rem; color: var(--or); }
.lignes { width: 100%; display: grid; border-top: 1px solid var(--trait); }
.lignes div { display: flex; justify-content: space-between; padding: 10px 2px; border-bottom: 1px solid var(--trait); font-variant-numeric: tabular-nums; }
.lignes span:first-child { color: var(--texte-2); }
.lignes span:last-child { font-weight: 700; }
.badge-gagne { display: flex; gap: 12px; align-items: center; text-align: left; width: 100%; padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--or); background: rgba(233,185,73,.08); }
.badge-gagne svg { color: var(--or); flex: none; }

/* ---------- Abonnement ---------- */
.offre-hero { text-align: center; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.avantages { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.avantages li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: start; }
.avantages svg { width: 22px; height: 22px; color: var(--laurier); }
.plans { display: grid; gap: 12px; }
.plan { position: relative; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 18px; border-radius: var(--r); background: var(--nuit-2); border: 1px solid var(--trait); text-align: left; width: 100%; }
.plan[aria-checked="true"] { border: 2px solid var(--or); padding: 17px; background: #1c2f4b; }
.plan .prix { font-family: var(--f-titre); font-size: 1.7rem; color: var(--or); text-align: right; line-height: 1.1; }
.plan .prix small { display: block; font-family: var(--f-texte); font-size: .76rem; color: var(--texte-2); }
.plan .mention { font-size: .82rem; color: var(--laurier); font-weight: 700; display: block; }
.plan .ruban { position: absolute; top: -11px; left: 16px; background: var(--laurier); color: #062314; font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 10px; border-radius: 99px; }

/* ---------- Statistiques et badges ---------- */
.tuiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tuile { padding: 14px; border-radius: var(--r); background: var(--nuit-2); border: 1px solid var(--trait); }
.tuile b { display: block; font-family: var(--f-titre); font-weight: 400; font-size: 1.8rem; color: var(--or); line-height: 1.1; font-variant-numeric: tabular-nums; }
.tuile span { font-size: .8rem; color: var(--texte-2); }
.badges { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.badge { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px 6px; border-radius: var(--r); border: 1px solid var(--trait); background: var(--nuit-2); font-size: .76rem; line-height: 1.25; }
.badge svg { width: 32px; height: 32px; color: var(--or); }
.badge .discret { font-size: .68rem; }
.badge.verrouille { opacity: .38; }
.badge.verrouille svg { color: var(--texte-2); }

/* ---------- Réglages ---------- */
.reglage { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--trait); }
.interrupteur { width: 52px; height: 30px; border-radius: 99px; border: 0; background: var(--trait); position: relative; flex: none; }
.interrupteur::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--texte); transition: transform .2s; }
.interrupteur[aria-checked="true"] { background: var(--laurier); }
.interrupteur[aria-checked="true"]::after { transform: translateX(22px); }

/* ---------- Fenêtre et toast ---------- */
.voile { position: fixed; inset: 0; background: rgba(5,10,18,.72); display: grid; place-items: end center; z-index: 20;
  padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(16px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.fenetre { width: 100%; max-width: 448px; background: var(--nuit-2); border: 1px solid var(--trait); border-radius: 20px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); background: var(--texte); color: var(--nuit); padding: 10px 18px; border-radius: 99px; font-weight: 700; font-size: .9rem; z-index: 30; max-width: calc(100% - 32px); text-align: center; }

.entree { animation: entree .35s ease both; }
@keyframes entree { from { opacity: .001; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 370px) {
  .hero h1 { font-size: 1.9rem; }
  .joueurs, .grille-themes { grid-template-columns: 1fr; }
  .badges { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .joueur .sc { font-size: 1.1rem; }
}
