/* L'Île aux Multiplications — style « app premium » : boutons 3D épais, police arrondie, couleurs vives. */
:root {
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Arial Rounded MT Bold", system-ui, sans-serif;
  --ink: #3c3c4a;
  --ink-soft: #6f6f80;
  --muted: #9a9aac;
  --line: #e6e6ef;
  --line-dark: #cfd0dc;
  --bg: #f7f8ff;
  --card: #ffffff;
  --green: #58cc02; --green-d: #46a302; --green-soft: #d7ffb8; --green-ink: #3f8a00;
  --blue: #1cb0f6; --blue-d: #1690ca; --blue-soft: #ddf4ff;
  --purple: #8b5cf6; --purple-d: #6d3fd8; --purple-soft: #efe7ff;
  --orange: #ff9600; --orange-d: #d97f00; --orange-soft: #fff1dc;
  --pink: #ff5d8f; --pink-d: #d93d70;
  --yellow: #ffc800; --yellow-d: #e0a800;
  --gem: #1cb0f6;
  --r: 18px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --c: var(--purple); --soft: var(--purple-soft); --deep: var(--purple-d);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  touch-action: manipulation; overscroll-behavior: none; position: fixed; inset: 0; overflow: hidden;
}
button { font-family: inherit; color: inherit; touch-action: manipulation; cursor: pointer; }
input, textarea, select { font-family: inherit; -webkit-user-select: text; user-select: text; }
h1, h2, h3 { margin: 0; font-weight: 900; letter-spacing: -0.01em; }
p { line-height: 1.45; }
b { font-weight: 900; }

#app { height: 100%; display: flex; flex-direction: column; }
.screen { flex: 1; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; position: relative; }
.fullscreen .screen { padding-top: var(--safe-t); padding-bottom: var(--safe-b); }

/* ---------- Écran de chargement ---------- */
.splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; background: linear-gradient(#7b6cff, #5fb8ff 60%, #9fe3ff); }
.splash img { width: 180px; height: 180px; border-radius: 40px; box-shadow: 0 16px 40px rgba(40,30,120,.35); animation: hop 1.4s ease-in-out infinite; }
.splash-title { color: #fff; font-weight: 900; font-size: 30px; text-shadow: 0 3px 0 rgba(0,0,0,.12); }

/* ---------- Illustrations ---------- */
.i { display: inline-flex; width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: none; }
.i svg, .ico { width: 100%; height: 100%; display: block; }
.toast-icon { width: 30px; height: 30px; display: inline-flex; } .toast-icon svg { width: 100%; height: 100%; }

/* ---------- Utilitaires ---------- */
.row { display: flex; align-items: center; } .gap { gap: 12px; } .center { justify-content: center; text-align: center; } .wrap { flex-wrap: wrap; }
.muted { color: var(--ink-soft); } .small { font-size: 14px; }
.hidden { display: none !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chips.center { justify-content: center; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: #fff; border: 2px solid var(--line); border-bottom-width: 4px; font-weight: 800; font-size: 16px; }
.chip.tap:active { transform: translateY(2px); border-bottom-width: 2px; }
.chip.warn { background: var(--orange-soft); border-color: #ffd7a3; color: #9a5a00; }
.bar { height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; position: relative; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--green); position: relative; transition: width .5s cubic-bezier(.2,.9,.3,1.2); }
.bar i::after { content: ''; position: absolute; left: 8px; right: 8px; top: 3px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.4); }
.bar.xp i { background: linear-gradient(90deg, var(--yellow), var(--orange)); }

/* ---------- Boutons 3D ---------- */
.btn {
  --b: #fff; --bd: var(--line-dark); --bt: var(--blue);
  border: 0; border-radius: 16px; padding: 14px 22px; font-size: 17px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase;
  background: var(--b); color: var(--bt); box-shadow: 0 5px 0 var(--bd); transform: translateY(0);
  transition: transform .08s, box-shadow .08s, filter .15s; position: relative; margin-bottom: 5px;
}
.btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 var(--bd); }
.btn:disabled { --b: #e5e5ec; --bd: #cfcfd8; --bt: #a9a9b8; cursor: default; }
.btn.primary { --b: var(--green); --bd: var(--green-d); --bt: #fff; }
.btn.soft { --b: #fff; --bd: var(--line-dark); --bt: var(--blue); border: 2px solid var(--line); padding: 12px 20px; }
.btn.ghost { --b: transparent; --bd: transparent; --bt: var(--ink-soft); box-shadow: none; }
.btn.danger { --b: #ff4b4b; --bd: #d63a3a; --bt: #fff; }
.btn.big { font-size: 19px; padding: 17px 30px; min-width: 240px; }
.btn.primary::before { content: ''; position: absolute; left: 14px; right: 14px; top: 5px; height: 5px; border-radius: 5px; background: rgba(255,255,255,.28); }

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: calc(10px + var(--safe-t)) 18px 10px;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--line); z-index: 5;
}
.tb-spacer { flex: 1; }
.tb-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 14px; font-size: 19px; font-weight: 900; background: transparent; border: 0; }
.tb-chip b { font-size: 19px; }
.tb-ico { width: 28px; height: 28px; display: inline-flex; } .tb-ico svg { width: 100%; height: 100%; }
[data-gems] b { color: var(--blue); }
[data-gems].bump { animation: bump .5s; }
.tb-level { gap: 8px; padding-left: 4px; }
.tb-ring { --p: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--yellow) calc(var(--p) * 360deg), var(--line) 0); }
.tb-ring b { width: 32px; height: 32px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 16px; color: var(--orange-d); }
.tb-label { font-size: 14px; color: var(--ink-soft); font-weight: 800; }
.tb-quests { border: 2px solid var(--line); border-bottom-width: 4px; }
.tb-quests.glow { border-color: var(--yellow); background: #fff8d6; animation: glow 1.6s infinite; }
.tb-parent { width: 40px; height: 40px; border-radius: 12px; border: 0; background: transparent; padding: 7px; opacity: .75; } .tb-parent svg { width: 100%; height: 100%; }

/* ---------- Barre d'onglets ---------- */
.tabbar { display: flex; justify-content: space-around; gap: 6px; padding: 8px 12px calc(8px + var(--safe-b)); background: #fff; border-top: 2px solid var(--line); z-index: 5; }
.tab { flex: 1; max-width: 150px; display: flex; flex-direction: column; align-items: center; gap: 2px; border: 2px solid transparent; background: none; border-radius: 16px; padding: 6px 4px; }
.tab-ico { width: 38px; height: 38px; display: block; filter: saturate(.75); opacity: .85; transition: transform .2s; } .tab-ico svg { width: 100%; height: 100%; }
.tab-ico.cr { width: 40px; height: 40px; display: block; }
.tab-ico.cr svg { width: 100%; height: 100%; }
.tab-label { font-size: 13px; font-weight: 900; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tab.on { border-color: #84d8ff; background: var(--blue-soft); }
.tab.on .tab-ico { filter: none; opacity: 1; transform: scale(1.08); }
.tab.on .tab-label { color: var(--blue); }

/* ---------- Créature ---------- */
.creature { width: 100%; height: 100%; overflow: visible; display: block; }
.cr-wrap { width: 120px; height: 140px; flex: none; }
.cr-body { animation: breathe 3.2s ease-in-out infinite; transform-origin: 100px 206px; }
.cr-eyes { animation: blink 4.5s infinite; transform-origin: 100px 118px; }
.cr-spark { animation: twinkle 2s ease-in-out infinite; transform-origin: center; transform-box: fill-box; }
.cr-spark.s2 { animation-delay: .7s; } .cr-spark.s3 { animation-delay: 1.3s; }
.creature.bounce, .bounce { animation: hop 1s ease-in-out infinite; }

/* ---------- Bulle de dialogue ---------- */
.bubble {
  position: relative; background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px 18px;
  font-size: 19px; font-weight: 800; line-height: 1.35; color: var(--ink); max-width: 420px;
  box-shadow: 0 3px 0 var(--line);
}
.bubble::before { content: ''; position: absolute; left: -11px; top: 26px; width: 18px; height: 18px; background: #fff; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: rotate(45deg); }
.bubble.pop { animation: popIn .35s cubic-bezier(.2,1.4,.4,1); }

/* ---------- Modales ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30, 24, 60, .45); display: grid; place-items: center; z-index: 50; padding: 20px; opacity: 0; transition: opacity .2s; }
.modal-back.in { opacity: 1; } .modal-back.out { opacity: 0; }
.modal { background: #fff; border-radius: 28px; padding: 28px; max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; text-align: center;
  box-shadow: 0 8px 0 rgba(0,0,0,.08), 0 30px 60px rgba(30,24,60,.25); transform: translateY(30px) scale(.94); transition: transform .3s cubic-bezier(.2,1.3,.4,1); }
.modal-back.in .modal { transform: none; }
.modal h2 { font-size: 28px; margin-bottom: 8px; }
.modal .btn { margin-top: 14px; }
.confirm-text { font-size: 22px; font-weight: 800; }
.confirm-text small { font-size: 16px; color: var(--ink-soft); font-weight: 700; }

.toast { position: fixed; left: 50%; top: calc(16px + var(--safe-t)); transform: translate(-50%, -140%); background: #fff; border: 2px solid var(--line); border-bottom-width: 5px;
  border-radius: 18px; padding: 12px 20px; display: flex; gap: 10px; align-items: center; font-weight: 900; font-size: 17px; z-index: 60; transition: transform .4s cubic-bezier(.2,1.3,.4,1); max-width: 90vw; }
.toast.in { transform: translate(-50%, 0); }
.toast-icon { font-size: 26px; }
.float-text { position: fixed; transform: translate(-50%, 0); font-weight: 900; font-size: 26px; pointer-events: none; z-index: 70; animation: floatUp 1.2s ease-out forwards; color: var(--blue); text-shadow: 0 2px 0 #fff, 0 0 12px #fff; white-space: nowrap; }
.float-text.fact { color: var(--purple-d); font-size: 30px; }
canvas.confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 80; }

/* ---------- Quêtes ---------- */
.quest-list { display: flex; flex-direction: column; gap: 12px; margin: 18px 0; text-align: left; }
.quest { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 18px; }
.quest.done { background: var(--green-soft); border-color: #a5ed6e; }
.quest-ico { width: 40px; height: 40px; flex: none; } .quest-ico svg { width: 100%; height: 100%; }
.quest-main { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.quest-label { font-weight: 900; font-size: 17px; }
.quest-count { font-weight: 900; color: var(--ink-soft); }
.quest .bar i { background: var(--yellow); } .quest.done .bar i { background: var(--green); }
.chest-zone { padding: 10px; border-radius: 22px; }
.chest-zone.ready { background: radial-gradient(circle, #fff6c9, transparent 70%); }
.chest { width: 96px; height: 96px; margin: 0 auto; } .chest svg { width: 100%; height: 100%; }
.chest-zone.ready .chest { animation: wiggle 1.2s ease-in-out infinite; }

/* ---------- Célébrations ---------- */
.celebrate { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.celebrate h2 { font-size: 34px; color: var(--orange-d); }
.celebrate p { font-size: 19px; font-weight: 700; margin: 4px 0; }
.cel-icon { width: 130px; height: 130px; animation: popIn .6s cubic-bezier(.2,1.5,.4,1); } .cel-icon svg { width: 100%; height: 100%; }
.cel-creature { width: 200px; height: 230px; animation: hop 1s ease-in-out infinite; }
.friend-reveal { display: flex; flex-direction: column; align-items: center; margin-top: 8px; background: var(--purple-soft); border-radius: 22px; padding: 14px 30px; }
.friend-svg { width: 130px; height: 150px; animation: popIn .7s .3s both cubic-bezier(.2,1.5,.4,1); }
.friend-name { font-weight: 900; font-size: 22px; color: var(--purple-d); }

/* ---------- Résultats ---------- */
.results { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 20px; gap: 10px;
  background: radial-gradient(circle at 50% 20%, #fffbe0, var(--bg) 60%); }
.res-creature { width: 200px; height: 230px; }
.results h1 { font-size: 40px; color: var(--orange-d); }
.res-sub { font-size: 20px; font-weight: 800; color: var(--ink-soft); margin: 0 0 10px; max-width: 520px; }
.res-stats { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; margin-bottom: 12px; }
.res-stat { min-width: 140px; border: 2px solid var(--green); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; background: #fff; animation: popIn .5s both cubic-bezier(.2,1.4,.4,1); }
.res-stat b { font-size: 30px; padding: 12px 10px 6px; color: var(--green-d); }
.res-stat span { background: var(--green); color: #fff; font-weight: 900; font-size: 13px; text-transform: uppercase; padding: 6px; letter-spacing: .05em; }
.res-stat.gem { border-color: var(--blue); animation-delay: .1s; } .res-stat.gem b { color: var(--blue-d); } .res-stat.gem span { background: var(--blue); }
.res-stat.xp { border-color: var(--yellow); animation-delay: .2s; } .res-stat.xp b { color: var(--orange-d); } .res-stat.xp span { background: var(--yellow); }
.res-stat.courage { border-color: var(--pink); animation-delay: .3s; } .res-stat.courage b { color: var(--pink-d); } .res-stat.courage span { background: var(--pink); }
.res-learned { background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 16px 20px; max-width: 640px; }
.res-learned h3 { margin-bottom: 10px; font-size: 19px; }
.res-quests { display: flex; flex-direction: column; gap: 8px; }
.quest-chip { background: #fff8d6; border-color: var(--yellow); }

/* ---------- Porte parent ---------- */
.gate-btn { position: relative; width: 170px; height: 170px; border-radius: 50%; border: 0; background: #fff; margin: 16px auto 4px; display: grid; place-items: center; font-weight: 900; color: var(--ink-soft); }
.gate-ring { --p: 0; position: absolute; inset: 0; border-radius: 50%; background: conic-gradient(var(--blue) calc(var(--p) * 360deg), var(--line) 0);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%); mask: radial-gradient(circle, transparent 62%, #000 63%); }

/* ---------- Accueil / création du compagnon ---------- */
.onb { min-height: 100%; display: grid; place-items: center; padding: 30px 20px;
  background: radial-gradient(circle at 20% 10%, #ffe1f0 0, transparent 40%), radial-gradient(circle at 85% 20%, #dff3ff 0, transparent 45%), radial-gradient(circle at 50% 100%, #e8ffd9 0, transparent 50%), #fdfcff; }
.onb-step { display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; max-width: 760px; width: 100%; animation: slideUp .45s cubic-bezier(.2,1.2,.4,1); }
.onb-step h2 { font-size: 34px; }
.onb-islands { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.onb-islands span { width: 52px; height: 52px; } .onb-islands svg { width: 100%; height: 100%; }
.onb-islands span { animation: floaty 3s ease-in-out infinite; display: inline-block; }
.onb-title { font-size: clamp(34px, 6.4vw, 64px); text-align: center; line-height: 1.05; font-weight: 900; background: linear-gradient(90deg, #ff5d8f, #ff9600, #ffc800, #58cc02, #1cb0f6, #8b5cf6); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 4px 0 rgba(0,0,0,.08)); }
.onb-lead { font-size: 20px; font-weight: 700; color: var(--ink-soft); max-width: 560px; margin: 0; }
.onb-q { font-size: 24px; font-weight: 900; margin-top: 10px; }
.onb-input { font-size: 28px; font-weight: 900; text-align: center; padding: 16px 22px; border-radius: 20px; border: 3px solid var(--line); border-bottom-width: 6px; width: min(420px, 100%); outline: none; color: var(--ink); background: #fff; }
.onb-input:focus { border-color: var(--blue); }
.onb-species { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; width: 100%; }
.onb-sp { background: #fff; border: 3px solid var(--line); border-bottom-width: 7px; border-radius: 26px; padding: 14px 10px 12px; display: flex; flex-direction: column; align-items: center; font-weight: 900; font-size: 20px; transition: transform .15s; }
.onb-sp:active { transform: translateY(4px); border-bottom-width: 3px; }
.onb-sp-svg { width: 130px; height: 150px; }
.onb-preview { width: 240px; height: 270px; animation: hop 1.4s ease-in-out infinite; }
.onb-preview.small { width: 150px; height: 170px; }
.swatches { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.swatch { width: 54px; height: 54px; border-radius: 50%; border: 4px solid #fff; box-shadow: 0 0 0 3px var(--line), 0 4px 0 3px var(--line); }
.swatch.on { box-shadow: 0 0 0 4px var(--blue), 0 4px 0 4px var(--blue-d); transform: scale(1.1); }
.egg-stage { height: 280px; display: grid; place-items: center; }
.egg { --c: #ff8fb1; width: 180px; height: 230px; border: 0; border-radius: 50% 50% 46% 46% / 58% 58% 42% 42%;
  background: radial-gradient(circle at 35% 30%, #fff, #fff6ea 40%, #ffe7c9); box-shadow: inset -14px -18px 0 rgba(0,0,0,.06), 0 10px 0 rgba(0,0,0,.08); position: relative; overflow: hidden; }
.egg-spots { position: absolute; inset: 0; background: radial-gradient(circle at 30% 60%, var(--c) 0 14px, transparent 15px), radial-gradient(circle at 70% 40%, var(--c) 0 18px, transparent 19px), radial-gradient(circle at 55% 78%, var(--c) 0 10px, transparent 11px), radial-gradient(circle at 40% 25%, var(--c) 0 9px, transparent 10px); opacity: .75; }
.egg.wobble { animation: eggWobble .5s; }
.egg.crack1::after, .egg.crack2::after, .egg.crack3::after { content: ''; position: absolute; left: 20%; right: 20%; top: 45%; height: 22px;
  background: linear-gradient(135deg, transparent 45%, #8a6a4a 46% 54%, transparent 55%) 0 0/22px 22px repeat-x; opacity: .8; }
.egg.crack2::after { left: 8%; right: 8%; } .egg.crack3::after { left: 0; right: 0; height: 30px; background-size: 30px 30px; }
.hatched { width: 240px; height: 270px; animation: hop 1.2s ease-in-out infinite; }
.pop-in { animation: popIn .6s cubic-bezier(.2,1.5,.4,1) both; }

/* ---------- Carte ---------- */
.map { padding: 18px 16px 60px; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.review-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 22px; border: 0; text-align: left; color: #fff;
  background: linear-gradient(120deg, #8b5cf6, #1cb0f6); box-shadow: 0 6px 0 #5b3fc0; animation: glow 2.4s infinite; }
.review-card:active { transform: translateY(5px); box-shadow: 0 1px 0 #5b3fc0; }
.rc-ico { width: 46px; height: 46px; flex: none; background: rgba(255,255,255,.9); border-radius: 14px; padding: 5px; } .rc-ico svg { width: 100%; height: 100%; } .rc-main { flex: 1; display: flex; flex-direction: column; font-size: 16px; font-weight: 700; } .rc-main b { font-size: 21px; }
.rc-badge { background: rgba(255,255,255,.25); padding: 8px 12px; border-radius: 12px; font-weight: 900; }
.install-tip { display: flex; gap: 10px; align-items: center; background: #fff; border: 2px dashed var(--line-dark); border-radius: 16px; padding: 12px 14px; font-weight: 700; color: var(--ink-soft); }
.install-tip .x { margin-left: auto; border: 0; background: var(--line); border-radius: 50%; width: 32px; height: 32px; flex: none; }

.island { --c: var(--purple); border-radius: 30px; padding: 0 0 26px; position: relative; overflow: hidden;
  background: radial-gradient(circle at 15% 30%, rgba(255,255,255,.7) 0 2px, transparent 3px) 0 0/34px 34px, linear-gradient(180deg, var(--soft), #fff 85%); border: 2px solid color-mix(in srgb, var(--c) 18%, transparent); }
.isl-head { display: flex; align-items: center; gap: 14px; padding: 18px 20px 20px; background: var(--c); color: #fff; border-radius: 28px 28px 22px 22px; box-shadow: 0 6px 0 var(--deep); margin-bottom: 26px; position: relative; overflow: hidden; }
.isl-head::after { content: ''; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.14); }
.isl-emoji { width: 74px; height: 74px; display: grid; place-items: center; background: rgba(255,255,255,.9); border-radius: 22px; flex: none; padding: 9px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.06); } .isl-emoji svg { width: 100%; height: 100%; }
.isl-txt { flex: 1; min-width: 0; }
.isl-num { font-size: 14px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.isl-txt h2 { font-size: 26px; line-height: 1.1; }
.isl-txt p { margin: 4px 0 0; font-weight: 700; opacity: .92; font-size: 16px; }
.isl-prog { display: flex; flex-direction: column; align-items: center; gap: 6px; z-index: 1; }
.isl-prog-ring { --p: 0; width: 60px; height: 60px; border-radius: 50%; background: conic-gradient(#fff calc(var(--p) * 360deg), rgba(255,255,255,.3) 0); display: grid; place-items: center; }
.isl-prog-ring span svg { width: 30px; height: 30px; } .isl-prog-ring span { width: 48px; height: 48px; border-radius: 50%; background: var(--c); display: grid; place-items: center; font-weight: 900; font-size: 16px; }
.isl-mastery { font-size: 13px; font-weight: 900; background: rgba(255,255,255,.25); padding: 3px 8px; border-radius: 10px; }
.island.locked { filter: grayscale(.85); opacity: .7; }
.island.locked .isl-head { background: #b9b9c6; box-shadow: 0 6px 0 #9a9aa8; }
.isl-lock { text-align: center; font-weight: 800; color: var(--ink-soft); margin-top: 6px; padding: 0 20px; }
.path { display: flex; flex-direction: column; align-items: center; gap: 34px; position: relative; padding-top: 34px; z-index: 1; }
.node-wrap { position: relative; transform: translateX(calc(var(--x) * min(120px, 18vw))); display: flex; flex-direction: column; align-items: center; }
.node { width: 84px; height: 78px; border-radius: 50%; border: 0; background: var(--c); box-shadow: 0 8px 0 var(--deep); position: relative; display: grid; place-items: center; transition: transform .1s, box-shadow .1s; }
.node::before { content: ''; position: absolute; left: 18px; right: 18px; top: 8px; height: 10px; border-radius: 10px; background: rgba(255,255,255,.3); }
.node:active { transform: translateY(8px); box-shadow: 0 0 0 var(--deep); }
.node-ico { width: 44px; height: 44px; filter: drop-shadow(0 2px 0 rgba(0,0,0,.18)); } .node-ico svg { width: 100%; height: 100%; }
.node.locked { background: #e3e3ea; box-shadow: 0 8px 0 #c5c5d0; }
.node.locked .node-ico { width: 34px; height: 34px; opacity: .7; }
.node.done { background: linear-gradient(160deg, #ffd84a, #ffb800); box-shadow: 0 8px 0 #d99a00; }
.node-check { position: absolute; right: -4px; bottom: -6px; width: 30px; height: 30px; border-radius: 50%; background: var(--green); color: #fff; font-weight: 900; display: grid; place-items: center; border: 3px solid #fff; font-size: 16px; }
.node.current { animation: nodePulse 1.8s ease-in-out infinite; }
.node.current::after { content: ''; position: absolute; inset: -12px; border-radius: 50%; border: 6px solid color-mix(in srgb, var(--c) 35%, transparent); }
.node-label { margin-top: 12px; font-weight: 900; font-size: 15px; color: var(--deep); background: rgba(255,255,255,.9); padding: 3px 10px; border-radius: 10px; }
.node.locked + .node-label { color: var(--muted); }
.node-buddy { position: absolute; width: 96px; height: 112px; top: -24px; left: calc(100% + 18px); animation: hop 1.6s ease-in-out infinite; pointer-events: none; }
.node-wrap.cur { margin-top: 26px; }
.node-wrap.right .node-buddy { left: auto; right: calc(100% + 18px); }
.node-start { position: absolute; top: -54px; background: #fff; color: var(--c); border: 2px solid var(--line); padding: 7px 14px; border-radius: 14px; font-weight: 900; font-size: 15px; text-transform: uppercase; letter-spacing: .05em; white-space: nowrap; animation: bob 1.4s ease-in-out infinite; box-shadow: 0 3px 0 var(--line); }
.node-start::after { content: ''; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: #fff; border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.animal { position: absolute; width: 86px; height: 100px; animation: floaty 4s ease-in-out infinite; pointer-events: none; z-index: 0; }
.map-end { text-align: center; font-weight: 800; color: var(--ink-soft); padding: 10px 20px; font-size: 17px; }
.node-sheet .ns-ico { width: 110px; height: 110px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--c); box-shadow: 0 7px 0 rgba(0,0,0,.15); padding: 24px; } .node-sheet .ns-ico svg { width: 100%; height: 100%; }
.node-sheet p { font-size: 19px; font-weight: 700; color: var(--ink-soft); }

/* ---------- Séance (leçon) ---------- */
.lesson, .discover, .memory, .bubbles, .correction { height: 100%; display: flex; flex-direction: column; background: linear-gradient(180deg, #fff 0%, var(--soft) 140%); }
.l-top { display: flex; align-items: center; gap: 16px; padding: 14px 22px; }
.l-close { width: 44px; height: 44px; border: 0; background: transparent; font-size: 26px; color: var(--muted); font-weight: 900; border-radius: 12px; flex: none; }
.l-progress { flex: 1; height: 20px; border-radius: 99px; background: var(--line); overflow: hidden; }
.l-progress i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--green); position: relative; transition: width .5s cubic-bezier(.2,1.2,.4,1); }
.l-progress i::after { content: ''; position: absolute; left: 10px; right: 10px; top: 4px; height: 6px; border-radius: 6px; background: rgba(255,255,255,.35); }
.kind-challenge .l-progress i { background: linear-gradient(90deg, var(--yellow), var(--orange)); }
.kind-review .l-progress i { background: linear-gradient(90deg, var(--purple), var(--blue)); }
.l-gems { font-weight: 900; font-size: 20px; padding: 6px 12px; border-radius: 14px; background: var(--blue-soft); flex: none; }
.l-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr minmax(320px, 400px); gap: 24px; padding: 6px 28px 24px; align-items: center; max-width: 1200px; margin: 0 auto; width: 100%; }
.l-left { display: flex; flex-direction: column; gap: 14px; min-height: 0; align-self: stretch; justify-content: center; }
.l-coach { display: flex; align-items: center; gap: 14px; }
.l-coach .cr-wrap { width: 140px; height: 160px; margin: -10px 0 -14px; }
.l-card { position: relative; background: #fff; border: 2px solid var(--line); border-bottom-width: 6px; border-radius: 28px; padding: 26px 22px; display: flex; flex-direction: column; align-items: center; gap: 16px; min-height: 220px; justify-content: center; }
.l-card.enter { animation: slideIn .35s cubic-bezier(.2,1.2,.4,1); }
.l-card.intro { border-color: color-mix(in srgb, var(--c) 45%, white); }
.l-card.repair { border-color: #ffd29a; background: #fffaf2; }
.tag { position: absolute; top: -16px; left: 50%; transform: translateX(-50%); background: var(--orange); color: #fff; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; padding: 6px 14px; border-radius: 12px; white-space: nowrap; }
.tag.new { background: var(--c); }
.q-big { display: flex; align-items: center; gap: 14px; font-size: clamp(54px, 8vw, 84px); font-weight: 900; color: var(--ink); line-height: 1; }
.q-big.small { font-size: 52px; justify-content: center; margin: 10px 0; }
.q-big .op { color: var(--c); font-size: .8em; }
.q-big .slot { min-width: 1.6em; padding: 4px 12px; border-radius: 18px; border: 4px dashed var(--line-dark); text-align: center; color: var(--c); background: #fafaff; }
.q-big .slot.typing:not(.empty) { border-style: solid; border-color: var(--c); }
.q-big .slot.empty::after, .copy-line .slot.empty::after { content: ''; display: inline-block; width: 4px; height: .8em; background: var(--c); border-radius: 2px; animation: caret 1s steps(1) infinite; vertical-align: middle; }
.q-big .answer { color: var(--green-d); background: var(--green-soft); padding: 4px 16px; border-radius: 18px; }
.q-big .slot.filled { border-style: solid; border-color: var(--green); background: var(--green-soft); color: var(--green-d); animation: bump .45s; }
.listen { position: absolute; top: 12px; right: 12px; width: 46px; height: 46px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 4px; background: #fff; padding: 9px; } .listen svg { width: 100%; height: 100%; }
.listen:active { transform: translateY(2px); border-bottom-width: 2px; }
.hint { display: none; font-size: 19px; font-weight: 800; color: #7a5200; background: #fff6d6; border: 2px solid #ffe08a; border-radius: 16px; padding: 10px 16px; text-align: center; max-width: 560px; }
.hint.show { display: block; animation: popIn .35s cubic-bezier(.2,1.4,.4,1); }
.hint-btn { border: 2px solid #ffe08a; border-bottom-width: 4px; background: #fffbea; color: #9a6a00; font-weight: 900; font-size: 16px; padding: 8px 16px; border-radius: 14px; }
.tf-note { font-weight: 800; color: var(--ink-soft); }
.l-input { display: flex; flex-direction: column; gap: 12px; align-self: center; }
.in-label { margin: 0; font-weight: 900; font-size: 18px; color: var(--ink-soft); text-align: center; text-transform: uppercase; letter-spacing: .05em; }
.choices { display: grid; gap: 14px; }
.choice { border: 2px solid var(--line); border-bottom-width: 6px; background: #fff; border-radius: 22px; font-size: 44px; font-weight: 900; padding: 20px 10px; color: var(--ink); transition: transform .08s; }
.choice:active { transform: translateY(4px); border-bottom-width: 2px; }
.choice.good { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); animation: bump .4s; }
.choice.bad { background: var(--orange-soft); border-color: var(--orange); color: #a35a00; animation: shake .4s; }
.choice.dim { opacity: .45; }
.choices.tf .choice { font-size: 28px; }
.choice.yes { color: var(--green-d); } .choice.no { color: #e25d5d; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.key { height: 74px; border-radius: 20px; border: 2px solid var(--line); border-bottom-width: 6px; background: #fff; font-size: 34px; font-weight: 900; color: var(--ink); transition: transform .06s; }
.key:active { transform: translateY(4px); border-bottom-width: 2px; background: #f4f6ff; }
.key.del { color: var(--ink-soft); font-size: 28px; }
.key.ok { background: var(--green); border-color: var(--green-d); color: #fff; font-size: 17px; text-transform: uppercase; letter-spacing: .04em; }
.key.ok:active { background: var(--green-d); }
.copy-line { font-size: 40px; font-weight: 900; text-align: center; display: flex; justify-content: center; align-items: center; gap: 10px; }
.copy-line .slot { min-width: 1.8em; padding: 2px 10px; border-radius: 14px; border: 4px solid var(--orange); background: #fff; color: var(--orange-d); }
.copy-line .slot.red { border-color: #ff6b6b; color: #e53935; }
.l-feedback { position: fixed; left: 0; right: 0; bottom: 0; transform: translateY(110%); transition: transform .3s cubic-bezier(.2,1.2,.4,1); padding: 18px 28px calc(18px + var(--safe-b)); z-index: 10; pointer-events: none; }
.l-feedback.show { transform: none; }
.l-feedback.good { background: var(--green-soft); }
.fb-main { display: flex; align-items: center; gap: 16px; max-width: 1100px; margin: 0 auto; color: var(--green-ink); font-size: 26px; }
.fb-ico { width: 70px; height: 70px; background: #fff; border-radius: 50%; display: grid; place-items: center; padding: 12px; flex: none; animation: popIn .4s cubic-bezier(.2,1.5,.4,1); } .fb-ico svg { width: 100%; height: 100%; }
.fb-main b { display: block; font-size: 28px; }
.fb-fact { font-weight: 800; font-size: 22px; }

/* Rectangles (visuel des multiplications) */
.arr { display: flex; flex-direction: column; gap: 4px; align-items: center; max-width: 100%; }
.arr-row { display: flex; gap: 4px; animation: rowIn .35s both cubic-bezier(.2,1.3,.4,1); }
.arr-cell.gap { margin-right: 8px; }
.arr.emoji .arr-cell { width: min(var(--sz, 26px), 5vw); height: min(var(--sz, 26px), 5vw); display: inline-flex; }
.arr.emoji .arr-cell svg { width: 100%; height: 100%; }
.arr.dots .arr-cell { width: clamp(10px, 1.8vw, 18px); height: clamp(10px, 1.8vw, 18px); border-radius: 50%; background: var(--c); box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.arr.dots .arr-row:nth-child(5n) { margin-bottom: 5px; }

/* ---------- Découverte ---------- */
.d-dots { flex: 1; display: flex; gap: 8px; }
.d-dots i { flex: 1; height: 14px; border-radius: 99px; background: var(--line); transition: background .3s; }
.d-dots i.on { background: var(--c); }
.d-coach { display: flex; align-items: center; gap: 14px; padding: 0 28px; max-width: 1000px; margin: 0 auto; width: 100%; }
.d-coach .cr-wrap { width: 130px; height: 150px; }
.d-coach .bubble { max-width: 700px; }
.d-stage { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 24px; display: flex; justify-content: center; }
.d-slide { width: 100%; max-width: 980px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; }
.d-slide.enter { animation: slideIn .4s cubic-bezier(.2,1.2,.4,1); }
.d-nav { padding: 12px 24px calc(18px + var(--safe-b)); display: flex; justify-content: center; border-top: 2px solid var(--line); background: #fff; }
.d-welcome { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.d-welcome h1 { font-size: 44px; color: var(--deep); }
.d-welcome p { font-size: 22px; font-weight: 800; color: var(--ink-soft); margin: 0; }
.d-big-emoji { width: 150px; height: 150px; animation: floaty 3s ease-in-out infinite; filter: drop-shadow(0 10px 8px rgba(0,0,0,.12)); } .d-big-emoji svg { width: 100%; height: 100%; }
.d-explorer { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.stepper { display: flex; align-items: center; gap: 14px; }
.step-btn { width: 70px; height: 70px; border-radius: 22px; border: 0; background: var(--c); color: #fff; font-size: 40px; font-weight: 900; box-shadow: 0 6px 0 var(--deep); }
.step-btn:active { transform: translateY(6px); box-shadow: none; }
.step-lab { font-weight: 900; font-size: 18px; color: var(--ink-soft); text-transform: uppercase; }
.d-explore { display: flex; flex-direction: column; align-items: center; gap: 10px; background: #fff; border: 2px solid var(--line); border-bottom-width: 6px; border-radius: 26px; padding: 18px 24px; width: 100%; }
.d-eq { font-size: 46px; font-weight: 900; } .d-eq b { color: var(--c); }
.d-sub { font-weight: 800; color: var(--ink-soft); font-size: 18px; }
.d-skip { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.d-skip span { min-width: 54px; padding: 8px 10px; border-radius: 14px; background: var(--line); color: #fff; font-weight: 900; font-size: 20px; text-align: center; transition: all .25s; }
.d-skip span.on { background: var(--c); transform: scale(1.06); }
.d-rule { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.d-rule-txt { font-size: 28px; font-weight: 800; text-align: center; background: #fff; border: 2px solid var(--line); border-bottom-width: 6px; border-radius: 26px; padding: 22px 28px; line-height: 1.4; }
.d-rule-txt b { color: var(--c); }
.d-examples { display: flex; flex-direction: column; gap: 10px; width: 100%; max-width: 640px; }
.d-ex { display: flex; gap: 16px; align-items: center; background: #fff; border: 2px solid var(--line); border-left: 8px solid var(--c); border-radius: 18px; padding: 14px 18px; font-size: 21px; font-weight: 800; }
.d-ex b { color: var(--deep); min-width: 100px; }
.hands { display: flex; gap: 8px; align-items: flex-end; }
.finger { width: 46px; height: 130px; border-radius: 24px 24px 12px 12px; border: 0; background: linear-gradient(180deg, #ffd9b8, #ffc396); box-shadow: inset 0 -6px 0 rgba(0,0,0,.08); font-weight: 900; color: #a0623a; display: flex; align-items: flex-start; justify-content: center; padding-top: 10px; transition: all .25s; }
.finger:nth-child(1), .finger:nth-child(10) { height: 96px; } .finger:nth-child(2), .finger:nth-child(9) { height: 120px; } .finger:nth-child(5), .finger:nth-child(6) { height: 80px; }
.finger.gap { margin-left: 26px; }
.finger.down { height: 40px !important; background: #e8cdb6; opacity: .7; }
.finger.tens { background: linear-gradient(180deg, #c9b6ff, #a98bff); color: #fff; }
.finger.units { background: linear-gradient(180deg, #a6e6ff, #6dd0ff); color: #fff; }
.d-finger-out { font-size: 24px; font-weight: 800; text-align: center; background: #fff; border-radius: 18px; padding: 14px 20px; border: 2px solid var(--line); }
.tens-t { color: #7c5cff; } .units-t { color: #1aa7e6; } .d-finger-out .res { color: var(--green-d); font-size: 1.3em; }
.d-rot { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.d-rotate { padding: 30px; transition: transform .7s cubic-bezier(.3,1.4,.5,1); }
.d-rotate .arr-cell { width: 56px !important; height: 56px !important; }
.d-rotate.turned { transform: rotate(90deg); }
.d-known { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; width: 100%; }
.kt { border-radius: 18px; padding: 14px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 900; border: 2px solid var(--line); border-bottom-width: 5px; background: #fff; animation: popIn .45s both cubic-bezier(.2,1.4,.4,1); }
.kt-q { font-size: 22px; } .kt-a { font-size: 15px; }
.kt.known { background: var(--green-soft); border-color: var(--green); color: var(--green-ink); }
.kt.new { background: #fff; border-style: dashed; color: var(--c); }
.d-hop { display: flex; flex-direction: column; align-items: center; gap: 24px; width: 100%; }
.hop { position: relative; width: 100%; padding: 74px 34px 10px; }
.hop-line { display: flex; justify-content: space-between; position: relative; }
.hop-line::before { content: ''; position: absolute; left: 0; right: 0; top: 9px; height: 6px; border-radius: 3px; background: var(--line); }
.hop-stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 0; }
.hop-stop i { width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--line-dark); z-index: 1; }
.hop-stop.on i { background: var(--c); border-color: var(--deep); }
.hop-stop span { font-weight: 900; font-size: 20px; color: var(--deep); min-height: 26px; }
.hop-token svg { width: 100%; height: 100%; }
.hop-token { position: absolute; top: -62px; left: 0; width: 50px; height: 50px; transform: translateX(-50%); transition: left .45s cubic-bezier(.3,1.2,.5,1); pointer-events: none; z-index: 2; }
.hop-token.jump { animation: jump .45s ease-out; }
.d-squares { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.d-sq-out { display: flex; flex-direction: column; align-items: center; gap: 12px; }

/* ---------- Memory ---------- */
.mem-title { flex: 1; font-weight: 900; font-size: 20px; text-align: center; }
.mem-count .i { width: 24px; height: 24px; }
.mem-count { font-weight: 900; font-size: 18px; padding: 6px 14px; border-radius: 14px; background: var(--blue-soft); color: var(--blue-d); white-space: nowrap; }
.mem-coach { display: flex; align-items: center; gap: 12px; padding: 0 24px; max-width: 900px; margin: 0 auto; width: 100%; }
.mem-coach .cr-wrap { width: 84px; height: 98px; }
.mem-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; padding: 16px 28px 28px; max-width: 900px; width: 100%; margin: 0 auto; align-content: center; }
.mcard { aspect-ratio: 1.15; border: 0; background: none; perspective: 900px; padding: 0; }
.mcard-in { position: relative; width: 100%; height: 100%; transition: transform .45s cubic-bezier(.3,1.3,.5,1); transform-style: preserve-3d; }
.mcard.flipped .mcard-in { transform: rotateY(180deg); }
.mcard-back, .mcard-front { position: absolute; inset: 0; border-radius: 22px; display: grid; place-items: center; backface-visibility: hidden; -webkit-backface-visibility: hidden; font-weight: 900; }
.mcard-back svg { width: 46%; height: 46%; filter: drop-shadow(0 3px 0 rgba(0,0,0,.15)); }
.mcard-back { background: var(--c); box-shadow: 0 7px 0 var(--deep);
  background-image: radial-gradient(circle at 25% 25%, rgba(255,255,255,.25) 0 6px, transparent 7px), radial-gradient(circle at 75% 75%, rgba(255,255,255,.18) 0 10px, transparent 11px); }
.mcard-front { background: #fff; border: 3px solid var(--line); box-shadow: 0 7px 0 var(--line); transform: rotateY(180deg); font-size: clamp(26px, 4vw, 40px); color: var(--ink); }
.mcard-front.r { color: var(--c); }
.mcard.matched .mcard-front { background: var(--green-soft); border-color: var(--green); box-shadow: 0 7px 0 var(--green); color: var(--green-ink); }
.mcard.matched { animation: bump .5s; }

/* ---------- Bulles ---------- */
.bubbles { background: linear-gradient(180deg, #e3f6ff, #bfe6ff 60%, #9fd4ff); }
.bb-field { flex: 1; position: relative; overflow: hidden; }
.bb { position: absolute; left: 0; top: 0; border-radius: 50%; border: 0; font-weight: 900; font-size: 30px; color: #fff; text-shadow: 0 2px 0 rgba(0,0,0,.18);
  background: radial-gradient(circle at 32% 28%, rgba(255,255,255,.95) 0 10%, transparent 11%), radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--b) 55%, transparent), var(--b) 75%);
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.08), 0 8px 20px rgba(0,60,120,.15); will-change: transform; }
.bb.popped { animation: bubblePop .3s forwards; }
.bb.wobble { animation: shake .4s; }

/* ---------- Classe / maîtresse ---------- */
.classroom { padding: 22px 18px 40px; max-width: 900px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.board { background: linear-gradient(160deg, #2f6b4f, #24563f); border: 12px solid #a26b3c; border-radius: 22px; padding: 24px; color: #f4fff6; text-align: center; box-shadow: 0 8px 0 #7e4f28, inset 0 0 40px rgba(0,0,0,.25); }
.board-title { font-size: 32px; font-weight: 900; }
.board-sub { font-size: 19px; font-weight: 700; opacity: .85; margin-top: 6px; }
.board-chalk { margin-top: 16px; font-size: 22px; font-weight: 800; letter-spacing: .03em; opacity: .7; }
.desks { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 16px; }
.desk { background: #fff; border: 2px solid var(--line); border-bottom: 10px solid #d9a46c; border-radius: 20px; padding: 10px; display: flex; flex-direction: column; align-items: center; animation: popIn .5s both cubic-bezier(.2,1.4,.4,1); }
.desk-cr { width: 90px; height: 104px; }
.desk-name { font-weight: 900; }
.class-actions { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; font-weight: 700; }
.correction { background: linear-gradient(180deg, #fff, #fff6e6); }
.corr-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 1fr minmax(300px, 380px); gap: 24px; padding: 4px 26px 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.corr-left { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.corr-left .mem-coach { padding: 0; }
.paper-zone { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 4px 14px; }
.paper { position: relative; background: #fff; border-radius: 10px 10px 22px 22px; padding: 18px 24px 22px 60px; box-shadow: 0 8px 0 #eadfcf, 0 14px 30px rgba(120,80,20,.12);
  background-image: linear-gradient(90deg, transparent 44px, #ffb3b3 44px 46px, transparent 46px), repeating-linear-gradient(180deg, transparent 0 51px, #d9e8ff 51px 53px); }
.paper.enter { animation: slideIn .45s cubic-bezier(.2,1.2,.4,1); }
.paper-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.paper-cr { width: 64px; height: 74px; }
.paper-name { font-weight: 900; font-size: 24px; } .paper-sub { color: var(--ink-soft); font-weight: 700; }
.paper-lines { display: flex; flex-direction: column; }
.pline { display: flex; align-items: center; gap: 12px; min-height: 53px; border-radius: 12px; padding: 0 8px; transition: background .2s; }
.pline.editing { background: #fff1f1; } .pline.flag { background: #ffe9cc; animation: shake .45s; }
.pl-q { font-size: 30px; font-weight: 800; color: #2c3e8f; font-family: "Chalkboard SE", "Comic Sans MS", var(--font); flex: 1; }
.pline.ko .pl-ans { text-decoration: line-through; text-decoration-color: #e53935; text-decoration-thickness: 3px; }
.pl-fix { font-size: 30px; font-weight: 900; color: #e53935; font-family: "Chalkboard SE", var(--font); transform: rotate(-6deg); }
.pl-btns { display: flex; gap: 8px; }
.mk { width: 54px; height: 48px; border-radius: 14px; border: 2px solid var(--line); border-bottom-width: 5px; background: #fff; font-size: 24px; font-weight: 900; }
.mk.ok { color: var(--green-d); } .mk.ko { color: #e53935; }
.mk.ok.on { background: var(--green); border-color: var(--green-d); color: #fff; }
.mk.ko.on { background: #ff6b6b; border-color: #d94a4a; color: #fff; }
.give { margin-top: 18px; width: 100%; }
.corr-side { display: flex; flex-direction: column; gap: 12px; justify-content: center; }
.corr-help { text-align: center; background: #fff; border: 2px dashed var(--line-dark); border-radius: 22px; padding: 22px; font-weight: 800; font-size: 18px; }
.big-ico { width: 72px; height: 72px; margin: 0 auto; } .big-ico svg { width: 100%; height: 100%; }
.stamps { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stamp-btn { border: 2px solid var(--line); border-bottom-width: 6px; background: #fff; border-radius: 20px; padding: 14px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.stamp-ico { width: 52px; height: 52px; } .stamp-ico svg { width: 100%; height: 100%; }
.stamp-btn small { font-size: 15px; font-weight: 900; color: var(--ink-soft); }
.stamp-btn:active { transform: translateY(4px); border-bottom-width: 2px; }
.stamp { position: absolute; right: 26px; top: 20px; transform: rotate(-14deg); border: 5px solid #e53935; color: #e53935; border-radius: 16px; padding: 6px 14px; display: flex; align-items: center; gap: 6px; font-size: 26px; background: rgba(255,255,255,.85); animation: stampIn .4s cubic-bezier(.2,1.4,.4,1); }

/* ---------- Ma table magique ---------- */
.collection { padding: 22px 16px 40px; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.col-head h1 { font-size: 34px; } .col-head p { margin: 6px 0 0; font-weight: 700; color: var(--ink-soft); font-size: 17px; }
.col-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cs { background: #fff; border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 18px; padding: 12px; display: flex; flex-direction: column; align-items: center; }
.cs b { font-size: 28px; } .cs span { font-weight: 800; color: var(--ink-soft); font-size: 14px; }
.cs.lv3 b { color: #e0a800; } .cs.lv2 b { color: var(--green-d); } .cs.lv1 b { color: var(--orange-d); } .cs.big { background: linear-gradient(135deg, #8b5cf6, #1cb0f6); color: #fff; border-color: transparent; } .cs.big span { color: #fff; }
.pyth-wrap { overflow-x: auto; padding-bottom: 6px; }
.pyth { display: grid; grid-template-columns: repeat(11, minmax(38px, 1fr)); gap: 6px; min-width: 460px; }
.py-corner, .py-head { display: grid; place-items: center; font-weight: 900; color: var(--purple-d); font-size: 18px; aspect-ratio: 1; }
.py-corner { background: var(--purple-soft); border-radius: 12px; }
.py-cell { aspect-ratio: 1; border-radius: 12px; border: 0; font-weight: 900; font-size: clamp(14px, 2.2vw, 20px); display: grid; place-items: center; animation: popIn .4s both cubic-bezier(.2,1.4,.4,1); }
.py-cell.lv0 { background: #ececf3; color: #c3c3d2; box-shadow: inset 0 -3px 0 #dcdce6; }
.py-cell.lv1 { background: #ffe9c2; color: #b26a00; box-shadow: inset 0 -4px 0 #ffd28a; }
.py-cell.lv2 { background: #c9f5a8; color: #3f8a00; box-shadow: inset 0 -4px 0 #9fe36b; }
.py-cell.lv3 { background: linear-gradient(145deg, #ffe066, #ffb800); color: #fff; text-shadow: 0 2px 0 rgba(180,110,0,.4); box-shadow: inset 0 -4px 0 #e09b00, 0 0 12px rgba(255,200,0,.45); }
.pyth.small .py-cell.lv3 { background: var(--green); color: #fff; box-shadow: inset 0 -4px 0 var(--green-d); text-shadow: none; }
.legend { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.lg { font-weight: 800; font-size: 14px; padding: 6px 12px; border-radius: 10px; }
.lg.lv0 { background: #ececf3; } .lg.lv1 { background: #ffe9c2; } .lg.lv2 { background: #c9f5a8; } .lg.lv3 { background: #ffd84a; }
.fact-detail { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.fd-badge { font-weight: 900; padding: 6px 14px; border-radius: 12px; background: #ececf3; }
.fd-badge.lv1 { background: #ffe9c2; } .fd-badge.lv2 { background: #c9f5a8; } .fd-badge.lv3 { background: #ffd84a; }

/* ---------- Compagnon ---------- */
.companion { display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 100%; }
.habitat { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 30px 20px 26px; overflow: hidden; min-height: 460px; }
.habitat .bubble { position: absolute; top: 26px; left: 50%; transform: translateX(-50%); width: max-content; max-width: 84%; text-align: center; }
.habitat .bubble::before { left: 50%; top: auto; bottom: -11px; transform: translateX(-50%) rotate(-45deg); }
.habitat .bubble.pop { animation: popInC .35s cubic-bezier(.2,1.4,.4,1); }
.deco svg { width: 100%; height: 100%; }
.deco { position: absolute; width: 64px; height: 64px; animation: floaty 4s ease-in-out infinite; filter: drop-shadow(0 6px 4px rgba(0,0,0,.15)); }
.deco.d0 { left: 8%; bottom: 30%; } .deco.d1 { right: 8%; bottom: 34%; animation-delay: 1s; } .deco.d2 { left: 16%; top: 22%; width: 46px; height: 46px; animation-delay: 2s; } .deco.d3 { right: 14%; top: 26%; width: 50px; height: 50px; animation-delay: .5s; }
.pet { width: min(300px, 70%); height: 340px; border: 0; background: none; padding: 0; z-index: 1; }
.pet.jump { animation: jump .6s ease-out; }
.pet-card { z-index: 1; background: rgba(255,255,255,.92); border-radius: 22px; padding: 14px 20px; width: min(360px, 92%); text-align: center; box-shadow: 0 6px 0 rgba(0,0,0,.08); display: flex; flex-direction: column; gap: 6px; }
.pet-name { font-size: 28px; font-weight: 900; }
.editable { border: 0; background: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 2px 10px; border-radius: 12px; }
.editable:active { background: rgba(0,0,0,.05); }
.editable .pen { width: .8em; height: .8em; display: inline-flex; opacity: .8; } .editable .pen svg { width: 100%; height: 100%; }
.kid-name { font-weight: 800; font-size: 15px; color: var(--ink-soft); margin-top: 2px; }
.shop-hint { margin: 0; font-weight: 700; color: var(--ink-soft); font-size: 15px; }
.trial { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff8d6; border: 2px solid var(--yellow); border-radius: 18px; padding: 10px 14px; animation: popIn .35s cubic-bezier(.2,1.4,.4,1); }
.trial-info { display: flex; align-items: center; gap: 10px; }
.trial-info b { display: block; font-size: 18px; } .trial-info span { font-weight: 800; color: var(--blue-d); }
.trial-ico { width: 56px; height: 62px; display: block; flex: none; } .trial-ico svg { width: 100%; height: 100%; } .trial-ico .bg-thumb svg { width: 32px; height: 32px; }
.trial-actions { display: flex; align-items: center; gap: 8px; }
.trial-actions .btn { margin: 0 0 5px; padding: 12px 18px; }
.trial-miss { font-weight: 800; color: #9a5a00; }
.item.trying { border-color: var(--yellow); background: #fff8d6; }
.item.trying .item-price { background: var(--yellow); color: #fff; } .pet-stage { font-weight: 800; color: var(--ink-soft); } .pet-next { font-weight: 800; font-size: 14px; color: var(--orange-d); }
.shop { padding: 22px; display: flex; flex-direction: column; gap: 14px; background: #fff; border-left: 2px solid var(--line); }
.shop-head { display: flex; align-items: center; justify-content: space-between; }
.shop-head h2 { font-size: 26px; }
.seg { display: flex; gap: 6px; background: var(--bg); border-radius: 16px; padding: 5px; flex-wrap: wrap; }
.seg-btn { flex: 1; border: 0; background: transparent; padding: 10px 8px; border-radius: 12px; font-weight: 900; font-size: 15px; color: var(--ink-soft); }
.seg-btn.on { background: #fff; color: var(--blue); box-shadow: 0 3px 0 var(--line); }
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.item { border: 2px solid var(--line); border-bottom-width: 6px; border-radius: 20px; background: #fff; padding: 14px 8px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.item:active { transform: translateY(4px); border-bottom-width: 2px; }
.item-ico { width: 92px; height: 100px; display: block; } .item-ico svg { width: 100%; height: 100%; }
.item-ico.bg { width: 92px; height: 70px; margin: 6px 0 4px; }
.bg-thumb { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 16px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); }
.bg-thumb svg { width: 46px; height: 46px; } .item-name { font-weight: 900; font-size: 15px; text-align: center; }
.item-price { font-weight: 900; font-size: 14px; color: var(--blue-d); background: var(--blue-soft); padding: 3px 10px; border-radius: 10px; }
.item.owned .item-price { color: var(--green-ink); background: var(--green-soft); }
.item.on { border-color: var(--blue); background: var(--blue-soft); }
.item.on .item-price { background: var(--blue); color: #fff; }
.item.locked { opacity: .55; }
.color-pick { display: flex; flex-direction: column; gap: 14px; align-items: center; text-align: center; font-weight: 700; }

/* ---------- Jeux ---------- */
.games { padding: 22px 16px 40px; max-width: 900px; margin: 0 auto; }
.games h1 { font-size: 34px; } .games > p { font-weight: 700; font-size: 17px; }
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin-top: 14px; }
.game-card { --gc: var(--purple); --gcd: var(--purple-d); position: relative; border: 0; border-radius: 26px; padding: 22px 18px; text-align: left; color: #fff; background: var(--gc); box-shadow: 0 7px 0 var(--gcd); display: flex; flex-direction: column; gap: 6px; overflow: hidden; min-height: 170px; }
.game-card::after { content: ''; position: absolute; right: -30px; bottom: -40px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.14); }
.game-card:active { transform: translateY(7px); box-shadow: none; }
.gc-ico { width: 64px; height: 64px; background: rgba(255,255,255,.92); border-radius: 18px; padding: 8px; box-shadow: 0 4px 0 rgba(0,0,0,.08); } .gc-ico svg { width: 100%; height: 100%; } .gc-title { font-size: 24px; font-weight: 900; } .gc-desc { font-weight: 700; opacity: .92; }
.gc-badge { position: absolute; top: 14px; right: 14px; background: rgba(255,255,255,.3); padding: 5px 10px; border-radius: 10px; font-weight: 900; }
.g-memory { --gc: #ff5d8f; --gcd: #d93d70; } .g-bubbles { --gc: #1cb0f6; --gcd: #1690ca; } .g-free { --gc: #58cc02; --gcd: #46a302; }
.g-review { --gc: #8b5cf6; --gcd: #6d3fd8; } .g-review.off { --gc: #b9b9c6; --gcd: #9a9aa8; } .g-teacher { --gc: #ff9600; --gcd: #d97f00; } .g-table { --gc: #ffc800; --gcd: #e0a800; }
.table-pick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0 4px; }
.tp { height: 70px; border-radius: 18px; border: 2px solid var(--line); border-bottom-width: 6px; background: #fff; font-size: 24px; font-weight: 900; color: var(--ink); }
.tp.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-d); }
.tp.locked { opacity: .45; padding: 18px; } .tp svg { width: 100%; height: 100%; }

/* ---------- Parent ---------- */
.parent { padding: 20px 16px 50px; max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; -webkit-user-select: text; user-select: text; }
.p-top { display: flex; align-items: center; gap: 12px; } .p-top h1 { font-size: 30px; }
.p-card { background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 20px; }
.p-card h2 { font-size: 22px; margin-bottom: 12px; } .p-card h3 { margin: 16px 0 8px; }
.p-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.p-kpi { background: var(--bg); border-radius: 16px; padding: 12px; display: flex; flex-direction: column; align-items: center; }
.p-kpi b { font-size: 24px; color: var(--purple-d); } .p-kpi span { font-size: 13px; font-weight: 800; color: var(--ink-soft); }
.p-days { display: grid; grid-template-columns: repeat(14, 1fr); gap: 5px; height: 70px; align-items: end; margin-top: 16px; }
.p-day { height: 100%; display: flex; align-items: flex-end; }
.p-day i { display: block; width: 100%; border-radius: 6px; background: var(--line); }
.p-day.on i { background: var(--green); }
.p-method { padding-left: 18px; line-height: 1.5; font-weight: 600; color: var(--ink); } .p-method li { margin-bottom: 8px; }
.p-toggle { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--line); font-weight: 800; }
.p-toggle input { width: 26px; height: 26px; accent-color: var(--green); }
.p-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 0 4px; font-weight: 800; }
.p-select { font-size: 16px; padding: 10px; border-radius: 12px; border: 2px solid var(--line); background: #fff; max-width: 100%; }
.p-daypick { display: flex; gap: 6px; flex-wrap: wrap; }
.p-dp { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); border-bottom-width: 4px; background: #fff; font-weight: 900; color: var(--ink-soft); }
.p-dp.on { background: var(--blue-soft); border-color: var(--blue); color: var(--blue-d); }
.p-warn { background: var(--orange-soft); border-radius: 12px; padding: 10px 14px; font-weight: 700; color: #9a5a00; }
.p-state { font-weight: 800; color: var(--ink-soft); margin-bottom: 0; } .p-state.on { color: var(--green-ink); }
.p-code-big { font-family: ui-monospace, "SF Mono", monospace; font-size: clamp(22px, 4vw, 32px); font-weight: 800; letter-spacing: .08em; text-align: center; background: var(--purple-soft); color: var(--purple-d); border-radius: 16px; padding: 16px; margin: 6px 0; -webkit-user-select: all; user-select: all; }
.link-btn { border: 0; background: none; color: var(--blue-d); font-weight: 800; font-size: 17px; text-decoration: underline; text-underline-offset: 4px; padding: 8px; }
.onb-input.code { font-family: ui-monospace, "SF Mono", monospace; letter-spacing: .06em; font-size: 22px; }
.restore { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.p-code { width: 100%; min-height: 120px; border-radius: 14px; border: 2px solid var(--line); padding: 10px; font-size: 12px; font-family: ui-monospace, monospace; }

/* ---------- Animations ---------- */
@keyframes breathe { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.025, .975); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
@keyframes twinkle { 0%, 100% { transform: scale(.6) rotate(0); opacity: .5; } 50% { transform: scale(1.15) rotate(20deg); opacity: 1; } }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes floaty { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-12px) rotate(3deg); } }
@keyframes popIn { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes popInC { 0% { transform: translateX(-50%) scale(.5); opacity: 0; } 100% { transform: translateX(-50%) scale(1); opacity: 1; } }
@keyframes slideIn { 0% { transform: translateX(40px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes slideUp { 0% { transform: translateY(30px); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes rowIn { 0% { transform: scale(.6); opacity: 0; } 100% { transform: none; opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.shake { animation: shake .4s; }
@keyframes wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-8deg) scale(1.05); } 75% { transform: rotate(8deg) scale(1.05); } }
@keyframes glow { 0%, 100% { box-shadow: 0 6px 0 #5b3fc0, 0 0 0 0 rgba(139,92,246,.0); } 50% { box-shadow: 0 6px 0 #5b3fc0, 0 0 0 8px rgba(139,92,246,.18); } }
.tb-quests.glow { animation: questGlow 1.4s infinite; }
@keyframes questGlow { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,200,0,.0); } 50% { box-shadow: 0 0 0 6px rgba(255,200,0,.35); } }
@keyframes nodePulse { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes floatUp { 0% { transform: translate(-50%, 0) scale(.8); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -10px) scale(1.1); } 100% { transform: translate(-50%, -90px) scale(1); opacity: 0; } }
@keyframes caret { 50% { opacity: 0; } }
@keyframes eggWobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-6deg); } }
@keyframes jump { 0% { transform: translate(-50%, 0); } 40% { transform: translate(-50%, -46px) scale(1.1); } 100% { transform: translate(-50%, 0); } }
.pet.jump { animation: petJump .6s ease-out; }
@keyframes petJump { 0%, 100% { transform: translateY(0); } 40% { transform: translateY(-40px) scale(1.04); } }
@keyframes bubblePop { 0% { opacity: 1; scale: 1; } 100% { opacity: 0; scale: 1.7; } }
@keyframes stampIn { 0% { transform: rotate(-14deg) scale(2.2); opacity: 0; } 100% { transform: rotate(-14deg) scale(1); opacity: 1; } }

/* ---------- Écrans étroits / portrait ---------- */
@media (max-width: 900px), (orientation: portrait) {
  .l-body, .corr-body { grid-template-columns: 1fr; align-items: stretch; align-content: center; gap: 22px; padding: 4px 18px 18px; }
  .l-left { align-self: auto; justify-content: flex-start; }
  .l-input { width: 100%; max-width: 520px; margin: 0 auto; }
  .l-card { min-height: 0; padding: 22px 16px; }
  .companion { grid-template-columns: 1fr; }
  .shop { border-left: 0; border-top: 2px solid var(--line); }
  .habitat { min-height: 420px; }
  .corr-side { max-width: 520px; width: 100%; margin: 0 auto; }
}
@media (max-width: 600px) {
  .tb-label, .tab-label { display: none; }
  .onb-species { grid-template-columns: repeat(2, 1fr); }
  .col-stats { grid-template-columns: repeat(2, 1fr); }
  .p-kpis { grid-template-columns: repeat(2, 1fr); }
  .mem-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px; }
  .d-known { grid-template-columns: repeat(2, 1fr); }
  .key { height: 60px; }
  .choice { font-size: 34px; padding: 14px 6px; }
  .isl-txt h2 { font-size: 21px; }
  .node-buddy { display: none; }
  .finger { width: 26px; } .finger.gap { margin-left: 10px; }
  .l-coach .cr-wrap, .d-coach .cr-wrap { width: 76px; height: 90px; }
  .bubble { font-size: 16px; }
}
@media (max-height: 760px) and (orientation: landscape) {
  .l-coach .cr-wrap { width: 84px; height: 96px; }
  .key { height: 62px; }
  .q-big { font-size: 60px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; } }
