@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,500;0,600;0,700;1,500&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --nuit: #101a16;
  --foret: #17261f;
  --foret-2: #1f3329;
  --ligne: rgba(234, 222, 196, .14);
  --ivoire: #f3ecdd;
  --ivoire-doux: rgba(243, 236, 221, .68);
  --or: #c9a45c;
  --or-clair: #e3c88f;
  --bordeaux: #8c2f3c;
  --vert: #4f9a6b;
  --rouge: #c0504d;
  --a: #c9a45c; --b: #6f9c8c; --c: #a35a64; --d: #6c7fa8;
  --serif: 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rayon: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--sans);
  color: var(--ivoire);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(201,164,92,.16), transparent 60%),
    radial-gradient(ellipse at 100% 120%, rgba(140,47,60,.18), transparent 55%),
    var(--nuit);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: lining-nums;
}
button { font: inherit; cursor: pointer; }
input, select { font: inherit; }
.cache { display: none !important; }

.surtitre { font-size: .78rem; letter-spacing: .28em; text-transform: uppercase; color: var(--or); font-weight: 600; }
.titre-serif { font-family: var(--serif); font-weight: 600; line-height: 1.05; }
.ornement { display: flex; align-items: center; gap: 14px; color: var(--or); }
.ornement::before, .ornement::after { content: ''; height: 1px; flex: 1; background: linear-gradient(90deg, transparent, var(--or), transparent); }

/* ------------------------------------------------------------------ Boutons */
.btn {
  border: 1px solid var(--ligne); background: var(--foret-2); color: var(--ivoire);
  padding: 10px 16px; border-radius: 10px; font-weight: 600; transition: transform .08s, background .15s, opacity .15s;
}
.btn:hover { background: #284236; }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-or { background: linear-gradient(180deg, var(--or-clair), var(--or)); color: #1b1407; border-color: transparent; }
.btn-or:hover { background: linear-gradient(180deg, #ecd5a2, #d3b06a); }
.btn-rouge { background: var(--bordeaux); border-color: transparent; }
.btn-rouge:hover { background: #a03847; }
.btn-fin { padding: 6px 10px; font-size: .85rem; border-radius: 8px; }
.btn-geant { font-size: 1.25rem; padding: 18px 22px; border-radius: 14px; width: 100%; }

/* ------------------------------------------------------------------ Choix A B C D */
.lettre {
  display: inline-grid; place-items: center; width: 1.9em; height: 1.9em; border-radius: 50%;
  font-weight: 700; color: #14100a; flex: none;
}
.c0 .lettre, .lettre.c0 { background: var(--a); }
.c1 .lettre, .lettre.c1 { background: var(--b); }
.c2 .lettre, .lettre.c2 { background: var(--c); }
.c3 .lettre, .lettre.c3 { background: var(--d); }

/* ================================================================== ÉCRAN */
body.ecran { overflow: hidden; height: 100vh; }
.ecran-cadre { height: 100vh; display: flex; flex-direction: column; padding: 3.2vh 4vw; }
.ecran-entete { display: flex; justify-content: space-between; align-items: center; font-size: 1.6vh; }
.ecran-entete .marque { font-family: var(--serif); font-size: 2.6vh; letter-spacing: .06em; }
.ecran-entete .progression { color: var(--ivoire-doux); letter-spacing: .14em; text-transform: uppercase; font-weight: 600; }
.vue { flex: 1; display: none; min-height: 0; }
.vue.active { display: flex; animation: apparition .5s ease both; }
@keyframes apparition { from { opacity: 0; transform: translateY(1.5vh); } to { opacity: 1; transform: none; } }

/* Accueil */
.vue-accueil { align-items: center; justify-content: center; gap: 6vw; }
.accueil-texte { max-width: 46vw; }
.accueil-texte h1 { font-size: 9vh; margin: 1.5vh 0 2vh; }
.accueil-texte h1 em { color: var(--or); font-style: italic; }
.accueil-texte p { font-size: 2.3vh; color: var(--ivoire-doux); line-height: 1.5; }
.accueil-qr { text-align: center; }
.accueil-qr .qr { background: #fff; padding: 2vh; border-radius: 22px; width: 38vh; height: 38vh; box-shadow: 0 0 0 1px var(--or), 0 30px 80px rgba(0,0,0,.45); }
.accueil-qr .qr img { width: 100%; height: 100%; display: block; }
.accueil-qr .url { margin-top: 2vh; font-size: 2.4vh; font-weight: 600; letter-spacing: .02em; }
.pastilles { display: flex; flex-wrap: wrap; gap: 1vh; margin-top: 3vh; }
.pastille {
  padding: .8vh 1.6vh; border-radius: 999px; background: var(--foret-2); border: 1px solid var(--ligne);
  font-size: 2vh; font-weight: 600; display: inline-flex; align-items: center; gap: .8vh; transition: all .3s;
}
.pastille.hors-ligne { opacity: .45; }
.pastille.repondu { background: rgba(201,164,92,.22); border-color: var(--or); }
.pastille.juste { background: rgba(79,154,107,.28); border-color: var(--vert); }
.pastille.faux { opacity: .45; }
.pastille .pt { width: .9vh; height: .9vh; border-radius: 50%; background: var(--vert); }
.pastille.hors-ligne .pt { background: #777; }
.compteur-equipes { font-size: 2vh; color: var(--ivoire-doux); margin-top: 3vh; }

/* Annonce de question / manche */
.vue-question { flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.vue-question .manche-num { font-size: 2.4vh; }
.vue-question h2 { font-size: 8vh; margin: 2vh 0; max-width: 80vw; }
.vue-question .coef { display: inline-block; margin-top: 1vh; padding: .6vh 1.6vh; border: 1px solid var(--or); border-radius: 999px; color: var(--or-clair); font-weight: 600; font-size: 2vh; }
.vue-question .num-question { font-family: var(--serif); font-size: 16vh; color: var(--or); line-height: 1; }
.egaliseur { display: flex; gap: .7vh; align-items: flex-end; height: 6vh; margin-top: 4vh; }
.egaliseur i { width: 1.1vh; background: var(--or); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.egaliseur i:nth-child(2) { animation-delay: -.2s } .egaliseur i:nth-child(3) { animation-delay: -.5s }
.egaliseur i:nth-child(4) { animation-delay: -.7s } .egaliseur i:nth-child(5) { animation-delay: -.3s }
@keyframes eq { 0%,100% { height: 20%; } 50% { height: 100%; } }
.egaliseur.arret i { animation-play-state: paused; }

/* Jeu */
.vue-jeu { flex-direction: column; gap: 3vh; padding-top: 2vh; }
.jeu-haut { display: flex; align-items: center; gap: 4vw; }
.jeu-haut .bloc-titre { flex: 1; }
.jeu-haut h2 { font-size: 6.2vh; margin: 1vh 0 0; }
.chrono-rond { position: relative; width: 20vh; height: 20vh; flex: none; margin-bottom: 2.8vh; }
.chrono-rond svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.chrono-rond circle { fill: none; stroke-width: 7; }
.chrono-rond .fond { stroke: var(--ligne); }
.chrono-rond .arc { stroke: var(--or); stroke-linecap: round; transition: stroke .3s; }
.chrono-rond.urgent .arc { stroke: var(--rouge); }
.chrono-rond .valeur { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 9vh; font-weight: 700; }
.chrono-rond .etiquette { position: absolute; bottom: -2.8vh; left: 0; right: 0; text-align: center; font-size: 1.5vh; letter-spacing: .2em; text-transform: uppercase; color: var(--ivoire-doux); }
.grille-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 2.2vh; flex: 1; min-height: 0; }
.choix-ecran {
  display: flex; align-items: center; gap: 2.4vh; padding: 0 3vh; border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02));
  border: 1px solid var(--ligne); font-size: 4.4vh; font-weight: 600; transition: all .5s;
}
.choix-ecran .lettre { font-size: 3vh; }
.choix-ecran.bonne { background: linear-gradient(180deg, rgba(79,154,107,.55), rgba(79,154,107,.3)); border-color: #7fcf9b; transform: scale(1.02); box-shadow: 0 0 60px rgba(79,154,107,.35); }
.choix-ecran.eteint { opacity: .28; }
.jeu-bas { display: flex; align-items: center; justify-content: space-between; gap: 2vw; }
.jeu-bas .pastilles { margin-top: 0; }
.jeu-bas .compte { font-size: 2.2vh; color: var(--ivoire-doux); white-space: nowrap; }
.solution {
  text-align: center; padding: 2vh; border-radius: 18px; border: 1px solid var(--or);
  background: rgba(201,164,92,.1); animation: apparition .6s ease both;
}
.solution .s1 { font-family: var(--serif); font-size: 5vh; font-weight: 700; }
.solution .s2 { font-size: 2.4vh; color: var(--ivoire-doux); margin-top: .6vh; }
.bandeau-etat { text-align: center; font-size: 2.6vh; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--or-clair); }

/* Classement / podium */
.vue-classement { flex-direction: column; align-items: center; justify-content: center; }
.vue-classement h2 { font-size: 7vh; margin: 1vh 0 4vh; }
.liste-classement { width: min(70vw, 1100px); display: flex; flex-direction: column; gap: 1.4vh; }
.ligne-classement {
  display: grid; grid-template-columns: 7vh 1fr 12vh; align-items: center; gap: 2vh;
  padding: 1.6vh 2.4vh; border-radius: 14px; background: var(--foret); border: 1px solid var(--ligne);
  font-size: 3.2vh; position: relative; overflow: hidden; animation: apparition .5s ease both;
}
.ligne-classement .barre { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, rgba(201,164,92,.22), rgba(201,164,92,.05)); z-index: 0; transition: width 1s ease; }
.ligne-classement > *:not(.barre) { position: relative; z-index: 1; }
.ligne-classement .rang { font-family: var(--serif); font-size: 4.4vh; color: var(--or); font-weight: 700; }
.ligne-classement .nom { font-weight: 600; }
.ligne-classement .pts { text-align: right; font-weight: 700; }
.ligne-classement .pts small { font-weight: 500; color: var(--ivoire-doux); font-size: .6em; }

.podium { display: flex; align-items: flex-end; justify-content: center; gap: 2.4vw; margin-top: 3vh; }
.marche { width: 22vw; text-align: center; }
.marche .nom-podium { font-family: var(--serif); font-size: 4.6vh; font-weight: 700; margin-bottom: 1vh; }
.marche .pts-podium { color: var(--ivoire-doux); font-size: 2.2vh; margin-bottom: 1.4vh; }
.marche .socle { border-radius: 16px 16px 0 0; display: grid; place-items: center; font-family: var(--serif); font-size: 12vh; font-weight: 700; color: #1b1407; animation: monte 1.2s cubic-bezier(.2,.8,.2,1) both; transform-origin: bottom; }
.marche.p1 .socle { height: 34vh; background: linear-gradient(180deg, #f0d79b, var(--or)); animation-delay: 1.6s; }
.marche.p2 .socle { height: 24vh; background: linear-gradient(180deg, #e2e2df, #a9aaa6); animation-delay: .8s; }
.marche.p3 .socle { height: 17vh; background: linear-gradient(180deg, #e1b48b, #a7714a); animation-delay: 0s; }
.marche.p1 .nom-podium, .marche.p1 .pts-podium { animation: apparition .6s 2.6s both; }
.marche.p2 .nom-podium, .marche.p2 .pts-podium { animation: apparition .6s 1.8s both; }
.marche.p3 .nom-podium, .marche.p3 .pts-podium { animation: apparition .6s 1s both; }
@keyframes monte { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.autres-podium { margin-top: 3vh; color: var(--ivoire-doux); font-size: 2.2vh; text-align: center; }

/* ================================================================== JOUEURS */
body.jouer { min-height: 100dvh; }
.mobile { max-width: 520px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
.mobile-entete { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--ligne); }
.mobile-entete .eq { font-weight: 700; font-size: 1.05rem; }
.mobile-entete .sc { text-align: right; font-size: .85rem; color: var(--ivoire-doux); }
.mobile-entete .sc b { color: var(--or-clair); font-size: 1.2rem; }
.ecran-mobile { flex: 1; display: none; flex-direction: column; justify-content: center; gap: 18px; padding: 20px 0; }
.ecran-mobile.active { display: flex; animation: apparition .35s ease both; }
.centre { text-align: center; }
.mobile h1 { font-family: var(--serif); font-size: 2.6rem; margin: .3em 0; line-height: 1.05; }
.mobile h2 { font-family: var(--serif); font-size: 2rem; margin: .2em 0; line-height: 1.1; }
.mobile p { color: var(--ivoire-doux); line-height: 1.5; margin: 0; }
.champ { width: 100%; padding: 16px; border-radius: 12px; border: 1px solid var(--ligne); background: rgba(255,255,255,.06); color: var(--ivoire); font-size: 1.15rem; }
.champ:focus { outline: 2px solid var(--or); border-color: transparent; }
.erreur { color: #f0a2a0; min-height: 1.3em; font-size: .95rem; }
.boutons-choix { display: grid; gap: 12px; }
.bouton-choix {
  display: flex; align-items: center; gap: 14px; text-align: left; width: 100%;
  padding: 18px 16px; border-radius: 16px; border: 1px solid var(--ligne); background: var(--foret-2); color: var(--ivoire);
  font-size: 1.15rem; font-weight: 600; min-height: 72px; transition: transform .08s, opacity .2s, background .2s;
}
.bouton-choix .lettre { font-size: 1.05rem; }
.bouton-choix:active { transform: scale(.98); }
.bouton-choix.choisi { background: rgba(201,164,92,.25); border-color: var(--or); }
.bouton-choix.eteint { opacity: .35; }
.bouton-choix.bonne { background: rgba(79,154,107,.35); border-color: #7fcf9b; opacity: 1; }
.barre-chrono { height: 8px; border-radius: 99px; background: var(--ligne); overflow: hidden; }
.barre-chrono i { display: block; height: 100%; background: var(--or); width: 100%; transform-origin: left; }
.barre-chrono.urgent i { background: var(--rouge); }
.chrono-mobile { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ivoire-doux); }
.chrono-mobile b { color: var(--ivoire); font-size: 1.1rem; }
.verdict { font-size: 4.5rem; line-height: 1; }
.carte { background: var(--foret); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; }
.lien-discret { background: none; border: 0; color: var(--ivoire-doux); text-decoration: underline; font-size: .85rem; padding: 8px; }

/* ================================================================== RÉGIE */
body.regie { font-size: 15px; }
.regie-entete { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: rgba(16,26,22,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ligne); flex-wrap: wrap; }
.regie-entete .marque { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin-right: auto; }
.regie-entete .phase { padding: 5px 12px; border-radius: 99px; background: var(--foret-2); font-weight: 600; font-size: .85rem; }
.regie-grille { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); gap: 18px; padding: 18px 20px 40px; align-items: start; }
@media (max-width: 980px) { .regie-grille { grid-template-columns: 1fr; } }
.panneau { background: var(--foret); border: 1px solid var(--ligne); border-radius: var(--rayon); padding: 18px; margin-bottom: 18px; }
.panneau h3 { margin: 0 0 12px; font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; color: var(--or); }
.q-entete { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.q-entete .num { font-family: var(--serif); font-size: 2.4rem; font-weight: 700; }
.q-entete .manche { color: var(--ivoire-doux); }
.q-reponse { margin: 6px 0 14px; font-size: 1.15rem; }
.q-reponse b { color: var(--or-clair); }
.regie-choix { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.regie-choix div { display: flex; gap: 10px; align-items: center; padding: 10px; border-radius: 10px; background: rgba(255,255,255,.04); border: 1px solid transparent; }
.regie-choix div.bonne { border-color: var(--vert); background: rgba(79,154,107,.15); }
.regie-choix .nb { margin-left: auto; font-weight: 700; color: var(--ivoire-doux); }
.actions-principales { display: grid; gap: 10px; }
.actions-ligne { display: flex; gap: 8px; flex-wrap: wrap; }
.actions-ligne .btn { flex: 1; }
.chrono-regie { display: flex; align-items: center; gap: 14px; margin: 14px 0; }
.chrono-regie .val { font-family: var(--serif); font-size: 2.6rem; font-weight: 700; min-width: 2.2ch; text-align: right; }
.chrono-regie .barre-chrono { flex: 1; }
.audio-ligne { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.audio-ligne input[type=range] { flex: 1; accent-color: var(--or); min-width: 140px; }
.audio-info { font-size: .85rem; color: var(--ivoire-doux); }
.alerte { padding: 10px 14px; border-radius: 10px; background: rgba(192,80,77,.18); border: 1px solid rgba(192,80,77,.5); margin-bottom: 12px; }
.alerte button { margin-left: 8px; }
.table { width: 100%; border-collapse: collapse; }
.table td, .table th { padding: 7px 6px; border-bottom: 1px solid var(--ligne); text-align: left; vertical-align: middle; }
.table th { font-size: .75rem; color: var(--ivoire-doux); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.table .droite { text-align: right; white-space: nowrap; }
.point { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--vert); margin-right: 6px; }
.point.off { background: #666; }
.sommaire { max-height: 420px; overflow: auto; }
.sommaire tr { cursor: pointer; }
.sommaire tr:hover td { background: rgba(255,255,255,.04); }
.sommaire tr.courante td { background: rgba(201,164,92,.14); }
.sommaire .manche-ligne td { color: var(--or); font-size: .75rem; letter-spacing: .14em; text-transform: uppercase; cursor: default; background: none !important; padding-top: 14px; }
.tag { font-size: .72rem; padding: 2px 7px; border-radius: 99px; background: var(--foret-2); color: var(--ivoire-doux); }
.tag.ok { background: rgba(79,154,107,.25); color: #a9e2bd; }
.tag.manque { background: rgba(192,80,77,.25); color: #f0a2a0; }
.form-ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; }
.form-ligne input[type=number] { width: 80px; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--ligne); background: rgba(255,255,255,.06); color: var(--ivoire); }
.connexion { max-width: 380px; margin: 14vh auto; padding: 28px; }
.connexion h1 { font-family: var(--serif); font-size: 2.2rem; margin: 6px 0 18px; }
.connexion form { display: grid; gap: 12px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bordeaux); padding: 10px 18px; border-radius: 10px; font-weight: 600; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.liens-ecrans { display: flex; gap: 8px; flex-wrap: wrap; }
.mini-qr { width: 120px; background: #fff; padding: 6px; border-radius: 8px; }

.table a { color: inherit; text-decoration: none; border-bottom: 1px dashed var(--ivoire-doux); }
