/* Académie Chicken Drive — design épuré, pensé pour le téléphone. */
:root {
  --red: #E30613; --red-press: #C00510; --red-tint: #FFF0F0;
  --ink: #1D1D1F; --ink-2: #424245; --muted: #6E6E73; --faint: #AEAEB2;
  --bg: #F5F5F7; --card: #FFFFFF; --fill: #EDEDF0; --fill-2: #E3E3E8; --line: rgba(0, 0, 0, .08);
  --night: #0B0B0C; --night-2: #1C1C1E;
  --ok: #1F9D55; --ok-bg: #E8F7EE; --warn: #B25E00; --warn-bg: #FFF4E0; --bad: #D70015; --bad-bg: #FFECEE;
  --gold: #C9A227;
  --r-lg: 28px; --r: 20px; --r-sm: 14px;
  --shadow: 0 1px 1px rgba(0,0,0,.02), 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.04), 0 24px 60px rgba(0,0,0,.12);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', system-ui, 'Segoe UI', sans-serif;
  --display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --num: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Inter', system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); }
body { min-height: 100dvh; font-size: 17px; line-height: 1.47; letter-spacing: -.012em; overscroll-behavior-y: none; -webkit-font-smoothing: antialiased; }
body.lang-ar, body.lang-prs { --font: 'Noto Sans Arabic', system-ui, sans-serif; --display: 'Noto Sans Arabic', system-ui, sans-serif; letter-spacing: 0; }
body.lang-ur { --font: 'Noto Nastaliq Urdu', 'Noto Sans Arabic', sans-serif; --display: 'Noto Sans Arabic', sans-serif; line-height: 2.05; letter-spacing: 0; }
body.lang-bn { --font: 'Noto Sans Bengali', system-ui, sans-serif; --display: 'Noto Sans Bengali', system-ui, sans-serif; letter-spacing: 0; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
h1, h2, h3, .display { font-family: var(--display); font-weight: 700; letter-spacing: -.025em; }
body.lang-ar h1, body.lang-prs h1, body.lang-ur h1, body.lang-bn h1 { letter-spacing: 0; }
h1 { font-size: 34px; line-height: 1.1; margin: 4px 0; }
h2 { font-size: 22px; line-height: 1.2; margin: 32px 4px 12px; }
.muted { color: var(--muted); }
.center { text-align: center; }
bdi[dir="ltr"] { direction: ltr; unicode-bidi: isolate; display: inline-block; font-family: var(--num); font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* ---------- barre du haut (verre dépoli) ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 56px;
  padding: 0 16px; background: rgba(245, 245, 247, .78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; direction: ltr; }
.brand-logo { height: 26px; width: auto; display: block; }
.brand-tag { font-family: var(--num); font-weight: 600; font-size: 12px; letter-spacing: .02em; color: var(--muted); padding-inline-start: 10px; border-inline-start: 1px solid var(--fill-2); }
.top-actions { display: flex; gap: 8px; }
.chip { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 36px; height: 36px; border: 0; background: var(--fill);
  color: var(--ink); border-radius: 999px; padding: 0 12px; font-size: 14px; font-weight: 600; transition: background .2s; }
.chip:active { background: var(--fill-2); }
body.on-dark .topbar { background: rgba(11, 11, 12, .72); border-color: rgba(255,255,255,.08); }
body.dark-top .topbar { background: #151517; border-color: transparent; }
body.on-dark .brand-logo, body.dark-top .brand-logo { filter: brightness(0) invert(1); }
body.on-dark .brand-tag, body.dark-top .brand-tag { color: rgba(255,255,255,.6); border-color: rgba(255,255,255,.2); }
body.on-dark .chip, body.dark-top .chip { background: rgba(255,255,255,.12); color: #fff; }

main { max-width: 600px; margin: 0 auto; padding: 16px 16px calc(132px + var(--safe-b)); }
main.flush { padding: 0 0 calc(132px + var(--safe-b)); max-width: 600px; }

/* ---------- éléments communs ---------- */
.hero { position: relative; overflow: hidden; color: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--shadow-lg);
  background: radial-gradient(120% 90% at 100% 0%, rgba(227, 6, 19, .55), transparent 55%), linear-gradient(160deg, #222225, var(--night) 70%); isolation: isolate; }
.hero::after { content: ''; position: absolute; inset: 0; z-index: -1; background: radial-gradient(60% 50% at 0% 100%, rgba(255,255,255,.07), transparent 70%); }
.hero h1 { margin-top: 0; color: #fff; }
.hero .sub { color: rgba(255,255,255,.72); margin: 6px 0 0; font-size: 16px; }
.sub { color: var(--muted); }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--red); margin: 0 0 6px; }
.hero .eyebrow { color: #FF6B6B; }
.btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 56px; padding: 14px 22px; border: 0; border-radius: 16px;
  background: var(--red); color: #fff; font-size: 17px; font-weight: 600; font-family: var(--font); letter-spacing: -.01em; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, opacity .2s; }
.btn:active { transform: scale(.98); background: var(--red-press); }
.btn[disabled] { background: var(--fill-2); color: var(--faint); cursor: not-allowed; transform: none; }
.btn.gold, .btn.dark { background: var(--ink); color: #fff; }
.btn.gold:active, .btn.dark:active { background: #000; }
.btn.secondary { background: var(--fill); color: var(--ink); }
.btn.secondary:active { background: var(--fill-2); }
.btn.light { background: #fff; color: var(--ink); }
.btn.glass { background: rgba(255,255,255,.14); color: #fff; }
.btn.ghost { background: transparent; color: var(--red); min-height: 48px; }
.btn .ico { font-size: 20px; line-height: 1; }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.alert { padding: 14px 16px; border-radius: var(--r-sm); margin: 12px 0; font-weight: 500; font-size: 15px; }
.alert.bad { background: var(--bad-bg); color: var(--bad); }
.alert.ok { background: var(--ok-bg); color: var(--ok); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }
.field { display: block; margin: 14px 0; }
.field span { display: block; font-weight: 600; font-size: 14px; color: var(--muted); margin: 0 4px 8px; }
.input { width: 100%; min-height: 56px; padding: 14px 16px; border: 0; border-radius: var(--r-sm); background: var(--fill); font-size: 19px; transition: box-shadow .2s, background .2s; }
.input:focus { outline: none; background: #fff; box-shadow: 0 0 0 2px var(--red), 0 0 0 6px rgba(227, 6, 19, .12); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--fill-2); border-top-color: var(--ink); border-radius: 50%; animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.bottom-bar { position: fixed; inset-inline: 0; bottom: 0; z-index: 15; padding: 14px 16px calc(14px + var(--safe-b));
  background: rgba(245, 245, 247, .82); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-top: .5px solid var(--line); }
.bottom-bar .inner { max-width: 568px; margin: 0 auto; display: grid; gap: 6px; }
.bottom-bar .inner.row { display: flex; }
.fade-in { animation: fadeUp .6s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); }

/* ---------- accueil / langue (plein écran sombre) ---------- */
.welcome { min-height: calc(100dvh - 56px); display: flex; flex-direction: column; }
.welcome-hero { position: relative; overflow: hidden; text-align: center; padding: 40px 24px 64px; color: #fff; isolation: isolate;
  background: radial-gradient(90% 70% at 50% 0%, rgba(227, 6, 19, .45), transparent 70%), linear-gradient(180deg, #151517, var(--night)); }
.welcome-hero h1 { font-size: 38px; margin: 0; color: #fff; }
.welcome-hero p { margin: 10px auto 0; color: rgba(255,255,255,.7); font-size: 17px; max-width: 380px; }
.hero-logo { display: block; width: min(210px, 58%); height: auto; margin: 0 auto 26px; }
.welcome-hero .badge { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 18px; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.lang-list { display: block; margin: -32px 16px 0; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-lg); overflow: hidden; position: relative; z-index: 2; }
.lang-btn { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px 16px; background: transparent; border: 0; text-align: start; position: relative; transition: background .15s; }
.lang-btn + .lang-btn::before { content: ''; position: absolute; top: 0; inset-inline: 76px 0; height: .5px; background: var(--line); }
.lang-btn:active { background: var(--fill); }
.lang-badge { flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-family: var(--num); color: #fff; font-size: 14px; letter-spacing: .02em; }
.lang-btn .names { flex: 1; min-width: 0; }
.lang-btn .native { display: block; font-size: 19px; font-weight: 600; line-height: 1.3; }
.lang-btn .fr { display: block; font-size: 14px; color: var(--muted); font-family: var(--font); line-height: 1.3; }
.lang-btn .go { color: var(--faint); font-size: 22px; font-weight: 400; }
.foot-note { text-align: center; color: var(--muted); font-size: 13px; margin: 20px 24px; }

/* ---------- connexion ---------- */
.login-card { background: #fff; border-radius: var(--r-lg); padding: 24px 20px; box-shadow: var(--shadow-lg); margin: -32px 16px 0; position: relative; z-index: 2; }
.who { display: flex; align-items: center; gap: 12px; padding: 4px 0 14px; border-bottom: .5px solid var(--line); margin-bottom: 8px; }
.avatar { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(160deg, #3A3A3C, #1D1D1F); color: #fff; font-weight: 600; font-size: 19px; }
.who b { flex: 1; font-size: 19px; font-weight: 600; }
.link { background: none; border: 0; color: var(--red); font-weight: 600; padding: 6px; font-size: 16px; }
.pin-dots { display: flex; justify-content: center; gap: 18px; margin: 24px 0 12px; direction: ltr; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 1.5px solid var(--faint); transition: all .2s var(--ease); }
.pin-dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.1); }
.pin-dots.shake { animation: shake .45s; }
@keyframes shake { 20%, 60% { transform: translateX(-10px); } 40%, 80% { transform: translateX(10px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 76px); justify-content: center; gap: 16px 26px; margin-top: 18px; direction: ltr; }
.keypad button { width: 76px; height: 76px; border: 0; border-radius: 50%; background: var(--fill); font-size: 32px; font-weight: 400; font-family: var(--num); transition: background .12s; }
.keypad button:active { background: var(--fill-2); }
.keypad .fn { background: transparent; font-size: 22px; color: var(--ink-2); }

/* ---------- tableau de bord ---------- */
.dash-head { display: flex; align-items: center; gap: 18px; }
.ring { --p: 0; flex: none; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.ring > span { width: 72px; height: 72px; border-radius: 50%; background: #18181A; display: grid; place-items: center; font-weight: 700; font-size: 19px; font-family: var(--num); direction: ltr; color: #fff; }
.prize-row { display: flex; gap: 8px; margin-top: 20px; flex-wrap: wrap; }
.prize { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.1); border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: 14px; color: rgba(255,255,255,.92); }
.cta-card { margin-top: 16px; }
.path { margin: 0; padding: 0; list-style: none; background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.path li { position: relative; }
.path li + li::before { content: ''; position: absolute; top: 0; inset-inline: 74px 0; height: .5px; background: var(--line); z-index: 1; }
.step { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 16px; background: none; border: 0; text-align: start; transition: background .15s; }
.step:active { background: var(--fill); }
.node { position: relative; flex: none; width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 23px;
  background: color-mix(in srgb, var(--c, #888) 14%, #fff); }
.step .body { flex: 1; min-width: 0; }
.step .body small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; line-height: 1.3; }
.step .body b { display: block; font-size: 17px; font-weight: 600; line-height: 1.3; }
.step::after { content: '›'; color: var(--faint); font-size: 24px; line-height: 1; }
[dir="rtl"] .step::after { content: '‹'; }
.step.done .node::after { content: '✓'; position: absolute; inset-inline-end: -5px; bottom: -5px; width: 20px; height: 20px; border-radius: 50%; background: var(--ok); color: #fff;
  font-size: 12px; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; font-family: var(--num); }
.step.next .body b { color: var(--red); }
.step.next .node { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red); animation: pulse 2.2s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--red); } 50% { box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgba(227,6,19,.25); } }
.step.locked { opacity: .45; }
.step.locked::after { content: ''; }
.step.exam .node { background: var(--ink); color: #fff; }
.best { display: inline-flex; gap: 6px; align-items: center; margin-top: 6px; font-weight: 600; font-size: 13px; padding: 3px 10px; border-radius: 999px; }
.best.ok { background: var(--ok-bg); color: var(--ok); } .best.warn { background: var(--warn-bg); color: var(--warn); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 32px 4px 12px; }
.section-title h2 { margin: 0; }
.section-title span { color: var(--muted); font-size: 15px; font-weight: 500; }
.diploma-tile { display: flex; align-items: center; gap: 14px; width: 100%; margin-top: 16px; padding: 16px; border: 0; border-radius: var(--r); text-align: start;
  background: linear-gradient(135deg, #FFFDF6, #F6EBCF); box-shadow: var(--shadow), inset 0 0 0 1px rgba(201, 162, 39, .35); }
.diploma-tile .seal { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  background: radial-gradient(circle at 35% 30%, #F2D675, var(--gold) 70%); box-shadow: 0 4px 12px rgba(201,162,39,.4); }
.diploma-tile b { display: block; font-size: 17px; font-weight: 600; }
.diploma-tile small { color: #7A6420; font-size: 14px; }
.diploma-tile::after { content: '›'; margin-inline-start: auto; color: #B8A15A; font-size: 24px; }
[dir="rtl"] .diploma-tile::after { content: '‹'; }
.rule-note { text-align: center; color: var(--muted); font-size: 14px; margin: 18px 12px 0; }

/* ---------- leçon (format « story ») ---------- */
.story { position: relative; min-height: calc(100dvh - 56px); display: flex; flex-direction: column; background: var(--bg); }
.story-bars { display: flex; gap: 4px; padding: 12px 16px 8px; direction: ltr; }
.story-bars i { flex: 1; height: 3px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.story-bars i.on { background: var(--ink); }
.story-bars i.cur { background: var(--ink); animation: grow .5s var(--ease) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } to { transform: none; } }
.story-top { display: flex; align-items: center; gap: 12px; padding: 4px 16px 12px; }
.story-top .mini-ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; flex: none; background: color-mix(in srgb, var(--c, #888) 14%, #fff); }
.story-top .ttl { flex: 1; min-width: 0; }
.story-top .ttl small { color: var(--muted); font-weight: 500; font-size: 13px; display: block; line-height: 1.2; }
.story-top .ttl b { font-size: 17px; font-weight: 600; line-height: 1.25; display: block; }
.close { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); font-size: 15px; font-weight: 600; color: var(--ink-2); }
.story-card { margin: 0 16px; border-radius: var(--r-lg); overflow: hidden; background: #fff; box-shadow: var(--shadow-lg); position: relative; }
.story-visual { position: relative; height: 36vh; min-height: 220px; max-height: 340px; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(90% 80% at 50% 20%, color-mix(in srgb, var(--c) 22%, #fff), color-mix(in srgb, var(--c) 8%, #fff)); }
.story-visual::after { content: ''; position: absolute; width: 60%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--c) 30%, transparent), transparent 70%); filter: blur(10px); }
.story-visual .emoji { position: relative; z-index: 1; font-size: 112px; filter: drop-shadow(0 18px 24px rgba(0,0,0,.18)); animation: pop .7s var(--ease) both; }
@keyframes pop { from { transform: scale(.7) translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.story-visual img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; }
.story-visual .num { position: absolute; z-index: 2; top: 14px; inset-inline-end: 14px; background: rgba(255,255,255,.72); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  color: var(--ink); font-weight: 600; border-radius: 999px; padding: 4px 10px; font-size: 13px; font-family: var(--num); direction: ltr; }
.tap-zone { position: absolute; top: 0; bottom: 0; width: 35%; z-index: 3; background: transparent; border: 0; }
.tap-zone.back { inset-inline-start: 0; } .tap-zone.fwd { inset-inline-end: 0; }
.story-text { padding: 22px 22px 14px; font-size: 21px; line-height: 1.45; font-weight: 500; letter-spacing: -.015em; }
body.lang-ur .story-text { font-size: 21px; line-height: 2.15; font-weight: 400; }
.listen { display: inline-flex; align-items: center; gap: 8px; margin: 0 22px 22px; background: var(--fill); color: var(--ink); border: 0; border-radius: 999px; padding: 9px 16px; font-weight: 600; font-size: 15px; }
.hint { text-align: center; color: var(--muted); font-size: 14px; margin: 14px 16px 0; }

/* ---------- célébration ---------- */
.celebrate { text-align: center; padding: 48px 12px 12px; }
.celebrate h1 { margin-top: 8px; }
.celebrate p { color: var(--muted); margin: 8px auto; max-width: 400px; }
.medal { width: 112px; height: 112px; margin: 0 auto 18px; border-radius: 32px; display: grid; place-items: center; font-size: 60px;
  background: #fff; box-shadow: var(--shadow-lg); animation: pop .7s var(--ease) both; }
.medal.check { border-radius: 50%; background: var(--ok); color: #fff; font-size: 54px; font-weight: 300; box-shadow: 0 20px 50px rgba(31,157,85,.35); }
.progress-line { max-width: 280px; height: 6px; margin: 22px auto 6px; border-radius: 6px; background: var(--fill-2); overflow: hidden; }
.progress-line i { display: block; height: 100%; background: var(--ink); border-radius: 6px; animation: grow .9s var(--ease) both; transform-origin: left; }
#confetti { position: fixed; inset: 0; pointer-events: none; z-index: 50; }

/* ---------- examen ---------- */
.exam-intro { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); margin-top: 16px; overflow: hidden; }
.exam-intro .fact { display: flex; align-items: center; gap: 14px; padding: 14px 16px; font-weight: 500; font-size: 16px; position: relative; }
.exam-intro .fact + .fact::before { content: ''; position: absolute; top: 0; inset-inline: 70px 0; height: .5px; background: var(--line); }
.exam-intro .fact span:first-child { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--fill); font-size: 20px; flex: none; }
.exam-top { position: sticky; top: 56px; z-index: 5; background: rgba(245,245,247,.9); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); padding: 12px 0 10px; }
.exam-meta { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 17px; }
.exam-meta small { display: block; color: var(--muted); font-weight: 500; font-size: 13px; }
.seg { display: flex; gap: 3px; margin-top: 12px; direction: ltr; }
.seg i { flex: 1; height: 4px; border-radius: 4px; background: var(--fill-2); }
.seg i.ans { background: var(--ink); } .seg i.cur { background: var(--red); }
.qcard { background: #fff; border-radius: var(--r-lg); padding: 24px 22px; box-shadow: var(--shadow); margin: 10px 0 14px; }
.qtext { font-size: 22px; font-weight: 600; line-height: 1.38; margin: 0; letter-spacing: -.02em; }
body.lang-ur .qtext { line-height: 2.1; font-weight: 700; }
.option { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; margin: 10px 0; padding: 12px 16px; text-align: start;
  background: #fff; border: 0; border-radius: 18px; font-size: 17px; font-weight: 500; box-shadow: var(--shadow), inset 0 0 0 1.5px transparent; transition: transform .15s var(--ease), box-shadow .2s; }
.option:active { transform: scale(.985); }
.option .letter { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; font-family: var(--num);
  color: var(--ink-2); background: var(--fill); }
.option.sel { box-shadow: var(--shadow), inset 0 0 0 2px var(--red); }
.option.sel .letter { background: var(--red); color: #fff; }
.option[disabled] { opacity: .75; }
.timer-ring text { fill: var(--ink); font-family: var(--num); }
.timer-ring circle { transition: stroke-dashoffset .1s linear, stroke .3s; }

/* ---------- résultat ---------- */
.score-ring { --p: 0; width: 184px; height: 184px; margin: 18px auto 6px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255,255,255,.14) 0); }
.score-ring > div { width: 164px; height: 164px; border-radius: 50%; background: #18181A; display: grid; place-items: center; text-align: center; }
.score-big { font-size: 52px; font-weight: 700; font-family: var(--num); line-height: 1; direction: ltr; letter-spacing: -.03em; color: #fff; }
.prize-banner { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: var(--r); padding: 18px; margin-top: 16px; font-weight: 600; font-size: 17px; box-shadow: var(--shadow); }
.prize-banner .big { font-size: 40px; }
.miss-list { background: #fff; border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.miss { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 16px; margin: 0; background: #fff; border: 0; text-align: start; position: relative; }
.miss + .miss::before { content: ''; position: absolute; top: 0; inset-inline: 68px 0; height: .5px; background: var(--line); }
.miss .mini-ico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 20px; flex: none; background: color-mix(in srgb, var(--c, #888) 14%, #fff); }
.miss b { flex: 1; font-size: 16px; font-weight: 600; }
.miss span:last-child { color: var(--faint); font-size: 22px; }

/* ---------- diplôme ---------- */
.stage { min-height: calc(100dvh - 56px); padding: 32px 16px calc(200px + var(--safe-b)); color: #fff; text-align: center;
  background: radial-gradient(80% 45% at 50% 0%, rgba(201,162,39,.26), transparent 70%), linear-gradient(180deg, #151517, var(--night)); }
.stage .eyebrow { color: #E2C261; }
.stage h1 { color: #fff; font-size: 32px; }
.stage p { color: rgba(255,255,255,.66); margin: 8px auto 0; max-width: 420px; font-size: 16px; }
.doc { position: relative; max-width: 520px; margin: 30px auto 0; aspect-ratio: 1.414; border-radius: 4px; overflow: hidden; color: #1B1718; text-align: center;
  background: radial-gradient(60% 55% at 50% 55%, rgba(227,6,19,.035), transparent 70%), #FFFDF8; box-shadow: 0 30px 80px rgba(0,0,0,.6), 0 0 0 1px rgba(255,255,255,.05);
  transform: perspective(1400px) rotateX(5deg); transform-origin: bottom; animation: docIn 1.1s var(--ease) both; font-family: 'Times New Roman', Times, Georgia, serif; direction: ltr; }
@keyframes docIn { from { opacity: 0; transform: perspective(1400px) rotateX(24deg) translateY(40px) scale(.92); } }
.doc::before { content: ''; position: absolute; inset: 1.6%; border: 2px solid #E30613; pointer-events: none; }
.doc::after { content: ''; position: absolute; inset: 4.4%; border: 1px solid #B8902F; box-shadow: inset 0 0 0 3px #FFFDF8, inset 0 0 0 4px #B8902F; pointer-events: none; }
.doc .in { position: absolute; inset: 8% 9% 7%; display: flex; flex-direction: column; align-items: center; }
.doc img { width: 15%; }
.doc .acad { font: 700 clamp(4px, 1.2vw, 7px) / 1 -apple-system, 'Inter', sans-serif; letter-spacing: .32em; color: #E30613; margin-top: 2.5%; }
.doc .t1 { font-weight: 700; font-size: clamp(17px, 6vw, 34px); letter-spacing: .18em; margin-top: 2.5%; line-height: 1; padding-left: .18em; }
.doc .t2 { font: 700 clamp(4px, 1.35vw, 8px) / 1 -apple-system, 'Inter', sans-serif; letter-spacing: .24em; margin-top: 2.5%; }
.doc .to { font-style: italic; color: #6B6163; font-size: clamp(7px, 2vw, 11px); margin-top: 5%; }
.doc .nm { font-weight: 700; font-style: italic; font-size: clamp(13px, 4.8vw, 28px); margin-top: 1.5%; padding: 0 5% 1.5%; border-bottom: 1px solid #B8902F; white-space: nowrap; }
.doc .bottom { position: absolute; bottom: 0; inset-inline: 0; display: flex; justify-content: space-between; align-items: flex-end; font: 600 clamp(4px, 1.2vw, 7px) / 1.35 -apple-system, 'Inter', sans-serif; color: #6B6163; }
.doc .bottom > div:not(.seal) { width: 34%; }
.doc .sig { font: italic 700 clamp(9px, 3vw, 16px) / 1 'Times New Roman', serif; color: #12235A; border-bottom: 1px solid #1B1718; padding-bottom: 3px; margin-bottom: 3px; }
.doc .seal { width: clamp(30px, 10vw, 58px); aspect-ratio: 1; border-radius: 50%; background: #E30613; box-shadow: 0 0 0 2px #FFFDF8, 0 0 0 4px #C9A227; display: grid; place-items: center; color: #fff; font: 800 clamp(5px, 1.7vw, 10px) / 1 -apple-system, 'Inter', sans-serif; letter-spacing: .04em; }
.doc .num { color: #E30613; font-weight: 700; }
.doc .shine { position: absolute; inset: 0; background: linear-gradient(115deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-100%); animation: shine 2.4s 1s var(--ease) both; pointer-events: none; }
@keyframes shine { to { transform: translateX(100%); } }
.doc-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 26px; }
.doc-meta span { background: rgba(255,255,255,.1); color: rgba(255,255,255,.85); border-radius: 999px; padding: 6px 12px; font-size: 13px; font-weight: 600; }
body.on-dark { background: var(--night); }
body.on-dark .bottom-bar { background: rgba(11,11,12,.82); border-color: rgba(255,255,255,.08); }

/* ---------- attestation (ancienne carte, admin) ---------- */
.cert { background: #fff; border-radius: var(--r); padding: 28px 22px; text-align: center; margin-top: 16px; }

@media print {
  .topbar, .bottom-bar, .no-print, #confetti { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (min-width: 700px) { h1 { font-size: 40px; } .welcome-hero { padding-top: 64px; } }
