/* Mini-games that are games, not quizzes (docs/art/STYLE_GUIDE.md, roadmap 1.4).
   Mia's Month: bill cards, three jars, a Safety jar meter, a month that plays out. */

.month-game,
.month-result {
  display: grid;
  gap: var(--space-4);
  padding: var(--space-4);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 var(--kit-depth, 4px) 0 var(--outline);
  color: var(--ink);
}

.month-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-3);
}
.month-pot,
.month-jar {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 2px;
  padding: var(--space-3);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--raised);
}
.month-pot span,
.month-jar span {
  position: relative;
  z-index: 1;
  color: var(--muted);
  font: 600 13px/1.2 var(--font-ui);
}
.month-num {
  position: relative;
  z-index: 1;
  font: 700 24px/1.1 var(--font-ui); font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.month-jar { border-color: var(--outline); padding-bottom: 18px; }
.month-jar .month-num { color: var(--win-ink); }
/* A meter under the number (readable at any level), not a fill behind it. */
.month-jar-fill {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--win) var(--fill, 100%), var(--bg) var(--fill, 100%));
  transition: background 320ms ease-out;
}
.month-jar.is-empty .month-num { color: var(--coral); }
.month-jar.is-empty .month-jar-fill { background: var(--action); }

.month-rules,
.month-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}
.month-run { width: 100%; }

@keyframes month-week-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes month-slam { from { opacity: 0; transform: scale(1.25) rotate(2deg); } to { opacity: 1; transform: none; } }

.month-result { text-align: center; justify-items: center; }
.month-result h2 { margin: 0; font-family: var(--font-display); font-weight: 800; letter-spacing: var(--tracking-head); font-size: 28px; }
.month-stars { display: flex; gap: var(--space-2); }
/* Stars (Deep Blue item 9): the Lucide outline star; earned ones are filled gold (gold is for rewards). */
.month-star { opacity: 1; color: var(--text-3); }
.month-star.is-on { opacity: 1; animation: month-star-pop 420ms cubic-bezier(.2, 1.5, .4, 1) both; }
.month-star.is-on { color: var(--gold); }
.month-star.is-on svg { fill: var(--gold); filter: drop-shadow(0 0 6px var(--gold-bg)); }
/* One confetti burst over the end screen (month.js plays it once; none under reduced motion). */
.month-result { position: relative; }
.month-result .lottie-slot.month-confetti { position: absolute; z-index: 2; top: -110px; left: 50%; width: min(520px, 100%); height: auto; margin: 0; aspect-ratio: 850 / 894; transform: translateX(-50%); pointer-events: none; }

/* While the month plays on the belt, the rules and the run button make way. */
.month-game.is-running .month-rules,
.month-game.is-running .month-note,
.month-game.is-running .month-run { display: none; }

.month-star.is-on:nth-child(2) { animation-delay: 160ms; }
.month-star.is-on:nth-child(3) { animation-delay: 320ms; }
@keyframes month-star-pop { from { transform: scale(0) rotate(-30deg); } to { transform: none; } }
.month-outcome { margin: 0; font-size: 16px; line-height: 1.45; }
.month-debt { margin: 0; color: var(--coral); font-weight: 600; }  /* a cost */
.month-why { margin: 0; color: var(--muted); }
.month-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); width: 100%; }

/* Buzz Off (Impulse): a 3D stage, the bee's line, two big sort buttons. */
.buzz-game {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 var(--kit-depth, 4px) 0 var(--outline);
  color: var(--ink);
}
.buzz-hud {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
  font: 600 13px/1.2 var(--font-ui);
  color: var(--muted);
}
.buzz-spend b { font: 700 16px/1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--ink); }
.buzz-dots { display: flex; gap: 6px; }
.buzz-dot {
  width: 12px;
  height: 12px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-pill);
  background: var(--raised);
}
.buzz-dot.is-now { background: var(--info); }
.buzz-dot.is-right { background: var(--win); }
.buzz-dot.is-miss { background: var(--action); }
.buzz-world {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 70%, var(--info)) 100%);
  touch-action: pan-y;
  cursor: grab;
}
.buzz-world canvas { position: absolute; inset: 0; }
.buzz-world.is-flat { display: grid; place-items: center; cursor: default; }
.buzz-flat { width: 40%; height: auto; pointer-events: none; user-select: none; }
.buzz-zone {
  position: absolute;
  bottom: 8px;
  z-index: 1;
  padding: 4px 10px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-pill);
  font: 700 12px/1.2 var(--font-ui);
  color: var(--on-color);
  pointer-events: none;
}
.buzz-zone-pause { left: 8px; background: var(--info); }
.buzz-zone-plan { right: 8px; background: var(--win); }
.buzz-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  min-height: 64px;
  padding: var(--space-3);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--raised);
}
.buzz-text { margin: 0; font: 600 16px/1.35 var(--font-ui); }
.buzz-amount { font: 700 18px/1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--coin-ink); white-space: nowrap; }
.buzz-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.buzz-btn { min-height: 52px; font-weight: 700; }
.buzz-game .buzz-actions .btn-game.buzz-btn-pause:not(:disabled) { background: var(--info); color: var(--on-color); box-shadow: 0 4px 0 var(--outline); }
.buzz-game .buzz-actions .btn-game.buzz-btn-plan:not(:disabled) { background: var(--win); color: var(--on-color); box-shadow: 0 4px 0 var(--outline); }
.buzz-btn:disabled { opacity: 0.45; cursor: default; }
.buzz-feedback {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 2px solid var(--line);
  font-size: 14px;
  line-height: 1.45;
}
.buzz-feedback[data-effect="slipped"] { border-color: var(--action); }
.buzz-feedback[data-effect="caught"],
.buzz-feedback[data-effect="kept"] { border-color: var(--win); }

/* Cool-down Shelf: a week of wants, a hot new card, cooled tickets on a shelf. */
.cool-game {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-lg);
  background: var(--panel);
  box-shadow: 0 var(--kit-depth, 4px) 0 var(--outline);
  color: var(--ink);
}
.cool-days {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cool-day {
  padding: 6px 0;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--raised);
  color: var(--muted);
  text-align: center;
  font: 700 12px/1 var(--font-ui);
}
.cool-day.is-past { opacity: 0.55; }
.cool-day.is-now { border-color: var(--outline); background: var(--info); color: var(--on-color); }
.cool-day.is-pop { animation: cool-pop 360ms cubic-bezier(.2, 1.5, .4, 1); }
.cool-budget {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  padding: 10px 12px 18px;
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-md);
  background: var(--raised);
  font: 600 13px/1.2 var(--font-ui);
  color: var(--muted);
}
.cool-budget b { font: 700 20px/1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--win-ink); }
.cool-budget-fill {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 6px;
  height: 6px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--win) var(--fill, 100%), var(--bg) var(--fill, 100%));
}
.cool-card {
  display: grid;
  justify-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-3);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-lg);
  text-align: center;
  box-shadow: 0 var(--kit-depth, 4px) 0 var(--outline);
}
.cool-card.is-new { background: linear-gradient(160deg, color-mix(in srgb, var(--action) 35%, var(--raised)), var(--raised)); }
.cool-card.is-keep { background: linear-gradient(160deg, color-mix(in srgb, var(--coin) 30%, var(--raised)), var(--raised)); }
.cool-card.is-fade { background: linear-gradient(160deg, color-mix(in srgb, var(--info) 25%, var(--raised)), var(--raised)); }
.cool-card.is-in { animation: month-week-in 260ms ease-out; }
.cool-card.is-flip { animation: cool-flip 420ms ease-out; }
.cool-card.is-out-shelve { animation: cool-out-down 320ms ease-in forwards; }
.cool-card.is-out-buy_now,
.cool-card.is-out-buy { animation: cool-out-right 320ms ease-in forwards; }
.cool-card.is-out-let_go { animation: cool-out-left 320ms ease-in forwards; }
.cool-kicker { margin: 0; color: var(--muted); font: 600 12px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; }
.cool-emote { width: 44px; height: 44px; image-rendering: auto; }
.cool-title { margin: 0; font: 700 18px/1.3 var(--font-ui); }
.cool-title span { display: block; font: 700 22px/1.2 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--coin-ink); }
.cool-line { margin: 0; font-size: 15px; line-height: 1.4; }
.cool-urge {
  width: 100%;
  max-width: 260px;
  height: 10px;
  border: 2px solid var(--outline);
  border-radius: var(--radius-pill);
  background: var(--bg);
  overflow: hidden;
}
.cool-urge i { display: block; width: 92%; height: 100%; background: linear-gradient(90deg, var(--coin), var(--action)); }
.cool-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); width: 100%; }
.cool-btn { min-height: 52px; font-weight: 700; }
.cool-game .cool-actions .btn-game.cool-btn-shelf:not(:disabled) { background: var(--info); color: var(--on-color); }
.cool-game .cool-actions .btn-game.cool-btn-buy:not(:disabled) { background: var(--win); color: var(--on-color); }
.cool-game .cool-actions .btn-game.cool-btn-now:not(:disabled),
.cool-game .cool-actions .btn-game.cool-btn-let:not(:disabled) { background: var(--raised); color: var(--ink); box-shadow: 0 4px 0 var(--outline); }
.cool-btn:disabled { opacity: 0.45; cursor: default; }
.cool-shelf-wrap h4,
.cool-bags h4 { margin: 0 0 6px; color: var(--muted); font: 700 12px/1.2 var(--font-ui); text-transform: uppercase; letter-spacing: .04em; }
.cool-shelf {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-height: 64px;
  margin: 0;
  padding: var(--space-2);
  border-bottom: 6px solid var(--coin-dark);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  background: color-mix(in srgb, var(--info) 12%, var(--bg));
  list-style: none;
}
.cool-shelf:empty::after { content: 'Empty. Shelved wants wait here for one day.'; align-self: center; color: var(--muted); font-size: 13px; }
.cool-ticket {
  display: grid;
  gap: 2px;
  min-width: 120px;
  padding: 8px 10px;
  border: 2px dashed var(--info);
  border-radius: var(--radius-sm);
  background: var(--raised);
  animation: month-week-in 260ms ease-out;
}
.cool-ticket-label { font: 700 13px/1.2 var(--font-ui); }
.cool-ticket-amount { font: 700 13px/1 var(--font-ui); font-variant-numeric: tabular-nums; color: var(--coin-ink); }
.cool-ticket-temp { height: 6px; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--info), var(--action)); animation: cool-cooling 2.4s ease-in-out infinite alternate; }
.cool-ticket-note { color: var(--muted); font-size: 11px; }
.cool-bags { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-3); }
.cool-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; min-height: 24px; }
.cool-chip { padding: 6px 8px; border-radius: var(--radius-sm); background: var(--raised); font-size: 13px; }
.cool-chip b { font-family: var(--font-ui); font-variant-numeric: tabular-nums; }
.cool-chip-bought { border-left: 4px solid var(--win); }
.cool-chip-let { border-left: 4px solid var(--line); color: var(--muted); }
.cool-review { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; text-align: left; width: 100%; }
.cool-review li { display: flex; align-items: center; gap: var(--space-2); font-size: 14px; }
.cool-review .cool-emote { width: 28px; height: 28px; }
.cool-habit { width: 100%; min-height: 48px; }
.month-result.cool-result .btn-game.cool-habit[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--win); color: var(--win-ink); }
.cool-habit-note { margin: 0; color: var(--win-ink); font-size: 13px; }
@keyframes cool-pop { from { transform: scale(1.3); } to { transform: none; } }
@keyframes cool-flip { from { transform: rotateY(90deg); } to { transform: none; } }
@keyframes cool-out-down { to { transform: translateY(60px) scale(0.6); opacity: 0; } }
@keyframes cool-out-right { to { transform: translateX(80px) rotate(6deg); opacity: 0; } }
@keyframes cool-out-left { to { transform: translateX(-80px) rotate(-6deg); opacity: 0; } }
@keyframes cool-cooling { from { filter: saturate(1.4); } to { filter: saturate(0.6) hue-rotate(-20deg); } }

@media (prefers-reduced-motion: reduce) {
  .cool-day.is-pop,
  .cool-card.is-in,
  .cool-card.is-flip,
  .cool-ticket,
  .cool-ticket-temp { animation: none; }
}

/* Boss fight arena (3D). boss.js falls back to its 2D banner when this stays hidden. */
.boss-arena {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  margin-bottom: var(--space-3);
  border: var(--kit-border, 3px) solid var(--outline);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--bg) 0%, color-mix(in srgb, var(--bg) 65%, var(--action)) 100%);
  box-shadow: 0 var(--kit-depth, 4px) 0 var(--outline);
}
.boss-arena canvas { position: absolute; inset: 0; }

@media (min-width: 1024px) {
  .buzz-world { aspect-ratio: 16 / 9; }
  .boss-arena { aspect-ratio: 16 / 8; }
}

@media (prefers-reduced-motion: reduce) {
  .month-jar-fill { transition: none; }
  .month-star.is-on { animation: none; }

}

/* Mode switch (roadmap 1.6): the normal game plus the variant a level unlocks. */
.mode-bar {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: var(--space-2);
}
.mode-pill {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 6px 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--raised);
  color: var(--ink);
  font: 700 13px/1.2 var(--font-ui);
  cursor: pointer;
}
.mode-pill small { color: var(--muted); font: 600 11px/1 var(--font-ui); }
.mode-pill[aria-pressed="true"] { border-color: var(--outline); background: var(--info); color: var(--on-color); }
.mode-pill[aria-pressed="true"] small { color: var(--on-color); }
.mode-pill.is-variant:not([aria-pressed="true"]) { border-color: var(--coin); }
.mode-pill.is-locked { opacity: 0.6; cursor: not-allowed; border-style: dashed; }
.mode-pill:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.mode-line { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }

/* Payday Rush conveyor (docs/redesign/CANVAS.md 5.1): the bills ride a PixiJS belt across Mia's month. */
.payday-day { margin: 4px 0 0; color: var(--muted); font-weight: 700; }
.payday-day b { color: var(--ink); font-variant-numeric: tabular-nums; }
.payday-belt {
  position: relative;
  min-height: 392px; /* R3-9: taller bill cards */
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--r-card);
  background: var(--card);
}
.payday-canvas { display: block; width: 100%; height: auto; touch-action: none; }
/* Without a canvas (no WebGL) the region stays for the keys and the status lines. */
.month-game.no-belt .payday-belt { min-height: 48px; }
.payday-belt:focus { outline: none; }
.payday-belt:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }

/* Keyboard play and toggles (CANVAS 5.6). */
.payday-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.payday-bar .payday-day { margin: 0; }
.payday-toggles { display: flex; gap: 6px; }
.payday-toggle {
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--edge);
  border-radius: var(--r-pill);
  background: var(--card);
  color: var(--muted);
  font: 800 14px/1 var(--font-ui);
  cursor: pointer;
}
.payday-toggle[aria-pressed="true"] { border-color: var(--sea); background: var(--sky); color: var(--ink); }
.payday-toggle:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.payday-keys { margin: 0; color: var(--muted); font-size: 13px; }
.payday-keys kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: 1px 5px;
  border: 1px solid var(--edge);
  border-bottom-width: 2px;
  border-radius: 5px;
  background: var(--card);
  color: var(--ink);
  font: 800 12px/1.3 var(--font-ui);
  text-align: center;
}
.payday-pick { min-height: 1.4em; margin: 0; color: var(--ink); font-weight: 700; }
.payday-pick:empty { min-height: 0; }
.payday-reason { min-height: 1.4em; margin: 0; color: var(--coral); font-weight: 700; }
.payday-reason:empty { min-height: 0; }
.payday-reason.is-good { color: var(--leaf); }
.payday-combo { margin-left: 0.3em; color: var(--leaf); font-weight: 800; display: inline-block; }
.payday-combo[hidden] { display: none; }
.payday-combo.is-pop { animation: payday-combo-pop 320ms ease-out; }
@keyframes payday-combo-pop { 0% { transform: scale(1.35); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) { .payday-combo.is-pop { animation: none; } }

/* Payday Rush end screen (docs/redesign/CANVAS.md 5.5): calendar, what went where, one lesson. */
.month-end { gap: var(--space-3); }
.month-combo { margin: 0; color: var(--leaf); font-weight: 800; }
.month-cal { width: 100%; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.cal-day {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 14px 2px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
}
.cal-num { position: absolute; top: 2px; left: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
.cal-icon {
  display: block;
  width: 20px;
  height: 20px;
  background: var(--ink);
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}
.cal-surprise { display: block; width: 20px; height: 20px; }
.cal-day.is-need, .cal-key.is-need { background: var(--blue-bg); border-color: var(--link); }      /* the jars' colours */
.cal-day.is-want, .cal-key.is-want { background: var(--coral-bg); border-color: var(--coral); }
.cal-day.is-skip, .cal-key.is-skip { background: var(--tag-bg); border-color: var(--lilac); }
.cal-day.is-surprise, .cal-key.is-surprise { border: 2px dashed var(--coral); }
.cal-day.is-zero { background: var(--coral-bg); box-shadow: inset 0 0 0 2px var(--coral); }
.cal-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.cal-key { display: inline-block; width: 14px; height: 14px; margin-right: 4px; border: 1px solid var(--line); border-radius: 4px; vertical-align: -2px; }
.month-where { display: grid; gap: 6px; width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.where-row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: baseline;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--paper-2);
}
.where-row span { color: var(--muted); font-size: 14px; }
.where-row em { color: var(--coral); font-style: normal; font-weight: 700; }
.where-row strong { font-variant-numeric: tabular-nums; }
.month-end .month-why { color: var(--ink); }
.month-own { width: 100%; }


/* Round 3, R3-4: Mia's month as a game screen. A centred play area of at most 480 px; Start and a 3-2-1
   over the belt (nothing moves before it); once playing, Finn's intro and the mode bar make way. */
.month-game { width: 100%; max-width: 480px; margin-inline: auto; }
.month-game.is-playing .finn-say,
.month-game.is-playing .mode-bar,
.month-game.is-playing .mode-line { display: none; }
.payday-frame { position: relative; }
.payday-start {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  border-radius: var(--r-card);
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  text-align: center;
}
.payday-start[hidden] { display: none; }
.payday-go { min-width: 160px; min-height: 56px; padding: 0 32px; font-size: 20px; }
.payday-start-line { max-width: 30ch; margin: 0; color: var(--ink); font-weight: 600; line-height: 1.4; }
.payday-start-line[hidden] { display: none; }
.payday-count { margin: 0; color: var(--ink); font: 800 72px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.payday-count:empty { display: none; }
.payday-count.is-pop { animation: payday-count-pop 600ms ease-out; }
@keyframes payday-count-pop { 0% { transform: scale(1.6); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1); } }
[data-belt-wave].is-flash { color: var(--ink); animation: payday-combo-pop 420ms ease-out; display: inline-block; }
@media (prefers-reduced-motion: reduce) {
  .payday-count.is-pop,
  [data-belt-wave].is-flash { animation: none; }
}
/* A phone: the stage and the game give their padding to the belt. */
@media (max-width: 520px) {
  .stage-play:has(.month-game) { padding: 8px; }
  .month-game { gap: 10px; padding: 10px; }
  .month-game .month-num { font-size: 20px; }
  .month-game .month-pot,
  .month-game .month-jar { padding: 8px 10px 16px; }
}

/* Round 3, R3-7: Debt Spiral. The R3-4 game screen (a centred 480 px column, Start, the intro makes way), the
   swamp canvas, the debts, the extra-cash coins, the throttle and Pay; the results add a 12-month strip. */
.spiral-game {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 480px;
  margin-inline: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--ink);
}
.spiral-game.is-playing .finn-say,
.spiral-game.is-playing .mode-bar,
.spiral-game.is-playing .mode-line { display: none; }
.spiral-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; }
.spiral-when { margin: 0; color: var(--muted); font-weight: 700; }
.spiral-when b { color: var(--ink); font-variant-numeric: tabular-nums; }
.spiral-when b.is-flash { animation: payday-combo-pop 420ms ease-out; display: inline-block; }
.spiral-frame { position: relative; min-height: 300px; border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; background: var(--bg); }
.spiral-canvas { min-height: 300px; }
.spiral-pixi { display: block; width: 100%; height: auto; }
.spiral-game.no-canvas .spiral-frame,
.spiral-game.no-canvas .spiral-canvas { min-height: 48px; }
.spiral-debts { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.spiral-debt {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--raised, var(--panel));
}
.spiral-debt.is-aim { border-color: var(--link); }
.spiral-debt-name small { color: var(--muted); font-weight: 700; }
.spiral-debt b { font-size: 18px; }
.spiral-aim {
  min-height: 44px;
  padding: 0 12px;
  border: 1px dashed var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.spiral-aim[aria-checked="true"] { border-style: solid; border-color: var(--link); background: color-mix(in srgb, var(--link) 18%, transparent); }
.spiral-coins { display: flex; flex-wrap: wrap; gap: 8px; }
.spiral-coins-empty { margin: 0; color: var(--muted); font-size: 13px; }
.spiral-coin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 999px;
  background: var(--gold-bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.spiral-coin.is-taken { opacity: .55; text-decoration: line-through; cursor: default; }
.spiral-coin b { color: var(--gold); }
.spiral-throttle label { font-weight: 700; }
.spiral-throttle output { color: var(--link); font-size: 18px; }
.spiral-pay { width: 100%; min-height: 56px; justify-content: center; font-size: 18px; }
.spiral-pay:disabled { opacity: .45; cursor: not-allowed; }
.spiral-line { min-height: 1.4em; margin: 0; font-weight: 700; }
.spiral-keys { margin: 0; color: var(--muted); font-size: 12px; }
/* The results: 12 months, each a stack of what came off the card (mint) and what went to interest (coral). */
.spiral-months { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); align-items: end; gap: 4px; width: 100%; height: 110px; margin: 0; padding: 0; list-style: none; }
.spiral-m { position: relative; display: flex; flex-direction: column-reverse; height: 100%; padding-bottom: 16px; }
.spiral-m-off { background: var(--mint); border-radius: 3px 3px 0 0; }
.spiral-m-int { background: var(--coral); }
.spiral-m i { position: absolute; bottom: 0; left: 0; right: 0; font-style: normal; font-size: 10px; color: var(--muted); }
.spiral-compare { display: grid; gap: 6px; width: 100%; margin: 0; padding: 0; list-style: none; text-align: left; }
.spiral-compare li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 12px; background: var(--raised, var(--panel)); font-size: 14px; }
.spiral-compare li.is-you { border: 1px solid var(--link); }
@media (max-width: 520px) {
  .stage-play:has(.spiral-game) { padding: 8px; }
  .spiral-game { padding: 10px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .spiral-when b.is-flash { animation: none; }
}

/* Round 3, R3-8: You Draw It. A centred 480 px column; a real chart you draw on (an SVG data chart, not art); the
   R3-6 certainty chips; Show; the verdict. Your line is orange (a game action), the real line the link blue. */
.draw-game { display: grid; gap: 12px; width: 100%; max-width: 480px; margin-inline: auto; color: var(--ink); }
.draw-chart { display: grid; gap: 8px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); }
.draw-kicker { margin: 0; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.draw-ask { margin: 0; font-size: 19px; line-height: 1.3; }
.draw-what { margin: 0; color: var(--muted); font-size: 13px; }
.draw-frame { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.draw-svg { display: block; width: 100%; height: auto; aspect-ratio: 440 / 230; touch-action: none; cursor: crosshair; border-radius: 12px; }
.draw-svg:focus-visible { outline: 3px solid var(--link); outline-offset: 2px; }
.draw-grid { stroke: var(--line); stroke-width: 1; }
.draw-grid.is-zero { stroke: var(--muted); }
.draw-tick { fill: var(--muted); font-size: 10px; font-family: var(--font-ui); }
.draw-zone { fill: color-mix(in srgb, var(--play-from) 10%, transparent); stroke: color-mix(in srgb, var(--play-from) 45%, transparent); stroke-dasharray: 4 4; }
.draw-zone-label { fill: var(--play-from); font-size: 11px; font-weight: 700; font-family: var(--font-ui); }
.draw-svg.is-revealed .draw-zone-label { display: none; }
.draw-shown, .draw-real, .draw-mine { fill: none; stroke-linejoin: round; stroke-linecap: round; }
.draw-shown { stroke: var(--link); stroke-width: 2.5; }
.draw-real { stroke: var(--link); stroke-width: 3; }
.draw-real.is-drawing { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw-in 1200ms ease-out forwards; }
@keyframes draw-in { to { stroke-dashoffset: 0; } }
.draw-mine { stroke: var(--play-from); stroke-width: 3; stroke-dasharray: 6 4; }
.draw-cursor { fill: var(--play-from); }
.draw-dot.is-close { fill: var(--mint); }
.draw-dot.is-far { fill: var(--coral); }
.draw-status { min-height: 1.4em; margin: 0; font-weight: 700; }
.draw-show, .draw-next { width: 100%; min-height: 56px; justify-content: center; font-size: 18px; }
.draw-show:disabled { opacity: .45; cursor: not-allowed; }
.draw-verdict { display: grid; gap: 6px; justify-items: center; text-align: center; }
.draw-verdict[hidden] { display: none; }
.draw-gap, .draw-fact, .draw-lesson { margin: 0; }
.draw-fact { font-weight: 700; }
.draw-lesson { color: var(--muted); }
.draw-source { margin: 0; color: var(--muted); font-size: 12px; }
@media (max-width: 520px) {
  .stage-play:has(.draw-game) { padding: 8px; }
  .draw-chart { padding: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .draw-real.is-drawing { animation: none; stroke-dasharray: none; stroke-dashoffset: 0; }
}

/* Round 3, R3-9: the surprise bill's alarm. The belt's frame pulses coral three times (a static outline under
   reduced motion); the canvas adds a coral wash, the game a shake. */
.payday-belt.is-alarm { box-shadow: 0 0 0 3px var(--coral); animation: payday-alarm 300ms ease-in-out 3; }
@keyframes payday-alarm { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--coral) 55%, transparent); } }
@media (prefers-reduced-motion: reduce) { .payday-belt.is-alarm { animation: none; } }
