:root {
  --bg: #f7f8fb;
  --ink: #102746;
  --muted: #66758a;
  --blue: #1165cf;
  --blue-dark: #0d50a6;
  --green: #238a45;
  --red: #d64545;
  --border: #e3e8ef;
  --shadow: 0 10px 30px rgba(28, 57, 90, .10);
  --radius: 20px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { -webkit-font-smoothing: antialiased; }
button { font: inherit; }
.app-shell { min-height: 100vh; min-height: 100dvh; max-width: 520px; margin: 0 auto; background: #fff; position: relative; overflow-x: hidden; }
.screen { display: none; min-height: 100vh; min-height: 100dvh; padding: env(safe-area-inset-top) 18px calc(92px + env(safe-area-inset-bottom)); }
.screen.active { display: block; }
.hero { text-align: center; padding: 18px 0 4px; position: relative; }
.hero h1 { font-size: clamp(38px, 12vw, 60px); line-height: .95; letter-spacing: -1.5px; margin: 8px 0 8px; font-weight: 900; }
.hero p { margin: 0; font-weight: 650; }
.sun { position: absolute; left: 12px; top: 38px; font-size: 27px; }
.boat { font-size: 58px; margin: 16px 0 4px; filter: drop-shadow(0 8px 8px rgba(0,0,0,.08)); }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 14px 0; box-shadow: var(--shadow); }
.compact-card { padding: 14px 16px; }
.score-card { text-align: center; }
.score-card.small { margin-top: 20px; }
.eyebrow { font-size: 14px; font-weight: 700; color: var(--muted); }
.big-score { font-weight: 900; color: var(--blue); font-size: 44px; line-height: 1.05; margin-top: 4px; }
.big-score small, .medium-score small { color: #7d8a9c; font-size: .48em; font-weight: 700; margin-left: 4px; }
.medium-score { font-weight: 900; color: var(--blue); font-size: 34px; }
.primary-btn, .secondary-btn { width: 100%; min-height: 56px; border-radius: 15px; border: 0; font-weight: 850; letter-spacing: .3px; }
.primary-btn { background: linear-gradient(180deg, #1671e3, #0e5fc6); color: #fff; box-shadow: 0 8px 18px rgba(17,101,207,.25); }
.primary-btn:disabled { opacity: .45; box-shadow: none; }
.secondary-btn { background: #edf3fb; color: var(--ink); }
.secondary-btn.danger { color: #a52727; background: #fff0f0; }
.microcopy { color: var(--muted); text-align: center; font-size: 13px; margin: 10px 12px; }
.microcopy.strong { color: var(--ink); font-weight: 650; }
.bottom-nav { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(520px, 100%); display: grid; grid-template-columns: repeat(4, 1fr); background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--border); padding: 8px 8px calc(8px + env(safe-area-inset-bottom)); z-index: 20; }
.nav-btn { background: transparent; border: 0; color: #7a8798; display: grid; gap: 3px; place-items: center; font-size: 21px; }
.nav-btn span { font-size: 10px; font-weight: 700; }
.nav-btn.active { color: var(--blue); }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.muted { color: var(--muted); }
.grade-chips { display: flex; gap: 7px; overflow-x: auto; padding-top: 10px; }
.grade-chip { flex: 0 0 auto; padding: 7px 9px; border-radius: 10px; background: #f2f5f9; font-weight: 800; font-size: 13px; }
.quiz-topbar, .secondary-header { display: grid; grid-template-columns: 42px 1fr 42px; align-items: center; text-align: center; min-height: 52px; }
.icon-btn, .back-btn { border: 0; background: transparent; color: var(--ink); font-size: 34px; line-height: 1; }
.progress-track { height: 9px; border-radius: 20px; background: #e6ebf2; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--blue); border-radius: inherit; transition: width .25s ease; }
.quiz-content { padding: 30px 2px 110px; }
.subject-badge { display: inline-block; border-radius: 999px; padding: 6px 10px; font-size: 12px; font-weight: 850; background: #eaf2ff; color: var(--blue); }
.quiz-content h2 { font-size: 23px; line-height: 1.3; margin: 18px 0; }
.question-context::before { content: "À OBSERVER"; display:block; font-size:10px; font-weight:900; letter-spacing:.08em; color:#63768d; margin-bottom:6px; }
.question-context { background: #f6f8fb; border-left: 4px solid #b9c5d5; border-radius: 10px; padding: 13px; line-height: 1.5; margin: -3px 0 18px; }
.hidden { display: none !important; }
.options { display: grid; gap: 11px; }
.option { width: 100%; border: 1.5px solid var(--border); background: #fff; border-radius: 16px; padding: 14px 14px; display: grid; grid-template-columns: 38px 1fr; align-items: center; text-align: left; gap: 11px; box-shadow: 0 4px 12px rgba(28,57,90,.05); }
.option-letter { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; background: #eef2f7; color: #4d5e74; }
.option.selected { border-color: var(--blue); background: #edf5ff; }
.option.selected .option-letter { background: var(--blue); color: white; }
.quiz-footer { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: min(520px, 100%); padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.97); border-top: 1px solid var(--border); z-index: 22; }
.feedback-content { padding: 34px 4px 105px; text-align: center; }
.feedback-icon { width: 90px; height: 90px; margin: 8px auto 20px; display: grid; place-items: center; border-radius: 50%; background: #e7f7ec; color: var(--green); font-size: 58px; font-weight: 900; }
.feedback-content.wrong .feedback-icon { background: #fdeaea; color: var(--red); }
.feedback-content h2 { font-size: 27px; margin: 0 0 12px; color: var(--green); }
.feedback-content.wrong h2 { color: var(--red); }
.feedback-answer { font-weight: 700; line-height: 1.45; }
.tip-card { text-align: left; border: 1.5px solid #e5d6ff; background: #fbf8ff; border-radius: 16px; padding: 16px; margin-top: 28px; line-height: 1.5; }
.tip-card strong { color: #7b3fc0; }
.result-content { padding: calc(28px + env(safe-area-inset-top)) 0 110px; text-align: center; }
.result-medal { font-size: 58px; }
.result-content h2 { margin: 4px 0 2px; }
.result-content .card { text-align: left; }
.result-content .score-card { text-align: center; }
.subject-results, .subject-stats { display: grid; gap: 12px; }
.subject-result, .subject-stat { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.stat-line { display: grid; grid-template-columns: 1fr 54px; gap: 8px; align-items: center; }
.stat-bar-track { height: 8px; background: #edf0f4; border-radius: 10px; overflow: hidden; margin-top: 5px; }
.stat-bar { height: 100%; background: var(--blue); }
.secondary-screen { padding-top: calc(8px + env(safe-area-inset-top)); }
.secondary-header h2 { font-size: 19px; }
.history-list { display: grid; gap: 10px; }
.history-item { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding: 10px 0; }
.history-item:last-child { border-bottom: 0; }
.grade-good { color: var(--green); }
.grade-mid { color: #b16b00; }
.grade-low { color: var(--red); }
.weak-skills { display: grid; gap: 8px; }
.weak-skill { padding: 10px 12px; border-radius: 12px; background: #fff7e9; border: 1px solid #f5dfb9; }
.danger-card { border-color: #f1d0d0; }
@media (max-width: 380px) {
  .screen { padding-left: 14px; padding-right: 14px; }
  .hero h1 { font-size: 42px; }
  .quiz-content h2 { font-size: 21px; }
  .option { padding: 12px; }
}

.coverage-card { margin-top: 12px; }
.coverage-track { height: 10px; border-radius: 999px; background: #e8edf4; overflow: hidden; margin: 12px 0 8px; }
.coverage-bar { height: 100%; width: 0; background: linear-gradient(90deg, #13a06f, #1165cf); border-radius: inherit; transition: width .3s ease; }
.coverage-caption { font-size: 12px; color: var(--muted); align-items: flex-start; }
.coverage-caption span:last-child { text-align: right; max-width: 72%; }
