/* 捏捏小卖铺 — mobile-first, phone-width column on desktop */

:root {
  --bg: #F6F2ED;
  --text: #4A3426;
  --text-2: #8C7B6D;
  --brand: #6E4A35;
  --cta: #8C5E3D;
  --surface: #FCFAF6;
  --border: #E8DDD0;
  --btn2-bg: #EFE6DB;
  --btn2-border: #D9CAB8;
  --track: #EEE7DF;
  --gold-bg: #F7E4B0;
  --gold-border: #E3C483;
  --gold-text: #6E4B26;
  --shadow-soft: 0 4px 14px rgba(110, 74, 53, .08);
  --side: 22px;
  --font: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

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

html {
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

body.modal-open { overflow: hidden; }

button {
  font: inherit;
  color: inherit;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}

button:focus { outline: none; }
button:focus-visible { outline: 2px solid rgba(140, 94, 61, .45); outline-offset: 2px; }

img { -webkit-user-drag: none; -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }

.ico {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.app {
  position: relative;
  max-width: 460px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 0 max(var(--side), env(safe-area-inset-right)) 0 max(var(--side), env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
}

main { display: block; }

/* ---------- 1. header ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: calc(env(safe-area-inset-top) + 14px);
}

.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }

.logo {
  width: 32px;
  height: 32px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #6E4A35;
  color: #FFF4E6;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(110, 74, 53, .28), inset 0 1px 0 rgba(255, 255, 255, .08);
}

.brand-name {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  color: #4A3426;
  letter-spacing: .4px;
  white-space: nowrap;
}

.sound-toggle {
  height: 42px;
  min-width: 87px;
  padding: 0 14px 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  background: #FCFAF6;
  border: 1.5px solid #E8DDD0;
  color: #7A6A5C;
  font-size: 14px;
  box-shadow: 0 2px 8px rgba(110, 74, 53, .05);
  transition: transform .12s ease;
}
.sound-toggle:active { transform: scale(.96); }
.sound-toggle .ico { width: 18px; height: 18px; stroke-width: 1.8; }
.sound-toggle .ico-off { display: none; }
.sound-toggle.is-off .ico-on { display: none; }
.sound-toggle.is-off .ico-off { display: block; }

/* ---------- 2. product title ---------- */
.product-head {
  margin-top: 26px;
  text-align: center;
}
.product-head.swap { animation: headSwap .32s cubic-bezier(.2, .8, .3, 1); }

.product-name {
  margin: 0;
  font-size: 28px;
  font-weight: 900;
  color: #4A3326;
  letter-spacing: -0.5px;
  line-height: 1.25;
}

.product-desc {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #8C7B6D;
}

@keyframes headSwap {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 3. hero stage ---------- */
.stage {
  position: relative;
  height: 256px;
  margin-top: 4px;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  z-index: 1;
}

.plate {
  position: absolute;
  left: 50%;
  top: 46%;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%,
    #FFFDF9 0%,
    rgba(255, 253, 249, .94) 28%,
    rgba(255, 253, 249, .62) 48%,
    rgba(255, 253, 249, .22) 62%,
    rgba(255, 253, 249, 0) 71%);
}
.plate::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 44%,
    rgba(150, 120, 90, 0) 52%,
    rgba(150, 120, 90, .08) 61%,
    rgba(150, 120, 90, .03) 67%,
    rgba(150, 120, 90, 0) 71%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 48%, #000 78%);
  mask-image: linear-gradient(to bottom, transparent 48%, #000 78%);
}

.floor-shadow {
  position: absolute;
  left: 50%;
  top: 220px;
  width: 260px;
  height: 24px;
  margin-left: -130px;
  pointer-events: none;
  will-change: transform, opacity;
}
.floor-shadow i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(80, 50, 30, .34), rgba(80, 50, 30, .22) 55%, rgba(80, 50, 30, .08));
  filter: blur(12px);
  -webkit-filter: blur(12px);
  animation: shadowBreath 3.5s ease-in-out infinite;
}

.stage-canvas,
.fx-canvas {
  position: absolute;
  left: -22px;
  top: -44px;
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
}
.stage-canvas { animation: floaty 3.5s ease-in-out infinite; will-change: transform; }
.fx-canvas { z-index: 2; }

.stage.is-pressed .stage-canvas,
.stage.is-pressed .floor-shadow i { animation-play-state: paused; }

@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}
@keyframes shadowBreath {
  0%, 100% { transform: scaleX(1); opacity: 1; }
  50% { transform: scaleX(.97); opacity: .9; }
}

.hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  transition: opacity .5s ease, transform .5s ease;
}
.hint.is-hidden { opacity: 0; transform: translateY(-4px); }

.hint-pill {
  position: absolute;
  right: 10px;
  top: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #FCFAF6;
  border: 1px solid #EADFCF;
  color: #6B5A4C;
  font-size: 12.5px;
  line-height: 16px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(110, 74, 53, .06);
}

.hint-arrow {
  position: absolute;
  right: 50px;
  top: 32px;
  width: 60px;
  height: 68px;
  overflow: visible;
  fill: none;
  stroke: #A07B5C;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .85;
}

.finger {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 4;
  opacity: 0;
  background: radial-gradient(circle at 40% 35%, rgba(255, 250, 244, .55), rgba(232, 214, 196, .35));
  border: 1.5px solid rgba(110, 74, 53, .35);
  box-shadow: 0 2px 8px rgba(110, 74, 53, .12);
  transition: opacity .2s ease, scale .12s ease, background-color .12s;
  will-change: transform;
}
.finger.is-on { opacity: 1; }
.finger.is-down {
  scale: .78;
  border-color: rgba(110, 74, 53, .55);
  background: radial-gradient(circle at 40% 35%, rgba(255, 246, 236, .6), rgba(205, 180, 156, .45));
}

@media (hover: hover) and (pointer: fine) {
  .stage { cursor: none; }
}

/* ---------- 4. action buttons ---------- */
.actions {
  position: relative;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
  z-index: 2;
}

.btn {
  height: 42px;
  min-width: 120px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 500;
  color: #5A4636;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(110, 74, 53, .06);
  transition: transform .12s ease, box-shadow .12s ease, background-color .2s ease, opacity .2s ease;
}
.btn:active { transform: scale(.96); box-shadow: 0 1px 4px rgba(110, 74, 53, .06); }
.btn .ico { width: 18px; height: 18px; }
.btn-light { background: #FCFAF6; border: 1.5px solid #E6DBCD; }
.btn-tan { background: #EFE6DB; border: 1.5px solid #D9CAB8; }
.btn-cta { background: #8C5E3D; border: 1.5px solid #8C5E3D; color: #FDF1E4; box-shadow: 0 4px 12px rgba(140, 94, 61, .25); }
.btn[disabled] { opacity: .55; cursor: default; transform: none; }

.toast {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(74, 52, 38, .92);
  color: #FFF4E6;
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, 6px) scale(.96);
  transition: opacity .25s ease, transform .3s cubic-bezier(.3, 1.4, .5, 1);
  box-shadow: 0 6px 18px rgba(74, 52, 38, .2);
  z-index: 5;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- 5. daily blind box ---------- */
.bb {
  margin-top: 27px;
  height: 71px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px 0 10px;
  border-radius: 22px;
  border: 1.5px solid #E8D3BA;
  background: linear-gradient(90deg, #F4E4D1, #FAF4EC);
  box-shadow: 0 4px 14px rgba(110, 74, 53, .08);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  transition: transform .15s ease;
}
.bb:active { transform: scale(.985); }

.bb-art { width: 48px; height: 48px; flex: none; overflow: visible; }

.bb-text { flex: 1; min-width: 0; }

.bb-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 24px;
  color: #5A3E2B;
}

.bb-sub {
  margin: 5px 0 0;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  line-height: 18px;
  color: #9A8A7C;
  white-space: nowrap;
}

.bb-badge {
  padding: 1px 7px;
  border-radius: 6px;
  border: 1px solid #E3C483;
  background: #F7E4B0;
  color: #6E4B26;
  font-size: 12px;
  font-weight: 600;
  line-height: 17px;
}

.bb-btn {
  flex: none;
  height: 30px;
  padding: 0 11px 0 12px;
  border-radius: 999px;
  background: #8C5E3D;
  color: #FDF1E4;
  font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(140, 94, 61, .22);
  transition: transform .12s ease, background-color .2s ease;
}
.bb-btn:active { transform: scale(.96); }
.bb-btn.is-out { background: #CDBBA9; color: #FFF8F0; box-shadow: none; cursor: default; }

/* Phone widths: the spec sizes only fit on one line from ~440px up, so the
   card copy steps down (as in the reference screenshot) instead of wrapping. */
@media (max-width: 440px) {
  .bb { gap: 8px; padding: 0 10px 0 9px; }
  .bb-art { width: 44px; height: 44px; }
  .bb-title { font-size: 19px; }
  .bb-sub { font-size: 11.5px; gap: 4px; word-spacing: -.08em; }
  .bb-badge { font-size: 11px; padding: 1px 5px; }
  .bb-btn { font-size: 13.5px; padding: 0 9px 0 10px; word-spacing: -.08em; }
}
@media (max-width: 380px) {
  .bb-art { width: 40px; height: 40px; }
  .bb-title { font-size: 18px; }
  .bb-sub { font-size: 11px; }
  .bb-badge { font-size: 10.5px; }
  .bb-btn { font-size: 13px; }
}
@media (max-width: 365px) {
  .bb { height: auto; min-height: 71px; padding-top: 10px; padding-bottom: 10px; }
  .bb-sub { flex-wrap: wrap; row-gap: 4px; }
}

/* ---------- 6. section header ---------- */
.section-title {
  margin: 26px 0 0;
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  font-weight: 500;
  color: #8A7568;
}
.section-title .ico { width: 17px; height: 17px; stroke: #C3A497; stroke-width: 1.8; }

/* ---------- 7. tabs ---------- */
.tabs {
  position: relative;
  margin-top: 12px;
  height: 67px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  border-radius: 22px;
  background: #EFE7DE;
  border: 1px solid #E7DDD2;
}

.tab-pill {
  position: absolute;
  left: 4px;
  top: 4px;
  bottom: 4px;
  width: calc((100% - 8px) / 5);
  border-radius: 16px;
  background: #FFFDF9;
  box-shadow: 0 2px 6px rgba(120, 90, 60, .10);
  transform: translateX(calc(var(--i, 0) * 100%));
  transition: transform .42s cubic-bezier(.3, 1.25, .45, 1);
  pointer-events: none;
}

.tab {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 16px;
  min-width: 0;
}
.tab:active .tab-emoji { transform: scale(.9); }

.tab-emoji {
  font-size: 22px;
  line-height: 24px;
  transition: transform .15s ease;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}
.tab-label {
  font-size: 14px;
  line-height: 18px;
  color: #9D8D82;
  font-weight: 400;
  white-space: nowrap;
  transition: color .2s ease;
}
.tab[aria-selected="true"] .tab-label { color: #3E2C22; font-weight: 600; }

/* ---------- 8. grid ---------- */
.grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 3px;
  border-radius: 12px;
  background: #FCF8F3;
  border: 1px solid #ECE2D7;
  text-align: center;
  min-width: 0;
  transition: transform .15s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
  animation: cardIn .34s cubic-bezier(.2, .8, .3, 1) both;
  animation-delay: calc(var(--n, 0) * 22ms);
}
.card:active { transform: scale(.96); }
.card.is-selected {
  border: 2px solid #B5805F;
  padding: 2px;
  background: #FBF2E8;
  box-shadow: 0 3px 10px rgba(140, 94, 61, .1);
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.well {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  background: #F3ECE3;
  overflow: visible;
}
.well img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 2px 2px rgba(80, 50, 30, .16));
  pointer-events: none;
}

.card-name {
  display: block;
  padding: 8px 1px 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  color: #3F2E25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-name.is-long { font-size: 10.5px; letter-spacing: -.3px; }

.tag {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  white-space: nowrap;
  line-height: 1;
}
.tag-sign {
  top: 1px;
  right: 3px;
  padding: 4px 6px 4px 7px;
  border-radius: 3px;
  background: #8A5A3B;
  color: #FFF4E8;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  transform: rotate(-8deg);
  box-shadow: inset 0 0 0 2px #8A5A3B, inset 0 0 0 3px #D2A983, 0 2px 4px rgba(80, 50, 30, .22);
}
.tag-new,
.tag-hidden {
  top: 7px;
  right: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 10px;
  line-height: 12px;
}
.tag-new { background: #E5EEDB; border: 1px solid #B7CDA3; color: #4E6A43; }
.tag-hidden { background: #F7E4B0; border: 1px solid #E3C483; color: #6E4B26; font-weight: 600; }

.grid-empty {
  grid-column: 1 / -1;
  padding: 28px 0;
  text-align: center;
  color: #B3A396;
  font-size: 13px;
}

/* ---------- footer ---------- */
.foot {
  margin-top: auto;
  padding: 30px 0 calc(26px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 12px;
  color: #B3A396;
}

/* ---------- blind-box modal ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top) + 16px) 18px calc(env(safe-area-inset-bottom) + 16px);
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(74, 52, 38, .36);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .25s ease;
}
.modal.is-open .modal-backdrop { opacity: 1; }

.modal-sheet {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 20px 18px 18px;
  border-radius: 26px;
  background: #FCFAF6;
  border: 1.5px solid #EADBC8;
  box-shadow: 0 18px 50px rgba(74, 52, 38, .22);
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: translateY(16px) scale(.96);
  transition: opacity .25s ease, transform .35s cubic-bezier(.3, 1.3, .5, 1);
}
.modal-sheet:focus { outline: none; }
.modal.is-open .modal-sheet { opacity: 1; transform: none; }

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #9A8A7C;
  background: #F4EDE4;
  z-index: 3;
}
.modal-close .ico { width: 16px; height: 16px; }

.box-head { position: relative; z-index: 5; }
.box-title { margin: 0; font-size: 19px; font-weight: 700; color: #5A3E2B; }
.box-left { margin: 4px 0 0; font-size: 12.5px; color: #9A8A7C; }

.box-stage {
  position: relative;
  height: 232px;
  margin-top: 6px;
}

.box-svg {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 172px;
  height: 160px;
  margin-left: -86px;
  overflow: visible;
  transform-origin: 50% 90%;
}
.box-lid { transform-box: fill-box; transform-origin: 30% 100%; transition: transform .5s cubic-bezier(.2, .9, .3, 1.2), opacity .45s ease .15s; }
.box-spark { transform-box: fill-box; transform-origin: center; animation: twinkle 1.6s ease-in-out infinite; }
.box-spark.s2 { animation-delay: .6s; }

.box-prize {
  position: absolute;
  left: 50%;
  top: 6px;
  width: 168px;
  height: 140px;
  margin-left: -84px;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(80, 50, 30, .22));
  opacity: 0;
  transform: translateY(70px) scale(.3);
  z-index: 2;
  pointer-events: none;
}

.box-rays {
  position: absolute;
  left: 50%;
  top: 76px;
  width: 300px;
  height: 300px;
  margin: -150px 0 0 -150px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 236, 205, 0) 0deg 9deg, rgba(255, 233, 196, .9) 9deg 18deg);
  -webkit-mask-image: radial-gradient(circle, #000 18%, transparent 66%);
  mask-image: radial-gradient(circle, #000 18%, transparent 66%);
  opacity: 0;
  transform: scale(.6);
  transition: opacity .5s ease, transform .6s ease;
  pointer-events: none;
}

.box-ribbon {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 3;
  transform: translate(-50%, -8px) scale(.6);
  opacity: 0;
  padding: 5px 22px;
  color: #6E4B26;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 2px;
  background: linear-gradient(100deg, #E3C483, #F7E4B0 35%, #FFF3D1 50%, #F7E4B0 65%, #E3C483);
  clip-path: polygon(0 0, 100% 0, 92% 50%, 100% 100%, 0 100%, 8% 50%);
  overflow: hidden;
  pointer-events: none;
}
.box-ribbon::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -60%;
  width: 40%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .85), transparent);
  transform: skewX(-20deg);
}

.box-confetti { position: absolute; inset: 0; pointer-events: none; z-index: 4; }
.box-confetti i {
  position: absolute;
  left: 50%;
  top: 70px;
  width: var(--w, 6px);
  height: var(--h, 3px);
  border-radius: 1px;
  background: var(--c, #D9B26A);
  opacity: 0;
  animation: confetti 1.3s cubic-bezier(.15, .7, .35, 1) forwards;
  animation-delay: var(--d, 0s);
}

.box-result { min-height: 76px; margin-top: 6px; }
.box-kicker { margin: 0; font-size: 12.5px; color: #A08C7B; letter-spacing: .5px; }
.box-name { margin: 4px 0 0; font-size: 21px; font-weight: 800; color: #4A3326; letter-spacing: -.3px; min-height: 28px; }
.box-desc { margin: 4px 0 0; font-size: 12.5px; color: #8C7B6D; min-height: 18px; }
.box-result > * { transition: opacity .3s ease, transform .35s ease; }
.modal-sheet[data-phase="shake"] .box-name,
.modal-sheet[data-phase="shake"] .box-desc,
.modal-sheet[data-phase="pop"] .box-name,
.modal-sheet[data-phase="pop"] .box-desc { opacity: 0; transform: translateY(4px); }

.box-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.box-actions .btn { min-width: 116px; }
.modal-sheet:not([data-phase="reveal"]) .box-actions .btn { opacity: .45; pointer-events: none; }

/* phases */
.modal-sheet[data-phase="shake"] .box-svg { animation: boxShake .7s cubic-bezier(.36, .07, .19, .97) both; }
.modal-sheet[data-phase="pop"] .box-lid,
.modal-sheet[data-phase="reveal"] .box-lid { transform: translate(-14px, -58px) rotate(-26deg); opacity: 0; }
.modal-sheet[data-phase="pop"] .box-svg,
.modal-sheet[data-phase="reveal"] .box-svg { animation: boxPop .45s cubic-bezier(.3, 1.6, .5, 1) both; }
.modal-sheet[data-phase="reveal"] .box-prize { animation: prizeUp .62s cubic-bezier(.25, 1.5, .45, 1) forwards; }
.modal-sheet[data-phase="reveal"] .box-rays { opacity: .55; transform: scale(1); animation: spin 14s linear infinite; }
.modal-sheet.is-hidden-prize[data-phase="reveal"] .box-rays {
  opacity: .95;
  background: repeating-conic-gradient(from 0deg, rgba(247, 228, 176, 0) 0deg 8deg, rgba(232, 196, 120, .75) 8deg 16deg);
}
.modal-sheet.is-hidden-prize[data-phase="reveal"] .box-ribbon {
  animation: ribbonIn .5s cubic-bezier(.3, 1.6, .5, 1) .2s forwards;
}
.modal-sheet.is-hidden-prize[data-phase="reveal"] .box-ribbon::after { animation: shimmer 1.8s ease-in-out .6s infinite; }
.modal-sheet.is-hidden-prize[data-phase="reveal"] .box-name {
  background: linear-gradient(100deg, #8A5A2B, #C9973F 40%, #F2D58A 50%, #C9973F 60%, #8A5A2B);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: textShimmer 2.4s linear infinite;
}
.modal-sheet.is-hidden-prize { border-color: #E3C483; box-shadow: 0 18px 50px rgba(74, 52, 38, .22), 0 0 0 4px rgba(247, 228, 176, .45); }

@keyframes boxShake {
  0% { transform: rotate(0) translateY(0); }
  12% { transform: rotate(-7deg) translateY(-2px); }
  26% { transform: rotate(6deg) translateY(0); }
  40% { transform: rotate(-6deg) translateY(-3px); }
  54% { transform: rotate(5deg) translateY(0); }
  68% { transform: rotate(-4deg) translateY(-2px); }
  82% { transform: rotate(3deg) scale(1.03, .96); }
  100% { transform: rotate(0) scale(1); }
}
@keyframes boxPop {
  0% { transform: scale(1.08, .9); }
  60% { transform: scale(.97, 1.04); }
  100% { transform: scale(1); }
}
@keyframes prizeUp {
  0% { opacity: 0; transform: translateY(70px) scale(.3); }
  35% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes spin { to { rotate: 360deg; } }
@keyframes ribbonIn { to { opacity: 1; transform: translate(-50%, 0) scale(1); } }
@keyframes shimmer { 0% { left: -60%; } 60%, 100% { left: 130%; } }
@keyframes textShimmer { from { background-position: 100% 0; } to { background-position: -150% 0; } }
@keyframes twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.7); opacity: .6; } }
@keyframes confetti {
  0% { opacity: 1; transform: translate(0, 0) rotate(0); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)); }
}

/* iOS haptic switch — must stay in the DOM but invisible */
.haptic-switch {
  position: fixed;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  clip-path: inset(50%);
}

@media (prefers-reduced-motion: reduce) {
  .stage-canvas, .floor-shadow i, .box-spark { animation: none; }
  .card { animation: none; }
}
