/* =============================================================================
   Calendrier de l'Avent : mobile-first
   ============================================================================= */

:root {
  --night: #0b231c;
  --night-2: #123629;
  --pine: #1f5c46;
  --pine-light: #2d7a5e;
  --berry: #b8323a;
  --berry-dark: #8c1f28;
  --cream: #f4e7cc;
  --paper: #fbf5e9;
  --gold: #e3b458;
  --gold-dark: #b0832b;
  --ink: #2b1d15;
  --ink-soft: #6b5848;
  --text: #f7efe0;
  --text-soft: #c7c0ad;
  --success: #2e7d4f;
  --danger: #b8323a;

  --radius: 16px;
  --shadow: 0 10px 30px rgb(0 0 0 / 0.35);
  --display: 'Fraunces', Georgia, serif;
  --body: 'Nunito', system-ui, -apple-system, sans-serif;
  --max: 560px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--body);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 50% -10%, #1d4a3a 0%, transparent 60%),
    radial-gradient(800px 500px at 100% 100%, #3a1418 0%, transparent 55%),
    var(--night);
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
}

button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

[hidden] { display: none !important; }

/* ---- Snow & confetti ----------------------------------------------------- */

.snow { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 0; }
.flake {
  position: absolute; top: -10px;
  border-radius: 50%;
  background: #fff;
  opacity: 0.7;
  animation: fall linear infinite;
}
@keyframes fall {
  to { transform: translate3d(var(--drift, 20px), 105vh, 0); }
}

.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 100; }

/* ---- Layout ------------------------------------------------------------- */

.app {
  position: relative; z-index: 1;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px calc(96px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 -16px 16px;
  padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
  background: linear-gradient(var(--night) 60%, rgb(11 35 28 / 0));
}
.topbar__eyebrow {
  margin: 0;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--gold);
}
.topbar__title {
  margin: 2px 0 0;
  font-family: var(--display); font-weight: 500; font-style: italic;
  font-size: clamp(1.5rem, 6.5vw, 2rem); line-height: 1.1;
}

.balance {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px 8px 12px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), var(--gold-dark));
  color: var(--ink);
  font-weight: 800; font-size: 1.15rem;
  box-shadow: 0 4px 18px rgb(227 180 88 / 0.35);
  font-variant-numeric: tabular-nums;
}
.balance__star { font-size: 1.1rem; }
.balance.bump { animation: bump 0.5s ease; }
@keyframes bump { 40% { transform: scale(1.15); } }

.hint { text-align: center; color: var(--text-soft); font-size: 0.85rem; margin: 18px 0 0; }

.section-title {
  font-family: var(--display); font-weight: 500;
  font-size: 1.35rem;
  margin: 26px 0 12px;
}

/* ---- Bottom tabs --------------------------------------------------------- */

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(3, 1fr);
  max-width: var(--max); margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgb(10 30 24 / 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid rgb(255 255 255 / 0.08);
}
.tab {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 4px;
  border: 0; border-radius: 12px;
  background: none;
  color: var(--text-soft);
  font-size: 0.75rem; font-weight: 600;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.is-active { color: var(--gold); }
.tab__dot {
  position: absolute; top: 4px; left: calc(50% + 10px);
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--berry);
  box-shadow: 0 0 0 2px var(--night);
}

/* ---- Calendar grid -------------------------------------------------------- */

.grid {
  --gap: 10px;
  --cell: calc((min(100vw, var(--max)) - 32px - 3 * var(--gap)) / 4);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: var(--cell);
  grid-auto-flow: dense;
  gap: var(--gap);
}

.door {
  position: relative;
  padding: 0; border: 0;
  border-radius: 14px;
  perspective: 700px;
  background: radial-gradient(circle at 50% 40%, #fff7e0, var(--cream));
  color: var(--ink);
  box-shadow: inset 0 2px 10px rgb(0 0 0 / 0.25);
}
.door--wide { grid-column: span 2; }
.door--big { grid-column: span 2; grid-row: span 2; }

.door__panel {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  border-radius: inherit;
  transform-origin: left center;
  transition: transform 0.65s cubic-bezier(0.3, 0.7, 0.3, 1);
  backface-visibility: hidden;
  box-shadow: 0 4px 12px rgb(0 0 0 / 0.35), inset 0 1px 0 rgb(255 255 255 / 0.2);
}
/* Stitched border, like fabric */
.door__panel::before {
  content: '';
  position: absolute; inset: 5px;
  border: 1.5px dashed rgb(255 255 255 / 0.35);
  border-radius: 10px;
}
.tone-0 .door__panel { background: linear-gradient(145deg, #c83c44, var(--berry-dark)); color: var(--cream); }
.tone-1 .door__panel { background: linear-gradient(145deg, var(--pine-light), #164634); color: var(--cream); }
.tone-2 .door__panel { background: linear-gradient(145deg, #f8edd5, #e6d3ad); color: var(--berry-dark); }
.tone-2 .door__panel::before { border-color: rgb(140 31 40 / 0.35); }
.tone-3 .door__panel { background: linear-gradient(145deg, #e9c06b, var(--gold-dark)); color: var(--ink); }
.tone-3 .door__panel::before { border-color: rgb(43 29 21 / 0.3); }

.door__num {
  font-family: var(--display); font-weight: 700;
  font-size: calc(var(--cell) * 0.42);
  line-height: 1;
  text-shadow: 0 2px 0 rgb(0 0 0 / 0.15);
}
.door--big .door__num { font-size: calc(var(--cell) * 0.8); }
.door__lock {
  position: absolute; right: 8px; bottom: 6px;
  font-size: 0.7rem; opacity: 0.75;
}

.door--locked .door__panel { filter: saturate(0.5) brightness(0.72); }
.door--new .door__panel { animation: glow 2.2s ease-in-out infinite; }
@keyframes glow {
  50% { box-shadow: 0 0 0 3px var(--gold), 0 0 26px rgb(227 180 88 / 0.7); }
}
.door--open .door__panel { transform: rotateY(-32deg); }
.door--opening .door__panel { transform: rotateY(-105deg); animation: none; }
.door--done .door__panel { display: none; }

.door__inside {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
}
.door__inside-num {
  position: absolute; top: 6px; left: 9px;
  font-family: var(--display); font-weight: 700; font-size: 0.8rem;
  color: var(--ink-soft);
}
.door__icon { font-size: calc(var(--cell) * 0.32); line-height: 1; }
.door__points { font-weight: 800; font-size: 0.8rem; color: var(--success); }
.door__points.is-negative { color: var(--danger); }
.door--big .door__icon { font-size: calc(var(--cell) * 0.6); }

.shake { animation: shake 0.45s ease; }
@keyframes shake {
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* ---- 3D mode (scene3d.js): the canvas replaces the grid ------------------------- */

.scene3d {
  position: fixed; inset: 0; z-index: 0;
  opacity: 0;
  transition: filter 0.5s ease, transform 0.5s ease, opacity 1.4s ease;
}
/* Set by scene3d.js after the first real frame: the scene fades in while the camera glides. */
.scene3d.is-ready { opacity: 1; }
/* touch-action: none = the browser doesn't scroll or zoom the page: drags and pinches go to the 3D. */
.scene3d canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
.scene3d.is-dimmed { filter: blur(8px) brightness(0.45) saturate(0.8); transform: scale(1.04); }
body:not(.has-3d) .scene3d { display: none; }

.has-3d .snow { display: none; }
.has-3d { background: #081a2c; }

/* The page lets clicks through to the canvas, except on real interface elements. */
.has-3d .app { pointer-events: none; }
.has-3d .topbar, .has-3d .tabs, .has-3d .view:not(#view-calendar) { pointer-events: auto; }
.has-3d .topbar {
  background: none;
  text-shadow: 0 2px 12px rgb(0 0 0 / 0.6);
}
/* Full-width shade behind the top bar (the bar itself is limited to --max wide). */
.has-3d::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; z-index: 1;
  height: calc(110px + env(safe-area-inset-top));
  background: linear-gradient(rgb(3 9 18 / 0.75) 35%, rgb(3 9 18 / 0));
  pointer-events: none;
}
/* Full-bleed trick: a huge shadow extends the bar's colour, clip-path keeps it on one line. */
.has-3d .tabs {
  background: rgb(6 16 28 / 0.85);
  box-shadow: 0 0 0 100vmax rgb(6 16 28 / 0.85);
  clip-path: inset(0 -100vmax);
}

/* The DOM grid stays for keyboard and screen reader users, but is visually hidden. */
.has-3d .grid {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.has-3d .hint {
  position: fixed; left: 0; right: 0; z-index: 2;
  bottom: calc(76px + env(safe-area-inset-bottom));
  margin: 0;
  font-size: 0.78rem;
  color: rgb(255 255 255 / 0.6);
  text-shadow: 0 1px 6px rgb(0 0 0 / 0.8);
  pointer-events: none;
}

/* Button shown when the camera has been turned away from the facade */
.recenter {
  position: fixed; left: 50%; z-index: 3;
  bottom: calc(100px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px;
  border: 1px solid rgb(255 255 255 / 0.2); border-radius: 999px;
  background: rgb(6 16 28 / 0.75);
  backdrop-filter: blur(8px);
  color: var(--text);
  font-weight: 700; font-size: 0.9rem;
  pointer-events: auto;
  box-shadow: var(--shadow);
  animation: pop 0.35s cubic-bezier(0.3, 1.6, 0.5, 1);
}

/* ---- Buttons & fields ------------------------------------------------------ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 0; border-radius: 999px;
  font-weight: 800; font-size: 1rem;
  transition: transform 0.15s ease, filter 0.15s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; }
.btn--gold { background: linear-gradient(135deg, #f0c66f, var(--gold-dark)); color: var(--ink); box-shadow: 0 4px 14px rgb(176 131 43 / 0.4); }
.btn--red { background: linear-gradient(135deg, #cf4049, var(--berry-dark)); color: var(--paper); box-shadow: 0 4px 14px rgb(140 31 40 / 0.4); }
.btn--green { background: linear-gradient(135deg, var(--pine-light), var(--pine)); color: var(--paper); }
.btn--ghost { background: transparent; color: inherit; box-shadow: inset 0 0 0 2px currentColor; }
.btn--block { width: 100%; }
.btn--big { min-height: 56px; font-size: 1.1rem; padding: 14px 28px; }

.field { display: grid; gap: 6px; font-weight: 600; font-size: 0.9rem; }
.field input, .input {
  width: 100%;
  min-height: 50px;
  padding: 12px 16px;
  border: 2px solid rgb(43 29 21 / 0.15); border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit; font-size: 1.05rem; /* ≥16px avoids zoom on iOS */
}
.field input:focus, .input:focus { outline: none; border-color: var(--gold-dark); }
.form-error { min-height: 1.2em; margin: 8px 0 0; color: #ffb4b4; font-weight: 600; text-align: center; }

/* ---- Login ------------------------------------------------------------------ */

.login {
  position: relative; z-index: 1;
  min-height: 100dvh;
  display: grid; place-items: center;
  padding: 24px 16px;
}
.login__card {
  width: 100%; max-width: 380px;
  display: grid; gap: 16px;
  padding: 28px 22px;
  border-radius: 24px;
  background: rgb(18 54 41 / 0.85);
  box-shadow: var(--shadow);
  text-align: center;
}
.login__card .field { text-align: left; }
.login__emoji { font-size: 3rem; }
.login__title { margin: 0; font-family: var(--display); font-weight: 500; font-style: italic; font-size: 1.6rem; }

/* ---- Modal sheet (bottom sheet on mobile) ------------------------------------- */

.modal {
  width: 100%; max-width: var(--max);
  max-height: 94dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
.modal::backdrop { background: rgb(4 14 11 / 0.7); backdrop-filter: blur(3px); }
.modal[open] .sheet { animation: sheet-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }

@media (min-width: 600px) {
  .modal { margin: auto; }
  .sheet { border-radius: 24px !important; }
}

.sheet {
  position: relative;
  max-height: 94dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 26px 20px calc(28px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background:
    radial-gradient(circle at 100% 0%, rgb(227 180 88 / 0.18), transparent 40%),
    var(--paper);
}
.sheet--center { text-align: center; }
.sheet__close {
  position: absolute; top: 12px; right: 12px;
  width: 40px; height: 40px;
  border: 0; border-radius: 50%;
  background: rgb(43 29 21 / 0.08);
  font-size: 1rem;
}

.day__eyebrow {
  margin: 0 48px 4px 0;
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--berry);
}
.day__title {
  margin: 0 48px 16px 0;
  font-family: var(--display); font-weight: 700;
  font-size: 1.7rem; line-height: 1.15;
}

.note {
  position: relative;
  margin: 0 0 22px;
  padding: 16px 18px 14px;
  border-radius: 4px 16px 16px 16px;
  background: #fff;
  box-shadow: 0 3px 14px rgb(43 29 21 / 0.1);
  font-family: var(--display); font-style: italic; font-size: 1.05rem; line-height: 1.5;
  white-space: pre-line;
}
.note cite { display: block; margin-top: 6px; text-align: right; font-size: 0.9rem; color: var(--ink-soft); }
.note p { margin: 0; }

/* ---- Games: shared --------------------------------------------------------------- */

.game { display: grid; gap: 16px; justify-items: center; text-align: center; }
.game__lead { margin: 0; color: var(--ink-soft); font-weight: 600; }
.game__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; width: 100%; }
.game__actions .btn { flex: 1 1 140px; }

.result {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius);
  background: rgb(46 125 79 / 0.1);
  color: var(--success);
  font-weight: 800; font-size: 1.15rem;
}
.result small { display: block; margin-top: 4px; font-weight: 600; font-size: 0.9rem; color: var(--ink-soft); }
.result--neutral { background: rgb(43 29 21 / 0.06); color: var(--ink); }
.result--bad { background: rgb(184 50 58 / 0.1); color: var(--danger); }

.big-emoji { font-size: 4.5rem; line-height: 1; }
.pop { animation: pop 0.6s cubic-bezier(0.3, 1.6, 0.5, 1); }
@keyframes pop { from { transform: scale(0.3); opacity: 0; } }
.wiggle { animation: wiggle 1.4s ease-in-out infinite; }
@keyframes wiggle {
  0%, 60%, 100% { transform: rotate(0); }
  70% { transform: rotate(-8deg); }
  80% { transform: rotate(8deg); }
  90% { transform: rotate(-4deg); }
}

/* ---- Quiz -------------------------------------------------------------------------- */

.quiz { display: grid; gap: 14px; width: 100%; text-align: left; }
.question {
  padding: 16px;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 2px 10px rgb(43 29 21 / 0.08);
}
.question__text { margin: 0 0 12px; font-weight: 800; line-height: 1.35; }
.question__num { color: var(--berry); }
.choices { display: grid; gap: 8px; }
.choice {
  min-height: 48px;
  padding: 10px 14px;
  border: 2px solid rgb(43 29 21 / 0.12); border-radius: 12px;
  background: var(--paper);
  text-align: left; font-weight: 600;
  transition: border-color 0.2s, background 0.2s;
}
.choice:hover:not(:disabled) { border-color: var(--gold-dark); }
.choice.is-correct { border-color: var(--success); background: rgb(46 125 79 / 0.12); }
.choice.is-wrong { border-color: var(--danger); background: rgb(184 50 58 / 0.1); }
.choice:disabled { cursor: default; opacity: 1; }
.choice:disabled:not(.is-correct):not(.is-wrong) { opacity: 0.55; }

/* ---- Riddle --------------------------------------------------------------------------- */

.riddle__question {
  margin: 0;
  font-family: var(--display); font-size: 1.25rem; line-height: 1.45;
}
.riddle__form { display: grid; gap: 10px; width: 100%; }
.attempts { display: flex; gap: 6px; justify-content: center; }
.attempts span { width: 12px; height: 12px; border-radius: 50%; background: var(--gold); }
.attempts span.is-used { background: rgb(43 29 21 / 0.15); }
.hint-box {
  width: 100%;
  padding: 12px 14px;
  border: 2px dashed var(--gold-dark); border-radius: 14px;
  background: rgb(227 180 88 / 0.12);
  text-align: left; font-weight: 600;
}
.guesses { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 0; padding: 0; list-style: none; }
.guesses li { padding: 4px 10px; border-radius: 999px; background: rgb(184 50 58 / 0.1); color: var(--danger); text-decoration: line-through; font-size: 0.9rem; }

/* ---- Wheel ------------------------------------------------------------------------------ */

.wheel-wrap { position: relative; width: min(78vw, 320px); aspect-ratio: 1; margin-top: 10px; }
.wheel {
  width: 100%; height: 100%;
  border-radius: 50%;
  box-shadow: 0 10px 30px rgb(43 29 21 / 0.35);
  will-change: transform;
}
.wheel__label { font-family: var(--body); font-weight: 800; font-size: 13px; }
.wheel__pointer {
  position: absolute; top: -14px; left: 50%; z-index: 2;
  width: 0; height: 0;
  transform: translateX(-50%);
  border-left: 15px solid transparent;
  border-right: 15px solid transparent;
  border-top: 30px solid var(--berry);
  filter: drop-shadow(0 3px 2px rgb(0 0 0 / 0.3));
}
.wheel__hub {
  position: absolute; inset: 50% auto auto 50%;
  width: 18%; aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffe7a8, var(--gold-dark));
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.35);
  font-size: 1.2rem;
}

/* ---- Dice -------------------------------------------------------------------------------- */

.dice-scene { width: 120px; height: 120px; margin: 24px 0 12px; perspective: 700px; }
.dice-tilt { width: 100%; height: 100%; transform-style: preserve-3d; transform: rotateX(-14deg) rotateY(18deg); }
.dice-scene.is-idle .dice-tilt { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: rotateX(-14deg) rotateY(18deg) translateY(-8px); } }
.dice {
  position: relative;
  width: 100%; height: 100%;
  transform-style: preserve-3d;
  transform: rotateX(-20deg) rotateY(-30deg);
}
.dice__face {
  position: absolute; inset: 0;
  display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  padding: 16px;
  border-radius: 20px;
  background: radial-gradient(circle at 30% 25%, #fff, #efe3cb);
  box-shadow: inset 0 0 0 2px rgb(43 29 21 / 0.08), inset 0 -6px 14px rgb(43 29 21 / 0.12);
}
.dice__face--1 { transform: translateZ(60px); }
.dice__face--6 { transform: rotateY(180deg) translateZ(60px); }
.dice__face--3 { transform: rotateY(90deg) translateZ(60px); }
.dice__face--4 { transform: rotateY(-90deg) translateZ(60px); }
.dice__face--2 { transform: rotateX(90deg) translateZ(60px); }
.dice__face--5 { transform: rotateX(-90deg) translateZ(60px); }
.pip { width: 20px; height: 20px; place-self: center; border-radius: 50%; background: var(--berry-dark); box-shadow: inset 0 2px 3px rgb(0 0 0 / 0.4); }
.multiplier { font-family: var(--display); font-size: 1.2rem; font-weight: 700; color: var(--berry); }

/* ---- Coin ---------------------------------------------------------------------------------- */

.coin-scene { width: 130px; height: 130px; margin: 18px 0 8px; perspective: 800px; }
.coin-scene.is-tossing { animation: toss 2.2s cubic-bezier(0.3, 0.6, 0.4, 1); }
@keyframes toss {
  40% { transform: translateY(-110px) scale(1.1); }
  80% { transform: translateY(0); }
  88% { transform: translateY(-14px); }
}
.coin { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.coin__side {
  position: absolute; inset: 0;
  display: grid; place-content: center; gap: 2px;
  border-radius: 50%;
  backface-visibility: hidden;
  background: radial-gradient(circle at 35% 30%, #ffe9ad, #d9a441 55%, #9c7020);
  box-shadow: inset 0 0 0 6px rgb(255 255 255 / 0.25), inset 0 0 0 9px rgb(156 112 32 / 0.6), 0 8px 20px rgb(0 0 0 / 0.3);
  color: #5a3d0c;
  font-weight: 800; letter-spacing: 0.1em;
}
.coin__side span:first-child { font-size: 2.4rem; letter-spacing: 0; }
.coin__side--face { transform: rotateX(180deg); }

/* ---- Shop & gifts ----------------------------------------------------------------------------- */

.banner {
  display: flex; gap: 12px; align-items: center;
  padding: 14px 16px;
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.06);
  border: 1px solid rgb(255 255 255 / 0.1);
}
.banner--open { background: linear-gradient(135deg, rgb(227 180 88 / 0.22), rgb(227 180 88 / 0.08)); border-color: rgb(227 180 88 / 0.5); }
.banner__emoji { font-size: 1.8rem; }
.banner p { margin: 0; }
.banner strong { display: block; }
.banner small { color: var(--text-soft); }

.items { display: grid; gap: 12px; }
.item {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 14px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 4px 14px rgb(0 0 0 / 0.25);
}
.item__emoji {
  grid-row: span 2;
  display: grid; place-items: center;
  width: 56px; height: 56px;
  border-radius: 14px;
  background: var(--cream);
  font-size: 1.9rem;
}
.item__name { margin: 0; font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.item__desc { margin: 0; color: var(--ink-soft); font-size: 0.92rem; line-height: 1.4; }
.item__footer {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 10px;
}
.item__footer .btn { min-height: 42px; padding: 8px 18px; font-size: 0.95rem; }
.price { font-weight: 800; font-size: 1.1rem; color: var(--gold-dark); white-space: nowrap; }
.stock { font-size: 0.8rem; font-weight: 700; color: var(--berry); }
.item--mystery { background: linear-gradient(135deg, #2a1640, #4a1d36); color: var(--text); }
.item--mystery .item__desc { color: var(--text-soft); }
.item--mystery .item__emoji { background: rgb(255 255 255 / 0.1); }
.item--mystery .price { color: var(--gold); }
.item--soldout { opacity: 0.55; }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem; font-weight: 800;
  background: rgb(227 180 88 / 0.25); color: var(--gold-dark);
}
.badge--done { background: rgb(46 125 79 / 0.14); color: var(--success); }
.item__date { font-size: 0.8rem; color: var(--ink-soft); }

.empty { padding: 30px 16px; text-align: center; color: var(--text-soft); }
.empty__emoji { font-size: 2.6rem; display: block; margin-bottom: 8px; }

.reveal__box { font-size: 5rem; line-height: 1; margin: 10px 0; }
.reveal__title { margin: 6px 0; font-family: var(--display); font-size: 1.6rem; }
.reveal__text { margin: 0 0 18px; color: var(--ink-soft); line-height: 1.45; }
.sheet .game__actions { margin-top: 8px; }

/* ---- Toast ------------------------------------------------------------------------------------- */

.toast {
  position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); z-index: 200;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 14px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 700;
  box-shadow: var(--shadow);
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ---- Reduced motion: no movement, results shown immediately --------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .snow { display: none; }
}
