:root {
  --c-blue: #1D6FA5;
  --c-blue-light: #E5EFF6;
  --c-blue-dark: #0B2E45;
  --c-teal: #1D9E75;
  --c-teal-light: #E1F5EE;
  --c-teal-dark: #04342C;
  --c-red: #E24B4A;
  --c-red-light: #FCEBEB;
  --c-red-dark: #501313;
  --c-amber: #BA7517;
  --c-amber-light: #FAEEDA;
  --c-amber-dark: #412402;
  --c-gray-bg: #F8F7F4;
  --c-gray-border: #D3D1C7;
  --c-gray-text: #5F5E5A;
  --c-text: #1a1a18;
  --c-text-muted: #888780;
  --radius: 10px;
  --radius-sm: 6px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, sans-serif; background: var(--c-gray-bg); color: var(--c-text); min-height: 100vh; }

#screen-main { display: flex; flex-direction: column; min-height: 100vh; }
.section { padding: 1.5rem; max-width: 720px; margin: 0 auto; width: 100%; }
.section-header { margin-bottom: 1.5rem; }
.section-eyebrow { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.8px; color: var(--c-blue); font-weight: 600; margin-bottom: 0.35rem; }
.section-title { font-size: 1.4rem; font-weight: 700; line-height: 1.3; }
.section-sub { font-size: 0.875rem; color: var(--c-gray-text); margin-top: 0.35rem; }

.qcm-wrap { }
.qcm-question { background: white; border: 1px solid var(--c-gray-border); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1rem; }
.q-text { font-size: 0.9rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.45; }
.q-hint { font-size: 0.72rem; color: var(--c-gray-text); margin-bottom: 0.75rem; }
.q-options { display: flex; flex-direction: column; gap: 0.5rem; }
.q-option { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.6rem 0.75rem; border: 1.5px solid var(--c-gray-border); border-radius: var(--radius-sm); cursor: pointer; font-size: 0.85rem; transition: background 0.1s, border-color 0.1s; }
.q-option:hover { background: var(--c-gray-bg); }
.q-option.selected { border-color: var(--c-blue); background: var(--c-blue-light); }
.q-option.correct { border-color: var(--c-teal); background: var(--c-teal-light); }
.q-option.wrong { border-color: var(--c-red); background: var(--c-red-light); }
.q-option input { margin-top: 2px; flex-shrink: 0; accent-color: var(--c-blue); }
.q-option .opt-label { line-height: 1.4; }
.q-feedback { font-size: 0.8rem; padding: 0.6rem 0.75rem; border-radius: var(--radius-sm); margin-top: 0.75rem; display: none; line-height: 1.5; }
.q-feedback.show { display: block; }
.q-feedback.ok { background: var(--c-teal-light); color: var(--c-teal-dark); }
.q-feedback.nok { background: var(--c-red-light); color: var(--c-red-dark); }

/* Signalement de question (bouton discret sous chaque question) */
.q-report { margin-top: 0.75rem; border-top: 1px dashed var(--c-gray-border); padding-top: 0.6rem; }
.report-toggle { background: none; border: none; color: var(--c-text-muted); font-size: 0.72rem; cursor: pointer; padding: 0.2rem 0; text-decoration: underline; text-underline-offset: 2px; transition: color 0.15s; }
.report-toggle:hover { color: var(--c-red-dark); }
.report-panel { margin-top: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; background: var(--c-red-light); border-radius: var(--radius-sm); padding: 0.75rem; }
.report-panel select,
.report-panel textarea { width: 100%; padding: 0.5rem 0.6rem; border: 1px solid var(--c-gray-border); border-radius: var(--radius-sm); font-family: inherit; font-size: 0.8rem; background: white; color: var(--c-text); }
.report-panel textarea { resize: vertical; min-height: 2.4rem; }
.report-panel select:focus,
.report-panel textarea:focus { outline: none; border-color: var(--c-red); }
.report-send { align-self: flex-start; background: var(--c-red); color: white; border: none; border-radius: var(--radius-sm); padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: opacity 0.15s; }
.report-send:hover { opacity: 0.9; }
.report-sent { font-size: 0.8rem; color: var(--c-teal-dark); background: var(--c-teal-light); padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); }

.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500; cursor: pointer; border: none; text-decoration: none; transition: opacity 0.15s, transform 0.1s; }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--c-blue); color: white; }
.btn-primary:hover { opacity: 0.9; }
.btn-teal { background: var(--c-teal); color: white; }
.btn-teal:hover { opacity: 0.9; }
.btn-ghost { background: white; border: 1.5px solid var(--c-gray-border); color: var(--c-text); }
.btn-ghost:hover { background: var(--c-gray-bg); }
.btn-row { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }

#screen-score { display: none; flex-direction: column; align-items: center; min-height: 100vh; text-align: center; }
#screen-score .score-body { padding: 2rem; display: flex; flex-direction: column; align-items: center; flex: 1; justify-content: center; }
.score-circle { width: 110px; height: 110px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2rem; font-weight: 700; margin: 1.5rem auto; }
.score-mention { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.score-detail { font-size: 0.85rem; color: var(--c-gray-text); max-width: 360px; line-height: 1.6; }
.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; max-width: 420px; width: 100%; margin: 1.5rem auto; }
.score-item { background: white; border: 1px solid var(--c-gray-border); border-radius: var(--radius); padding: 0.75rem; text-align: center; }
.score-item .val { font-size: 1.4rem; font-weight: 700; }
.score-item .lbl { font-size: 0.75rem; color: var(--c-gray-text); margin-top: 0.2rem; }
.wave { font-size: 2.5rem; margin-bottom: 0.5rem; }
.logo-title { font-size: 1.6rem; font-weight: 700; color: var(--c-blue); letter-spacing: -0.5px; margin-bottom: 0.25rem; }

.hero { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; padding: 1.4rem 1.5rem; color: white; width: 100%; background: linear-gradient(160deg, #0B2E45 0%, #1D6FA5 55%, #5FA3CC 100%); }
.hero-banner-img { height: 88px; width: auto; justify-self: center; object-fit: contain; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.3); }
.hero-text { min-width: 0; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: 0.5rem; padding: 0.3rem 0.75rem 0.3rem 0.55rem; background: rgba(255,255,255,0.14); border: 1px solid rgba(255,255,255,0.28); border-radius: 30px; font-size: 0.72rem; font-weight: 600; color: white; text-decoration: none; transition: background 0.15s, border-color 0.15s; }
.back-link:hover { background: rgba(255,255,255,0.24); border-color: rgba(255,255,255,0.4); }
.hero-title { font-size: 1.05rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; }
.hero-sub { font-size: 0.75rem; color: rgba(255,255,255,0.75); margin-top: 0.15rem; }
.hero-identity { font-size: 0.72rem; color: rgba(255,255,255,0.65); margin-top: 0.3rem; }
.hero-identity button { background: none; border: none; color: rgba(255,255,255,0.85); text-decoration: underline; font-size: 0.72rem; cursor: pointer; padding: 0; margin-left: 4px; }
.progress-block { justify-self: end; text-align: right; min-width: 130px; }
.progress-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; margin-bottom: 0.35rem; }
.progress-caption { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: rgba(255,255,255,0.65); font-weight: 600; }
.progress-pct { font-size: 0.85rem; font-weight: 800; color: white; font-variant-numeric: tabular-nums; }
.progress-track { width: 130px; height: 6px; border-radius: 10px; background: rgba(255,255,255,0.2); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 10px; background: white; transition: width 0.4s ease; }
@media (max-width: 480px) {
  .hero { display: flex; flex-direction: column; align-items: stretch; gap: 0.6rem; padding: 1rem; }
  .hero-banner-img { align-self: center; height: 48px; }
  .hero-title { font-size: 1rem; }
  .progress-block { text-align: left; min-width: 0; width: 100%; }
  .progress-track { width: 100%; }
}

.empty-state { text-align: center; padding: 3rem 1.5rem; color: var(--c-gray-text); font-size: 0.9rem; }

.locked-card { background: white; border: 1px solid var(--c-gray-border); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; }
.locked-card .big-emoji { font-size: 2.5rem; margin-bottom: 0.75rem; }
.locked-card .locked-score { font-size: 1.8rem; font-weight: 700; color: var(--c-teal); margin: 0.5rem 0; }

/* Mode survie — statut en jeu, manche bonus chronométrée, bilan (cf. QCMEngine.runSurvival) */
.survie-status { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; background: white; border: 1px solid var(--c-gray-border); border-radius: var(--radius-sm); padding: 0.6rem 0.9rem; margin-bottom: 1rem; font-size: 0.8rem; }
.survie-streak strong { color: var(--c-red-dark); font-size: 0.95rem; }
.survie-bonus-score strong { color: var(--c-amber-dark); font-size: 0.95rem; }
.survie-quota { color: var(--c-gray-text); font-size: 0.75rem; margin-left: auto; }

.survie-timer { text-align: center; font-size: 1.3rem; font-weight: 800; color: var(--c-red-dark); background: var(--c-red-light); border-radius: var(--radius-sm); padding: 0.4rem; margin-bottom: 0.75rem; font-variant-numeric: tabular-nums; }

.survie-bonus-intro { background: white; border: 1px solid var(--c-gray-border); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; }
.survie-bonus-intro h3 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.survie-bonus-intro p { font-size: 0.85rem; color: var(--c-gray-text); margin-bottom: 1.25rem; }

.survie-validate,
.survie-start-bonus,
.survie-next,
.survie-end,
.survie-replay {
  display: inline-flex; align-items: center; gap: 0.4rem; margin-top: 1rem;
  padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.875rem; font-weight: 500;
  cursor: pointer; border: none; text-decoration: none; transition: opacity 0.15s, transform 0.1s;
}
.survie-validate:active,
.survie-start-bonus:active,
.survie-next:active,
.survie-end:active,
.survie-replay:active { transform: scale(0.97); }
.survie-validate { background: var(--c-blue); color: white; }
.survie-validate:disabled { background: var(--c-gray-border); color: var(--c-gray-text); cursor: not-allowed; }
.survie-validate:not(:disabled):hover { opacity: 0.9; }
.survie-start-bonus { background: var(--c-amber); color: white; }
.survie-start-bonus:hover { opacity: 0.9; }
.survie-next { background: var(--c-teal); color: white; }
.survie-next:hover { opacity: 0.9; }
.survie-end,
.survie-replay { background: var(--c-red); color: white; }
.survie-end:hover,
.survie-replay:hover { opacity: 0.9; }

/* Signalement en mode survie — mêmes styles que .report-toggle/.report-send/.report-panel,
   noms de classe distincts car un seul signalement actif à la fois (pas d'index qi). */
.survie-report-toggle { background: none; border: none; color: var(--c-text-muted); font-size: 0.72rem; cursor: pointer; padding: 0.2rem 0; text-decoration: underline; text-underline-offset: 2px; transition: color 0.15s; }
.survie-report-toggle:hover { color: var(--c-red-dark); }
.survie-report-send { align-self: flex-start; background: var(--c-red); color: white; border: none; border-radius: var(--radius-sm); padding: 0.5rem 1rem; font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: opacity 0.15s; }
.survie-report-send:hover { opacity: 0.9; }
.q-report-closed { margin-top: 0.75rem; border-top: 1px dashed var(--c-gray-border); padding-top: 0.6rem; font-size: 0.72rem; color: var(--c-gray-text); }

.survie-summary { background: white; border: 1px solid var(--c-gray-border); border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center; }
.survie-summary h3 { font-size: 1.2rem; margin-bottom: 0.75rem; }
.survie-summary p { font-size: 0.9rem; margin-bottom: 0.4rem; }
.survie-lb-note { font-size: 0.78rem; color: var(--c-gray-text); }
