/* Escape Maths (solo) — style « bande dessinée » : contours encre, ombres franches, couleurs vives.
   Les scènes illustrées (art.js) sont le point fort ; le reste de l'interface reste sobre et lisible. */
/* Polices hébergées sur le site (aucun appel à Google : rien n'est transmis à un tiers). */
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/baloo-2-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/baloo-2-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Baloo 2"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/baloo-2-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/nunito-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 800; font-display: swap; src: url("fonts/nunito-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito"; font-style: normal; font-weight: 900; font-display: swap; src: url("fonts/nunito-latin-900-normal.woff2") format("woff2"); }

:root {
  --sky: #e6f0ff;      /* fond de page */
  --paper: #fffdf7;    /* cartes */
  --ink: #1e1b4b;      /* contours et texte */
  --sun: #ffc93c;      /* action principale */
  --coral: #ff6b6b;    /* vies, erreurs */
  --mint: #2bc4a4;     /* réussite */
  --grape: #7c5cff;    /* indices, notions */
  --blue: #4d96ff;
  --soft: #5b5a86;     /* texte secondaire */
  --line: 3px solid var(--ink);
  --title: "Baloo 2", ui-rounded, "Arial Rounded MT Bold", system-ui, sans-serif;
  --body: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background-color: var(--sky);
  background-image: radial-gradient(rgba(30,27,75,.09) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
  color: var(--ink);
  font: 600 17px/1.5 var(--body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); font-weight: 800; }
.wrap { max-width: 720px; margin: 0 auto; padding: 18px 16px 64px; }
h1, h2, h3 { font-family: var(--title); line-height: 1.1; margin: 0 0 .4em; }
h1 { font-size: clamp(2.6rem, 11vw, 4.2rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.7rem; font-weight: 800; }
h3 { font-size: 1.2rem; font-weight: 700; }
p { margin: 0 0 .8em; }
strong { font-weight: 900; }
.muted { color: var(--soft); }
.small { font-size: .92rem; }
:focus-visible { outline: 3px dashed var(--grape); outline-offset: 3px; }

/* ---------- Cartes ---------- */
.card {
  background: var(--paper);
  border: var(--line);
  border-radius: 22px;
  padding: 20px;
  margin-bottom: 18px;
  box-shadow: 6px 6px 0 var(--ink);
}
.card.flat { box-shadow: none; background: rgba(255,253,247,.75); }

/* Panneau illustré (le « dessin » de chaque étape) */
.art {
  margin: -6px -6px 16px;
  border: var(--line);
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #2b2d6e;
}
.art svg { display: block; width: 100%; height: 100%; }

/* ---------- Boutons & champs ---------- */
.btn {
  appearance: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: .45em;
  font: 800 1.1rem var(--title);
  padding: 10px 22px; min-height: 54px;
  border: var(--line); border-radius: 14px;
  background: var(--sun); color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
  text-decoration: none;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: 2px 2px 0 var(--ink); }
.btn.ghost { background: var(--paper); }
.btn.mint { background: var(--mint); }
.btn.block { width: 100%; }
input[type=text] {
  width: 100%; min-height: 54px;
  font: 800 1.15rem var(--body);
  padding: 10px 14px;
  border: var(--line); border-radius: 14px;
  background: #fff; color: var(--ink);
  outline: none;
}
input[type=text]::placeholder { color: #a3a2c4; font-weight: 700; }
input[type=text]:focus { box-shadow: 0 0 0 4px rgba(124,92,255,.3); }
label { display: block; font-weight: 800; margin: 0 0 6px; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: stretch; }
.row > * { flex: 1; }
.error { color: #d93636; font-weight: 800; min-height: 1.4em; margin: 8px 0 0; }

.pill {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .85rem; font-weight: 800;
  padding: 3px 11px; border-radius: 999px;
  border: 2px solid var(--ink); background: #fff;
}
.pill.grape { background: #e6dfff; }
.pill.sun { background: #fff0c2; }
.pill.mint { background: #d3f5ec; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- Accueil ---------- */
.hero { text-align: center; padding: 8px 0 6px; }
.hero h1 { margin: 6px 0 4px; }
.hero h1 span { display: inline-block; }
.hero h1 span:nth-child(2) { color: var(--coral); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.hero p { font-size: 1.12rem; max-width: 30em; margin: 0 auto 18px; color: var(--soft); }
.hero .art { margin: 0 0 18px; box-shadow: 6px 6px 0 var(--ink); border-radius: 22px; }
.code-input { text-transform: uppercase; letter-spacing: .3em; text-align: center; }
.levels { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0 16px; }
.level-chip {
  border: var(--line); border-radius: 12px; background: #fff; color: var(--ink);
  font: 800 1rem var(--title); min-height: 46px; padding: 4px 2px; cursor: pointer;
}
.level-chip.active { background: var(--ink); color: #fff; }
.level-chip.empty:not(.active) { color: #6e6d96; border-color: #b7b6d8; }
.scenario { border: var(--line); border-radius: 18px; padding: 16px; background: #fff; }
.scenario .art { margin: 0 0 14px; border-radius: 12px; }
.scenario h3 { font-size: 1.5rem; font-weight: 800; margin-bottom: 6px; }
.scenario .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.scenario .tags { margin: 10px 0 14px; }
.soon { text-align: center; padding: 30px 12px; border: 3px dashed #b7b6d8; border-radius: 18px; color: var(--soft); }
.soon b { display: block; font: 800 2.2rem var(--title); color: #b7b6d8; }

/* ---------- Étapes ---------- */
.scene.enter { animation: panel-in .55s cubic-bezier(.2,1.3,.4,1); }
.scene .kicker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.scene .text p:last-child { margin-bottom: 0; }
.riddle {
  position: relative; margin: 20px 4px 18px; padding: 20px 18px 16px;
  background: #fff3b8; border: var(--line); border-radius: 6px 6px 18px 6px;
  font-size: 1.12rem; transform: rotate(-.6deg);
  box-shadow: 4px 4px 0 var(--ink);
}
.riddle::before {
  content: ""; position: absolute; top: -12px; left: 50%; width: 76px; height: 20px; margin-left: -38px;
  background: rgba(124,92,255,.45); border: 2px solid var(--ink); transform: rotate(-3deg); border-radius: 3px;
}
.riddle p:last-child, .hint-box p:last-child { margin-bottom: 0; }
.answer-row { display: flex; gap: 8px; align-items: center; }
.answer-row input { flex: 1; min-width: 0; font-size: 1.35rem; text-align: center; }
.answer-row .unit { font: 800 1.1rem var(--title); color: var(--soft); }
.answer-row .btn { flex: none; }
.choices-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.choices-grid .btn { font-size: 2.3rem; min-height: 84px; padding: 0; background: #fff; }
.choices-grid .btn:nth-child(1) { background: #ffe0e0; }
.choices-grid .btn:nth-child(2) { background: #dcecff; }
.choices-grid .btn:nth-child(3) { background: #d3f5ec; }
.choices-grid .btn:nth-child(4) { background: #e6dfff; }
.hint-box { margin-top: 14px; padding: 12px 14px; border: 2.5px dashed var(--grape); border-radius: 14px; background: #f1edff; }
.hint-btn { margin-top: 14px; min-height: 46px; font-size: 1rem; }
.solved-box { padding: 14px 16px; border: var(--line); border-radius: 14px; background: #d3f5ec; font-weight: 800; }
.solved-box span { font-weight: 600; }
.progress { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.progress .pill { padding-left: 3px; }
.progress .pill.done { background: #d3f5ec; }
.team-note { margin: 14px 0 0; }

.vote-head { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 10px; font-weight: 800; }
.vote-head .clock { font-size: 1.1rem; }
.choice {
  width: 100%; text-align: left; cursor: pointer;
  display: block; position: relative; overflow: hidden;
  margin-bottom: 12px; padding: 14px 16px 12px;
  border: var(--line); border-radius: 16px;
  background: #fff; color: var(--ink);
  font: 800 1.1rem/1.3 var(--body);
  box-shadow: 4px 4px 0 var(--ink);
  transition: transform .08s, box-shadow .08s;
}
.choice:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--ink); }
.choice.mine { background: #fff0c2; }
.choice .bar { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(255,201,60,.45); transition: width .5s cubic-bezier(.3,1.4,.5,1); }
.choice .label, .choice .voters { position: relative; }
.choice .voters { display: flex; align-items: center; gap: 8px; margin-top: 8px; min-height: 26px; font-size: .9rem; color: var(--soft); }

.log ul { list-style: none; padding: 0; margin: 0; }
.log li { padding: 7px 0; border-bottom: 2px dotted #c9c8e3; font-size: .95rem; color: var(--soft); }
.log li:first-child { color: var(--ink); font-weight: 800; }
.log li:last-child { border-bottom: 0; }

/* ---------- Fin ---------- */
.ending { text-align: center; }
.ending.good { background: #f2fff9; }
.ending.bad { background: #fff4f4; }
.ending .text { text-align: left; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 18px 0; }
.stats div { border: var(--line); border-radius: 14px; padding: 10px 4px 8px; background: #fff; }
.stats div:nth-child(1) { background: #dcecff; }
.stats div:nth-child(2) { background: #ffe0e0; }
.stats div:nth-child(3) { background: #fff0c2; }
.stats div:nth-child(4) { background: #e6dfff; }
.stats b { display: block; font: 800 1.6rem var(--title); line-height: 1.1; }
.stats span { font-size: .82rem; color: var(--soft); }

/* ---------- Retours visuels ---------- */
.toast {
  position: fixed; left: 50%; bottom: 22px; z-index: 50;
  transform: translateX(-50%) translateY(30px) scale(.9);
  background: #c43c3c; color: #fff; font: 800 1.1rem var(--title);
  border: var(--line); border-radius: 14px; box-shadow: 4px 4px 0 var(--ink);
  padding: 10px 20px 8px; opacity: 0; pointer-events: none;
  transition: transform .3s cubic-bezier(.3,1.6,.5,1), opacity .2s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
.toast.good { background: var(--mint); color: var(--ink); }
.shake { animation: shake .45s; }
.confetti { position: fixed; top: -20px; z-index: 60; width: 10px; height: 14px; border: 2px solid var(--ink); border-radius: 2px; pointer-events: none; animation: fall linear forwards; }

@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes panel-in { 0% { transform: translateY(30px) rotate(1.5deg) scale(.96); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes shake { 20%, 60% { transform: translateX(-9px); } 40%, 80% { transform: translateX(9px); } }
@keyframes heartbreak { 0% { transform: scale(1); filter: none; opacity: 1; } 30% { transform: scale(1.6) rotate(-12deg); } 100% { transform: scale(1) translateY(4px); filter: grayscale(1); opacity: .25; } }
@keyframes tick { 50% { transform: scale(1.06); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* ---------- Animations des illustrations ---------- */
.art svg * { transform-box: view-box; }
.a-twinkle { animation: twinkle 2.4s ease-in-out infinite; }
.a-sweep { animation: sweep 4.5s ease-in-out infinite alternate; }
.a-float { animation: float 3s ease-in-out infinite; }
.a-flicker { animation: flicker .35s ease-in-out infinite alternate; }
.a-blink { animation: blink 4s infinite; }
.a-blink-fast { animation: blinkfast 1s steps(2) infinite; }
.a-press { animation: press 1.6s infinite; }
.a-wiggle { animation: wiggle 2.6s ease-in-out infinite; }
.a-spin-slow { animation: spin 18s linear infinite; }
.a-spin-rev { animation: spin 14s linear infinite reverse; }
.a-spin-hour { animation: spin 48s linear infinite; }
.a-spin-min { animation: spin 4s linear infinite; }
.a-glow { animation: glow 2.2s ease-in-out infinite; }
.a-tilt { animation: tilt 3.2s ease-in-out infinite; }
.a-tile { animation: tile 2.25s ease-in-out infinite; }
.a-bounce { animation: bounce 1.2s ease-in-out infinite; }
.a-slump { animation: slump 3s ease-in-out infinite; }
.a-laser { animation: laser 1.4s ease-in-out infinite; }
.a-look { animation: look 4s ease-in-out infinite; }
.a-shake { animation: lockshake 2.5s ease-in-out infinite; }
.a-hop { animation: hop .9s ease-in-out infinite; }
.a-police-a { animation: blinkfast .8s steps(2) infinite; }
.a-police-b { animation: blinkfast .8s steps(2) infinite reverse; }
.a-drop { animation: drop .7s cubic-bezier(.5,0,.6,1.4) both; }
.a-rise { animation: rise 3s ease-out both; }
@keyframes twinkle { 50% { opacity: .2; } }
@keyframes sweep { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }
@keyframes float { 50% { transform: translateY(-7px); } }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(.88, 1.12); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes blinkfast { 50% { opacity: .15; } }
@keyframes press { 0%, 70%, 100% { transform: scale(1); } 80% { transform: scale(.7); } }
@keyframes wiggle { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes glow { 50% { transform: scale(1.25); opacity: .1; } }
@keyframes tilt { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(6deg); } }
@keyframes tile { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes bounce { 50% { transform: translateY(-10px); } }
@keyframes slump { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(-7deg) translateY(2px); } }
@keyframes laser { 50% { transform: translateY(-26px); } }
@keyframes look { 0%, 100% { transform: translateX(0); } 30% { transform: translateX(-18px); } 65% { transform: translateX(18px); } }
@keyframes lockshake { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-10deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
@keyframes hop { 50% { transform: translateY(-8px); } }
@keyframes drop { from { transform: translateY(-110px); } }
@keyframes rise { from { transform: translateY(60px); } }

@media (max-width: 520px) {
  body { font-size: 16px; }
  .card { padding: 16px; box-shadow: 5px 5px 0 var(--ink); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .choices-grid .btn { min-height: 70px; font-size: 2rem; }
  .levels { grid-template-columns: repeat(4, 1fr); }
  .answer-row .btn { padding: 10px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
  .confetti { display: none; }
}
.hud:empty { display: none; }
.row input { min-width: 0; }

.create-form .row { flex-direction: column; }
.create-form .btn { width: 100%; }

/* ---------- Pied de page ---------- */
.site-footer { display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: center; padding: 0 16px 28px; font-size: .9rem; color: var(--soft); }
.site-footer a { color: var(--soft); }

/* ---------- Jeu solo : barre du haut ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: var(--paper); border-bottom: var(--line); }
.topbar-title { flex: 1; min-width: 0; font: 800 1.15rem var(--title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; gap: 6px; }
.icon-btn { width: 44px; height: 44px; border: var(--line); border-radius: 12px; background: #fff; font-size: 1.3rem; line-height: 1;
  cursor: pointer; box-shadow: 3px 3px 0 var(--ink); color: var(--ink); flex: none; }
.icon-btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn.small { min-height: 44px; padding: 6px 12px; font-size: .95rem; box-shadow: 3px 3px 0 var(--ink); }

.play { max-width: 980px; margin: 0 auto; padding: 14px 12px 40px; display: grid; gap: 16px; }
@media (min-width: 900px) { .play { grid-template-columns: 1fr 230px; align-items: start; } }

/* ---------- Scène point-and-click ---------- */
.scene-card { padding: 12px; margin: 0; }
.scene { border: var(--line); border-radius: 16px; overflow: hidden; background: #2b2d6e; aspect-ratio: 8 / 5; position: relative; }
.scene svg { display: block; width: 100%; height: 100%; }
.scene.enter { animation: scene-in .45s ease-out; }
@keyframes scene-in { from { opacity: 0; transform: scale(1.03); } to { opacity: 1; transform: none; } }
.scene .hs { cursor: pointer; outline: none; }
.scene .hs > *:not(title) { transition: filter .15s; }
.scene .hs:hover > *:not(title), .scene .hs:focus-visible > *:not(title) { filter: drop-shadow(0 0 4px #fff) drop-shadow(0 0 8px var(--sun)); }
.scene .hs .hs-ring { fill: none; stroke: var(--sun); stroke-width: 3; stroke-dasharray: 6 5; opacity: 0; }
.scene.reveal .hs .hs-ring { opacity: 1; animation: ring 1.4s ease-in-out infinite; }
.scene .hs:focus-visible .hs-ring { opacity: 1; }
@keyframes ring { 50% { stroke-width: 5; } }
.narration { margin: 12px 2px 4px; padding: 12px 14px; background: #fff; border: var(--line); border-radius: 14px; min-height: 3.2em; }
.narration p:last-child { margin-bottom: 0; }
.narration.flash { animation: flash .35s ease-out; }
@keyframes flash { from { background: #fff3b8; } to { background: #fff; } }
.scene-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.btn.pulse { animation: pulse-btn .9s ease-out 2; }
@keyframes pulse-btn { 50% { background: var(--sun); transform: scale(1.06); } }

/* ---------- Inventaire ---------- */
.inventory { margin: 0; }
.inventory h3 { margin-bottom: 8px; }
.inv-items { display: flex; flex-wrap: wrap; gap: 8px; }
.inv-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border: var(--line); border-radius: 14px; background: #fff;
  font: 800 .92rem var(--body); color: var(--ink); cursor: pointer; box-shadow: 3px 3px 0 var(--ink); }
.inv-item.pop { animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.inv-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #fff3b8; border: 2px solid var(--ink); font-size: 1.2rem; }
@media (min-width: 900px) { .inv-items { flex-direction: column; align-items: stretch; } }

/* ---------- Fenêtres ---------- */
.modal-back { position: fixed; inset: 0; z-index: 40; background: rgba(30,27,75,.55); display: flex; align-items: flex-start; justify-content: center;
  padding: 16px 10px; overflow-y: auto; animation: fade .2s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; margin: auto 0; animation: panel-in .35s cubic-bezier(.2,1.3,.4,1); }
.modal.wide { max-width: 760px; }
.modal-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.modal-titles { flex: 1; min-width: 0; }
.modal-titles .tags { margin-bottom: 6px; }
.modal-x { width: 40px; height: 40px; flex: none; border: var(--line); border-radius: 12px; background: #fff; font: 900 1.1rem var(--body); cursor: pointer; color: var(--ink); }
.modal.shake { animation: shake .45s; }
body.has-modal { overflow: hidden; }
.puzzle-intro { margin-bottom: 4px; }
.puzzle .riddle { margin-top: 18px; }
.puzzle-foot { margin-top: 14px; }
.solved-banner { margin-top: 14px; padding: 12px 14px; border: var(--line); border-radius: 14px; background: #d3f5ec; font-weight: 800; animation: pop .4s; }
.solved-banner p { margin: 0; }
.choice-box .art { margin: 0 0 12px; }
.choice-opts { display: grid; gap: 10px; margin-top: 14px; }
.map-svg { width: 100%; height: auto; display: block; background: #fff8e1; border: var(--line); border-radius: 14px;
  background-image: radial-gradient(rgba(30,27,75,.08) 1.5px, transparent 1.6px); background-size: 18px 18px; }
.map-link { stroke: var(--ink); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 2 12; }
.map-node rect { fill: #fff; stroke: var(--ink); stroke-width: 3; }
.map-node.seen rect { fill: #dcecff; cursor: pointer; }
.map-node.here rect { fill: var(--sun); }
.map-node.locked rect { fill: #e8e6f5; stroke-dasharray: 6 5; }
.map-node:focus-visible rect { stroke: var(--grape); stroke-width: 5; }
.map-label { font: 800 15px var(--title); text-anchor: middle; fill: var(--ink); pointer-events: none; }
.map-here { font: 700 11px var(--body); text-anchor: middle; fill: var(--ink); pointer-events: none; }
.notes-list { padding-left: 1.2em; margin: 0 0 12px; }
.notes-list li { margin-bottom: 8px; }
.notes-list li p { margin: 0; }
.notes-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }

/* ---------- Fin ---------- */
.center { text-align: center; justify-content: center; }
.ending .art { margin: -6px -6px 16px; }
.stars { font-size: 2.6rem; letter-spacing: 4px; margin: 6px 0; }
.stars span { color: #d6d3ea; -webkit-text-stroke: 2px var(--ink); }
.stars span.on { color: var(--sun); }
.endings-list { list-style: none; padding: 0; margin: 0 0 16px; text-align: left; display: grid; gap: 6px; }
.endings-list li { padding: 8px 12px; border: 2px dashed #b7b6d8; border-radius: 12px; color: var(--soft); }
.endings-list li.got { border: 2.5px solid var(--ink); background: #fff; color: var(--ink); font-weight: 800; }
.end-actions { display: grid; gap: 10px; }
.scenario-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.scenario-actions .btn { flex: 1 1 200px; }
.diploma-form input { margin: 6px 0 12px; }
.diploma { display: none; }

@media print {
  body { background: #fff !important; }
  body > *:not(.diploma) { display: none !important; }
  .diploma { display: block !important; }
  .dip { border: 6px double #1e1b4b; border-radius: 20px; padding: 40px; text-align: center; margin: 20px; font-family: var(--body); color: #1e1b4b; }
  .dip h1 { font-size: 2.6rem; margin: 10px 0; }
  .dip-top, .dip-foot { font-weight: 800; letter-spacing: .05em; }
  .dip-name { font: 800 2.2rem var(--title); border-bottom: 2px solid #1e1b4b; display: inline-block; padding: 0 30px; }
  .dip-stars { font-size: 2rem; color: #e0a400; }
}

/* ---------- Bandeau de consentement ---------- */
.consent { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35; max-width: 720px; margin: 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 12px 14px;
  background: var(--paper); border: var(--line); border-radius: 16px; box-shadow: 5px 5px 0 var(--ink); font-size: .92rem; }
.consent p { margin: 0; flex: 1 1 320px; }
.consent-actions { display: flex; gap: 8px; }
.consent-actions .btn { min-width: 110px; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; color: var(--soft); text-decoration: underline; font-weight: 800; cursor: pointer; }

/* Les messages longs s'affichent en largeur (left: 50% réduisait la boîte à la moitié de l'écran). */
.toast { width: max-content; max-width: min(560px, calc(100vw - 32px)); line-height: 1.3; }
