/* =========================================================================
   Gacha-gacha: a sticker-style capsule machine that dispenses love notes.
   Chunky ink outlines + hard offset shadows keep everything toy-like.
   ========================================================================= */
:root {
  --ink: #4a2b3a;
  --bg: #fdeefa;
  --cream: #fffaf2;
  --pink: #ff8fb1;
  --pink-d: #ff6f9c;
  --mint: #7fdcc4;
  --butter: #ffd45c;
  --lilac: #c7a8ff;
  --sky: #8fcaff;
  --peach: #ffb38a;
  --gold: #ffc93c;
  --line: 3px;
  --pop: 4px 4px 0 var(--ink);
  --w: min(290px, 74vw);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Fredoka', ui-rounded, system-ui, sans-serif;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(circle, rgba(255, 143, 177, 0.18) 2.5px, transparent 3px),
    radial-gradient(circle, rgba(127, 220, 196, 0.2) 2.5px, transparent 3px);
  background-size: 44px 44px;
  background-position: 0 0, 22px 22px;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

::selection { background: var(--butter); color: var(--ink); }

button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible { outline: 3px dashed var(--pink-d); outline-offset: 4px; }

.hidden, [hidden] { display: none !important; }

#bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
/* After the yes: hearts fly over the question card too. */
body.party #bg { z-index: 30; }

/* ---------------------------------------------------------------------
   Layout
   --------------------------------------------------------------------- */
.shop {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 22px 16px 28px;
  gap: 10px;
}

.banner { text-align: center; }
.banner-kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--pink-d);
}
.banner-title {
  margin: 2px 0 0;
  font-size: clamp(38px, 11vw, 60px);
  font-weight: 700;
  line-height: 1;
  color: var(--cream);
  -webkit-text-stroke: 2.5px var(--ink);
  paint-order: stroke fill;
  text-shadow: 3px 4px 0 var(--ink);
  letter-spacing: 0.02em;
}
.banner-title span {
  display: inline-block;
  margin: 0 0.08em;
  color: var(--pink-d);
  animation: beat 1.4s ease-in-out infinite;
}

@keyframes beat {
  0%, 100% { transform: scale(1); }
  15% { transform: scale(1.22); }
  30% { transform: scale(1); }
  45% { transform: scale(1.14); }
}

.stage {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 14px 0 40px;
}

.hint {
  margin: -20px 0 0;
  min-height: 1.4em;
  font-family: 'Gochi Hand', cursive;
  font-size: 22px;
  color: var(--pink-d);
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-4px) rotate(2deg); }
}

/* ---------------------------------------------------------------------
   The machine
   --------------------------------------------------------------------- */
.machine {
  position: relative;
  width: var(--w);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: idle 3.6s ease-in-out infinite;
  transform-origin: 50% 100%;
}
@keyframes idle {
  0%, 100% { transform: rotate(0) scaleY(1); }
  50% { transform: rotate(0) scaleY(0.985); }
}
.machine.shake { animation: shake 0.6s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-3deg) translateX(-3px); }
  40% { transform: rotate(3deg) translateX(3px); }
  60% { transform: rotate(-2deg); }
  80% { transform: rotate(2deg); }
}
.machine.jackpot { animation: hop 0.55s var(--bounce) 4; }
@keyframes hop {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(0) scale(1.06, 0.92); }
  60% { transform: translateY(-12px) scale(0.97, 1.03); }
}

.marquee {
  position: relative;
  z-index: 3;
  margin-bottom: -10px;
  padding: 6px 18px;
  min-width: 70%;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--butter);
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--pop);
  white-space: nowrap;
}
.marquee::before,
.marquee::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 8px;
  height: 8px;
  margin-top: -4px;
  border-radius: 50%;
  background: var(--pink-d);
  border: 2px solid var(--ink);
  animation: blink 0.9s steps(1) infinite;
}
.marquee::before { left: 8px; }
.marquee::after { right: 8px; animation-delay: 0.45s; }
@keyframes blink { 50% { background: var(--cream); } }

.globe {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: var(--line) solid var(--ink);
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0) 45%),
    radial-gradient(circle at 50% 60%, rgba(207, 236, 255, 0.75), rgba(190, 220, 255, 0.55));
  overflow: hidden;
  margin-bottom: -18%;
}
.glare {
  position: absolute;
  top: 11%;
  left: 16%;
  width: 18%;
  height: 30%;
  border-radius: 50%;
  border-left: 6px solid rgba(255, 255, 255, 0.95);
  transform: rotate(25deg);
  pointer-events: none;
}
.pile { position: absolute; inset: 0; }
/* Capsule: top half colored, bottom half clear-ish white, with a seam. */
.cap {
  --c: var(--pink);
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: var(--line) solid var(--ink);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.85) 0 12%, transparent 13%),
    linear-gradient(180deg, var(--c) 0 48%, var(--ink) 48% 52%, #fff 52%);
  transform: rotate(var(--r, 0deg));
  transition: transform 0.4s var(--bounce), opacity 0.3s;
}
.cap.gold {
  --c: var(--gold);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.95) 0 12%, transparent 13%),
    linear-gradient(180deg, var(--gold) 0 48%, var(--ink) 48% 52%, #fff3c4 52%);
  animation: twinkle 1.6s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(255, 201, 60, 0)); }
  50% { filter: drop-shadow(0 0 8px rgba(255, 201, 60, 0.95)); }
}
/* Pile capsules are placed every frame by js/globe.js. */
.pile .cap { width: 20%; transform: none; transition: opacity 0.3s, scale 0.3s; will-change: transform; }
.pile .cap.gone { opacity: 0; scale: 0.2; }

.body {
  position: relative;
  z-index: 1;
  width: 92%;
  padding: 24% 0 0;
  border: var(--line) solid var(--ink);
  border-radius: 28px 28px 20px 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0) 30%),
    var(--pink);
  box-shadow: var(--pop), inset 0 -10px 0 rgba(0, 0, 0, 0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Face */
.face {
  position: relative;
  width: 44%;
  height: 34px;
  margin-top: 4px;
}
.eye {
  position: absolute;
  top: 2px;
  width: 16px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 0.15s;
  animation: blinky 4.6s infinite;
}
.eye-l { left: 12%; }
.eye-r { right: 12%; }
.pupil {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
  transform: translate(var(--px, 0), var(--py, 0));
}
@keyframes blinky {
  0%, 94%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.1); }
}
.cheek {
  position: absolute;
  top: 18px;
  width: 16px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 90, 130, 0.55);
}
.cheek-l { left: -2%; }
.cheek-r { right: -2%; }
.mouth {
  position: absolute;
  left: 50%;
  top: 14px;
  width: 16px;
  height: 9px;
  margin-left: -8px;
  border: var(--line) solid var(--ink);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  transition: all 0.2s var(--bounce);
}

.face.squish .eye { animation: none; transform: scaleY(0.18); }
.face.squish .mouth { height: 4px; width: 10px; margin-left: -5px; border-radius: 0 0 6px 6px; }
.face.happy .mouth {
  width: 22px;
  height: 14px;
  margin-left: -11px;
  background: #ff5f86;
  border-top: var(--line) solid var(--ink);
  border-radius: 3px 3px 22px 22px;
}
.face.love .eye {
  animation: none;
  background: none;
  width: 22px;
  height: 22px;
  top: -2px;
  transform: none;
}
.face.love .eye::before {
  content: '\2665';
  position: absolute;
  inset: 0;
  font-size: 24px;
  line-height: 22px;
  text-align: center;
  color: #ff3d74;
  -webkit-text-stroke: 1.5px var(--ink);
  animation: beat 1s ease-in-out infinite;
}
.face.love .pupil { display: none; }

/* Coins + crank */
.controls {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 11% 0;
}
.coins {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 15px;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 12px;
}
.coin-icon {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--butter);
  border: 2px solid var(--ink);
  font-size: 12px;
  line-height: 1;
}
.coins.spend { animation: spend 0.4s var(--bounce); }
@keyframes spend { 50% { transform: scale(1.2) rotate(-6deg); } }

.knob {
  position: relative;
  width: 62px;
  height: 62px;
  padding: 0;
  border-radius: 50%;
  border: var(--line) solid var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff5c9, var(--butter) 55%);
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.15s, box-shadow 0.15s;
}
.knob:hover:not(:disabled) { transform: scale(1.06); }
.knob:active:not(:disabled) { box-shadow: 1px 1px 0 var(--ink); transform: translate(2px, 2px); }
.knob:disabled { cursor: default; filter: saturate(0.5); }
.knob-grip {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 46px;
  margin: -23px 0 0 -7px;
  border-radius: 8px;
  border: var(--line) solid var(--ink);
  background: var(--cream);
  transition: transform 0.9s var(--bounce);
  transform: rotate(var(--turn, 0deg));
}
.knob.ready::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 3px dashed var(--pink-d);
  animation: spin 6s linear infinite;
  pointer-events: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.chute {
  position: relative;
  width: 36%;
  height: 46px;
  margin: 14px 0 16px;
  border: var(--line) solid var(--ink);
  border-radius: 14px 14px 10px 10px;
  background: #5b3446;
  overflow: hidden;
}
.chute-flap {
  position: absolute;
  inset: 0 0 45% 0;
  background: repeating-linear-gradient(90deg, var(--cream) 0 8px, #f3e6ee 8px 16px);
  border-bottom: var(--line) solid var(--ink);
  transform-origin: 50% 0;
  transition: transform 0.25s;
}
.chute.open .chute-flap { transform: perspective(200px) rotateX(70deg); }

.feet {
  display: flex;
  justify-content: space-between;
  width: 76%;
  margin-top: -2px;
}
.feet span {
  width: 22%;
  height: 16px;
  border: var(--line) solid var(--ink);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: var(--mint);
}

/* The capsule that rolls out onto the floor */
.floor { position: absolute; inset: 0; pointer-events: none; }
.dropped {
  position: absolute;
  width: 58px;
  pointer-events: auto;
  cursor: pointer;
  padding: 0;
  border: 0;
  background: none;
  z-index: 4;
}
.dropped.wiggle { animation: wig 1.2s ease-in-out infinite; }
@keyframes wig {
  0%, 60%, 100% { rotate: 0deg; }
  70% { rotate: -14deg; }
  80% { rotate: 12deg; }
  90% { rotate: -6deg; }
}
.dropped .cap { position: relative; width: 100%; display: block; }
.dropped::after {
  content: 'tap!';
  position: absolute;
  left: 50%;
  top: -28px;
  translate: -50% 0;
  font-family: 'Gochi Hand', cursive;
  font-size: 20px;
  color: var(--pink-d);
  white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Collection tray
   --------------------------------------------------------------------- */
.tray {
  width: min(420px, 100%);
  padding: 12px 14px 14px;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 20px;
  box-shadow: var(--pop);
}
.tray-title {
  margin: 0 0 10px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tray-right { display: flex; align-items: center; gap: 8px; }
#tray-count { color: var(--pink-d); }
.tray-receipt {
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--butter);
  animation: plop 0.5s var(--bounce);
}
.tray-slots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.slot {
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2.5px dashed rgba(74, 43, 58, 0.3);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  color: rgba(74, 43, 58, 0.35);
}
.slot button {
  width: 100%;
  height: 100%;
  padding: 0;
  border-radius: 50%;
  border: var(--line) solid var(--ink);
  background: var(--c);
  font-weight: 700;
  font-size: 13px;
  animation: plop 0.5s var(--bounce);
  transition: transform 0.15s;
}
.slot button:hover { transform: scale(1.12) rotate(-6deg); }
.slot.gold-slot { border-color: rgba(255, 180, 0, 0.6); color: rgba(220, 150, 0, 0.8); }
@keyframes plop {
  from { transform: scale(0) rotate(-90deg); }
  to { transform: scale(1) rotate(0); }
}

/* ---------------------------------------------------------------------
   Modals
   --------------------------------------------------------------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.modal[hidden] { display: none; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(199, 168, 255, 0.45);
  backdrop-filter: blur(3px);
  animation: fade 0.25s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal.closing { animation: fade 0.25s ease-in reverse forwards; }

.pill {
  display: inline-block;
  padding: 10px 22px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--mint);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 700;
  font-size: 16px;
  transition: transform 0.12s, box-shadow 0.12s;
}
.pill:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.pill:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

/* Prize: capsule splits, sticker pops out */
.prize {
  position: relative;
  width: min(340px, 100%);
  display: grid;
  place-items: center;
}
.prize-capsule {
  --c: var(--pink);
  position: absolute;
  top: 50%;
  left: 50%;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  z-index: 2;
  pointer-events: none;
}
.half {
  position: absolute;
  left: 0;
  width: 100%;
  height: 50%;
  border: var(--line) solid var(--ink);
}
.half-top {
  top: 0;
  border-radius: 65px 65px 0 0;
  background:
    radial-gradient(circle at 30% 45%, rgba(255, 255, 255, 0.85) 0 14%, transparent 15%),
    var(--c);
}
.half-bottom {
  bottom: 0;
  border-radius: 0 0 65px 65px;
  background: #fff;
}
.modal.open .half-top { animation: lidOff 0.7s cubic-bezier(0.5, 0, 0.75, 0) 0.35s forwards; }
.modal.open .half-bottom { animation: baseOff 0.7s cubic-bezier(0.5, 0, 0.75, 0) 0.35s forwards; }
.modal.open .prize-capsule { animation: jiggle 0.35s ease-in-out; }
@keyframes jiggle {
  0%, 100% { transform: scale(1); }
  30% { transform: scale(1.12, 0.9); }
  60% { transform: scale(0.94, 1.08); }
}
@keyframes lidOff {
  to { transform: translate(-120px, -260px) rotate(-200deg); opacity: 0; }
}
@keyframes baseOff {
  to { transform: translate(120px, 260px) rotate(160deg); opacity: 0; }
}

.sticker {
  --c: var(--pink);
  position: relative;
  width: 100%;
  padding: 26px 22px 22px;
  text-align: center;
  background:
    radial-gradient(circle, rgba(255, 255, 255, 0.6) 2px, transparent 2.5px) 0 0 / 18px 18px,
    color-mix(in srgb, var(--c) 35%, var(--cream));
  border: var(--line) solid var(--ink);
  border-radius: 26px;
  box-shadow: 6px 6px 0 var(--ink);
  transform: scale(0) rotate(-12deg);
  opacity: 0;
}
.sticker::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 2.5px dashed rgba(74, 43, 58, 0.25);
  border-radius: 19px;
  pointer-events: none;
}
.modal.open .sticker { animation: stickerIn 0.6s var(--bounce) 0.7s forwards; }
@keyframes stickerIn {
  to { transform: scale(1) rotate(-2deg); opacity: 1; }
}
.sticker-num {
  display: inline-block;
  margin: 0;
  padding: 2px 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: var(--c);
  border: 2.5px solid var(--ink);
  border-radius: 999px;
}
.sticker-title {
  margin: 12px 0 8px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.1;
}
.sticker-text {
  margin: 0 0 18px;
  font-size: 16px;
  line-height: 1.5;
}
.sticker .pill { position: relative; background: var(--cream); }

/* Letter */
.letter {
  position: relative;
  width: min(600px, 100%);
  margin: auto;
  padding: 44px 30px 30px;
  font-family: 'Gochi Hand', cursive;
  font-size: 21px;
  line-height: 1.5;
  background:
    linear-gradient(90deg, transparent 38px, rgba(255, 111, 156, 0.35) 38px 40px, transparent 40px),
    repeating-linear-gradient(180deg, var(--cream) 0 31px, #e4d9f5 31px 32px);
  background-position: 0 0, 0 12px;
  border: var(--line) solid var(--ink);
  border-radius: 18px;
  box-shadow: 7px 7px 0 var(--ink);
  transform-origin: 50% 100%;
}
.modal.open .letter { animation: letterIn 0.7s var(--bounce); }
@keyframes letterIn {
  from { transform: translateY(40px) scale(0.6) rotate(6deg); opacity: 0; }
}
.letter-tape {
  position: absolute;
  top: -14px;
  left: 50%;
  width: 110px;
  height: 28px;
  margin-left: -55px;
  background: repeating-linear-gradient(45deg, rgba(255, 212, 92, 0.85) 0 8px, rgba(255, 255, 255, 0.85) 8px 16px);
  border: 2px solid var(--ink);
  transform: rotate(-3deg);
}
.letter-badge {
  position: absolute;
  top: 16px;
  right: 18px;
  margin: 0;
  padding: 2px 10px;
  font-family: 'Fredoka', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--gold);
  border: 2px solid var(--ink);
  border-radius: 999px;
  transform: rotate(4deg);
}
.letter-to { margin: 0 0 10px; font-size: 34px; font-weight: 400; color: var(--pink-d); }
.letter-body p { margin: 0 0 14px; }
.verse {
  margin: 18px 0;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--mint) 30%, transparent);
  border: 2.5px dashed var(--ink);
  border-radius: 14px;
  transform: rotate(-1deg);
}
.verse cite {
  display: block;
  margin-top: 4px;
  font-style: normal;
  font-size: 17px;
  text-align: right;
  color: var(--pink-d);
}
.letter-sign { margin: 22px 0 0; }
.letter-from { margin: 0; font-size: 34px; color: var(--pink-d); transform: rotate(-3deg); transform-origin: left; }
.letter-ps { margin: 16px 0 0; font-size: 18px; opacity: 0.7; }
.letter .pill { margin-top: 20px; font-family: 'Fredoka', sans-serif; }

/* The question */
.ask {
  position: relative;
  width: min(400px, 100%);
  padding: 26px 20px 22px;
  text-align: center;
  background: var(--cream);
  border: var(--line) solid var(--ink);
  border-radius: 28px;
  box-shadow: 7px 7px 0 var(--ink);
}
.modal.open .ask { animation: letterIn 0.7s var(--bounce); }
.ask-face {
  position: relative;
  width: 84px;
  height: 60px;
  margin: 0 auto 6px;
  background: var(--pink);
  border: var(--line) solid var(--ink);
  border-radius: 24px;
}
.ask-face .eye { top: 14px; width: 11px; height: 14px; animation: blinky 3s infinite; }
.ask-face .eye:nth-child(1) { left: 20px; }
.ask-face .eye:nth-child(2) { right: 20px; }
.ask-face .cheek { top: 30px; width: 12px; height: 7px; }
.ask-face .cheek-l { left: 7px; }
.ask-face .cheek-r { right: 7px; }
.ask-face .mouth { top: 28px; width: 12px; height: 7px; margin-left: -6px; border-width: 2.5px; }
.ask.done .ask-face .eye { animation: none; background: none; }
.ask.done .ask-face .eye::before {
  content: '\2665';
  position: absolute;
  inset: -4px -6px;
  font-size: 20px;
  line-height: 20px;
  color: #ff3d74;
  -webkit-text-stroke: 1px var(--ink);
}

.ask-q {
  margin: 4px 0 0;
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 700;
  line-height: 1.15;
}
.ask-yes {
  margin: 14px 0 6px;
  font-family: 'Gochi Hand', cursive;
  font-size: 32px;
  color: var(--pink-d);
  animation: letterIn 0.6s var(--bounce);
}
.ask-actions {
  position: relative;
  height: 150px;
  margin-top: 8px;
}
.ask.done .ask-actions { display: none; }
.ask-actions .pill {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: left 0.3s var(--bounce), top 0.3s var(--bounce), transform 0.3s var(--bounce);
}
.ask-actions .pill:hover { transform: translate(-50%, -50%) scale(1.05); }
.pill-yes {
  left: 34%;
  z-index: 2;
  padding: 12px 28px;
  font-size: 20px;
  background: var(--pink);
}
.pill-no {
  left: 68%;
  white-space: nowrap;
  background: var(--cream);
  font-size: 14px;
}
.pill-ghost { margin-top: 10px; background: var(--butter); }

/* Receipt: thermal paper with a torn zigzag edge, printed line by line. */
.receipt-wrap {
  position: relative;
  width: min(320px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.receipt-paper {
  width: 100%;
  /* Outline + offset shadow that follow the zigzag edge. */
  filter:
    drop-shadow(1.5px 0 0 var(--ink)) drop-shadow(-1.5px 0 0 var(--ink))
    drop-shadow(0 1.5px 0 var(--ink)) drop-shadow(0 -1.5px 0 var(--ink))
    drop-shadow(5px 5px 0 var(--ink));
}
.receipt {
  --zig: 9px;
  position: relative;
  padding: 22px 20px calc(20px + var(--zig));
  font-family: 'Courier Prime', ui-monospace, monospace;
  font-size: 13.5px;
  line-height: 1.45;
  color: #3a2a30;
  background: #fffdf6;
  -webkit-mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
  mask: conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) 50% / calc(2 * var(--zig)) 100%;
}
.modal.open .receipt { animation: print 2.2s steps(24, end) both; }
@keyframes print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(-24px); }
  to { clip-path: inset(0 0 0 0); transform: translateY(0); }
}
.r-center { text-align: center; }
.r-title { font-size: 22px; font-weight: 700; letter-spacing: 0.08em; }
.r-small { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.7; }
.r-row { display: flex; justify-content: space-between; gap: 12px; }
.r-row span:last-child { text-align: right; font-weight: 700; }
.r-rule { margin: 10px 0; border-top: 2px dashed rgba(58, 42, 48, 0.45); }
.r-prize-box { position: relative; padding: 4px 0; }
.r-prize {
  margin: 2px 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--pink-d);
}
.r-stamp {
  position: absolute;
  left: -6px;
  top: -6px;
  padding: 2px 8px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #ff3d74;
  border: 3px solid #ff3d74;
  border-radius: 8px;
  transform: rotate(-14deg);
  opacity: 0;
}
.modal.open .r-stamp { animation: stamp 0.35s cubic-bezier(0.5, 0, 0.75, 0) 2.3s forwards; }
@keyframes stamp {
  from { opacity: 0; transform: rotate(-14deg) scale(2.4); }
  to { opacity: 0.85; transform: rotate(-14deg) scale(1); }
}
.r-barcode { display: flex; justify-content: center; height: 46px; margin: 12px 0 6px; }
.r-barcode span { display: block; height: 100%; }
.r-barcode .bar { background: #3a2a30; }

/* ---------------------------------------------------------------------
   Sound toggle
   --------------------------------------------------------------------- */
.sound-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: var(--line) solid var(--ink);
  border-radius: 14px;
  background: var(--cream);
  box-shadow: 3px 3px 0 var(--ink);
}
.sound-toggle svg { width: 20px; height: 20px; }
.sound-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }

@media (max-height: 740px) and (min-width: 700px) {
  :root { --w: 240px; }
}

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