/* ══════════════════════════════════════════════════
   CyberMois 2026 — Styles partagés (pages épreuves, admin)
   ══════════════════════════════════════════════════ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --idt-purple:       #6B22D4;
  --idt-purple-dark:  #4A0FA0;
  --cyber-teal:       #0D5D6B;
  --cyber-grad-from:  #00C9D4;
  --cyber-grad-to:    #4AE54A;
  --bg:        #0D1117;
  --surface:   #161B22;
  --surface2:  #21262D;
  --border:    #30363D;
  --text:      #E6EDF3;
  --text-muted:#8B949E;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── Header ── */
header {
  background: linear-gradient(135deg, var(--idt-purple-dark) 0%, var(--idt-purple) 50%, var(--cyber-teal) 100%);
  position: relative;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 40px; flex-wrap: wrap; gap: 16px;
}
.logos { display: flex; align-items: center; gap: 24px; }
.logo-idt img   { height: 52px; filter: brightness(0) invert(1); }
.logo-divider   { width: 1px; height: 48px; background: rgba(255,255,255,0.3); }
.logo-cyber img { height: 48px; filter: brightness(0) invert(1); }
.header-title   { text-align: right; }
.header-title .tags { justify-content: flex-end; margin-top: 8px; margin-bottom: 0; }
.header-title h1 { font-size: 1.6rem; font-weight: 700; color: #fff; }
.header-title p  { font-size: 0.85rem; color: rgba(255,255,255,0.75); margin-top: 4px; }

/* ── Barre de session ── */
.session-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
  padding: 9px 40px;
  background: rgba(0,0,0,0.20);
  border-top: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9); font-size: 0.85rem;
}
.session-bar strong { color: #fff; font-weight: 700; }
.session-sep { opacity: 0.4; }
.session-admin {
  background: rgba(240,180,41,0.2); color: #F0B429;
  border: 1px solid rgba(240,180,41,0.35);
  padding: 2px 9px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; margin-left: 8px;
}
.session-logout {
  margin-left: auto; color: rgba(255,255,255,0.9); text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  padding: 4px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s;
}
.session-logout:hover { background: rgba(255,255,255,0.12); }

/* ── Navbar ── */
.navbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; gap: 8px; padding: 0 40px; flex-wrap: wrap;
}
.nav-link {
  padding: 14px 18px; color: var(--text-muted); text-decoration: none;
  font-size: 0.9rem; font-weight: 500;
  border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s;
}
.nav-link:hover  { color: var(--text); }
.nav-link.active { color: var(--text); border-bottom-color: var(--idt-purple); }

/* ── Contenu ── */
main { max-width: 1100px; margin: 0 auto; padding: 28px 24px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 20px;
}
.card h2 { font-size: 1.3rem; font-weight: 700; margin-bottom: 6px; }
.card h3 { font-size: 1.05rem; font-weight: 600; margin: 18px 0 8px; }
.card p  { line-height: 1.65; color: var(--text); margin-bottom: 12px; }
.muted   { color: var(--text-muted); }

/* ── Bannière d'état (accès) ── */
.notice {
  border-radius: 12px; padding: 16px 20px; margin-bottom: 20px;
  border: 1px solid var(--border); font-size: 0.92rem;
}
.notice.locked { background: rgba(240,180,41,0.10); border-color: rgba(240,180,41,0.35); color: #F0B429; }
.notice.info   { background: rgba(0,201,212,0.08);  border-color: rgba(0,201,212,0.30);  color: var(--cyber-grad-from); }

/* ── Boutons / badges ── */
.btn {
  border: none; border-radius: 8px; padding: 7px 14px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.btn.on  { background: #3FB950; color: #0D1117; }
.btn.off { background: rgba(139,148,158,0.2); color: var(--text); border: 1px solid var(--border); }
.btn:disabled { opacity: 0.5; cursor: default; }

/* ── Table admin (matrice d'accès) ── */
.matrix { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.matrix th, .matrix td {
  padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left;
}
.matrix th { color: var(--text-muted); font-weight: 600; }
.matrix td.center, .matrix th.center { text-align: center; }
.matrix .team-name { font-weight: 600; }
.matrix .team-code { color: var(--text-muted); font-size: 0.78rem; margin-left: 6px; }

footer {
  text-align: center; color: var(--text-muted);
  font-size: 0.8rem; padding: 24px; border-top: 1px solid var(--border); margin-top: 20px;
}
footer .flogos { display: flex; gap: 12px; justify-content: center; margin-bottom: 8px; }
footer .flogos img { height: 26px; filter: brightness(0) invert(1); opacity: 0.55; }
footer a { color: var(--cyber-grad-from); text-decoration: none; }

/* ══════════════════════════════════════════════════
   Composants de contenu des épreuves (thème sombre)
   ══════════════════════════════════════════════════ */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.tag {
  font-size: 0.72rem; font-weight: 700; padding: 4px 11px; border-radius: 999px;
  background: var(--surface2); color: var(--text); border: 1px solid var(--border);
}
.tag.accent { background: rgba(107,34,212,0.20); color: #b98cff;            border-color: rgba(107,34,212,0.40); }
.tag.teal   { background: rgba(0,201,212,0.15);  color: var(--cyber-grad-from); border-color: rgba(0,201,212,0.35); }
/* Barème de l'épreuve (points) */
.tag.gold   { background: rgba(240,180,41,0.18); color: #F0B429;             border-color: rgba(240,180,41,0.40); font-weight: 700; }

/* ── Sous-onglets (panneaux dans une page épreuve) ── */
.subtabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 20px; border-bottom: 1px solid var(--border);
}
.subtab {
  appearance: none; cursor: pointer;
  padding: 10px 18px; border: 1px solid var(--border); border-bottom: none;
  border-radius: 10px 10px 0 0; margin-bottom: -1px;
  background: var(--surface); color: var(--text-muted);
  font-size: 0.92rem; font-weight: 600; font-family: inherit;
  display: flex; align-items: center; gap: 8px;
  transition: color .15s, background .15s;
}
.subtab:hover { color: var(--text); background: var(--surface2); }
.subtab.active {
  color: #fff; background: var(--surface2);
  border-color: var(--idt-purple); border-bottom-color: var(--surface2);
}
.subpanel[hidden] { display: none; }
/* NB : les 4 épreuves ouvrent leur panneau « Contexte & explication » sur une
   carte dont le titre est « 🎯 Épreuve N — <thème> » (cf. .card h2). L'ancienne
   règle .panel-titre (titre HORS carte) n'a plus d'usage et a été retirée. */

/* ── Saisie des réponses (onglet « Notre réponse » + page Résultat) ── */
.res-block {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: rgba(255,255,255,0.02);
}
.res-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  margin-bottom: 12px;
}
.res-head .r-name { font-size: 1.05rem; font-weight: 700; }
.res-head .r-desc { font-size: 0.82rem; color: var(--text-muted); }
.res-head .spacer { flex: 1; }
.res-attempts {
  font-size: 0.72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
}
.res-form { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px; }
.res-input {
  flex: 1; min-width: 220px;
  background: var(--surface2); border: 1.5px solid var(--border); border-radius: 8px;
  color: var(--text); padding: 10px 12px; font-size: 0.92rem; font-family: inherit; outline: none;
}
.res-input:focus { border-color: var(--idt-purple); }
.res-save {
  border: none; border-radius: 8px; padding: 10px 16px;
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  background: var(--idt-purple); color: #fff;
}
.res-save:disabled { opacity: 0.5; cursor: default; }
.res-msg { font-size: 0.8rem; width: 100%; min-height: 1em; }
.res-msg.ok  { color: #3FB950; }
.res-msg.err { color: #FF8080; }
/* Pastilles d'état du contrôle « max 2 chances » */
.res-attempts.ok     { background: rgba(63,185,80,0.15);  color: #3FB950; border-color: rgba(63,185,80,0.4); }
.res-attempts.locked { background: rgba(255,128,128,0.12); color: #FF8080; border-color: rgba(255,128,128,0.4); }
/* Bandeau « épreuve clôturée » (clôture globale posée par l'admin) */
.res-cloture {
  background: rgba(240,180,41,0.10); border: 1px solid rgba(240,180,41,0.35);
  color: #F0B429; border-radius: 8px; padding: 10px 14px;
  font-size: 0.86rem; margin-bottom: 12px;
}

/* Date limite de réponse (vendredi 14h de la semaine d'activation) */
.res-delai {
  background: rgba(94,159,255,0.10); border: 1px solid rgba(94,159,255,0.32);
  color: #9CC3FF; border-radius: 8px; padding: 10px 14px;
  font-size: 0.86rem; margin: 0 0 12px;
}
.res-delai.clos {
  background: rgba(240,180,41,0.10); border-color: rgba(240,180,41,0.35);
  color: #F0B429;
}
/* Barème acquis sur l'épreuve (jokers et délai déjà appliqués) */
.res-points {
  margin: 12px 0 0; padding: 10px 14px; border-radius: 8px;
  font-size: 0.86rem;
  background: rgba(34,197,94,0.10); border: 1px solid rgba(34,197,94,0.32);
  color: #6EE7A8;
}
.res-points.zero {
  background: rgba(148,163,184,0.10); border-color: rgba(148,163,184,0.28);
  color: var(--text-muted);
}
.res-points .muted { font-weight: 400; }

/* Épreuves multi-mots (ex. Épreuve 1 = 3 mots) */
.res-mode { font-size: 0.8rem; margin: 0 0 12px; }
.res-multi { display: flex; flex-direction: column; gap: 10px; }
.res-mot { align-items: center; }
.res-mot-lbl {
  flex: 0 0 auto; min-width: 58px;
  font-size: 0.78rem; font-weight: 700; color: var(--text-muted);
}
.res-input.ok {
  border-color: rgba(63,185,80,0.55);
  background: rgba(63,185,80,0.08);
}
.res-mot-ok { color: #3FB950; font-weight: 700; }

/* Phase posée sous forme de question (Épreuve 4 / Phase 2) : l'intitulé tient
   sa propre ligne au-dessus du champ, qui garde toute la largeur. */
.res-phase { display: flex; flex-direction: column; gap: 6px; }
.res-phase-q { margin: 0; font-size: 0.84rem; color: var(--text); }
.res-phase-q strong { color: var(--text-muted); }

/* Passerelle affichée sous une épreuve validée (cf. bandeauApres). Discrète :
   c'est une constatation, pas une consigne — aucune explication ne l'accompagne. */
.res-apres {
  margin: 10px 0 0; font-size: 0.86rem; color: var(--text-muted);
}
/* white-space : la passerelle peut comporter des espaces significatifs (début
   ou fin) ; sans ça le rendu HTML les supprimerait. */
.res-apres code { font-size: 0.9em; white-space: pre-wrap; }

/* Une phase encore masquée n'est plus rendue du tout (cf. htmlMotMasque dans
   reponse.js) : les règles .res-mot-lock / .res-lock-txt n'ont plus d'objet. */

/* Vue admin : tableau des réponses par équipe et par épreuve */
.ar-scroll { overflow-x: auto; }
.admin-res {
  width: 100%; border-collapse: collapse; font-size: 0.85rem;
}
.admin-res th, .admin-res td {
  border: 1px solid var(--border); padding: 8px 10px;
  text-align: left; vertical-align: top;
}
.admin-res thead th {
  background: var(--surface2); font-weight: 700; white-space: nowrap;
}
.admin-res .ar-team { font-weight: 700; white-space: nowrap; background: rgba(255,255,255,0.02); }
.ar-val { word-break: break-word; margin-bottom: 6px; }
.ar-mot { display: flex; align-items: baseline; gap: 6px; margin-bottom: 3px; word-break: break-word; }
.ar-mot-lbl { font-size: 0.7rem; font-weight: 700; color: var(--text-muted); flex: 0 0 auto; }
.ar-empty { color: var(--text-muted); }
.ar-ok { color: #3FB950; font-weight: 700; }
.ar-ko { color: #FF8080; font-weight: 700; }
.ar-badge {
  display: inline-block; margin-top: 4px;
  font-size: 0.7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
}
.ar-badge.ok { background: rgba(63,185,80,0.15); color: #3FB950; border-color: rgba(63,185,80,0.4); }

/* Barème automatique affiché sous chaque saisie (vue admin) */
.admin-res .ar-score {
  margin-top: 6px; padding-top: 6px; font-size: 0.7rem; font-weight: 700;
  border-top: 1px dashed rgba(255,255,255,0.08); white-space: nowrap;
}
.admin-res .ar-score.ok   { color: #3FB950; }
.admin-res .ar-score.zero { color: #F0B429; }
.admin-res .ar-score.none { color: var(--text-muted); font-weight: 400; }
.admin-res .ar-total {
  display: block; margin-top: 4px; font-size: 0.72rem; font-weight: 700; color: #3FB950;
}

/* Encart « À retenir » (contexte des épreuves) */
.callout-retenir {
  margin: 16px 0;
  padding: 12px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--idt-purple);
  background: rgba(107,34,212,0.12);
  font-size: 0.95rem;
  line-height: 1.5;
}
/* Liste de consignes */
.ep-consignes { margin: 8px 0 0; padding-left: 1.2em; }
.ep-consignes li { margin-bottom: 6px; line-height: 1.5; }

/* Affichage du texte brut de l'épreuve */
.raw-text {
  white-space: pre-wrap; word-break: break-word;
  font-family: 'Segoe UI', system-ui, sans-serif; font-size: 1rem;
  line-height: 1.7; color: var(--text);
}

/* ── Visualiseur d'image (zoom + déplacement) ── */
.img-viewer { display: flex; flex-direction: column; gap: 10px; }
.img-stage {
  position: relative; overflow: hidden;
  height: 70vh; min-height: 360px;
  background: #0a0d12 repeating-linear-gradient(45deg, #0d1117 0 12px, #0a0d12 12px 24px);
  border: 1px solid var(--border); border-radius: 12px;
  cursor: grab; touch-action: none;
}
.img-stage.grabbing { cursor: grabbing; }
.img-stage img {
  position: absolute; top: 0; left: 0;
  transform-origin: 0 0; will-change: transform;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
  max-width: none;
}
.img-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.img-controls button {
  appearance: none; cursor: pointer;
  width: 38px; height: 38px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  font-size: 1.1rem; font-weight: 700; line-height: 1; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s, border-color .15s;
}
.img-controls button:hover { background: var(--surface); border-color: var(--idt-purple); }
.img-controls .img-reset { width: auto; padding: 0 14px; font-size: 0.9rem; font-weight: 600; }
.img-controls .img-zoom-level {
  min-width: 64px; text-align: center;
  font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 0.9rem;
}
.img-controls .img-hint { margin-left: auto; color: var(--text-muted); font-size: 0.85rem; }

.card h2 { display: flex; align-items: center; gap: 12px; }
.card .icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: linear-gradient(135deg, var(--idt-purple), var(--cyber-grad-from));
}
.card strong { color: #b98cff; }

.callout {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface2); border-left: 4px solid var(--cyber-grad-from);
  border-radius: 8px; padding: 12px 16px; margin: 14px 0; font-size: 0.92rem;
}
.callout.green  { border-left-color: var(--cyber-grad-to); }
.callout.danger { border-left-color: #F85149; background: rgba(248, 81, 73, 0.08); }

/* Bouts de code en ligne : noms de filtres, valeurs à recopier. Discret mais
   nettement détaché du texte courant, pour qu'on voie ce qui se tape tel quel. */
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em; padding: 1px 6px; border-radius: 5px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--cyber-grad-from); white-space: nowrap;
}

.data-table {
  width: 100%; border-collapse: collapse; font-size: 0.9rem;
  margin: 16px 0; border-radius: 10px; overflow: hidden;
}
.data-table thead tr { background: var(--idt-purple); color: #fff; }
.data-table th, .data-table td { padding: 10px 14px; text-align: center; }
.data-table th:first-child, .data-table td:first-child { text-align: left; }
/* Colonnes de phrases plutôt que de chiffres : tout à gauche. */
.data-table.left th, .data-table.left td { text-align: left; }
.data-table tbody tr { border-bottom: 1px solid var(--border); }
.data-table tbody tr:nth-child(even) { background: rgba(255,255,255,0.02); }

.steps { display: flex; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 160px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.step .num {
  width: 28px; height: 28px; border-radius: 50%; color: #fff; font-weight: 700; font-size: 0.82rem;
  display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px;
  background: linear-gradient(135deg, var(--idt-purple), var(--cyber-grad-from));
}
.step p { font-size: 0.86rem; color: var(--text-muted); }

.summary {
  text-align: center; border: 1px solid var(--border); border-radius: 16px;
  padding: 30px; margin-top: 24px;
  background: linear-gradient(135deg, var(--idt-purple-dark), var(--cyber-teal));
}
.summary .key-icon { font-size: 2.2rem; display: block; margin-bottom: 10px; }
.summary p { max-width: 600px; margin: 0 auto; line-height: 1.8; }
.summary strong { color: var(--cyber-grad-from); }

/* ══════════════════════════════════════════════════
   Page « Règles & fonctionnement »
   ══════════════════════════════════════════════════ */
.rule-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.rule {
  display: flex; align-items: flex-start; gap: 14px;
  background: var(--surface2); border: 1px solid var(--border);
  border-left: 3px solid var(--idt-purple);
  border-radius: 12px; padding: 14px 18px;
}
.rule-ico { font-size: 1.5rem; line-height: 1.2; flex-shrink: 0; }
.rule-body h3 { font-size: 1rem; font-weight: 700; margin: 0 0 4px; }
.rule-body p  { font-size: 0.92rem; line-height: 1.6; color: var(--text); margin: 0; }

.creneaux { display: flex; gap: 12px; flex-wrap: wrap; margin: 16px 0; }
.creneau {
  flex: 1; min-width: 200px; text-align: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
}
.creneau .cr-ico    { font-size: 1.6rem; display: block; margin-bottom: 6px; }
.creneau .cr-heures {
  display: block; font-size: 1.25rem; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--cyber-grad-from);
}
.creneau .cr-note   { display: block; font-size: 0.82rem; color: var(--text-muted); margin-top: 4px; }

/* ── Épreuve 4 : état de la connexion (lecture seule) ──
   Section non modifiable, alimentée par l'API entrante /api/hack :
   « Déconnecté » → « En attente de connexion » → « Hacking effectué ». */
.hack-state {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  margin-top: 14px; padding: 14px 16px;
  border: 1px solid var(--border); border-radius: 12px;
  background: rgba(255,255,255,0.02);
}
.hack-dot {
  flex: 0 0 auto; width: 11px; height: 11px; border-radius: 50%;
  background: var(--text-muted); box-shadow: 0 0 0 4px rgba(139,148,158,0.12);
}
.hack-titre { font-size: 1rem; font-weight: 700; }
.hack-titre strong { color: #fff; }
.hack-state .spacer { flex: 1; }
.hack-pill {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
}
/* Déconnecté */
.hack-state.off   { border-color: rgba(255,128,128,0.28); background: rgba(255,128,128,0.05); }
.hack-state.off   .hack-dot { background: #FF8080; box-shadow: 0 0 0 4px rgba(255,128,128,0.14); }
.hack-state.off   .hack-titre { color: #FF8080; }
.hack-state.off   .hack-pill  { background: rgba(255,128,128,0.12); color: #FF8080; border-color: rgba(255,128,128,0.35); }
/* En attente de connexion */
.hack-state.wait  { border-color: rgba(240,180,41,0.32); background: rgba(240,180,41,0.06); }
.hack-state.wait  .hack-dot { background: #F0B429; box-shadow: 0 0 0 4px rgba(240,180,41,0.16); animation: hack-pulse 1.8s ease-in-out infinite; }
.hack-state.wait  .hack-titre { color: #F0B429; }
.hack-state.wait  .hack-pill  { background: rgba(240,180,41,0.14); color: #F0B429; border-color: rgba(240,180,41,0.38); }
/* Hacking effectué */
.hack-state.ok    { border-color: rgba(63,185,80,0.38); background: rgba(63,185,80,0.08); }
.hack-state.ok    .hack-dot { background: #3FB950; box-shadow: 0 0 0 4px rgba(63,185,80,0.18); }
.hack-state.ok    .hack-titre { color: #6EE7A8; }
.hack-state.ok    .hack-pill  { background: rgba(63,185,80,0.16); color: #3FB950; border-color: rgba(63,185,80,0.42); }
@keyframes hack-pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(240,180,41,0.16); }
  50%      { box-shadow: 0 0 0 8px rgba(240,180,41,0.05); }
}
.hack-sub { font-size: 0.8rem; color: var(--text-muted); margin: 10px 0 0; }
.hack-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.hack-step {
  font-size: 0.72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
  background: var(--surface2); color: var(--text-muted); border: 1px solid var(--border);
}
.hack-step.done { background: rgba(63,185,80,0.14); color: #3FB950; border-color: rgba(63,185,80,0.38); }
.hack-step.now  { background: rgba(240,180,41,0.14); color: #F0B429; border-color: rgba(240,180,41,0.38); }

/* Saisie segmentée (ex. Épreuve 4 Phase 1 : blocs 3-3-2 caractères) */
.res-segs { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.res-input.res-seg {
  flex: 0 0 auto; min-width: 0;
  /* Largeur = n caractères + interlettrage + padding + bordures. `box-sizing:
     border-box` (reset global) fait que la largeur INCLUT les 2×8px de padding
     et les 2×1.5px de bordure ; le letter-spacing s'ajoute après CHAQUE
     caractère, dernier compris. Les anciennes largeurs fixes (5.5ch / 4.2ch)
     ignoraient tout cela : le dernier caractère de chaque bloc était rogné.
     --seg-n est posé par public/reponse.js (taille du bloc). */
  width: calc(var(--seg-n, 1) * (1ch + 0.25em) + 24px);
  text-align: center; letter-spacing: 0.25em; text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 10px 8px;
}
.res-seg-sep { color: var(--text-muted); font-weight: 700; }
/* Saisie « un caractère par case » (Épreuve 2 = 12 cases, Épreuve 4 / Phase 2 =
   22) : pas de séparateur entre les cases, grille resserrée qui passe à la ligne
   d'elle-même quand il y en a beaucoup. La case prend toute la largeur du
   groupe, le bouton d'enregistrement passe donc en dessous. */
.res-segs.res-segs-car { gap: 6px; flex: 1 1 100%; }
.res-segs.res-segs-car .res-input.res-seg {
  width: calc(1ch + 0.25em + 18px); padding: 10px 4px; letter-spacing: 0;
  /* Pas de mise en majuscules ici, contrairement aux blocs de plusieurs
     caractères : une saisie caractère par caractère sert aussi à des chaînes
     longues (Phase 2), et afficher autre chose que ce qui est tapé égare. */
  text-transform: none;
}

/* Réponse unique en DEUX PARTIES (ex. Épreuve 3 : « champs@champs »).
   Les deux champs se partagent la largeur, le séparateur reste au milieu. */
.res-parts {
  flex: 1; min-width: 240px;
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
}
.res-input.res-part { flex: 1 1 0; min-width: 0; }
.res-part-sep {
  flex: 0 0 auto; font-weight: 700; font-size: 1.35rem; line-height: 1;
  color: var(--idt-purple);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
