/* SpaceBaguette — feuille de style. Thème « planétarium de nuit » : verre dépoli sur ciel profond. */
@font-face { font-family: 'Bricolage Grotesque'; font-style: normal; font-weight: 200 800; font-display: swap; src: url(../fonts/bricolage.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 300 800; font-display: swap; src: url(../fonts/inter.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: italic; font-weight: 400 600; font-display: swap; src: url(../fonts/inter-italic.woff2) format('woff2'); }

:root {
  --bg0: #05061a; --bg1: #0a0d2c; --bg2: #141a48;
  --glass: rgba(255, 255, 255, .055); --glass2: rgba(255, 255, 255, .09); --glass3: rgba(255, 255, 255, .14);
  --line: rgba(255, 255, 255, .11); --line2: rgba(255, 255, 255, .2);
  --ink: #f4f2ff; --ink2: #bcbde4; --ink3: #8487b8;
  --gold: #ffc44d; --gold2: #ff9a3d; --cyan: #3ee6c9; --rose: #ff5c8a; --violet: #a58bff; --sky: #62b6ff;
  --m-frise: #ffb648; --m-carte: #38dcb0; --m-ordre: #7f9dff; --m-jauge: #ff8c5a; --m-vf: #ff6fb0; --m-qcm: #b48cff; --m-dictee: #9be15d; --m-echelle: #57c7ff; --m-puzzle: #e8d44d;
  --r: 16px; --r-lg: 26px;
  --fd: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --f: 'Inter', 'Segoe UI', system-ui, sans-serif;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .75);
  --drawer: min(560px, 34vw);
  color-scheme: dark;
}
html { font-size: clamp(13px, calc(.55vw + .45vh + 2px), 22px); }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg0); color: var(--ink); font-family: var(--f); line-height: 1.45;
  overflow: hidden; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--cyan); }
kbd { font: 600 .75em var(--f); background: var(--glass2); border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; padding: .05em .4em; }
.ico { width: 1.15em; height: 1.15em; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; fill: currentColor; flex: none; }
.hidden { display: none !important; }

/* ---------- Ciel ---------- */
#sky { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(ellipse 70% 55% at 18% 8%, rgba(70, 60, 190, .38), transparent 70%),
    radial-gradient(ellipse 60% 50% at 88% 92%, rgba(140, 40, 150, .28), transparent 70%),
    radial-gradient(ellipse 50% 40% at 70% 20%, rgba(30, 110, 170, .18), transparent 70%),
    linear-gradient(180deg, #05061a 0%, #080a26 60%, #0b0a24 100%); }
.stars { position: absolute; inset: -50% -50%; background-repeat: repeat; will-change: transform; }
.stars-1 { opacity: .75; animation: drift 240s linear infinite; }
.stars-2 { opacity: .85; animation: drift 160s linear infinite, twinkle 6s ease-in-out infinite alternate; }
.stars-3 { opacity: .9; animation: drift 110s linear infinite; }
@keyframes drift { from { transform: translate3d(0, 0, 0); } to { transform: translate3d(-512px, -256px, 0); } }
@keyframes twinkle { from { opacity: .45; } to { opacity: .95; } }
.nebula { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .5; will-change: transform; }
.n1 { width: 46vw; height: 46vw; left: -12vw; top: 30vh; background: radial-gradient(circle, rgba(62, 230, 201, .22), transparent 65%); animation: float1 38s ease-in-out infinite alternate; }
.n2 { width: 50vw; height: 50vw; right: -14vw; top: -18vh; background: radial-gradient(circle, rgba(165, 139, 255, .28), transparent 65%); animation: float2 46s ease-in-out infinite alternate; }
.n3 { width: 36vw; height: 36vw; left: 40vw; bottom: -20vh; background: radial-gradient(circle, rgba(255, 111, 176, .18), transparent 65%); animation: float1 52s ease-in-out infinite alternate-reverse; }
@keyframes float1 { to { transform: translate3d(8vw, -6vh, 0) scale(1.1); } }
@keyframes float2 { to { transform: translate3d(-6vw, 8vh, 0) scale(.92); } }
body.calm .stars, body.calm .nebula { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .stars, .nebula { animation: none !important; } }

/* ---------- Cadre ---------- */
#app { position: relative; z-index: 1; height: 100%; display: flex; flex-direction: column; }
#topbar { flex: none; height: 4rem; display: flex; align-items: center; gap: 1rem; padding: 0 1.4rem; position: relative; z-index: 5; }
.top-logo { display: flex; align-items: center; gap: .55rem; background: none; border: 0; padding: .3rem .4rem; border-radius: 12px; font: 800 1.3rem var(--fd); letter-spacing: -.02em; }
.top-logo .logo-mark { width: 2.1rem; height: 2.1rem; }
.top-logo:hover { background: var(--glass); }
body[data-screen="home"] .top-logo { visibility: hidden; }
#top-mid { flex: 1; display: flex; justify-content: center; min-width: 0; }
.top-btns { display: flex; gap: .4rem; }
.icon-btn { width: 2.5rem; height: 2.5rem; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); color: var(--ink2); transition: .15s; }
.icon-btn:hover { background: var(--glass2); color: var(--ink); border-color: var(--line2); }
.icon-btn .ico { fill: none; }
.top-btns .icon-btn .ico path:first-child { fill: currentColor; }
.top-btns [data-t="full"] .ico path, .top-btns [data-t="gear"] .ico path { fill: none; }
#screen { flex: 1; min-height: 0; position: relative; overflow-y: auto; overflow-x: hidden; }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1px solid var(--line2); background: var(--glass2);
  padding: .75rem 1.3rem; border-radius: 14px; font: 650 1rem var(--f); color: var(--ink); transition: transform .12s, background .15s, box-shadow .2s, opacity .2s; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--glass3); transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.98); }
.btn:disabled { opacity: .4; cursor: default; }
.btn .ico { fill: none; }
.btn-primary { background: linear-gradient(135deg, #ffd166, #ff9a3d); color: #2a1300; border-color: transparent; box-shadow: 0 10px 30px -10px rgba(255, 160, 60, .7), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, #ffdb85, #ffa850); box-shadow: 0 14px 34px -10px rgba(255, 160, 60, .85), inset 0 1px 0 rgba(255, 255, 255, .5); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-xl { flex-direction: column; align-items: flex-start; gap: .1rem; padding: 1rem 1.6rem; border-radius: 20px; font-size: 1.35rem; font-family: var(--fd); font-weight: 750; min-width: 15rem; }
.btn-xl small { font: 500 .78rem var(--f); opacity: .78; white-space: normal; text-align: left; }
.btn-day { background: linear-gradient(135deg, rgba(62, 230, 201, .18), rgba(98, 182, 255, .12)); border-color: rgba(62, 230, 201, .45); }
.btn-day:hover:not(:disabled) { background: linear-gradient(135deg, rgba(62, 230, 201, .28), rgba(98, 182, 255, .2)); }

.chip { display: inline-flex; align-items: center; gap: .35rem; padding: .25rem .7rem; border-radius: 99px; font: 650 .8rem var(--f);
  color: var(--c, var(--ink)); background: color-mix(in srgb, var(--c, #fff) 14%, transparent); border: 1px solid color-mix(in srgb, var(--c, #fff) 35%, transparent); }

/* ---------- Accueil ---------- */
.home { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); grid-template-rows: 1fr auto; padding: 0 3rem 2rem; gap: 0 2rem; }
.home-left { display: flex; flex-direction: column; justify-content: center; gap: 1.6rem; padding-top: 1rem; max-width: 42rem; }
.logo-big { display: flex; align-items: center; gap: 1.1rem; }
.logo-big .logo-mark { width: 6.2rem; height: 6.2rem; filter: drop-shadow(0 0 30px rgba(255, 180, 70, .45)); animation: bob 6s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-6px) rotate(-3deg); } }
.logo-big h1 { margin: 0; font: 800 clamp(3.4rem, 7.2vw, 7.2rem) / .95 var(--fd); letter-spacing: -.045em;
  background: linear-gradient(100deg, #fff6d8 0%, #ffc44d 35%, #ff7fb6 70%, #a58bff 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 8px 40px rgba(255, 140, 120, .25)); }
.tagline { margin: 0; font-size: 1.18rem; color: var(--ink2); max-width: 34rem; text-wrap: pretty; }
.home-actions { display: flex; gap: 1rem; flex-wrap: wrap; }
.home-links { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; max-width: 34rem; }
.link-card { text-align: left; display: flex; flex-direction: column; gap: .15rem; padding: .8rem 1rem; border-radius: 16px; border: 1px solid var(--line); background: var(--glass); transition: .15s; }
.link-card b { font: 700 1rem var(--fd); }
.link-card span { font-size: .8rem; color: var(--ink3); }
.link-card:hover { background: var(--glass2); border-color: var(--line2); transform: translateY(-2px); }
.home-stats { color: var(--ink3); font-size: .85rem; }
.home-stats b { color: var(--gold); }
.home-right { position: relative; min-height: 22rem; }
.orrery { position: absolute; inset: 0; width: 100%; height: 100%; }
.home-modes { grid-column: 1 / -1; display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; }
.mini-mode { padding: .4rem .9rem; border-radius: 99px; font: 650 .85rem var(--f); color: var(--mc); background: color-mix(in srgb, var(--mc) 12%, transparent); border: 1px solid color-mix(in srgb, var(--mc) 30%, transparent); }

/* ---------- Menus ---------- */
.menu-screen { max-width: 70rem; margin: 0 auto; padding: 1rem 2rem 3rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; background: none; border: 0; color: var(--ink2); padding: .3rem 0; font-weight: 600; }
.back .ico { fill: none; }
.back:hover { color: var(--ink); }
.screen-title { font: 800 2.8rem / 1.05 var(--fd); letter-spacing: -.03em; margin: .6rem 0 .3rem; }
.screen-sub { color: var(--ink2); margin: 0 0 1.8rem; font-size: 1.05rem; }
.theme-grid, .mode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: 1rem; }
.theme-card, .mode-card { position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: flex-start; gap: .3rem; text-align: left;
  padding: 1.3rem 1.3rem 1.1rem; border-radius: 22px; border: 1px solid var(--line); background: var(--glass); transition: .18s; min-height: 10rem; }
.theme-card::before, .mode-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 85% 0%, color-mix(in srgb, var(--c, var(--mc)) 30%, transparent), transparent 60%); opacity: .7; transition: .2s; }
.theme-card:hover:not(:disabled), .mode-card:hover:not(:disabled) { transform: translateY(-3px); border-color: color-mix(in srgb, var(--c, var(--mc)) 50%, transparent); }
.theme-card:hover::before, .mode-card:hover::before { opacity: 1; }
.theme-card:disabled, .mode-card:disabled { opacity: .35; cursor: default; }
.theme-card > *, .mode-card > * { position: relative; }
.tc-emoji, .mc-emoji { font-size: 2.4rem; line-height: 1; margin-bottom: .3rem; }
.theme-card b, .mc-name { font: 750 1.35rem var(--fd); }
.theme-card span:last-child, .mc-count { font-size: .8rem; color: var(--ink3); margin-top: auto; }
.mc-desc { color: var(--ink2); font-size: .9rem; }

/* ---------- Barre de manche ---------- */
.top-round { display: flex; align-items: center; gap: 1.6rem; }
.pips { display: flex; gap: .4rem; }
.pip { width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; font-size: .95rem; background: var(--glass); border: 1px solid var(--line); opacity: .55; transition: .3s; }
.pip.cur { opacity: 1; border-color: var(--mc); box-shadow: 0 0 0 3px color-mix(in srgb, var(--mc) 25%, transparent), 0 0 20px color-mix(in srgb, var(--mc) 40%, transparent); transform: scale(1.12); }
.pip.done { opacity: 1; background: var(--mc); border-color: transparent; width: .9rem; height: .9rem; margin: 0 .55rem; }
.top-score { display: flex; align-items: baseline; gap: .5rem; padding: .35rem .9rem; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.top-score .lbl { font-size: .75rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.top-score b { font: 800 1.3rem var(--fd); color: var(--gold); font-variant-numeric: tabular-nums; }

/* ---------- Carton d'annonce ---------- */
.round-intro { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; cursor: pointer;
  animation: introIn .5s cubic-bezier(.2, .9, .3, 1.2) both; }
.round-intro.out { animation: introOut .26s ease-in both; }
@keyframes introIn { from { opacity: 0; transform: scale(.85); } }
@keyframes introOut { to { opacity: 0; transform: scale(1.08); filter: blur(6px); } }
.ri-num { font: 700 1rem var(--f); color: var(--ink3); text-transform: uppercase; letter-spacing: .2em; }
.ri-emoji { font-size: 5.5rem; line-height: 1.1; filter: drop-shadow(0 0 40px color-mix(in srgb, var(--mc) 70%, transparent)); animation: pop .6s .1s cubic-bezier(.2, .9, .3, 1.5) both; }
@keyframes pop { from { transform: scale(.3) rotate(-20deg); opacity: 0; } }
.ri-name { font: 800 clamp(3rem, 7vw, 6rem) / 1 var(--fd); letter-spacing: -.04em; color: var(--mc); text-shadow: 0 0 60px color-mix(in srgb, var(--mc) 50%, transparent); }
.ri-sub { font-size: 1.3rem; color: var(--ink2); }

/* ---------- Manche ---------- */
.round { height: 100%; display: flex; flex-direction: column; padding: 0 1.4rem 1rem; gap: .8rem; animation: fadeUp .45s ease both;
  background: radial-gradient(ellipse 60% 40% at 50% 0%, color-mix(in srgb, var(--mc) 9%, transparent), transparent 70%); }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } }
.round-head { display: flex; align-items: center; gap: 1rem; min-height: 2.8rem; }
.mode-chip { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem 1rem .4rem .7rem; border-radius: 99px; font: 750 1.05rem var(--fd);
  color: var(--mc); background: color-mix(in srgb, var(--mc) 13%, transparent); border: 1px solid color-mix(in srgb, var(--mc) 40%, transparent); }
.mode-chip span { font-size: 1.2rem; }
.round-consigne { color: var(--ink2); font-size: 1.05rem; flex: 1; }
.hints { display: flex; gap: .5rem; }
.btn-hint { padding: .5rem .9rem; font-size: .88rem; border-radius: 12px; background: rgba(255, 196, 77, .08); border-color: rgba(255, 196, 77, .35); color: #ffe3a3; }
.btn-hint .ico { color: var(--gold); }
.btn-hint em { font-style: normal; font-size: .75rem; color: var(--ink3); font-weight: 600; }
.btn-hint:hover:not(:disabled) { background: rgba(255, 196, 77, .16); }
.round-body { flex: 1; min-height: 0; display: flex; }
.round-body > * { flex: 1; min-width: 0; }
.round-foot { display: flex; align-items: center; gap: 1rem; justify-content: flex-end; }
.keys-help { color: var(--ink3); font-size: .8rem; margin-right: auto; }
.btn-validate { font-size: 1.15rem; padding: .85rem 2.6rem; border-radius: 16px; font-family: var(--fd); font-weight: 750; }
.hint-card { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .9rem; border-radius: 14px; background: rgba(255, 196, 77, .09); border: 1px solid rgba(255, 196, 77, .3);
  color: #ffeec7; font-size: .95rem; animation: fadeUp .35s ease both; }
.hint-card .ico { color: var(--gold); fill: none; margin-top: .1rem; }
.hint-card b { color: var(--gold); }

/* ---------- Mode frise ---------- */
.frise { display: flex; flex-direction: column; gap: .9rem; min-height: 0; }
.frise-top { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 1.2rem; }
.exhibit { position: relative; margin: 0; border-radius: var(--r-lg); overflow: hidden; background: #0b0d22; border: 1px solid var(--line); box-shadow: var(--shadow); min-height: 10rem; }
.exhibit-blur { position: absolute; inset: -30px; background-size: cover; background-position: center; filter: blur(28px) saturate(1.3) brightness(.55); transform: scale(1.1); }
.exhibit img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: .8rem; filter: drop-shadow(0 18px 30px rgba(0, 0, 0, .5)); animation: imgIn .6s ease both; }
@keyframes imgIn { from { opacity: 0; transform: scale(1.04); } }
.exhibit figcaption { position: absolute; left: .7rem; bottom: .55rem; right: .7rem; font-size: .62rem; color: rgba(255, 255, 255, .55); text-shadow: 0 1px 3px #000; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.exhibit-none { position: absolute; inset: 0; display: grid; place-items: center; font-size: 8rem; background: radial-gradient(circle, color-mix(in srgb, var(--mc) 25%, transparent), transparent 70%); }
.plaque { display: flex; flex-direction: column; gap: .8rem; padding: 1.6rem 1.7rem; border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); backdrop-filter: blur(14px); overflow: auto; }
.plaque .chip { align-self: flex-start; }
.plaque-title { margin: 0; font: 800 clamp(1.8rem, 2.7vw, 3rem) / 1.05 var(--fd); letter-spacing: -.03em; text-wrap: balance; }
.plaque-sub { margin: 0; font-size: 1.15rem; color: var(--ink2); text-wrap: pretty; }
.hint-slot { display: flex; flex-direction: column; gap: .5rem; }
.frise-read { margin-top: auto; display: flex; align-items: baseline; gap: .8rem; padding-top: .6rem; border-top: 1px dashed var(--line2); }
.frise-read-label { font-size: .75rem; color: var(--ink3); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.frise-read-year { font: 800 2.3rem var(--fd); color: var(--gold); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }

.tl-panel { flex: none; height: clamp(11rem, 30vh, 16rem); display: flex; flex-direction: column; border-radius: var(--r-lg); background: rgba(8, 10, 32, .62);
  border: 1px solid var(--line); backdrop-filter: blur(10px); padding: .6rem .9rem .3rem; box-shadow: var(--shadow); }
.tl-tools { display: flex; align-items: center; gap: .4rem; }
.tl-tools .icon-btn { width: 2.1rem; height: 2.1rem; }
.tl-help { font-size: .76rem; color: var(--ink3); margin-left: .5rem; flex: 1; }
.tl-type { font-size: .8rem; color: var(--ink3); display: flex; align-items: center; gap: .4rem; }
.tl-type input { width: 7.5rem; background: var(--glass); border: 1px solid var(--line2); color: var(--ink); border-radius: 10px; padding: .35rem .6rem; font: 600 .9rem var(--f); outline: none; }
.tl-type input:focus { border-color: var(--gold); }
.tl-type input.bad { border-color: var(--rose); animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.tl-track { position: relative; flex: 1; min-height: 0; cursor: crosshair; touch-action: none; user-select: none; }
.tl-track.panning { cursor: grabbing; }
.tl-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.tl-empty { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); padding: .5rem 1.1rem; border-radius: 99px; background: rgba(255, 196, 77, .12);
  border: 1px solid rgba(255, 196, 77, .4); color: #ffe3a3; font-weight: 600; font-size: .95rem; pointer-events: none; animation: breathe 2.2s ease-in-out infinite; white-space: nowrap; }
.tl-track.has-pin .tl-empty { display: none; }
@keyframes breathe { 50% { opacity: .55; } }
.tl-band-label { position: absolute; transform: translateX(-50%); font-size: .75rem; font-weight: 700; color: var(--gold); opacity: 0; pointer-events: none; white-space: nowrap; }
.tl-band-label.show { opacity: 1; }
.tl-pin, .tl-ans { position: absolute; left: 0; top: 0; height: var(--ay); width: 0; pointer-events: none; will-change: transform; }
.tl-pin .tl-line, .tl-ans .tl-line { position: absolute; left: -1.5px; width: 3px; top: 1.6rem; bottom: 0; border-radius: 2px; }
.tl-pin .tl-line { background: linear-gradient(var(--gold), rgba(255, 196, 77, .3)); box-shadow: 0 0 14px rgba(255, 196, 77, .6); }
.tl-ans .tl-line { background: linear-gradient(var(--cyan), rgba(62, 230, 201, .3)); box-shadow: 0 0 14px rgba(62, 230, 201, .7); }
.tl-dot { position: absolute; left: -8px; bottom: -8px; width: 16px; height: 16px; border-radius: 50%; border: 3px solid #fff; }
.tl-pin .tl-dot { background: var(--gold); box-shadow: 0 0 0 4px rgba(255, 196, 77, .3); }
.tl-ans .tl-dot { background: var(--cyan); box-shadow: 0 0 0 4px rgba(62, 230, 201, .3); }
.tl-bubble { position: absolute; top: 0; left: 0; transform: translateX(-50%); padding: .2rem .7rem; border-radius: 10px; font: 800 1.05rem var(--fd); white-space: nowrap; pointer-events: auto; cursor: grab; }
.tl-pin .tl-bubble { background: var(--gold); color: #2a1300; box-shadow: 0 6px 20px -4px rgba(255, 170, 60, .7); }
.tl-ans .tl-bubble { background: var(--cyan); color: #00261f; box-shadow: 0 6px 20px -4px rgba(62, 230, 201, .7); pointer-events: none; }
.tl-ans .tl-bubble { top: 1.9rem; }
.tl-ans.drop { animation: drop .5s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes drop { from { opacity: 0; translate: 0 -30px; } }
.tl-pin.offscreen, .tl-ans.offscreen { opacity: 0; }
.dragging .tl-pin .tl-bubble { cursor: grabbing; transform: translateX(-50%) scale(1.1); }
.revealed .tl-pin .tl-bubble { pointer-events: none; }
.tl-gap { position: absolute; height: 4px; transform: translateY(-1px); background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .9) 0 6px, transparent 6px 10px); pointer-events: none; animation: fadeIn .4s ease both; }
.tl-gap span { position: absolute; left: 50%; top: 10px; transform: translateX(-50%); font: 700 .8rem var(--f); white-space: nowrap; color: #fff; background: rgba(0, 0, 0, .55); padding: .05rem .5rem; border-radius: 8px; }
@keyframes fadeIn { from { opacity: 0; } }

/* ---------- Panneau « Le saviez-vous ? » ---------- */
#drawer { position: fixed; z-index: 20; top: 4.6rem; right: 1rem; bottom: 1rem; width: var(--drawer); border-radius: var(--r-lg); overflow-y: auto;
  background: linear-gradient(170deg, rgba(28, 30, 74, .94), rgba(12, 13, 40, .96)); border: 1px solid var(--line2); box-shadow: -30px 0 80px -20px rgba(0, 0, 0, .7), var(--shadow);
  backdrop-filter: blur(18px); transform: translateX(calc(100% + 2rem)); visibility: hidden; transition: transform .55s cubic-bezier(.2, .9, .25, 1), visibility 0s .55s; }
#drawer.open { transform: none; visibility: visible; transition: transform .55s cubic-bezier(.2, .9, .25, 1); }
.dr-inner { padding: 1.6rem 1.7rem 1.4rem; display: flex; flex-direction: column; gap: 1.2rem; min-height: 100%; }
.dr-score { text-align: center; padding: .4rem 0 .2rem; }
.dr-verdict { font: 800 1.4rem var(--fd); letter-spacing: -.01em; }
.dr-points { display: flex; align-items: baseline; justify-content: center; gap: .4rem; }
.dr-points b { font: 800 4.6rem / 1 var(--fd); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.dr-points span { color: var(--ink3); font-weight: 600; }
.dr-pen { font-size: .8rem; color: var(--ink3); }
.dr-score.perfect .dr-points b, .dr-score.great .dr-points b { background: linear-gradient(120deg, #fff2c2, var(--gold), #ff8c5a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dr-score.perfect .dr-verdict, .dr-score.great .dr-verdict { color: var(--gold); }
.dr-score.good .dr-points b, .dr-score.good .dr-verdict { color: var(--cyan); }
.dr-score.ok .dr-points b, .dr-score.ok .dr-verdict { color: #9fd0ff; }
.dr-score.meh .dr-points b, .dr-score.meh .dr-verdict, .dr-score.bad .dr-points b, .dr-score.bad .dr-verdict { color: var(--rose); }
.dr-answer { padding: 1rem 1.1rem; border-radius: 16px; background: rgba(62, 230, 201, .08); border: 1px solid rgba(62, 230, 201, .3); }
.dr-answer .lbl { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; color: var(--cyan); font-weight: 700; }
.dr-answer .val { font: 750 1.6rem / 1.15 var(--fd); margin-top: .15rem; }
.dr-answer .det { font-size: .9rem; color: var(--ink2); margin-top: .3rem; }
.dr-fact-head { display: flex; align-items: center; flex-wrap: wrap; gap: .45rem; font: 800 1.15rem var(--fd); color: var(--gold); }
.dr-fact-head .ico { fill: none; }
.dr-fact-head .new { margin-left: auto; font: 700 .7rem var(--f); color: #00261f; background: var(--cyan); padding: .15rem .55rem; border-radius: 99px; }
.dr-fact p { margin: .5rem 0 .7rem; font-size: 1.05rem; line-height: 1.6; color: #e4e3fb; text-wrap: pretty; }
.dr-wiki { display: inline-flex; align-items: center; gap: .35rem; font-weight: 650; font-size: .9rem; text-decoration: none; }
.dr-wiki .ico { fill: none; width: 1em; }
.dr-wiki:hover { text-decoration: underline; }
.dr-credit { font-size: .66rem; color: var(--ink3); margin-top: auto; }
.btn-next { width: 100%; padding: 1rem; font-size: 1.15rem; font-family: var(--fd); font-weight: 750; }

/* ---------- Bilan ---------- */
.results { min-height: 100%; display: grid; place-items: center; padding: 1rem 1.5rem 2rem; }
.res-card { width: min(44rem, 100%); padding: 2.2rem 2.4rem; border-radius: 30px; background: linear-gradient(165deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03)); border: 1px solid var(--line2);
  box-shadow: var(--shadow); backdrop-filter: blur(16px); text-align: center; animation: fadeUp .6s ease both; }
.res-kicker { text-transform: uppercase; letter-spacing: .18em; font-weight: 700; font-size: .8rem; color: var(--ink3); }
.res-rank { font: 800 2.4rem var(--fd); letter-spacing: -.02em; margin: .4rem 0; display: flex; align-items: center; justify-content: center; gap: .6rem; }
.res-rank span { font-size: 2.6rem; }
.res-total { display: flex; align-items: baseline; justify-content: center; gap: .5rem; }
.res-total b { font: 800 5rem / 1 var(--fd); letter-spacing: -.04em; background: linear-gradient(120deg, #fff2c2, var(--gold), #ff8c5a); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.res-total span { color: var(--ink3); font-weight: 600; font-size: 1.2rem; }
.res-record { display: inline-block; margin-top: .6rem; padding: .3rem .9rem; border-radius: 99px; background: rgba(62, 230, 201, .15); color: var(--cyan); font-weight: 700; font-size: .9rem; }
.res-list { list-style: none; padding: 0; margin: 1.4rem 0; display: flex; flex-direction: column; gap: .35rem; text-align: left; }
.res-list li { display: flex; align-items: center; gap: .7rem; padding: .5rem .8rem; border-radius: 12px; background: var(--glass); border-left: 3px solid var(--mc); }
.rl-title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink2); }
.res-list b { font: 750 1rem var(--fd); font-variant-numeric: tabular-nums; }
.res-actions { display: flex; gap: .7rem; justify-content: center; flex-wrap: wrap; }

/* ---------- Divers ---------- */
#toast { position: fixed; z-index: 50; left: 50%; bottom: 2rem; transform: translate(-50%, 250%); visibility: hidden; padding: .8rem 1.3rem; border-radius: 14px; background: rgba(20, 22, 60, .95);
  border: 1px solid var(--line2); box-shadow: var(--shadow); transition: transform .35s cubic-bezier(.2, .9, .3, 1.2); max-width: min(90vw, 40rem); text-align: center; }
#toast.show { transform: translate(-50%, 0); visibility: visible; }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 40; pointer-events: none; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }

/* ---------- Petits écrans ---------- */
@media (max-width: 900px) {
  :root { --drawer: 100vw; }
  body { overflow: auto; }
  #topbar { padding: 0 .8rem; height: 3.4rem; }
  .top-logo span { display: none; }
  .pips { display: none; }
  .home { grid-template-columns: 1fr; padding: 0 1rem 1.5rem; }
  .home-right { order: -1; min-height: 14rem; }
  .home-links { grid-template-columns: 1fr; }
  .btn-xl { min-width: 0; width: 100%; }
  .round { padding: 0 .8rem .8rem; }
  .round-consigne, .keys-help, .tl-help { display: none; }
  .frise-top { grid-template-columns: 1fr; }
  .exhibit { min-height: 12rem; }
  #drawer { top: auto; left: 0; right: 0; bottom: 0; width: auto; max-height: 78vh; border-radius: 24px 24px 0 0; transform: translateY(105%); }
}

/* ---------- Mode vrai ou faux ---------- */
.vf { position: relative; display: grid; grid-template-columns: 1fr minmax(0, 40rem) 1fr; align-items: center; gap: 2rem; padding-bottom: 2rem; }
.vf-stack { position: relative; height: min(100%, 34rem); min-height: 22rem; perspective: 1600px; }
.vf-card { position: absolute; inset: 0; transition: transform .45s cubic-bezier(.2, .9, .3, 1), opacity .35s; touch-action: none; user-select: none;
  transform: translateY(calc(var(--depth, 0) * 18px)) scale(calc(1 - var(--depth, 0) * .05)); z-index: calc(10 - var(--depth, 0)); }
.vf-card:not(.top) { pointer-events: none; }
.vf-card:not(.top) .vf-front { filter: brightness(.6); }
.vf-card.top { cursor: grab; }
.vf-card.dragging { transition: none; cursor: grabbing; }
.vf-card.went-right { transform: translateX(14%) rotate(4deg); }
.vf-card.went-left { transform: translateX(-14%) rotate(-4deg); }
.vf-card.leaving { transform: translateY(-120%) rotate(-6deg) scale(.9) !important; opacity: 0; }
.vf-card.gone { visibility: hidden; }
.vf-inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .7s cubic-bezier(.3, 1.3, .5, 1); }
.vf-card.flipped .vf-inner { transform: rotateY(180deg); }
.vf-face { position: absolute; inset: 0; backface-visibility: hidden; border-radius: 28px; overflow: hidden; border: 1px solid var(--line2);
  background: linear-gradient(170deg, #20235a, #121436); box-shadow: 0 30px 70px -25px rgba(0, 0, 0, .8); display: flex; flex-direction: column; }
.vf-img { flex: 0 0 42%; background-size: cover; background-position: center; position: relative; }
.vf-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 40%, #181a48); }
.vf-img-none { display: grid; place-items: center; font-size: 5rem; background: radial-gradient(circle at 50% 60%, rgba(255, 111, 176, .28), transparent 65%); }
.vf-body { flex: 1; padding: 1.2rem 1.8rem 1.6rem; display: flex; flex-direction: column; gap: .9rem; overflow: auto; }
.vf-meta { display: flex; justify-content: space-between; align-items: center; font-size: .8rem; color: var(--ink3); font-weight: 600; }
.vf-txt { margin: 0; font: 750 clamp(1.5rem, 2.3vw, 2.4rem) / 1.2 var(--fd); letter-spacing: -.02em; text-wrap: balance; }
.vf-stamp { position: absolute; top: 1.4rem; padding: .35rem 1rem; border: 4px solid; border-radius: 12px; font: 800 2rem var(--fd); letter-spacing: .05em; opacity: 0; pointer-events: none; }
.vf-stamp.vrai { left: 1.4rem; color: var(--cyan); transform: rotate(-12deg); opacity: calc(var(--lean, 0) * 1.4); }
.vf-stamp.faux { right: 1.4rem; color: var(--rose); transform: rotate(12deg); opacity: calc(var(--lean, 0) * -1.4); }
.vf-back { transform: rotateY(180deg); padding: 1.6rem 1.8rem; gap: .9rem; }
.vf-verdict { font: 800 2.6rem / 1 var(--fd); letter-spacing: -.03em; }
.vf-verdict.vrai { color: var(--cyan); }
.vf-verdict.faux { color: var(--rose); }
.vf-you { display: inline-flex; align-items: center; gap: .4rem; align-self: flex-start; padding: .3rem .8rem; border-radius: 99px; font-weight: 700; font-size: .9rem; }
.vf-you .ico { fill: none; }
.vf-you.ok { background: rgba(62, 230, 201, .15); color: var(--cyan); }
.vf-you.ko { background: rgba(255, 92, 138, .15); color: var(--rose); }
.vf-fait { margin: 0; font-size: 1.08rem; line-height: 1.6; color: #e4e3fb; flex: 1; overflow: auto; text-wrap: pretty; }
.vf-next { align-self: flex-end; }
.vf-card.is-ok .vf-back { border-color: rgba(62, 230, 201, .5); box-shadow: 0 0 60px -10px rgba(62, 230, 201, .35), 0 30px 70px -25px rgba(0, 0, 0, .8); }
.vf-card.is-ko .vf-back { border-color: rgba(255, 92, 138, .5); box-shadow: 0 0 60px -10px rgba(255, 92, 138, .3), 0 30px 70px -25px rgba(0, 0, 0, .8); }
.vf-chatbar { position: relative; height: 1.7rem; border-radius: 10px; background: rgba(255, 92, 138, .25); overflow: hidden; }
.vf-chatbar span { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(62, 230, 201, .45); }
.vf-chatbar em { position: relative; font: 700 .8rem/1.7rem var(--f); font-style: normal; padding: 0 .7rem; }
.vf-btn { justify-self: center; width: 9.5rem; height: 9.5rem; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .1rem;
  font: 800 1.5rem var(--fd); border: 2px solid; transition: .18s; }
.vf-btn .vf-x { font-size: 2.6rem; line-height: 1; }
.vf-btn kbd { font-size: .65rem; margin-top: .3rem; opacity: .7; }
.vf-btn.faux { color: var(--rose); border-color: rgba(255, 92, 138, .5); background: radial-gradient(circle, rgba(255, 92, 138, .18), rgba(255, 92, 138, .04)); }
.vf-btn.vrai { color: var(--cyan); border-color: rgba(62, 230, 201, .5); background: radial-gradient(circle, rgba(62, 230, 201, .18), rgba(62, 230, 201, .04)); }
.vf-btn:hover:not(:disabled) { transform: scale(1.07); }
.vf-btn.faux:hover:not(:disabled) { box-shadow: 0 0 40px rgba(255, 92, 138, .4); }
.vf-btn.vrai:hover:not(:disabled) { box-shadow: 0 0 40px rgba(62, 230, 201, .4); }
.vf-btn:disabled { opacity: .25; cursor: default; }
.vf-dots { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); display: flex; gap: .6rem; }
.vf-dots span { width: .8rem; height: .8rem; border-radius: 50%; background: var(--glass3); transition: .3s; }
.vf-dots .cur { background: var(--m-vf); box-shadow: 0 0 12px var(--m-vf); transform: scale(1.2); }
.vf-dots .ok { background: var(--cyan); }
.vf-dots .ko { background: var(--rose); }
.vf-recap { padding: .7rem .9rem; border-radius: 14px; background: var(--glass); border-left: 3px solid; margin: .5rem 0; }
.vf-recap.ok { border-color: var(--cyan); }
.vf-recap.ko { border-color: var(--rose); }
.vf-recap-h { display: flex; align-items: center; gap: .4rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; }
.vf-recap-h .vrai { color: var(--cyan); }
.vf-recap-h .faux { color: var(--rose); }
.vf-recap-h .ico { fill: none; margin-left: auto; }
.vf-recap.ok .ico { color: var(--cyan); }
.vf-recap.ko .ico { color: var(--rose); }
.vf-recap-t { font-size: .95rem; color: var(--ink2); margin-top: .2rem; }
.dr-wikis { display: flex; flex-direction: column; gap: .3rem; margin-top: .4rem; }

/* ---------- Mode QCM ---------- */
.qcm { display: grid; grid-template-columns: 1fr; gap: 1.4rem; align-content: center; max-width: 72rem; margin: 0 auto; width: 100%; }
.qcm.has-media { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); max-width: none; align-content: stretch; }
.qcm-media { min-height: 16rem; }
.qcm-planet { position: absolute; inset: 0; margin: auto; width: 70%; height: auto; max-height: 85%; object-fit: contain; filter: drop-shadow(0 0 40px rgba(140, 170, 255, .35)); }
.qcm-main { display: flex; flex-direction: column; gap: 1.1rem; justify-content: center; }
.qcm-main > .chip { align-self: flex-start; }
.qcm:not(.has-media) .qcm-main > .chip { align-self: center; }
.qcm-q { margin: 0; font: 800 clamp(1.8rem, 2.9vw, 3.2rem) / 1.1 var(--fd); letter-spacing: -.03em; text-wrap: balance; }
.qcm:not(.has-media) .qcm-q { text-align: center; }
.qcm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }
.qcm-opt { position: relative; overflow: hidden; display: flex; align-items: center; gap: 1rem; text-align: left; padding: 1.2rem 1.3rem; min-height: 5.5rem; border-radius: 20px;
  border: 1.5px solid var(--line2); background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03)); font: 650 1.25rem var(--f);
  transition: transform .15s, border-color .2s, background .2s, opacity .3s; animation: fadeUp .4s var(--d) ease both; }
.qcm-opt:hover:not(:disabled) { transform: translateY(-2px); border-color: color-mix(in srgb, var(--m-qcm) 60%, transparent); background: rgba(180, 140, 255, .1); }
.qcm-l { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 12px; display: grid; place-items: center; font: 800 1.2rem var(--fd); background: var(--glass2); color: var(--m-qcm); }
.qcm-pl { width: 3.2rem; height: 3.2rem; object-fit: contain; flex: none; }
.qcm-t { flex: 1; position: relative; z-index: 1; }
.qcm-opt.sel { border-color: var(--gold); background: rgba(255, 196, 77, .12); box-shadow: 0 0 0 3px rgba(255, 196, 77, .2); }
.qcm-opt.sel .qcm-l { background: var(--gold); color: #2a1300; }
.qcm-opt.out { opacity: .15; transform: scale(.96); }
.qcm-opt:disabled { cursor: default; }
.qcm-opt.good { border-color: var(--cyan); background: rgba(62, 230, 201, .16); box-shadow: 0 0 40px -6px rgba(62, 230, 201, .5); opacity: 1; }
.qcm-opt.good .qcm-l { background: var(--cyan); color: #00261f; }
.qcm-opt.bad { border-color: var(--rose); background: rgba(255, 92, 138, .14); animation: shake .45s; }
.qcm-opt.bad .qcm-l { background: var(--rose); color: #2b0010; }
.revealed .qcm-opt:not(.good):not(.bad) { opacity: .45; }
.qcm-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; pointer-events: none; display: none; }
.qcm-opt.has-chat .qcm-bar { display: block; }
.qcm-bar i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: rgba(165, 139, 255, .22); transition: width 1s cubic-bezier(.2, .9, .3, 1); }
.qcm-bar em { position: absolute; right: .9rem; bottom: .4rem; font: 700 .8rem var(--f); font-style: normal; color: var(--violet); }
@media (max-width: 900px) {
  .vf { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr auto; gap: 1rem; }
  .vf-stack { grid-column: 1 / -1; grid-row: 1; height: 30rem; }
  .vf-btn { width: 100%; height: 4.5rem; border-radius: 18px; flex-direction: row; gap: .5rem; }
  .vf-btn .vf-x { font-size: 1.6rem; }
  .vf-btn kbd { display: none; }
  .qcm.has-media, .qcm-grid { grid-template-columns: 1fr; }
}

/* Quand le panneau de réponse s'ouvre, le contenu se pousse à gauche */
.qcm, .vf, .frise-top, .ordre, .jauge, .carte-side { transition: margin-right .55s cubic-bezier(.2, .9, .25, 1); }
@media (min-width: 901px) {
  body.with-drawer .qcm, body.with-drawer .vf, body.with-drawer .frise-top, body.with-drawer .ordre, body.with-drawer .jauge { margin-right: calc(var(--drawer) + 1rem); }
  body.with-drawer .qcm-q { font-size: clamp(1.5rem, 2.2vw, 2.4rem); }
  body.with-drawer .vf { grid-template-columns: 0 minmax(0, 1fr) 0; gap: 0; }
  body.with-drawer .vf-btn { display: none; }
}
.vf-rappel { font: italic 500 .95rem var(--f); color: var(--ink3); }
.tl-gap span { top: -1.75rem; }
kbd { font-family: 'Segoe UI Symbol', 'Segoe UI', system-ui, sans-serif; }

/* ---------- Mode carte ---------- */
.carte { display: grid; grid-template-columns: minmax(18rem, 27rem) minmax(0, 1fr); gap: 1.2rem; min-height: 0; }
.carte-side { display: flex; flex-direction: column; gap: 1rem; min-height: 0; }
.carte-img { flex: 1 1 auto; min-height: 12rem; }
.carte-text { flex: 0 0 auto; display: flex; flex-direction: column; gap: .8rem; padding: 1.3rem 1.4rem; border-radius: var(--r-lg); background: linear-gradient(160deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .03));
  border: 1px solid var(--line); overflow: auto; }
.carte-text .chip { align-self: flex-start; }
.carte-q { margin: 0; font: 800 clamp(1.4rem, 1.9vw, 2.1rem) / 1.12 var(--fd); letter-spacing: -.02em; text-wrap: balance; }
.map-wrap { position: relative; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line2); cursor: crosshair; touch-action: none; user-select: none;
  background: radial-gradient(ellipse at 50% 40%, #12375c 0%, #0b2545 55%, #071a33 100%); box-shadow: var(--shadow), inset 0 0 120px rgba(0, 0, 0, .45); }
.map-wrap.panning { cursor: grabbing; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.map-grat { fill: none; stroke: rgba(150, 200, 255, .09); stroke-width: .6; vector-effect: non-scaling-stroke; }
.map-eq { fill: none; stroke: rgba(255, 196, 77, .18); stroke-width: 1; stroke-dasharray: 4 6; vector-effect: non-scaling-stroke; }
.map-land path { fill: #2a5574; stroke: #4f86a8; stroke-width: .6; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.map-land { filter: drop-shadow(0 0 3px rgba(120, 200, 255, .15)); }
.map-hl path { fill: rgba(255, 196, 77, .45); stroke: var(--gold); stroke-width: 1.5; vector-effect: non-scaling-stroke; animation: fadeIn .5s ease both; }
.map-zone path { fill: rgba(255, 196, 77, .14); stroke: var(--gold); stroke-width: 2; stroke-dasharray: 6 5; vector-effect: non-scaling-stroke; animation: fadeIn .5s ease both; }
.map-link { fill: none; stroke: #fff; stroke-width: 2.5; stroke-dasharray: 7 6; vector-effect: non-scaling-stroke; animation: fadeIn .6s .2s ease both; }
.map-grid path { fill: none; stroke: rgba(165, 139, 255, .35); stroke-width: 1; vector-effect: non-scaling-stroke; }
.map-grid text { fill: rgba(200, 185, 255, .75); font: 700 15px var(--f); }
.map-pins { position: absolute; inset: 0; pointer-events: none; }
.map-pin { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: transform; }
.map-pin i { position: absolute; left: -13px; top: -34px; width: 26px; height: 26px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); border: 3px solid #fff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, .5); }
.map-pin i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px; border-radius: 50%; background: #fff; }
.map-pin.me i { background: var(--gold); }
.map-pin.ans i { background: var(--cyan); }
.map-pin.in i { animation: pinDrop .45s cubic-bezier(.3, 1.5, .5, 1) both; }
@keyframes pinDrop { from { translate: 0 -40px; opacity: 0; } }
.map-pin .mp-label { position: absolute; left: 0; top: -60px; transform: translateX(-50%); white-space: nowrap; padding: .15rem .6rem; border-radius: 8px; font: 800 .85rem var(--fd); }
.map-pin.me .mp-label { background: var(--gold); color: #2a1300; }
.map-pin.ans .mp-label { background: var(--cyan); color: #00261f; }
.map-pin.chat i { left: -6px; top: -6px; width: 12px; height: 12px; border-radius: 50%; transform: none; border-width: 2px; background: var(--c, var(--violet)); box-shadow: none; }
.map-pin.chat i::after { display: none; }
.map-pin.chat .mp-label { display: none; }
.map-empty { position: absolute; left: 50%; top: 1.2rem; transform: translateX(-50%); padding: .5rem 1.1rem; border-radius: 99px; background: rgba(10, 20, 40, .7);
  border: 1px solid rgba(255, 196, 77, .45); color: #ffe3a3; font-weight: 600; font-size: .95rem; pointer-events: none; animation: breathe 2.2s ease-in-out infinite; white-space: nowrap; }
.map-wrap.has-pin .map-empty { display: none; }
.map-zoom { position: absolute; right: .8rem; bottom: .8rem; display: flex; flex-direction: column; gap: .35rem; }
.map-zoom .icon-btn { background: rgba(10, 20, 40, .75); }
.revealed .map-zoom { display: none; }
.revealed .map-wrap { cursor: grab; }
@media (max-width: 900px) {
  .carte { grid-template-columns: 1fr; grid-template-rows: auto minmax(22rem, 1fr); }
  .carte-img { display: none; }
}

/* ---------- Mode dans l'ordre ---------- */
.ordre { display: flex; flex-direction: column; justify-content: center; gap: 1.3rem; min-height: 0; }
.ordre-head { text-align: center; display: flex; flex-direction: column; align-items: center; gap: .6rem; }
.ordre-title { margin: 0; font: 800 clamp(2rem, 3.2vw, 3.4rem) / 1.05 var(--fd); letter-spacing: -.03em; }
.ordre-axis { display: flex; align-items: center; gap: 1rem; font: 700 .95rem var(--f); color: var(--m-ordre); text-transform: uppercase; letter-spacing: .08em; }
.ordre-axis i { flex: 1; height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(127, 157, 255, .2), var(--m-ordre)); position: relative; }
.ordre-axis i::after { content: ""; position: absolute; right: -2px; top: 50%; width: 12px; height: 12px; border-top: 3px solid var(--m-ordre); border-right: 3px solid var(--m-ordre); transform: translateY(-50%) rotate(45deg); }
.ordre-row { display: flex; gap: .9rem; justify-content: center; flex-wrap: wrap; }
.oc { position: relative; flex: 0 1 calc((100% - (var(--n) - 1) * .9rem) / var(--n)); max-width: 15rem; min-width: 7.5rem; display: flex; flex-direction: column; align-items: center; gap: .5rem;
  padding: 1.1rem .7rem 1rem; border-radius: 22px; border: 1.5px solid var(--line2); background: linear-gradient(170deg, rgba(255, 255, 255, .09), rgba(255, 255, 255, .03));
  cursor: grab; user-select: none; touch-action: none; transition: transform .35s cubic-bezier(.2, .9, .3, 1), border-color .2s, box-shadow .2s, background .2s;
  animation: fadeUp .4s var(--d) ease both; }
.oc:hover { border-color: color-mix(in srgb, var(--m-ordre) 60%, transparent); }
.oc.dragging { transition: none; z-index: 10; cursor: grabbing; border-color: var(--m-ordre); box-shadow: 0 24px 50px -10px rgba(0, 0, 0, .7), 0 0 0 4px rgba(127, 157, 255, .25); background: #252a66; }
.oc.sel { border-color: var(--gold); box-shadow: 0 0 0 4px rgba(255, 196, 77, .25); }
.oc.hinted { border-color: var(--gold); }
.oc.hinted::after { content: "📌"; position: absolute; top: -.6rem; right: -.4rem; font-size: 1.3rem; }
.oc-let { position: absolute; top: .55rem; left: .7rem; font: 800 .85rem var(--fd); color: var(--m-ordre); opacity: .8; }
.oc-vis { height: 7rem; width: 100%; display: grid; place-items: center; pointer-events: none; }
.oc-vis img { height: 6.4rem; width: auto; max-width: 100%; object-fit: contain; filter: drop-shadow(0 8px 18px rgba(0, 0, 0, .5)); }
.oc-vis img.ringed { height: auto; width: 100%; max-height: 6.4rem; }
.oc-emoji { font-size: 4.2rem; line-height: 1; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .45)); }
.oc-name { font: 750 1.08rem / 1.15 var(--fd); text-align: center; text-wrap: balance; pointer-events: none; }
.oc-val { font-size: .85rem; color: var(--ink2); text-align: center; max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s, opacity .5s; pointer-events: none; }
.revealed .oc-val { max-height: 4rem; opacity: 1; }
.oc-rank { position: absolute; top: -.7rem; left: 50%; transform: translateX(-50%) scale(0); min-width: 2rem; height: 2rem; padding: 0 .4rem; border-radius: 99px; display: grid; place-items: center;
  font: 800 .9rem var(--fd); transition: transform .35s cubic-bezier(.3, 1.5, .5, 1); }
.revealed .oc-rank { transform: translateX(-50%) scale(1); }
.oc.ok { border-color: var(--cyan); }
.oc.ok .oc-rank { background: var(--cyan); color: #00261f; }
.oc.ko { border-color: var(--rose); }
.oc.ko .oc-rank { background: var(--rose); color: #2b0010; }
.sorted .oc.ko { border-color: var(--line2); }
.sorted .oc.ko .oc-rank { background: var(--glass3); color: var(--ink2); }
.revealed .oc { cursor: default; }
.ordre-tip { text-align: center; font-size: .82rem; color: var(--ink3); }
.revealed .ordre-tip { visibility: hidden; }
.ordre .hint-slot { align-items: center; }

/* ---------- Mode combien ---------- */
.jauge { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 1.4rem; min-height: 0; }
.jg-visual { min-height: 14rem; }
.jg-planet { position: absolute; inset: 0; margin: auto; width: 72%; max-height: 86%; object-fit: contain; filter: drop-shadow(0 0 50px rgba(255, 170, 90, .3)); }
.jg-main { display: flex; flex-direction: column; justify-content: center; gap: 1.1rem; padding: 1.4rem 1.8rem; border-radius: var(--r-lg);
  background: linear-gradient(160deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .02)); border: 1px solid var(--line); }
.jg-main > .chip { align-self: flex-start; }
.jg-q { margin: 0; font: 800 clamp(1.7rem, 2.6vw, 2.9rem) / 1.1 var(--fd); letter-spacing: -.03em; text-wrap: balance; }
.jg-read { display: flex; align-items: baseline; gap: .6rem; min-height: 4.6rem; }
.jg-num { font: 800 clamp(2.6rem, 4.4vw, 4.4rem) / 1 var(--fd); letter-spacing: -.03em; color: var(--ink3); font-variant-numeric: tabular-nums; transition: color .2s; }
.touched .jg-num { color: var(--gold); }
.jg-unit { font: 650 1.3rem var(--f); color: var(--ink2); }
.jg-track-wrap { padding: 2.2rem .6rem 0; }
.jg-track { position: relative; height: 1.4rem; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 140, 90, .12), rgba(255, 140, 90, .28)); border: 1px solid rgba(255, 140, 90, .35);
  cursor: pointer; touch-action: none; }
.jg-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; background: linear-gradient(90deg, rgba(255, 196, 77, .2), rgba(255, 196, 77, .7)); opacity: 0; transition: opacity .2s; }
.touched .jg-fill { opacity: 1; }
.jg-thumb { position: absolute; top: 50%; width: 2.4rem; height: 2.4rem; margin: -1.2rem 0 0 -1.2rem; border-radius: 50%; background: var(--gold); border: 4px solid #fff;
  box-shadow: 0 6px 18px rgba(255, 170, 60, .6), 0 0 0 6px rgba(255, 196, 77, .2); transition: transform .15s; }
.jg-thumb::before { content: ""; position: absolute; left: 50%; bottom: 100%; height: .9rem; width: 2px; background: var(--gold); transform: translateX(-50%); }
.dragging .jg-thumb { transform: scale(1.15); }
.jauge:not(.touched) .jg-thumb { animation: breathe 2s ease-in-out infinite; }
.jg-band { position: absolute; top: -.5rem; bottom: -.5rem; border-radius: 10px; background: rgba(255, 196, 77, .18); border: 2px dashed var(--gold); animation: fadeIn .4s ease both; pointer-events: none; }
.jg-ans { position: absolute; top: 50%; width: 0; height: 0; pointer-events: none; }
.jg-ans::before { content: ""; position: absolute; left: -1.1rem; top: -1.1rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--cyan); border: 4px solid #fff; box-shadow: 0 0 24px rgba(62, 230, 201, .8);
  animation: pop .5s cubic-bezier(.3, 1.5, .5, 1) both; }
.jg-ans span { position: absolute; left: 0; bottom: 1.6rem; transform: translateX(-50%); white-space: nowrap; padding: .2rem .7rem; border-radius: 10px; background: var(--cyan); color: #00261f;
  font: 800 1rem var(--fd); animation: fadeUp .4s .2s ease both; }
.jg-chat i { position: absolute; top: 50%; width: 10px; height: 10px; margin: -5px; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .7); opacity: .85; }
.jg-ticks { position: relative; height: 1.6rem; margin-top: .6rem; }
.jg-ticks span { position: absolute; transform: translateX(-50%); font: 600 .8rem var(--fd); color: var(--ink3); white-space: nowrap; }
.jg-tools { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.jg-scale { font-size: .78rem; color: var(--ink3); }
.revealed .jg-track { cursor: default; }
@media (max-width: 900px) {
  .jauge { grid-template-columns: 1fr; }
  .jg-visual { min-height: 10rem; max-height: 12rem; }
  .oc { min-width: 6rem; }
  .oc-vis { height: 4.5rem; }
  .oc-emoji { font-size: 2.8rem; }
}

/* ---------- Panneaux de réglages ---------- */
.st-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; }
.panel { padding: 1.3rem 1.4rem; border-radius: 22px; background: var(--glass); border: 1px solid var(--line); display: flex; flex-direction: column; gap: .9rem; }
.panel h3 { margin: 0; font: 800 1.25rem var(--fd); display: flex; align-items: center; gap: .6rem; }
.step { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: grid; place-items: center; background: var(--violet); color: #1b0b3a; font-size: .95rem; }
.st-row { display: flex; align-items: center; border: 1.5px solid var(--line2); border-radius: 14px; background: rgba(0, 0, 0, .25); overflow: hidden; }
.st-row:focus-within { border-color: var(--violet); }
.st-prefix { padding: 0 0 0 .9rem; color: var(--ink3); font-weight: 600; }
.st-row input { flex: 1; min-width: 0; background: none; border: 0; color: var(--ink); font: 650 1.05rem var(--f); padding: .8rem .2rem; outline: none; }
.st-row .btn { border-radius: 0; align-self: stretch; }
.st-status { display: flex; align-items: center; gap: .5rem; font-weight: 600; font-size: .92rem; color: var(--ink2); }
.st-status i { width: .7rem; height: .7rem; border-radius: 50%; background: var(--ink3); }
.st-status.s-on i { background: #3fe07a; box-shadow: 0 0 10px #3fe07a; animation: breathe 1.6s infinite; }
.st-status.s-connecting i, .st-status.s-retry i { background: var(--gold); animation: breathe .8s infinite; }
.st-status.s-bad i, .st-status.s-error i { background: var(--rose); }
.linkbtn { background: none; border: 0; color: var(--cyan); text-decoration: underline; padding: 0; font: inherit; }
.st-note { margin: 0; font-size: .85rem; color: var(--ink3); line-height: 1.5; }
.st-cmds { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .45rem; }
.st-cmds li { display: flex; gap: .8rem; align-items: baseline; font-size: .92rem; color: var(--ink2); }
.sc-mode { flex: 0 0 9.5rem; font-weight: 700; color: var(--mc); }
.st-cmds b { color: var(--ink); background: var(--glass2); padding: 0 .35rem; border-radius: 6px; }
.st-tips { margin: 0; padding-left: 1.1rem; display: flex; flex-direction: column; gap: .5rem; font-size: .9rem; color: var(--ink2); }
.st-actions { display: flex; gap: 1rem; margin-top: 1.6rem; flex-wrap: wrap; }
.toggle { display: flex; align-items: flex-start; gap: .8rem; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.tg-ui { flex: none; width: 2.8rem; height: 1.6rem; border-radius: 99px; background: var(--glass3); position: relative; transition: background .2s; margin-top: .1rem; }
.tg-ui::after { content: ""; position: absolute; left: .2rem; top: .2rem; width: 1.2rem; height: 1.2rem; border-radius: 50%; background: #fff; transition: transform .2s cubic-bezier(.3, 1.4, .5, 1); }
.toggle input:checked + .tg-ui { background: var(--violet); }
.toggle input:checked + .tg-ui::after { transform: translateX(1.2rem); }
.toggle input:focus-visible + .tg-ui { outline: 2px solid var(--gold); outline-offset: 2px; }
.tg-txt { display: flex; flex-direction: column; gap: .1rem; }
.tg-txt small { color: var(--ink3); font-size: .82rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field select, .field input[type="range"] { width: 100%; }
.field select { background: rgba(0, 0, 0, .3); color: var(--ink); border: 1.5px solid var(--line2); border-radius: 12px; padding: .6rem .7rem; font: 600 .95rem var(--f); }
.field input[type="range"] { accent-color: var(--gold); }

/* ---------- Chat en jeu ---------- */
.chat-pill { display: inline-flex; align-items: center; gap: .45rem; height: 2.5rem; padding: 0 .9rem; border-radius: 12px; border: 1px solid rgba(165, 139, 255, .45);
  background: rgba(165, 139, 255, .12); color: #d9cfff; font: 700 .85rem var(--f); }
.chat-pill i { width: .55rem; height: .55rem; border-radius: 50%; background: var(--gold); }
.chat-pill.live i { background: #3fe07a; box-shadow: 0 0 8px #3fe07a; animation: breathe 1.6s infinite; }
.chat-pill.sim i { background: var(--violet); }
.chat-badge { display: flex; align-items: center; gap: .6rem; padding: .55rem 1rem; border-radius: 14px; background: rgba(165, 139, 255, .12); border: 1px solid rgba(165, 139, 255, .4);
  font-size: .95rem; margin-right: auto; max-width: 70%; }
.chat-badge.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.04); } }
.cb-dot { width: .6rem; height: .6rem; border-radius: 50%; background: var(--violet); flex: none; }
.cb-dot.live { background: #3fe07a; box-shadow: 0 0 8px #3fe07a; }
.cb-help { color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cb-help b { color: var(--ink); background: rgba(165, 139, 255, .25); padding: 0 .35rem; border-radius: 6px; }
.cb-n { font: 800 1.3rem var(--fd); color: #d9cfff; margin-left: .4rem; font-variant-numeric: tabular-nums; }
.cb-l { color: var(--ink3); font-size: .85rem; }
.cb-timer { font: 800 1.1rem var(--fd); color: var(--gold); padding: 0 .4rem; }
.cb-last { font-weight: 700; font-size: .85rem; animation: fadeUp .3s ease both; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 10rem; }
.chat-badge:not(.hidden) ~ .keys-help { display: none; }
.dr-chat { padding: 1rem 1.1rem; border-radius: 16px; background: rgba(165, 139, 255, .09); border: 1px solid rgba(165, 139, 255, .3); display: flex; flex-direction: column; gap: .5rem; }
.dr-chat-head { display: flex; align-items: center; gap: .45rem; font: 800 1.05rem var(--fd); color: #d9cfff; }
.dr-chat-head .ico { fill: none; }
.dr-chat-head span { margin-left: auto; font: 600 .8rem var(--f); color: var(--ink3); }
.dr-chat-sum { font-size: .92rem; color: var(--ink2); }
.dr-chat-top { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .25rem; counter-reset: c; }
.dr-chat-top li { display: flex; gap: .6rem; align-items: center; font-size: .92rem; counter-increment: c; }
.dr-chat-top li::before { content: counter(c); width: 1.3rem; color: var(--ink3); font-weight: 700; }
.dr-chat-top li span { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-chat-vs { font-size: .85rem; color: var(--ink3); }
.dr-chat-vs b { color: var(--gold); }
.res-chat { margin: 0 0 1.4rem; padding: 1rem 1.2rem; border-radius: 18px; background: rgba(165, 139, 255, .09); border: 1px solid rgba(165, 139, 255, .3); text-align: left; }
.res-chat-head { display: flex; align-items: center; gap: .45rem; font: 800 1.1rem var(--fd); color: #d9cfff; margin-bottom: .5rem; }
.res-chat-head .ico { fill: none; }
.res-chat ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .3rem; }
.res-chat li { display: flex; align-items: center; gap: .7rem; }
.rc-rank { width: 1.8rem; text-align: center; font-weight: 800; color: var(--ink3); }
.rc-name { flex: 1; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-n { font-size: .8rem; color: var(--ink3); }
.res-chat-vs { margin-top: .6rem; font-size: .9rem; color: var(--ink2); }
.res-chat-vs b { color: var(--gold); }

/* ---------- Cabinet ---------- */
.cab-progress { height: .6rem; border-radius: 99px; background: var(--glass2); overflow: hidden; margin: -1rem 0 1.2rem; }
.cab-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--gold)); }
.cab-filters { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.2rem; }
.cab-filters .chip { cursor: pointer; padding: .4rem .9rem; font-size: .85rem; }
.cab-filters .chip:not([style]) { --c: #fff; }
.cab-filters .chip.on { background: color-mix(in srgb, var(--c) 35%, transparent); border-color: var(--c); color: #fff; }
.cab-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .9rem; }
.cab-card { position: relative; display: flex; flex-direction: column; text-align: left; padding: 0; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--glass); transition: .18s; }
.cab-card[data-i]:hover { transform: translateY(-3px); border-color: var(--mc); }
.cab-img { height: 7.5rem; background-size: cover; background-position: center; background-color: #0b0d22; }
.cab-planet, .cab-emoji, .cab-lock { display: grid; place-items: center; }
.cab-planet img { height: 80%; }
.cab-emoji { font-size: 3.4rem; background: radial-gradient(circle, color-mix(in srgb, var(--mc) 22%, transparent), transparent 70%); }
.cab-lock { font: 800 3rem var(--fd); color: var(--ink3); background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .03) 0 10px, transparent 10px 20px); }
.cab-mode { position: absolute; top: .45rem; right: .45rem; width: 1.9rem; height: 1.9rem; border-radius: 50%; display: grid; place-items: center; background: rgba(5, 6, 26, .75); font-size: .95rem; }
.cab-t { padding: .55rem .7rem .7rem; font-size: .82rem; font-weight: 600; color: var(--ink2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cab-card.locked { opacity: .5; }
.cab-detail { display: flex; flex-direction: column; gap: 1rem; }
.cab-detail .cab-img { height: 14rem; border-radius: 18px; background-size: contain; background-repeat: no-repeat; }
.cab-detail h3 { margin: 0; font: 800 1.7rem / 1.1 var(--fd); letter-spacing: -.02em; }
.cab-detail .mode-chip { align-self: flex-start; }

/* ---------- Bilan sur deux colonnes ---------- */
.res-card { width: min(78rem, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 2.4rem; text-align: left; align-items: start; }
.res-main { display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; position: sticky; top: 0; }
.res-main .res-rank, .res-main .res-total { justify-content: flex-start; }
.res-side .res-list { margin-top: 0; }
.res-side .res-chat { margin-bottom: 0; }
.res-grid { display: flex; gap: .35rem; margin: 1rem 0 .4rem; }
.res-grid i { width: 1.6rem; height: 1.6rem; border-radius: 6px; animation: pop .4s ease both; }
.res-grid i:nth-child(n) { animation-delay: calc(var(--n, 0) * 60ms); }
.res-grid .g { background: #3fd27a; } .res-grid .y { background: var(--gold); } .res-grid .o { background: #ff9a3d; } .res-grid .r { background: var(--rose); }
.res-learn { color: var(--ink2); margin: .4rem 0 1.2rem; }
.res-learn b { color: var(--cyan); }
.res-actions { justify-content: flex-start; }
@media (max-width: 1100px) {
  .res-card { grid-template-columns: 1fr; }
  .res-main { position: static; align-items: center; text-align: center; }
  .res-main .res-rank, .res-main .res-total, .res-actions { justify-content: center; }
}
@media (max-width: 900px) {
  .round-head { flex-wrap: wrap; gap: .5rem; }
  .hints { width: 100%; overflow-x: auto; }
  .btn-hint { flex: none; }
  .mode-chip { white-space: nowrap; }
}
.cab-img:not(.cab-planet) img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cab-detail .cab-img:not(.cab-planet) img { object-fit: contain; }
.jg-emoji { font-size: clamp(7rem, 14vw, 13rem); filter: drop-shadow(0 20px 40px rgba(0, 0, 0, .45)); background: radial-gradient(circle, rgba(255, 140, 90, .22), transparent 65%); }

/* ---------- Archimède, l’escargot mascotte ---------- */
.leaves { display: inline-flex; align-items: center; gap: .3rem; font-variant-numeric: tabular-nums; }
.leaves b { font: 800 1em var(--fd); color: #9df07e; }
.leaf { width: 1.15em; height: 1.15em; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35)); }

.snail-box { position: relative; }
.sn-art { cursor: pointer; }
.snail-box.sn-mini .sn-art, .snail-box.sn-res .sn-art { cursor: default; }
.snail { display: block; width: 100%; height: auto; overflow: visible; }
.snail .sn-all { transform-origin: 150px 214px; animation: sn-breathe 2.8s ease-in-out infinite; }
.snail .sn-head { transform-origin: 238px 170px; animation: sn-nod 2.8s ease-in-out infinite; }
.snail .sn-ant-l { transform-origin: 226px 92px; animation: sn-ant 3.2s ease-in-out infinite; }
.snail .sn-ant-r { transform-origin: 252px 90px; animation: sn-ant 3.6s ease-in-out -1.2s infinite; }
.snail .sn-eye { transform-box: fill-box; transform-origin: center; animation: sn-blink 5s infinite; }
.snail .sn-spin { transform-box: fill-box; transform-origin: center; animation: sn-spin .45s linear infinite; }
.snail .sn-flicker { transform-box: fill-box; transform-origin: 50% 100%; animation: sn-flicker .22s ease-in-out infinite alternate; }
.snail .sn-flicker-x { transform-box: fill-box; transform-origin: 100% 50%; animation: sn-flicker-x .2s ease-in-out infinite alternate; }
.snail .sn-float { animation: sn-float 2.4s ease-in-out infinite; }
.snail .sn-twinkle { transform-box: fill-box; transform-origin: center; animation: sn-twinkle 1.8s ease-in-out infinite; }
.snail .sn-wave { transform-box: fill-box; transform-origin: 0 50%; animation: sn-wave 1.1s ease-in-out infinite alternate; }
.snail .sn-pulse { animation: sn-pulse 1.4s ease-out infinite; }
.snail.mood-happy .sn-all { animation: sn-hop .75s ease-in-out infinite; }
.snail.mood-sad .sn-head { animation: none; transform: translateY(4px) rotate(-4deg); }
.snail.mood-wow .sn-all { animation: sn-wow .5s ease-out; }
.snail.static, .snail.static * { animation: none !important; }
@keyframes sn-breathe { 50% { transform: scale(1.012, .985); } }
@keyframes sn-nod { 50% { transform: translateY(-2px) rotate(1.2deg); } }
@keyframes sn-ant { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes sn-blink { 0%, 92%, 100% { transform: scaleY(1); } 94% { transform: scaleY(.08); } }
@keyframes sn-spin { 50% { transform: scaleX(-1); } }
@keyframes sn-flicker { to { transform: scale(.82, 1.14); } }
@keyframes sn-flicker-x { to { transform: scale(1.18, .86); } }
@keyframes sn-float { 50% { transform: translateY(-4px); } }
@keyframes sn-twinkle { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.6); } }
@keyframes sn-wave { to { transform: skewY(-7deg) scaleX(.94); } }
@keyframes sn-pulse { 0% { opacity: 0; } 30% { opacity: 1; } 100% { opacity: 0; } }
@keyframes sn-hop { 0%, 100% { transform: translateY(0) scale(1); } 35% { transform: translateY(-16px) scale(.98, 1.03); } 65% { transform: translateY(0) scale(1.04, .95); } }
@keyframes sn-wow { 30% { transform: translateY(-8px) scale(1.03); } }
body.calm .snail .sn-all, body.calm .snail .sn-head { animation-duration: 5s; }

.sn-bubble { position: absolute; z-index: 3; left: 60%; bottom: 84%; width: max-content; max-width: 19rem; padding: .7rem 1rem;
  border-radius: 18px 18px 18px 4px; background: #fffaf0; color: #2b1b3d; font: 650 1rem / 1.35 var(--f); box-shadow: 0 12px 30px rgba(0, 0, 0, .4); transform-origin: 0 100%; pointer-events: none; }
.sn-bubble.pop { animation: sn-bubble .4s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes sn-bubble { from { opacity: 0; transform: scale(.5) translateY(12px); } }

/* Accueil */
.home-snail { position: absolute; z-index: 2; left: 0; bottom: 3%; width: min(24rem, 62%); display: flex; flex-direction: column; align-items: flex-start; gap: .4rem; }
.home-snail .snail-box { width: 100%; }
.btn-shop { gap: .7rem; }
.btn-shop .leaves { padding: .12rem .55rem; border-radius: 99px; background: rgba(139, 224, 108, .14); }
.home-snail .btn-shop { margin-left: 12%; }

/* Panneau de manche */
.dr-score { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); column-gap: .4rem; align-items: center; }
.dr-score > :not(.dr-snail) { grid-column: 2; }
.dr-snail { grid-column: 1; grid-row: 1 / span 3; width: 7.5rem; margin-left: -.6rem; }

/* Bilan */
.res-harvest { display: flex; align-items: center; gap: .9rem; margin: .9rem 0 .2rem; padding: .5rem 1.2rem .6rem .3rem; border-radius: 20px;
  background: rgba(139, 224, 108, .08); border: 1px solid rgba(139, 224, 108, .28); max-width: 34rem; }
.rh-snail { width: 10.5rem; flex: none; }
.rh-total { display: flex; align-items: center; gap: .3rem; font: 800 2rem var(--fd); color: #9df07e; font-variant-numeric: tabular-nums; }
.rh-total .leaf { width: 1.7rem; height: 1.7rem; }
.rh-total span { font: 600 .9rem var(--f); color: var(--ink2); margin-left: .35rem; }
.rh-list { list-style: none; margin: .15rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .1rem .9rem; font-size: .82rem; color: var(--ink3); }
.rh-list b { color: #9df07e; font-weight: 700; }
.rh-say { margin: .45rem 0 0; font-style: italic; color: var(--ink2); font-size: .92rem; }

/* Boutique */
.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .4rem; }
.shop-wallet { display: flex; align-items: center; gap: .55rem; padding: .45rem 1.1rem; border-radius: 99px; background: rgba(139, 224, 108, .12); border: 1px solid rgba(139, 224, 108, .38); font-size: 1.45rem; }
.shop-wallet .leaf { width: 1.6rem; height: 1.6rem; }
.shop-wallet > span:last-child { font-size: .85rem; color: var(--ink2); }
.shop-body { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 2.4rem; align-items: start; }
.shop-stage { position: sticky; top: 0; display: flex; flex-direction: column; align-items: center; text-align: center; }
.shop-stage .screen-title { margin-top: 0; }
.shop-stage .screen-sub { margin-bottom: .6rem; }
.shop-stage .screen-sub b { color: var(--gold); }
.stage-spot { position: absolute; left: 50%; top: 8rem; width: 32rem; height: 20rem; transform: translateX(-50%); pointer-events: none;
  background: radial-gradient(closest-side, rgba(255, 214, 120, .2), rgba(255, 214, 120, .05) 60%, transparent); }
.stage-snail { width: min(30rem, 100%); position: relative; margin-top: 2.2rem; }
.stage-name { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .8rem; border-radius: 12px; border: 1px dashed var(--line2); color: var(--ink3); margin: .2rem 0 1rem; cursor: text; }
.stage-name .ico { fill: none; width: 1.1rem; }
.stage-name input { background: none; border: 0; color: var(--ink); font: 800 1.5rem var(--fd); width: 11ch; text-align: center; outline: none; }
.stage-name:focus-within { border-color: var(--gold); }
.sh-info, .sh-card { --rc: var(--line2); }
.sh-info.r-commun, .sh-card.r-commun { --rc: #9fb3c8; }
.sh-info.r-rare, .sh-card.r-rare { --rc: #3ee6c9; }
.sh-info.r-epique, .sh-card.r-epique { --rc: #a58bff; }
.sh-info.r-legendaire, .sh-card.r-legendaire { --rc: #ffc44d; }
.sh-info { width: 100%; max-width: 34rem; text-align: left; padding: 1rem 1.3rem 1.1rem; border-radius: 20px; background: var(--glass); border: 1px solid var(--line); border-top: 3px solid var(--rc); min-height: 11rem; }
.sh-info h3 { margin: .25rem 0 .4rem; font: 800 1.6rem var(--fd); letter-spacing: -.01em; }
.sh-info p { margin: 0 0 .5rem; color: var(--ink2); text-wrap: pretty; }
.sh-info-top { display: flex; align-items: center; justify-content: space-between; gap: .6rem; }
.rar-chip { padding: .15rem .6rem; border-radius: 99px; font: 700 .72rem var(--f); text-transform: uppercase; letter-spacing: .08em; color: var(--rc);
  background: color-mix(in srgb, var(--rc) 16%, transparent); border: 1px solid color-mix(in srgb, var(--rc) 45%, transparent); }
.sh-cat { font-size: .85rem; color: var(--ink3); }
.sh-fact span { display: flex; align-items: center; gap: .35rem; color: var(--gold); font-weight: 700; margin-bottom: .15rem; }
.sh-fact .ico { fill: none; width: 1.1rem; }
.sh-act { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin-top: .7rem; }
.sh-worn { color: var(--cyan); font-weight: 700; }
.sh-short { color: var(--rose); font-size: .9rem; font-weight: 600; }
.btn-buy .leaves b { color: inherit; }
.sh-earn { display: flex; gap: .6rem; align-items: flex-start; font-size: .9rem; }
.sh-earn .leaf { width: 1.4rem; height: 1.4rem; margin-top: .1rem; }
.sh-earn b { color: #9df07e; }
.stage-tools { display: flex; gap: .6rem; margin-top: 1rem; }
.shop-tabs { display: flex; flex-wrap: wrap; gap: .45rem; margin-bottom: 1rem; }
.sh-tab { display: inline-flex; align-items: center; gap: .4rem; padding: .5rem .95rem; border-radius: 99px; border: 1px solid var(--line); background: var(--glass); color: var(--ink2); font: 650 .95rem var(--f); transition: .15s; }
.sh-tab em { font-style: normal; font-size: .75rem; color: var(--ink3); }
.sh-tab:hover { background: var(--glass2); color: var(--ink); }
.sh-tab.on { background: rgba(255, 196, 77, .16); border-color: rgba(255, 196, 77, .55); color: var(--ink); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.6rem, 1fr)); gap: .8rem; padding-bottom: 2rem; }
.sh-card { position: relative; display: flex; flex-direction: column; gap: .3rem; padding: .5rem .5rem .7rem; border-radius: 18px; border: 1px solid var(--line); text-align: left;
  background: linear-gradient(170deg, color-mix(in srgb, var(--rc) 14%, transparent), rgba(255, 255, 255, .02) 60%); transition: transform .15s, border-color .15s, box-shadow .2s; }
.sh-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--rc) 60%, transparent); }
.sh-card.sel { border-color: var(--rc); box-shadow: 0 0 0 2px color-mix(in srgb, var(--rc) 70%, transparent), 0 10px 30px rgba(0, 0, 0, .3); }
.sh-card.worn::after { content: "\2713"; position: absolute; top: .45rem; right: .5rem; width: 1.4rem; height: 1.4rem; border-radius: 50%; display: grid; place-items: center; background: var(--cyan); color: #04241e; font-weight: 800; font-size: .8rem; }
.sh-thumb { aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(255, 255, 255, .09), rgba(0, 0, 0, .2)); }
.sh-thumb .snail { width: 100%; height: 100%; }
.sh-name { font: 700 .95rem / 1.2 var(--fd); padding: 0 .15rem; }
.sh-foot { font-size: .85rem; color: var(--ink3); padding: 0 .15rem; }
.sh-foot i { font-style: normal; }
.sh-foot i.ok { color: var(--cyan); font-weight: 700; }
.sh-rar { position: absolute; top: .5rem; left: .55rem; font: 700 .6rem var(--f); text-transform: uppercase; letter-spacing: .08em; color: var(--rc); background: rgba(5, 6, 26, .7); padding: .1rem .42rem; border-radius: 99px; }
.sh-card.r-none .sh-thumb { opacity: .75; }
@media (max-width: 1100px) {
  .shop-body { grid-template-columns: 1fr; }
  .shop-stage { position: static; }
}
@media (max-width: 900px) {
  .home-snail { position: relative; width: min(20rem, 90%); margin: 0 auto; }
  .shop-wallet > span:last-child { display: none; }
  .shop-grid { grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); }
}
.menu-screen.shop { max-width: 112rem; }
.sn-big .sn-bubble { left: auto; right: 4%; bottom: 92%; border-radius: 18px 18px 4px 18px; transform-origin: 100% 100%; }
.home-snail { width: min(27rem, 60%); bottom: 1%; }
.stage-snail { width: min(36rem, 100%); }
.res-actions .btn { padding-left: 1rem; padding-right: 1rem; }
.dr-score { grid-template-columns: 8.5rem minmax(0, 1fr); }
.dr-snail { width: 8.5rem; }
@media (max-width: 900px) { .sn-home .sn-bubble { display: none; } }
@media (min-width: 901px) {
  .home-snail { left: auto; right: 0; bottom: 0; align-items: flex-end; }
  .home-snail .btn-shop { margin-left: 0; margin-right: 10%; }
  .sn-home .sn-bubble { left: auto; right: 20%; bottom: 90%; border-radius: 18px 18px 4px 18px; transform-origin: 100% 100%; }
}
@media (min-width: 901px) { .home-snail { width: min(20rem, 45%); } }

/* ---------- Chrono de manche ---------- */
.round-timer { display: flex; align-items: center; gap: .7rem; margin-right: .4rem; }
.rt-bar { width: 12rem; height: .6rem; border-radius: 99px; background: rgba(255, 255, 255, .1); overflow: hidden; }
.rt-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--cyan), var(--gold)); transform-origin: left; }
.rt-num { min-width: 3.4rem; display: flex; align-items: baseline; gap: .1rem; font: 800 2rem var(--fd); font-variant-numeric: tabular-nums; }
.rt-num span { font-size: .9rem; color: var(--ink3); }
.round-timer.urgent .rt-bar i { background: var(--rose); }
.round-timer.urgent .rt-num { color: var(--rose); animation: rt-pulse .5s ease-in-out infinite alternate; }
@keyframes rt-pulse { to { transform: scale(1.15); } }
.mp-loading { position: absolute; inset: 0; display: grid; place-items: center; font: 800 2rem var(--fd); color: var(--ink2); }
.vf-recap-f { margin: .3rem 0 0; font-size: .85rem; color: var(--ink2); }

/* ---------- Multijoueur : accueil ---------- */
.link-card.link-multi { grid-column: 1 / -1; background: linear-gradient(120deg, rgba(165, 139, 255, .22), rgba(62, 230, 201, .1)); border-color: rgba(165, 139, 255, .5); }
.link-card.link-multi b { font-size: 1.1rem; }

/* Notifications (invitations, demandes d'ami) */
#mp-notes { position: fixed; z-index: 60; left: 1rem; bottom: 1rem; display: flex; flex-direction: column; gap: .6rem; width: min(24rem, calc(100vw - 2rem)); }
.mp-note { padding: .9rem 1rem; border-radius: 18px; background: rgba(20, 22, 60, .97); border: 1px solid rgba(165, 139, 255, .55); box-shadow: 0 16px 40px rgba(0, 0, 0, .5); animation: mp-in .35s cubic-bezier(.2, 1.2, .4, 1) both; }
.mp-note.out { opacity: 0; transform: translateY(10px); transition: .3s; }
.mp-note-txt { margin-bottom: .6rem; }
.mp-note-act { display: flex; gap: .5rem; }
.mp-note .btn { padding: .45rem .9rem; font-size: .9rem; }
@keyframes mp-in { from { opacity: 0; transform: translateY(16px) scale(.96); } }

/* Écran multijoueur */
.mp-top { display: grid; grid-template-columns: 1.3fr 1fr; gap: 1rem; margin-bottom: 1rem; }
.mp-me { display: flex; gap: 1.2rem; align-items: center; }
.mp-me-av { width: 9rem; flex: none; }
.mp-me-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .7rem; }
.mp-code { display: flex; align-items: center; gap: .6rem; color: var(--ink2); flex-wrap: wrap; }
.mp-code b { font: 800 1.5rem var(--fd); letter-spacing: .08em; color: var(--gold); }
.mp-code .btn { padding: .35rem .8rem; font-size: .85rem; }
.mp-net { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--ink3); }
.mp-net i { width: .6rem; height: .6rem; border-radius: 50%; background: var(--ink3); }
.mp-net.s-on i { background: #3fd27a; box-shadow: 0 0 8px #3fd27a; }
.mp-net.s-connecting i, .mp-net.s-retry i { background: var(--gold); }
.mp-net.s-error i { background: var(--rose); }
.mp-play { display: flex; flex-direction: column; justify-content: center; gap: .9rem; }
.mp-play .btn-xl { width: 100%; }
.mp-join, .mp-add { display: flex; gap: .5rem; }
.mp-join input, .mp-add input { flex: 1; min-width: 0; padding: .7rem 1rem; border-radius: 14px; border: 1px solid var(--line2); background: rgba(0, 0, 0, .25); color: var(--ink); font: 700 1.05rem var(--f); letter-spacing: .06em; text-transform: uppercase; }
.mp-join input::placeholder, .mp-add input::placeholder { text-transform: none; letter-spacing: 0; color: var(--ink3); font-weight: 500; }
.mp-msg { min-height: 1.3rem; font-size: .9rem; margin: .4rem 0; }
.mp-msg.ok { color: #3fd27a; }
.mp-msg.bad { color: var(--rose); }
.mp-friends h3 em { font-style: normal; font-size: .85rem; color: var(--ink3); margin-left: .3rem; }
.mp-flist, .mp-inv ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(21rem, 1fr)); gap: .6rem; }
.mp-friend { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; border-radius: 16px; background: var(--glass); border: 1px solid var(--line); }
.mp-fn { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mp-fn b { font: 700 1rem var(--fd); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-fn span { display: flex; align-items: center; gap: .35rem; font-size: .8rem; color: var(--ink3); }
.mp-fn span i { width: .5rem; height: .5rem; border-radius: 50%; background: var(--ink3); }
.f-on .mp-fn span i, .f-room .mp-fn span i { background: #3fd27a; }
.f-busy .mp-fn span i { background: var(--gold); }
.mp-fa { display: flex; gap: .4rem; align-items: center; }
.mp-fa .btn { padding: .4rem .8rem; font-size: .85rem; }
.mp-fa .btn-ghost .ico { width: 1rem; fill: none; }
.mp-empty { color: var(--ink3); font-size: .95rem; padding: .4rem 0; grid-column: 1 / -1; }
.mp-req { display: flex; align-items: center; gap: .7rem; padding: .5rem .7rem; margin-bottom: .5rem; border-radius: 16px; background: rgba(255, 196, 77, .1); border: 1px solid rgba(255, 196, 77, .35); }
.mp-req span { flex: 1; }
.mp-req .btn { padding: .4rem .8rem; font-size: .85rem; }
.mp-av { width: 2.6rem; height: 2.6rem; flex: none; display: block; border-radius: 50%; overflow: hidden; background: radial-gradient(circle at 50% 40%, rgba(255, 255, 255, .12), rgba(0, 0, 0, .25)); border: 1px solid var(--line2); }
.mp-av .snail { width: 100%; height: 100%; }
.mp-ok { color: #3fd27a; font-weight: 700; font-size: .9rem; }

/* Salon */
.mp-salon-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.mp-room { font: 800 1em var(--fd); letter-spacing: .12em; color: var(--gold); padding: 0 .5rem; border-radius: 12px; background: rgba(255, 196, 77, .12); }
.mp-stage { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 1rem 1.6rem; margin: .6rem 0 1.4rem; min-height: 11rem; }
.mp-seat { width: 11rem; display: flex; flex-direction: column; align-items: center; gap: .1rem; animation: mp-in .4s var(--d, 0ms) both; }
.mp-seat-art { width: 100%; }
.mp-seat b { font: 750 1.05rem var(--fd); text-align: center; }
.mp-seat span { font-size: .8rem; color: var(--ink3); min-height: 1.1em; }
.mp-seat.me b { color: var(--gold); }
.mp-seat.empty { opacity: .45; }
.mp-seat.empty .mp-seat-art { width: 70%; height: 5.5rem; display: grid; place-items: center; border: 2px dashed var(--line2); border-radius: 20px; font: 800 2rem var(--fd); color: var(--ink3); }
.mp-salon-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; }
.mp-salon-grid .mp-inv ul { grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); }
.mp-ro { font-weight: 700; }
.mp-actions { display: flex; justify-content: center; gap: .8rem; margin-top: 1.4rem; flex-wrap: wrap; }
.mp-waiting { display: flex; align-items: center; gap: .8rem; font: 700 1.2rem var(--fd); color: var(--ink2); padding: 1rem; }
.mp-dots { display: inline-flex; gap: .2rem; }
.mp-dots i { width: .4rem; height: .4rem; border-radius: 50%; background: currentColor; animation: mp-dot 1s ease-in-out infinite; }
.mp-dots i:nth-child(2) { animation-delay: .15s; }
.mp-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes mp-dot { 50% { transform: translateY(-4px); opacity: .4; } }

/* Classement dans le volet de manche */
.mp-round { border-radius: 18px; background: rgba(165, 139, 255, .08); border: 1px solid rgba(165, 139, 255, .3); padding: .9rem 1rem; }
.mp-wait { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.mp-wait span { font: 800 1.2rem var(--fd); color: var(--violet); }
.mp-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.mp-mini li { display: flex; align-items: center; gap: .6rem; color: var(--ink3); }
.mp-mini li.ok { color: var(--ink); }
.mp-mini li span { flex: 1; }
.mp-mini .ico { width: 1.1rem; fill: none; color: #3fd27a; }
.mp-mini .mp-av, .mp-board .mp-av { width: 2.1rem; height: 2.1rem; }
.mp-board-head { font: 800 .8rem var(--f); text-transform: uppercase; letter-spacing: .12em; color: #d9cfff; margin-bottom: .5rem; }
.mp-board { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.mp-board li { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem; border-radius: 12px; animation: mp-in .35s var(--d, 0ms) both; }
.mp-board li.me { background: rgba(255, 196, 77, .12); }
.mp-board .rk { width: 1.4rem; text-align: center; font: 800 1rem var(--fd); color: var(--ink3); }
.mp-board li:first-child .rk { color: var(--gold); }
.mp-board .nm { flex: 1; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-board .nm i { font-style: normal; font-size: .7rem; margin-left: .3rem; }
.mp-board .up { color: #3fd27a; }
.mp-board .down { color: var(--rose); }
.mp-board em { font-style: normal; font-weight: 700; font-size: .9rem; }
.mp-board em.g { color: #3fd27a; }
.mp-board em.y { color: var(--gold); }
.mp-board em.r { color: var(--rose); }
.mp-board .tt { min-width: 3.6rem; text-align: right; font: 800 1.05rem var(--fd); font-variant-numeric: tabular-nums; }
.mp-next { display: flex; align-items: center; gap: .8rem; margin-top: .8rem; flex-wrap: wrap; }
.mp-count { font-size: .9rem; color: var(--ink3); }
.mp-count b { color: var(--ink); }

/* Podium */
.mp-podium { text-align: center; }
.mp-podium .screen-title { margin-top: 1.4rem; }
.mp-steps { display: flex; justify-content: center; align-items: flex-end; gap: 1rem; margin: 1rem 0 1.2rem; }
.mp-step { width: 15rem; display: flex; flex-direction: column; align-items: center; gap: .15rem; }
.mp-step-art { width: 100%; }
.mp-step b { font: 800 1.25rem var(--fd); }
.mp-step span { color: var(--ink2); font-weight: 600; }
.mp-step.me b { color: var(--gold); }
.mp-block { width: 100%; margin-top: .5rem; border-radius: 18px 18px 6px 6px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem; font-size: 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04)); border: 1px solid var(--line2); }
.mp-block em { font: 800 2.4rem var(--fd); font-style: normal; color: var(--ink2); }
.s1 .mp-block { height: 10rem; background: linear-gradient(180deg, rgba(255, 196, 77, .35), rgba(255, 196, 77, .06)); border-color: rgba(255, 196, 77, .5); }
.s2 .mp-block { height: 7rem; }
.s3 .mp-block { height: 5rem; }
.mp-rest { list-style: none; margin: 0 auto 1rem; padding: 0; max-width: 30rem; display: flex; flex-direction: column; gap: .3rem; }
.mp-rest li { display: flex; align-items: center; gap: .6rem; padding: .35rem .7rem; border-radius: 12px; background: var(--glass); }
.mp-rest li span { flex: 1; text-align: left; }
.mp-rest li.me { background: rgba(255, 196, 77, .12); }
.mp-harvest { margin: 0 auto; justify-content: center; padding-left: 1.2rem; }
@media (max-width: 900px) {
  .mp-top, .mp-salon-grid { grid-template-columns: 1fr; }
  .mp-steps { gap: .4rem; }
  .mp-step { width: 32%; }
  .rt-bar { width: 6rem; }
  .mp-flist, .mp-inv ul { grid-template-columns: 1fr; }
}
.rt-bar { width: 18rem; height: .8rem; }
.rt-num { font-size: 2.8rem; min-width: 4.4rem; }
.round-timer { gap: .9rem; padding: .3rem .9rem .3rem 1rem; border-radius: 99px; background: rgba(0, 0, 0, .25); border: 1px solid var(--line); }
.round-timer.urgent { border-color: rgba(255, 92, 138, .6); }
.mp-stage { align-items: flex-start; }
.mp-seat span { min-height: 1.2rem; line-height: 1.2rem; }
.field input[type="text"] { width: 100%; background: rgba(0, 0, 0, .3); color: var(--ink); border: 1.5px solid var(--line2); border-radius: 12px; padding: .6rem .8rem; font: 700 1.1rem var(--f); outline: none; }
.field input[type="text"]:focus { border-color: var(--gold); }
.mp-me-av { width: 14rem; }
.panel.mp-me { flex-direction: row; align-items: center; }
.mp-friends .mp-msg:empty { min-height: .4rem; margin: .2rem 0; }

/* ---------- La dictée ---------- */
.dictee { width: min(76rem, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: .9rem; padding-bottom: 1rem; }
.dt-head { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; }
.dt-title { margin: 0; font: 800 clamp(1.8rem, 2.6vw, 2.7rem) / 1.1 var(--fd); letter-spacing: -.02em; }
.dt-page { position: relative; padding: 2rem 2.6rem 2.4rem 5.4rem; border-radius: 18px; color: #1f2340;
  background: repeating-linear-gradient(transparent 0 calc(3.3rem - 1px), rgba(70, 110, 200, .28) calc(3.3rem - 1px) 3.3rem) 0 1.15rem / 100% 100% no-repeat, #fbf6e8;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .65), inset 0 0 0 1px rgba(0, 0, 0, .06); }
.dt-page::before { content: ""; position: absolute; left: 3.7rem; top: 0; bottom: 0; width: 2px; background: rgba(226, 70, 96, .55); }
.dt-page::after { content: ""; position: absolute; left: 1.3rem; top: 1.6rem; bottom: 1.6rem; width: 14px; background: radial-gradient(circle, #0b0d22 5px, transparent 6px) 0 0 / 14px 3.3rem repeat-y; opacity: .85; }
.dt-text { margin: 0; font: 400 1.75rem / 3.3rem Georgia, 'Times New Roman', serif; text-wrap: pretty; }
.dt-slot { position: relative; display: inline-block; min-width: 4.6rem; margin: 0 .12rem; padding: 0 .55rem; border: 0; border-bottom: 3px dashed #4f5fd1; border-radius: 8px 8px 0 0;
  background: rgba(79, 95, 209, .1); color: #2433a8; font: italic 700 1.75rem / 2.5rem Georgia, 'Times New Roman', serif; text-align: center; cursor: pointer; vertical-align: baseline; transition: background .15s, box-shadow .15s; }
.dt-slot:hover { background: rgba(79, 95, 209, .2); }
.dt-slot.active { background: rgba(79, 95, 209, .24); box-shadow: inset 0 0 0 2px #4f5fd1; }
.dt-slot.filled { border-bottom-style: solid; }
.dt-slot.given { color: #7a4cc4; border-color: #9a6be0; }
.dt-slot sup { position: absolute; top: -.75rem; left: -.35rem; font: 800 .7rem var(--f); color: #fff; background: #4f5fd1; border-radius: 99px; padding: .05rem .35rem; font-style: normal; line-height: 1.2; }
.dt-slot.good { color: #13803d; border-bottom-color: #22c55e; background: rgba(34, 197, 94, .16); }
.dt-slot.bad { color: #b4232c; border-bottom-color: #ef4444; background: rgba(239, 68, 68, .12); }
.dt-slot.bad s { opacity: .65; text-decoration-thickness: 2px; }
.dt-slot .fix { color: #13803d; font-style: italic; }
.dt-slot:disabled { cursor: default; }
.dt-chat { position: absolute; right: -.4rem; top: -.8rem; font: 700 .7rem var(--f); font-style: normal; color: #fff; background: var(--violet); padding: .05rem .35rem; border-radius: 99px; line-height: 1.3; }
.dt-pop { position: absolute; z-index: 6; display: flex; gap: .4rem; padding: .45rem; border-radius: 14px; background: #1b1e4a; border: 1px solid var(--line2); box-shadow: 0 16px 34px rgba(0, 0, 0, .5); animation: mp-in .2s ease-out both; }
.dt-pop::before { content: ""; position: absolute; top: -7px; left: 50%; width: 12px; height: 12px; background: #1b1e4a; border-left: 1px solid var(--line2); border-top: 1px solid var(--line2); transform: translateX(-50%) rotate(45deg); }
.dt-pop button { display: flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 10px; border: 1px solid var(--line2); background: var(--glass2); color: var(--ink); font: 700 1.3rem Georgia, 'Times New Roman', serif; white-space: nowrap; transition: .12s; }
.dt-pop button em { font: 800 .72rem var(--f); color: var(--m-dictee); font-style: normal; }
.dt-pop button:hover, .dt-pop button.sel { background: rgba(155, 225, 93, .18); border-color: var(--m-dictee); }
.dt-legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .85rem; color: var(--ink2); }
.dt-legend span { display: inline-flex; gap: .4rem; align-items: center; }
.dt-legend b { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: #4f5fd1; color: #fff; font-size: .7rem; }
.dt-rules { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-direction: column; gap: .55rem; }
.dt-rules li { display: flex; flex-direction: column; gap: .1rem; }
.dt-rules b { color: var(--m-dictee); font: 700 1rem Georgia, 'Times New Roman', serif; }
.dt-rules span { color: var(--ink2); font-size: .95rem; }
.hint-card .dt-rules b { color: var(--gold); }
.dt-fact-lead { margin: 0 0 .3rem; color: var(--ink2); }
@media (max-width: 900px) {
  .dt-page { padding: 1.4rem 1.2rem 1.6rem 2.6rem; }
  .dt-page::before { left: 1.8rem; }
  .dt-page::after { display: none; }
  .dt-text, .dt-slot { font-size: 1.25rem; }
  .dt-text { line-height: 2.6rem; }
  .dt-slot { line-height: 2rem; min-width: 3rem; }
  .dt-pop { flex-wrap: wrap; }
}
.dictee { width: min(72rem, 100%); justify-content: center; align-self: center; transition: margin .4s ease; }
.dt-text, .dt-slot { font-size: 2.05rem; }
.dt-text { line-height: 3.8rem; }
.dt-slot { line-height: 2.9rem; }
.dt-page { background-size: 100% 100%, auto; background: repeating-linear-gradient(transparent 0 calc(3.8rem - 1px), rgba(70, 110, 200, .28) calc(3.8rem - 1px) 3.8rem) 0 1.4rem / 100% 100% no-repeat, #fbf6e8; }
.dt-page::after { background-size: 14px 3.8rem; }
@media (min-width: 901px) { body.with-drawer .dictee { margin-right: calc(var(--drawer) + 1rem); margin-left: 0; } body.with-drawer .dt-text, body.with-drawer .dt-slot { font-size: 1.75rem; } body.with-drawer .dt-text { line-height: 3.4rem; } }
.round-body > .dictee { flex: 0 1 82rem; margin-left: auto; margin-right: auto; }
.dt-page { background: repeating-linear-gradient(transparent 0 calc(3.8rem - 1px), rgba(70, 110, 200, .3) calc(3.8rem - 1px) 3.8rem) 0 1.25rem / 100% 100% no-repeat, #fbf6e8; }
@media (min-width: 901px) { body.with-drawer .round-body > .dictee { margin-right: calc(var(--drawer) + 1rem); margin-left: 0; } body.with-drawer .dt-text { line-height: 3.8rem; } }

/* ---------- Mode « À l'échelle » ---------- */
.echelle { display: flex; flex-direction: column; gap: .8rem; min-height: 0; transition: margin-right .55s cubic-bezier(.2, .9, .25, 1); }
.ec-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.ec-q { margin: 0; flex: 1 1 30rem; font: 800 clamp(1.3rem, 2vw, 2.2rem) / 1.12 var(--fd); letter-spacing: -.02em; text-wrap: balance; }
.ec-head .hint-slot { flex: 1 1 100%; }
.ec-head .hint-slot:empty { display: none; }
.ec-stage { position: relative; flex: 1; min-height: 18rem; overflow: hidden; border-radius: var(--r-lg); border: 1px solid var(--line2); cursor: ns-resize; touch-action: none; user-select: none;
  background: radial-gradient(ellipse 80% 60% at 50% 100%, rgba(87, 199, 255, .12), transparent 70%), linear-gradient(180deg, rgba(10, 14, 46, .7), rgba(14, 20, 60, .8)); box-shadow: var(--shadow); }
.revealed .ec-stage { cursor: default; }
.ec-ground { position: absolute; left: 0; right: 0; bottom: 0; border-top: 2px solid rgba(255, 255, 255, .28); background: linear-gradient(180deg, rgba(87, 199, 255, .1), rgba(0, 0, 0, .25)); }
.ec-line { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255, 255, 255, .09); pointer-events: none; }
.ec-line span { position: absolute; left: .7rem; bottom: .2rem; font: 650 .72rem var(--f); color: var(--ink3); white-space: nowrap; }
.ec-fig { position: absolute; left: 0; top: 0; pointer-events: none; }
.ec-fig .sil { display: block; width: 100%; height: 100%; overflow: visible; }
.sil-hi { fill: rgba(255, 255, 255, .22); }
.ec-ref .sil-body { fill: #8e9be0; }
.ec-obj .sil-body { fill: var(--gold); }
.ec-obj { filter: drop-shadow(0 0 18px rgba(255, 196, 77, .35)); }
.ec-truth .sil-body { fill: rgba(62, 230, 201, .22); stroke: var(--cyan); stroke-width: 2px; vector-effect: non-scaling-stroke; }
.ec-truth .sil-hi { display: none; }
.ec-truth .sil-astre image { opacity: .5; }
.ec-truth .sil-astre { outline: 3px solid var(--cyan); outline-offset: -2px; border-radius: 50%; }
.revealed .ec-obj { opacity: .45; filter: none; }
.ec-tag { position: absolute; left: 0; top: 0; translate: -50% 0; display: flex; flex-direction: column; align-items: center; text-align: center; max-width: 42%; pointer-events: none; }
.ec-tag b { font: 750 .95rem / 1.15 var(--fd); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.ec-tag span { font: 700 .85rem var(--f); color: var(--ink3); }
.ec-tag-obj span { color: var(--gold); }
.revealed .ec-tag-obj span { color: var(--cyan); }
.ec-bubble { position: absolute; left: 0; top: 0; display: flex; flex-direction: column; align-items: center; padding: .25rem .8rem .3rem; border-radius: 12px; pointer-events: none;
  background: rgba(20, 16, 50, .82); border: 1px solid rgba(255, 196, 77, .55); white-space: nowrap; translate: -50% -100%; }
.ec-bubble b { font: 800 1.25rem / 1.1 var(--fd); color: var(--gold); font-variant-numeric: tabular-nums; }
.ec-bubble span { font-size: .72rem; color: var(--ink2); }
.revealed .ec-bubble { border-color: var(--cyan); }
.revealed .ec-bubble b { color: var(--cyan); }
.ec-band { position: absolute; border-top: 2px dashed var(--gold); border-bottom: 2px dashed var(--gold); background: rgba(255, 196, 77, .1); pointer-events: none; }
.ec-chat i { position: absolute; width: 16px; height: 4px; margin-top: -2px; border-radius: 3px; opacity: .85; }
.ec-help { position: absolute; top: .8rem; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: .45rem; padding: .35rem .9rem; border-radius: 99px;
  background: rgba(255, 255, 255, .07); border: 1px solid var(--line); color: var(--ink2); font-size: .8rem; white-space: nowrap; pointer-events: none; transition: opacity .4s; }
.echelle.touched .ec-help { opacity: 0; }
.echelle:not(.touched) .ec-obj { animation: breathe 2s ease-in-out infinite; }
.ec-stage.anim .ec-fig, .ec-stage.anim .ec-tag, .ec-stage.anim .ec-bubble, .ec-stage.anim .ec-line { transition: transform .9s cubic-bezier(.2, .9, .25, 1), width .9s cubic-bezier(.2, .9, .25, 1), height .9s cubic-bezier(.2, .9, .25, 1), top .9s cubic-bezier(.2, .9, .25, 1), opacity .5s; }
.ec-tools { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.ec-range { flex: 1 1 14rem; accent-color: var(--gold); height: 2rem; cursor: pointer; }
.ec-small { font-size: .75rem; color: var(--ink3); }
.cab-sil { display: grid; place-items: center; background: radial-gradient(circle at 50% 80%, rgba(87, 199, 255, .2), transparent 70%); }
.cab-sil .sil { height: 80%; width: auto; max-width: 85%; }
.cab-sil .sil-body { fill: var(--gold); }

/* ---------- Mode « Le puzzle » ---------- */
.puzzle { display: flex; flex-direction: column; gap: .8rem; min-height: 0; transition: margin-right .55s cubic-bezier(.2, .9, .25, 1); }
.pz-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; }
.pz-q { margin: 0; flex: 1 1 24rem; font: 800 clamp(1.3rem, 2vw, 2.2rem) / 1.12 var(--fd); letter-spacing: -.02em; }
.pz-head .hint-slot { flex: 1 1 100%; }
.pz-head .hint-slot:empty { display: none; }
.pz-stage { position: relative; flex: 1; min-height: 20rem; user-select: none; touch-action: none; }
.pz-map { position: absolute; border-radius: var(--r-lg); border: 1px solid var(--line2); box-shadow: var(--shadow); overflow: hidden; }
.pz-sea { fill: #0f2149; }
.pz-decor { fill: #3a4f82; stroke: #22305c; stroke-width: 1; }
.pz-tray { position: absolute; border-radius: var(--r-lg); background: rgba(255, 255, 255, .04); border: 1px dashed var(--line2); }
.pz-piece { position: absolute; left: 0; top: 0; transform-origin: 0 0; z-index: 2; pointer-events: none; }
.pz-piece path { cursor: grab; }
.revealed .pz-tray { opacity: 0; transition: opacity .4s; }
.pz-piece svg { display: block; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.pz-piece path { fill: var(--m-puzzle); stroke: #4a3c06; stroke-width: 1.5px; vector-effect: non-scaling-stroke; pointer-events: visiblePainted; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .45)); }
.pz-piece.placed path { fill: #f3e27a; filter: none; }
.pz-piece.dragging { z-index: 5; }
.pz-piece.dragging path { cursor: grabbing; }
.pz-piece.dragging path { filter: drop-shadow(0 14px 22px rgba(0, 0, 0, .6)); }
.pz-piece.hinted path, .pz-piece.good path { fill: #5fe0a0; stroke: #0d4a2f; }
.pz-piece.bad path { fill: #ff7a9c; stroke: #5a0f25; }
.pz-name { position: absolute; left: 0; top: 0; z-index: 3; pointer-events: none; font: 700 .8rem var(--fd); color: var(--ink); white-space: nowrap;
  padding: .1rem .5rem; border-radius: 8px; background: rgba(10, 12, 40, .75); }
.pz-name.placed { font-size: .7rem; background: rgba(10, 12, 40, .6); }
.pz-name.dragging { opacity: .9; }
.pz-name.good { color: #8ff0bf; }
.pz-name.bad { color: #ffb3c5; }
.pz-stage.anim .pz-piece:not(.dragging), .pz-stage.anim .pz-name:not(.dragging) { transition: transform .45s cubic-bezier(.2, .9, .25, 1.1); }
.revealed .pz-piece path { cursor: default; }
.cab-puzzle { display: grid; place-items: center; background: #0f2149; }
.cab-puzzle svg { width: 100%; height: 100%; }
.cab-puzzle .pz-on { fill: var(--m-puzzle); }

@media (min-width: 901px) {
  body.with-drawer .echelle, body.with-drawer .puzzle { margin-right: calc(var(--drawer) + 1rem); }
}
@media (max-width: 900px) {
  .ec-stage { min-height: 0; flex: none; height: 56vh; }
  .ec-tools .tl-type { display: none; }
  .pz-stage { min-height: 0; flex: none; height: 68vh; }
}
