/* Petit Mochi — thème indigo, inspiré de revisions-enfants.vercel.app */
:root {
    --bg: #eef2ff;
    --card: #ffffff;
    --card-border: #a5b4fc;
    --paper: #ffffff;
    --ink: #1e1b4b;
    --text: #334155;
    --muted: #64748b;
    --accent: #6366f1;
    --accent-d: #4338ca;
    --title: #4338ca;
    --soft: #e0e7ff;
    --good: #059669;
    --good-bg: #d1fae5;
    --bad: #e11d48;
    --bad-bg: #ffe4e6;
    --gold: #f59e0b;
    --gold-bg: #fef3c7;
    --gold-ink: #92400e;
    --shadow: 0 10px 30px -12px rgba(67, 56, 202, .35);
    --radius: 22px;
    color-scheme: light;
}
:root[data-theme="dark"] {
    --bg: #12142b;
    --card: #1e2142;
    --card-border: #3b4180;
    --paper: #171a38;
    --ink: #e0e7ff;
    --text: #e2e8f0;
    --muted: #a5b0cf;
    --accent: #818cf8;
    --accent-d: #6366f1;
    --title: #a5b4fc;
    --soft: #2b2f5e;
    --good: #34d399;
    --good-bg: #123528;
    --bad: #fb7185;
    --bad-bg: #4c1d24;
    --gold: #fbbf24;
    --gold-bg: #4a3b12;
    --gold-ink: #fde68a;
    --shadow: 0 10px 30px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: Nunito, system-ui, -apple-system, "Segoe UI", sans-serif;
    font-size: 17px;
    -webkit-tap-highlight-color: transparent;
}
#app { min-height: 100dvh; display: flex; flex-direction: column; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, .brand, .tile-name, .level-name, .btn, .fb-title, .result-score { font-family: Fredoka, Nunito, sans-serif; }

/* ---------- En-tête ---------- */
.topbar {
    position: sticky; top: 0; z-index: 10;
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
    background: var(--card); border-bottom: 1px solid var(--soft);
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 20px; color: var(--title); }
.top-actions { display: flex; gap: 10px; align-items: center; }
.icon-btn {
    width: 44px; height: 38px; border-radius: 999px; border: 0;
    background: var(--soft); color: var(--title);
    display: grid; place-items: center; transition: transform .15s;
}
.icon-btn:hover { transform: scale(1.06); }
.icon-btn.small { width: 36px; height: 36px; font-size: 16px; flex: none; }
.score-pill {
    display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px;
    padding: 8px 14px; background: var(--gold-bg); color: var(--gold-ink); font-weight: 700; font-size: 15px;
}
.score-pill svg { color: var(--gold); }

main { flex: 1; width: 100%; max-width: 940px; margin: 0 auto; padding: 16px; }
.version { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 0 max(14px, env(safe-area-inset-bottom)); }

/* ---------- Carte ---------- */
.card {
    background: var(--card); border: 3px solid var(--card-border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px 20px 26px; position: relative;
}
h1 { color: var(--title); text-align: center; font-size: 26px; font-weight: 600; margin: 4px 0 6px; }
h1 small.badge { font-size: 14px; vertical-align: middle; background: var(--c, var(--accent)); color: #fff; border-radius: 999px; padding: 3px 10px; margin-left: 4px; }
.sub { text-align: center; color: var(--muted); margin: 0 0 20px; }
.muted { color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--accent); font-weight: 700; }
.crumbs a:hover { text-decoration: underline; }
.crumbs b { color: var(--text); font-weight: 700; }

/* ---------- Tuiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
.tile {
    background: var(--c); color: #fff; border-radius: 16px; min-height: 150px; padding: 18px 14px 14px;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
    box-shadow: 0 6px 0 0 color-mix(in srgb, var(--c) 70%, #000), 0 10px 20px -8px var(--c);
    transition: transform .12s, box-shadow .12s; position: relative; overflow: hidden;
}
.tile::after { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 0%, rgba(255,255,255,.25), transparent 55%); pointer-events: none; }
.tile:hover { transform: translateY(-3px); }
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 0 color-mix(in srgb, var(--c) 70%, #000); }
.tile-icon { font-size: 40px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.tile-name { font-weight: 600; font-size: 19px; }
.tile-small { font-size: 13px; opacity: .9; font-weight: 600; }
.tile-foot { font-size: 13px; font-weight: 700; opacity: .95; }
.level-name { font-size: 40px; font-weight: 600; line-height: 1; }
.level-age { font-size: 14px; font-weight: 700; opacity: .9; }
.tile.last { outline: 4px solid var(--gold); outline-offset: 3px; }
.mini-bar { width: 70%; height: 10px; background: rgba(0,0,0,.28); box-shadow: inset 0 1px 2px rgba(0,0,0,.25); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.mini-bar div { height: 100%; background: #fff; border-radius: 99px; transition: width .4s; }
.levels .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
@media (min-width: 720px) { .tiles.levels { grid-template-columns: repeat(5, 1fr); } .levels .tile:last-child:nth-child(odd) { grid-column: auto; } }

/* ---------- Leçons ---------- */
.h-icon { font-size: 26px; }
.lessons { display: grid; gap: 10px; }
@media (min-width: 720px) { .lessons { grid-template-columns: 1fr 1fr; } }
.lesson {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
    background: var(--paper); border: 2px solid var(--soft); transition: border-color .15s, transform .12s;
}
.lesson:hover { border-color: var(--c); transform: translateX(3px); }
.lesson-icon { width: 48px; height: 48px; flex: none; display: grid; place-items: center; font-size: 26px; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.lesson-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lesson-txt b { font-size: 16px; color: var(--text); }
.lesson-txt small { color: var(--muted); font-size: 13px; }
.stars { white-space: nowrap; font-size: 18px; letter-spacing: 1px; }
.stars i { font-style: normal; color: var(--soft); }
.stars i.on { color: var(--gold); text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.btn.mix { display: flex; justify-content: center; margin-top: 16px; }

/* ---------- Boutons ---------- */
.btn {
    border: 0; border-radius: 14px; padding: 12px 20px; font-size: 17px; font-weight: 600;
    background: var(--soft); color: var(--title); transition: transform .1s, filter .15s;
}
.btn:hover { filter: brightness(1.05); }
.btn:active { transform: translateY(2px); }
.btn.primary { background: var(--accent-d); color: #fff; box-shadow: 0 4px 0 #312e81; }
.btn.success { background: #059669; color: #fff; box-shadow: 0 4px 0 #065f46; }
.btn.danger { background: #e11d48; color: #fff; }
.btn.ghost-btn { background: transparent; border: 2px solid var(--card-border); color: var(--title); }
.btn:disabled { opacity: .45; cursor: default; }

/* ---------- Préparation ---------- */
.prep-head { display: flex; align-items: center; gap: 14px; justify-content: center; margin: 8px 0 6px; }
.prep-head h1, .prep-head .sub { text-align: left; margin: 0; }
.prep-head .stars { font-size: 22px; }
.prep-icon { font-size: 52px; width: 76px; height: 76px; display: grid; place-items: center; border-radius: 20px; background: color-mix(in srgb, var(--c) 18%, transparent); flex: none; }
.prep-title { text-align: center; color: var(--title); font-weight: 600; font-size: 20px; margin: 22px 0 12px; }
.modes { display: grid; gap: 12px; max-width: 520px; margin: 0 auto; }
.mode {
    display: flex; align-items: center; gap: 14px; text-align: left; padding: 14px 16px; border-radius: 16px;
    background: var(--paper); border: 3px solid var(--soft); transition: border-color .15s, transform .12s;
}
.mode:hover { border-color: var(--c); transform: scale(1.015); }
.mode-icon { font-size: 34px; }
.mode-txt { flex: 1; display: flex; flex-direction: column; }
.mode-txt b { font-family: Fredoka, sans-serif; font-size: 19px; font-weight: 600; color: var(--title); }
.mode-txt small { color: var(--muted); }
.mode-best { text-align: center; font-size: 12px; color: var(--gold-ink); background: var(--gold-bg); border-radius: 10px; padding: 4px 8px; }

/* ---------- Jeu ---------- */
.game { padding-top: 14px; }
.game-head { display: flex; align-items: center; gap: 10px; }
.game-prog { flex: 1; display: flex; align-items: center; gap: 8px; }
.progress, .chrono { flex: 1; height: 14px; border-radius: 99px; background: var(--soft); overflow: hidden; position: relative; }
.progress-fill { height: 100%; background: linear-gradient(90deg, #818cf8, #6366f1); border-radius: 99px; transition: width .4s; }
.chrono { height: 22px; }
.chrono-fill { height: 100%; background: linear-gradient(90deg, #34d399, #10b981); transition: width .2s linear; }
.chrono-fill.hurry { background: linear-gradient(90deg, #fb7185, #e11d48); }
.chrono-txt { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: var(--ink); }
.qcount { font-weight: 800; font-size: 14px; color: var(--muted); white-space: nowrap; }
.game-score { display: flex; gap: 8px; align-items: center; font-weight: 800; font-size: 15px; }
.streak { opacity: .35; transition: opacity .2s; }
.streak.on { opacity: 1; animation: pulse .6s; }
.pts { background: var(--gold-bg); color: var(--gold-ink); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }
.pts.bump { animation: bump .35s; }
.game-title { text-align: center; color: var(--muted); font-weight: 700; font-size: 14px; margin: 10px 0 4px; }

.qzone { min-height: 200px; }
.question, .posee, .droite { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 10px 0; }
.qtext { font-size: 21px; font-weight: 700; color: var(--text); text-align: center; line-height: 1.4; max-width: 640px; }
.qtext b { color: var(--title); }
.big-calc { font-family: Fredoka, sans-serif; font-size: 44px; font-weight: 600; color: var(--ink); margin-top: 10px; white-space: nowrap; }
.big-sentence { font-size: 22px; font-weight: 600; margin-top: 12px; padding: 12px 16px; border-radius: 14px; background: var(--soft); color: var(--ink); }
.blank { display: inline-block; min-width: 1.6em; border-bottom: 3px dashed var(--accent); color: var(--accent); text-align: center; }
.center { display: flex; justify-content: center; margin-top: 12px; }
.speak-btn { border: 0; background: var(--soft); border-radius: 999px; width: 44px; height: 44px; font-size: 22px; vertical-align: middle; }
.coins { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 12px; }
.coin { display: inline-grid; place-items: center; width: 58px; height: 58px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b); color: #78350f; font-weight: 800; border: 3px solid #d97706; font-size: 15px; }
.coin.bill { width: 86px; height: 50px; border-radius: 8px; background: linear-gradient(135deg, #a7f3d0, #34d399); border-color: #059669; color: #064e3b; }

.choices { display: grid; grid-template-columns: 1fr; gap: 10px; width: 100%; max-width: 560px; }
@media (min-width: 560px) { .choices { grid-template-columns: 1fr 1fr; } }
.choices.compact { grid-template-columns: repeat(2, 1fr); max-width: 380px; }
.choices.compact .choice { justify-content: center; font-size: 24px; font-family: Fredoka, sans-serif; }
.choices.vf { grid-template-columns: 1fr 1fr; max-width: 380px; }
.choice {
    display: flex; align-items: center; gap: 10px; text-align: left; padding: 14px 16px; min-height: 58px;
    border-radius: 14px; border: 3px solid var(--soft); background: var(--paper); font-size: 18px; font-weight: 700; color: var(--text);
    box-shadow: 0 3px 0 var(--soft); transition: transform .1s, border-color .15s;
}
.choice:hover:not(:disabled) { border-color: var(--accent); transform: translateY(-2px); }
.choice .key { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 8px; background: var(--soft); color: var(--muted); font-size: 13px; font-family: Nunito, sans-serif; }
.choices.compact .key { display: none; }
.choice.good { border-color: var(--good); background: var(--good-bg); animation: pulse .4s; }
.choice.bad { border-color: var(--bad); background: var(--bad-bg); animation: shake .4s; }
.choice:disabled { cursor: default; }

.answer-row { display: flex; gap: 10px; width: 100%; max-width: 440px; }
.answer-input {
    flex: 1; min-width: 0; font: inherit; font-size: 24px; font-weight: 700; padding: 12px 14px; border-radius: 14px;
    border: 3px solid var(--card-border); background: var(--paper); color: var(--ink); text-align: center; outline: none;
}
.answer-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.answer-input.good, .pin.good { border-color: var(--good) !important; background: var(--good-bg) !important; }
.answer-input.bad, .pin.bad { border-color: var(--bad) !important; background: var(--bad-bg) !important; animation: shake .4s; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%; max-width: 640px; }
.chips.line { min-height: 64px; padding: 10px; border: 3px dashed var(--card-border); border-radius: 16px; background: var(--soft); align-content: flex-start; }
.chips.line:empty::before { content: attr(data-empty); color: var(--muted); font-size: 15px; align-self: center; }
.chip { border: 2px solid var(--card-border); background: var(--paper); border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 17px; box-shadow: 0 3px 0 var(--card-border); }
.chip.used { opacity: .25; }
.chip.placed small { color: var(--accent); font-weight: 800; margin-right: 2px; }
.chip.good { border-color: var(--good); background: var(--good-bg); }
.chip.bad { border-color: var(--bad); background: var(--bad-bg); }

/* Opération posée */
.ptitle { font-weight: 800; font-size: 19px; color: var(--title); text-align: center; }
.pgrid { display: inline-flex; flex-direction: column; align-items: flex-end; padding: 14px 18px 14px 44px; background: var(--paper); border-radius: 16px; border: 2px solid var(--soft);
    background-image: linear-gradient(var(--soft) 1px, transparent 1px), linear-gradient(90deg, var(--soft) 1px, transparent 1px); background-size: 46px 46px; }
.prow { display: flex; position: relative; }
.pcell { width: 46px; height: 50px; display: grid; place-items: center; font-family: Fredoka, sans-serif; font-size: 34px; font-weight: 600; color: var(--ink); }
.psign { position: absolute; left: -38px; top: 0; height: 50px; display: grid; place-items: center; font-family: Fredoka, sans-serif; font-size: 34px; color: var(--accent); }
.pline { height: 4px; width: 100%; background: var(--ink); border-radius: 2px; margin: 4px 0; }
.pin { border: 2px solid var(--card-border); border-radius: 10px; margin: 2px 4px; width: 38px; height: 46px; background: var(--card); text-align: center; font-family: Fredoka, sans-serif; font-size: 28px; color: var(--ink); outline: none; padding: 0; }
.pin:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }
.carry .pin { width: 26px; height: 26px; font-size: 15px; margin: 2px 10px; border-style: dashed; color: #e11d48; }
.partial .pin { border-style: dashed; }
.phint { color: var(--muted); font-size: 14px; text-align: center; max-width: 420px; margin: 0; }
@media (max-width: 420px) { .pcell { width: 38px; font-size: 28px; } .pin { width: 32px; margin: 2px 3px; font-size: 24px; } .carry .pin { width: 22px; margin: 2px 8px; } .pgrid { padding-left: 36px; } .psign { left: -32px; } }

.arrow-bob { animation: bob 1.2s ease-in-out infinite; }

/* Feedback */
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 16px; display: flex; flex-direction: column; gap: 8px; animation: slideUp .25s ease-out; }
.feedback.ok { background: var(--good-bg); border: 2px solid var(--good); }
.feedback.ko { background: var(--bad-bg); border: 2px solid var(--bad); }
.fb-title { font-size: 22px; font-weight: 600; }
.feedback.ok .fb-title { color: var(--good); }
.feedback.ko .fb-title { color: var(--bad); }
.gain { font-size: 16px; background: var(--gold-bg); color: var(--gold-ink); padding: 2px 8px; border-radius: 99px; margin-left: 4px; }
.gain.bad { background: var(--bad); color: #fff; }
.fb-text { font-size: 16px; line-height: 1.45; }
.feedback .btn { align-self: flex-end; }

/* Memory */
.memo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
@media (min-width: 640px) { .memo-grid { grid-template-columns: repeat(4, 1fr); } }
.memo-card { position: relative; height: 92px; border: 0; padding: 0; background: none; perspective: 600px; }
.memo-card span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 14px; backface-visibility: hidden; transition: transform .35s; padding: 6px; font-weight: 800; font-size: 15px; text-align: center; line-height: 1.2; }
.memo-back { background: linear-gradient(135deg, #818cf8, #6366f1); color: #fff; font-size: 34px !important; font-family: Fredoka, sans-serif; box-shadow: 0 4px 0 #4338ca; }
.memo-face { transform: rotateY(180deg); background: var(--paper); border: 3px solid var(--card-border); color: var(--ink); }
.memo-face.side-a { border-color: #0ea5e9; }
.memo-face.side-b { border-color: #f59e0b; }
.memo-card.open .memo-back, .memo-card.done .memo-back { transform: rotateY(180deg); }
.memo-card.open .memo-face, .memo-card.done .memo-face { transform: rotateY(360deg); }
.memo-card.done .memo-face { background: var(--good-bg); border-color: var(--good); animation: pulse .4s; }

/* Résultat */
.result { text-align: center; }
.result h2 { color: var(--title); font-size: 30px; margin: 6px 0; font-weight: 600; }
.result-stars { font-size: 64px; letter-spacing: 6px; }
.result-stars .star { color: var(--soft); display: inline-block; }
.result-stars .star.on { color: var(--gold); animation: starPop .5s both; text-shadow: 0 3px 0 rgba(0,0,0,.12); }
.result-line { color: var(--muted); font-weight: 700; margin: 4px 0; }
.result-score { font-size: 44px; color: var(--gold); font-weight: 600; }
.result-score small { font-size: 18px; color: var(--muted); }
.record { color: var(--gold-ink); background: var(--gold-bg); display: inline-block; padding: 4px 12px; border-radius: 99px; font-weight: 800; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }
.mistakes { text-align: left; max-width: 560px; margin: 14px auto 0; background: var(--soft); border-radius: 14px; padding: 10px 14px; }
.mistakes summary { cursor: pointer; font-weight: 800; color: var(--title); }
.mistake { border-top: 1px solid var(--card-border); padding: 10px 0; font-size: 15px; }
.mistake .big-calc { font-size: 22px; margin: 4px 0 0; }
.mistake .big-sentence { font-size: 16px; padding: 6px 10px; margin-top: 4px; }
.mistake svg { max-width: 110px; height: auto; }
.mistake .fix { color: var(--good); font-weight: 800; margin-top: 4px; }

/* Modale */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 23, 42, .55); display: grid; place-items: center; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--card); border-radius: var(--radius); padding: 22px; max-width: 400px; width: 100%; border: 3px solid var(--card-border); }
.modal-box h3 { margin: 0 0 8px; color: var(--title); font-weight: 600; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; color: var(--muted); }

/* Confettis */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }

/* Animations */
.pop-in { animation: popIn .3s ease-out; }
@keyframes popIn { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
@keyframes pulse { 50% { transform: scale(1.05); } }
@keyframes bump { 50% { transform: scale(1.25); } }
@keyframes bob { 50% { transform: translateY(-5px); } }
@keyframes starPop { 0% { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3) rotate(10deg); } 100% { transform: scale(1); } }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

@media (max-width: 420px) {
    h1 { font-size: 23px; }
    .tile { min-height: 132px; }
    .qtext { font-size: 19px; }
    .big-calc { font-size: 36px; }
    .card { padding: 18px 14px 22px; }
}

/* =========================================================
   Profils, avatar, boutique
   ========================================================= */
.avatar { display: block; flex: none; }
.avatar.big { filter: drop-shadow(0 6px 12px rgba(67, 56, 202, .25)); }
.score-pill { text-decoration: none; }
.coin-ico { font-size: 17px; line-height: 1; }
.me-chip { display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 3px; border-radius: 999px; background: var(--soft); color: var(--title); }
.me-chip .avatar { border-radius: 50%; }
.me-txt { display: flex; flex-direction: column; line-height: 1.05; }
.me-txt b { font-size: 14px; max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-txt small { font-size: 11px; color: var(--muted); font-weight: 700; }
@media (max-width: 460px) { .me-txt { display: none; } .me-chip { padding: 3px; } .brand span { display: none; } }

.small { font-size: 14px; }
.center { text-align: center; justify-content: center; }
.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.row-btns.center { justify-content: center; }
.big-btn { font-size: 20px; padding: 14px 28px; }
.err { color: var(--bad); font-weight: 800; text-align: center; }
.danger-txt { color: var(--bad) !important; border-color: var(--bad-bg) !important; }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--card); padding: 12px 20px; border-radius: 999px; font-weight: 800; box-shadow: var(--shadow); animation: slideUp .25s; transition: opacity .4s; white-space: nowrap; }
.toast.out { opacity: 0; }

/* Joueurs */
.players { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.player { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 10px; border-radius: 18px; border: 3px solid var(--soft); background: var(--paper); transition: transform .12s, border-color .15s; text-align: center; }
.player:hover { transform: translateY(-3px); border-color: var(--accent); }
.player b { font-family: Fredoka, sans-serif; font-size: 20px; font-weight: 600; color: var(--title); }
.player small { color: var(--muted); font-size: 13px; font-weight: 700; }
.player.add { border-style: dashed; justify-content: center; }
.player .plus { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; font-size: 54px; color: var(--accent); background: var(--soft); font-family: Fredoka, sans-serif; }
.backup { margin-top: 22px; border-top: 2px dashed var(--soft); padding-top: 12px; text-align: center; }
.backup .row-btns { justify-content: center; }
.backup label.btn { cursor: pointer; }

/* Éditeur */
.editor { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .editor { grid-template-columns: 220px 1fr; } }
.editor-preview { display: flex; flex-direction: column; align-items: center; gap: 8px; position: sticky; top: 70px; background: var(--card); padding: 6px 0; z-index: 2; }
.editor-preview b { font-family: Fredoka, sans-serif; font-size: 22px; color: var(--title); min-height: 1.2em; }
@media (max-width: 719px) { .editor-preview .avatar { width: 130px; height: 130px; } }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: thin; }
.tab { flex: none; border: 0; border-radius: 999px; padding: 8px 14px; font-weight: 800; font-size: 14px; background: var(--soft); color: var(--title); }
.tab.on { background: var(--accent-d); color: #fff; }
.editor-panel { padding-top: 10px; }
.editor-panel h4 { margin: 14px 0 8px; color: var(--title); font-family: Fredoka, sans-serif; font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--card); box-shadow: 0 0 0 2px var(--card-border); }
.swatch.on { box-shadow: 0 0 0 4px var(--accent); transform: scale(1.08); }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.thumb { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px; border-radius: 14px; border: 3px solid var(--soft); background: var(--paper); font-size: 12px; font-weight: 800; color: var(--muted); }
.thumb.on { border-color: var(--accent); color: var(--title); background: color-mix(in srgb, var(--accent) 10%, var(--paper)); }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-weight: 800; color: var(--title); }
.field input { font: inherit; font-size: 20px; font-weight: 700; padding: 10px 14px; border-radius: 14px; border: 3px solid var(--card-border); background: var(--paper); color: var(--ink); outline: none; max-width: 320px; }
.field input:focus { border-color: var(--accent); }
.chips-row { display: flex; flex-wrap: wrap; gap: 8px; }
.cls { border: 3px solid var(--c); background: var(--paper); color: var(--c); border-radius: 14px; padding: 8px 16px; font-family: Fredoka, sans-serif; font-size: 20px; font-weight: 600; }
.cls.on { background: var(--c); color: #fff; }

/* Accueil */
.hello { display: flex; align-items: center; justify-content: center; gap: 14px; margin-bottom: 16px; }
.hello h1, .hello .sub { text-align: left; margin: 0; }

/* Profil */
.profile { display: grid; gap: 14px; }
.profile .home-h { margin: 4px 0 -6px; }
.me-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: center; padding: 18px; border-radius: 24px; background: color-mix(in srgb, var(--c) 11%, var(--card)); }
.me-photo { display: grid; justify-items: center; flex: none; }
.me-ring { width: 156px; height: 156px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: var(--card); border: 5px solid var(--card); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 55%, transparent); }
.me-edit { position: relative; margin-top: -14px; background: var(--accent-d); color: #fff; border: 3px solid var(--card); border-radius: 999px; padding: 6px 14px; font: 600 14px Fredoka, sans-serif; text-decoration: none; white-space: nowrap; }
.me-edit:hover { filter: brightness(1.12); }
.me-id { flex: 1 1 260px; min-width: 0; display: grid; gap: 10px; }
.me-id h1 { margin: 0; text-align: left; font-size: 34px; line-height: 1.1; }
.me-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.me-rank { font-weight: 800; font-size: 14px; color: var(--gold-ink); background: var(--gold-bg); border-radius: 999px; padding: 3px 12px; }
.me-wallet { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; background: var(--card); border-radius: 999px; padding: 3px 12px; }
.me-wallet b { font: 600 17px Fredoka, sans-serif; color: var(--title); }
.me-level { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 18px; background: var(--card); }
.me-lv { flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; align-content: center; justify-items: center; background: linear-gradient(145deg, #fcd34d, #f59e0b); color: #4a2a03; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .55); }
.me-lv small { font: 800 9.5px/1 Nunito, sans-serif; text-transform: uppercase; letter-spacing: .06em; } .me-lv b { font: 600 26px/1.05 Fredoka, sans-serif; }
.me-xp { flex: 1; min-width: 0; display: grid; gap: 5px; } .me-xp small { color: var(--muted); font-weight: 700; font-size: 13px; }
.xp { height: 14px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.xp-fill { height: 100%; background: linear-gradient(90deg, #fbbf24, #f59e0b); border-radius: 99px; transition: width .6s; }
.me-links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.me-link { display: flex; align-items: center; gap: 11px; padding: 11px 12px; border-radius: 20px; text-decoration: none; color: var(--text); background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 38%, transparent); transition: transform .15s, box-shadow .15s; }
.me-link:hover, .me-subj:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(60, 50, 130, .45); }
.me-link.ready { background: color-mix(in srgb, var(--c) 10%, var(--card)); border-color: var(--c); }
.me-stats { list-style: none; margin: 0; padding: 12px 6px; display: flex; flex-wrap: wrap; row-gap: 12px; border-radius: 20px; background: color-mix(in srgb, var(--accent) 8%, var(--card)); }
.me-stats li { flex: 1 1 108px; display: grid; justify-items: center; align-content: start; text-align: center; padding: 0 6px; }
.me-stats b { font: 600 26px/1.15 Fredoka, sans-serif; color: var(--title); font-variant-numeric: tabular-nums; } .me-stats small { color: var(--muted); font-weight: 700; font-size: 12.5px; line-height: 1.25; }
.me-subjects { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.me-subj { display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px; border-radius: 18px; text-decoration: none; color: var(--text); background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 38%, transparent); transition: transform .15s, box-shadow .15s; }
.me-subj-ic { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 22px; background: color-mix(in srgb, var(--c) 17%, transparent); }
.me-subj-txt { flex: 1; min-width: 0; display: grid; gap: 6px; } .me-subj-txt > span:first-child { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.me-subj b { font: 600 16px/1.2 Fredoka, sans-serif; } .me-subj small { color: var(--muted); font-weight: 800; font-size: 12.5px; white-space: nowrap; } .me-subj .home-bar { width: 100%; }
@media (max-width: 640px) { .me-links, .me-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); } .me-id h1 { text-align: center; } .me-chips { justify-content: center; } }
@media (max-width: 440px) { .me-subjects { grid-template-columns: 1fr; } .me-link { flex-direction: column; text-align: center; gap: 6px; padding: 12px 6px; } }
.profile-foot { justify-content: space-between; margin-top: 8px; }
.small-inp { width: 100%; margin-top: 8px; font-size: 18px; }

/* Boutique */
.shop-head { display: flex; gap: 16px; align-items: center; justify-content: center; margin-bottom: 14px; }
.shop-head h1, .shop-head .sub { text-align: left; margin: 0; }
.wallet-big { margin-top: 6px; display: inline-block; background: var(--gold-bg); color: var(--gold-ink); padding: 6px 14px; border-radius: 99px; font-weight: 700; }
.wallet-big b { font-size: 20px; }
.shop-tabs { margin-bottom: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.shop-item { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 10px; border-radius: 18px; border: 3px solid var(--soft); background: var(--paper); text-align: center; }
.shop-item b { font-size: 15px; }
.shop-item small { font-size: 12px; }
.shop-item .btn { width: 100%; padding: 9px 10px; font-size: 16px; }
.shop-item.owned { border-color: color-mix(in srgb, var(--good) 50%, var(--soft)); }
.shop-item.locked .shop-prev { filter: grayscale(.9) opacity(.55); }
.tag { position: absolute; top: 8px; right: 8px; background: var(--accent-d); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 8px; border-radius: 99px; }
.tag.own { background: var(--good); }

/* Résultat */
.levelup { display: flex; align-items: center; gap: 12px; text-align: left; margin: 12px auto 0; max-width: 420px; background: linear-gradient(135deg, #fef3c7, #fde68a); color: #78350f; border-radius: 16px; padding: 10px 14px; border: 2px solid #f59e0b; }
.wallet a { color: var(--accent); font-weight: 800; }
[hidden] { display: none !important; }
.editor > * { min-width: 0; }
.editor-side { overflow: hidden; }
@media (max-width: 719px) { .editor-preview { position: static; } .editor-preview .avatar { width: 120px; height: 120px; } }

.pin-inp { letter-spacing: 8px; text-align: center; }
.pin-inp::placeholder { letter-spacing: normal; }

/* ---------- Ma chambre (POC) ---------- */
.room-screen { max-width: 920px; margin: 0 auto; }
.room-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 12px; }
.room-top h1 { margin: 0; }
.room-top-btns { display: flex; align-items: center; gap: 10px; }
.room-coins { background: var(--gold-bg); color: var(--gold-ink); border-radius: 999px; padding: 6px 14px; font-weight: 800; }
.gold-btn { background: #f59e0b; color: #fff; box-shadow: 0 4px 0 #b45309; }
.gold-btn small { opacity: .8; font-weight: 600; }
.room-stage { border-radius: 38px; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(120, 50, 100, .55), 0 0 0 6px #fff, 0 0 0 9px #ffc2d9; background: #fff; margin: 10px 8px 0; }
#roomSvg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; }
#roomSvg .it { cursor: grab; }
#roomSvg .it.lift { cursor: grabbing; filter: drop-shadow(0 10px 8px rgba(90, 42, 69, .35)); }
#roomSvg .it .in { transform-box: fill-box; transform-origin: 50% 100%; }
#roomSvg .it .popin { animation: roomPop .55s cubic-bezier(.3, 1.6, .5, 1); }
#av { cursor: pointer; }
.av-pos { transform-box: view-box; }
.av-hop { transform-box: fill-box; transform-origin: 50% 100%; animation: roomIdle 2.8s ease-in-out infinite; }
.av-pos.walking .av-hop { animation: roomHop .28s ease-in-out infinite; }
.sel { animation: roomAnts 1s linear infinite; pointer-events: none; }
.sel2 { animation-direction: reverse; }
.sway { transform-box: fill-box; transform-origin: 50% 100%; animation: roomSway 3.6s ease-in-out infinite; }
.breathe { transform-box: fill-box; transform-origin: 50% 100%; animation: roomBreathe 3s ease-in-out infinite; }
.bob { animation: roomBob 2.4s ease-in-out infinite; }
.floaty { animation: roomBob 4s ease-in-out infinite; }
.swing { transform-box: fill-box; transform-origin: 50% 0; animation: roomSwing 4s ease-in-out infinite; }
.glow { animation: roomGlow 3s ease-in-out infinite; }
.blink { animation: roomGlow 1.8s ease-in-out infinite; }
.drift { animation: roomDrift 14s linear infinite alternate; }
.drift.d2 { animation-duration: 19s; animation-direction: alternate-reverse; }
.steam { animation: roomGlow 2s ease-in-out infinite; }
.zzz { animation: roomZzz 3s ease-in-out infinite; }
.zzz.z2 { animation-delay: 1.4s; }
.spk { animation: roomTwinkle 4s ease-in-out infinite; opacity: 0; pointer-events: none; }
.say { animation: roomPop .35s cubic-bezier(.3, 1.6, .5, 1); transform-box: fill-box; transform-origin: 50% 100%; pointer-events: none; }
.burst { animation: roomBurst 1s ease-out forwards; pointer-events: none; text-anchor: middle; }
.room-bar { margin: 14px 8px 0; background: var(--card); border: 2px dashed var(--card-border); border-radius: 18px; padding: 10px 14px; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; color: var(--muted); font-size: 14px; min-height: 28px; text-align: center; }
.room-bar.on { border-style: solid; border-color: #ff9ebd; background: #fff1f6; color: #7a5560; animation: popIn .25s; }
:root[data-theme="dark"] .room-bar.on { background: #3a2342; color: #ffd6e5; }
.room-bar b { font-family: Fredoka, Nunito, sans-serif; font-size: 16px; }
.room-bar button { border: 2px solid #ffc2d9; background: #fff; border-radius: 12px; padding: 6px 10px; font: inherit; font-weight: 700; cursor: pointer; color: #7a5560; }
.room-bar button:hover { background: #ffe3ee; }
.room-bar button.danger { border-color: #ffb3b3; }
.swatches { display: inline-flex; gap: 6px; }
.room-bar .sw { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #e6b8c9; }
.room-bar .sw.on { box-shadow: 0 0 0 3px #ff7fa5; transform: scale(1.12); }
.room-shop { margin-top: 16px; }
.room-tabs { flex-wrap: wrap; }
.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 12px; margin: 14px 0; }
.room-card { background: var(--paper); border: 3px solid var(--card-border); border-radius: 20px; padding: 10px 8px 12px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; font: inherit; color: var(--text); transition: transform .15s, box-shadow .15s; }
.room-card:hover { transform: translateY(-3px) rotate(-1deg); box-shadow: 0 10px 18px -10px rgba(120, 50, 100, .5); }
.room-card.on { border-color: #ff7fa5; background: #fff1f6; }
:root[data-theme="dark"] .room-card.on { background: #3a2342; }
.room-card.poor { opacity: .75; }
.room-card b { font-family: Fredoka, Nunito, sans-serif; font-size: 14px; line-height: 1.15; }
.room-prev { width: 100%; height: 84px; }
.room-price { background: var(--gold-bg); color: var(--gold-ink); border-radius: 999px; padding: 3px 12px; font-weight: 800; font-size: 13px; }
.room-price.own { background: var(--good-bg); color: var(--good); }
@keyframes roomPop { 0% { transform: scale(0); } 70% { transform: scale(1.18, .88); } 100% { transform: scale(1); } }
@keyframes roomIdle { 50% { transform: translateY(-3px) scale(1.02, .98); } }
@keyframes roomHop { 50% { transform: translateY(-16px) rotate(4deg); } }
@keyframes roomAnts { to { stroke-dashoffset: -24; } }
@keyframes roomSway { 50% { transform: rotate(4deg); } 0%, 100% { transform: rotate(-3deg); } }
@keyframes roomBreathe { 50% { transform: scale(1.03, 1.07); } }
@keyframes roomBob { 50% { transform: translateY(-4px); } }
@keyframes roomSwing { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes roomGlow { 50% { opacity: .35; } }
@keyframes roomDrift { from { transform: translateX(-30px); } to { transform: translateX(60px); } }
@keyframes roomZzz { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
@keyframes roomTwinkle { 50% { opacity: .85; } }
@keyframes roomBurst { 0% { opacity: 1; transform: translate(0, 0) scale(.4); } 100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2); } }
@media (prefers-reduced-motion: reduce) { #roomSvg * { animation: none !important; } }

/* ---------- Mon village (3D) ---------- */
main:has(.vil-screen) { max-width: 1240px; }
.vil-screen { max-width: 1210px; margin: 0 auto; }
.vil-stage { position: relative; height: min(78vh, 760px); min-height: 380px; border-radius: 30px; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(60, 60, 120, .5), 0 0 0 6px #fff, 0 0 0 9px #bfe0ff; margin: 8px 8px 12px; transition: background .8s; touch-action: none; }
.vil-stage.day { background: linear-gradient(#bfe3ff, #eaf6ff 60%, #fff1f6); }
.vil-stage.night { background: linear-gradient(#232656, #4b4a8e 70%, #7b6aa8); }
@media (max-width: 560px) { .vil-stage:not(.int-stage) { height: min(70vh, 640px); } }
.vil-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
#vilTags, #vilFx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.vil-tag { position: absolute; left: 0; top: 0; background: #fff; color: #7a5560; font: 700 13px Fredoka, Nunito, sans-serif; padding: 4px 10px; border-radius: 999px; box-shadow: 0 3px 8px rgba(90, 60, 100, .25); white-space: nowrap; will-change: transform; }
.vil-tag.mine { background: #ff7fa5; color: #fff; }
.vil-say { position: absolute; left: 0; top: 0; background: #fff; color: #5b4038; font: 700 15px Nunito, sans-serif; padding: 8px 14px; border-radius: 18px; box-shadow: 0 6px 14px rgba(90, 60, 100, .3); white-space: nowrap; margin-top: -8px; will-change: transform; }
.vil-heart { position: absolute; font-size: 24px; animation: vilHeart 1.2s ease-out forwards; }
.vil-hud { position: absolute; right: 12px; top: 12px; display: flex; flex-direction: column; gap: 8px; }
.vil-hud button { width: 44px; height: 44px; border-radius: 50%; border: 3px solid #fff; background: rgba(255, 255, 255, .85); font-size: 20px; cursor: pointer; box-shadow: 0 4px 10px rgba(60, 60, 120, .25); }
.vil-hud button:active { transform: scale(.92); }
.vil-go { position: absolute; left: 12px; bottom: 12px; }
@keyframes vilHeart { 0% { opacity: 0; transform: translateY(0) scale(.5); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(-70px) scale(1.2); } }

/* ---------- Créateur de personnage 3D ---------- */
.ed3d { position: relative; width: 100%; aspect-ratio: 4 / 5; max-height: 52vh; border-radius: 26px; overflow: hidden; box-shadow: 0 12px 26px -12px rgba(67, 56, 202, .45), 0 0 0 5px #fff, 0 0 0 8px var(--card-border); transition: background .5s; touch-action: none; }
.ed3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.editor-preview { padding: 10px 10px 6px; }
.editor-preview small { text-align: center; }
.p3d { display: inline-block; border-radius: 50%; overflow: hidden; vertical-align: middle; flex: none; box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .7); }
.p3d img { display: block; }
.p3d.big { box-shadow: 0 0 0 4px #fff, 0 8px 18px -8px rgba(67, 56, 202, .5); }
.th3d { width: 64px; height: 64px; border-radius: 14px; background: var(--soft); }
.th3d.dec { display: block; border: 2px solid #fff; }
.chip-tog { border: 3px solid var(--soft); background: var(--paper); border-radius: 999px; padding: 8px 16px; font: 800 14px Nunito, sans-serif; color: var(--muted); cursor: pointer; }
.chip-tog.on { border-color: var(--accent); color: var(--title); background: color-mix(in srgb, var(--accent) 10%, var(--paper)); }

/* Menu du créateur : tuiles à icônes qui passent à la ligne (pas de barre de défilement) */
.ed-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; overflow: visible; padding-bottom: 4px; }
.ed-tabs .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 16px; padding: 8px 4px 7px; font-size: 13px; line-height: 1.1; border: 3px solid transparent; transition: transform .12s, background .12s; }
.ed-tabs .tab .ti { font-size: 22px; line-height: 1.1; }
.ed-tabs .tab:hover { transform: translateY(-2px); }
.ed-tabs .tab.on { border-color: color-mix(in srgb, var(--accent-d) 55%, #fff); box-shadow: 0 6px 14px -8px var(--accent-d); }
@media (max-width: 719px) { .ed-tabs { grid-template-columns: repeat(4, 1fr); } .ed-tabs .tab { padding: 7px 2px 6px; font-size: 12px; } }

.bd-chip { display: block; border-radius: 14px; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--soft); }
.thumbs { max-height: none; }

.editor-panel .swatches { padding: 4px 4px 2px; flex-wrap: wrap; }

/* ---------- Atelier de validation ---------- */
.atelier { max-width: 980px; margin: 0 auto; }
.atelier h1 small { font-size: 16px; }
.at-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 10px 0 14px; }
.at-stats > div { background: var(--soft); border-radius: 16px; padding: 10px; text-align: center; }
.at-stats b { display: block; font: 600 26px Fredoka, sans-serif; color: var(--title); }
.at-stats small { color: var(--muted); font-weight: 700; }
.at-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: flex-end; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.at-row { display: grid; grid-template-columns: 54px 50px 1fr; align-items: center; gap: 8px; padding: 10px 12px; border: 3px solid color-mix(in srgb, var(--c) 35%, #fff); border-radius: 16px; margin-bottom: 8px; background: var(--paper); color: var(--text); }
.at-row:hover { transform: translateY(-2px); }
.at-row b { font: 600 20px Fredoka, sans-serif; color: var(--c); }
.at-row small { color: var(--muted); font-weight: 700; }
.at-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.at-cell { font-size: 13px; display: flex; flex-direction: column; gap: 3px; align-items: center; }
.at-cell em { font-style: normal; font-weight: 800; }
.at-bar { display: inline-flex; width: 100%; min-width: 46px; height: 7px; background: var(--soft); border-radius: 99px; overflow: hidden; vertical-align: middle; }
.at-bar i { display: block; height: 100%; } .at-bar i.ok { background: #10b981; } .at-bar i.ko { background: #f43f5e; }
.at-tools { flex-wrap: wrap; margin-top: 14px; }
.at-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 12px; }
.at-tile { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 3px solid color-mix(in srgb, var(--c) 40%, #fff); border-radius: 18px; background: var(--paper); color: var(--text); }
.at-tile .ic { font-size: 30px; } .at-tile b { font: 600 18px Fredoka, sans-serif; color: var(--c); } .at-tile small { color: var(--muted); font-weight: 700; }
.at-list { display: grid; gap: 8px; margin-top: 10px; }
.at-item { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 2px solid var(--soft); border-radius: 14px; background: var(--paper); color: var(--text); }
.at-item.big { flex-direction: row; align-items: center; gap: 12px; } .at-item .ic { font-size: 26px; } .at-item .tx { flex: 1; display: flex; flex-direction: column; } .at-item small { color: var(--muted); } .at-item .meta { min-width: 120px; text-align: right; font-size: 12px; font-weight: 800; color: var(--muted); display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }
.at-item:hover { border-color: var(--accent); }
.at-warn { color: var(--bad); } .at-okc { color: var(--good); }
.chip-i { display: inline-block; background: var(--soft); color: var(--title); border-radius: 99px; padding: 3px 10px; font-size: 12px; font-weight: 800; margin: 2px 4px 2px 0; }
.chip-i.warn { background: var(--gold-bg); color: var(--gold-ink); } .chip-i.okc { background: var(--good-bg); color: var(--good); }
#atBarTools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; } #atBarTools select, #atBarTools input { border: 2px solid var(--card-border); border-radius: 12px; padding: 8px 10px; font: inherit; background: var(--paper); color: var(--text); }
.at-q { border: 3px solid var(--soft); border-radius: 20px; padding: 12px 14px; margin-bottom: 14px; background: var(--paper); }
.at-q.ok { border-color: #6ee7b7; } .at-q.ko { border-color: #fda4af; }
.at-q header { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; } .at-q .no { font: 600 18px Fredoka, sans-serif; color: var(--title); } .at-q .state { margin-left: auto; font-weight: 800; font-size: 13px; }
.at-warns { margin: 0 0 8px; padding: 6px 12px 6px 28px; background: var(--gold-bg); color: var(--gold-ink); border-radius: 10px; font-size: 13px; }
.at-fb { margin-top: 10px; padding: 8px 12px; border-radius: 12px; font-size: 14px; } .at-fb.ok { background: var(--good-bg); color: var(--good); } .at-fb.ko { background: var(--bad-bg); color: var(--bad); } .at-fb .ex { color: var(--text); margin-top: 4px; }
.at-sol { margin-top: 10px; padding: 8px 12px; border-radius: 12px; background: var(--soft); font-size: 14px; display: grid; gap: 4px; }
.at-q footer { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; align-items: center; } .at-q footer .sp { flex: 1; }
.at-note textarea { width: 100%; margin-top: 8px; border: 2px solid #fda4af; border-radius: 12px; padding: 8px; font: inherit; background: var(--paper); color: var(--text); }
.at-q .question { margin: 0; } .at-q .qzone { margin: 0; }
.at-nav { margin-top: 16px; flex-wrap: wrap; }
@media (max-width: 719px) { .at-row { grid-template-columns: 44px 1fr; } .at-row small { display: none; } .at-cells { grid-template-columns: repeat(3, 1fr); } }
.at-warns.info { background: var(--soft); color: var(--muted); }
.at-filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }

/* ---------- Mini-jeux ---------- */
.arcade-banner { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding: 14px 18px; border-radius: 20px; background: linear-gradient(120deg, #f43f5e, #f59e0b); color: #fff; box-shadow: 0 8px 18px -10px #f43f5e; flex-wrap: wrap; }
.arcade-banner span { font-size: 28px; } .arcade-banner b { font: 600 20px Fredoka, sans-serif; } .arcade-banner small { opacity: .9; font-weight: 700; }
.arcade-banner:hover { filter: brightness(1.06); transform: translateY(-2px); }
.arc-hub, .arc-screen { max-width: 640px; margin: 0 auto; }
.arc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 14px 0; }
.arc-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 22px; border: 3px solid color-mix(in srgb, var(--c) 45%, #fff); background: color-mix(in srgb, var(--c) 9%, var(--paper)); color: var(--text); transition: transform .15s; }
.arc-card:hover { transform: translateY(-3px) rotate(-.5deg); } .arc-card .ic { font-size: 44px; } .arc-card b { font: 600 20px Fredoka, sans-serif; color: var(--c); } .arc-card small { color: var(--muted); font-weight: 700; } .arc-card .rec { margin-top: 6px; font-weight: 800; font-size: 13px; color: var(--gold-ink); }
.arc-top { display: flex; align-items: center; justify-content: space-between; }
.arc-stage { position: relative; width: min(100%, 440px); height: min(74vh, 700px); height: min(72dvh, 700px); min-height: 420px; margin: 8px auto 10px; border-radius: 28px; overflow: hidden; background: var(--bg); box-shadow: 0 16px 34px -16px rgba(67, 56, 202, .55), 0 0 0 5px #fff, 0 0 0 8px var(--card-border); touch-action: none; user-select: none; -webkit-user-select: none; }
.arc-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.arc-ov { position: absolute; inset: 0; z-index: 5; display: flex; align-items: center; justify-content: center; background: rgba(255, 255, 255, .55); backdrop-filter: blur(3px); text-align: center; padding: 16px; }
.arc-ov[hidden] { display: none; }
.ov-card { background: #fff; border-radius: 26px; padding: 20px 22px; box-shadow: 0 14px 30px -12px rgba(60, 40, 120, .45); max-width: 320px; animation: popIn .3s; color: #5b4038; }
.ov-card .big { font-size: 54px; } .ov-card h2 { margin: 4px 0; } .ov-card p { margin: 6px 0; font-size: 14px; } .ov-card .score { font: 600 44px Fredoka, sans-serif; color: #ec4899; } .ov-card .score small { font-size: 16px; color: #7a5560; }
.ov-card .newrec { color: #db2777; font-weight: 800; } .ov-card .gain { font: 600 22px Fredoka, sans-serif; color: #d97706; } .ov-card .lines { color: #7a5560; }
.echo-msg { position: absolute; top: 18px; left: 0; right: 0; text-align: center; font: 600 22px Fredoka, sans-serif; color: #6d28d9; z-index: 2; }
.echo-grid { position: absolute; inset: 70px 18px 24px; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.echo-pad { border: 0; border-radius: 28px; background: color-mix(in srgb, var(--c) 55%, #fff); box-shadow: 0 8px 0 color-mix(in srgb, var(--c) 70%, #000 12%), 0 14px 22px -10px rgba(0, 0, 0, .3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; cursor: pointer; transition: transform .08s, filter .1s, box-shadow .08s; font: inherit; color: #5b4038; }
.echo-pad .face { font-size: 54px; } .echo-pad small { font-weight: 800; }
.echo-pad.on { background: var(--c); filter: brightness(1.12) saturate(1.2); transform: translateY(6px) scale(1.03); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 70%, #000 12%), 0 0 30px var(--c); }
.echo-pad.bad { animation: shake .35s; background: #fecaca; }

.arc-h { font: 600 20px Fredoka, sans-serif; color: var(--title); margin: 18px 0 4px; }
.arc-hud { position: absolute; top: 10px; left: 12px; right: 12px; display: flex; justify-content: space-between; align-items: center; z-index: 3; pointer-events: none; font: 600 18px Fredoka, sans-serif; color: #5b4038; gap: 8px; }
.arc-hud span { background: rgba(255, 255, 255, .85); border-radius: 14px; padding: 4px 12px; }
.arc-hud:empty { display: none; }
.arc-hud span { white-space: nowrap; }
.arc-hud span.vies8 { font-size: 13px; padding: 4px 8px; }
.arc-hud span:nth-child(3) { padding: 4px 8px; font-size: 14px; }       /* trois pastilles (score, avancée, cœurs ou chrono) : tout tient sur un téléphone */
.arc-hud span:first-child:nth-last-child(3), .arc-hud span:nth-child(2):nth-last-child(2) { padding: 4px 8px; }
/* jeux de révision en DOM */
.lg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: stretch; padding: 56px 14px 14px; gap: 10px; z-index: 2; color: #5b4038; font-family: Nunito, sans-serif; }
.lg .q { background: #fff; border-radius: 22px; padding: 14px; text-align: center; box-shadow: 0 8px 18px -10px rgba(0, 0, 0, .35); font: 600 30px Fredoka, sans-serif; }
.lg .q small { display: block; font: 700 14px Nunito, sans-serif; color: #7a5560; margin-top: 4px; }
.lg-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lg-btn { border: 0; border-radius: 20px; padding: 16px 8px; font: 600 26px Fredoka, sans-serif; background: #fff; color: #4b2e3a; box-shadow: 0 6px 0 rgba(120, 90, 130, .25); cursor: pointer; transition: transform .08s; }
.lg-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(120, 90, 130, .25); }
.lg-btn.good { background: #bbf7d0; } .lg-btn.bad { background: #fecaca; animation: shake .3s; }
.lg-track { background: rgba(255, 255, 255, .7); border-radius: 18px; padding: 8px 10px; display: grid; gap: 6px; }
.lg-lane { position: relative; height: 46px; background: repeating-linear-gradient(90deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 10%); border-radius: 12px; overflow: hidden; }
.lg-lane .runner { position: absolute; top: 0; transition: left .35s cubic-bezier(.3, 1.4, .5, 1); font-size: 30px; line-height: 46px; display: flex; align-items: center; }
.lg-lane .flag { position: absolute; right: 4px; top: 0; font-size: 26px; line-height: 46px; }
.lg-bar { height: 12px; border-radius: 99px; background: rgba(255, 255, 255, .7); overflow: hidden; } .lg-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #fbbf24, #f43f5e); transition: width .2s linear; }
.lg-pizza { align-self: center; width: min(78%, 280px); aspect-ratio: 1; } .lg-pizza svg { width: 100%; height: 100%; overflow: visible; } .lg-pizza path { cursor: pointer; transition: transform .12s, fill .12s; transform-origin: 50% 50%; } .lg-pizza path:hover { filter: brightness(1.05); }
.lg-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; } .lg-row .lg-btn { font-size: 20px; padding: 12px 18px; }
.lg-coin { width: 64px; height: 64px; border-radius: 50%; font-size: 17px; padding: 0; } .lg-note { border-radius: 14px; width: 86px; height: 52px; padding: 0; font-size: 17px; background: #bbf7d0; }
.lg-beam { align-self: center; width: 90%; height: 150px; position: relative; margin-top: 8px; }
.lg-beam .beam { position: absolute; left: 6%; right: 6%; top: 44px; height: 12px; border-radius: 8px; background: #a16207; transform-origin: 50% 50%; transition: transform .6s cubic-bezier(.3, 1.5, .5, 1); }
.lg-beam .pan { position: absolute; top: 58px; width: 110px; min-height: 56px; background: #fff; border-radius: 0 0 40px 40px; text-align: center; font: 600 28px Fredoka, sans-serif; padding: 6px; box-shadow: 0 6px 12px -6px rgba(0, 0, 0, .4); transition: transform .6s cubic-bezier(.3, 1.5, .5, 1); }
.lg-beam .stand { position: absolute; left: 50%; top: 50px; width: 12px; height: 96px; background: #78350f; transform: translateX(-50%); border-radius: 6px; }
.lg-letters { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; } .lg-slot { width: 44px; height: 54px; border-radius: 12px; background: #fff; border-bottom: 5px solid #a78bfa; font: 600 30px Fredoka, sans-serif; display: flex; align-items: center; justify-content: center; }
.lg-bins { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: auto; } .lg-bin { border: 0; border-radius: 18px; padding: 12px 4px; color: #fff; font: 700 13px Nunito, sans-serif; display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 5px 0 rgba(0, 0, 0, .2); cursor: pointer; } .lg-bin span { font-size: 28px; }
.lg-item { position: absolute; left: 0; right: 0; text-align: center; font-size: 58px; pointer-events: none; } .lg-item small { display: block; font: 700 15px Nunito, sans-serif; background: #fff; border-radius: 10px; padding: 2px 10px; width: fit-content; margin: 0 auto; }
.lg-toast { position: absolute; left: 0; right: 0; top: 40%; text-align: center; font: 700 30px Fredoka, sans-serif; color: #fff; text-shadow: 0 2px 0 #7a5560, 0 0 10px rgba(0,0,0,.2); pointer-events: none; animation: vilHeart 1s ease-out forwards; z-index: 4; }

.lg-coin, .lg-note { white-space: nowrap; font-size: 16px; }
.lg-coin { width: 62px; height: 62px; }

/* Trie-tout : poubelles dessinées */
.lg-bins { gap: 6px; } .lg-bin { background: transparent !important; box-shadow: none !important; color: #3f2d3a; padding: 0 0 2px; gap: 0; font: 800 13px Nunito, sans-serif; transition: transform .15s; }
.lg-bin small { font: 700 10.5px Nunito, sans-serif; opacity: .8; line-height: 1.1; min-height: 24px; }
.lg-bin .bin-svg { width: 100%; max-width: 92px; height: auto; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .15)); }
.lg-bin .lid { transform-origin: 8% 100%; transition: transform .18s; transform-box: fill-box; }
.lg-bin.over { transform: scale(1.12); } .lg-bin.over .lid { transform: rotate(-22deg) translateY(-3px); }
.lg-bin:active { transform: scale(.96); }

/* ---------- Compte parent (connexion, inscription, mon compte) ---------- */
.brand-logo { border-radius: 10px; display: block; }
@keyframes syncPulse { 50% { opacity: .45; } }
body.is-guest #coinsBtn, body.is-guest #meBtn, body.is-guest #syncBtn { display: none !important; }
.auth-card { max-width: 440px; margin: 18px auto; text-align: center; }
.auth-logo { display: block; margin: 4px auto 8px; border-radius: 24px; box-shadow: 0 10px 26px -10px rgba(139, 123, 255, .7); animation: authBob 3.2s ease-in-out infinite; }
@keyframes authBob { 50% { transform: translateY(-4px) rotate(-2deg); } }
.auth-card form, .acc-form { display: grid; gap: 12px; text-align: left; margin-top: 14px; }
.auth-f { display: grid; gap: 4px; }
.auth-f > span:first-child { font-size: 14px; font-weight: 700; color: var(--muted); }
.auth-f .answer-input { font-size: 18px; font-weight: 600; text-align: left; width: 100%; }
.auth-pw { position: relative; display: flex; }
.auth-pw .answer-input { padding-right: 48px; }
.auth-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; padding: 8px; opacity: .6; cursor: pointer; }
.auth-go { width: 100%; justify-content: center; }
.auth-msg { margin: 0; padding: 10px 12px; border-radius: 12px; font-size: 14px; font-weight: 600; text-align: left; }
.auth-msg.err { background: var(--bad-bg); color: var(--bad); }
.auth-msg.ok { background: var(--good-bg); color: var(--good); }
.auth-msg[hidden] { display: none; }
.auth-legal { text-align: left; margin: 0; line-height: 1.5; }
.auth-links { margin: 14px 0 4px; }
.linkish { background: none; border: 0; color: var(--accent-d); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; padding: 4px; }
[data-theme="dark"] .linkish { color: var(--title); }
.auth-guest { background: var(--gold-bg); color: var(--gold-ink); margin-top: 10px; }
.auth-sep { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; margin: 10px 0; }
.auth-sep::before, .auth-sep::after { content: ""; flex: 1; border-top: 2px dashed var(--card-border); opacity: .6; }
.auth-banner { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; padding: 8px 14px; background: var(--gold-bg); color: var(--gold-ink); font-size: 14px; font-weight: 600; text-align: center; }
.auth-banner[hidden] { display: none; }
.auth-banner .linkish { color: inherit; }
.acc { max-width: 560px; margin-left: auto; margin-right: auto; }
.acc-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--soft); border-radius: 16px; padding: 12px 14px; margin: 10px 0 4px; }
.acc .row-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-btn { background: var(--bad-bg); color: var(--bad); border: 2px solid var(--bad); }

/* ---------- Tablette (portrait ≥ 720 px) : on profite de la place ---------- */
@media (min-width: 720px) {
    .shop-tabs { flex-wrap: wrap; overflow: visible; }                 /* plus de barre coupée */
    .arc-hub, .arc-screen { max-width: 760px; }
}
@media (min-width: 720px) and (min-height: 880px) {
    /* scène de jeu plus grande, même proportions que sur téléphone (≈ 0,63) */
    .arc-stage { width: min(100%, 540px); height: min(78dvh, 860px); }
}

/* ---------- Mini-jeux : pause, quitter, choix du niveau ---------- */
.arc-btns { display: flex; gap: 8px; align-items: center; }
.arc-btns .icon-btn[hidden] { display: none; }
.arc-ov.pause { background: rgba(60, 40, 110, .45); backdrop-filter: blur(5px); }
.arc-ov .row-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.arc-pick { margin: 8px 0 4px; }
.arc-pick small { display: block; font: 800 12px Nunito, sans-serif; color: #7a5560; text-transform: uppercase; letter-spacing: .04em; margin: 8px 0 4px; }
.arc-pick em { font-size: 12px; color: #a16207; font-style: normal; font-weight: 700; }
.arc-chips { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.arc-chip { border: 2px solid #e2d4f0; background: #fff; border-radius: 999px; padding: 5px 13px; font: 700 14px Nunito, sans-serif; color: #5b4038; cursor: pointer; }
.arc-chip.on { background: #8b7bff; border-color: #8b7bff; color: #fff; }
.ov-card { max-height: 100%; overflow-y: auto; }

/* ---------- La caisse : un petit supermarché ---------- */
.lg.cs { overflow-y: auto; gap: 7px; padding-top: 52px; background: linear-gradient(#fff7d6, #ffe7c2 55%, #ffd9a8); }
.cs-awn { flex: none; height: 26px; border-radius: 10px 10px 18px 18px; background: repeating-linear-gradient(90deg, #ef4444 0 26px, #fff 26px 52px); box-shadow: 0 4px 0 rgba(120, 50, 40, .25); display: grid; place-items: center; }
.cs-awn span { background: #fff; color: #b91c1c; border-radius: 8px; padding: 0 12px; font: 800 12px Fredoka, sans-serif; letter-spacing: .12em; }
.cs-belt { position: relative; flex: none; height: 118px; }
.cs-roll { position: absolute; left: -4px; right: -4px; bottom: 0; height: 24px; border-radius: 12px; background: repeating-linear-gradient(90deg, #7c8798 0 18px, #5b6678 18px 22px); box-shadow: 0 5px 0 #3f4858; }
.cs-item { position: absolute; left: 50%; bottom: 20px; transform: translateX(-50%); text-align: center; }
.cs-item.enter { animation: shopIn .6s cubic-bezier(.2, .9, .3, 1.2); }
@keyframes shopIn { from { transform: translateX(-190%) rotate(-8deg); } to { transform: translateX(-50%); } }
.cs-art svg { width: 84px; height: 84px; display: block; margin: 0 auto; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .22)); }
.cs-name { background: #fff; border-radius: 10px; padding: 1px 10px; font: 800 13px Nunito, sans-serif; color: #5b4038; white-space: nowrap; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.cs-bar { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.cs-price, .cs-gives { background: #fff; border-radius: 16px; padding: 6px 8px; text-align: center; box-shadow: 0 4px 0 rgba(120, 90, 60, .18); }
.cs-bar small { display: block; font: 800 11px Nunito, sans-serif; color: #7a5560; text-transform: uppercase; letter-spacing: .05em; }
.cs-price { background: #14532d; }
.cs-price small { color: #86efac; }
.cs-price b { font: 600 30px Fredoka, sans-serif; color: #bbf7d0; text-shadow: 0 0 8px rgba(134, 239, 172, .5); }
.cs-paybill svg { width: 108px; height: auto; display: block; margin: 2px auto; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .25)); }
.cs-gives span { font: 700 14px Fredoka, sans-serif; color: #5b4038; }
.cs-lcd { flex: none; background: #1f2937; color: #e5e7eb; border-radius: 12px; padding: 6px 12px; text-align: center; font: 600 16px Fredoka, sans-serif; }
.cs-lcd b { color: #fde047; font-size: 22px; margin-left: 4px; }
.cs-tray { flex: none; min-height: 52px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; justify-content: center; padding: 5px; border-radius: 14px; border: 3px dashed #d6b98a; background: rgba(255, 255, 255, .6); }
.cs-tray:empty::before { content: 'Tes pièces et billets apparaissent ici'; font: 700 12px Nunito, sans-serif; color: #a8907a; }
.cs-put { border: 0; background: none; padding: 0; cursor: pointer; width: 54px; display: block; animation: popIn .2s; }
.cs-put svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.cs-drawer { flex: none; background: #fff3d6; border-radius: 16px; padding: 8px; box-shadow: inset 0 3px 6px rgba(120, 80, 20, .2); display: grid; gap: 8px; }
.cs-coins, .cs-bills { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; }
.cs-coin, .cs-bill { border: 0; background: none; padding: 0; cursor: pointer; transition: transform .08s; -webkit-tap-highlight-color: transparent; }
.cs-coin svg, .cs-bill svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 3px 2px rgba(0, 0, 0, .28)); }
.cs-bill { width: 98px; }
.cs-coin:active, .cs-bill:active { transform: scale(.9); }
.lg.cs .lg-row { flex: none; } .lg.cs .lg-row .lg-btn { font-size: 18px; padding: 9px 16px; }

/* Trie-tout : déchets dessinés */
.lg-ico svg { width: 92px; height: 92px; display: block; margin: 0 auto 2px; filter: drop-shadow(0 4px 3px rgba(0, 0, 0, .22)); }

/* ---------- Compactage (petits écrans) ---------- */
.lg.cs { padding-top: 46px; gap: 6px; }
.cs-belt { height: 106px; }
.cs-art svg { width: 66px; height: 66px; }
.cs-name { font-size: 12px; }
.cs-paybill svg { width: 92px; }
.cs-price b { font-size: 26px; }
.cs-gives span { font-size: 13px; }
.cs-bar small { font-size: 10px; }
.cs-lcd { padding: 4px 12px; font-size: 14px; } .cs-lcd b { font-size: 19px; }
.cs-tray { min-height: 44px; padding: 3px; } .cs-put { width: 46px; }
.cs-bill { width: 82px; }
.cs-drawer { padding: 6px; gap: 6px; }
.lg.cs .lg-row .lg-btn { font-size: 16px; padding: 7px 14px; }
.arc-chip { padding: 4px 11px; font-size: 13px; }
.arc-chip[data-opt] { font-size: 20px; padding: 2px 16px; min-width: 52px; }
.ov-card { padding: 14px 16px; } .ov-card .big { font-size: 44px; }
.ov-card p { font-size: 13px; margin: 4px 0; }
.arc-pick small { margin: 6px 0 3px; }

.cs-price { display: flex; flex-direction: column; justify-content: center; }
.cs-gives { display: flex; flex-direction: column; justify-content: center; }
.cs-belt { height: 120px; } .cs-item { bottom: 32px; z-index: 1; } .cs-art svg { width: 62px; height: 62px; }
.cs-bill { width: 74px; }

/* ---------- Puzzles et coloriages ---------- */
.lg.pz { align-items: center; gap: 8px; overflow-y: auto; }
.pz-board { position: relative; width: min(100%, 340px); aspect-ratio: 1; flex: none; background: #fff; border-radius: 16px; padding: 6px; box-shadow: 0 8px 18px -10px rgba(60, 40, 120, .45); touch-action: manipulation; user-select: none; }
.pz-board > svg { width: 100%; height: 100%; display: block; }
.pz-board svg g[data-i] { cursor: pointer; transition: opacity .2s; }
.pz-board g.pop { transform-box: fill-box; transform-origin: center; animation: pzPop .28s; }
@keyframes pzPop { 50% { transform: scale(1.3); } }
.pz-board.done, .lg.pz.shine .pz-board { animation: pzDone .8s; }
@keyframes pzDone { 30% { transform: scale(1.04) rotate(-1deg); } 60% { transform: scale(1.04) rotate(1deg); } }
.pz-legend { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; flex: none; }
.pz-legend.wig { animation: shake .4s; }
.pz-sw { position: relative; width: 58px; height: 58px; border-radius: 50%; border: 4px solid #fff; background: var(--c); box-shadow: 0 4px 0 rgba(60, 40, 90, .25); cursor: pointer; display: grid; place-items: center; transition: transform .1s; }
.pz-sw b { font: 700 22px Fredoka, sans-serif; color: #3b2a6b; text-shadow: 0 0 5px #fff, 0 0 3px #fff; }
.pz-sw small { position: absolute; right: -4px; bottom: -4px; background: #3b2a6b; color: #fff; border-radius: 999px; min-width: 20px; padding: 0 4px; font: 700 11px Nunito, sans-serif; }
.pz-sw.on { transform: scale(1.14); border-color: #3b2a6b; box-shadow: 0 0 0 3px #fff, 0 6px 10px rgba(60, 40, 90, .35); }
.pz-sw.fin { opacity: .45; }
.pz-note { font: 700 12px Nunito, sans-serif; color: #7a5560; text-align: center; max-width: 320px; flex: none; }
.pz-pal { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; max-width: 340px; flex: none; }
.pz-col { width: 34px; height: 34px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(60, 40, 90, .3); cursor: pointer; padding: 0; }
.pz-col.on { box-shadow: 0 0 0 3px #3b2a6b; transform: scale(1.12); }
.pz-tools { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; flex: none; }
.pz-tool { border: 0; background: #fff; border-radius: 14px; padding: 5px 12px; font-size: 22px; line-height: 1.1; box-shadow: 0 4px 0 rgba(60, 40, 90, .22); cursor: pointer; display: grid; place-items: center; min-width: 64px; }
.pz-tool small { font: 800 11px Nunito, sans-serif; color: #5b4038; }
.pz-tool.on { background: #8b7bff; } .pz-tool.on small { color: #fff; }
.pz-tool.fin { background: #bbf7d0; }
.pz-peek { position: absolute; inset: 6px; z-index: 4; border-radius: 10px; overflow: hidden; box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(0, 0, 0, .35); }
.pz-peek[hidden] { display: none; }
.pz-peek svg { width: 100%; height: 100%; display: block; }
.pz-board.jig { gap: 3px; }
.pz-piece { padding: 0; border: 3px solid #fff; border-radius: 8px; overflow: hidden; background: #fff; cursor: pointer; box-shadow: 0 2px 0 rgba(60, 40, 90, .2); transition: transform .1s; min-width: 0; min-height: 0; }
.pz-piece svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pz-piece.sel { transform: scale(.92); border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139, 92, 246, .4); }
.pz-piece.ok { border-color: #4ade80; cursor: default; }
.pz-inner { position: absolute; inset: 6px; }
.pz-tile { position: absolute; left: 0; top: 0; padding: 0; margin: 0; border: 3px solid #fff; border-radius: 10px; overflow: hidden; cursor: pointer; background: #fff; transition: transform .18s ease-out; box-shadow: 0 2px 0 rgba(60, 40, 90, .25); box-sizing: border-box; }
.pz-tile svg { width: 100%; height: 100%; display: block; pointer-events: none; }
.pz-tile i { position: absolute; right: 4px; bottom: 2px; font: 700 13px Fredoka, sans-serif; color: #fff; text-shadow: 0 0 3px #3b2a6b, 0 0 3px #3b2a6b; font-style: normal; }
.pz-tile.ok { border-color: #4ade80; }

/* ---------- Boutique : essayage 3D ---------- */
.shop-prev[data-try] { cursor: pointer; }
.try-btn { margin-bottom: 6px; }
.modal-box.try-box { max-width: 360px; }
.try-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.try-name { text-align: center; line-height: 1.2; } .try-name b { display: block; font: 600 19px Fredoka, sans-serif; color: var(--title); } .try-name small { color: var(--muted); font-weight: 700; }
.try3d { width: 100%; height: 300px; border-radius: 22px; overflow: hidden; position: relative; background: var(--soft); box-shadow: inset 0 0 0 3px #fff; }
.try3d canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.try-info { margin: 8px 0 0; font-weight: 700; color: var(--text); }

/* ---------- Chambre : vignettes 3D ---------- */
img.room-prev { object-fit: contain; width: 100%; height: 96px; display: block; }
.room-grid { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }

/* ---------- Chambre : agrandissement ---------- */
.room-ext { grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; text-align: center; padding: 14px; border-radius: 20px; border: 3px dashed var(--card-border); background: var(--paper); }
.room-ext.own { border-style: solid; border-color: #86efac; }
.room-ext b { font: 600 22px Fredoka, sans-serif; color: var(--title); } .room-ext p { margin: 0; max-width: 460px; color: var(--text); }
.room-ext-art { width: min(280px, 90%); height: auto; }
.room-seg { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: center; }
.room-seg button { border: 3px solid var(--card-border); background: var(--paper); color: var(--title); border-radius: 999px; padding: 6px 16px; font: 700 15px Nunito, sans-serif; cursor: pointer; }
.room-seg button.on { background: #8b7bff; border-color: #8b7bff; color: #fff; }

/* ---------- Créateur : flèches pour défiler + vignettes qui se remplissent ---------- */
.steppers { display: grid; gap: 6px; margin: 0 0 14px; }
.stepper { display: grid; grid-template-columns: 52px 1fr 52px; align-items: center; background: var(--soft); border: 3px solid transparent; border-radius: 18px; cursor: pointer; }
.stepper.on { border-color: var(--accent); background: var(--paper); box-shadow: 0 4px 0 color-mix(in srgb, var(--accent) 35%, transparent); }
.st-btn { height: 50px; border: 0; background: none; font-size: 22px; color: var(--title); border-radius: 14px; cursor: pointer; touch-action: manipulation; }
.st-btn:hover { background: color-mix(in srgb, var(--accent) 14%, transparent); } .st-btn:active { transform: scale(.88); }
.st-mid { text-align: center; line-height: 1.15; min-width: 0; }
.st-mid small { display: block; font: 800 11px Nunito, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.st-mid b { font: 600 18px Fredoka, sans-serif; color: var(--title); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.st-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .25); vertical-align: -3px; }
.st-hint { margin: 2px 0 0; text-align: center; font-size: 12px; color: var(--muted); }
@media (hover: none) { .st-hint { display: none; } }
.th3d.ld { opacity: .35; background: var(--soft); border-radius: 14px; animation: thPulse 1s ease-in-out infinite; }
@keyframes thPulse { 50% { opacity: .15; } }

/* ---------- Créateur : la liste des choix défile dans sa zone (onglets et flèches restent toujours visibles) ---------- */
.editor-side { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
.editor-side > .ed-tabs, .editor-side > .steppers { flex: none; }
.editor-panel { flex: 1 1 auto; min-height: 150px; overflow-y: auto; overscroll-behavior: contain; padding-right: 6px; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--accent) 45%, transparent) transparent; }
.editor-panel::-webkit-scrollbar { width: 8px; } .editor-panel::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--accent) 40%, transparent); border-radius: 8px; }
@media (min-width: 720px) { .editor-side { max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); } }
@media (max-width: 719px) {
    .editor-panel { max-height: 42vh; max-height: 42dvh; }
    .stepper { grid-template-columns: 44px 1fr 44px; } .st-btn { height: 42px; font-size: 20px; } .st-mid b { font-size: 16px; }
    .steppers { margin-bottom: 8px; gap: 4px; }
}

/* Créateur sur téléphone : l'aperçu reste collé en haut (petit), tout le reste tient dans l'écran */
@media (max-width: 719px) {
    .editor { gap: 6px; }
    .editor-preview { position: sticky; top: 0; z-index: 6; display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: 12px; row-gap: 0; padding: 6px 4px; border-radius: 0 0 18px 18px; box-shadow: 0 6px 12px -10px rgba(40, 30, 100, .4); }
    .editor-preview .ed3d { grid-row: 1 / span 2; width: 36vw; max-width: 160px; height: 24vh; height: 24dvh; min-height: 130px; max-height: none; aspect-ratio: auto; }
    .editor-preview b.ed-name { align-self: end; text-align: left; font-size: 20px; }
    .editor-preview small { align-self: start; text-align: left !important; font-size: 12px; }
    .ed-tabs { grid-template-columns: repeat(5, 1fr) !important; gap: 4px; }
    .ed-tabs .tab { padding: 5px 1px 4px !important; font-size: 10.5px !important; }
    .ed-tabs .tab .ti { font-size: 18px; }
    .editor-panel { max-height: calc(100vh - 24vh - 300px); max-height: calc(100dvh - 24dvh - 300px); min-height: 140px; }
}

/* ---- âges des jeux + jeux des petits (sans lecture) ---- */
.arc-card .age { align-self: flex-start; margin-top: 4px; padding: 2px 10px; border-radius: 99px; background: color-mix(in srgb, var(--c) 18%, #fff); color: var(--c); font: 700 12px Nunito, sans-serif; }
.arc-card.off { opacity: .6; }
.ov-card .age-tag { margin: -4px 0 6px; font-weight: 800; color: var(--muted); font-size: 13px; }
.ty { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 10px; padding: 52px 10px 12px; height: 100%; box-sizing: border-box; overflow: auto; }
.ty-prompt { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; position: relative; }
.ty-say { order: 9; border: 0; background: #fff; border-radius: 50%; width: 40px; height: 40px; font-size: 20px; box-shadow: 0 3px 8px rgba(0,0,0,.15); cursor: pointer; }
.ty-big { font-size: 58px; line-height: 1; } .ty-target { display: flex; align-items: center; gap: 10px; } .ty-lens { font-size: 34px; }
.ty-pile { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; max-width: 100%; line-height: 1.05; } .ty-pile i { font-style: normal; }
.ty-seq { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; font-size: 40px; } .ty-seq i { font-style: normal; } .ty-q { animation: tyq 1s infinite alternate; } @keyframes tyq { to { transform: scale(1.2); } }
.ty-hint { font-size: 40px; opacity: .5; }
.ty-shadow { font-size: 110px; line-height: 1.1; filter: brightness(0) opacity(.75); transition: filter .5s; } .ty-shadow.reveal { filter: none; }
.ty-board { display: grid; gap: 10px; width: 100%; max-width: 420px; margin-top: 4px; }
.ty-board.c2 { grid-template-columns: repeat(2, 1fr); } .ty-board.c3 { grid-template-columns: repeat(3, 1fr); } .ty-board.c4 { grid-template-columns: repeat(4, 1fr); } .ty-board.c5 { grid-template-columns: repeat(5, 1fr); }
.ty-choice { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 78px; padding: 6px; border: 3px solid #fff; border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 0 4px 0 rgba(0,0,0,.12); cursor: pointer; font: inherit; }
.ty-choice.sq { aspect-ratio: 1; min-height: 0; } .ty-choice.tall { min-height: 150px; }
.ty-choice:active { transform: translateY(2px); } .ty-choice.good { border-color: #22c55e; background: #dcfce7; animation: tyhop .5s; } .ty-choice.bad { border-color: #fca5a5; background: #fee2e2; opacity: .5; animation: tyshake .35s; }
@keyframes tyhop { 40% { transform: scale(1.12) rotate(-3deg); } } @keyframes tyshake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.ty-num { font: 700 38px Fredoka, sans-serif; color: var(--title); } .ty-num.sm { font-size: 22px; } .ty-num.big { font-size: 56px; } .ty-emo { font-size: 44px; line-height: 1; }
.ty-board.mem { gap: 8px; } .ty-card { position: relative; aspect-ratio: 1; border: 3px solid #fff; border-radius: 16px; background: #fdba74; box-shadow: 0 4px 0 rgba(0,0,0,.12); font: inherit; cursor: pointer; padding: 0; }
.ty-card .back, .ty-card .front { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 34px; transition: opacity .2s; } .ty-card .front { opacity: 0; background: #fff; border-radius: 13px; }
.ty-card.up .front, .ty-card.done .front { opacity: 1; } .ty-card.done { border-color: #22c55e; }

.ed-dice { width: 100%; margin-bottom: 8px; font-weight: 800; }
.tile-foot { margin-top: 2px; }

/* ---- vrai puzzle à pièces ---- */
.lg.jg { padding: 52px 0 0; gap: 0; display: flex; flex-direction: column; align-items: center; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.jg-board { position: relative; flex: none; background: #fff; border-radius: 10px; box-shadow: 0 8px 18px -10px rgba(60, 40, 120, .5), 0 0 0 4px #fff; }
.jg-bsvg, .jg-bsvg svg { width: 100%; height: 100%; display: block; border-radius: 8px; }
.jg-peek { position: absolute; inset: 0; z-index: 90; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 4px #fff, 0 10px 24px rgba(0, 0, 0, .35); background: #fff; } .jg-peek[hidden] { display: none; }
.jg-piece { position: absolute; touch-action: none; cursor: grab; filter: drop-shadow(0 3px 3px rgba(60, 40, 90, .35)); transition: transform .12s, filter .12s; z-index: 10; }
.jg-piece svg { display: block; overflow: visible; pointer-events: none; }
.jg-piece.drag { cursor: grabbing; transform: scale(1.06); filter: drop-shadow(0 8px 8px rgba(60, 40, 90, .4)); }
.jg-piece.locked { pointer-events: none; filter: none; animation: jgsnap .25s; }
.lg.jg.done .jg-piece .o { opacity: 0; transition: opacity .6s; }
.lg.jg .pz-tools { margin-top: 8px; }
@keyframes jgsnap { 50% { transform: scale(1.05); } }

.ty-board > * { min-width: 0; overflow: hidden; }
.ty-grid5 { display: grid; grid-template-columns: repeat(5, 1fr); width: 100%; text-align: center; gap: 1px 3px; justify-content: center; line-height: 1.1; } .ty-grid5 i { font-style: normal; }

.ty-chip { font-size: 30px; line-height: 1; padding: 4px 8px; border-radius: 14px; background: #fff; border: 3px dashed #f59e0b; }
.ty-target { padding-bottom: 4px; }
.ty-pile { background: rgba(255,255,255,.75); border-radius: 18px; padding: 8px 10px; box-shadow: inset 0 0 0 3px #fff; }

.room-bar.pv { border-style: solid; border-color: #8b7bff; background: #f1eeff; color: #3b2a6b; animation: popIn .25s; } .room-bar.pv[hidden] { display: none; }
:root[data-theme="dark"] .room-bar.pv { background: #2a2350; color: #e0dcff; }
.room-card.pv { outline: 4px solid #8b7bff; outline-offset: 2px; }

/* ---------- Album des badges ---------- */
.bdg-banner { position: relative; display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 14px 18px; border-radius: 20px; background: linear-gradient(120deg, #a855f7, #ec4899); color: #fff; box-shadow: 0 8px 18px -10px #a855f7; flex-wrap: wrap; }
.bdg-banner span { font-size: 28px; } .bdg-banner b { font: 600 20px Fredoka, sans-serif; } .bdg-banner small { opacity: .95; font-weight: 800; }
.bdg-banner:hover { filter: brightness(1.06); transform: translateY(-2px); }
.bdg-dot { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); min-width: 26px; height: 26px; padding: 0 7px; border-radius: 999px; background: #fff; color: #db2777; font: 800 14px/26px Nunito, sans-serif; text-align: center; animation: bdgBeat 1.4s infinite; }
@keyframes bdgBeat { 50% { transform: translateY(-50%) scale(1.15); } }
/* La vitrine du profil : un écrin de velours sombre sur lequel les badges pastel ressortent. */
.vitrine { display: grid; gap: 10px; padding: 16px 16px 12px; border-radius: 24px; text-decoration: none; color: #fff; background: radial-gradient(120% 90% at 50% 0%, #54418f, #2c2360 70%); box-shadow: inset 0 0 0 2px rgba(253, 224, 138, .55), 0 12px 24px -16px #2c2360; }
.vit-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; } .vit-head b { font: 600 20px Fredoka, sans-serif; color: #fde68a; }
.vit-count { font-weight: 800; font-size: 14px; color: #e4ddff; } .vit-count strong { font: 600 22px Fredoka, sans-serif; color: #fff; }
.vit-track { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .16); overflow: hidden; } .vit-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #fde68a, #f59e0b); }
.vit-shelf { list-style: none; margin: 0; padding: 8px 0 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.vit-slot { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: center; align-content: start; gap: 8px; text-align: center; min-width: 0; }
.vit-medal { position: relative; width: min(100%, 96px); aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle, rgba(255, 255, 255, .26), rgba(255, 255, 255, .06) 68%, transparent 71%); }
.vit-medal img { width: 90%; height: 90%; object-fit: contain; filter: drop-shadow(0 6px 6px rgba(10, 5, 40, .5)); transition: transform .2s; }
.vitrine:hover .vit-medal img { transform: translateY(-3px) rotate(-3deg); }
.vit-slot.pinned .vit-medal::after { content: '📌'; position: absolute; top: -4px; right: 2px; font-size: 15px; }
.vit-slot.empty .vit-medal { width: min(86%, 82px); margin-block: 6px; border: 2px dashed rgba(255, 255, 255, .34); background: none; font: 600 28px Fredoka, sans-serif; color: rgba(255, 255, 255, .5); }
.vit-slot small { font-weight: 800; font-size: 12.5px; line-height: 1.2; overflow-wrap: anywhere; } .vit-slot.empty small { color: #c3b8ee; }
.vit-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, .16); padding-top: 10px; } .vit-foot small { color: #d6cdfb; font-weight: 700; font-size: 13px; }
.vit-go { background: #fde68a; color: #3a2a05; border-radius: 999px; padding: 6px 14px; font: 600 14px Fredoka, sans-serif; }
@media (max-width: 520px) { .vitrine { padding: 14px 12px 12px; } .vit-shelf { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 4px; } .vit-slot { flex: 0 0 31%; } .vit-medal { width: 82px; } .vit-slot small { font-size: 11.5px; } .vit-slot.empty .vit-medal { width: 70px; } }
.bdg-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bdg-count { font: 600 22px Fredoka, sans-serif; color: var(--title); background: var(--soft); padding: 4px 16px; border-radius: 999px; }
.bdg-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 2px; }
.bdg-tabs button { flex: 0 1 auto; border: 3px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 14px; font: 700 14px Nunito, sans-serif; cursor: pointer; white-space: nowrap; }
.bdg-tabs button small { opacity: .7; margin-left: 4px; } .bdg-tabs button.on { background: var(--accent); border-color: var(--accent-d); color: #fff; }
.bdg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 12px; margin: 8px 0 16px; }
.bdg-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px 12px; border: 3px solid var(--card-border); border-radius: 20px; background: var(--paper); color: var(--text); font: inherit; cursor: pointer; text-align: center; position: relative; }
.bdg-cell.on { border-color: #f9a8d4; box-shadow: 0 6px 14px -8px #ec4899; } .bdg-cell.on:hover { transform: translateY(-3px) rotate(-2deg); }
.bdg-cell b { font: 600 15px Fredoka, sans-serif; color: var(--ink); line-height: 1.15; } .bdg-cell small { font-size: 12px; color: var(--muted); font-weight: 700; line-height: 1.2; }
.bdg-img { width: 84px; height: 84px; object-fit: contain; } .bdg-cell.on .bdg-img { transform: rotate(-4deg); filter: drop-shadow(0 4px 4px rgba(0,0,0,.15)); }
.bdg-cell.off .bdg-img:not(.bdg-q), .bdg-big.off { filter: grayscale(1) brightness(1.1) opacity(.45); }
.bdg-cell.off b { color: var(--muted); }
.bdg-cell.new::after { content: 'Nouveau !'; position: absolute; top: -8px; right: -6px; background: #ec4899; color: #fff; font: 800 11px Nunito, sans-serif; padding: 3px 8px; border-radius: 999px; transform: rotate(8deg); }
.bdg-q { display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #4b5693, #1e2142); color: #fde68a; font: 600 44px Fredoka, sans-serif; width: 84px; height: 84px; }
.bdg-q.sm { width: 30px; height: 30px; font-size: 18px; }
.bdg-pop { position: fixed; inset: 0; z-index: 70; background: rgba(30, 20, 60, .6); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.bdg-card { position: relative; overflow: hidden; background: var(--card); border: 4px solid #f9a8d4; border-radius: 28px; padding: 24px 22px 20px; max-width: 380px; width: 100%; text-align: center; animation: bdgPop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes bdgPop { from { transform: scale(.4) rotate(-8deg); opacity: 0; } }
.bdg-card h2 { margin: 6px 0 2px; font: 600 26px Fredoka, sans-serif; color: var(--title); }
.bdg-new { margin: 0; font: 600 20px Fredoka, sans-serif; color: #db2777; }
.bdg-big { width: 190px; height: 190px; object-fit: contain; margin: 8px auto 0; display: block; animation: bdgBounce 1.6s ease-in-out infinite; }
.bdg-q.bdg-big { width: 160px; height: 160px; font-size: 90px; margin: 8px auto 0; animation: none; }
@keyframes bdgBounce { 50% { transform: translateY(-8px) rotate(3deg); } }
.bdg-mini { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0; } .bdg-mini img { width: 62px; height: 62px; animation: bdgBounce 1.8s ease-in-out infinite; } .bdg-mini img:nth-child(2n) { animation-delay: .3s; }
.bdg-card .gain { font: 600 22px Fredoka, sans-serif; color: #d97706; margin: 4px 0 8px; }
.bdg-conf { position: absolute; inset: 0; pointer-events: none; } .bdg-conf i { position: absolute; top: -24px; font-style: normal; animation: bdgFall 2.4s ease-in forwards; }
@keyframes bdgFall { to { transform: translateY(460px) rotate(360deg); opacity: .2; } }
.bdg-fam-wrap { overflow-x: auto; margin: 8px 0 14px; border: 3px solid var(--card-border); border-radius: 18px; background: var(--paper); }
.bdg-fam { border-collapse: collapse; width: 100%; min-width: 260px; }
.bdg-fam th, .bdg-fam td { padding: 6px 8px; text-align: center; border-bottom: 1px solid var(--soft); }
.bdg-fam thead th { position: sticky; top: 0; background: var(--paper); font: 600 14px Fredoka, sans-serif; color: var(--ink); } .bdg-fam thead th small { display: block; color: var(--muted); font: 700 12px Nunito, sans-serif; } .bdg-fam thead th.me { background: var(--soft); }
.bdg-fam tbody th { position: sticky; left: 0; background: var(--paper); text-align: left; font: 700 13px Nunito, sans-serif; color: var(--text); display: flex; align-items: center; gap: 8px; min-width: 150px; border-right: 2px solid var(--soft); }
.bdg-fam tbody th img { width: 30px; height: 30px; } .bdg-fam td img { width: 38px; height: 38px; } .bdg-fam td i { display: inline-block; width: 12px; height: 12px; border-radius: 50%; background: var(--soft); }
@media (max-width: 520px) { .bdg-grid { grid-template-columns: repeat(3, 1fr); gap: 8px; } .bdg-img, .bdg-q { width: 68px; height: 68px; } .bdg-cell b { font-size: 13px; } }
.bdg-book .mini-bar { width: 100%; height: 12px; background: var(--soft); border-radius: 999px; overflow: hidden; margin: 8px 0 0; } .bdg-book .mini-bar div { height: 100%; background: linear-gradient(90deg, #f472b6, #a855f7); border-radius: 999px; }
.bdg-cell.off .bdg-img:not(.bdg-q), .bdg-big.off { filter: grayscale(1) brightness(1.05) opacity(.6); }
.bdg-card > :not(.bdg-conf) { position: relative; z-index: 1; }

/* ---------- Village : saisons, personnalisation, lettres ---------- */
.vil-stage.day.s-printemps { background: linear-gradient(#cfeaff, #f2fbff 60%, #ffeef4); }
.vil-stage.day.s-ete { background: linear-gradient(#8fd0ff, #d8f0ff 60%, #fff6d6); }
.vil-stage.day.s-automne { background: linear-gradient(#f7d9b0, #fde9d2 60%, #ffe3d0); }
.vil-stage.day.s-hiver { background: linear-gradient(#cfd9e8, #edf2f9 60%, #ffffff); }
.vil-season { position: absolute; left: 12px; top: 12px; background: rgba(255, 255, 255, .88); border: 3px solid #fff; border-radius: 999px; padding: 5px 14px; font: 600 15px Fredoka, sans-serif; color: #7a5560; box-shadow: 0 4px 10px rgba(60, 60, 120, .2); }
.vil-season small { font-weight: 400; opacity: .7; }
.vd { margin-top: 14px; } .vd h2 { margin: 0 0 8px; }
.vd-tabs { margin-bottom: 12px; }
.vd-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0; } .vd-row > b { min-width: 90px; } .vd-row > span { display: flex; flex-wrap: wrap; gap: 8px; }
.vd-sw { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--card-border), 0 3px 6px rgba(0, 0, 0, .15); cursor: pointer; }
.vd-sw.on { box-shadow: 0 0 0 4px #a855f7, 0 3px 6px rgba(0, 0, 0, .15); transform: scale(1.1); }
.vd-chip { border: 3px solid var(--card-border); background: var(--card); color: var(--text); border-radius: 999px; padding: 7px 14px; font: 700 14px Nunito, sans-serif; cursor: pointer; }
.vd-chip.on { background: var(--accent); border-color: var(--accent-d); color: #fff; }
.vd-seasons { display: flex; flex-wrap: wrap; gap: 10px; }
.vd-slots { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0; }
.vd-slot { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 96px; padding: 10px; font-size: 30px; border: 3px dashed var(--card-border); border-radius: 18px; background: var(--paper); cursor: pointer; }
.vd-slot small { font: 700 12px Nunito, sans-serif; color: var(--text); opacity: .7; } .vd-slot.on { border-style: solid; border-color: #a855f7; background: #faf5ff; }
.vd-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.vd-card { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border: 3px solid var(--card-border); border-radius: 18px; background: var(--paper); color: var(--text); cursor: pointer; text-align: center; font: inherit; }
.vd-card span { font-size: 34px; } .vd-card b { font: 600 14px Fredoka, sans-serif; } .vd-card small { font-weight: 800; font-size: 12px; opacity: .8; }
.vd-card.on { border-color: #a855f7; background: #faf5ff; } .vd-card.poor { opacity: .6; }
.room-screen.visit .room-shop, .room-screen.visit #rmBar, .room-screen.visit #rmPv, .room-screen.visit #rmClear, .room-screen.visit .room-top-btns { display: none !important; }
.vil-go { display: flex; gap: 8px; flex-wrap: wrap; }
.ltr-ov { position: fixed; inset: 0; z-index: 90; background: rgba(60, 30, 80, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ltr-box { background: var(--card); color: var(--text); border-radius: 26px; padding: 20px; width: min(520px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.ltr-box h2 { margin: 0 0 10px; text-align: center; }
.ltr-paper { position: relative; border: 3px solid; border-radius: 16px; padding: 18px 18px 12px; margin: 8px 0 12px; text-align: center; color: #5b4038; }
.ltr-paper p { margin: 6px 0 10px; font: 600 22px Fredoka, sans-serif; } .ltr-paper small { opacity: .8; }
.ltr-st { position: absolute; right: 10px; top: 6px; font-size: 30px; transform: rotate(10deg); }
.ltr-list { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; } .ltr-item.new .ltr-paper { box-shadow: 0 0 0 3px #ef4444; }
.ltr-opts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ltr-opts button { border: 3px solid var(--card-border); background: var(--paper); color: var(--text); border-radius: 999px; padding: 6px 12px; font: 700 14px Nunito, sans-serif; cursor: pointer; }
.ltr-opts button.on { border-color: #a855f7; box-shadow: 0 0 0 2px #a855f7; }
.ltr-toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); z-index: 99; background: #a855f7; color: #fff; padding: 10px 20px; border-radius: 999px; font: 700 15px Nunito, sans-serif; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }

/* ---------- Espace parent ---------- */
.acc-h3 { margin: 16px 0 6px; font: 600 17px Fredoka, sans-serif; color: var(--title); }
.acc-list { display: flex; flex-direction: column; gap: 6px; }
.acc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border: 2px solid var(--card-border); border-radius: 14px; background: var(--paper); }
.acc-row small { white-space: nowrap; }
.pin-inp { letter-spacing: .4em; text-align: center; max-width: 180px; }

/* ---------- Villages partagés ---------- */
.vil-sel { display: flex; justify-content: center; margin: 4px 0 6px; } .vil-sel label { font: 600 15px Fredoka, sans-serif; color: var(--title); }
.vil-sel select { font: 700 15px Nunito, sans-serif; padding: 6px 12px; border-radius: 999px; border: 3px solid var(--card-border); background: var(--card); color: var(--text); margin-left: 6px; }
.vp-card { border: 3px solid var(--card-border); border-radius: 20px; background: var(--paper); padding: 12px 14px; margin: 10px 0; }
.vp-head { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.vp-members { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.vp-chip { padding: 3px 12px; border-radius: 999px; background: var(--soft); font: 700 13px Nunito, sans-serif; } .vp-chip.mine { background: #f3e8ff; color: #7e22ce; }
.vp-kids { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 10px; } .vp-kid { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 2px solid var(--card-border); border-radius: 999px; background: var(--card); cursor: pointer; font: 700 14px Nunito, sans-serif; }
.auth-card .auth-go + .auth-go { margin-top: 10px; }

/* ---------- Numéro de version ---------- */
.ver-pill { margin-left: 8px; padding: 2px 10px; border-radius: 999px; background: var(--soft); color: var(--title); font: 800 12px Nunito, sans-serif; letter-spacing: .02em; white-space: nowrap; align-self: center; border: 2px solid var(--card-border); }
.version b { color: var(--title); }

/* ---------- Pointe le pays ---------- */
.lg-geo { padding-top: 52px; gap: 8px; }
.geo-ask { text-align: center; font: 600 22px Fredoka, sans-serif; color: #0c4a6e; background: rgba(255, 255, 255, .85); border-radius: 18px; padding: 8px 12px; min-height: 28px; box-shadow: 0 4px 10px rgba(14, 116, 144, .18); }
.geo-ask.ok { background: #dcfce7; color: #166534; } .geo-ask.ko { background: #fee2e2; color: #991b1b; font-size: 18px; }
.geo-map { position: relative; flex: 1; min-height: 240px; border-radius: 20px; overflow: hidden; background: #cfeafe; box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .8); touch-action: none; }
.geo-svg { width: 100%; height: 100%; display: block; touch-action: none; cursor: pointer; }
.geo-c { stroke: #fff; stroke-width: 1px; vector-effect: non-scaling-stroke; transition: fill .15s; }
.geo-c.ok { fill: #4ade80 !important; } .geo-c.ko { fill: #f87171 !important; }
.geo-c.hint { animation: geoPulse .45s ease-in-out infinite alternate; stroke: #0369a1; stroke-width: 2.5px; }
@keyframes geoPulse { to { fill: #fde047; } }
.geo-label { fill: #0c4a6e; font-family: Fredoka, sans-serif; font-weight: 600; paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.geo-c.good { fill: #22c55e !important; stroke: #14532d; stroke-width: 3px; animation: geoGood .6s ease-in-out infinite alternate; } @keyframes geoGood { to { fill-opacity: .55 } }
.geo-label.good { fill: #14532d; } .geo-label.bad { fill: #991b1b; } .geo-right { color: #166534; }
.geo-next { display: block; margin: 8px auto 2px; border: 3px solid #fff; border-radius: 999px; padding: 9px 18px; font: 600 18px Fredoka, sans-serif; color: #fff; background: #16a34a; box-shadow: 0 3px 8px rgba(0, 0, 0, .25); cursor: pointer; }
.geo-zoom { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 6px; }
.geo-zoom button { width: 40px; height: 40px; border-radius: 50%; border: 3px solid #fff; background: rgba(255, 255, 255, .9); font-size: 18px; cursor: pointer; box-shadow: 0 3px 8px rgba(0, 0, 0, .2); }

/* ---------- Les drapeaux ---------- */
.lg-flags { padding: 52px 10px 12px; gap: 10px; align-items: center; overflow-y: auto; }
.flag-ask { align-self: stretch; text-align: center; font: 600 21px Fredoka, sans-serif; color: #0c4a6e; background: rgba(255, 255, 255, .85); border-radius: 18px; padding: 8px 12px; box-shadow: 0 4px 10px rgba(14, 116, 144, .18); }
.flag-ask.ok { background: #dcfce7; color: #166534; } .flag-ask.ko { background: #fee2e2; color: #991b1b; font-size: 18px; }
.flag-frame { flex: 1 1 140px; min-height: 110px; align-self: stretch; display: flex; align-items: center; justify-content: center; }
.flag-frame img { height: 100%; max-height: 260px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: contain; filter: drop-shadow(0 0 2px rgba(0, 0, 0, .35)) drop-shadow(0 8px 12px rgba(0, 0, 0, .18)); }
.flag-choices { align-self: stretch; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 560px; margin: 0 auto; }
.flag-btn { min-height: 58px; border: 3px solid #fff; border-radius: 18px; padding: 8px 6px; background: #fff; color: #3b2a4a; font: 600 19px/1.15 Fredoka, sans-serif; box-shadow: 0 4px 0 rgba(122, 85, 96, .25); cursor: pointer; touch-action: manipulation; }
.flag-btn:disabled { cursor: default; color: #3b2a4a; }
.flag-btn.good { background: #22c55e; color: #fff; } .flag-btn.ko { background: #ef4444; color: #fff; }
.flag-after:empty { display: none; }
.flag-after { text-align: center; }
.flag-other { display: flex; align-items: center; justify-content: center; gap: 10px; margin: 0; font: 600 16px Fredoka, sans-serif; color: #3b2a4a; background: rgba(255, 255, 255, .85); border-radius: 14px; padding: 6px 12px; }
.flag-other img { width: 60px; height: 45px; filter: drop-shadow(0 0 1px rgba(0, 0, 0, .4)); }

/* ---------- Compagnon animé ---------- */
.game-title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.mascot-slot { position: relative; width: 84px; height: 70px; flex: none; }
.mascot-slot .mascot { position: absolute; right: 0; bottom: -10px; }
.mascot-slot.big { width: 120px; height: 120px; margin: 0 auto 4px; } .mascot-slot.big .mascot { position: relative; bottom: 0; width: 120px; height: 140px; margin-top: -20px; }
.mascot { width: 84px; height: 100px; cursor: pointer; touch-action: manipulation; }
.mascot canvas { width: 100%; height: 100%; display: block; }
.mascot-slot.big .mascot canvas { width: 120px; height: 140px; }
.mascot-bubble { position: absolute; right: 78%; top: 6px; background: #fff; color: #5b4038; font: 700 13px Nunito, sans-serif; padding: 5px 10px; border-radius: 14px; box-shadow: 0 4px 10px rgba(90, 60, 100, .25); white-space: nowrap; z-index: 3; pointer-events: none; animation: popIn .2s ease-out; }
.mascot-bubble::after { content: ''; position: absolute; right: -5px; top: 10px; border: 6px solid transparent; border-left-color: #fff; border-right: 0; }
.mascot-slot.big .mascot-bubble { right: auto; left: 100%; top: 18px; margin-left: 4px; } .mascot-slot.big .mascot-bubble::after { right: auto; left: -5px; border-left-color: transparent; border-right: 6px solid #fff; border-left: 0; }
.mascot-star { position: absolute; bottom: 55%; font-size: 18px; pointer-events: none; animation: mascotStar 1.3s ease-out forwards; }
@keyframes mascotStar { 0% { transform: translateY(0) scale(.4); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-70px) scale(1.1) rotate(25deg); opacity: 0; } }
@media (max-width: 520px) { .mascot-slot { width: 72px; height: 60px; } .mascot { width: 72px; height: 86px; } }

.bdg-tabdot { display: inline-block; width: 9px; height: 9px; margin-right: 5px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 2px #fff; vertical-align: middle; }
.bdg-tabs button.on .bdg-tabdot { box-shadow: 0 0 0 2px var(--accent); }

/* ---------- Lettres libres ---------- */
.ltr-art { display: flex; flex-direction: column; align-items: center; gap: 4px; margin: 8px 0 12px; } .ltr-art canvas { width: min(300px, 100%); aspect-ratio: 3 / 4; border-radius: 14px; box-shadow: 0 8px 18px -10px rgba(91, 64, 56, .6); }
.ltr-item.new .ltr-art canvas { box-shadow: 0 0 0 3px #ef4444; }
.lt-wrap { display: flex; justify-content: center; } .lt-cv { width: min(300px, 78vw); aspect-ratio: 3 / 4; border-radius: 14px; box-shadow: 0 8px 18px -10px rgba(91, 64, 56, .6); touch-action: none; cursor: crosshair; background: #fff; }
.lt-sel { display: flex; justify-content: center; gap: 6px; margin: 8px 0 0; } .lt-sel[hidden] { display: none; }
.lt-sel button, .lt-pw { border: 3px solid var(--card-border); background: var(--paper); border-radius: 999px; min-width: 44px; height: 40px; font-size: 18px; cursor: pointer; }
.lt-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 10px 0 6px; }
.lt-tabs button { border: 3px solid var(--card-border); background: var(--paper); color: var(--text); border-radius: 999px; padding: 6px 12px; font: 700 14px Nunito, sans-serif; cursor: pointer; } .lt-tabs button.on { border-color: #a855f7; background: #f5e9ff; color: #6b21a8; }
.lt-panel { min-height: 70px; } .lt-hint { text-align: center; margin: 6px 0; }
.lt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 150px; overflow-y: auto; padding: 2px; }
.lt-grid button { border: 3px solid var(--card-border); background: var(--paper); border-radius: 14px; font-size: 26px; padding: 4px 0; cursor: pointer; } .lt-grid button:hover { border-color: #a855f7; transform: scale(1.06); }
.lt-grid.stamps { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); } .lt-grid.stamps button { display: flex; flex-direction: column; align-items: center; font-size: 22px; line-height: 1.1; } .lt-grid.stamps b { font: 800 11px Fredoka, sans-serif; }
.lt-row { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 6px 0; } .lt-row input { flex: 1; min-width: 0; border: 3px solid var(--card-border); border-radius: 14px; padding: 8px 12px; font: 700 16px Nunito, sans-serif; background: var(--paper); color: var(--text); }
.lt-sws { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0; }
.lt-sw { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px var(--card-border); cursor: pointer; } .lt-sw.on { box-shadow: 0 0 0 3px #a855f7; transform: scale(1.12); }
.lt-pw { display: grid; place-items: center; } .lt-pw.on { border-color: #a855f7; } .lt-pw i { display: block; border-radius: 50%; background: #5b4038; }

/* ---------- Tableau des badges (maison) ---------- */
.bdg-board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 10px; margin: 10px 0 14px; max-height: 55vh; overflow-y: auto; padding: 14px; border-radius: 18px; background: #fff7e8; border: 8px solid #c58a54; }
.bdg-board-grid img { width: 100%; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .2)); }
.icon-btn.off { opacity: .4; filter: grayscale(1); }

/* ---------- Boulangerie mémoire & Courses ---------- */
.bk-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px 12px 12px; }
.bk-top { display: flex; justify-content: space-between; width: 100%; font: 600 20px Fredoka, sans-serif; color: #92400e; }
.bk-show { flex: 1; min-height: 110px; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 72px; line-height: 1; background: rgba(255, 255, 255, .6); border-radius: 26px; }
.bk-show small { font: 700 18px Nunito, sans-serif; color: #92400e; margin-top: 4px; } .bk-pop { display: inline-block; animation: bkPop .45s ease-out; } .bk-pop.big { font-size: 90px; }
@keyframes bkPop { 0% { transform: scale(.2) translateY(-40px); opacity: 0; } 70% { transform: scale(1.2); } 100% { transform: scale(1); opacity: 1; } }
.bk-bowl { min-height: 52px; width: 100%; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; padding: 6px 10px; border-radius: 0 0 40px 40px; background: #fde68a; border: 4px solid #f59e0b; font-size: 30px; }
.bk-bowl.shake { animation: bkShake .4s; } @keyframes bkShake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.bk-in { animation: bkPop .3s ease-out; }
.bk-msg { font: 700 16px Nunito, sans-serif; color: #92400e; text-align: center; min-height: 22px; }
.bk-shelf { display: grid; gap: 8px; width: 100%; }
.bk-ing { display: flex; flex-direction: column; align-items: center; border: 3px solid #fcd34d; background: #fffbeb; border-radius: 18px; padding: 6px 2px; font-size: 34px; line-height: 1.1; cursor: pointer; touch-action: manipulation; }
.bk-ing small { font: 800 11px Nunito, sans-serif; color: #92400e; } .bk-ing:disabled { opacity: .55; cursor: default; } .bk-ing:not(:disabled):active { transform: scale(.94); } .bk-ing.bad { border-color: #ef4444; background: #fee2e2; }
.run-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; display: block; }
.run-hud { display: inline-block; background: rgba(255, 255, 255, .85); border-radius: 999px; padding: 4px 14px; font: 700 17px Fredoka, sans-serif; color: #166534; }

/* ---------- Mes amis ---------- */
.fr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; margin: 8px 0 16px; }
.fr-card { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 10px; border-radius: 22px; border: 3px solid #fbcfe8; background: linear-gradient(#fff, #fdf2f8); text-align: center; }
.fr-card b { font: 600 20px Fredoka, sans-serif; color: var(--title); }

/* ---------- Découvertes ---------- */
.dc-tile { display: flex; align-items: center; gap: 14px; margin-top: 16px; padding: 14px 18px; border-radius: 22px; background: linear-gradient(120deg, var(--c), color-mix(in srgb, var(--c) 55%, #fff)); color: #fff; box-shadow: 0 8px 18px -10px var(--c); text-decoration: none; flex-wrap: wrap; }
.dc-tile:hover { filter: brightness(1.06); transform: translateY(-2px); } .dc-ic { font-size: 38px; } .dc-tt { display: flex; flex-direction: column; flex: 1; min-width: 150px; } .dc-tt small { font-weight: 800; opacity: .95; } .dc-tt b { font: 600 22px Fredoka, sans-serif; }
.dc-go { background: rgba(255, 255, 255, .25); padding: 6px 14px; border-radius: 999px; font-weight: 800; }
.dc-fact { display: flex; align-items: center; gap: 12px; margin-top: 10px; padding: 10px 16px; border-radius: 18px; background: #fffbeb; border: 2px dashed #fcd34d; color: #78350f; } .dc-fact span { font-size: 30px; } .dc-fact p { margin: 0; font-weight: 700; line-height: 1.4; } .dc-fact.big { margin: 16px 0; } .dc-fact small { display: block; opacity: .7; }
.dc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.dc-card { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border-radius: 22px; border: 3px solid color-mix(in srgb, var(--c) 45%, #fff); background: linear-gradient(#fff, color-mix(in srgb, var(--c) 12%, #fff)); color: var(--text); text-decoration: none; } .dc-card:hover { transform: translateY(-3px); }
.dc-card .ic { font-size: 40px; } .dc-card b { font: 600 20px Fredoka, sans-serif; color: var(--title); } .dc-card small { color: var(--muted, #6b7280); } .dc-card .ok, .dc-card .new { position: absolute; top: 10px; right: 12px; font-weight: 800; font-size: 13px; color: #16a34a; } .dc-card .new { color: #db2777; } .dc-card.big { flex-direction: row; align-items: center; flex-wrap: wrap; gap: 14px; } .dc-card.big .ic { font-size: 56px; }
.dc-view { max-width: 640px; margin-inline: auto; text-align: center; }
.dc-dots { display: flex; justify-content: center; gap: 8px; margin: 6px 0 10px; } .dc-dots i { width: 12px; height: 12px; border-radius: 50%; background: #e5e7eb; } .dc-dots i.past { background: color-mix(in srgb, var(--c) 50%, #fff); } .dc-dots i.on { background: var(--c); transform: scale(1.3); }
.dc-pic { border-radius: 26px; overflow: hidden; border: 4px solid color-mix(in srgb, var(--c) 40%, #fff); box-shadow: 0 12px 24px -14px var(--c); } .dc-svg { display: block; width: 100%; height: auto; }
.dc-main { animation: dcFloat 3.2s ease-in-out infinite; transform-origin: 200px 110px; } .dc-ex { animation: dcFloat 4s ease-in-out infinite; } .dc-ex1 { animation-delay: .6s } .dc-ex2 { animation-delay: 1.2s } .dc-ex3 { animation-delay: 1.8s }
@keyframes dcFloat { 50% { transform: translateY(-8px); } }
.dc-h { font: 600 28px Fredoka, sans-serif; color: var(--title); margin: 14px 0 6px; } .dc-x { font: 700 20px/1.55 Nunito, sans-serif; margin: 0 0 12px; }
.dc-more { text-align: left; background: #f0f9ff; border-left: 5px solid #38bdf8; border-radius: 12px; padding: 10px 14px; font-size: 16px; line-height: 1.5; margin: 8px 0 14px; }
.dc-ans { display: grid; gap: 10px; margin: 10px 0; } .dc-a { font-size: 19px; padding: 14px; } .dc-a.right { background: #bbf7d0; border-color: #22c55e; } .dc-a.wrong { background: #fecaca; border-color: #ef4444; }
.dc-fb { font-weight: 700; min-height: 40px; } .dc-end .big { font-size: 80px; } .dc-gain { font: 600 28px Fredoka, sans-serif; color: #b45309; }
.dc-a:disabled { opacity: 1; color: var(--text); }

/* ---------- Bibliothèque : étagère et livres animés « pop-up » ---------- */
.lib-shelf { display: flex; flex-wrap: wrap; gap: 18px; justify-content: center; padding: 24px 14px 30px; margin: 14px 0; border-radius: 22px; background: linear-gradient(#f3dcc0, #e6c49a); box-shadow: inset 0 -14px 0 #b98a5e; }
.lib-book { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; width: 170px; min-height: 210px; padding: 14px 12px; border-radius: 6px 16px 16px 6px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 60%, #000)); color: #fff; text-align: center; text-decoration: none; transform: rotate(var(--r)); box-shadow: -6px 0 0 color-mix(in srgb, var(--c) 55%, #000), 0 12px 18px -10px rgba(0, 0, 0, .5); transition: transform .2s; }
.lib-book:hover { transform: rotate(0) translateY(-8px); } .lib-cv { font-size: 56px; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .3)); } .lib-book b { font: 600 19px/1.15 Fredoka, sans-serif; } .lib-book small { opacity: .92; font-weight: 700; font-size: 13px; } .lib-ok { position: absolute; top: 8px; right: 8px; background: #fff; color: #16a34a; font: 800 12px Nunito, sans-serif; padding: 2px 8px; border-radius: 999px; }
.pb { max-width: 760px; margin-inline: auto; }
.pb-stage { position: relative; perspective: 1400px; margin: 8px 0 12px; }
.pb-cover { position: relative; z-index: 3; display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; border-radius: 8px 20px 20px 8px; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #000)); color: #fff; text-align: center; box-shadow: -10px 0 0 color-mix(in srgb, var(--c) 50%, #000), 0 20px 30px -16px rgba(0, 0, 0, .55); backface-visibility: hidden; }
.pb-cv-in { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px; } .pb-cv-in .ic { font-size: clamp(56px, 12vw, 92px); filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .35)); animation: dcFloat 3s ease-in-out infinite; } .pb-cv-in h2 { margin: 0; font: 600 clamp(22px, 5vw, 34px) Fredoka, sans-serif; } .pb-cv-in small { font-weight: 700; opacity: .92; }
.pb-book { position: absolute; inset: 0; z-index: 1; border-radius: 12px; background: #fffaf0; padding: 10px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 55%, #000), 0 3px 0 6px #f3e9d2, 0 18px 28px -14px rgba(0, 0, 0, .5); } .pb-book[hidden] { display: none; }
.pb-scene { position: relative; width: 100%; height: 100%; border-radius: 6px; overflow: visible; --u: 6px; --v: 0; }
.pb-sky, .pb-ground { position: absolute; inset: 0; border-radius: 6px; } .pb-ground { top: auto; height: 34%; border-radius: 0 0 6px 6px; }
.bg-sea .pb-sky { background: linear-gradient(#bfe9ff, #7dd3fc 55%, #38bdf8 55%, #0ea5e9); } .bg-sea .pb-ground { display: none; }
.bg-sky .pb-sky { background: linear-gradient(#7dd3fc, #e0f2fe); } .bg-sky .pb-ground { display: none; }
.bg-meadow .pb-sky { background: linear-gradient(#a5b4c8, #dbeafe 60%, #bbf7d0 60%); } .bg-meadow .pb-ground { background: #86efac; }
.bg-river .pb-sky { background: linear-gradient(#bae6fd, #e0f2fe 55%, #86efac 55%); } .bg-river .pb-ground { background: linear-gradient(#5eead4, #38bdf8); height: 28%; }
.bg-farm .pb-sky { background: linear-gradient(#bae6fd, #e0f2fe 55%, #bef264 55%); } .bg-farm .pb-ground { background: #a3e635; height: 36%; }
.bg-pond .pb-sky { background: linear-gradient(#bae6fd, #e0f2fe 40%, #bef264 40%); } .bg-pond .pb-ground { background: linear-gradient(#67e8f9, #22d3ee); height: 52%; opacity: .85; }
.bg-space .pb-sky { background: radial-gradient(circle at 20% 30%, #3b3a8a, #1e1b4b 60%, #0f0c2e); } .bg-space .pb-ground { display: none; }
.bg-space .pb-sky::after { content: ""; position: absolute; inset: 0; background-image: radial-gradient(1.5px 1.5px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 70%, #fff, transparent), radial-gradient(1.5px 1.5px at 55% 15%, #fff, transparent), radial-gradient(1px 1px at 70% 60%, #fff, transparent), radial-gradient(1.5px 1.5px at 88% 30%, #fff, transparent), radial-gradient(1px 1px at 45% 85%, #fff, transparent), radial-gradient(1px 1px at 92% 82%, #fff, transparent); }
.pb-night { position: absolute; inset: 0; border-radius: 6px; background: #0b1240; opacity: calc(var(--v) * .6); pointer-events: none; z-index: 6; }
.pb-crease { position: absolute; inset: 10px; left: 50%; width: 36px; margin-left: -18px; background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .18) 48%, rgba(0, 0, 0, .08) 52%, transparent); pointer-events: none; z-index: 8; border-radius: 4px; }
.pb-it { position: absolute; transform: translate(-50%, -100%); transform-origin: 50% 100%; font-size: calc(var(--s) * var(--u)); line-height: 1; animation: pbPop .75s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: var(--d); }
.pb-it.tap { cursor: pointer; } .pb-cut { display: inline-block; text-shadow: 0 0 0 #fff, 2px 0 #fff, -2px 0 #fff, 0 2px #fff, 0 -2px #fff, 1.5px 1.5px #fff, -1.5px -1.5px #fff, 1.5px -1.5px #fff, -1.5px 1.5px #fff; filter: drop-shadow(0 calc(var(--u) * .8) calc(var(--u) * .5) rgba(0, 0, 0, .3)); }
.pb-shadow { position: absolute; left: 50%; bottom: -4%; width: 75%; height: 12%; margin-left: -37%; border-radius: 50%; background: rgba(0, 0, 0, .22); filter: blur(3px); z-index: -1; }
@keyframes pbPop { 0% { transform: translate(-50%, -100%) perspective(700px) rotateX(-88deg) scale(.7); opacity: 0; } 70% { opacity: 1; } 100% { transform: translate(-50%, -100%) perspective(700px) rotateX(0) scale(1); opacity: 1; } }
.pb-cut.float { animation: pbFloat 3s ease-in-out infinite; } .pb-cut.sway { animation: pbSway 3.4s ease-in-out infinite; transform-origin: 50% 100%; } .pb-cut.spin { animation: pbSpin 6s linear infinite; }
@keyframes pbFloat { 50% { transform: translateY(-.25em); } } @keyframes pbSway { 50% { transform: rotate(4deg); } 0%, 100% { transform: rotate(-4deg); } } @keyframes pbSpin { to { transform: rotate(360deg); } }
.pb-it.boing .pb-cut, .pb-it.boing.pb-pl { animation: pbBoing .5s ease-out; } @keyframes pbBoing { 30% { transform: scale(1.25) rotate(-6deg); } 60% { transform: scale(.92) rotate(4deg); } }
.pb-it.rx-up { opacity: var(--v); transform: translate(-50%, calc(-100% - var(--v) * var(--u) * 14)); animation: none; } .rx-up2 { transform: translate(-50%, calc(-100% - var(--v) * var(--u) * 20)); } .pb-it.rx-up2 { animation: none; }
.pb-it.rx-sun { animation: none; } .pb-it.rx-sun .pb-cut { transform: scale(calc(1 + var(--v) * .55)); filter: drop-shadow(0 0 calc(var(--v) * 14px) #fde047); transition: transform .2s; }
.pb-it.rx-zzz { opacity: var(--v); animation: none; } .pb-it.rx-moon { opacity: var(--v); transform: translate(-50%, calc(-100% + (1 - var(--v)) * var(--u) * 14)); animation: none; } .pb-it.rx-sunset { opacity: calc(1 - var(--v)); transform: translate(-50%, calc(-100% + var(--v) * var(--u) * 14)); animation: none; }
.pb-pl { transform: translate(-50%, -50%); width: calc(var(--s) * var(--u)); height: calc(var(--s) * var(--u)); border-radius: 50%; background: radial-gradient(circle at 32% 30%, var(--c1), var(--c2) 72%, color-mix(in srgb, var(--c2) 60%, #000)); box-shadow: inset calc(var(--u) * -.8) calc(var(--u) * -.8) calc(var(--u) * 1.6) rgba(0, 0, 0, .35); animation-name: pbPopC; }
@keyframes pbPopC { 0% { transform: translate(-50%, -50%) scale(.1); opacity: 0; } 70% { transform: translate(-50%, -50%) scale(1.12); opacity: 1; } 100% { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.pb-pl.glow { box-shadow: 0 0 calc(var(--u) * 5) calc(var(--u) * 1.2) rgba(255, 210, 80, .65), inset calc(var(--u) * -.8) calc(var(--u) * -.8) calc(var(--u) * 1.6) rgba(0, 0, 0, .25); }
.pb-pl.ring::after { content: ""; position: absolute; left: -45%; right: -45%; top: 38%; bottom: 38%; border: calc(var(--u) * .8) solid rgba(240, 220, 170, .85); border-radius: 50%; transform: rotate(-14deg); }
.pb-pl.bands { background: repeating-linear-gradient(0deg, transparent 0 14%, rgba(150, 90, 40, .35) 14% 22%), radial-gradient(circle at 32% 30%, var(--c1), var(--c2) 72%); } .pb-pl.land::before { content: ""; position: absolute; inset: 20% 12% 30% 40%; border-radius: 45% 55% 50% 40%; background: #6fd08c; opacity: .85; }
.pb-flapbox { position: absolute; transform: translate(0, -100%); animation: pbPop .75s cubic-bezier(.3, 1.45, .5, 1) both; animation-delay: var(--d); cursor: pointer; perspective: 600px; z-index: 5; }
.pb-hid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: calc(var(--u) * 8); background: #fff7e0; border-radius: 8px; box-shadow: inset 0 2px 6px rgba(0, 0, 0, .25); }
.pb-flap { position: absolute; inset: 0; border-radius: 8px; display: flex; align-items: center; justify-content: center; transform-origin: 50% 0; transition: transform .7s cubic-bezier(.3, 1.2, .5, 1); box-shadow: 0 6px 8px -3px rgba(0, 0, 0, .4); backface-visibility: hidden; } .pb-flap b { font: 700 calc(var(--u) * 4.2) Fredoka, sans-serif; color: #fff; text-shadow: 0 2px 0 rgba(0, 0, 0, .25); }
.pb-flapbox.open .pb-flap { transform: rotateX(-170deg); } .pb-flapbox:not(.open) .pb-flap { animation: pbPeek 2.6s ease-in-out 1.6s infinite; } @keyframes pbPeek { 0%, 85%, 100% { transform: rotateX(0); } 92% { transform: rotateX(-14deg); } }
.pb-slide { position: absolute; transform: translate(-50%, -100%); z-index: 7; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 12px 8px; border-radius: 14px; background: #fde68a; box-shadow: 0 5px 0 #d9a93a; font: 700 calc(var(--u) * 2.5) Fredoka, sans-serif; color: #7a4b00; min-width: 120px; }
.pb-slide input { width: 100%; accent-color: #f97316; height: 28px; cursor: grab; }
.pb-orbit { animation: none; font-size: calc(var(--s) * var(--u)); transform: translate(-50%, -50%); z-index: 4; text-shadow: 0 0 10px #fff; } .pb-chip { position: absolute; left: 50%; top: 4%; transform: translateX(-50%); background: rgba(255, 255, 255, .9); color: #4338ca; font: 700 16px Fredoka, sans-serif; padding: 4px 14px; border-radius: 999px; z-index: 7; }
.pb-rain { position: absolute; transform: translateX(-50%); overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .3s; z-index: 4; } .pb-rain.on { opacity: 1; } .pb-rain i { position: absolute; top: -10%; font-style: normal; font-size: calc(var(--u) * 2.4); animation: pbDrop .9s linear infinite; } @keyframes pbDrop { to { transform: translateY(520%); } }
.pb-bub { position: absolute; transform: translate(-50%, -100%); max-width: 70%; padding: 8px 14px; border-radius: 16px; background: #fff; color: #44403c; font: 700 clamp(13px, 2.4vw, 17px)/1.3 Nunito, sans-serif; box-shadow: 0 6px 14px -6px rgba(0, 0, 0, .45); z-index: 9; text-align: center; animation: pbPopB .3s ease-out; } .pb-bub::after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -8px; border: 8px solid transparent; border-top-color: #fff; border-bottom: 0; }
@keyframes pbPopB { from { transform: translate(-50%, -80%) scale(.6); opacity: 0; } }
.pb-leaf { position: absolute; top: 10px; bottom: 10px; z-index: 12; width: calc(50% - 10px); background: linear-gradient(90deg, #fffaf0, #f3e9d2); box-shadow: 0 0 20px rgba(0, 0, 0, .25); backface-visibility: hidden; } .pb-leaf.fwd { right: 10px; transform-origin: left center; border-radius: 0 8px 8px 0; } .pb-leaf.back { left: 10px; transform-origin: right center; border-radius: 8px 0 0 8px; }
.pb-cap { text-align: center; margin: 12px 0; } .pb-cap h2 { margin: 0 0 4px; font: 600 26px Fredoka, sans-serif; color: var(--title); } .pb-cap p { margin: 0; font: 700 18px/1.5 Nunito, sans-serif; }
.pb-stage { aspect-ratio: 16 / 10; } .pb-stage .pb-cover { height: 100%; aspect-ratio: auto; }
@media (max-width: 520px) { .pb-cap h2 { font-size: 22px; } .pb-cap p { font-size: 16px; } .lib-book { width: 150px; } }

.vil-quick { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; align-items: center; margin: 10px 0 4px; } .vil-quick span { font-weight: 800; color: var(--muted, #6b7280); }

.lib-soon { text-align: center; padding: 30px 16px; margin: 14px 0; border-radius: 22px; background: linear-gradient(#f3dcc0, #e6c49a); box-shadow: inset 0 -14px 0 #b98a5e; color: #5b4038; } .lib-soon-ic { font-size: 64px; animation: dcFloat 3s ease-in-out infinite; } .lib-soon h2 { margin: 4px 0; font: 600 30px Fredoka, sans-serif; } .lib-soon p { max-width: 460px; margin: 0 auto 12px; font-weight: 700; } .lib-soon-books span { display: inline-block; font-size: 40px; opacity: .55; margin: 0 4px; animation: dcFloat 3s ease-in-out infinite; } .lib-soon-books span:nth-child(2) { animation-delay: .4s } .lib-soon-books span:nth-child(3) { animation-delay: .8s } .lib-soon-books span:nth-child(4) { animation-delay: 1.2s }

/* ---------- Courrier : pastille, bandeau, alerte parent ---------- */
.mail-btn { position: relative; } .mail-btn i { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: #ef4444; color: #fff; font: 800 12px/20px Nunito, sans-serif; font-style: normal; text-align: center; border: 2px solid #fff; }
.mail-btn.new { animation: mailWiggle 1.6s ease-in-out infinite; } @keyframes mailWiggle { 0%, 60%, 100% { transform: rotate(0); } 10%, 30% { transform: rotate(-12deg) scale(1.12); } 20%, 40% { transform: rotate(12deg) scale(1.12); } }
.mail-alert { display: flex; align-items: center; gap: 14px; width: 100%; margin: 0 0 14px; padding: 12px 18px; border: 0; border-radius: 20px; background: linear-gradient(120deg, #fb7185, #f59e0b); color: #fff; text-align: left; cursor: pointer; box-shadow: 0 8px 18px -10px #fb7185; animation: mailPulse 2s ease-in-out infinite; } .mail-alert .mail-ic { font-size: 40px; animation: dcFloat 1.6s ease-in-out infinite; } .mail-alert b { display: block; font: 600 22px Fredoka, sans-serif; } .mail-alert small { font-weight: 700; opacity: .95; }
@keyframes mailPulse { 50% { box-shadow: 0 0 0 8px rgba(251, 113, 133, .25); } }
.alert-bar { padding: 8px 16px; background: #fef3c7; color: #78350f; text-align: center; font-weight: 700; } .alert-bar a { margin-left: 10px; color: #b45309; text-decoration: underline; } .alert-bar[hidden] { display: none; }
.vil-tag.mail { background: #ef4444; color: #fff; animation: mailPulse 1.6s infinite; }

/* ---------- Espace parent : en-tête, onglets, cartes, interrupteurs ---------- */
.acc { max-width: 760px; margin-inline: auto; }
.acc-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; margin-bottom: 14px; border-radius: 22px; background: linear-gradient(120deg, #eef2ff, #fdf2f8); border: 2px solid var(--card-border); }
.acc-av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 28px; background: #fff; box-shadow: 0 4px 10px -4px rgba(99, 102, 241, .5); }
.acc-id { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 1px; text-align: left; } .acc-id h1 { margin: 0; font-size: 24px; text-align: left; } .acc-id b { word-break: break-all; }
.acc-tabs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px 2px 12px; margin-bottom: 4px; }
.acc-tab { position: relative; flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 9px 14px; border: 3px solid var(--card-border); border-radius: 999px; background: var(--paper); color: var(--text); font: 700 15px Nunito, sans-serif; cursor: pointer; white-space: nowrap; }
.acc-tab span { font-size: 18px; } .acc-tab.on { background: #4338ca; border-color: #4338ca; color: #fff; box-shadow: 0 6px 12px -6px #4338ca; } .acc-tab i { min-width: 20px; height: 20px; border-radius: 999px; background: #ef4444; color: #fff; font: 800 12px/20px Nunito, sans-serif; font-style: normal; text-align: center; padding: 0 5px; }
.acc-pane[hidden] { display: none; }
.acc-card { margin: 0 0 14px; padding: 16px 18px; border-radius: 22px; border: 2px solid var(--card-border); background: var(--paper); box-shadow: 0 6px 14px -12px rgba(67, 56, 202, .5); text-align: left; }
.acc-ct { margin: 0 0 6px; font: 600 20px Fredoka, sans-serif; color: var(--title); text-align: left; }
.acc-card .row-btns { justify-content: flex-start; margin-top: 8px; }
.acc-sw { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--card-border); cursor: pointer; } .acc-sw:first-of-type { border-top: 0; }
.acc-sw input { position: absolute; opacity: 0; pointer-events: none; }
.acc-knob { position: relative; flex: 0 0 auto; width: 52px; height: 30px; border-radius: 999px; background: #cbd5e1; transition: background .2s; } .acc-knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0, 0, 0, .3); transition: transform .2s; }
.acc-sw input:checked + .acc-knob { background: #22c55e; } .acc-sw input:checked + .acc-knob::after { transform: translateX(22px); } .acc-sw input:focus-visible + .acc-knob { outline: 3px solid #a5b4fc; outline-offset: 2px; }
.acc-sw-t { display: flex; flex-direction: column; gap: 1px; } .acc-sw-t b { font-size: 16px; } .acc-sw-t small { color: var(--muted, #6b7280); font-weight: 700; }
.acc-danger { border-color: #fecaca; background: #fff7f7; } .acc-danger .acc-ct { color: #b91c1c; }
@media (max-width: 520px) { .acc-head { padding: 12px; } .acc-card { padding: 14px; } .acc-tab { padding: 8px 12px; font-size: 14px; } }

/* ---------- diamants 💎 (monnaie payante) ---------- */
.gem-pill { background: linear-gradient(135deg, #e6f4ff, #efe6ff); border-color: #b9a6ff; }
.gem-pill[hidden] { display: none; }
.gem-bal { display: flex; align-items: center; gap: 14px; margin: 6px 0 10px; }
.gem-bal b { font-size: 2.2rem; line-height: 1; color: #6b4bd8; display: block; }
.gem-bal small { color: var(--muted, #777); }
.gem-ico { font-size: 1.8rem; } .gem-ico.big { font-size: 3rem; }
.gem-packs { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin: 10px 0; }
.gem-pack { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border-radius: 20px; border: 3px solid #cbbcff; background: linear-gradient(160deg, #f6f1ff, #e9f6ff); cursor: pointer; font: inherit; color: inherit; transition: transform .15s; }
.gem-pack:hover { transform: translateY(-3px) rotate(-1deg); }
.gem-pack.off { opacity: .55; cursor: not-allowed; }
.gem-pack b { font-size: 1.6rem; color: #6b4bd8; } .gem-pack i { font-size: .75rem; color: #3a9a6a; font-style: normal; min-height: 1em; }
.gem-price { margin-top: 6px; padding: 4px 14px; border-radius: 999px; background: #6b4bd8; color: #fff; font-weight: 800; }
.gem-consent { display: flex; gap: 8px; align-items: flex-start; font-size: .85rem; margin: 8px 0; }
.gem-table { display: flex; flex-direction: column; gap: 4px; }
.gem-row { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; padding: 8px 4px; border-bottom: 1px dashed #ddd; font-size: .9rem; }
.gem-row .gem-lbl { flex: 1 1 200px; } .gem-row b.pos { color: #2a9a5a; } .gem-row b.neg { color: #d6456a; }
.gem-row em { font-style: normal; font-size: .75rem; padding: 2px 8px; border-radius: 999px; background: #e0f7e9; color: #1d7a45; } .gem-row em.refunded { background: #ffe3e8; color: #b42a4c; }
.gem-links { margin-left: auto; display: flex; gap: 10px; } .gem-links a { color: #6b4bd8; font-weight: 700; }
.room-card.gem { border-color: #cbbcff; background: linear-gradient(160deg, #fbf9ff, #eef6ff); }
.room-gembar { grid-column: 1 / -1; margin: 0 0 4px; padding: 8px 12px; border-radius: 14px; background: #f1ecff; font-size: .9rem; }

/* ---------- Taupes à mots ---------- */
.tp-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 10px 12px 14px; }
.tp-top { display: flex; justify-content: space-between; width: 100%; font: 600 20px Fredoka, sans-serif; color: #854d0e; }
.tp-ask { width: 100%; text-align: center; background: rgba(255, 255, 255, .75); border-radius: 22px; padding: 8px 10px; font: 700 26px Fredoka, sans-serif; color: #854d0e; } .tp-ask small { display: block; font: 700 14px Nunito, sans-serif; opacity: .7; }
.tp-grid { flex: 1; width: 100%; max-width: 420px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; align-content: center; }
.tp-hole { position: relative; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(#6b4423 55%, #4a2f17 56%, #8a5a2b 100%); overflow: hidden; cursor: pointer; touch-action: none; -webkit-tap-highlight-color: transparent; }
.tp-mole { position: absolute; left: 12%; right: 12%; bottom: -80%; height: 80%; display: flex; align-items: center; justify-content: center; font: 700 clamp(26px, 8vw, 40px) Fredoka, sans-serif; font-style: normal; color: #422006; background: #c08457; border-radius: 50% 50% 14% 14%; border: 3px solid #8b5a2b; transition: bottom .16s ease-out; }
.tp-hole.up .tp-mole { bottom: 8%; } .tp-hole.hit .tp-mole { background: #86efac; border-color: #16a34a; } .tp-hole.bad .tp-mole { background: #fca5a5; border-color: #dc2626; }

/* ---------- Backoffice ---------- */
body.adm-wide main { max-width: 1280px; }
.adm-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; } .adm-head h1 { margin: 0; font-size: 26px; color: var(--title); }
.adm-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 16px; }
.adm-tabs a { display: inline-flex; gap: 6px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--card); border: 2px solid var(--soft); color: var(--title); font-weight: 700; font-size: 14px; text-decoration: none; }
.adm-tabs a.on { background: var(--accent-d); color: #fff; border-color: var(--accent-d); }
.adm-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-bottom: 16px; }
.adm-tile { position: relative; background: var(--card); border: 2px solid var(--soft); border-radius: 18px; padding: 12px 14px 12px 54px; min-height: 84px; }
.adm-tile .ic { position: absolute; left: 12px; top: 12px; font-size: 28px; } .adm-tile b { display: block; font: 700 26px Fredoka, sans-serif; color: var(--ink); line-height: 1.1; }
.adm-tile small { display: block; color: var(--text); font-weight: 700; font-size: 13px; } .adm-tile em { display: block; font-style: normal; color: var(--muted); font-size: 12px; margin-top: 2px; }
.adm-tile.live { border-color: #34d399; background: linear-gradient(#ecfdf5, var(--card)); } .adm-tile.warn { border-color: #f59e0b; }
.adm-card { background: var(--card); border: 2px solid var(--soft); border-radius: 18px; padding: 14px 16px; margin-bottom: 16px; min-width: 0; } .adm-card h2 { margin: 0 0 8px; font-size: 18px; color: var(--title); } .adm-card h3 { margin: 10px 0 4px; font-size: 14px; color: var(--muted); }
.adm-grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 16px; margin-bottom: 16px; } .adm-grid2 .adm-card { margin-bottom: 0; }
.adm-chart { margin: 0; } .adm-chart figcaption { font-weight: 700; font-size: 14px; color: var(--text); margin-bottom: 4px; } .adm-chart svg { width: 100%; height: 140px; display: block; } .adm-chart .ax { font: 10px sans-serif; fill: var(--muted); }
.adm-top { margin: 0; padding-left: 20px; font-size: 14px; } .adm-top li { margin: 2px 0; } .adm-top b { color: var(--accent-d); margin-left: 6px; }
.adm-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.adm-bar input[type=search], .adm-bar select, .adm-bar input[type=date], .adm-dlg input, .adm-dlg select { padding: 9px 12px; border-radius: 12px; border: 2px solid var(--card-border); background: var(--card); color: var(--ink); font: inherit; min-width: 0; } .adm-bar input[type=search] { flex: 1 1 240px; }
.adm-d { font-size: 13px; color: var(--muted); display: inline-flex; gap: 4px; align-items: center; }
.adm-scroll { overflow-x: auto; } .adm-table { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--card); }
.adm-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 8px 10px; border-bottom: 2px solid var(--soft); white-space: nowrap; }
.adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--soft); vertical-align: middle; } .adm-table tr.click { cursor: pointer; } .adm-table tr.click:hover td { background: var(--bg); }
.adm-table .pos { color: #059669; font-weight: 700; } .adm-table .neg { color: #e11d48; font-weight: 700; }
.adm-docs { white-space: nowrap; } .adm-docs .btn { padding: 4px 10px; font-size: 13px; margin-right: 4px; }
.adm-b { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--soft); color: var(--title); margin: 0 4px 2px 0; }
.adm-b.ok { background: #d1fae5; color: #065f46; } .adm-b.bad { background: #ffe4e6; color: #9f1239; } .adm-b.warn { background: #fef3c7; color: #92400e; } .adm-b.info { background: #dbeafe; color: #1e40af; }
.adm-actions { display: flex; flex-wrap: wrap; gap: 8px; } .adm-actions .btn { font-size: 14px; padding: 8px 12px; }
.adm-err { color: #be123c; font-weight: 700; } .adm-warn { background: #fef3c7; color: #92400e; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.adm-houses { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; margin-top: 10px; } .adm-house { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; padding: 12px; border-radius: 16px; background: var(--bg); } .adm-house small { color: var(--muted); }
.adm-room { position: relative; min-height: 520px; border-radius: 16px; overflow: hidden; } .adm-room #rmLetter { display: none !important; }
.adm-modal { position: fixed; inset: 0; background: rgba(30, 27, 75, .55); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 9999; }
.adm-dlg { background: var(--card); color: var(--text); border-radius: 20px; padding: 20px; width: min(460px, 100%); max-height: 90vh; overflow: auto; display: grid; gap: 10px; } .adm-dlg h3 { margin: 0; color: var(--title); } .adm-dlg label { display: grid; gap: 4px; font-weight: 700; font-size: 14px; } .adm-dlg label.adm-chk { display: flex; gap: 8px; align-items: center; }
.adm-row { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; } .adm-secret { display: flex; gap: 8px; align-items: center; } .adm-secret code { flex: 1; padding: 10px 12px; background: var(--bg); border-radius: 12px; font-size: 18px; letter-spacing: .05em; user-select: all; }
.adm-ax { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.adm-room .crumbs { display: none; }

/* Boîte aux lettres : une grande lettre au centre, une pile derrière, flèches, bande de miniatures */
.ltr-count { margin: 0 0 6px; } .ltr-newtxt { color: #ef4444; }
.ltr-stage { display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 6px; margin: 4px 0 6px; }
.ltr-nav { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--card-border); background: var(--paper); color: var(--title); font-size: 18px; cursor: pointer; box-shadow: 0 3px 0 var(--card-border); } .ltr-nav:hover:not(:disabled) { border-color: #a855f7; transform: scale(1.08); } .ltr-nav:disabled { opacity: .3; cursor: default; }
.ltr-deck { position: relative; width: min(290px, 100%); margin: 0 auto; padding: 8px 0 12px; }
.ltr-ghost { position: absolute; inset: 14px 6px 8px; border-radius: 16px; background: #fff; border: 3px solid var(--card-border); box-shadow: 0 6px 14px -8px rgba(91, 64, 56, .6); } .ltr-ghost.g1 { transform: rotate(-4deg); } .ltr-ghost.g2 { transform: rotate(3.5deg); background: #fff7ed; }
.ltr-card { position: relative; transform: rotate(-.6deg); } .ltr-card canvas { display: block; width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; box-shadow: 0 10px 22px -10px rgba(91, 64, 56, .8); background: #fff; }
.ltr-card .ltr-paper { margin: 0; aspect-ratio: 3 / 4; display: flex; flex-direction: column; justify-content: center; }
.ltr-card.fresh canvas, .ltr-card.fresh .ltr-paper { box-shadow: 0 0 0 4px #ef4444, 0 10px 22px -10px rgba(91, 64, 56, .8); }
.ltr-card.inR { animation: ltrInR .28s ease-out both; } .ltr-card.inL { animation: ltrInL .28s ease-out both; }
@keyframes ltrInR { from { opacity: 0; transform: translateX(46px) rotate(5deg); } } @keyframes ltrInL { from { opacity: 0; transform: translateX(-46px) rotate(-5deg); } }
.ltr-ribbon { position: absolute; z-index: 2; top: -6px; right: -8px; background: #ef4444; color: #fff; font: 800 13px Fredoka, sans-serif; padding: 4px 12px; border-radius: 999px; box-shadow: 0 4px 8px rgba(0, 0, 0, .25); transform: rotate(6deg); }
.ltr-meta { margin: 2px 0; }
.ltr-strip { display: flex; gap: 8px; overflow-x: auto; padding: 8px 4px 10px; margin: 4px 0 8px; scroll-snap-type: x proximity; }
.ltr-strip button { position: relative; flex: none; width: 52px; height: 68px; padding: 0; border: 3px solid var(--card-border); border-radius: 10px; background: #fff; overflow: hidden; cursor: pointer; scroll-snap-align: center; display: grid; place-items: center; opacity: .75; }
.ltr-strip button.on { opacity: 1; border-color: #a855f7; box-shadow: 0 0 0 2px #a855f7; transform: translateY(-3px); }
.ltr-strip button.new::after { content: ''; position: absolute; top: 3px; right: 3px; width: 11px; height: 11px; border-radius: 50%; background: #ef4444; border: 2px solid #fff; }
.ltr-strip canvas { width: 100%; height: 100%; display: block; } .ltr-th-e { font-size: 26px; }
.ltr-empty { text-align: center; padding: 10px 0 6px; } .ltr-empty-box { font-size: 72px; line-height: 1; }

/* ---- jetons : la monnaie gagnée en jouant (icône dessinée) ---- */
.jeton { display: inline-block; width: 1.15em; height: 1.15em; vertical-align: -.2em; font-style: normal; flex: none; background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20viewBox%3D%270%200%2032%2032%27%3E%3Ccircle%20cx%3D%2716%27%20cy%3D%2716%27%20r%3D%2715%27%20fill%3D%27%23f59e0b%27/%3E%3Ccircle%20cx%3D%2716%27%20cy%3D%2715%27%20r%3D%2713.5%27%20fill%3D%27%23fcd34d%27/%3E%3Ccircle%20cx%3D%2716%27%20cy%3D%2715%27%20r%3D%2710%27%20fill%3D%27%23fbbf24%27%20stroke%3D%27%23fde68a%27%20stroke-width%3D%271.5%27/%3E%3Cpath%20d%3D%27M16%207.6l2.2%204.6%205%20.6-3.7%203.5%201%205-4.5-2.5-4.5%202.5%201-5-3.7-3.5%205-.6z%27%20fill%3D%27%23fffbeb%27%20stroke%3D%27%23d97706%27%20stroke-width%3D%271%27%20stroke-linejoin%3D%27round%27/%3E%3C/svg%3E") center / contain no-repeat; }
.score-pill .jeton { width: 22px; height: 22px; }

/* ---- tableau des records ---- */
.rec-tabs { justify-content: center; } .rec-tabs .tab { cursor: pointer; font: inherit; }
.rec-only { display: flex; gap: 8px; justify-content: center; align-items: center; margin: 10px 0 16px; font-size: 14px; color: var(--muted); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; align-items: start; }
.rec-card { border: 2px solid var(--c); border-radius: 18px; padding: 12px; display: grid; gap: 8px; min-width: 0; }
.rec-card h3 { margin: 0; font: 600 17px Fredoka, sans-serif; }
.rec-card ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rec-card li { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-radius: 12px; }
.rec-card li.me { background: rgba(250, 204, 21, .22); }
.rec-card li > :first-child { flex: none; }
.rec-n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
.rec-lv { font-size: 11px; border-radius: 999px; padding: 1px 7px; background: rgba(99, 102, 241, .16); }
.rec-card li b { font: 600 19px Fredoka, sans-serif; font-variant-numeric: tabular-nums; } .rec-top { width: 1.4em; text-align: center; }
.rec-card .btn { justify-self: center; }
.bdg-gift { margin: 8px 0; padding: 8px 12px; border-radius: 14px; background: rgba(250, 204, 21, .2); font-size: 14px; } .feat-btn { text-decoration: none; }
.vil-quick .vil-locked { opacity: .75; border-style: dashed; }
/* ---- intérieurs des bâtiments du village ---- */
.int-stage { background-image: linear-gradient(rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); }
.int-tags, .int-fx { position: absolute; inset: 0; pointer-events: none; }
.vil-tag.int-tag { pointer-events: auto; cursor: pointer; border: 0; font-size: 12px; }
.int-fact { font-size: 17px; line-height: 1.55; text-align: center; }
@media (max-width: 560px) { .vil-tag.int-tag { font-size: 10.5px; padding: 3px 7px; } .vil-stage.int-stage { height: min(66vh, 108vw); min-height: 300px; } }

/* ---- bouton « Parents » de l'en-tête ---- */
.parent-btn { position: relative; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 0; width: auto; min-width: 48px; padding: 0 7px; border-radius: 16px; text-decoration: none; color: var(--text); }
.parent-btn small { font: 800 10px/1.1 Nunito, sans-serif; letter-spacing: .01em; }
.parent-btn svg { display: block; width: 20px; height: 20px; }
.sync-dot { position: absolute; top: 3px; right: 4px; width: 9px; height: 9px; border-radius: 50%; display: none; }
.parent-btn[data-st="saving"] .sync-dot { display: block; background: #f59e0b; }
.parent-btn:not([data-st="saved"]):not([data-st="saving"])[data-st] .sync-dot { display: block; background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .3); }

/* ---- accueil ---- */
.home { display: grid; gap: 14px; }
.home > * { min-width: 0; margin: 0; }
.home > #mailAlert:empty { display: none; }
.home-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.home-av { flex: none; display: block; }
.home-id { flex: 1 1 190px; min-width: 0; }
.home-id h1 { margin: 0; text-align: left; }
.home-id p { margin: 4px 0 8px; color: var(--muted); font-weight: 700; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.home-class { background: var(--c); color: #fff; border-radius: 999px; padding: 2px 11px; font: 600 14px Fredoka, sans-serif; }
.home-xp { height: 8px; border-radius: 999px; background: rgba(99, 102, 241, .16); overflow: hidden; max-width: 320px; }
.home-xp i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #818cf8, #c084fc); }
.home-stars { text-align: center; padding: 8px 16px; border-radius: 18px; background: rgba(250, 204, 21, .16); }
.home-stars b { display: block; font: 600 24px Fredoka, sans-serif; } .home-stars small { color: var(--muted); font-size: 12px; }
.home-next { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 20px; text-decoration: none; color: var(--text); border: 2px solid var(--c); background: color-mix(in srgb, var(--c) 11%, var(--card)); }
.home-next-ic { flex: none; font-size: 30px; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--card); }
.home-next-txt { flex: 1; min-width: 0; } .home-next-txt small { display: block; color: var(--muted); font-weight: 800; font-size: 12.5px; } .home-next-txt b { display: block; font: 600 19px/1.25 Fredoka, sans-serif; }
.home-next-go { flex: none; background: var(--c); color: #fff; border-radius: 999px; padding: 10px 18px; font: 600 16px Fredoka, sans-serif; text-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.home-done { padding: 14px; border-radius: 18px; background: rgba(34, 197, 94, .14); text-align: center; font-weight: 800; }
.home-h { font: 600 17px Fredoka, sans-serif; text-align: left; padding-top: 4px; }
.home-subjects { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.home-subj { display: grid; justify-items: center; gap: 6px; padding: 14px 8px 10px; border-radius: 20px; text-decoration: none; color: var(--text); border: 1.5px solid color-mix(in srgb, var(--c) 38%, transparent); background: var(--card); text-align: center; transition: transform .15s, box-shadow .15s; }
.home-subj-ic { font-size: 27px; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 17%, transparent); }
.home-subj b { font: 600 15.5px/1.2 Fredoka, sans-serif; } .home-subj small { color: var(--muted); font-weight: 800; font-size: 12px; }
.home-bar { width: 80%; height: 6px; border-radius: 999px; background: color-mix(in srgb, var(--c) 18%, transparent); overflow: hidden; } .home-bar i { display: block; height: 100%; background: var(--c); border-radius: 999px; }
.home-doors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.door { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 20px; text-decoration: none; color: var(--text); background: var(--card); border: 1.5px solid color-mix(in srgb, var(--c) 38%, transparent); transition: transform .15s, box-shadow .15s; min-width: 0; }
.d-jeux { --c: #f43f5e; } .d-badges { --c: #a855f7; } .d-village { --c: #22c55e; } .d-shop { --c: #f59e0b; }
.door-ic { flex: none; width: 46px; height: 46px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; background: color-mix(in srgb, var(--c) 16%, transparent); }
.door-txt { flex: 1; min-width: 0; } .door-txt b { display: block; font: 600 17px/1.25 Fredoka, sans-serif; } .door-txt small { color: var(--muted); font-weight: 700; font-size: 12.5px; }
.door-badges { display: flex; flex: none; } .door-badges img { width: 34px; height: 34px; margin-left: -10px; }
.door-dot { position: absolute; top: -6px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: #ef4444; color: #fff; font: 800 12px/22px Nunito, sans-serif; text-align: center; font-style: normal; }
.home-subj:hover, .door:hover, .home-next:hover { transform: translateY(-2px); box-shadow: 0 8px 18px -10px rgba(60, 50, 130, .45); }
.home-other summary { cursor: pointer; color: var(--muted); font-weight: 800; font-size: 14px; text-align: center; padding: 6px; }
.home-classes { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-top: 8px; }
.home-classes a { display: grid; justify-items: center; min-width: 74px; padding: 8px 14px; border-radius: 16px; text-decoration: none; color: var(--text); border: 2px solid var(--c); } .home-classes b { font: 600 17px Fredoka, sans-serif; } .home-classes small { color: var(--muted); font-size: 12px; }
@media (max-width: 620px) {
    .home-subjects { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .home-doors { grid-template-columns: 1fr; }
    .home-next { flex-wrap: wrap; } .home-next-go { width: 100%; text-align: center; }
    .home-stars { display: none; }
}
/* le livre pop-up a besoin de place */
main:has(#pop3d) { max-width: 1240px; }

/* ---- Mon compagnon ---- */
.me-link.wide { grid-column: 1 / -1; justify-content: center; }
.pals-head { text-align: center; margin-bottom: 10px; }
.pals-head h1, .pals-head .sub { margin: 0; }
.pals-top { scroll-margin-top: 80px; padding-bottom: 8px; }
.pals-stage { position: relative; height: clamp(190px, 34vh, 300px); max-width: 560px; margin: 0 auto; border-radius: 22px; overflow: hidden; background: var(--soft); display: flex; align-items: center; justify-content: center; }
.pals-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: pan-y; cursor: grab; }
.pals-now { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 8px 0 0; min-height: 34px; }
.pals-gift { text-align: center; margin: 8px auto 12px; max-width: 560px; padding: 10px 14px; border-radius: 16px; border: 2px dashed var(--good); background: color-mix(in srgb, var(--good) 12%, var(--card)); }
.pals button.shop-prev { border: 0; background: none; padding: 0; cursor: pointer; }
.pals .shop-item.seen { box-shadow: 0 0 0 3px #8b5cf6; }
.pals-emoji { font-size: 56px; }
@media (max-width: 560px) { .pals-stage { height: 180px; } }
.pals .shop-prev img { width: 96px; height: 96px; }

/* ----- textes à trous, mots et verbes à terminer (js/ecrit.js) ----- */
.lessons-h { font-size: 18px; margin: 18px 0 8px; text-align: left; }
.ec-form { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; }
.ec-title { margin: 0; font-size: 20px; color: var(--title); }
.ec-line { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; gap: 6px 12px; font-size: 26px; max-width: 640px; }
.ec-cue { font-size: 18px; color: var(--muted); }
.ec-word { line-height: 2; }
.ec-word .ec-in { padding: 2px 4px; field-sizing: content; min-width: 3.2ch; }
.ec-slot { display: inline-block; min-width: 2.2em; margin: 0 1px; padding: 0 4px; border-bottom: 3px dashed var(--accent); color: var(--accent); text-align: center; line-height: 1.3; }
.ec-slot.good { border-color: var(--good); background: var(--good-bg); color: var(--good); } .ec-slot.bad { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.ec-text { width: 100%; max-width: 640px; font-size: 20px; font-weight: 600; line-height: 2.4; padding: 10px 18px; border-radius: 16px; background: var(--soft); color: var(--ink); text-align: left; }
.ec-text.small { font-size: 15px; line-height: 2; padding: 8px 12px; margin-top: 4px; }
.ec-gap { display: inline-block; vertical-align: baseline; margin: 0 2px; padding: 2px 8px; font: inherit; line-height: 1.5; color: var(--ink); background: var(--paper); border: 2px dashed var(--accent); border-radius: 10px; cursor: pointer; }
.ec-gap::after { content: '\00a0'; }
.ec-gap.full { border-style: solid; }
.ec-gap.on { background: color-mix(in srgb, var(--accent) 14%, var(--paper)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); }
.ec-in { font: inherit; font-weight: 700; line-height: 1.4; max-width: 100%; margin: 0 2px; padding: 2px 8px; text-align: center; color: var(--ink); background: var(--paper); border: 2px dashed var(--accent); border-radius: 10px; outline: none; }
.ec-in:focus { border-style: solid; box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 28%, transparent); }
.ec-gap.good, .ec-in.good { border: 2px solid var(--good); background: var(--good-bg); color: var(--ink); opacity: 1; }
.ec-gap.bad, .ec-in.bad { border: 2px solid var(--bad); background: var(--bad-bg); animation: shake .4s; }
.ec-msg { margin: 0; min-height: 1.2em; font-weight: 700; color: var(--bad); text-align: center; }
.ec-msg:empty { display: none; }
.ec-accents { display: flex; gap: 6px; justify-content: center; width: 100%; }
.ec-accents button { min-width: 40px; min-height: 40px; font: inherit; font-size: 20px; font-weight: 700; color: var(--text); background: var(--paper); border: 2px solid var(--card-border); border-radius: 10px; cursor: pointer; }
.ec-bank { margin-top: 2px; } .ec-bank .chip { cursor: pointer; color: var(--text); } .ec-bank .chip.good { border-color: var(--good); background: var(--good-bg); } .ec-bank .chip.bad { border-color: var(--bad); background: var(--bad-bg); }
.question.ec { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; }
.fix .ec-text, .mistake .fix { overflow-wrap: anywhere; }

/* ----- difficulté des mini-jeux (js/difficulte.js) ----- */
.df { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.df-top { display: flex; align-items: center; justify-content: center; gap: 12px; }
.df-mascot { width: 104px; height: 98px; flex: none; }
.df-face { width: 100%; height: 100%; display: block; }
.df-face.pop { animation: dfpop .32s ease-out; }
@keyframes dfpop { 0% { transform: scale(.82) rotate(-5deg); } 65% { transform: scale(1.08) rotate(2deg); } 100% { transform: none; } }
.df-txt { display: flex; flex-direction: column; text-align: left; min-width: 8.5em; }
.df-txt small { font-size: 13px; font-weight: 700; color: var(--muted); }
.df-txt b { font: 600 23px/1.1 Fredoka, sans-serif; color: var(--dfd); text-transform: uppercase; letter-spacing: .01em; }
.df-slide { position: relative; width: 100%; max-width: 300px; }
.df-track { position: absolute; left: 0; right: 0; top: 7px; height: 26px; border-radius: 99px; background: linear-gradient(90deg, #9aa0ad 0 55%, #5560c4 75%, #b3328c); box-shadow: 0 0 0 5px #fff, 0 3px 10px 3px rgba(60, 30, 90, .22); overflow: hidden; }
.df-track i { position: absolute; left: 0; top: 0; bottom: 0; width: calc(20px + (100% - 40px) * var(--dfk)); background: var(--df); transition: width .16s ease-out, background .16s; }
.df-range { -webkit-appearance: none; appearance: none; position: relative; width: 100%; height: 40px; margin: 0; background: transparent; cursor: pointer; display: block; touch-action: none; }
.df-range::-webkit-slider-runnable-track { height: 40px; background: transparent; }
.df-range::-webkit-slider-thumb { -webkit-appearance: none; width: 40px; height: 40px; border-radius: 50%; background: var(--dfd); border: 8px solid #fff; box-shadow: 0 2px 8px rgba(40, 20, 60, .4); }
.df-range::-moz-range-track { height: 40px; background: transparent; }
.df-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--dfd); border: 8px solid #fff; box-shadow: 0 2px 8px rgba(40, 20, 60, .4); }
.df-range:focus-visible { outline: 3px solid var(--dfd); outline-offset: 6px; border-radius: 99px; }
.df-ticks { display: flex; justify-content: space-between; margin-top: 4px; }
.df-ticks button { width: 40px; height: 26px; border: 0; background: transparent; font: 700 13px Nunito, sans-serif; color: var(--muted); cursor: pointer; }
.df-school { margin: 0; font-size: 12.5px; color: var(--muted); text-align: center; }
.ov-card .btn.df-go { background: var(--df); border-color: var(--df); box-shadow: 0 5px 0 var(--dfd); color: #fff; display: flex; flex-direction: column; align-items: center; line-height: 1.15; min-width: 190px; width: fit-content; margin: 6px auto 8px; align-self: center; }
.ov-card .btn.df-go b { font-size: 22px; } .ov-card .btn.df-go small { font-size: 12px; font-weight: 700; opacity: .95; }
.ov-card.has-df > .big { font-size: 34px; line-height: 1; margin: 0; }
.ov-card .df-how { font-size: 14px; }
.df-tag { display: inline-block; font: 700 11px/1.5 Nunito, sans-serif; color: #fff; background: var(--dfd); border-radius: 99px; padding: 0 8px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .df-face.pop { animation: none; } .df-track i { transition: none; } }

/* textes sur plusieurs lignes : pas de mot seul en dernière ligne */
p, .sub, .alert > span, .arc-card > small, .lib-book > small { text-wrap: pretty; }
p.center { display: block; }                 /* un paragraphe centré reste un paragraphe : ses phrases et ses mots en gras s’enchaînent normalement */
