/* La Galerie — style « licorne & arc-en-ciel », pensé mobile/tablette d'abord */

@font-face {
  font-family: 'Baloo 2';
  src: url('../fonts/baloo2-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --pink: #ff4fa3;
  --pink-l: #ffd6ec;
  --purple: #8b5cf6;
  --lav: #efe7ff;
  --mint: #c9f7e6;
  --sky: #d7ecff;
  --yellow: #ffd24d;
  --ink: #3b2352;
  --ink-2: #6b5580;
  --white: #fff;
  --radius: 22px;
  --shadow: 0 6px 0 rgba(90, 40, 120, .12), 0 12px 30px rgba(90, 40, 120, .12);
  --font: 'Baloo 2', ui-rounded, 'SF Pro Rounded', 'Segoe UI', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  background: linear-gradient(180deg, #ffe3f3 0%, #efe3ff 45%, #dcefff 100%) fixed;
  min-height: 100vh;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; }
h2 { font-size: 1.6rem; font-weight: 800; }
h3 { font-size: 1.25rem; font-weight: 800; margin-top: 1.2em; }
b, strong { font-weight: 800; }
:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; border-radius: 10px; }
[hidden] { display: none !important; }

/* ---------- Ciel décoratif ---------- */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.rainbow {
  position: absolute; left: 50%; top: -38vmin; width: 150vmin; height: 150vmin; transform: translateX(-50%);
  border-radius: 50%; opacity: .28;
  background: radial-gradient(circle, transparent 52%, #ff5d5d 52% 54.5%, #ffa94d 54.5% 57%, #ffe14d 57% 59.5%, #6ee07a 59.5% 62%, #4fb5ff 62% 64.5%, #a77bff 64.5% 67%, transparent 67%);
}
.cloud { position: absolute; width: 160px; height: 50px; background: #fff; border-radius: 50px; opacity: .8; animation: drift 60s linear infinite; }
.cloud::before, .cloud::after { content: ''; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 70px; height: 70px; top: -35px; left: 25px; }
.cloud::after { width: 90px; height: 90px; top: -45px; left: 65px; }
.c1 { top: 18%; left: -200px; }
.c2 { top: 55%; left: -200px; animation-delay: -25s; transform: scale(.7); }
.c3 { top: 80%; left: -200px; animation-delay: -45s; transform: scale(.9); }
@keyframes drift { to { left: 110%; } }

/* ---------- En-tête ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 8px max(12px, env(safe-area-inset-left));
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 12px rgba(90, 40, 120, .1);
}
.logo { font-weight: 800; font-size: 1.3rem; color: var(--pink); text-decoration: none; white-space: nowrap; }
#hud { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; justify-content: flex-end; }
.chip {
  border: 0; border-radius: 999px; padding: 6px 12px; min-height: 44px; min-width: 44px;
  background: var(--lav); font-weight: 700; font-size: .95rem; display: inline-flex; align-items: center; gap: 4px;
  box-shadow: 0 3px 0 rgba(90, 40, 120, .15);
}
.chip:active { transform: translateY(2px); box-shadow: none; }
.chip.money { background: #fff4c2; }
.chip.stars { background: #fff0d6; }
.chip.who span { max-width: 9ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bump { animation: bump .4s; }
@keyframes bump { 50% { transform: scale(1.25); } }
body.counting #hud-money .m { visibility: hidden; }

/* ---------- Structure ---------- */
main { max-width: 980px; margin: 0 auto; padding: 14px 12px 40px; }
.hero { text-align: center; padding: 18px 8px 6px; }
.hero h1 { font-size: clamp(2rem, 7vw, 3.4rem); font-weight: 800; color: var(--pink); text-shadow: 0 3px 0 #fff, 0 6px 0 rgba(139, 92, 246, .25); margin: 0; }
.hero h1 small { display: block; font-size: .42em; color: var(--purple); text-shadow: none; margin-top: 6px; }
.tagline { font-size: 1.1rem; color: var(--ink-2); margin: 10px auto 0; max-width: 40ch; }
body.playing .hero, body.playing .intro, body.focus .hero, body.focus .intro { display: none; }

.card { background: rgba(255, 255, 255, .92); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin: 16px 0; }
.intro .card { font-size: 1rem; }
.center { text-align: center; }
.small { font-size: .9rem; color: var(--ink-2); }
.lead { font-size: 1.1rem; text-align: center; margin: 4px 0 14px; }
.err { background: #ffe1e6; color: #b3123b; border-radius: 12px; padding: 8px 12px; font-weight: 700; }
.placeholder { color: var(--ink-2); opacity: .8; margin: 0; }
.empty { text-align: center; font-size: 1.15rem; padding: 20px; }

.how li { margin: 8px 0; }
.levels-table { width: 100%; border-collapse: collapse; }
.levels-table th, .levels-table td { padding: 8px; text-align: left; border-bottom: 2px dashed var(--pink-l); vertical-align: top; }
.levels-table td:first-child { font-weight: 800; color: var(--pink); text-align: center; }
.shop-list { columns: 2 220px; padding-left: 1.1em; }
.faq h3 { font-size: 1.1rem; color: var(--purple); }
.site-footer { text-align: center; color: var(--ink-2); font-size: .9rem; padding: 10px 16px 30px; }

/* ---------- Boutons ---------- */
.btn {
  border: 0; border-radius: 999px; padding: 10px 20px; min-height: 48px;
  background: #fff; font-weight: 800; font-size: 1.05rem;
  box-shadow: 0 4px 0 rgba(90, 40, 120, .2); transition: transform .1s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 rgba(90, 40, 120, .2); }
.btn:disabled { opacity: .5; }
.btn.primary { background: linear-gradient(135deg, var(--pink), var(--purple)); color: #fff; box-shadow: 0 4px 0 #6a3fc7; }
.btn.good { background: #8fe07a; box-shadow: 0 4px 0 #4f9e3c; }
.btn.bad { background: #ff8fa3; box-shadow: 0 4px 0 #c24d64; }
.btn.on { background: var(--yellow); }
.btn.big { font-size: 1.3rem; padding: 14px 30px; }
.btn.round { width: 48px; height: 48px; padding: 0; font-size: 1.5rem; flex: none; }
.link { background: none; border: 0; color: var(--purple); font-weight: 700; text-decoration: underline; min-height: 44px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 4px; }
.actions.col { flex-direction: column; align-items: stretch; }

/* ---------- Profils & formulaires ---------- */
.home-card h2 { text-align: center; }
.profiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.profile {
  border: 0; border-radius: 20px; padding: 14px 8px; background: linear-gradient(180deg, #fff, var(--lav));
  display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 5px 0 rgba(90, 40, 120, .15);
}
.profile .av { font-size: 3rem; line-height: 1.1; }
.profile small { color: var(--ink-2); font-size: .85rem; }
.profile.new { background: linear-gradient(180deg, #fff, var(--mint)); }
.profile.loading { animation: pulse .8s infinite; }
@keyframes pulse { 50% { transform: scale(.95); opacity: .7; } }
.form-card { max-width: 560px; margin-inline: auto; }
.field { display: block; font-weight: 800; margin: 12px 0; }
.field input {
  display: block; width: 100%; margin-top: 4px; font: inherit; font-size: 1.2rem; padding: 10px 14px;
  border: 3px solid var(--pink-l); border-radius: 14px; background: #fff;
}
.field input:focus { border-color: var(--pink); outline: none; }
fieldset { border: 0; padding: 0; margin: 12px 0; }
legend { font-weight: 800; margin-bottom: 6px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.pill span { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 4px 14px; border-radius: 999px; background: var(--lav); font-weight: 700; border: 3px solid transparent; }
.pill.big span { font-size: 1.8rem; padding: 2px 8px; }
.pill input:checked + span { background: var(--pink-l); border-color: var(--pink); }
.pill input:focus-visible + span { outline: 4px solid var(--purple); }

/* ---------- Inscription en didacticiel ---------- */
.wizard { max-width: 560px; margin-inline: auto; text-align: center; }
.wz-top { display: flex; align-items: center; gap: 10px; }
.dots { flex: 1; display: flex; justify-content: center; gap: 8px; padding-right: 48px; }
.dots span { width: 14px; height: 14px; border-radius: 50%; background: var(--lav); transition: background .3s, transform .3s; }
.dots span.on { background: var(--pink); transform: scale(1.15); }
.wz-body { animation: pop .35s cubic-bezier(.3, 1.6, .6, 1); padding: 6px 0 4px; }
.wz-emo { font-size: 4.5rem; line-height: 1.1; margin: 6px 0; }
.wz-body h2 { font-size: clamp(1.6rem, 6vw, 2.1rem); }
.wz-sub { font-size: 1.2rem; font-weight: 700; color: var(--ink-2); margin: 4px 0 10px; }
.wz-form { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.big-input {
  width: 100%; max-width: 340px; font: inherit; font-size: 2rem; font-weight: 800; text-align: center; color: var(--ink);
  padding: 8px 14px; border: 4px solid var(--pink-l); border-radius: 18px; background: #fff;
}
.big-input:focus { border-color: var(--pink); outline: none; }
.big-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.choice {
  width: 76px; height: 76px; border: 0; border-radius: 50%; font-size: 2rem; font-weight: 800;
  background: linear-gradient(180deg, #fff, var(--lav)); box-shadow: 0 5px 0 rgba(90, 40, 120, .2);
}
.big-choices.emo .choice { font-size: 2.8rem; width: 84px; height: 84px; }
.choice:active { transform: translateY(4px); box-shadow: none; }
.choice:hover { filter: brightness(1.05); background: linear-gradient(180deg, #fff, var(--pink-l)); }
.pinpad { max-width: 300px; margin: 0 auto; }
.pin-boxes { display: flex; justify-content: center; gap: 10px; margin: 6px 0 14px; }
.pin-boxes span {
  width: 56px; height: 64px; border-radius: 14px; border: 4px solid var(--pink-l); background: #fff;
  display: grid; place-items: center; font-size: 2rem; font-weight: 800;
}
.pin-boxes span.on { border-color: var(--pink); background: #fff5fb; }
.pin-boxes.show span { border-color: var(--purple); color: var(--purple); }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.bounce { animation: hop 1.6s ease-in-out infinite; }

/* ---------- Galerie ---------- */
.mall-sign {
  text-align: center; background: #fff; border-radius: var(--radius); padding: 16px; margin: 10px 0 16px;
  border: 6px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #ff5d5d, #ffa94d, #ffe14d, #6ee07a, #4fb5ff, #a77bff);
  background-origin: border-box; background-clip: padding-box, border-box; box-shadow: var(--shadow);
}
.mall-sign h2 { color: var(--pink); margin: 0; font-size: clamp(1.5rem, 5vw, 2.2rem); }
.mall-sign p { margin: 0; color: var(--ink-2); font-weight: 700; }
.modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.mode {
  border: 0; border-radius: var(--radius); padding: 18px; text-align: left;
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  box-shadow: var(--shadow); transition: transform .15s;
}
.mode:hover { filter: brightness(1.04) saturate(1.1); }
.mode .big { grid-row: span 2; font-size: 3.2rem; line-height: 1; }
.mode b { font-size: 1.35rem; }
.mode small { color: var(--ink-2); font-size: .95rem; }
.m-sell { background: linear-gradient(135deg, #ffd6ec, #ffb3d9); }
.m-buy { background: linear-gradient(135deg, #e3d4ff, #c9b1ff); }
.m-room { background: linear-gradient(135deg, #d4f5ff, #aee6ff); }
.m-wallet { background: linear-gradient(135deg, #fff4c2, #ffe38a); }
.m-level { background: linear-gradient(135deg, #d5f9e6, #a8efc8); }
.mall-floor { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 22px; font-size: 2rem; }
.mall-floor span { animation: hop 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .2s); }
@keyframes hop { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } }

/* ---------- Barre de titre des écrans ---------- */
.topbar { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; }
.topbar h2 { margin: 0; font-size: clamp(1.2rem, 4.5vw, 1.7rem); flex: 1; }
.tb-right .day { background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 800; font-size: .95rem; white-space: nowrap; box-shadow: 0 3px 0 rgba(90, 40, 120, .12); }

/* ---------- Devantures de boutiques ---------- */
.shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.storefront {
  --c: var(--pink);
  position: relative; border: 0; padding: 0 0 12px; border-radius: 18px 18px 14px 14px; overflow: hidden;
  background: #fff; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; transition: transform .15s;
}
.storefront:hover { filter: brightness(1.04) saturate(1.1); }
.awning {
  width: 100%; height: 38px;
  background: repeating-linear-gradient(90deg, var(--c) 0 22px, #fff 22px 44px);
  -webkit-mask: radial-gradient(12px at 11px 100%, #0000 98%, #000) 0 0 / 22px 100%;
          mask: radial-gradient(12px at 11px 100%, #0000 98%, #000) 0 0 / 22px 100%;
}
.window {
  font-size: 3.4rem; line-height: 1; margin: 8px 0 4px; width: 78%; aspect-ratio: 4 / 3;
  display: grid; place-items: center; border-radius: 12px; border: 4px solid var(--c);
  background: linear-gradient(160deg, #fff 30%, color-mix(in srgb, var(--c) 18%, #fff));
}
.sign { padding: 0 8px; text-align: center; font-size: 1rem; color: color-mix(in srgb, var(--c) 70%, #000); }
.owned { font-size: .8rem; color: var(--ink-2); }

/* ---------- Scène (client + bulle) ---------- */
.scene {
  position: relative; min-height: 210px; border-radius: var(--radius); overflow: hidden;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 22%, #fff) 0%, #fff 70%, #f6e9da 70%, #efdcc6 100%);
  box-shadow: var(--shadow); display: flex; align-items: flex-end; padding: 44px 12px 0;
}
.scene.small { min-height: 180px; }
.shelf {
  position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-around;
  font-size: 1.6rem; padding: 6px; border-bottom: 6px solid color-mix(in srgb, var(--c) 60%, #7a4a22);
  background: color-mix(in srgb, var(--c) 12%, #fff);
}
.customer { position: relative; width: 120px; flex: none; display: flex; flex-direction: column; align-items: center; }
.customer .fig { width: 110px; animation: idle 2.6s ease-in-out infinite; transform-origin: bottom center; }
.customer svg { width: 100%; height: auto; display: block; }
.cname { font-weight: 800; font-size: .85rem; background: #fff; border-radius: 999px; padding: 0 10px; margin: -6px 0 6px; box-shadow: 0 2px 0 rgba(0, 0, 0, .1); }
.customer.enter { animation: enter .7s cubic-bezier(.3, 1.4, .6, 1); }
.customer.bye { animation: bye 1s 1.2s ease-in forwards; }
@keyframes idle { 50% { transform: translateY(-4px) rotate(1deg); } }
@keyframes enter { from { transform: translateX(-160%); } }
@keyframes bye { to { transform: translateX(-180%); opacity: 0; } }
.bubble {
  position: relative; align-self: center; margin: 0 0 30px 14px; background: #fff; border-radius: 20px; padding: 12px 16px;
  font-size: 1.1rem; font-weight: 600; box-shadow: 0 4px 0 rgba(90, 40, 120, .12); flex: 1; max-width: 480px;
}
.bubble::before { content: ''; position: absolute; left: -14px; bottom: 20px; border: 10px solid transparent; border-right: 16px solid #fff; border-left: 0; }
.bubble.pop { animation: pop .35s cubic-bezier(.3, 1.6, .6, 1); }
@keyframes pop { from { transform: scale(.7); opacity: 0; } }

/* ---------- Comptoir, ticket ---------- */
.play-grid { display: grid; gap: 14px; }
.play-left { display: grid; gap: 14px; align-content: start; }
.counter {
  padding: 14px 12px; border-radius: var(--radius);
  background: linear-gradient(180deg, #f3c89a, #e5ad76); box-shadow: var(--shadow);
}
.countup { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 6px; }
.cu-val { background: #fff; border-radius: 10px; padding: 0 8px; font-weight: 800; box-shadow: 0 2px 0 rgba(0, 0, 0, .08); }
.cu-add { color: #0a7d4f; font-weight: 800; font-size: .9em; }
.cu-add::after { content: ' →'; color: var(--ink-2); }
.cu-end { margin: 6px 0 0; font-size: 1.1rem; }
.tray .placeholder.ask { margin: 0; opacity: 1; color: var(--ink); }
.ticket {
  background: #fff; border-radius: 6px; padding: 10px 14px 16px; margin: 0 auto; max-width: 520px;
  font-size: 1.02rem; position: relative;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
          mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / 16px 100%;
}
.r-head { text-align: center; font-weight: 800; border-bottom: 2px dashed #ddd; padding-bottom: 4px; margin-bottom: 6px; }
.r-line { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.r-line b { white-space: nowrap; }
.r-line .unit { color: var(--ink-2); font-size: .9em; }
.r-line.extra { color: #0a7d4f; }
.tag { font-style: normal; background: #ff4f6d; color: #fff; border-radius: 6px; padding: 0 6px; font-size: .8em; font-weight: 800; white-space: nowrap; }
.r-total { display: flex; justify-content: space-between; border-top: 2px dashed #ddd; margin-top: 6px; padding-top: 6px; font-size: 1.25rem; font-weight: 800; }
.r-total b { color: var(--pink); }
.step { background: rgba(255, 255, 255, .92); border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.ask { font-weight: 800; font-size: 1.15rem; text-align: center; margin: 6px 0; }
.paid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px 12px; scroll-margin-top: 110px; }
.paid p { margin: 0; }
.fb { text-align: center; font-weight: 800; margin: 8px 0 0; min-height: 1.4em; }
.fb.bad { color: #c2185b; }
.fb.good { color: #2e8b3d; }
.hint { background: #fffbe0; border: 3px dashed var(--yellow); border-radius: 16px; padding: 10px 14px; margin-top: 12px; }
.hint ol { margin: 6px 0 0; padding-left: 1.3em; }

/* ---------- Billets et pièces ---------- */
.pieces { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; }
.piece {
  position: relative; border: 0; background: none; padding: 2px; line-height: 0; border-radius: 10px;
  filter: drop-shadow(0 3px 2px rgba(60, 30, 80, .25)); transition: transform .12s;
  -webkit-tap-highlight-color: transparent;
}
button.piece:hover { filter: drop-shadow(0 3px 2px rgba(60, 30, 80, .25)) brightness(1.1); }
button.piece:active { transform: scale(.94); }
.piece svg { display: block; }
.piece .count {
  position: absolute; right: -6px; top: -8px; background: var(--pink); color: #fff; border-radius: 999px;
  font-size: .85rem; line-height: 1; padding: 4px 7px; font-weight: 800; box-shadow: 0 2px 0 rgba(0, 0, 0, .15);
}
.till {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px;
  background: linear-gradient(180deg, #5b6b7d, #3f4b58); border-radius: 18px; padding: 12px;
  box-shadow: inset 0 4px 10px rgba(0, 0, 0, .35); margin-top: 10px;
}
.till .piece { touch-action: none; }
.wallet-till { background: linear-gradient(180deg, #ff9ccf, #e4679f); }
.wallet-till.breaking .piece { animation: wiggle .5s infinite; }
@keyframes wiggle { 25% { transform: rotate(-4deg); } 75% { transform: rotate(4deg); } }
.tray {
  min-height: 96px; border: 4px dashed #d6b48d; border-radius: 18px; background: #fffaf2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px; transition: background .2s;
}
.tray.over { background: #fff0c2; border-color: var(--pink); }
.tray .pieces { gap: 2px; }
.tray .piece.is-coin { margin: 0 -3px; }
.running { margin: 4px 0 0; font-weight: 700; }
.ghost { position: fixed; z-index: 1000; pointer-events: none; transform: translate(-50%, -50%) scale(1.1) rotate(-6deg); opacity: .92; }
.fly { position: fixed; z-index: 900; pointer-events: none; line-height: 0; }
.static .piece { cursor: default; }

/* ---------- Clavier numérique ---------- */
.keypad { max-width: 300px; margin: 0 auto; }
.kp-display {
  display: block; text-align: center; font-size: 2rem; font-weight: 800; background: #fff; border-radius: 14px;
  border: 3px solid var(--pink-l); padding: 2px 10px; margin-bottom: 8px;
}
.kp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-key { border: 0; border-radius: 14px; min-height: 56px; font-size: 1.6rem; font-weight: 800; background: var(--lav); box-shadow: 0 4px 0 rgba(90, 40, 120, .2); }
.kp-key:active { transform: translateY(3px); box-shadow: none; }
.kp-ok { width: 100%; margin-top: 10px; }

/* ---------- Victoire ---------- */
.win { text-align: center; }
.win p { font-size: 1.2rem; margin: 6px 0; }
.stars-row { font-size: 3rem; line-height: 1; }
.stars-row span { display: inline-block; animation: star .5s cubic-bezier(.3, 1.8, .6, 1) backwards; }
.stars-row span:nth-child(2) { animation-delay: .15s; }
.stars-row span:nth-child(3) { animation-delay: .3s; }
.stars-row .off { filter: grayscale(1); opacity: .25; }
@keyframes star { from { transform: scale(0) rotate(-90deg); } }
.bigemo { font-size: 5rem; line-height: 1.1; animation: star .6s cubic-bezier(.3, 1.8, .6, 1); }
.msg { background: #e5ffe0; border-radius: 14px; padding: 8px 12px; }
.msg.warn { background: #fff0d6; }

/* ---------- Shopping ---------- */
.items { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.item {
  position: relative; border: 0; border-radius: 18px; background: #fff; padding: 12px 8px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 2px; border-top: 8px solid var(--c); transition: transform .15s;
}
.item:hover { filter: brightness(1.04) saturate(1.1); }
.item .emo { font-size: 3rem; line-height: 1.1; }
.item b { font-size: .95rem; text-align: center; line-height: 1.15; }
.price { background: var(--yellow); border-radius: 8px; padding: 0 8px; font-weight: 800; transform: rotate(-3deg); display: inline-block; box-shadow: 0 2px 0 rgba(0, 0, 0, .12); }
.own { position: absolute; top: 4px; right: 6px; font-size: .8rem; font-weight: 800; color: var(--purple); }
.product { display: flex; align-items: center; justify-content: center; gap: 14px; background: #fff; border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.product .emo { font-size: 3.4rem; }
.product b { display: block; font-size: 1.2rem; }
.product { margin: 0; }
.sub { text-align: center; font-size: 1.1rem; margin: 14px 0 0; }

/* ---------- Porte-monnaie ---------- */
.wallet-total { text-align: center; font-size: 1.5rem; background: #fff; border-radius: 18px; padding: 10px; box-shadow: var(--shadow); }
.wallet-total b { color: var(--pink); font-size: 2rem; }

/* ---------- Chambre ---------- */
.room-wall {
  border-radius: var(--radius); padding: 16px; min-height: 200px; box-shadow: var(--shadow);
  background:
    radial-gradient(circle at 20px 20px, rgba(255, 255, 255, .7) 5px, transparent 6px) 0 0 / 60px 60px,
    linear-gradient(180deg, #ffd0ea, #e9d2ff);
}
.things {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 22px 0;
}
.thing {
  position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; height: 118px;
  justify-content: flex-end; padding: 0 4px 4px; border-bottom: 10px solid #c98a5a; box-shadow: 0 6px 0 -2px rgba(90, 50, 20, .25);
}
.thing .emo { font-size: 3rem; line-height: 1; transition: transform .2s; }
.thing:hover .emo { transform: scale(1.2) rotate(-6deg); }
.thing small { font-size: .75rem; font-weight: 700; line-height: 1.1; }
.thing .count { position: absolute; top: 0; right: 10%; background: var(--pink); color: #fff; border-radius: 999px; padding: 0 7px; font-size: .8rem; font-weight: 800; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.badge { background: #fff; border-radius: 16px; padding: 10px 6px; text-align: center; box-shadow: 0 4px 0 rgba(90, 40, 120, .12); filter: grayscale(1); opacity: .45; }
.badge.on { filter: none; opacity: 1; background: linear-gradient(180deg, #fff, #fff4c2); }
.badge span { font-size: 2.2rem; display: block; line-height: 1.2; }
.badge small { font-size: .8rem; font-weight: 700; line-height: 1.1; display: block; }
.stats { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.stats li { background: #fff; border-radius: 14px; padding: 8px 12px; box-shadow: 0 3px 0 rgba(90, 40, 120, .1); }
.stats b { color: var(--pink); display: block; font-size: 1.3rem; }

/* ---------- Niveaux ---------- */
.levels { display: grid; gap: 10px; }
.level {
  border: 3px solid transparent; border-radius: 18px; background: #fff; padding: 12px; text-align: left;
  display: flex; gap: 14px; align-items: center; box-shadow: var(--shadow);
}
.level.current { border-color: var(--pink); background: linear-gradient(90deg, #fff, var(--pink-l)); }
.level .num {
  flex: none; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.6rem; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--pink), var(--purple));
}
.level .d { display: block; color: var(--ink-2); font-size: .95rem; }
.level .st { display: block; color: var(--purple); font-weight: 700; }

/* ---------- Modale, toast, confettis ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 200; background: rgba(59, 35, 82, .72); display: grid; place-items: center; padding: 14px;
  animation: fade .2s;
}
.modal-wrap.out { opacity: 0; transition: opacity .25s; }
.modal {
  background: #fff; border-radius: 26px; padding: 20px; width: min(520px, 100%); max-height: 92vh; overflow: auto; text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .3); animation: pop .35s cubic-bezier(.3, 1.6, .6, 1);
}
.big-stars { font-size: 2.4rem; font-weight: 800; margin: 0; }
.levelup { background: linear-gradient(135deg, #fff4c2, #ffd6ec); border-radius: 18px; padding: 12px; margin: 12px 0; }
@keyframes fade { from { opacity: 0; } }
.toast {
  position: fixed; left: 50%; bottom: 20px; z-index: 300; transform: translate(-50%, 150%);
  background: #fff; border-radius: 999px; padding: 10px 20px; font-weight: 700; box-shadow: 0 10px 30px rgba(59, 35, 82, .3);
  transition: transform .35s cubic-bezier(.3, 1.4, .6, 1); max-width: 92vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); }
.t-emo { font-size: 1.6rem; vertical-align: middle; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.confetti i { position: absolute; top: -30px; width: 10px; height: 16px; border-radius: 3px; animation: fall 2s ease-in forwards; }
.confetti i.emo { width: auto; height: auto; font-style: normal; font-size: 1.4rem; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--rot)); } }

/* ---------- Grands écrans : ticket à gauche, caisse à droite ---------- */
/* Objectif : écran de jeu sans défilement sur un portable 14" (≈ 1512 × 780 utiles) */
@media (min-width: 900px) {
  body.playing main { max-width: 1260px; padding-top: 8px; padding-bottom: 12px; }
  body.playing .site-footer { display: none; }
  .topbar { margin: 0 0 10px; }
  .play-grid { grid-template-columns: minmax(330px, 400px) 1fr; align-items: start; }
  .scene { min-height: 196px; }
  .step .ask { margin: 2px 0 6px; }
  .step .actions { margin: 10px 0 0; }
  .step .fb { margin: 6px 0 0; min-height: 1.2em; }
  .tray { min-height: 84px; }
  .till { margin-top: 8px; padding: 10px; }
  .kp-key { min-height: 50px; }
  .kp-display { font-size: 1.8rem; margin-bottom: 6px; }
  .step .hint { margin-top: 10px; padding: 8px 12px; }
  .total-row { display: flex; gap: 16px; align-items: flex-start; justify-content: center; }
  .kp-col { flex: 0 0 320px; }
  .total-row .hint { flex: 1; margin-top: 36px; max-width: 460px; }
  .room-wall { min-height: 150px; }
  .stats li { padding: 4px 10px; }
  .stats b { font-size: 1.1rem; }
  .step .hint ol { margin-top: 2px; }
  .levels { grid-template-columns: 1fr 1fr; }
  .level { padding: 8px 12px; }
  .room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
  .room-side h3:first-child { margin-top: 0; }
  .badges { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
  .badge { padding: 6px 4px; }
  .badge span { font-size: 1.8rem; }
  .stats { grid-template-columns: repeat(3, 1fr); }
}

/* Écrans peu hauts (portables 13", 1280×720) : on resserre encore */
@media (min-width: 900px) and (max-height: 820px) {
  .site-header { padding-top: 4px; padding-bottom: 4px; }
  .chip { min-height: 40px; }
  .scene { min-height: 170px; padding-top: 38px; }
  .customer .fig { width: 92px; }
  .piece svg { zoom: .86; }
  .tray { min-height: 72px; }
  .kp-key { min-height: 44px; }
  .ticket { font-size: .95rem; }
  .btn { min-height: 44px; padding: 8px 18px; }
}

/* ---------- Petits écrans ---------- */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .piece svg { zoom: .78; }
  .till { gap: 4px; padding: 8px; }
  .scene { min-height: 176px; padding-top: 40px; }
  .shelf { font-size: 1.3rem; padding: 4px; }
  .customer { width: 96px; }
  .customer .fig { width: 90px; }
  .bubble { font-size: 1rem; margin-left: 10px; }
  .logo { font-size: 1.1rem; }
  .chip { padding: 4px 9px; font-size: .88rem; }
  .chip.who span { display: none; }
  .mode { padding: 14px; }
  .mode .big { font-size: 2.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Très petits écrans de portable (≈ 1280×680 utiles) */
@media (min-width: 900px) and (max-height: 700px) {
  .scene { min-height: 150px; }
  .customer .fig { width: 80px; }
  .piece svg { zoom: .78; }
  .room-wall { min-height: 110px; }
  .badge span { font-size: 1.5rem; }
}
