/* Concept : un plan de métro gravé, imprimé sur papier ivoire comme un objet de maison.
   Encre bleu nuit, filets d'or, cinq lignes émaillées (une par personnage).
   L'anglais s'écrit en Bodoni (né à Parme), le français et l'interface en Jost. Motion lent et précis. */
:root {
  color-scheme: light;
  --paper: #F2ECE1;
  --paper-2: #E8E0D1;
  --paper-3: #FBF8F2;
  --ink: #15192B;
  --ink-2: #4A4E5E;
  --ink-3: #7D7F88;
  --hair: rgba(21, 25, 43, .14);
  --gold: #A9824A;
  --gold-hi: #E2C88F;
  --gold-lo: #7C5A28;
  --wax: #8C1C22;
  --river: #CDD8D9;
  --l1: #1F7A63; --l2: #4F3F96; --l3: #B27A1C; --l4: #B8402E; --l5: #5E7340;
  --ok: #1F7A63; --ko: #A8322B;
  --serif: "Bodoni Moda", "Didot", "Bodoni 72", "Times New Roman", serif;
  --sans: "Jost", "Futura", "Century Gothic", "Avenir Next", system-ui, sans-serif;
  --lux: cubic-bezier(.19, 1, .22, 1);
  --silk: cubic-bezier(.77, 0, .175, 1);
  --t1: 220ms; --t2: 600ms; --t3: 1100ms;
  --foil: linear-gradient(115deg, #7C5A28 0%, #B8925A 22%, #F1DCAA 40%, #B8925A 55%, #8E6A35 75%, #D9BC82 100%);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0; overflow: hidden; background: #E4DCCC; color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.5; font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold-lo); outline-offset: 3px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 22px; height: 22px; display: block; flex: none; }

#app { position: relative; height: 100%; max-width: 440px; margin-inline: auto; overflow: hidden; overflow: clip; isolation: isolate; background: var(--paper); }
#app::after { content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 90; opacity: .5; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .28 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
@media (min-width: 600px) { #app { box-shadow: 0 0 0 1px rgba(21, 25, 43, .08), 0 40px 120px rgba(60, 45, 20, .25); } }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; }

/* ---------- Typo ---------- */
.kicker { font-family: var(--sans); font-size: 11.5px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--gold-lo); margin: 0; }
.en { font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(30px, 8.6vw, 38px); line-height: 1.1; letter-spacing: -.01em; text-wrap: balance; margin: 0; }
.fr { font-size: 17px; color: var(--ink-2); margin: 0; text-wrap: balance; }
.q { font-size: 18px; font-weight: 500; margin: 0; }
.muted { color: var(--ink-2); }

/* ---------- Boutons ---------- */
.btn { appearance: none; border: 0; cursor: pointer; position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 26px; border-radius: 2px;
  font-family: var(--sans); font-size: 13px; font-weight: 500; letter-spacing: .24em; text-transform: uppercase;
  transition: background-color var(--t2) var(--lux), color var(--t2) var(--lux), opacity var(--t2); }
.btn::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 30%, rgba(241, 220, 170, .45) 50%, transparent 70%); }
.btn:hover::after, .btn.sheen::after { animation: sheen 1.1s var(--lux); }
@keyframes sheen { to { transform: translateX(120%); } }
.btn-ink { background: var(--ink); color: var(--paper-3); box-shadow: inset 0 0 0 1px rgba(226, 200, 143, .32), inset 0 0 0 4px var(--ink), inset 0 0 0 5px rgba(226, 200, 143, .18); }
.btn-ink:active:not(:disabled) { background: #232842; }
.btn-ink:disabled { background: var(--paper-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--hair); cursor: not-allowed; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.btn-text { background: none; color: var(--ink-2); min-height: 48px; letter-spacing: .14em; font-size: 12px; }
.btn-text:hover { color: var(--ink); }
.btn-block { width: 100%; }

.say { flex: none; width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--gold); background: transparent; color: var(--gold-lo);
  display: grid; place-items: center; cursor: pointer; transition: background-color var(--t1), color var(--t1); }
.say:hover { background: rgba(169, 130, 74, .08); }
.say.speaking { animation: say-ring 1.2s var(--lux) infinite; }
@keyframes say-ring { 0% { box-shadow: 0 0 0 0 rgba(169, 130, 74, .45); } 100% { box-shadow: 0 0 0 12px rgba(169, 130, 74, 0); } }

.medal { position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%; padding: 3px; background: var(--foil); }
.medal img { width: 100%; height: 100%; border-radius: 50%; display: block; box-shadow: 0 0 0 2px var(--paper-3); }

/* ---------- Intro ---------- */
#screen-intro { align-items: center; padding: 18px 24px 22px; text-align: center; overflow: hidden; }
.intro-top { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--hair);
  opacity: 0; animation: fade 1.4s var(--lux) .3s forwards; }
.intro-top .kicker { color: var(--ink-2); }
.intro-medal { position: relative; width: min(74vw, 300px); aspect-ratio: 1; margin-top: clamp(14px, 4vh, 40px); flex: none; cursor: grab; touch-action: none; }
.intro-medal svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ros path { fill: none; stroke: var(--gold); stroke-width: .55; opacity: .85; }
.ros-b path { stroke: var(--gold-lo); opacity: .45; }
.ros-spin { transform-origin: 150px 150px; animation: spin 140s linear infinite; }
.ros-spin-r { transform-origin: 150px 150px; animation: spin 220s linear infinite reverse; }
@keyframes spin { to { transform: rotate(360deg); } }
.ring-o { fill: none; stroke: var(--gold); stroke-width: 1; }
.tick { stroke: var(--gold-lo); stroke-width: .8; }
.intro-cameo { position: absolute; left: 50%; top: 50%; width: 31%; aspect-ratio: 1; translate: -50% -50%; border-radius: 50%; padding: 4px; background: var(--foil);
  box-shadow: 0 10px 30px rgba(80, 60, 25, .25); opacity: 0; scale: .7; animation: cameo 1.6s var(--lux) 1.3s forwards; }
.intro-cameo img { width: 100%; height: 100%; border-radius: 50%; display: block; box-shadow: 0 0 0 3px var(--paper-3); }
@keyframes cameo { to { opacity: 1; scale: 1; } }
.wordmark { margin: clamp(10px, 3vh, 26px) 0 0; font-family: var(--serif); font-weight: 500; font-size: clamp(60px, 19vw, 84px); line-height: .95;
  font-variation-settings: "opsz" 96; display: flex; justify-content: center; overflow: hidden; padding: 0 .06em .06em;
  letter-spacing: .14em; animation: track 2.4s var(--lux) .2s forwards; }
@keyframes track { to { letter-spacing: -.012em; } }
.wordmark span { display: inline-block; transform: translateY(105%); animation: rise 1.5s var(--lux) forwards; animation-delay: calc(var(--i) * 70ms + 300ms); }
@keyframes rise { to { transform: none; } }
.rule { width: 120px; height: 1px; background: var(--foil); margin: 14px auto 0; transform: scaleX(0); animation: grow 1.6s var(--lux) 1.2s forwards; }
@keyframes grow { to { transform: scaleX(1); } }
.tagline { margin: 14px 0 0; font-family: var(--serif); font-style: italic; font-size: 21px; opacity: 0; animation: fade 1.6s var(--lux) 1.5s forwards; }
.intro-sub { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; opacity: 0; animation: fade 1.6s var(--lux) 1.7s forwards; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.intro-cta { margin-top: auto; width: 100%; display: grid; gap: 8px; opacity: 0; animation: fade 1.6s var(--lux) 2s forwards; }
.proto-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }

/* ---------- Plan ---------- */
#screen-map { background: var(--paper); }
.map-scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; padding: 64px 0 210px; }
.map-scroll::-webkit-scrollbar { display: none; }
.map-inner { position: relative; width: 100%; }
.map-inner > svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.frame { fill: none; stroke: var(--gold); stroke-width: .8; }
.frame-2 { fill: none; stroke: var(--gold); stroke-width: .4; }
.river { fill: none; stroke: var(--river); stroke-width: 74; stroke-linecap: round; }
.river-h { fill: none; stroke: #A9BCBE; stroke-width: .7; stroke-dasharray: 10 7; opacity: .9; }
.river-t { font-family: var(--serif); font-style: italic; font-size: 15px; fill: #6E8587; letter-spacing: .06em; }
.ln-case { fill: none; stroke: var(--paper); stroke-width: 15; stroke-linecap: round; stroke-linejoin: round; }
.ln-off { fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; opacity: .22; }
.ln-on { fill: none; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; transition: stroke-dashoffset 1.8s var(--silk); }
.future { fill: none; stroke: var(--ink-3); stroke-width: 2.5; stroke-dasharray: 2 7; stroke-linecap: round; opacity: .6; }
.future-t { font-family: var(--sans); font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; fill: var(--ink-3); }
.lm { fill: none; stroke: var(--gold); stroke-width: 1.1; stroke-linecap: round; stroke-linejoin: round; }
.lm-t { font-family: var(--serif); font-style: italic; font-size: 12px; fill: var(--gold-lo); }
.compass { transform-box: fill-box; transform-origin: center; }
.compass path, .compass circle { fill: none; stroke: var(--gold); stroke-width: .9; }
.compass .cf { fill: var(--gold); stroke: none; opacity: .85; }
.compass text { font-family: var(--serif); font-size: 11px; fill: var(--gold-lo); stroke: none; }
.term { stroke: var(--ink); stroke-width: 3; stroke-linecap: round; }
.draw-in { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.map-ready .draw-in { animation: draw 2.4s var(--lux) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.cartouche { position: absolute; left: 20%; right: 20%; z-index: 2; text-align: center; padding: 16px 10px 14px; }
.cartouche::before, .cartouche::after { content: ""; position: absolute; inset: 0; border: 1px solid var(--gold); pointer-events: none;
  clip-path: polygon(0 12px, 12px 12px, 12px 0, calc(100% - 12px) 0, calc(100% - 12px) 12px, 100% 12px, 100% calc(100% - 12px), calc(100% - 12px) calc(100% - 12px), calc(100% - 12px) 100%, 12px 100%, 12px calc(100% - 12px), 0 calc(100% - 12px)); }
.cartouche::after { inset: 5px; opacity: .5; }
.cartouche .fan { width: 46px; height: 23px; margin: -30px auto 6px; display: block; background: var(--paper); padding: 0 6px; box-sizing: content-box; }
.cartouche h2 { margin: 2px 0 0; font-family: var(--serif); font-weight: 500; font-style: italic; font-size: 38px; line-height: 1; }
.cartouche p { margin: 6px 0 0; font-size: 12.5px; color: var(--ink-2); }

.unit-card { position: absolute; z-index: 3; display: flex; gap: 12px; align-items: center; padding: 12px 14px 12px 12px;
  background: var(--paper-3); box-shadow: 0 0 0 1px var(--hair), 0 12px 30px -18px rgba(60, 45, 20, .4); transition: opacity .8s var(--lux); }
.unit-card::before { content: ""; position: absolute; inset: 4px; border: 1px solid; border-color: color-mix(in srgb, var(--lc) 35%, transparent); pointer-events: none; }
.unit-card.locked { opacity: .55; }
.unit-card .medal { width: 50px; height: 50px; cursor: pointer; border: 0; }
.unit-txt { min-width: 0; flex: 1; }
.unit-txt p { margin: 0; }
.line-tag { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.bullet { width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--lc); color: #fff;
  font-family: var(--serif); font-weight: 700; font-size: 12px; letter-spacing: 0; font-variant-numeric: lining-nums; }
.unit-title { margin: 3px 0 1px; font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.05; text-wrap: balance; }
.unit-sub { font-size: 13px; color: var(--ink-2); }
.unit-count { flex: none; font-family: var(--serif); font-size: 15px; color: var(--ink-2); font-variant-numeric: lining-nums tabular-nums; align-self: flex-start; }

.st { position: absolute; z-index: 4; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; padding: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.st::before { content: ""; width: 16px; height: 16px; border-radius: 50%; background: var(--paper-3); box-shadow: 0 0 0 3.5px var(--lc); transition: all .6s var(--lux); }
.st.is-done::before { background: var(--lc); box-shadow: 0 0 0 3.5px var(--lc), 0 0 0 6px var(--paper); width: 12px; height: 12px; }
.st.is-locked::before { box-shadow: 0 0 0 3px color-mix(in srgb, var(--lc) 35%, var(--paper)); width: 13px; height: 13px; }
.st.is-current::before { width: 22px; height: 22px; background: var(--paper-3); box-shadow: 0 0 0 3px var(--gold), 0 0 0 8px rgba(169, 130, 74, .14); }
.st.is-current::after { content: ""; position: absolute; width: 40px; height: 40px; border-radius: 50%; border: 1px dashed var(--gold); animation: spin 14s linear infinite; }
.st.boss::before { width: 34px; height: 18px; border-radius: 10px; background: var(--paper-3); box-shadow: 0 0 0 2.5px var(--ink); }
.st.boss.is-done::before { background: var(--ink); box-shadow: 0 0 0 2.5px var(--ink), 0 0 0 5px var(--paper); width: 34px; height: 18px; }
.st.boss.is-locked::before { box-shadow: 0 0 0 2px var(--ink-3); width: 34px; height: 18px; }
.st.boss.is-current::before { width: 38px; height: 22px; box-shadow: 0 0 0 3px var(--gold), 0 0 0 8px rgba(169, 130, 74, .14); }
.halo { position: absolute; z-index: 3; width: 22px; height: 22px; translate: -50% -50%; border-radius: 50%; border: 1.5px solid var(--gold); pointer-events: none; animation: halo 2.6s var(--lux) infinite; }
@keyframes halo { from { scale: 1; opacity: .8; } to { scale: 3.2; opacity: 0; } }
.st-label { position: absolute; z-index: 4; translate: 0 -50%; max-width: 62%; pointer-events: none; line-height: 1.2; transition: opacity .6s var(--lux); }
.st-label.r { text-align: right; }
.st-label.diag { max-width: 40%; }
.st-label b { display: block; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 15.5px; }
.st-label small { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.st-label.locked { opacity: .45; }
.st-label.current b { font-weight: 700; }
.st-label.current small { color: var(--gold-lo); }
.shake { animation: shake .5s var(--silk); }
@keyframes shake { 20%, 60% { translate: -5px 0; } 40%, 80% { translate: 5px 0; } }

.token { position: absolute; z-index: 5; width: 46px; height: 46px; translate: -50% -50%; pointer-events: none; border-radius: 50%; padding: 2.5px; background: var(--foil);
  box-shadow: 0 8px 18px -6px rgba(60, 45, 20, .5); }
.token img { width: 100%; height: 100%; border-radius: 50%; display: block; box-shadow: 0 0 0 2px var(--paper-3); }
.dust { position: absolute; z-index: 4; width: 4px; height: 4px; border-radius: 50%; background: var(--gold); translate: -50% -50%; pointer-events: none; animation: dust 1.2s var(--lux) forwards; }
@keyframes dust { to { opacity: 0; scale: .2; translate: calc(-50% + var(--dx)) calc(-50% + var(--dy)); } }
.burst { position: absolute; z-index: 4; width: 30px; height: 30px; translate: -50% -50%; border-radius: 50%; border: 1px solid var(--gold); pointer-events: none; animation: halo 1.2s var(--lux) forwards; }

.legend { position: absolute; left: 8%; right: 8%; z-index: 2; padding: 20px 18px 18px; box-shadow: 0 0 0 1px var(--gold), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(169, 130, 74, .45); }
.legend h3 { margin: 0 0 12px; text-align: center; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: 22px; }
.legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.legend li { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.lg { flex: none; width: 38px; height: 22px; position: relative; display: grid; place-items: center; }
.lg::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 6px; margin-top: -3px; background: var(--l1); border-radius: 3px; }
.lg i { position: relative; width: 12px; height: 12px; border-radius: 50%; background: var(--paper-3); box-shadow: 0 0 0 3px var(--l1); }
.lg.d i { background: var(--l1); width: 10px; height: 10px; box-shadow: 0 0 0 3px var(--l1), 0 0 0 5px var(--paper); }
.lg.c i { width: 16px; height: 16px; box-shadow: 0 0 0 3px var(--gold); }
.lg.x i { width: 26px; height: 14px; border-radius: 8px; box-shadow: 0 0 0 2.5px var(--ink); }
.scale { margin-top: 16px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2); }
.scale-bar { display: flex; height: 6px; width: 120px; box-shadow: 0 0 0 1px var(--ink); }
.scale-bar span { flex: 1; } .scale-bar span:nth-child(odd) { background: var(--ink); }

.hud { position: absolute; top: 0; left: 0; right: 0; z-index: 8; display: flex; align-items: center; gap: 18px; padding: 14px 18px 18px;
  background: linear-gradient(to bottom, var(--paper) 72%, rgba(242, 236, 225, 0)); }
.stat-m { display: flex; align-items: baseline; gap: 6px; }
.stat-m b { font-family: var(--serif); font-weight: 600; font-size: 24px; font-variant-numeric: lining-nums tabular-nums; line-height: 1; }
.stat-m span { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.hud .sep { width: 1px; height: 22px; background: var(--hair); }
.hud .spacer { flex: 1; }
.icon-btn { width: 44px; height: 44px; border: 0; background: none; cursor: pointer; display: grid; place-items: center; color: var(--ink-2); border-radius: 50%; }
.icon-btn:hover { color: var(--ink); }

.next-stop { position: absolute; left: 12px; right: 12px; bottom: 76px; z-index: 8; display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px;
  background: var(--paper-3); box-shadow: 0 0 0 1px var(--hair), 0 18px 40px -14px rgba(60, 45, 20, .45); transition: transform .8s var(--lux), opacity .8s var(--lux); }
.next-stop::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--foil); }
.next-stop.hide { transform: translateY(24px); opacity: 0; pointer-events: none; }
.ns-txt { flex: 1; min-width: 0; }
.ns-txt p { margin: 0; }
.ns-title { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 18px; line-height: 1.15; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ns-meta { font-size: 12.5px; color: var(--ink-2); }
.next-stop .btn { min-height: 48px; padding: 0 18px; flex: none; }

.nav { position: absolute; left: 0; right: 0; bottom: 0; z-index: 8; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding: 6px 8px 8px;
  background: var(--paper); border-top: 1px solid var(--hair); }
.nav-item { position: relative; border: 0; background: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0 6px;
  color: var(--ink-3); font-size: 10.5px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; }
.nav-item .icon { width: 22px; height: 22px; }
.nav-item[aria-current="page"] { color: var(--ink); }
.nav-item[aria-current="page"]::after { content: ""; position: absolute; bottom: 0; width: 18px; height: 2px; background: var(--foil); }

/* ---------- Feuilles ---------- */
.scrim { position: absolute; inset: 0; z-index: 20; background: rgba(21, 25, 43, .35); opacity: 0; pointer-events: none; transition: opacity .6s var(--lux); }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 30; padding: 26px 22px 22px; background: var(--paper-3);
  box-shadow: 0 -20px 60px -20px rgba(40, 30, 15, .4); transform: translateY(105%); visibility: hidden;
  transition: transform .8s var(--lux), visibility 0s linear .8s; display: flex; flex-direction: column; gap: 16px; max-height: 92%; overflow-y: auto; }
.sheet::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; background: var(--foil); }
.sheet.open { transform: none; visibility: visible; transition: transform .8s var(--lux), visibility 0s; }
.sheet h2, .sheet p { margin: 0; }
.s-head { display: flex; align-items: center; gap: 14px; }
.s-head .who { font-family: var(--serif); font-weight: 600; font-size: 19px; }
.s-head .role { font-size: 13.5px; color: var(--ink-2); }
.say-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--hair); }
.say-row .en { font-size: 24px; flex: 1; }
.lesson-name { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.08; text-wrap: balance; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.word-chip { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; box-shadow: inset 0 0 0 1px var(--gold);
  font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink); background: var(--paper-3); }
.sheet-actions { display: grid; gap: 4px; }
.fb-title { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 32px; line-height: 1; }
.fb.ok .fb-title { color: var(--ok); }
.fb.ko .fb-title { color: var(--ko); }
.fb-text { font-size: 16.5px; line-height: 1.5; }
.fb .medal { width: 62px; height: 62px; }
.fb.open .medal { animation: medal-in 1s var(--lux) both .1s; }
@keyframes medal-in { from { opacity: 0; scale: .6; rotate: -20deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
.toast { position: absolute; left: 16px; right: 16px; top: 74px; z-index: 40; padding: 13px 16px; background: var(--ink); color: var(--paper-3);
  box-shadow: inset 0 0 0 1px rgba(226, 200, 143, .35), 0 18px 40px -14px rgba(20, 20, 30, .5); font-size: 14.5px;
  opacity: 0; transform: translateY(-12px); pointer-events: none; transition: opacity .5s var(--lux), transform .7s var(--lux); }
.toast.on { opacity: 1; transform: none; }

/* ---------- Leçon ---------- */
#screen-lesson { background: var(--paper); }
.lesson-top { display: flex; align-items: center; gap: 8px; padding: 12px 14px 6px 6px; }
.mini-line { flex: 1; position: relative; height: 30px; }
.mini-line .track, .mini-line .fill { position: absolute; left: 9px; right: 9px; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; }
.mini-line .track { background: color-mix(in srgb, var(--l1) 22%, var(--paper)); }
.mini-line .fill { right: auto; width: 0; background: var(--l1); transition: width 1.1s var(--lux); }
.mini-line .dots { position: absolute; inset: 0 0; display: flex; justify-content: space-between; align-items: center; }
.mini-line .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--paper-3); box-shadow: 0 0 0 2.5px color-mix(in srgb, var(--l1) 35%, var(--paper)); transition: all .6s var(--lux); }
.mini-line .dot.done { background: var(--l1); box-shadow: 0 0 0 2.5px var(--l1), 0 0 0 5px var(--paper); width: 12px; height: 12px; margin: 3px; }
.mini-line .dot.now { box-shadow: 0 0 0 2.5px var(--gold), 0 0 0 7px rgba(169, 130, 74, .16); }
.count { font-family: var(--serif); font-size: 16px; color: var(--ink-2); min-width: 32px; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.ex { flex: 1; min-height: 0; overflow-y: auto; padding: 22px 22px 18px; display: flex; flex-direction: column; gap: 22px; }
.ex-head { display: flex; align-items: center; gap: 12px; }
.ex-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(to right, var(--gold), transparent); }
.line { display: flex; align-items: center; gap: 14px; }
.line .en { flex: 1; min-width: 0; }
.opts { display: grid; gap: 10px; }
.opt { position: relative; min-height: 60px; padding: 14px 52px 14px 18px; border: 0; text-align: left; cursor: pointer; background: var(--paper-3);
  box-shadow: inset 0 0 0 1px var(--hair); font-size: 18px; transition: background-color var(--t2) var(--lux), color var(--t2) var(--lux), box-shadow var(--t2) var(--lux); }
.opt:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink); }
.opt[aria-pressed="true"] { background: var(--ink); color: var(--paper-3); box-shadow: inset 0 0 0 1px var(--ink); }
.opt.correct { background: var(--paper-3); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ok); }
.opt.wrong { background: var(--paper-3); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ko); }
.opt .mark { position: absolute; right: 16px; top: 50%; width: 24px; height: 24px; margin-top: -12px; }
.opt .mark path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .8s var(--lux) .1s forwards; }
.opt:disabled { cursor: default; }
.lesson-foot { padding: 8px 22px 18px; display: grid; gap: 2px; }

.card { perspective: 1600px; min-height: 400px; flex: none; cursor: pointer; }
.card-inner { position: relative; width: 100%; min-height: 400px; transform-style: preserve-3d; transition: transform 1.2s var(--silk); }
.card.flipped .card-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; padding: 26px; display: flex; flex-direction: column; gap: 14px; }
.front { align-items: center; justify-content: center; text-align: center; background: var(--ink); color: var(--paper-3); overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(226, 200, 143, .35), inset 0 0 0 7px var(--ink), inset 0 0 0 8px rgba(226, 200, 143, .2); }
.front svg.ros-bg { position: absolute; width: 150%; aspect-ratio: 1; left: -25%; top: 50%; translate: 0 -50%; opacity: .5; }
.front svg.ros-bg path { fill: none; stroke: var(--gold); stroke-width: .5; opacity: .5; }
.front .big { position: relative; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(50px, 15vw, 64px); line-height: 1; margin: 0;
  background: var(--foil); -webkit-background-clip: text; background-clip: text; color: transparent; background-size: 200% 100%; animation: foil 5s linear infinite; }
@keyframes foil { from { background-position: 0% 0; } to { background-position: 200% 0; } }
.front .say { position: relative; border-color: rgba(226, 200, 143, .6); color: var(--gold-hi); }
.front .hint { position: relative; margin: 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: rgba(242, 236, 225, .7); }
.back { transform: rotateY(180deg); background: var(--paper-3); box-shadow: 0 0 0 1px var(--hair); }
.back::before { content: ""; position: absolute; inset: 9px; border: 1.5px dashed rgba(169, 130, 74, .55); pointer-events: none; }
.back .pair { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.back .pair .w { font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 36px; }
.back .pair .t { font-size: 19px; color: var(--ink-2); }
.ex-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--hair); }
.ex-line p { margin: 0; }
.ex-line .e { font-family: var(--serif); font-style: italic; font-size: 19px; }
.ex-line .f { font-size: 14px; color: var(--ink-2); }
.ex-line .say { width: 40px; height: 40px; }
.back .note { margin: auto 0 0; font-size: 14.5px; color: var(--ink-2); }

.answer { min-height: 128px; padding: 6px 0 12px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 10px;
  background: repeating-linear-gradient(to bottom, transparent 0 59px, var(--hair) 59px 60px); }
.answer.correct { --bc: var(--ok); } .answer.wrong { --bc: var(--ko); }
.bank { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.slot { display: inline-block; }
.slot:empty { box-shadow: inset 0 0 0 1px var(--hair); background: var(--paper-2); }
.tile { height: 50px; padding: 0 16px; border: 0; cursor: pointer; background: var(--paper-3); white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--bc, rgba(21, 25, 43, .35)), 0 2px 0 rgba(21, 25, 43, .08);
  font-family: var(--serif); font-style: italic; font-size: 20px; }
.tile:hover { box-shadow: inset 0 0 0 1px var(--ink), 0 2px 0 rgba(21, 25, 43, .08); }

.mic-zone { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.mic { position: relative; width: 108px; height: 108px; border-radius: 50%; border: 0; cursor: pointer; background: var(--ink); color: var(--gold-hi);
  display: grid; place-items: center; box-shadow: 0 0 0 1px var(--gold), 0 0 0 7px var(--paper), 0 0 0 8px rgba(169, 130, 74, .4); transition: background-color var(--t2); }
.mic .icon { width: 38px; height: 38px; }
.mic.rec::before, .mic.rec::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 1px solid var(--gold); animation: halo 1.8s var(--lux) infinite; }
.mic.rec::after { animation-delay: .9s; }
.mic-label { margin: 0; font-size: 12.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.wave-cv { width: 100%; height: 60px; display: block; }
.result { display: flex; flex-direction: column; gap: 18px; }
.score { display: flex; align-items: center; gap: 18px; }
.score-ring { position: relative; width: 92px; height: 92px; flex: none; display: grid; place-items: center; }
.score-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }
.score-ring .track { fill: none; stroke: var(--paper-2); stroke-width: 3; }
.score-ring .val { fill: none; stroke: var(--gold); stroke-width: 3; stroke-linecap: round; transition: stroke-dashoffset 1.6s var(--lux); }
.score-ring b { font-family: var(--serif); font-size: 34px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums; }
.words { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.wd { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wd span:first-child { font-family: var(--serif); font-style: italic; font-size: 25px; padding-bottom: 2px; border-bottom: 2px solid; }
.wd span:last-child { font-size: 12px; font-variant-numeric: tabular-nums; letter-spacing: .1em; }
.wd.good span:first-child { border-color: var(--ok); } .wd.good span:last-child { color: var(--ok); }
.wd.mid span:first-child { border-color: var(--gold); } .wd.mid span:last-child { color: var(--gold-lo); }
.tip { margin: 0; padding: 14px 16px; background: var(--paper-3); box-shadow: inset 0 0 0 1px var(--hair); font-size: 15px; }
.tip em { font-family: var(--serif); font-size: 17px; }
.demo-note { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.hintline { margin: 0; font-family: var(--serif); font-size: 26px; letter-spacing: .16em; color: var(--ink-3); }
.field { width: 100%; height: 64px; border: 0; border-bottom: 1px solid var(--ink); background: transparent; color: var(--ink); padding: 0 2px; border-radius: 0;
  font-family: var(--serif); font-style: italic; font-size: 30px; outline: none; transition: border-color var(--t2); }
.field::placeholder { color: var(--ink-3); font-size: 22px; }
.field:focus { border-bottom: 2px solid var(--gold); }
.field.correct { border-bottom: 2px solid var(--ok); } .field.wrong { border-bottom: 2px solid var(--ko); }
.scene { display: flex; gap: 14px; align-items: center; }
.scene .medal { width: 52px; height: 52px; }

/* ---------- Récompense : le billet ---------- */
#screen-reward { overflow-y: auto; align-items: center; padding: 26px 20px 22px; gap: 20px; text-align: center; }
#screen-reward::before, #screen-reward::after { content: ""; flex: 1 0 0; }
.rw-head { display: grid; gap: 6px; }
.rw-title { margin: 0; font-family: var(--serif); font-style: italic; font-weight: 500; font-size: clamp(38px, 11vw, 48px); line-height: 1; }
.ticket { position: relative; width: 100%; display: flex; text-align: left; filter: drop-shadow(0 18px 24px rgba(60, 45, 20, .22)); }
.t-main, .t-stub { position: relative; background: var(--paper-3); overflow: hidden; }
.t-main { flex: 1; min-width: 0; padding: 18px 16px 16px 18px; border-radius: 4px 0 0 4px;
  -webkit-mask: radial-gradient(circle 9px at 100% 0, #0000 98%, #000) top right / 100% 51% no-repeat, radial-gradient(circle 9px at 100% 100%, #0000 98%, #000) bottom right / 100% 51% no-repeat;
  mask: radial-gradient(circle 9px at 100% 0, #0000 98%, #000) top right / 100% 51% no-repeat, radial-gradient(circle 9px at 100% 100%, #0000 98%, #000) bottom right / 100% 51% no-repeat; }
.t-stub { width: 92px; flex: none; padding: 18px 10px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; border-radius: 0 4px 4px 0;
  border-left: 2px dotted rgba(21, 25, 43, .25);
  -webkit-mask: radial-gradient(circle 9px at 0 0, #0000 98%, #000) top left / 100% 51% no-repeat, radial-gradient(circle 9px at 0 100%, #0000 98%, #000) bottom left / 100% 51% no-repeat;
  mask: radial-gradient(circle 9px at 0 0, #0000 98%, #000) top left / 100% 51% no-repeat, radial-gradient(circle 9px at 0 100%, #0000 98%, #000) bottom left / 100% 51% no-repeat; }
.guil { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.guil path { fill: none; stroke: var(--l1); stroke-width: .5; opacity: .28; }
.t-main > *:not(svg), .t-stub > *:not(svg) { position: relative; }
.t-brand { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.t-brand b { font-family: var(--serif); font-weight: 600; font-size: 17px; letter-spacing: .04em; }
.t-brand span { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); }
.t-name { margin: 12px 0 2px; font-family: var(--serif); font-style: italic; font-weight: 600; font-size: 25px; line-height: 1.05; }
.t-route { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); margin: 0; }
.t-row { display: flex; gap: 18px; margin-top: 12px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); }
.t-row b { display: block; font-family: var(--serif); font-size: 15px; letter-spacing: 0; text-transform: none; color: var(--ink); font-weight: 600; font-variant-numeric: lining-nums; }
.t-stub small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); writing-mode: vertical-rl; transform: rotate(180deg); }
.punch-target { width: 30px; height: 30px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(21, 25, 43, .3); position: relative; }
.hole { position: absolute; inset: 3px; border-radius: 50%; background: #CFC6B4; box-shadow: inset 0 2px 4px rgba(40, 30, 15, .45); transform: scale(0); }
.hole.on { animation: punch .35s var(--lux) forwards; }
@keyframes punch { 0% { transform: scale(0); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.stamp { position: absolute; right: 70px; top: 66%; z-index: 3; padding: 5px 12px 4px; border: 2px solid var(--wax); color: var(--wax); border-radius: 4px;
  font-family: var(--sans); font-weight: 600; font-size: 15px; letter-spacing: .26em; text-transform: uppercase; mix-blend-mode: multiply;
  box-shadow: inset 0 0 0 2px var(--paper-3), inset 0 0 0 3px var(--wax); opacity: 0; transform: translateY(-50%) rotate(-11deg) scale(2.2); pointer-events: none; }
.stamp.on { animation: stamp .42s cubic-bezier(.5, 0, .75, 0) forwards; }
@keyframes stamp { to { opacity: .86; transform: translateY(-50%) rotate(-11deg) scale(1); } }
.ticket .shine { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: linear-gradient(105deg, transparent 35%, rgba(241, 220, 170, .55) 50%, transparent 65%);
  transform: translateX(-110%); }
.ticket .shine.on { animation: sheen-t 1.6s var(--lux) forwards; }
@keyframes sheen-t { to { transform: translateX(110%); } }
.stats { width: 100%; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stats > div { padding: 4px 6px; display: grid; gap: 2px; }
.stats > div + div { border-left: 1px solid var(--hair); }
.stats b { font-family: var(--serif); font-weight: 600; font-size: 32px; line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.stats span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-2); }
.acquired { margin: 0; font-family: var(--serif); font-style: italic; font-size: 19px; min-height: 28px; }
.acquired i { font-style: normal; color: var(--gold); padding: 0 8px; font-size: 12px; vertical-align: 3px; }
.pocket-line { margin: -10px 0 0; font-size: 14px; color: var(--ink-2); min-height: 21px; }
#screen-reward .btn { width: 100%; }


/* ---------- Illustrations gravées ---------- */
.plate { position: relative; margin: 0; height: 160px; flex: none; display: grid; place-items: center;
  background: radial-gradient(ellipse at 50% 55%, var(--paper-3), #EAE1D0 85%);
  box-shadow: inset 0 0 0 1px rgba(169, 130, 74, .6), inset 0 0 0 5px var(--paper), inset 0 0 0 6px rgba(169, 130, 74, .3); }
.plate.sm { height: 132px; }
.plate svg { height: 78%; width: auto; max-width: 86%; }
.plate figcaption { position: absolute; right: 12px; bottom: 9px; font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--gold-lo); }
.pick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick-card { position: relative; height: 146px; border: 0; padding: 10px 8px 30px; cursor: pointer; background: var(--paper-3); display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--hair); transition: box-shadow var(--t2) var(--lux), transform var(--t2) var(--lux); }
.pick-card svg.illu { height: 92px; width: auto; max-width: 92%; }
.mark path { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .8s var(--lux) .1s forwards; }
.pick-card:hover:not(:disabled) { box-shadow: inset 0 0 0 1px var(--ink); }
.pick-card[aria-pressed="true"] { box-shadow: inset 0 0 0 1.5px var(--ink), 0 14px 24px -16px rgba(60, 45, 20, .5); transform: translateY(-3px); }
.pick-card.correct { box-shadow: inset 0 0 0 1.5px var(--ok); }
.pick-card.wrong { box-shadow: inset 0 0 0 1.5px var(--ko); }
.pick-card .lbl { position: absolute; left: 0; right: 0; bottom: 8px; font-family: var(--serif); font-style: italic; font-size: 16px; opacity: 0; transform: translateY(6px);
  transition: opacity .8s var(--lux), transform .8s var(--lux); }
.pick.revealed .lbl { opacity: 1; transform: none; }
.pick-card .mark { position: absolute; right: 10px; bottom: 8px; top: auto; width: 20px; height: 20px; margin: 0; }
.pick-card:disabled { cursor: default; }
.blank { display: inline-block; min-width: 2.6em; border-bottom: 1.5px solid var(--ink); text-align: center; color: var(--gold-lo); }
.back .pair svg.illu { height: 64px; width: auto; margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .wordmark span { transform: none; } .wordmark { letter-spacing: -.012em; }
}
