/* ==========================================================================
   Constellation — design "stickers" : couleurs pop, contours épais,
   ombres franches, gros boutons en relief.
   ========================================================================== */

:root {
  --ink: #1d1640;
  --ink-soft: #4a4270;
  --muted: #7a7299;
  --paper: #fff6e5;
  --paper-2: #ffe9c2;
  --white: #fff;

  --grape: #7c4dff;
  --pink: #ff4fa3;
  --orange: #ff7a1a;
  --sun: #ffc21a;
  --mint: #16c47f;
  --sky: #10b4e6;
  --cherry: #ef3b45;

  --good: var(--mint);
  --good-bg: #dcfbe9;
  --bad: var(--cherry);
  --bad-bg: #ffe1e3;

  --bw: 3px;
  --border: var(--bw) solid var(--ink);
  --sh: 5px 5px 0 var(--ink);
  --sh-sm: 3px 3px 0 var(--ink);
  --sh-lg: 8px 8px 0 var(--ink);
  --r: 22px;
  --r-sm: 14px;
  --r-xs: 10px;

  --display: 'Fredoka', 'Baloo 2', system-ui, sans-serif;
  --body: 'Nunito', system-ui, sans-serif;
  --pop: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--body);
  font-weight: 700;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
  background-color: var(--paper);
  background-image: radial-gradient(var(--paper-2) 2.2px, transparent 2.6px);
  background-size: 26px 26px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; line-height: 1.05; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px dashed var(--grape); outline-offset: 3px; }

/* Formes décoratives en arrière-plan */
.deco { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.deco i { position: absolute; border: var(--border); border-radius: 50%; opacity: .9; }
.deco i:nth-child(1) { width: 220px; height: 220px; background: var(--sun); left: -90px; top: 120px; }
.deco i:nth-child(2) { width: 140px; height: 140px; background: var(--pink); right: -50px; top: 60px; border-radius: 38% 62% 55% 45%; }
.deco i:nth-child(3) { width: 300px; height: 300px; background: var(--sky); right: -140px; bottom: -120px; }
.deco i:nth-child(4) { width: 90px; height: 90px; background: var(--mint); left: 8%; bottom: 40px; border-radius: 22px; transform: rotate(18deg); }
.page { position: relative; z-index: 1; }

/* ---------- Primitives ---------- */

.sticker {
  background: var(--white);
  border: var(--border);
  border-radius: var(--r);
  box-shadow: var(--sh);
}

.btn {
  --b: var(--white);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px;
  font-family: var(--display); font-weight: 600; font-size: 16px; line-height: 1;
  background: var(--b);
  color: var(--ink);
  border: var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--sh-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: transform .12s var(--pop), box-shadow .12s;
}
.btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn-primary { --b: var(--grape); color: #fff; }
.btn-sun { --b: var(--sun); }
.btn-good { --b: var(--mint); color: #fff; }
.btn-bad { --b: var(--cherry); color: #fff; }
.btn-pink { --b: var(--pink); color: #fff; }
.btn-sky { --b: var(--sky); color: #fff; }
.btn-lg { padding: 15px 24px; font-size: 19px; border-radius: 16px; }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 10px; box-shadow: 2px 2px 0 var(--ink); }
.btn-icon { width: 38px; height: 38px; padding: 0; }
.btn-block { width: 100%; }

.tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px;
  font-family: var(--display); font-weight: 600; font-size: 13px;
  border: 2px solid var(--ink);
  border-radius: 99px;
  background: var(--white);
  white-space: nowrap;
}

.avatar {
  --size: 44px;
  --c: var(--grape);
  width: var(--size); height: var(--size);
  flex-shrink: 0;
  display: grid; place-items: center;
  border: var(--border);
  border-radius: 50%;
  background: var(--c);
  overflow: hidden;
  font-size: calc(var(--size) * .5);
  font-family: var(--display); font-weight: 700; color: #fff;
  line-height: 1;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.xs { --size: 26px; border-width: 2px; font-size: 13px; }
.avatar.sm { --size: 34px; border-width: 2px; }
.avatar.lg { --size: 76px; }
.avatar.xl { --size: 110px; border-width: 4px; }
.avatar.xxl { --size: 150px; border-width: 5px; }

.section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 22px; margin-bottom: 14px;
}
.section-title .bubble {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: var(--border); border-radius: 12px; box-shadow: var(--sh-sm);
  background: var(--sun); font-size: 20px;
  transform: rotate(-6deg);
}

/* ---------- Barre du haut ---------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  padding: 12px max(16px, env(safe-area-inset-right)) 12px max(16px, env(safe-area-inset-left));
  background: var(--white);
  border-bottom: var(--border);
}
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; margin-right: auto; }
.logo-star {
  width: 42px; height: 42px; display: grid; place-items: center;
  background: var(--sun); border: var(--border); border-radius: 12px; box-shadow: var(--sh-sm);
  font-size: 22px; transform: rotate(-8deg);
  transition: transform .3s var(--pop);
}
.logo:hover .logo-star { transform: rotate(8deg) scale(1.08); }
.logo-text { font-family: var(--display); font-weight: 700; font-size: 24px; letter-spacing: -.3px; }
.logo-text small { display: block; font-family: var(--body); font-size: 11px; font-weight: 800; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.nav { display: flex; gap: 6px; }
.nav a {
  padding: 8px 14px; border-radius: 12px; border: 2px solid transparent;
  font-family: var(--display); font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink-soft);
}
.nav a:hover { background: var(--paper); }
.nav a.on { background: var(--paper-2); border-color: var(--ink); color: var(--ink); }
.me { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border: var(--border); border-radius: 99px; background: var(--paper); text-decoration: none; }
.me span { font-family: var(--display); font-weight: 600; }
.live {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 12px; border: 2px solid var(--ink); border-radius: 99px; background: var(--good-bg);
  font-family: var(--display); font-weight: 600; font-size: 13px;
}
.live i { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); border: 2px solid var(--ink); }
.live.busy { background: #fff3c4; } .live.busy i { background: var(--sun); animation: blink .8s infinite; }
.live.off { background: var(--bad-bg); } .live.off i { background: var(--cherry); }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- Flash ---------- */

.flashes { display: grid; gap: 10px; margin-bottom: 18px; }
.flash { padding: 12px 16px; border: var(--border); border-radius: var(--r-sm); box-shadow: var(--sh-sm); font-weight: 800; animation: drop .45s var(--pop); }
.flash.success { background: var(--good-bg); }
.flash.error { background: var(--bad-bg); }
.flash.info { background: #e0f4ff; }
@keyframes drop { from { opacity: 0; transform: translateY(-14px) rotate(-1deg); } }

/* ---------- Pages d'accueil / connexion ---------- */

.auth {
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1.05fr 1fr;
}
.auth-art {
  position: relative; overflow: hidden;
  background: var(--grape);
  border-right: var(--border);
  display: flex; flex-direction: column; justify-content: center; padding: 48px;
  color: #fff;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,.18) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 60%, rgba(255,255,255,.18) 0 2px, transparent 3px);
  background-size: 60px 60px, 90px 90px;
}
.auth-art h1 { font-size: clamp(44px, 6vw, 84px); letter-spacing: -1px; text-shadow: 4px 4px 0 var(--ink); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; }
.auth-art p { font-size: 20px; max-width: 460px; margin-top: 16px; font-weight: 800; }
.floaters { position: absolute; inset: 0; pointer-events: none; }
.floaters span {
  position: absolute; display: grid; place-items: center;
  width: 86px; height: 86px; font-size: 42px;
  background: var(--white); border: var(--border); border-radius: 24px; box-shadow: var(--sh);
  animation: bob 4s ease-in-out infinite;
}
.floaters span:nth-child(1) { top: 9%; right: 12%; background: var(--sun); transform: rotate(8deg); }
.floaters span:nth-child(2) { bottom: 12%; right: 22%; background: var(--pink); animation-delay: -1s; border-radius: 50%; }
.floaters span:nth-child(3) { bottom: 26%; left: 8%; background: var(--mint); animation-delay: -2s; }
.floaters span:nth-child(4) { top: 14%; left: 10%; background: var(--sky); animation-delay: -3s; border-radius: 50%; width: 64px; height: 64px; font-size: 30px; }
@keyframes bob { 50% { translate: 0 -14px; rotate: 4deg; } }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 480px; padding: 32px; }
.auth-card h2 { font-size: 34px; margin-bottom: 6px; }
.auth-card .lead { color: var(--muted); margin-bottom: 22px; }

/* ---------- Formulaires ---------- */

.field { margin-bottom: 16px; }
.field > label, .field legend { display: block; font-family: var(--display); font-weight: 600; font-size: 16px; margin-bottom: 6px; }
.input, .field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field select {
  width: 100%;
  padding: 12px 14px;
  border: var(--border); border-radius: var(--r-sm);
  background: var(--white);
  font-weight: 800; font-size: 16px;
  box-shadow: inset 0 3px 0 rgba(29, 22, 64, .06);
  transition: box-shadow .15s, transform .15s;
}
.field input:focus, .input:focus { outline: none; box-shadow: var(--sh-sm); transform: translate(-1px, -1px); }
.help { font-size: 13px; color: var(--muted); margin-top: 5px; }
.errors { list-style: none; color: var(--cherry); font-size: 14px; font-weight: 800; margin-top: 6px; }
.errors li::before { content: '⚠️ '; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--cherry); }

.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch input { position: absolute; opacity: 0; pointer-events: none; }
.swatch span {
  display: block; width: 42px; height: 42px; border-radius: 50%;
  background: var(--c); border: var(--border); cursor: pointer;
  transition: transform .15s var(--pop), box-shadow .15s;
}
.swatch span:hover { transform: scale(1.1); }
.swatch input:checked + span { box-shadow: 0 0 0 4px var(--white), 0 0 0 7px var(--ink); transform: scale(1.05); }
.swatch input:focus-visible + span { outline: 3px dashed var(--grape); outline-offset: 6px; }

.points-choice { display: flex; flex-wrap: wrap; gap: 8px; }
.points-choice label { cursor: pointer; }
.points-choice input { position: absolute; opacity: 0; }
.points-choice span {
  display: grid; place-items: center; min-width: 54px; height: 44px; padding: 0 10px;
  border: var(--border); border-radius: 12px; background: var(--white);
  font-family: var(--display); font-weight: 700; font-size: 18px;
  transition: all .15s var(--pop);
}
.points-choice .pos span { color: #0b7a4d; }
.points-choice .neg span { color: #b01822; }
.points-choice input:checked + span { box-shadow: var(--sh-sm); transform: translate(-2px, -2px); }
.points-choice .pos input:checked + span { background: var(--mint); color: #fff; }
.points-choice .neg input:checked + span { background: var(--cherry); color: #fff; }

.emoji-picker { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.emoji-picker button {
  width: 40px; height: 40px; font-size: 22px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white);
  transition: transform .12s var(--pop);
}
.emoji-picker button:hover { transform: scale(1.15) rotate(-6deg); background: var(--paper-2); }

.photo-field { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-drop {
  position: relative; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border: 3px dashed var(--ink); border-radius: var(--r-sm); background: var(--paper);
  font-family: var(--display); font-weight: 600;
  transition: background .15s;
}
.photo-drop:hover { background: var(--paper-2); }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Mise en page appli ---------- */

.wrap { width: 100%; max-width: 1320px; margin: 0 auto; padding: 22px 16px 60px; }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 24px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 24px; }
.panel { padding: 20px; }

/* ---------- Cartes enfant (parents) ---------- */

.kids-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.kid {
  --c: var(--grape);
  position: relative; text-align: center; overflow: visible;
  padding: 0 0 16px;
  background: var(--white); border: var(--border); border-radius: var(--r); box-shadow: var(--sh);
  transition: transform .25s var(--pop), box-shadow .25s;
}
.kid:hover { transform: translateY(-4px) rotate(-.6deg); }
.kid.sel { transform: translateY(-6px) rotate(-1.5deg); box-shadow: 8px 8px 0 var(--c), 8px 8px 0 3px var(--ink); }
.kid.sel::after {
  content: 'À toi de jouer !'; position: absolute; top: -14px; left: 50%; translate: -50% 0;
  padding: 3px 12px; border: var(--border); border-radius: 99px; background: var(--sun);
  font-family: var(--display); font-weight: 700; font-size: 13px; white-space: nowrap; rotate: 3deg;
}
.kid-top {
  height: 78px; border-radius: calc(var(--r) - 3px) calc(var(--r) - 3px) 0 0; border-bottom: var(--border);
  background-color: var(--c);
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.22) 0 10px, transparent 10px 20px);
}
.kid .avatar { margin: -58px auto 8px; --size: 96px; border-width: 4px; box-shadow: var(--sh-sm); position: relative; }
.kid-mood {
  position: absolute; top: 58px; right: calc(50% - 64px);
  width: 40px; height: 40px; display: grid; place-items: center; font-size: 22px;
  background: var(--white); border: var(--border); border-radius: 50%; z-index: 1;
}
.kid-name { font-size: 24px; }
.kid-pts { display: flex; align-items: baseline; justify-content: center; gap: 4px; margin: 4px 0 10px; }
.kid-pts b { font-family: var(--display); font-size: 44px; line-height: 1; }
.kid-pts span { font-family: var(--display); font-weight: 600; color: var(--muted); }
.kid.neg .kid-pts b { color: var(--cherry); }
.kid .track { padding: 0 14px; }
.kid-chips { display: flex; justify-content: center; gap: 6px; margin-top: 12px; flex-wrap: wrap; padding: 0 8px; }
.kid-chips .tag.hot { background: var(--sun); animation: wiggle 1.6s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { rotate: 0deg; } 20% { rotate: -6deg; } 40% { rotate: 5deg; } 60% { rotate: -3deg; } }
.kid.bump { animation: bump .6s var(--pop); }
.kid.hit { animation: hit .5s; }
@keyframes bump { 35% { transform: translateY(-14px) scale(1.04) rotate(-2deg); } }
@keyframes hit { 20%, 60% { translate: -8px 0; } 40%, 80% { translate: 8px 0; } }

/* Piste d'étoiles (points vers le palier) */
.track { display: grid; grid-template-columns: repeat(var(--n, 10), 1fr); gap: 4px; }
.slot {
  aspect-ratio: 1; display: grid; place-items: center;
  border: 2px dashed rgba(29, 22, 64, .3); border-radius: 8px;
  font-size: 13px; line-height: 1;
}
.slot.on { border: 2px solid var(--ink); background: var(--sun); animation: popIn .45s var(--pop) both; animation-delay: calc(var(--i) * 35ms); }
.slot.neg { border: 2px solid var(--ink); background: var(--bad-bg); }
.slot.rec { border: 2px solid var(--ink); background: var(--mint); }
@keyframes popIn { from { transform: scale(0) rotate(-40deg); } }
.track-note { font-size: 13px; color: var(--muted); margin-top: 8px; padding: 0 12px; }

/* ---------- Boutons de motifs ---------- */

.actions-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.act-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.act-head h3 { font-size: 21px; display: flex; align-items: center; gap: 8px; }
.act-head .for { font-size: 14px; color: var(--muted); font-family: var(--body); font-weight: 800; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.tile {
  --t: var(--mint); --tb: var(--good-bg);
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px;
  min-height: 108px; padding: 12px;
  text-align: left;
  background: var(--white); border: var(--border); border-radius: 16px; box-shadow: var(--sh-sm);
  transition: transform .12s var(--pop), box-shadow .12s, background .15s;
}
.tile.bad { --t: var(--cherry); --tb: var(--bad-bg); }
.tile:hover { background: var(--tb); transform: translate(-2px, -2px) rotate(-.5deg); box-shadow: 5px 5px 0 var(--ink); }
.tile:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
.tile-emoji { width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; background: var(--tb); border: 2px solid var(--ink); border-radius: 12px; }
.tile-label { font-weight: 800; font-size: 14px; line-height: 1.2; padding-right: 34px; }
.tile-pts {
  position: absolute; top: 10px; right: 10px;
  min-width: 36px; height: 30px; padding: 0 6px; display: grid; place-items: center;
  background: var(--t); color: #fff; border: 2px solid var(--ink); border-radius: 10px;
  font-family: var(--display); font-weight: 700; font-size: 16px;
}
.empty { padding: 22px; text-align: center; color: var(--muted); border: 3px dashed rgba(29,22,64,.2); border-radius: var(--r-sm); }

/* ---------- Journal ---------- */

.feed { display: flex; flex-direction: column; gap: 8px; max-height: 560px; overflow-y: auto; padding: 2px 6px 6px 2px; }
.feed-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.fbtn { padding: 5px 11px; border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-family: var(--display); font-weight: 600; font-size: 13px; }
.fbtn.on { background: var(--c, var(--ink)); color: #fff; }
.ev { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); }
.ev.good { background: linear-gradient(90deg, var(--good-bg), var(--white) 70%); }
.ev.bad { background: linear-gradient(90deg, var(--bad-bg), var(--white) 70%); }
.ev.gold { background: linear-gradient(90deg, #fff1bf, var(--white) 70%); }
.ev.undone { opacity: .45; }
.ev.undone .ev-label { text-decoration: line-through; }
.ev-emoji { width: 36px; height: 36px; display: grid; place-items: center; font-size: 19px; flex-shrink: 0; background: var(--white); border: 2px solid var(--ink); border-radius: 11px; }
.ev-body { flex: 1; min-width: 0; }
.ev-label { font-weight: 800; font-size: 14px; line-height: 1.25; }
.ev-meta { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 3px; flex-wrap: wrap; }
.ev-meta b { color: var(--ink-soft); }
.ev-kid { display: inline-flex; align-items: center; gap: 4px; padding: 0 7px; border-radius: 99px; background: var(--c); color: #fff; font-weight: 800; border: 1.5px solid var(--ink); }
.ev-pts { font-family: var(--display); font-weight: 700; font-size: 20px; }
.ev-pts.p { color: #0b7a4d; } .ev-pts.m { color: #b01822; }
.ev-undo { width: 32px; height: 32px; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); font-size: 15px; flex-shrink: 0; transition: transform .12s var(--pop); }
.ev-undo:hover { background: var(--sun); transform: rotate(-20deg); }

/* ---------- Récompenses ---------- */

.rewards { display: flex; flex-direction: column; gap: 14px; }
.rw-kid { border: 2px solid var(--ink); border-radius: 16px; padding: 12px; background: var(--paper); }
.rw-kid-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.rw-kid-head b { font-family: var(--display); font-size: 18px; }
.rw-kid-head small { display: block; font-size: 12px; color: var(--muted); }
.tickets { display: flex; flex-direction: column; gap: 8px; }
.ticket {
  position: relative; display: flex; align-items: center; gap: 10px;
  padding: 10px 12px 10px 16px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 12px;
}
.ticket::before, .ticket::after {
  content: ''; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background: var(--paper); border: 2px solid var(--ink); border-radius: 50%; clip-path: inset(0 0 0 50%);
}
.ticket::after { left: auto; right: -9px; clip-path: inset(0 50% 0 0); }
.ticket.treasure { background: linear-gradient(100deg, #fff1bf, #ffe07a); }
.ticket.used { opacity: .5; }
.ticket.used .t-label { text-decoration: line-through; }
.t-emoji { font-size: 24px; }
.t-body { flex: 1; min-width: 0; }
.t-label { font-family: var(--display); font-weight: 600; font-size: 16px; }
.t-date { font-size: 12px; color: var(--muted); }
.more { font-size: 13px; color: var(--muted); text-align: center; padding: 4px; }

/* ---------- Graphique semaine ---------- */

.chart svg { width: 100%; height: auto; max-height: 240px; display: block; overflow: visible; }
.chart .axis { stroke: var(--ink); stroke-width: 2; }
.chart .grid { stroke: rgba(29,22,64,.12); stroke-dasharray: 4 5; }
.chart .bar { stroke: var(--ink); stroke-width: 2; transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--pop) both; }
.chart .bar.neg { transform-origin: top; }
.chart text { font-family: var(--display); font-weight: 600; font-size: 12px; fill: var(--ink-soft); }
@keyframes grow { from { transform: scaleY(0); } }
.legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 10px; font-size: 13px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border: 2px solid var(--ink); border-radius: 4px; background: var(--c); }

/* ---------- Réglages ---------- */

.settings { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.side { padding: 10px; display: flex; flex-direction: column; gap: 4px; position: sticky; top: 90px; }
.side a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; border: 2px solid transparent; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 17px; }
.side a:hover { background: var(--paper); }
.side a.on { background: var(--sun); border-color: var(--ink); box-shadow: var(--sh-sm); }
.side a span { font-size: 20px; }
.list { display: flex; flex-direction: column; gap: 10px; }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: var(--border); border-radius: 16px; background: var(--white); }
.item-body { flex: 1; min-width: 0; }
.item-title { font-family: var(--display); font-weight: 600; font-size: 19px; }
.item-sub { font-size: 13px; color: var(--muted); }
.item .row { gap: 6px; flex-wrap: nowrap; }
.inline { display: inline; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.danger-zone { border-color: var(--cherry); background: #fff7f7; }
.link-box { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.link-box input { flex: 1; min-width: 200px; font-family: ui-monospace, monospace; font-size: 14px; }
.qr { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* ---------- Écran enfants ---------- */

.kids-page .topbar { background: var(--sun); }
.kids-hero { text-align: center; padding: 26px 16px 8px; }
.kids-hero h1 {
  font-size: clamp(40px, 7vw, 76px); color: #fff; letter-spacing: -1px;
  -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink);
}
.kids-hero p { font-size: 18px; margin-top: 10px; color: var(--ink-soft); }
.kbig-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 26px; margin-top: 28px; }
.kbig {
  --c: var(--grape);
  position: relative; overflow: hidden;
  background: var(--white); border: 4px solid var(--ink); border-radius: 30px; box-shadow: var(--sh-lg);
  text-align: center;
}
.kbig.bump { animation: bump .7s var(--pop); }
.kbig.hit { animation: hit .5s; }
.kbig-top {
  position: relative; height: 150px; border-bottom: 4px solid var(--ink);
  background-color: var(--c);
  background-image:
    radial-gradient(circle at 15% 30%, rgba(255,255,255,.35) 0 6px, transparent 7px),
    radial-gradient(circle at 85% 60%, rgba(255,255,255,.3) 0 9px, transparent 10px),
    repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 14px, transparent 14px 28px);
}
.kbig .avatar { --size: 160px; border-width: 5px; margin: -110px auto 8px; position: relative; box-shadow: var(--sh); animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translateY(-6px) rotate(2deg); } }
.kbig-mood {
  position: absolute; top: 105px; right: calc(50% - 100px); z-index: 2;
  width: 64px; height: 64px; display: grid; place-items: center; font-size: 36px;
  background: var(--white); border: 4px solid var(--ink); border-radius: 50%; box-shadow: var(--sh-sm);
}
.kbig-name { font-size: 40px; }
.kbig-score { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 8px 0 4px; }
.kbig-score b {
  font-family: var(--display); font-size: 96px; line-height: .9; color: var(--c);
  -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink);
}
.kbig.neg .kbig-score b { color: var(--cherry); }
.kbig-score span { font-size: 54px; }
.kbig-msg {
  display: inline-block; margin: 6px 16px 16px; padding: 8px 16px;
  background: var(--paper); border: 3px solid var(--ink); border-radius: 99px;
  font-family: var(--display); font-weight: 600; font-size: 18px;
}
.kbig .track { padding: 0 18px; gap: 6px; }
.kbig .slot { border-radius: 12px; font-size: clamp(16px, 2.2vw, 24px); }
.kbig-section { margin: 18px 18px 0; padding: 14px; border: 3px solid var(--ink); border-radius: 18px; background: var(--paper); text-align: left; }
.kbig-section h4 { font-size: 18px; margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.shelf { display: flex; flex-wrap: wrap; gap: 6px; min-height: 42px; align-items: center; }
.trophy { font-size: 30px; filter: drop-shadow(2px 2px 0 var(--ink)); animation: popIn .5s var(--pop) both; animation-delay: calc(var(--i) * 60ms); }
.trophy.used { filter: grayscale(1); opacity: .35; }
.chest-bar { position: relative; height: 30px; border: 3px solid var(--ink); border-radius: 99px; background: var(--white); overflow: hidden; }
.chest-bar i {
  position: absolute; inset: 0 auto 0 0; width: var(--p); border-right: 3px solid var(--ink);
  background: var(--sun); background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.4) 0 8px, transparent 8px 16px);
  transition: width 1s var(--pop);
  animation: stripes 1.2s linear infinite;
}
.chest-bar span { position: absolute; inset: 0; z-index: 1; display: grid; place-items: center; font-family: var(--display); font-weight: 700; text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 2px #fff; }
@keyframes stripes { to { background-position: 22px 0; } }
.moods { display: flex; justify-content: space-between; gap: 4px; }
.moods span { font-size: 30px; opacity: .25; filter: grayscale(1); transition: all .3s var(--pop); }
.moods span.on { opacity: 1; filter: none; transform: scale(1.35); }
.recent { display: flex; flex-direction: column; gap: 6px; }
.recent div { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.recent b { margin-left: auto; font-family: var(--display); }
.kbig-foot { height: 18px; }
.rules { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 34px; }
.rules .panel h3 { font-size: 24px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-weight: 800; }
.chip.good { background: var(--good-bg); } .chip.bad { background: var(--bad-bg); }
.chip b { font-family: var(--display); }

/* ---------- Célébration ---------- */

.celebrate { position: fixed; inset: 0; z-index: 80; display: none; place-items: center; padding: 16px; background: rgba(29, 22, 64, .55); }
.celebrate.show { display: grid; }
.sunburst {
  position: absolute; width: 180vmax; height: 180vmax; left: 50%; top: 50%; margin: -90vmax 0 0 -90vmax;
  background: repeating-conic-gradient(from 0deg, var(--c) 0 10deg, var(--sun) 10deg 20deg);
  opacity: .9; animation: spin 18s linear infinite;
  -webkit-mask: radial-gradient(circle, #000 0, #000 20%, transparent 62%);
  mask: radial-gradient(circle, #000 0, #000 20%, transparent 62%);
}
@keyframes spin { to { transform: rotate(360deg); } }
.cel-card { position: relative; text-align: center; padding: 30px 34px; max-width: 520px; animation: celIn .7s var(--pop); }
@keyframes celIn { from { transform: scale(.2) rotate(-12deg); opacity: 0; } }
.cel-card .avatar { margin: -100px auto 10px; box-shadow: var(--sh); }
.cel-emoji { font-size: 70px; line-height: 1; margin-bottom: 4px; animation: wiggle 1s ease-in-out infinite; display: inline-block; }
.cel-card h2 { font-size: clamp(34px, 6vw, 54px); }
.cel-card p { font-size: 20px; margin: 10px 0 20px; color: var(--ink-soft); }

/* ---------- Toast & effets ---------- */

.toasts { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; width: calc(100% - 32px); }
.toast {
  padding: 12px 18px; max-width: 100%;
  background: var(--white); border: var(--border); border-radius: 16px; box-shadow: var(--sh);
  font-weight: 800; text-align: center;
  animation: toastIn .45s var(--pop);
}
.toast.good { background: var(--good-bg); }
.toast.bad { background: var(--bad-bg); }
.toast.gold { background: #fff1bf; }
.toast.err { background: var(--cherry); color: #fff; }
.toast.out { animation: toastOut .3s ease forwards; }
@keyframes toastIn { from { transform: translateY(40px) scale(.8) rotate(-3deg); opacity: 0; } }
@keyframes toastOut { to { transform: translateY(20px) scale(.9); opacity: 0; } }
.floaty {
  position: fixed; z-index: 85; pointer-events: none;
  font-family: var(--display); font-weight: 700; font-size: 30px; color: #fff;
  -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink);
  animation: floaty 1.1s ease-out forwards;
}
.floaty.m { color: var(--cherry); }
@keyframes floaty { from { transform: translate(-50%, -50%) scale(.6); opacity: 1; } 30% { transform: translate(-50%, -90%) scale(1.25); } to { transform: translate(-50%, -190%) scale(1); opacity: 0; } }
#fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

dialog.confirm { margin: auto; padding: 26px; max-width: 440px; width: calc(100% - 32px); border: var(--border); border-radius: var(--r); box-shadow: var(--sh-lg); background: var(--white); color: var(--ink); }
dialog.confirm::backdrop { background: rgba(29, 22, 64, .5); }
dialog.confirm h3 { font-size: 26px; margin-bottom: 8px; }
dialog.confirm p { color: var(--ink-soft); margin-bottom: 18px; }
dialog.confirm[open] { animation: celIn .4s var(--pop); }

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .dash { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 260px; border-right: 0; border-bottom: var(--border); padding: 32px 22px; }
  .floaters span:nth-child(2), .floaters span:nth-child(3) { display: none; }
  .settings { grid-template-columns: 1fr; }
  .side { position: static; flex-direction: row; overflow-x: auto; }
  .side a { white-space: nowrap; }
  .rules { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .actions-grid { grid-template-columns: 1fr; }
  .nav a span.lbl, .me span, .logo-text small { display: none; }
  .logo-text { font-size: 20px; }
  .kids-row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .kid { padding-bottom: 10px; }
  .kid-top { height: 46px; }
  .kid .avatar { --size: 60px; margin-top: -34px; border-width: 3px; }
  .kid-mood { top: 34px; right: calc(50% - 44px); width: 28px; height: 28px; font-size: 15px; border-width: 2px; }
  .kid-name { font-size: 16px; }
  .kid-pts b { font-size: 28px; }
  .kid-pts span { font-size: 12px; }
  .kid .track { padding: 0 6px; gap: 2px; }
  .kid .slot { font-size: 8px; border-radius: 4px; border-width: 1.5px; }
  .kid-chips .tag { font-size: 11px; padding: 1px 6px; }
  .kid.sel::after { font-size: 10px; top: -12px; content: 'Choisi'; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 96px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kbig-score b { font-size: 76px; }
  .item { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Pages (ajouts)
   ========================================================================== */

a.kid, a.kbig { display: block; text-decoration: none; color: inherit; }
.flash.gold { background: #fff1bf; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.page-head h1 { font-size: clamp(30px, 4vw, 44px); }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 16px; }
.kids-row { margin-bottom: 30px; padding-top: 14px; }
.dash-bottom { display: grid; grid-template-columns: 1.1fr 1fr 1fr; gap: 22px; align-items: start; }
.totals { display: grid; gap: 8px; margin-top: 16px; }
.total { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); }
.total b { font-family: var(--display); font-size: 17px; display: block; }
.total small { color: var(--muted); font-size: 13px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--c); border: 2px solid var(--ink); vertical-align: middle; }

/* Onglets enfants (page d'un enfant) */
.kid-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.kid-tabs a {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px;
  border: var(--border); border-radius: 99px; background: var(--white); text-decoration: none;
  font-family: var(--display); font-weight: 600; font-size: 16px; box-shadow: var(--sh-sm);
  transition: transform .15s var(--pop);
}
.kid-tabs a:hover { transform: translateY(-2px); }
.kid-tabs a b { padding: 1px 8px; border-radius: 99px; background: var(--paper); border: 2px solid var(--ink); font-size: 13px; }
.kid-tabs a.on { background: var(--c); color: #fff; }
.kid-tabs a.on b { color: var(--ink); }

/* Page d'un enfant (parents) */
.child-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 24px; align-items: start; }
.child-hero { position: sticky; top: 90px; padding: 0 0 16px; overflow: hidden; display: flex; flex-direction: column; gap: 12px; }
.child-hero > .btn, .child-hero > form { margin: 0 16px; }
.hero-kid { border: 0; box-shadow: none; border-radius: 0; padding-bottom: 6px; }
.hero-kid:hover { transform: none; }
.hero-kid .kid-top { height: 110px; border-radius: 0; }
.hero-kid .avatar { --size: 130px; margin-top: -80px; }
.hero-kid .kid-mood { top: 110px; right: calc(50% - 82px); width: 50px; height: 50px; font-size: 28px; }
.hero-kid .kid-name { font-size: 34px; }
.hero-kid .kid-pts b { font-size: 64px; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 16px; }
.hero-stats div { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); text-align: center; }
.hero-stats b { font-family: var(--display); font-size: 24px; line-height: 1; }
.hero-stats span { font-size: 11px; color: var(--muted); line-height: 1.25; }
.tile-pts.static { position: static; }
.tile-pts.bad { background: var(--cherry); }
.tiles form { display: contents; }
.item .tile-emoji { flex-shrink: 0; }
.item .tile-pts { position: static; background: var(--mint); }

/* Historique */
.feed-full { max-height: none; }
.feed-filters a { text-decoration: none; }
.pager { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.ev form { display: contents; }
.ev-kid { text-decoration: none; }

/* Récompenses */
.reward-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; align-items: start; }
.reward-col { border-top: 10px solid var(--c); }
.reward-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.reward-head h2 { font-size: 28px; }
.reward-head span { color: var(--muted); font-size: 14px; }

/* Écran enfants */
.kid-nav a { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px 5px 5px; background: rgba(255,255,255,.6); }
.kid-nav a.on { background: var(--white); }
.kbig-row .kbig { transition: transform .25s var(--pop); }
.kbig-row a.kbig:hover { transform: translateY(-6px) rotate(-.8deg); }
.kid-page { display: grid; grid-template-columns: minmax(300px, 460px) minmax(0, 1fr); gap: 26px; align-items: start; margin-top: 10px; }
.kid-page .kbig .avatar { --size: 190px; margin-top: -120px; }
.kid-page .kbig-top { height: 170px; }
.kid-page .kbig-mood { top: 125px; right: calc(50% - 116px); }
.kid-page .moods span { font-size: 44px; }
.big-total {
  padding: 22px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--c); color: #fff;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 14px, transparent 14px 28px);
}
.big-total span { font-family: var(--display); font-weight: 600; font-size: 20px; }
.big-total b { font-family: var(--display); font-size: 72px; line-height: 1; -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.recent .ev-emoji { width: 32px; height: 32px; font-size: 16px; }
.rules-how { grid-column: 1 / -1; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.step { display: flex; align-items: center; gap: 12px; font-size: 16px; }
.step i { font-style: normal; flex-shrink: 0; width: 54px; height: 54px; display: grid; place-items: center; font-size: 28px; border: var(--border); border-radius: 16px; box-shadow: var(--sh-sm); }

@media (max-width: 1100px) {
  .dash-bottom { grid-template-columns: 1fr 1fr; }
  .dash-bottom > :first-child { grid-column: 1 / -1; }
  .child-layout { grid-template-columns: 1fr; }
  .child-hero { position: static; }
  .kid-page { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .dash-bottom, .two-col, .grid-3, .steps { grid-template-columns: 1fr; }
  .page-head .row { width: 100%; }
  .kid-nav .lbl { display: none; }
  .kid-nav a { padding: 4px; }
  .kid-page .kbig .avatar { --size: 150px; margin-top: -100px; }
  .kid-page .kbig-mood { top: 110px; right: calc(50% - 96px); }
}

/* Petits écrans : la barre du haut et la page enfant tiennent dans la largeur */
@media (max-width: 1100px) {
  .child-layout, .kid-page, .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .topbar { gap: 6px; padding-left: 10px; padding-right: 10px; }
  .logo-text { display: none; }
  .live { padding: 6px; }
  .live span { display: none; }
  .nav { gap: 2px; }
  .nav a { padding: 7px 8px; }
  .me { padding: 2px; }
  .wrap { padding-left: 12px; padding-right: 12px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .tile { min-height: 92px; padding: 10px; }
  .tile-label { font-size: 13px; padding-right: 0; }
  .kbig-row { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .hero-kid .track { padding: 0 14px; gap: 4px; }
  .hero-kid .slot { font-size: 14px; border-radius: 8px; }
}

/* ==========================================================================
   Fonctionnalités ludiques
   ========================================================================== */

/* ---------- Défi du jour ---------- */
.challenge {
  position: relative; display: flex; align-items: center; gap: 16px;
  padding: 14px 18px; margin-bottom: 22px; overflow: hidden;
  background: linear-gradient(100deg, #fff1bf 0%, #fff 60%);
}
.challenge::after {
  content: ''; position: absolute; right: -30px; top: -30px; width: 120px; height: 120px; border-radius: 50%;
  background: repeating-radial-gradient(circle, var(--cherry) 0 10px, #fff 10px 20px); opacity: .12;
}
.challenge-target {
  flex-shrink: 0; width: 58px; height: 58px; display: grid; place-items: center; font-size: 32px;
  background: var(--white); border: var(--border); border-radius: 50%; box-shadow: var(--sh-sm);
  animation: wiggle 2.4s ease-in-out infinite;
}
.challenge-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.challenge-kicker { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: #b36b00; }
.challenge-body b { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.2; }
.challenge-kids { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.challenge-kid {
  display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px 3px 3px;
  border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-size: 14px;
}
.challenge-kid.done { background: var(--good-bg); }
.challenge.done { background: linear-gradient(100deg, var(--good-bg) 0%, #fff 60%); }
.challenge.done .challenge-kicker { color: #0b7a4d; }

/* ---------- Bocal de la famille ---------- */
.jar-panel { display: flex; align-items: center; gap: 26px; padding: 18px 24px; margin-bottom: 26px; }
.jar-panel.reached { background: linear-gradient(100deg, #fff1bf, #fff); animation: glow 2s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 5px 5px 0 var(--ink), 0 0 0 6px rgba(255, 194, 26, .45); } }
.jar { position: relative; width: 110px; flex-shrink: 0; }
.jar-lid { width: 70%; height: 16px; margin: 0 auto -3px; background: var(--orange); border: var(--border); border-radius: 8px 8px 4px 4px; position: relative; z-index: 1; }
.jar-body {
  position: relative; height: 128px; overflow: hidden;
  border: var(--border); border-radius: 22px 22px 30px 30px; background: rgba(255, 255, 255, .7);
  box-shadow: inset 8px 0 0 rgba(255, 255, 255, .8);
}
.jar-fill {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--p);
  background: var(--sun); border-top: 3px solid var(--ink);
  background-image: radial-gradient(circle at 30% 30%, rgba(255,255,255,.5) 0 4px, transparent 5px), radial-gradient(circle at 70% 60%, rgba(255,255,255,.4) 0 3px, transparent 4px);
  background-size: 26px 26px, 34px 34px;
  display: flex; flex-wrap: wrap; align-content: flex-end; justify-content: center; gap: 0 2px; font-size: 15px;
  transition: height 1.2s var(--pop);
}
.jar-fill span { animation: bob 3s ease-in-out infinite; }
.jar-fill span:nth-child(2n) { animation-delay: -1.5s; }
.jar-count {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  font-family: var(--display); font-size: 28px; line-height: 1; color: var(--ink);
  text-shadow: 0 0 4px #fff, 0 0 4px #fff, 0 0 8px #fff;
}
.jar-count small { font-size: 14px; display: block; }
.jar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.jar-text h2 { font-size: 28px; }
.jar-text p { color: var(--ink-soft); }
.jar-text .chest-bar { width: 100%; max-width: 460px; }
.jar-win { font-family: var(--display); font-size: 20px; color: #b36b00 !important; animation: wiggle 1.5s infinite; }
.jar-empty {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 26px;
  border-style: dashed; box-shadow: none; text-decoration: none; font-size: 32px; color: var(--ink);
  transition: transform .2s var(--pop);
}
.jar-empty span { font-size: 14px; color: var(--muted); }
.jar-empty b { font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--ink); }
.jar-empty:hover { transform: translateY(-2px); background: var(--paper); }

/* ---------- Série 🔥 ---------- */
.streak {
  display: inline-flex; align-items: baseline; gap: 2px; padding: 3px 10px;
  border: 2px solid var(--ink); border-radius: 99px; background: #ffe2cc;
  font-family: var(--display); font-weight: 700; font-size: 14px; white-space: nowrap;
}
.streak small { font-size: 11px; }
.streak.hot { background: linear-gradient(90deg, #ff7a1a, #ffc21a); color: #fff; text-shadow: 1px 1px 0 var(--ink); animation: wiggle 2s infinite; }
.streak.cold { background: var(--white); opacity: .7; }

/* ---------- Compagnon ---------- */
.companion { display: flex; align-items: center; gap: 14px; text-align: left; }
.companion-pet {
  position: relative; flex-shrink: 0; width: 64px; height: 64px; display: grid; place-items: center;
  border: var(--border); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--c) 35%, #fff));
  box-shadow: var(--sh-sm);
}
.companion-pet span { font-size: 36px; line-height: 1; animation: petBob 2.6s ease-in-out infinite; display: inline-block; }
@keyframes petBob { 0%, 100% { transform: translateY(0) rotate(-4deg); } 50% { transform: translateY(-5px) rotate(4deg); } }
.companion.egg .companion-pet span { animation: eggShake 3s ease-in-out infinite; }
@keyframes eggShake { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-12deg); } 80% { transform: rotate(10deg); } 85% { transform: rotate(-6deg); } 90% { transform: rotate(4deg); } }
.companion.legend .companion-pet { background: radial-gradient(circle, #fff6c2, var(--sun)); box-shadow: var(--sh-sm), 0 0 0 5px rgba(255, 194, 26, .4); }
.companion.legend .companion-pet::after { content: '👑'; position: absolute; top: -18px; font-size: 22px; transform: rotate(-12deg); }
.companion-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.companion-info b { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.1; }
.companion-info small { font-size: 12px; color: var(--muted); }
.mini-bar { height: 10px; border: 2px solid var(--ink); border-radius: 99px; background: var(--white); overflow: hidden; max-width: 220px; }
.mini-bar i { display: block; height: 100%; background: var(--c); transition: width .8s var(--pop); }
.companion.lg .companion-pet { width: 110px; height: 110px; border-width: 4px; }
.companion.lg .companion-pet span { font-size: 64px; }
.companion.lg .companion-info b { font-size: 26px; }
.companion.lg .companion-info small { font-size: 14px; }
.kid-companion {
  position: absolute; top: 44px; left: calc(50% - 72px); z-index: 1;
  width: 38px; height: 38px; display: grid; place-items: center; font-size: 22px;
  background: var(--white); border: var(--border); border-radius: 50%;
  animation: petBob 2.6s ease-in-out infinite;
}
.hero-companion { margin: 0 16px; padding: 12px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); }
.kbig-companion .companion { justify-content: center; }
.kbig-row-info { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 0 16px 4px; }
.evolution { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 18px; padding: 12px; border: 2px dashed rgba(29,22,64,.25); border-radius: 16px; }
.evo-step { display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; flex: 1; opacity: .45; }
.evo-step span { font-size: 30px; filter: grayscale(1); }
.evo-step small { font-size: 11px; color: var(--muted); line-height: 1.1; }
.evo-step.reached { opacity: 1; }
.evo-step.reached span { filter: none; }
.evo-lvl { font-weight: 900; }
.evo-arrow { font-style: normal; color: var(--muted); font-size: 14px; }

/* ---------- Badges ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.badge-item {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; text-align: center;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--white);
}
.badge-item.on { background: linear-gradient(160deg, #fff6c2, #fff); box-shadow: var(--sh-sm); animation: popIn .5s var(--pop) both; animation-delay: calc(var(--i) * 40ms); }
.badge-item.off { border-style: dashed; opacity: .55; }
.badge-medal {
  width: 52px; height: 52px; display: grid; place-items: center; font-size: 28px;
  border: var(--border); border-radius: 50%; background: var(--sun);
}
.badge-item.off .badge-medal { background: #eee; font-size: 20px; }
.badge-item b { font-family: var(--display); font-weight: 600; font-size: 14px; line-height: 1.1; }
.badge-item small { font-size: 11px; color: var(--muted); line-height: 1.2; }
.badges.compact { display: flex; flex-wrap: wrap; gap: 6px; }
.badges.compact .badge-item { padding: 0; border: 0; background: none; box-shadow: none; }
.badges.compact .badge-medal { width: 36px; height: 36px; font-size: 19px; border-width: 2px; }
.hero-badges { margin: 0 16px; }

/* ---------- Mots doux ---------- */
.love-note { display: flex; align-items: flex-end; gap: 12px; padding: 16px; background: linear-gradient(120deg, #ffe3f1, #fff); }
.love-note.new { animation: drop .6s var(--pop), glow 2s 1s ease-in-out 3; }
.love-bubble {
  position: relative; flex: 1; padding: 12px 16px;
  background: var(--white); border: var(--border); border-radius: 20px 20px 20px 6px;
}
.love-sticker { position: absolute; top: -18px; right: -8px; font-size: 32px; transform: rotate(12deg); animation: wiggle 2s infinite; }
.love-bubble p { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.25; }
.love-bubble small { color: var(--muted); }
.love-form .field { margin-bottom: 10px; }
.love-send { display: flex; gap: 8px; }
.love-send input { flex: 1; min-width: 0; padding: 12px 14px; border: var(--border); border-radius: var(--r-sm); font-weight: 800; font-size: 16px; }
.love-list { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.love-mini { font-size: 14px; padding: 8px 12px; border-radius: 12px; background: #fff0f7; border: 2px solid var(--ink); }
.love-mini small { color: var(--muted); }
.sticker-choice { display: flex; flex-wrap: wrap; gap: 6px; }
.sticker-choice input { position: absolute; opacity: 0; }
.sticker-choice span {
  display: grid; place-items: center; width: 44px; height: 44px; font-size: 24px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 12px; background: var(--white); transition: transform .15s var(--pop);
}
.sticker-choice span:hover { transform: scale(1.1) rotate(-6deg); }
.sticker-choice input:checked + span { background: #ffd1e8; box-shadow: var(--sh-sm); transform: translate(-2px, -2px) scale(1.08); }

/* ---------- Choix du compagnon ---------- */
.companion-choice { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.companion-choice input { position: absolute; opacity: 0; }
.companion-choice span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; cursor: pointer;
  border: 2px solid var(--ink); border-radius: 14px; background: var(--white);
  font-family: var(--display); font-weight: 600; font-size: 14px; transition: transform .15s var(--pop);
}
.companion-choice span i { font-style: normal; font-size: 34px; }
.companion-choice span:hover { transform: translateY(-2px); }
.companion-choice input:checked + span { background: var(--sun); box-shadow: var(--sh-sm); transform: translate(-2px, -2px); }

/* ---------- Tuile "défi du jour" ---------- */
.tile.is-challenge { background: linear-gradient(160deg, #fff1bf, #fff); border-width: 4px; }
.tile-ribbon {
  position: absolute; left: -6px; bottom: -10px; z-index: 1;
  padding: 2px 8px; background: var(--cherry); color: #fff; border: 2px solid var(--ink); border-radius: 8px;
  font-family: var(--display); font-weight: 600; font-size: 12px; transform: rotate(-3deg);
}
.tile.challenge-done .tile-ribbon { background: var(--mint); }
.tile.pressed { transform: translate(3px, 3px) scale(.96); box-shadow: 0 0 0 var(--ink); }

/* ---------- Petites fenêtres (nouveau badge, mot doux) ---------- */
.popup {
  position: fixed; left: 50%; bottom: 24px; z-index: 88; translate: -50% 0;
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; max-width: calc(100% - 32px);
  background: var(--white); border-color: var(--ink); animation: popUp .6s var(--pop);
}
.popup.out { animation: toastOut .4s ease forwards; }
@keyframes popUp { from { transform: translateY(80px) scale(.6) rotate(-6deg); opacity: 0; } }
.popup-emoji { font-size: 46px; animation: wiggle 1s ease-in-out infinite; }
.popup b { display: block; font-family: var(--display); font-size: 20px; }
.popup small { color: var(--muted); font-size: 14px; }

/* ---------- Bouton son ---------- */
.sound-btn { width: 40px; height: 40px; display: grid; place-items: center; font-size: 19px; border: var(--border); border-radius: 12px; background: var(--white); box-shadow: 2px 2px 0 var(--ink); }
.sound-btn:active { transform: translate(2px, 2px); box-shadow: none; }

.sub-title { font-size: 20px; margin: 22px 0 6px; }
.t-prize { font-size: 13px; font-weight: 800; color: var(--ink-soft); }

@media (max-width: 720px) {
  .challenge { flex-wrap: wrap; padding: 12px; gap: 10px; }
  .challenge-target { width: 44px; height: 44px; font-size: 24px; }
  .challenge-body b { font-size: 16px; }
  .challenge-kids { width: 100%; }
  .jar-panel { flex-direction: column; text-align: center; gap: 12px; padding: 16px; }
  .jar-text { align-items: center; }
  .jar-text h2 { font-size: 22px; }
  .kid-companion { top: 24px; left: calc(50% - 50px); width: 26px; height: 26px; font-size: 15px; border-width: 2px; }
  .companion.lg .companion-pet { width: 80px; height: 80px; }
  .companion.lg .companion-pet span { font-size: 46px; }
  .evo-step span { font-size: 22px; }
  .badges { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
}

/* ---------- Roue du jour ---------- */
.wheel-card {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; text-decoration: none; color: inherit;
  background: var(--white);
}
.wheel-card-icon { flex-shrink: 0; width: 54px; height: 54px; display: grid; place-items: center; font-size: 30px; border: var(--border); border-radius: 50%; background: var(--paper); }
.wheel-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.wheel-card-kicker { font-size: 12px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.wheel-card-body b { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.2; }
.wheel-card-body small { font-size: 13px; color: var(--muted); }
.wheel-card.state-ready { background: linear-gradient(110deg, #ffd1e8, #fff 70%); animation: glow 1.6s ease-in-out infinite; }
.wheel-card.state-ready .wheel-card-icon { background: var(--pink); animation: spin 4s linear infinite; }
.wheel-card.state-done { background: linear-gradient(110deg, var(--good-bg), #fff 70%); }
.wheel-card.state-lost { background: linear-gradient(110deg, #e8ecf5, #fff 70%); }
.wheel-card.state-waiting { background: linear-gradient(110deg, #fff1bf, #fff 70%); }
.wheel-go { font-size: 18px; animation: wiggle 1.4s ease-in-out infinite; }
.hero-wheel { margin: 0 16px; }
.hero-wheel .wheel-card { box-shadow: none; border-width: 2px; padding: 10px 12px; }
.hero-wheel .wheel-card-icon { width: 42px; height: 42px; font-size: 22px; }
.hero-wheel .wheel-card-body b { font-size: 15px; }

.wheel-page { display: flex; flex-direction: column; align-items: center; gap: 18px; max-width: 640px; margin: 0 auto; }
.wheel-page > .btn:first-child { align-self: flex-start; }
.wheel-head { display: flex; align-items: center; gap: 14px; }
.wheel-head h1 { font-size: clamp(30px, 6vw, 48px); margin-top: 6px; }
.wheel-stage { width: min(460px, 92vw); }
.wheel { position: relative; filter: drop-shadow(8px 8px 0 var(--ink)); }
.wheel-svg { width: 100%; height: auto; display: block; }
.wheel-svg text { font-family: var(--body); }
.wheel-pointer {
  position: absolute; left: 50%; top: -14px; z-index: 2; translate: -50% 0;
  font-size: 44px; line-height: 1; color: var(--cherry); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill;
  transform-origin: 50% 20%;
}
.wheel-pointer.tick { animation: pointerTick .12s ease-out; }
@keyframes pointerTick { 50% { transform: rotate(-18deg); } }
.wheel-bulb { animation: bulb 1s steps(2) infinite; }
@keyframes bulb { 50% { fill: #ffc21a; } }
.btn-giant { font-size: clamp(22px, 4vw, 30px); padding: 20px 34px; border-radius: 22px; box-shadow: 6px 6px 0 var(--ink); animation: wiggle 1.6s ease-in-out infinite; }
.prize { display: flex; align-items: center; gap: 18px; padding: 20px 24px; width: 100%; background: linear-gradient(120deg, #fff1bf, #fff); }
.prize[data-hidden-until-spin] { opacity: 0; transform: scale(.4); }
.prize.revealed { animation: celIn .7s var(--pop); }
.prize-emoji { font-size: 70px; line-height: 1; animation: wiggle 1.2s ease-in-out infinite; }
.prize small { font-size: 14px; color: var(--muted); font-weight: 800; }
.prize h2 { font-size: clamp(26px, 5vw, 38px); }
.prize p { color: var(--ink-soft); margin-top: 6px; }
.wheel-locked { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px; text-align: center; width: 100%; }
.wheel-locked span { font-size: 54px; }
.wheel-locked p { font-family: var(--display); font-weight: 600; font-size: 22px; }
.wheel-locked small { color: var(--muted); }
.wheel-preview { width: min(280px, 70vw); margin: 0 auto 20px; }

/* Prestige du compagnon légendaire : l'aura grandit */
.companion.legend[data-prestige="1"] .companion-pet { box-shadow: var(--sh-sm), 0 0 0 6px rgba(255, 194, 26, .5), 0 0 22px 6px rgba(255, 194, 26, .5); }
.companion.legend[data-prestige="2"] .companion-pet { box-shadow: var(--sh-sm), 0 0 0 6px rgba(255, 79, 163, .45), 0 0 26px 10px rgba(255, 194, 26, .6); }
.companion.legend[data-prestige="3"] .companion-pet { box-shadow: var(--sh-sm), 0 0 0 6px rgba(124, 77, 255, .5), 0 0 32px 14px rgba(255, 79, 163, .55); animation: glow 2s infinite; }

/* ---------- Anniversaires & fêtes ---------- */
.party-list { display: flex; flex-direction: column; gap: 8px; }
.party-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); }
.party-item.today { background: linear-gradient(100deg, #ffd1e8, #fff); animation: glow 2s infinite; }
.party-emoji { font-size: 24px; }
.party-body { flex: 1; min-width: 0; }
.party-body b { display: block; font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.2; }
.party-body small { color: var(--muted); font-size: 12px; }
.party-count { flex-shrink: 0; padding: 3px 10px; border: 2px solid var(--ink); border-radius: 99px; background: var(--sun); font-family: var(--display); font-weight: 700; font-size: 14px; }
.party-banner {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 18px; padding: 18px 22px; margin-bottom: 22px;
  background: var(--c); color: #fff;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px);
}
.party-banner h2 { font-size: clamp(24px, 4vw, 36px); -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.party-banner p { font-weight: 800; margin-top: 4px; text-shadow: 1px 1px 0 var(--ink); }
.balloons { position: absolute; right: 16px; top: 0; bottom: 0; display: flex; gap: 6px; align-items: center; font-size: 40px; pointer-events: none; }
.balloons span { animation: bob 3s ease-in-out infinite; }
.balloons span:nth-child(2) { animation-delay: -1s; filter: hue-rotate(120deg); }
.balloons span:nth-child(3) { animation-delay: -2s; filter: hue-rotate(240deg); }
.party-hat { position: absolute; top: 20px; left: calc(50% - 30px); z-index: 3; font-size: 44px; transform: rotate(-18deg); animation: wiggle 1.8s infinite; }

/* ---------- Blague du jour ---------- */
.fun-row { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 30px; align-items: start; }
.joke { background: linear-gradient(160deg, #fff6c2, #fff 60%); display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.joke-head { display: flex; align-items: center; gap: 10px; }
.joke-face { font-size: 38px; animation: wiggle 2s ease-in-out infinite; }
.joke-q { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.25; }
.joke-a { width: 100%; }
.joke-a summary {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 10px 16px; border: var(--border); border-radius: 14px; background: var(--white); box-shadow: var(--sh-sm);
  font-family: var(--display); font-weight: 600; font-size: 17px;
}
.joke-a summary::-webkit-details-marker { display: none; }
.joke-a[open] summary { display: none; }
.joke-a p {
  padding: 14px 18px; border: var(--border); border-radius: 18px 18px 18px 4px; background: var(--sun);
  font-family: var(--display); font-weight: 700; font-size: 22px; animation: celIn .5s var(--pop);
}
.jokes-page { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 22px; }
.joke-big .joke-q { font-size: clamp(26px, 5vw, 38px); }
.joke-big .joke-a p { font-size: clamp(24px, 4vw, 32px); }

@media (max-width: 720px) {
  .fun-row { grid-template-columns: 1fr; }
  .balloons { display: none; }
  .party-banner { padding: 14px; }
}

/* Défis du jour (un par enfant) */
.challenge-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; position: relative; z-index: 1; }
.challenge-list .challenge-kid { gap: 6px; padding: 4px 10px 4px 4px; }
.challenge-list .challenge-kid b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.challenge-list .challenge-kid i { font-style: normal; }
.chip .avatar.xs { margin-left: -2px; }
.kid-dots { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.kid-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.kid-checks input { position: absolute; opacity: 0; }
.kid-checks span { display: inline-block; padding: 8px 14px; border: 2px solid var(--ink); border-radius: 99px; background: var(--white); font-family: var(--display); font-weight: 600; cursor: pointer; transition: transform .15s var(--pop); }
.kid-checks input:checked + span { background: var(--sun); box-shadow: var(--sh-sm); transform: translate(-2px, -2px); }
.kid-checks input:focus-visible + span { outline: 3px dashed var(--grape); outline-offset: 3px; }
.party-banner { padding-right: 170px; }
.wheel-card .btn { flex-shrink: 0; }
@media (max-width: 720px) { .party-banner { padding-right: 14px; } }
.party-banner h2 { font-size: clamp(22px, 3vw, 32px); }
fieldset.field { border: 0; padding: 0; margin-inline: 0; min-width: 0; }

/* ==========================================================================
   Ergonomie v2 : rangées de même hauteur, espace enfants façon jeu vidéo
   ========================================================================== */

/* ---------- Règle générale : dans une rangée, toutes les colonnes ont la même hauteur ---------- */
.row-2, .row-3, .row-auto, .tile-row, .home-grid, .two-col, .reward-cols, .actions-grid, .fun-row, .rules,
.set-grid, .card-grid, .kids-row, .select-grid, .stat-row, .steps-row, .notes-grid, .dash-bottom {
  align-items: stretch !important;
}
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-bottom: 24px; }
.row-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; margin-bottom: 24px; }
.row-auto, .tile-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; margin-bottom: 24px; }
.row-auto:empty { display: none; }
/* Les blocs d'une rangée remplissent la hauteur ; leur bouton final se cale en bas. */
:is(.row-2, .row-3, .row-auto, .tile-row, .home-grid, .two-col, .reward-cols, .stat-row, .steps-row, .notes-grid) > :is(.sticker, .panel, section, .home-tile) {
  display: flex; flex-direction: column; min-width: 0;
}
:is(.row-2, .row-3, .row-auto, .tile-row, .two-col, .reward-cols) > .panel > .btn-block:last-child,
:is(.row-2, .row-3, .row-auto, .tile-row, .two-col, .reward-cols) > .panel > a.btn:last-child { margin-top: auto; }
.row-3 .feed { flex: 1; max-height: 440px; }
.kids-row > .kid { display: flex; flex-direction: column; }
.kids-row > .kid .kid-chips { margin-top: auto; padding-top: 12px; }
.joke > .btn:last-child { margin-top: auto; }

/* ---------- Page d'un enfant (parents) : bandeau en tête ---------- */
.child-banner {
  display: grid; grid-template-columns: auto minmax(0, 1.3fr) minmax(0, 1fr) 220px; gap: 22px; align-items: center;
  padding: 18px 22px; margin-bottom: 24px; position: relative; overflow: hidden;
  border-top: 10px solid var(--c);
}
.child-banner.neg { border-top-color: var(--cherry); }
.cb-id { display: flex; align-items: center; gap: 16px; position: relative; }
.cb-id .kid-mood { top: auto; bottom: -4px; left: 80px; right: auto; }
.cb-id h1 { font-size: 32px; }
.cb-id .kid-pts { justify-content: flex-start; margin: 2px 0 0; }
.cb-id .kid-pts b { font-size: 50px; }
.cb-track .track-note { padding: 0; margin: 8px 0; }
.cb-track .kid-chips { justify-content: flex-start; padding: 0; margin: 0; }
.cb-side { display: flex; flex-direction: column; gap: 10px; }
.cb-side .wheel-card { box-shadow: none; border-width: 2px; padding: 10px 12px; }
.cb-side .wheel-card-icon { width: 40px; height: 40px; font-size: 22px; }
.cb-side .wheel-card-body b { font-size: 15px; }
.cb-actions { display: flex; flex-direction: column; gap: 10px; }
.love-form input[type=text] { width: 100%; padding: 12px 14px; border: var(--border); border-radius: var(--r-sm); font-weight: 800; font-size: 16px; }

/* ---------- Espace enfants : « Qui joue ? » ---------- */
.kids-page .live { display: none; }
.select-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 26px; margin: 26px 0 30px; }
.select-card {
  position: relative; display: flex; flex-direction: column; text-decoration: none; color: inherit; overflow: hidden;
  background: var(--white); border: 4px solid var(--ink); border-radius: 30px; box-shadow: var(--sh-lg);
  transition: transform .25s var(--pop), box-shadow .25s;
}
.select-card:hover { transform: translateY(-8px) rotate(-1deg); box-shadow: 12px 14px 0 var(--ink); }
.select-card:active { transform: translate(4px, 4px); box-shadow: 2px 2px 0 var(--ink); }
.select-top {
  position: relative; display: flex; justify-content: center; padding: 26px 16px 18px;
  background-color: var(--c); border-bottom: 4px solid var(--ink);
  background-image: radial-gradient(circle at 15% 25%, rgba(255,255,255,.35) 0 7px, transparent 8px), radial-gradient(circle at 85% 70%, rgba(255,255,255,.3) 0 10px, transparent 11px), repeating-linear-gradient(-45deg, rgba(255,255,255,.18) 0 14px, transparent 14px 28px);
}
.select-top .avatar { box-shadow: var(--sh); animation: breathe 4s ease-in-out infinite; }
.select-pet {
  position: absolute; left: calc(50% + 40px); bottom: 10px; width: 58px; height: 58px; display: grid; place-items: center; font-size: 34px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 50%; box-shadow: var(--sh-sm); animation: petBob 2.6s ease-in-out infinite;
}
.notifs { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; flex-wrap: wrap; gap: 6px; }
.notif { padding: 4px 10px; background: var(--white); border: 2px solid var(--ink); border-radius: 99px; font-family: var(--display); font-weight: 600; font-size: 13px; box-shadow: 2px 2px 0 var(--ink); }
.notif.pulse { background: var(--sun); animation: wiggle 1.4s ease-in-out infinite; }
.select-body { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 18px 12px; text-align: center; }
.select-body h2 { font-size: 34px; }
.select-score { display: flex; align-items: center; gap: 6px; }
.select-score b { font-family: var(--display); font-size: 72px; line-height: .9; color: var(--c); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; text-shadow: 4px 4px 0 var(--ink); }
.select-card.neg .select-score b { color: var(--cherry); }
.select-score span { font-size: 42px; }
.select-body .track { width: 100%; }
.select-stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: auto; padding-top: 6px; }
.select-go {
  display: block; margin: 0 18px 18px; padding: 12px; text-align: center;
  background: var(--c); color: #fff; border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--sh-sm);
  font-family: var(--display); font-weight: 700; font-size: 20px; text-shadow: 2px 2px 0 var(--ink);
}
.center-row { display: flex; justify-content: center; margin: 10px 0 30px; }
.goal-tile { gap: 10px; background: linear-gradient(160deg, #fff6c2, #fff 60%); }
.goal-tile-body { display: flex; align-items: center; gap: 18px; flex: 1; }
.goal-tile h3 { font-size: 22px; }
.goal-tile p { color: var(--ink-soft); margin-top: 4px; }
.jar.small { width: 84px; }
.jar.small .jar-body { height: 96px; }
.jar.small .jar-count { font-size: 22px; }

/* Règles */
.steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 18px; }
.step-card { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 16px; text-align: center; }
.step-card i { font-style: normal; width: 70px; height: 70px; display: grid; place-items: center; font-size: 38px; background: var(--c); border: var(--border); border-radius: 22px; box-shadow: var(--sh-sm); transform: rotate(-5deg); }
.step-card b { font-family: var(--display); font-size: 24px; }
.step-card span { color: var(--ink-soft); }

/* ---------- Espace enfants : « Mon espace » ---------- */
.me-hero {
  display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 360px); gap: 26px; align-items: center;
  padding: 22px 26px; border-width: 4px; border-top: 12px solid var(--c); border-radius: 30px; box-shadow: var(--sh-lg);
  background: linear-gradient(120deg, color-mix(in srgb, var(--c) 14%, #fff), #fff 55%);
}
.me-hero.neg { border-top-color: var(--cherry); }
.me-av { position: relative; }
.me-av .avatar { box-shadow: var(--sh); }
.me-mood { position: absolute; right: -6px; bottom: 4px; width: 56px; height: 56px; display: grid; place-items: center; font-size: 32px; background: var(--white); border: 3px solid var(--ink); border-radius: 50%; }
.me-av .party-hat { top: -26px; left: 30px; }
.me-main h1 { font-size: clamp(34px, 5vw, 54px); }
.me-score { display: flex; align-items: baseline; gap: 8px; margin: 4px 0 10px; }
.me-score b { font-family: var(--display); font-size: 84px; line-height: .9; color: var(--c); -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; text-shadow: 5px 5px 0 var(--ink); }
.me-hero.neg .me-score b { color: var(--cherry); }
.me-score span { font-size: 50px; }
.me-score small { font-family: var(--display); font-size: 24px; color: var(--muted); }
.me-main .track .slot { border-radius: 10px; font-size: 20px; }
.me-msg { display: inline-block; margin-top: 12px; padding: 8px 16px; background: var(--white); border: 3px solid var(--ink); border-radius: 99px; font-family: var(--display); font-weight: 600; font-size: 18px; }
.me-pet { text-decoration: none; color: inherit; padding: 14px; border: 3px solid var(--ink); border-radius: 22px; background: var(--white); box-shadow: var(--sh-sm); transition: transform .2s var(--pop); }
.me-pet:hover { transform: translateY(-3px) rotate(1deg); }

/* Menu de gros boutons */
.me-menu { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.me-tab {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 6px 12px;
  background: var(--white); border: 3px solid var(--ink); border-radius: 20px; box-shadow: var(--sh-sm);
  text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 16px; transition: transform .15s var(--pop), box-shadow .15s;
}
.me-tab i { font-style: normal; font-size: 36px; line-height: 1; transition: transform .2s var(--pop); }
.me-tab:hover { transform: translateY(-3px); box-shadow: 5px 5px 0 var(--ink); }
.me-tab:hover i { transform: scale(1.15) rotate(-8deg); }
.me-tab:active { transform: translate(3px, 3px); box-shadow: none; }
.me-tab.on { background: var(--c); color: #fff; text-shadow: 1px 1px 0 var(--ink); transform: translateY(-3px); box-shadow: 5px 5px 0 var(--ink); }
.me-tab em {
  position: absolute; top: -10px; right: -8px; min-width: 28px; height: 28px; padding: 0 6px; display: grid; place-items: center;
  background: var(--sun); color: var(--ink); text-shadow: none; border: 2px solid var(--ink); border-radius: 99px; font-style: normal; font-size: 14px;
}
.me-tab em.alert { background: var(--cherry); color: #fff; animation: wiggle 1.2s ease-in-out infinite; }

/* Accueil de mon espace : tuiles de même hauteur */
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 22px; }
.home-tile { min-width: 0; }
.home-tile > .sticker { flex: 1; margin: 0; }
.home-tile .wheel-card { flex-direction: column; text-align: center; justify-content: center; padding: 22px; }
.home-tile .wheel-card-icon { width: 80px; height: 80px; font-size: 44px; }
.home-tile .wheel-card-body b { font-size: 22px; }
.home-tile .challenge { flex-direction: column; text-align: center; justify-content: center; padding: 22px; }
.home-tile .challenge-target { width: 80px; height: 80px; font-size: 44px; }
.home-tile .challenge-body b { font-size: 22px; }
.tile-link { display: flex; flex-direction: column; gap: 8px; padding: 18px; text-decoration: none; color: inherit; transition: transform .2s var(--pop); }
.tile-link:hover { transform: translateY(-4px) rotate(-.5deg); }
.tile-kicker { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
.tile-quote { font-family: var(--display); font-weight: 600; font-size: 22px; line-height: 1.25; }
.tile-empty { font-family: var(--display); font-size: 20px; color: var(--muted); margin: auto 0; }
.next-badges { display: flex; flex-direction: column; gap: 10px; }
.next-badge { display: flex; align-items: center; gap: 10px; }
.next-badge > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-badge b { font-family: var(--display); font-weight: 600; font-size: 15px; }
.next-badge small { font-size: 12px; color: var(--muted); line-height: 1.2; }

/* ---------- Badges (rareté, verrou, progression) ---------- */
.badges { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.badge-item { gap: 5px; padding: 14px 10px 12px; justify-content: flex-start; }
.badge-item.off { border-style: solid; border-color: rgba(29,22,64,.35); background: #fbfaf7; opacity: 1; }
.badge-item.off .badge-medal span { filter: grayscale(1); opacity: .45; }
.badge-item.off b { color: var(--ink-soft); }
.badge-medal { position: relative; width: 58px; height: 58px; display: grid; place-items: center; font-size: 30px; border: var(--border); border-radius: 50%; background: var(--sun); flex-shrink: 0; }
.badge-medal.tier-0, .tier-0 .badge-medal { background: radial-gradient(circle at 35% 30%, #ffe0c2, #e0935a); }
.badge-medal.tier-1, .tier-1 .badge-medal { background: radial-gradient(circle at 35% 30%, #ffffff, #b9c1cf); }
.badge-medal.tier-2, .tier-2 .badge-medal { background: radial-gradient(circle at 35% 30%, #fff6c2, #ffc21a); }
.badge-medal.tier-3, .tier-3 .badge-medal { background: radial-gradient(circle at 35% 30%, #e6fbff, #52d5f2); }
.badge-medal.tier-4, .tier-4 .badge-medal { background: conic-gradient(#ff4fa3, #ffc21a, #16c47f, #10b4e6, #7c4dff, #ff4fa3); }
.badge-item.on.tier-4 { box-shadow: var(--sh-sm), 0 0 0 4px rgba(124, 77, 255, .25); }
.badge-lock { position: absolute; right: -6px; bottom: -6px; font-style: normal; font-size: 16px; width: 26px; height: 26px; display: grid; place-items: center; background: var(--white); border: 2px solid var(--ink); border-radius: 50%; }
.badge-item small { min-height: 2.4em; }
.badge-done { margin-top: auto; font-size: 11px; font-weight: 900; color: #0b7a4d; text-transform: uppercase; letter-spacing: .4px; }
.badge-bar { position: relative; display: block; width: 100%; height: 16px; margin-top: auto; background: var(--white); border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.badge-bar i { position: absolute; inset: 0 auto 0 0; background: var(--mint); }
.badge-bar em { position: absolute; inset: 0; display: grid; place-items: center; font-style: normal; font-size: 10px; font-weight: 900; text-shadow: 0 0 3px #fff, 0 0 3px #fff; }
.badges.compact .badge-medal { width: 38px; height: 38px; font-size: 20px; border-width: 2px; }
.badge-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.badge-summary > div:first-child { flex: 1; min-width: 240px; }
.badge-summary h2 { font-size: 40px; margin-bottom: 10px; }
.badge-summary h2 small { font-size: 20px; color: var(--muted); }
.tier-legend { display: grid; grid-template-columns: repeat(5, auto); gap: 4px 12px; justify-items: center; }
.tier-legend .badge-medal { width: 44px; height: 44px; font-size: 22px; }
.tier-legend small { grid-row: 2; font-family: var(--display); font-weight: 700; }
.badge-cat { margin-top: 16px; padding: 0; overflow: hidden; }
.badge-cat summary { display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; list-style: none; }
.badge-cat summary::-webkit-details-marker { display: none; }
.badge-cat summary b { font-family: var(--display); font-weight: 600; font-size: 20px; }
.badge-cat summary::after { content: '▾'; margin-left: 4px; font-size: 20px; transition: transform .2s; }
.badge-cat[open] summary::after { transform: rotate(180deg); }
.badge-cat .bubble { width: 38px; height: 38px; display: grid; place-items: center; font-size: 20px; border: var(--border); border-radius: 12px; background: var(--sun); }
.cat-bar { flex: 1; max-width: 220px; margin: 0 0 0 auto; height: 12px; }
.badge-cat > .badges { padding: 4px 18px 18px; }

/* ---------- Compagnon, trophées, semaine, messages ---------- */
.companion-stage { align-items: center; text-align: center; gap: 10px; background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--c) 25%, #fff), #fff 70%); }
.stage-pet { width: 190px; height: 190px; display: grid; place-items: center; margin: 10px auto; border: 5px solid var(--ink); border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, color-mix(in srgb, var(--c) 40%, #fff)); box-shadow: var(--sh); }
.stage-pet span { font-size: 110px; line-height: 1; animation: petBob 2.6s ease-in-out infinite; }
.companion-stage.legend .stage-pet { background: radial-gradient(circle, #fff6c2, var(--sun)); }
.companion-stage h2 { font-size: 36px; }
.stage-name { color: var(--ink-soft); font-weight: 800; }
.companion-stage .chest-bar { width: 100%; margin-top: auto; }
.evo-list { display: flex; flex-direction: column; gap: 8px; }
.evo-row { display: grid; grid-template-columns: 52px 1fr auto; grid-template-rows: auto auto; align-items: center; gap: 0 12px; padding: 8px 12px; border: 2px dashed rgba(29,22,64,.25); border-radius: 16px; opacity: .6; }
.evo-row.reached { opacity: 1; border: 2px solid var(--ink); background: var(--paper); }
.evo-emoji { grid-row: span 2; font-size: 36px; text-align: center; }
.evo-row b { font-family: var(--display); font-weight: 600; font-size: 18px; }
.evo-row small { grid-column: 2; color: var(--muted); font-size: 12px; }
.evo-row > span:last-child { grid-row: 1 / span 2; grid-column: 3; font-size: 20px; }
.shelf.big { gap: 10px; }
.shelf.big .trophy { position: relative; font-size: 46px; }
.shelf.big .trophy small { position: absolute; left: 50%; bottom: 2px; translate: -50% 0; font-family: var(--display); font-size: 12px; color: var(--ink); text-shadow: 0 0 3px #fff; }
.shelf-note { margin-top: auto; padding-top: 12px; font-family: var(--display); font-weight: 600; color: #b36b00; }
.treasure-box { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; }
.treasure-chest { font-size: 90px; animation: wiggle 3s ease-in-out infinite; }
.treasure-chest.open { animation: wiggle .8s ease-in-out infinite; }
.treasure-box .chest-bar { width: 100%; }
.treasure-box p { font-family: var(--display); font-weight: 600; font-size: 18px; }
.tickets.two-cols { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.stat-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 18px 10px; text-align: center; }
.stat-tile i { font-style: normal; font-size: 34px; }
.stat-tile b { font-family: var(--display); font-size: 44px; line-height: 1; }
.stat-tile span { font-size: 13px; color: var(--muted); font-weight: 800; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }

/* ---------- Barre de navigation en bas de l'écran (téléphone) ---------- */
@media (max-width: 720px) {
  body { padding-bottom: 86px; }
  /* Parents : le menu passe en bas, comme une appli */
  .topbar .nav:not(.kid-nav) {
    position: fixed; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); z-index: 40;
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 6px;
    background: var(--white); border: var(--border); border-radius: 22px; box-shadow: var(--sh);
  }
  .topbar .nav:not(.kid-nav) a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px; font-size: 22px; }
  .topbar .nav:not(.kid-nav) a .lbl { display: block; font-size: 11px; }
  /* Enfants : le menu de "mon espace" devient la barre du bas */
  .me-menu {
    position: fixed; left: 6px; right: 6px; bottom: max(6px, env(safe-area-inset-bottom)); z-index: 40; margin: 0;
    grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; padding: 6px;
    background: var(--white); border: var(--border); border-radius: 22px; box-shadow: var(--sh);
  }
  .me-tab { padding: 6px 0 4px; border-width: 2px; border-radius: 14px; box-shadow: none; font-size: 10px; }
  .me-tab i { font-size: 24px; }
  .me-tab.on { transform: none; box-shadow: none; }
  .me-tab em { top: -8px; right: -4px; min-width: 20px; height: 20px; font-size: 11px; }
  .row-2, .row-3, .stat-row { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .child-banner { grid-template-columns: 1fr; padding: 14px; }
  .me-hero { grid-template-columns: 1fr; text-align: center; padding: 16px; gap: 14px; }
  .me-av { justify-self: center; }
  .me-score { justify-content: center; }
  .me-score b { font-size: 64px; }
  .me-pet .companion { justify-content: center; }
  .select-score b { font-size: 60px; }
  .notes-grid { grid-template-columns: 1fr; }
  .badges { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (min-width: 721px) and (max-width: 1100px) {
  .row-3 { grid-template-columns: 1fr 1fr; }
  .child-banner { grid-template-columns: auto 1fr; }
  .me-hero { grid-template-columns: auto 1fr; }
  .me-pet { grid-column: 1 / -1; }
  .me-menu { grid-template-columns: repeat(4, 1fr); }
}
.sticker > .tag, .panel > .tag, .joke-head { align-self: flex-start; }

/* ==========================================================================
   Mode tout-petit : gros, visuel, presque sans texte
   ========================================================================== */
.is-simple .me-hero { grid-template-columns: auto 1fr; }
.is-simple .me-hero .me-pet, .is-simple .me-hero .track, .is-simple .me-msg { display: none; }
.is-simple .me-menu { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.is-simple .me-tab { padding: 18px 6px 14px; font-size: 20px; }
.is-simple .me-tab i { font-size: 52px; }

.tiny { display: grid; grid-template-columns: 1.3fr 1fr; gap: 24px; align-items: stretch; }
.tiny-stars { grid-column: 1 / -1; display: flex; align-items: center; gap: 18px; padding: 22px; flex-wrap: wrap; background: linear-gradient(120deg, #fff6c2, #fff 70%); }
.tiny-sky { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.tiny-star {
  width: clamp(54px, 8vw, 84px); aspect-ratio: 1; display: grid; place-items: center; font-size: clamp(36px, 5.5vw, 60px);
  border: 4px dashed rgba(29,22,64,.25); border-radius: 22px; background: var(--white);
}
.tiny-star.on { border: 4px solid var(--ink); background: var(--sun); box-shadow: var(--sh-sm); animation: popIn .6s var(--pop) both; animation-delay: calc(var(--i) * 90ms); }
.tiny-star.on:nth-child(odd) { transform: rotate(-6deg); }
.tiny-star.on:nth-child(even) { transform: rotate(5deg); }
.tiny-star.cloud { border: 4px solid var(--ink); background: #e8ecf5; }
.tiny-gift { font-size: clamp(50px, 8vw, 80px); margin-left: 6px; filter: drop-shadow(3px 3px 0 var(--ink)); }
.tiny-gift.close { animation: wiggle .9s ease-in-out infinite; }

.speak-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 14px 22px;
  background: var(--sky); color: #fff; border: var(--border); border-radius: 20px; box-shadow: var(--sh-sm);
  font-family: var(--display); font-weight: 700; font-size: 22px; text-shadow: 1px 1px 0 var(--ink);
  transition: transform .12s var(--pop);
}
.speak-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.speak-btn.speaking { animation: wiggle .5s ease-in-out 3; background: var(--pink); }
.speak-btn.small { padding: 8px 14px; font-size: 16px; margin-top: 8px; align-self: flex-start; }

.tiny-pet {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 280px;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--c) 30%, #fff), #fff 70%);
  cursor: pointer;
}
.tiny-pet-emoji { font-size: clamp(120px, 16vw, 190px); line-height: 1; animation: petBob 2.6s ease-in-out infinite; }
.tiny-pet.jump .tiny-pet-emoji { animation: petJump .7s var(--pop); }
@keyframes petJump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-60px) scale(1.15) rotate(-12deg); } 60% { transform: translateY(0) scale(.92, 1.08); } 100% { transform: none; } }
.tiny-pet-hint { font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--ink-soft); }

.tiny-buttons { display: grid; grid-template-columns: 1fr; gap: 14px; }
.tiny-btn {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; text-decoration: none; color: inherit;
  transition: transform .15s var(--pop);
}
a.tiny-btn:hover { transform: translateY(-3px) rotate(-1deg); }
a.tiny-btn:active { transform: translate(3px, 3px); box-shadow: none; }
.tiny-btn-img { font-size: 58px; line-height: 1; }
.tiny-btn-label { font-family: var(--display); font-weight: 700; font-size: 26px; }
.tiny-trophies { font-size: 38px; letter-spacing: -6px; }
.tiny-btn.state-ready { background: linear-gradient(110deg, #ffd1e8, #fff 70%); animation: glow 1.6s ease-in-out infinite; }
.tiny-btn.state-ready .tiny-btn-img { animation: spin 3s linear infinite; }
.tiny-btn.state-locked, .tiny-btn.state-lost, .tiny-btn.state-waiting { opacity: .75; }
.tiny-btn.glow { background: linear-gradient(110deg, #ffe3f1, #fff 70%); animation: glow 1.6s ease-in-out infinite; }

.tiny-challenge { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: linear-gradient(110deg, #fff1bf, #fff 70%); }
.tiny-challenge.done { background: linear-gradient(110deg, var(--good-bg), #fff 70%); }
.tiny-challenge-img { font-size: 56px; }
.tiny-challenge b { flex: 1; font-family: var(--display); font-weight: 600; font-size: 24px; }

@media (max-width: 720px) {
  .tiny { grid-template-columns: 1fr; }
  .is-simple .me-hero { grid-template-columns: 1fr; }
  .is-simple .me-tab i { font-size: 30px; }
  .is-simple .me-tab { font-size: 11px; padding: 8px 2px; }
  .tiny-pet { min-height: 220px; }
}

/* ==========================================================================
   Statistiques (parents)
   ========================================================================== */
.filter-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 22px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--white); border: var(--border); border-radius: 16px; box-shadow: var(--sh-sm); }
.seg a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 11px; text-decoration: none; font-family: var(--display); font-weight: 600; font-size: 15px; }
.seg a:hover { background: var(--paper); }
.seg a.on { background: var(--ink); color: #fff; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-bottom: 24px; align-items: stretch; }
.kpi { padding: 16px 18px; border-top: 8px solid var(--c); }
.kpi h2 { font-size: 22px; margin-bottom: 10px; }
.kpi-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.kpi-grid div { display: flex; flex-direction: column; gap: 2px; }
.kpi-grid b { font-family: var(--display); font-size: 26px; line-height: 1; }
.kpi-grid span { font-size: 11px; color: var(--muted); line-height: 1.2; }
.chart-sub { margin: -6px 0 8px; }
.chart-box { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .gridline { stroke: rgba(29,22,64,.1); stroke-width: 1; }
.chart-svg .axis { stroke: var(--ink); stroke-width: 1.5; }
.chart-svg .tick { font-family: var(--body); font-size: 11px; font-weight: 700; fill: var(--muted); }
.chart-svg .end-label { font-family: var(--display); font-weight: 600; font-size: 13px; fill: var(--ink); }
.chart-svg .end-value { fill: var(--ink-soft); font-weight: 700; }
.chart-svg .crosshair { stroke: var(--ink-soft); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-svg .hit { cursor: crosshair; }
.bar-mark { cursor: pointer; transition: opacity .15s; }
.bar-mark.good { fill: #0E9F66; }
.bar-mark.bad { fill: #D42A35; }
.bar-mark:hover, .bar-mark:focus { opacity: .75; outline: none; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px; padding: 8px 10px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--sh-sm);
  font-size: 13px;
}
.tip-head { font-weight: 900; color: var(--ink-soft); margin-bottom: 4px; }
.tip-row { display: flex; align-items: center; gap: 8px; }
.tip-row i { width: 14px; height: 3px; border-radius: 2px; }
.tip-row b { font-family: var(--display); font-size: 16px; min-width: 28px; }
.tip-row span { color: var(--ink-soft); }
.legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 800; margin-right: 14px; }
.legend .lg i { width: 14px; height: 14px; border-radius: 4px; }
.legend .lg.good i { background: #0E9F66; }
.legend .lg.bad i { background: #D42A35; }
.hbars { display: flex; flex-direction: column; gap: 8px; }
.hbar { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 36px; align-items: center; gap: 10px; }
.hbar-label { font-weight: 800; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar-track { height: 14px; background: var(--paper); border-radius: 99px; overflow: hidden; }
.hbar-track i { display: block; height: 100%; border-radius: 99px; }
.hbar-track i.good { background: #0E9F66; }
.hbar-track i.bad { background: #D42A35; }
.hbar b { font-family: var(--display); text-align: right; }
.heatmap { display: grid; grid-template-columns: 90px repeat(var(--cols), minmax(0, 1fr)); gap: 4px; }
.heat-head { text-align: center; font-size: 12px; font-weight: 900; color: var(--muted); }
.heat-row { font-size: 13px; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; }
.heat-cell { aspect-ratio: 1.6; display: grid; place-items: center; border-radius: 8px; font-family: var(--display); font-weight: 700; font-size: 13px; background: var(--paper); cursor: default; }
.heat-cell.good { background: color-mix(in srgb, #0E9F66 calc(var(--a) * 100%), #f4f1ea); }
.heat-cell.bad { background: color-mix(in srgb, #D42A35 calc(var(--a) * 100%), #f4f1ea); }
.heat-cell.strong { color: #fff; }
.table-view summary { cursor: pointer; font-family: var(--display); font-weight: 600; font-size: 18px; }
.table-scroll { max-height: 380px; overflow: auto; margin-top: 12px; }
.table-view table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-view th, .table-view td { padding: 6px 10px; border-bottom: 1px solid var(--line, rgba(29,22,64,.12)); text-align: right; }
.table-view th:first-child, .table-view td:first-child { text-align: left; }
.table-view thead th { position: sticky; top: 0; background: var(--white); }
@media (max-width: 720px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .topbar .nav:not(.kid-nav) { grid-template-columns: repeat(5, 1fr); }
  .heatmap { grid-template-columns: 70px repeat(var(--cols), minmax(0, 1fr)); }
}
.chart-svg { max-height: 340px; }

/* Détail de ce qu'une action a rapporté */
.flash.detail { padding: 12px 16px; }
.detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.detail-head b { font-family: var(--display); font-size: 20px; }
.detail-head span { font-size: 13px; color: var(--ink-soft); }
.detail-lines { list-style: none; margin-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.detail-lines li { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.detail-lines li b { margin-left: auto; font-family: var(--display); }
.gift-note { display: inline-block; margin-top: 6px; padding: 3px 12px; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); border-radius: 99px; text-shadow: none; }

/* ---------- Fenêtre « nouveau badge » ---------- */
dialog.badge-modal {
  margin: auto; width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 40px); padding: 0; overflow: auto;
  border: 4px solid var(--ink); border-radius: 30px; box-shadow: var(--sh-lg); background: var(--white); color: var(--ink);
}
dialog.badge-modal[open] { animation: celIn .6s var(--pop); }
dialog.badge-modal::backdrop { background: rgba(29, 22, 64, .6); }
.bm-head {
  display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  background-color: var(--c); color: #fff; border-bottom: 4px solid var(--ink);
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,.2) 0 14px, transparent 14px 28px);
}
.bm-head .avatar { box-shadow: var(--sh-sm); }
.bm-kicker { display: inline-block; padding: 3px 12px; background: var(--sun); color: var(--ink); border: 2px solid var(--ink); border-radius: 99px; font-family: var(--display); font-weight: 700; font-size: 14px; animation: wiggle 1.4s ease-in-out infinite; }
.bm-head h2 { font-size: clamp(26px, 5vw, 34px); margin-top: 6px; -webkit-text-stroke: 2px var(--ink); paint-order: stroke fill; text-shadow: 3px 3px 0 var(--ink); }
.bm-list { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px; }
.bm-badge { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(120deg, #fff6c2, #fff 60%); animation: popIn .5s var(--pop) both; animation-delay: calc(var(--i) * 120ms + 300ms); }
.bm-badge .badge-medal { width: 64px; height: 64px; font-size: 34px; animation: wiggle 2s ease-in-out infinite; }
.bm-badge > div { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bm-badge b { font-family: var(--display); font-weight: 700; font-size: 20px; line-height: 1.1; }
.bm-badge small { color: var(--ink-soft); font-size: 14px; }
.bm-tier { font-style: normal; font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.bm-stars { flex-shrink: 0; padding: 4px 10px; background: var(--sun); border: 2px solid var(--ink); border-radius: 99px; font-family: var(--display); font-weight: 700; }
.bm-more { text-align: center; font-family: var(--display); font-weight: 600; color: var(--muted); }
.bm-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 0 20px 20px; }
.bm-total { margin-right: auto; font-family: var(--display); font-weight: 700; font-size: 18px; }

/* Motif déjà compté aujourd'hui */
.tile.maxed { opacity: .5; filter: grayscale(.6); background: var(--paper); }
.tile.maxed:hover { transform: none; box-shadow: var(--sh-sm); background: var(--paper); }
.tile-count { position: absolute; left: 8px; bottom: -10px; z-index: 1; padding: 1px 8px; background: var(--mint); color: #fff; border: 2px solid var(--ink); border-radius: 8px; font-family: var(--display); font-weight: 600; font-size: 12px; }
.tile.maxed .tile-count { background: var(--ink-soft); }

/* Gain d'étoiles des badges : impossible à rater */
.bm-banner { margin: 16px 20px 0; padding: 14px 18px; border: 3px solid var(--ink); border-radius: 18px; display: flex; flex-direction: column; gap: 4px; text-align: center; }
.bm-banner span:not(.bm-banner-big) { font-weight: 800; color: var(--ink-soft); }
.bm-banner-big { font-family: var(--display); font-weight: 700; font-size: 28px; line-height: 1.1; }
.bm-banner.gain { background: linear-gradient(120deg, #ffe07a, #fff6c2); box-shadow: var(--sh-sm); animation: glow 1.4s ease-in-out 3; }
.bm-banner.gain .bm-banner-big { color: var(--ink); animation: wiggle 1s ease-in-out 3; }
.bm-banner.glory { background: var(--paper); }
.bm-stars { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; padding: 6px 12px; background: var(--sun); border: 3px solid var(--ink); border-radius: 16px; box-shadow: var(--sh-sm); font-family: var(--display); line-height: 1.1; animation: popIn .5s var(--pop) both; animation-delay: calc(var(--i) * 120ms + 700ms); }
.bm-stars b { font-size: 24px; }
.bm-stars small { font-size: 11px; font-weight: 700; }
.bm-glory { flex-shrink: 0; max-width: 140px; text-align: center; padding: 4px 10px; background: var(--paper); border: 2px dashed rgba(29,22,64,.35); border-radius: 12px; font-size: 12px; font-weight: 800; color: var(--muted); }
.bm-badge.paid { background: linear-gradient(120deg, #ffe07a, #fff 65%); }
.detail-badge-stars { display: inline-block; margin-left: 6px; padding: 2px 10px; background: var(--sun); border: 2px solid var(--ink); border-radius: 99px; font-size: 14px; vertical-align: middle; }
.joke .speak-btn.small { margin-top: 0; }
.joke-a[open] { display: flex; flex-direction: column; gap: 8px; }
.joke-tomorrow { margin-top: auto; color: var(--muted); font-weight: 800; }
.tiny-joke { grid-column: 1 / -1; }
.tiny-joke .joke-q { font-size: 26px; }
.score-neg { color: var(--cherry) !important; font-family: var(--display); font-weight: 700; white-space: nowrap; }
.me-score .score-neg { font-size: 20px; }

/* ---------- Gamelle et repas du compagnon ---------- */
.feed-box { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 14px; margin-top: 12px; border: 3px solid var(--ink); border-radius: 18px; background: linear-gradient(120deg, #fff1bf, #fff 70%); }
.feed-box.empty { background: var(--paper); border-style: dashed; }
.bowl { position: relative; width: 74px; height: 64px; flex-shrink: 0; }
.bowl-dish { position: absolute; left: 50%; bottom: 0; translate: -50% 0; font-size: 50px; line-height: 1; }
.bowl-stars { position: absolute; left: 6px; right: 6px; top: 2px; display: flex; flex-wrap: wrap; justify-content: center; gap: 0 1px; font-size: 13px; z-index: 1; }
.bowl-stars i { font-style: normal; animation: bob 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * -170ms); }
.bowl-count { position: absolute; right: -8px; bottom: -6px; z-index: 2; min-width: 28px; height: 28px; padding: 0 6px; display: grid; place-items: center; background: var(--sun); border: 2px solid var(--ink); border-radius: 99px; font-family: var(--display); font-size: 15px; }
.feed-text { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: 2px; }
.feed-text b { font-family: var(--display); font-weight: 700; font-size: 19px; }
.feed-text small { color: var(--ink-soft); }
.feed-form { display: flex; gap: 8px; flex-wrap: wrap; }
.feed-one { font-size: 18px; animation: wiggle 1.8s ease-in-out infinite; }
.feed-box.big .bowl { width: 96px; height: 82px; }
.feed-box.big .bowl-dish { font-size: 66px; }
.feed-box.big .feed-one { font-size: 22px; padding: 14px 20px; }
.food-note { color: #b36b00 !important; font-weight: 900; }
.flying-star { position: fixed; z-index: 95; font-size: 34px; translate: -50% -50%; pointer-events: none; transition: transform .6s cubic-bezier(.5, -0.3, .6, 1), opacity .6s; filter: drop-shadow(2px 2px 0 var(--ink)); }
.chomp, .chomp span { animation: chomp .5s ease-in-out !important; }
@keyframes chomp { 0%, 100% { transform: scale(1); } 25% { transform: scale(1.2, .85); } 50% { transform: scale(.9, 1.15); } 75% { transform: scale(1.1, .92); } }
.tiny-feed { display: flex; }
.tiny-feed .feed-box { flex: 1; margin: 0; }
.tiny-feed { grid-column: 1 / -1; }
.badge-pending { margin-top: auto; padding: 3px 8px; background: var(--sun); border: 2px solid var(--ink); border-radius: 99px; font-size: 11px; font-weight: 900; animation: wiggle 1.6s ease-in-out infinite; }
.badge-item.off:has(.badge-pending) { border-style: solid; border-color: var(--ink); background: #fff6c2; }

/* ==========================================================================
   Guide « Comment ça marche ? » (écran enfants)
   ========================================================================== */
.guide { display: flex; flex-direction: column; gap: 18px; }
.guide-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.guide-dots { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; justify-content: center; }
.guide-dot {
  position: relative; width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; text-decoration: none;
  background: var(--white); border: var(--border); border-radius: 50%; box-shadow: var(--sh-sm); transition: transform .15s var(--pop);
}
.guide-dot:hover { transform: translateY(-3px) rotate(-6deg); }
.guide-dot.on { background: var(--c); transform: scale(1.18); box-shadow: var(--sh); }
.guide-dot.seen::after, .guide-map-item.seen::after {
  content: '✓'; position: absolute; right: -5px; bottom: -5px; width: 18px; height: 18px; display: grid; place-items: center;
  font-size: 11px; font-weight: 900; color: #fff; background: var(--mint); border: 2px solid var(--ink); border-radius: 50%;
}
.guide-count { font-family: var(--display); font-weight: 700; padding: 4px 12px; background: var(--white); border: var(--border); border-radius: 99px; }

.guide-card { padding: clamp(16px, 3vw, 28px); background: var(--white); display: flex; flex-direction: column; gap: 20px; }
.guide-head { display: flex; align-items: center; gap: 14px; }
.guide-head h1 { margin: 0; font-size: clamp(28px, 5vw, 44px); }
.guide-step-emoji {
  width: 72px; height: 72px; flex: none; display: grid; place-items: center; font-size: 40px;
  background: var(--c); border: var(--border); border-radius: 22px; box-shadow: var(--sh-sm); rotate: -6deg;
}

.guide-talk { display: flex; align-items: flex-start; gap: 16px; }
.guide-mascot {
  flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 0; background: none; border: 0; cursor: pointer;
}
.guide-mascot span { font-size: clamp(64px, 12vw, 96px); line-height: 1; filter: drop-shadow(4px 4px 0 rgba(29, 22, 64, .25)); animation: breathe 3s ease-in-out infinite; }
.guide-mascot small { font-family: var(--display); font-weight: 700; padding: 2px 10px; background: var(--c); border: 2px solid var(--ink); border-radius: 99px; }
.guide-mascot.jump span { animation: petJump .7s var(--pop); }
.guide-bubble {
  position: relative; flex: 1; padding: 16px 18px; font-size: clamp(17px, 2.4vw, 21px); line-height: 1.5; font-weight: 700;
  background: var(--paper); border: var(--border); border-radius: 22px; box-shadow: var(--sh-sm);
}
.guide-bubble::before {
  content: ''; position: absolute; left: -14px; top: 34px; width: 22px; height: 22px; rotate: 45deg;
  background: var(--paper); border-left: var(--border); border-bottom: var(--border);
}
.guide-say b { background: linear-gradient(transparent 55%, color-mix(in srgb, var(--c) 55%, transparent) 55%); }
.guide-listen { margin-top: 10px; }

.guide-demo { padding: 18px; background: color-mix(in srgb, var(--c) 14%, var(--white)); border: 3px dashed var(--ink); border-radius: var(--r); display: flex; flex-direction: column; gap: 14px; }
.guide-try { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; }
.guide-real { margin: 0; padding: 12px 16px; font-weight: 800; background: var(--paper-2); border: 2px solid var(--ink); border-radius: var(--r-sm); }
.guide-sub { margin: 6px 0 0; font-size: 20px; }
.guide-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.guide-nav .guide-next { margin-left: auto; }

.demo-msg { margin: 0; min-height: 1.4em; font-weight: 800; font-size: 18px; }
.demo-counter { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.demo-big { font-family: var(--display); font-size: 44px; font-weight: 700; line-height: 1; }
.demo-buttons { display: flex; gap: 12px; flex-wrap: wrap; }
.demo-buttons .tile { min-width: 150px; }
.demo-tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.demo-tiles .tile-pts small { font-size: 11px; opacity: .75; }
.shake { animation: hit .45s ease-in-out; }
.jump { animation: petJump .7s var(--pop); }

/* Carte du voyage */
.guide-map { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.guide-map-item {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; text-align: center; text-decoration: none; color: var(--ink);
  background: var(--white); border: var(--border); border-radius: var(--r-sm); box-shadow: var(--sh-sm); transition: transform .15s var(--pop);
}
.guide-map-item:hover { transform: translateY(-4px) rotate(-1.5deg); background: color-mix(in srgb, var(--c) 25%, var(--white)); }
.guide-map-item b { position: absolute; left: 8px; top: 6px; font-size: 13px; color: var(--muted); }
.guide-map-item i { font-style: normal; font-size: 38px; }
.guide-map-item span { font-family: var(--display); font-weight: 700; }

/* Paliers */
.demo-bar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 6px; background: var(--white); border: var(--border); border-radius: 99px; }
.demo-bar i { height: 26px; border-radius: 99px; background: var(--paper-2); transition: background .2s, transform .2s var(--pop); }
.demo-bar i.on { background: var(--sun); transform: scale(1.08); box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.demo-treasure { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-weight: 800; }
.demo-dots { display: flex; gap: 5px; flex-wrap: wrap; }
.demo-dots i { width: 22px; height: 22px; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); }
.demo-dots i.on { background: var(--pink); }
.demo-tickets { display: flex; gap: 8px; flex-wrap: wrap; }
.demo-ticket { padding: 6px 12px; font-weight: 900; background: var(--sun); border: 2px solid var(--ink); border-radius: 10px; box-shadow: var(--sh-sm); animation: popIn .4s var(--pop); }

/* Sous zéro */
.demo-recovery.neg .demo-big { color: var(--cherry); }
.demo-hearts { display: flex; gap: 4px; font-size: 30px; }
.demo-hearts i { font-style: normal; }

/* Défi + flamme */
.demo-challenge-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; align-items: start; }
.demo-challenge { display: flex; flex-direction: column; gap: 10px; }
.demo-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.demo-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 2px; font-weight: 900; font-size: 13px;
  background: var(--white); border: 2px solid var(--ink); border-radius: 12px; cursor: pointer;
}
.demo-day i { font-style: normal; font-size: 20px; line-height: 1.2; }
.demo-day.on { background: #ffe0b8; }
.demo-flame-big { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 90px; font-family: var(--display); font-size: 32px; }
.demo-flame-big span { transition: font-size .3s var(--pop); filter: grayscale(1); opacity: .4; }
.demo-flame.lit .demo-flame-big span { filter: none; opacity: 1; }
.demo-flame-big small { font-size: 16px; }

/* Roue */
.demo-wheel { display: flex; align-items: center; justify-content: center; gap: 24px; flex-wrap: wrap; }
.demo-wheel .wheel-stage { width: min(320px, 80vw); }
.demo-wheel-side { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.demo-prize { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 20px; background: var(--white); border: var(--border); border-radius: var(--r-sm); box-shadow: var(--sh); animation: popIn .4s var(--pop); }
.demo-prize i { font-style: normal; font-size: 48px; }
.demo-prize b { font-family: var(--display); font-size: 22px; }

/* Compagnon */
.demo-pet { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.demo-pet-stage { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.demo-pet-emoji { font-size: 110px; line-height: 1; display: inline-block; }
.demo-pet-stage b { font-family: var(--display); font-size: 24px; }
.demo-pet-bar { width: min(280px, 100%); height: 18px; background: var(--white); border: 2px solid var(--ink); border-radius: 99px; overflow: hidden; }
.demo-pet-bar i { display: block; height: 100%; background: var(--mint); transition: width .4s var(--pop); }
.demo-bowl { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }
.demo-bowl .bowl { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 22px; padding: 10px 16px; background: var(--white); border: var(--border); border-radius: 0 0 40px 40px; }
.demo-bowl .bowl span { font-size: 32px; }
.demo-timeline { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 0; margin: 0; list-style: none; }
.demo-timeline li { display: flex; flex-direction: column; align-items: center; padding: 8px 4px; text-align: center; background: var(--white); border: 2px solid var(--ink); border-radius: 14px; opacity: .45; filter: grayscale(.8); }
.demo-timeline li.on { opacity: 1; filter: none; background: #d8f8e8; }
.demo-timeline i { font-style: normal; font-size: 30px; }
.demo-timeline span { font-weight: 900; font-size: 13px; }
.demo-timeline small { font-size: 11px; color: var(--muted); }
.demo-pet .demo-msg, .demo-pet [data-reset] { grid-column: 1 / -1; justify-self: start; }

/* Badges */
.demo-badges { display: flex; flex-direction: column; gap: 16px; align-items: center; }
.demo-tiers { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; width: 100%; }
.demo-tier { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; background: var(--white); border: 2px solid var(--ink); border-radius: 16px; cursor: pointer; }
.demo-tier small { font-weight: 900; font-size: 12px; }
.demo-mystery { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 240px; padding: 16px 20px; background: var(--white); cursor: pointer; transition: transform .2s var(--pop); }
.demo-mystery:not(.open) { animation: wiggle 1.8s ease-in-out infinite; }
.demo-mystery.open { background: #efe6ff; transform: scale(1.05); }
.demo-mystery b { font-family: var(--display); font-size: 20px; }

/* Cartes à retourner */
.demo-flip-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 14px; }
.flip-card { min-height: 190px; padding: 0; background: none; border: 0; perspective: 900px; cursor: pointer; text-align: center; }
.flip-inner { position: relative; display: block; height: 100%; min-height: 190px; transform-style: preserve-3d; transition: transform .6s var(--pop); }
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.flip-front, .flip-back {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 14px;
  backface-visibility: hidden; border: var(--border); border-radius: var(--r-sm); box-shadow: var(--sh-sm);
}
.flip-front { background: var(--c); }
.flip-front i { font-style: normal; font-size: 54px; }
.flip-front b { font-family: var(--display); font-size: 20px; }
.flip-front small { font-weight: 800; opacity: .8; }
.flip-back { background: var(--white); transform: rotateY(180deg); font-weight: 800; font-size: 15px; line-height: 1.35; }
.flip-back i { font-style: normal; font-size: 30px; }

/* Règles */
.guide-rules .chip { cursor: pointer; font: inherit; font-weight: 800; }
.guide-rules .chip small { margin-left: 4px; font-size: 11px; opacity: .7; }
.panel-lite { padding: 16px; background: var(--paper); border: 2px solid var(--ink); border-radius: var(--r); }

/* Quiz */
.demo-quiz { display: flex; flex-direction: column; gap: 14px; }
.quiz-q { margin: 0; padding: 16px; background: var(--white); min-width: 0; }
.quiz-q legend { float: left; width: 100%; margin-bottom: 10px; font-family: var(--display); font-size: 20px; font-weight: 700; }
.quiz-answers { clear: both; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.quiz-a { padding: 12px; font: inherit; font-weight: 800; background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; cursor: pointer; transition: transform .12s var(--pop); }
.quiz-a:hover:not(:disabled) { transform: translateY(-2px); background: var(--paper-2); }
.quiz-a.right { background: var(--mint); color: #fff; transform: scale(1.04); }
.quiz-a.wrong { background: var(--bad-bg); text-decoration: line-through; opacity: .7; }
.quiz-a:disabled { cursor: default; }
.quiz-explain { margin: 10px 0 0; font-weight: 800; color: #0b7a4f; }
.quiz-q[data-result="ok"] { border-color: var(--mint); }
.speak-mini { padding: 0 4px; font-size: 18px; background: none; border: 0; cursor: pointer; vertical-align: middle; }
.quiz-score { font-family: var(--display); font-size: 24px; text-align: center; }
.diploma {
  position: relative; padding: 28px 24px; text-align: center; background: linear-gradient(135deg, #fff6c2, #ffe0f0); animation: popIn .6s var(--pop);
  border-style: double; border-width: 8px;
}
.diploma > i { font-style: normal; font-size: 64px; }
.diploma h2 { margin: 6px 0; font-size: clamp(24px, 4vw, 34px); }
.diploma p { font-size: 18px; font-weight: 800; }
.diploma-seal { position: absolute; right: 14px; bottom: 10px; font-size: 44px; rotate: 12deg; }

@media (max-width: 640px) {
  .guide-talk { flex-direction: column; align-items: center; }
  .guide-bubble::before { left: 50%; top: -14px; translate: -50% 0; rotate: 135deg; }
  .demo-pet { grid-template-columns: 1fr; }
  .demo-timeline { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .demo-timeline span, .demo-timeline small { font-size: 10px; }
  .demo-tiers { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .demo-tier b { font-size: 11px; }
  .guide-nav .btn { flex: 1; justify-content: center; }
  .guide-top { justify-content: space-between; }
  .guide-dots { order: 3; flex: 0 0 100%; flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding: 6px 4px 10px; scrollbar-width: none; }
  .guide-dot { flex: none; width: 40px; height: 40px; font-size: 19px; }
  .guide-head h1 { font-size: 26px; }
  .guide-step-emoji { width: 56px; height: 56px; font-size: 30px; }
}

/* Tuto automatique */
.guide-tools { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.tuto-play { animation: glow 2s ease-in-out infinite; }
.voice-picker { max-width: 240px; padding: 8px 12px; font: inherit; font-weight: 800; background: var(--white); border: var(--border); border-radius: 99px; box-shadow: var(--sh-sm); cursor: pointer; }
body.tuto-on .tuto-play { display: none; }
.guide.talking .guide-mascot span { animation: talk .35s ease-in-out infinite alternate; }
.guide.talking .guide-bubble { box-shadow: 0 0 0 5px color-mix(in srgb, var(--c) 60%, transparent), var(--sh-sm); }
@keyframes talk { from { transform: translateY(0) rotate(-3deg) scale(1); } to { transform: translateY(-6px) rotate(3deg) scale(1.05, .97); } }
.guide-map-item.glow { transform: translateY(-6px) scale(1.06); background: color-mix(in srgb, var(--c) 35%, var(--white)); }

.tuto-finger {
  position: fixed; left: 0; top: 0; z-index: 90; font-size: 46px; pointer-events: none; opacity: 0;
  margin: -6px 0 0 -18px; filter: drop-shadow(3px 4px 0 rgba(29, 22, 64, .35));
  transition: transform .55s cubic-bezier(.3, .8, .3, 1), opacity .3s;
}
.tuto-finger.show { opacity: 1; }
.tuto-finger.press { animation: press .3s ease-in-out; }
@keyframes press { 50% { margin-top: 4px; scale: .85; } }

.tuto-bar {
  position: fixed; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); z-index: 80; translate: -50% 0;
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--white); border-radius: 99px; max-width: calc(100vw - 20px); flex-wrap: wrap; justify-content: center;
  animation: popUp .4s var(--pop);
}
.tuto-live { padding: 4px 10px; font-weight: 900; color: #fff; background: var(--cherry); border-radius: 99px; animation: blink 1.4s ease-in-out infinite; }
.tuto-bar.paused .tuto-live { animation: none; background: var(--muted); }
body.tuto-on .page { padding-bottom: 90px; }

.tuto-start { position: fixed; inset: 0; z-index: 95; display: grid; place-items: center; padding: 16px; background: rgba(29, 22, 64, .55); backdrop-filter: blur(3px); }
.tuto-start-card { max-width: 440px; padding: 28px 24px; text-align: center; background: var(--paper); animation: celIn .45s var(--pop); }
.tuto-start-card > i { display: block; font-style: normal; font-size: 84px; animation: breathe 2.4s ease-in-out infinite; }
.tuto-start-card h2 { margin: 8px 0; font-size: 32px; }
.tuto-start-card p { font-weight: 800; font-size: 18px; }
.tuto-start-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.tuto-go { font-size: 24px; padding: 18px 24px; animation: glow 1.8s ease-in-out infinite; }
