/* Code des régates — Jeunes. Couleurs inspirées de la charte FFAviron. */

:root {
  color-scheme: light;
  --navy: #00205B;
  --navy-deep: #001233;
  --teal: #00B388;
  --teal-pale: #D9F1EA;
  --red: #DA291C;
  --red-pale: #FBE1DE;
  --sky: #AFCDD7;
  --sky-pale: #EAF2F5;
  --cream: #F4F6F7;
  --paper: #FFFFFF;
  --ink: #17233B;
  --soft: #55606B;
  --line: #D7DEE3;
  --jaune: #FFC845;
  /* couleurs des réponses du quiz */
  --k0: #E21B3C;
  --k1: #1368CE;
  --k2: #C98A00;
  --k3: #26890C;
  --rayon: 16px;
  --ombre: 0 6px 20px rgba(0, 32, 91, .12);
  --titre: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --texte: 'Barlow', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 17px/1.5 var(--texte);
}
img { max-width: 100%; display: block; }
a { color: var(--navy); }
h1, h2, h3 { font-family: var(--titre); line-height: 1.1; margin: 0 0 .4em; color: var(--navy); }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); font-weight: 800; }
h2 { font-size: clamp(1.5rem, 4vw, 2rem); font-weight: 700; }
h3 { font-size: 1.3rem; font-weight: 700; }
p { margin: 0 0 .8em; }
.surtitre { font-family: var(--titre); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--teal); margin: 0 0 .3em; }

/* ---------- Boutons ---------- */
.boutons { display: flex; flex-wrap: wrap; gap: 12px; }
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; border: 2px solid transparent;
  font: 700 1.05rem var(--texte); text-decoration: none; cursor: pointer; transition: transform .1s, filter .15s;
}
.bouton:active { transform: scale(.97); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.bouton-principal { background: var(--teal); color: #fff; }
.bouton-principal:hover:not(:disabled) { filter: brightness(1.07); }
.bouton-clair { background: #fff; color: var(--navy); }
.bouton-contour { background: transparent; color: var(--navy); border-color: var(--navy); }
.bouton-geant { min-height: 64px; font-size: 1.3rem; padding: 14px 32px; }

/* ---------- Barre du haut / pied ---------- */
.barre {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: var(--navy); color: #fff;
}
.marque { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font: 700 1.25rem var(--titre); }
.marque em { font-style: normal; color: var(--jaune); }
.marque-icone { font-size: 1.4rem; }
.barre nav { display: flex; gap: 6px; }
.barre nav a { color: #fff; text-decoration: none; font-weight: 600; padding: 6px 12px; border-radius: 999px; }
.barre nav a:hover { background: rgba(255, 255, 255, .12); }
.barre nav .nav-jouer { background: var(--teal); }
.pied { padding: 28px 16px 40px; text-align: center; color: var(--soft); font-size: .9rem; max-width: 760px; margin: 0 auto; }

/* ---------- Accueil ---------- */
.hero { background: var(--navy) center / cover no-repeat; }
.hero-voile {
  min-height: min(78vh, 620px); display: flex; flex-direction: column; justify-content: flex-end;
  padding: 40px 16px; color: #fff;
  background: linear-gradient(180deg, rgba(0, 18, 51, .1) 0%, rgba(0, 18, 51, .85) 70%);
}
.hero-voile > * { max-width: 760px; margin-left: auto; margin-right: auto; width: 100%; }
.hero h1 { color: #fff; font-size: clamp(2.6rem, 9vw, 4.8rem); }
.hero .surtitre { color: var(--jaune); }
.hero-texte { font-size: 1.15rem; }

.parcours, .bloc-quiz { max-width: 1100px; margin: 0 auto; padding: 40px 16px; }
.frise { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.carte-etape {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--paper); border-radius: var(--rayon); overflow: hidden; box-shadow: var(--ombre);
  text-decoration: none; color: inherit; transition: transform .15s;
}
.carte-etape:hover { transform: translateY(-3px); }
.carte-etape img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.carte-etape .num {
  position: absolute; top: 10px; left: 10px; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--jaune); color: var(--navy); font: 800 1.5rem var(--titre);
}
.carte-texte { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.carte-texte strong { font: 700 1.35rem var(--titre); color: var(--navy); }
.carte-texte span { color: var(--soft); font-size: .95rem; }
.bloc-quiz {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--navy); color: #fff; border-radius: var(--rayon); margin-bottom: 20px;
  max-width: calc(1100px - 32px);
}
.bloc-quiz h2 { color: #fff; }
.bloc-quiz > div:first-child { flex: 1 1 320px; }
.bloc-quiz .bouton-contour { color: #fff; border-color: #fff; }
@media (max-width: 1132px) { .bloc-quiz { margin-left: 16px; margin-right: 16px; } }

/* ---------- Page d'étape ---------- */
.page-etape main { max-width: 1000px; margin: 0 auto; padding: 16px 16px 40px; }
.fil { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: 4px 0 18px; }
.fil a {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--paper); border: 2px solid var(--line); color: var(--soft); font-weight: 700; text-decoration: none;
}
.fil a.fait { border-color: var(--teal); color: var(--teal); }
.fil a.actif { background: var(--navy); border-color: var(--navy); color: #fff; }
.etape-tete { display: grid; gap: 20px; align-items: center; margin-bottom: 24px; }
@media (min-width: 760px) { .etape-tete { grid-template-columns: 1.1fr 1fr; } }
.etape-photo { margin: 0; }
.etape-photo img { border-radius: var(--rayon); aspect-ratio: 3 / 2; object-fit: cover; width: 100%; box-shadow: var(--ombre); }
figcaption { font-size: .85rem; color: var(--soft); margin-top: 6px; }
.accroche { font-size: 1.2rem; }

.regles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); margin-bottom: 28px; }
.regle { display: flex; gap: 14px; background: var(--paper); border-radius: var(--rayon); padding: 16px; box-shadow: var(--ombre); }
.regle-ico { font-size: 2rem; line-height: 1; flex: none; width: 52px; height: 52px; display: grid; place-items: center; background: var(--sky-pale); border-radius: 14px; }
.regle h3 { margin-bottom: .2em; }
.regle p { margin: 0; }

.drapeaux { background: var(--paper); border-radius: var(--rayon); padding: 20px 16px; margin-bottom: 24px; box-shadow: var(--ombre); }
.drapeaux-liste { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.drapeau-carte { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 12px; background: var(--sky-pale); border-radius: 12px; }
.drapeau-carte strong { font-family: var(--titre); font-size: 1.2rem; color: var(--navy); }
.drapeau-carte span { font-size: .95rem; }
.drapeau { width: 90px; height: 90px; }

.schema { margin: 0 0 24px; background: var(--paper); border-radius: var(--rayon); padding: 12px; box-shadow: var(--ombre); }
.schema img { width: 100%; max-width: 640px; margin: 0 auto; }
.schema figcaption { text-align: center; }

.retenir { background: var(--jaune); border-radius: var(--rayon); padding: 18px 20px; margin-bottom: 20px; }
.retenir h2 { font-size: 1.5rem; }
.retenir p { margin: 0; font-size: 1.1rem; font-weight: 500; }
.duo { display: grid; gap: 20px; margin-bottom: 28px; align-items: start; }
@media (min-width: 760px) { .duo { grid-template-columns: 1fr 1fr; } }
.encart { border-radius: var(--rayon); padding: 18px 20px; border-left: 8px solid; }
.encart h2 { font-size: 1.5rem; }
.encart p { margin: 0; }
.encart-securite { background: var(--red-pale); border-color: var(--red); }
.encart-fairplay { background: var(--teal-pale); border-color: var(--teal); }
.photo2 { margin: 0; }
.photo2 img { border-radius: var(--rayon); width: 100%; max-height: 420px; object-fit: cover; }

.quiz-etape {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
  background: var(--navy); color: #fff; border-radius: var(--rayon); padding: 22px 20px; margin-bottom: 24px;
}
.quiz-etape h2 { color: #fff; }
.quiz-etape p { margin: 0; }
.quiz-etape .bouton-contour { color: #fff; border-color: #fff; }
.suite { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Crédits ---------- */
.credits { max-width: 900px; margin: 0 auto; padding: 24px 16px 40px; }
.liste-sources { list-style: none; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
.liste-sources img { border-radius: 10px; aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.liste-sources a { font-size: .85rem; word-break: break-all; }

/* =========================================================
   Quiz — écran de l'animateur (projeté)
   ========================================================= */
.anim { background: var(--navy-deep); color: #fff; min-height: 100vh; }
.anim h1, .anim h2 { color: #fff; }
.ecran { min-height: 100vh; display: flex; flex-direction: column; padding: 20px clamp(16px, 3vw, 40px); }
.retour { color: var(--sky); text-decoration: none; font-weight: 600; display: inline-block; margin-bottom: 12px; }

.choix { max-width: 1100px; margin: 0 auto; width: 100%; }
.choix-grille { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); margin-top: 20px; }
.choix-carte {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 18px; border-radius: var(--rayon); border: 3px solid transparent; cursor: pointer;
  background: var(--navy); color: #fff; font: inherit; transition: transform .1s, border-color .15s;
}
.choix-carte:hover:not(:disabled) { border-color: var(--teal); transform: translateY(-2px); }
.choix-carte.suggere { border-color: var(--jaune); }
.choix-carte .num { font: 800 1.8rem var(--titre); color: var(--jaune); }
.choix-carte strong { font: 700 1.35rem var(--titre); }
.choix-carte span:last-child { color: var(--sky); font-size: .95rem; }
.choix-tout { background: var(--teal); }
.choix-tout span:last-child { color: #fff; }

/* Salle d'attente */
.salle { flex: 1; display: grid; gap: 30px; align-items: center; max-width: 1300px; margin: 0 auto; width: 100%; }
@media (min-width: 900px) { .salle { grid-template-columns: auto 1fr; } }
.salle-rejoindre { text-align: center; background: #fff; color: var(--navy); border-radius: 24px; padding: 24px 28px; }
.salle-rejoindre .surtitre { color: var(--teal); }
.qr { display: inline-block; padding: 10px; background: #fff; }
.qr img, .qr canvas { width: min(260px, 60vw); height: auto; }
.salle-lien { font-weight: 700; font-size: 1.1rem; word-break: break-all; margin: 8px 0 0; }
.salle-code-label { margin: 14px 0 0; text-transform: uppercase; letter-spacing: .1em; font-weight: 700; color: var(--soft); }
.salle-code { font: 800 clamp(4rem, 10vw, 7rem) / 1 var(--titre); letter-spacing: .12em; margin: 0; }
.salle-equipes h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.puces { list-style: none; padding: 0; margin: 0 0 24px; display: flex; flex-wrap: wrap; gap: 10px; min-height: 60px; }
.puces li {
  background: var(--teal); color: #fff; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  font: 700 clamp(1.2rem, 2vw, 1.6rem) var(--titre); animation: arrive .35s ease-out;
}
.puces li:hover { background: var(--red); }
@keyframes arrive { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.aide { color: var(--sky); font-size: .9rem; margin-top: 10px; }

/* Question */
.q-haut { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; font-weight: 700; color: var(--sky); margin-bottom: 12px; }
.q-num { background: var(--navy); padding: 6px 14px; border-radius: 999px; color: #fff; }
.q-code strong { color: var(--jaune); font-size: 1.2em; letter-spacing: .08em; }
.q-corps { flex: 1; display: grid; gap: 20px; align-items: center; grid-template-columns: 1fr; grid-template-areas: "texte" "centre"; }
.q-corps.avec-img { grid-template-areas: "texte" "img" "centre"; }
@media (min-width: 900px) {
  .q-corps { grid-template-columns: 1fr auto; grid-template-areas: "texte centre"; }
  .q-corps.avec-img { grid-template-columns: 1fr minmax(0, 420px) auto; grid-template-areas: "texte img centre"; }
}
.q-texte { grid-area: texte; font-size: clamp(1.8rem, 3.8vw, 3.2rem); font-weight: 700; color: #fff; margin: 0; }
.q-img { grid-area: img; border-radius: var(--rayon); max-height: 34vh; object-fit: cover; width: 100%; }
.q-centre { grid-area: centre; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.q-compteur { margin: 0; font-size: 1.2rem; }
.q-compteur strong { font-size: 1.6em; color: var(--jaune); }
.q-centre .bouton-contour { color: var(--sky); border-color: var(--sky); min-height: 40px; font-size: .95rem; }

.chrono {
  --part: 1;
  width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--teal) calc(var(--part) * 360deg), rgba(255, 255, 255, .12) 0);
  transition: background .2s;
}
.chrono span {
  width: 104px; height: 104px; border-radius: 50%; background: var(--navy-deep);
  display: grid; place-items: center; font: 800 3rem var(--titre);
}
.chrono.urgent { background: conic-gradient(var(--red) calc(var(--part) * 360deg), rgba(255, 255, 255, .12) 0); }
.chrono.lecture { background: rgba(255, 255, 255, .12); }
.chrono.lecture span { font-size: 1.5rem; }

.reponses { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.rep {
  display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: 12px; color: #fff;
  font: 700 clamp(1.2rem, 2.2vw, 1.9rem) / 1.2 var(--texte); min-height: 90px; transition: opacity .3s, transform .3s;
}
.rep-0 { background: var(--k0); }
.rep-1 { background: var(--k1); }
.rep-2 { background: var(--k2); }
.rep-3 { background: var(--k3); }
.forme { font-size: 1.4em; flex: none; width: 1.3em; text-align: center; }
.rep-texte { flex: 1; }
.en-lecture .reponses .rep { opacity: .35; }
.reponses .faux { opacity: .3; }
.reponses .juste { outline: 6px solid #fff; transform: scale(1.02); }
.reponses .juste .rep-texte::after { content: '  ✔'; }
.rep-stat { background: rgba(0, 0, 0, .25); border-radius: 999px; padding: 2px 14px; font-size: .9em; }

.q-corps.correction { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 20px; }
.anim .bouton-contour { color: var(--sky); border-color: var(--sky); }
.explication { background: #fff; color: var(--ink); border-radius: var(--rayon); padding: 18px 22px; font-size: clamp(1.1rem, 1.8vw, 1.5rem); }
.explication strong { color: var(--k3); font-family: var(--titre); font-size: 1.3em; }
.explication p { margin: .3em 0 0; }
.correction .bouton-geant { align-self: flex-end; }

/* Classement */
.classement, .final { flex: 1; max-width: 900px; margin: 0 auto; width: 100%; display: flex; flex-direction: column; gap: 16px; }
.classement h1, .final h1 { text-align: center; }
.tableau { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.tableau li {
  display: flex; align-items: center; gap: 14px; background: #fff; color: var(--navy);
  border-radius: 12px; padding: 12px 18px; font: 700 clamp(1.2rem, 2.2vw, 1.8rem) var(--titre);
  animation: arrive .3s ease-out backwards;
}
.tableau li:nth-child(2) { animation-delay: .05s; }
.tableau li:nth-child(3) { animation-delay: .1s; }
.tableau li:nth-child(n+4) { animation-delay: .15s; }
.tableau .rang { width: 2em; height: 2em; border-radius: 50%; background: var(--navy); color: #fff; display: grid; place-items: center; flex: none; font-size: .8em; }
.tableau li:first-child .rang { background: var(--jaune); color: var(--navy); }
.tableau .nom { flex: 1; }
.tableau .gain { color: var(--k3); font-size: .8em; }
.tableau .pts { min-width: 4ch; text-align: right; }
.classement .bouton-geant { align-self: flex-end; }

/* Podium */
.podium { display: grid; grid-template-columns: repeat(3, 1fr); align-items: end; gap: 12px; max-width: 760px; margin: 10px auto 0; width: 100%; }
.marche { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; animation: arrive .6s ease-out backwards; }
.marche .nom { font: 800 clamp(1.2rem, 2.5vw, 2rem) var(--titre); }
.marche .pts { color: var(--sky); }
.socle { width: 100%; display: grid; place-items: center; border-radius: 12px 12px 0 0; font: 800 3rem var(--titre); color: var(--navy); }
.marche.un .socle { height: 200px; background: var(--jaune); }
.marche.deux .socle { height: 140px; background: #D9DEE5; }
.marche.trois .socle { height: 100px; background: #E0A96D; }
.marche.un { animation-delay: .8s; }
.marche.deux { animation-delay: .4s; }
.marche.vide .socle { opacity: .3; }
.suite-classement { margin-top: 10px; }
.final .boutons { justify-content: center; }
.message { margin: auto; text-align: center; }

/* =========================================================
   Quiz — écran d'une équipe (téléphone)
   ========================================================= */
.joueur { background: var(--navy-deep); color: #fff; }
.ecran-joueur { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; padding: 16px; }
.joueur h1 { color: #fff; font-size: clamp(1.6rem, 7vw, 2.4rem); }

.rejoindre { display: flex; flex-direction: column; gap: 16px; margin: auto 0; }
.rejoindre-logo { font-size: 4rem; text-align: center; }
.rejoindre h1 { text-align: center; }
.rejoindre label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; color: var(--sky); }
.rejoindre input {
  font: 700 1.4rem var(--texte); padding: 14px 16px; border-radius: 12px; border: 3px solid transparent;
  background: #fff; color: var(--navy); width: 100%;
}
.rejoindre input[name="code"] { font-size: 2.2rem; letter-spacing: .3em; text-align: center; }
.rejoindre input:focus { outline: none; border-color: var(--teal); }
.erreur { background: var(--red); color: #fff; padding: 10px 14px; border-radius: 10px; margin: 0; font-weight: 600; }

.j-bandeau { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 14px; background: var(--navy); border-radius: 12px; font-weight: 700; }
.j-nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.j-score { color: var(--jaune); flex: none; }
.j-message { margin: auto 0; text-align: center; padding: 20px 0; }
.j-gros { font-size: 5rem; line-height: 1.2; }
.j-forme { width: 140px; height: 140px; margin: 0 auto 16px; border-radius: 24px; display: grid; place-items: center; font-size: 4.5rem; color: #fff; }
.j-question { padding: 16px 0 10px; }
.j-num { color: var(--sky); font-weight: 700; margin: 0 0 6px; }
.j-question h1 { font-size: clamp(1.3rem, 5.5vw, 1.8rem); font-family: var(--texte); font-weight: 700; }
.j-lecture { color: var(--jaune); font-weight: 700; font-size: 1.1rem; margin: 0; }
.j-reponses { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 10px; flex: 1; grid-auto-rows: 1fr; }
.j-reponses button.rep {
  width: 100%; height: 100%; min-height: 72px; border: 0; cursor: pointer; text-align: left;
  font-size: 1.15rem; box-shadow: 0 4px 0 rgba(0, 0, 0, .25);
}
.j-reponses button.rep:active:not(:disabled) { transform: translateY(3px); box-shadow: none; }
.j-reponses.bloque button.rep { opacity: .45; }
.j-reponses button:disabled { cursor: default; }

.j-resultat { margin: auto 0; text-align: center; padding: 28px 18px; border-radius: 20px; }
.j-resultat.juste { background: var(--k3); }
.j-resultat.faux { background: var(--k0); }
.j-resultat.neutre { background: var(--navy); }
.j-gain { font: 800 2.4rem var(--titre); margin: 0 0 .4em; }
.j-bonne { font-size: 1.1rem; }
.j-expl { opacity: .95; }
.j-rang { font-size: 1.3rem; margin: 14px 0 0; }
.j-podium { text-align: left; max-width: 320px; margin: 16px auto 0; padding-left: 1.4em; font-size: 1.15rem; }
.j-podium span { color: var(--sky); }
.j-quitter { margin-top: auto; align-self: center; background: none; border: 0; color: var(--sky); text-decoration: underline; padding: 14px; font: inherit; font-size: .9rem; cursor: pointer; }
