/* ==========================================================================
   《深夜灵魂便利店 · 02:14》 1C Stop-Motion Polymer Clay Diorama Stylesheet
   Every UI surface sculpted like matte polymer clay, kraft tags & thermal paper
   ========================================================================== */

:root {
  --clay-bg: #10131b;
  --clay-cream: #f7efe1;
  --clay-cream-dark: #e6d7be;
  --clay-mint: #93c9b6;
  --clay-mint-dark: #69a591;
  --clay-coral: #e76f5e;
  --clay-coral-dark: #c24d3d;
  --clay-wood: #543b2a;
  --clay-wood-deep: #2c1e15;
  --clay-gold: #f6c453;
  --clay-ink: #38281e;
  --clay-ink-soft: #6e5544;
  --font-round: "PingFang SC", "Hiragino Maru Gothic ProN", "Microsoft YaHei", "SF Pro Rounded", system-ui, sans-serif;
  --font-mono: "SF Mono", Consolas, Menlo, "Courier New", monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: radial-gradient(circle at 50% 28%, #1c2233 0%, #0e111a 60%, #080a10 100%);
  color: var(--clay-cream);
  font-family: var(--font-round);
  user-select: none;
  display: flex;
  flex-direction: column;
}

#rain-bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.ico-xs { width: 14px; height: 14px; }
.ico-sm { width: 17px; height: 17px; }
.ico-md { width: 20px; height: 20px; }
.hidden { display: none !important; }

/* ---------- Top Ambient Clay Bar ---------- */
.top-bar {
  position: relative;
  z-index: 20;
  flex-shrink: 0;
  padding: 10px 18px 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tb-left, .tb-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Tactile Polymer Clay Pill Button */
.clay-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: none;
  background: rgba(45, 36, 30, 0.78);
  color: var(--clay-cream);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow:
    inset 0 2px 3px rgba(255, 240, 215, 0.2),
    inset 0 -3px 4px rgba(0, 0, 0, 0.4),
    0 5px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.14s ease, filter 0.15s;
}
.clay-chip:hover { filter: brightness(1.12); transform: translateY(-1px); }
.clay-chip:active { transform: scale(0.94); }

.clay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 22px;
  border: none;
  font-family: var(--font-round);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.14s cubic-bezier(.34,1.56,.64,1), filter 0.15s;
}
.clay-btn:active { transform: scale(0.94) translateY(2px); }
.clay-btn.coral {
  background: linear-gradient(180deg, #f08272 0%, var(--clay-coral) 62%, var(--clay-coral-dark) 100%);
  color: #fffaf5;
  box-shadow:
    inset 0 3px 4px rgba(255, 226, 218, 0.55),
    inset 0 -5px 6px rgba(132, 36, 25, 0.45),
    0 10px 22px rgba(0, 0, 0, 0.48);
}
.clay-btn.mint {
  background: linear-gradient(180deg, #a9dccb 0%, var(--clay-mint) 62%, var(--clay-mint-dark) 100%);
  color: #18362c;
  box-shadow:
    inset 0 3px 4px rgba(232, 255, 247, 0.65),
    inset 0 -5px 6px rgba(52, 102, 85, 0.42),
    0 10px 22px rgba(0, 0, 0, 0.42);
}
.clay-btn.cream {
  background: linear-gradient(180deg, #fffaf0 0%, var(--clay-cream) 64%, var(--clay-cream-dark) 100%);
  color: var(--clay-ink);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.8),
    inset 0 -4px 6px rgba(154, 126, 92, 0.38),
    0 8px 18px rgba(0, 0, 0, 0.35);
}
.clay-btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}

/* ---------- Centered 9:16 Miniature Diorama Frame ---------- */
#diorama-stage {
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px 12px 12px;
}

.diorama-frame {
  position: relative;
  width: 394px;
  height: 788px;
  flex-shrink: 0;
  border-radius: 38px;
  overflow: hidden;
  background: #14110f;
  transform-origin: center center;
  box-shadow:
    0 34px 90px rgba(0, 0, 0, 0.85),
    0 0 0 6px #2d221c,
    0 0 0 8px rgba(255, 232, 198, 0.14);
}

.scene-root {
  position: relative;
  width: 100%;
  height: 100%;
}

.diorama-vignette {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 28;
  box-shadow: inset 0 0 46px rgba(12, 8, 5, 0.58);
}

@media (max-width: 520px) {
  html, body { height: 100dvh; }
  .top-bar { padding: 6px 10px 2px; background: #10131b; }
  #diorama-stage { padding: 0; }
  .diorama-frame {
    width: 100vw;
    height: 100%;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ==========================================================================
   SCENE 1: RAINY CLAY STOREFRONT ENTRANCE (bg_storefront_rain.jpg)
   ========================================================================== */
.scene-entrance {
  position: relative;
  width: 100%;
  height: 100%;
  background: url('../assets/scenes/bg_storefront_rain.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px 18px 26px;
}

/* Hand-painted title sitting RIGHT ON TOP of the blank clay roof signboard! */
.roof-sign-overlay {
  position: absolute;
  top: 28.4%;
  left: 26%;
  width: 54%;
  height: 6.4%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(2.1deg);
  pointer-events: none;
}
.roof-sign-title {
  font-size: 16.5px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #463225;
  text-shadow: 0 1px 0 rgba(255, 248, 232, 0.8);
}
.roof-sign-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #7c5c45;
}

.entrance-top-badge {
  align-self: center;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(24, 20, 18, 0.72);
  border: 1px solid rgba(255, 232, 196, 0.24);
  backdrop-filter: blur(8px);
  font-size: 11.5px;
  color: #fde6b8;
  letter-spacing: 0.08em;
}

.entrance-bottom-card {
  margin-top: auto;
  padding: 16px 16px 15px;
  border-radius: 26px;
  background: rgba(29, 22, 18, 0.82);
  border: 1px solid rgba(255, 230, 194, 0.2);
  backdrop-filter: blur(12px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
  text-align: center;
}
.entrance-copy {
  font-size: 12.8px;
  line-height: 1.65;
  color: #f3e6d3;
  margin-bottom: 13px;
}
.entrance-copy strong { color: var(--clay-gold); }

/* ==========================================================================
   SCENE 2: 3-TIER WOODEN CLAY SHELVES & RED CLAY BASKET (bg_shelf_stage.jpg)
   Exact vertical shelf alignment: Tier 1 @ 43%, Tier 2 @ 60%, Tier 3 @ 79%
   ========================================================================== */
.scene-shop {
  position: relative;
  width: 100%;
  height: 100%;
  background: url('../assets/scenes/bg_shelf_stage.jpg') center/cover no-repeat;
  overflow: hidden;
}

.shop-hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  z-index: 18;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shop-hud-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.budget-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff9ec, #ebd9bc);
  color: var(--clay-ink);
  font-size: 13px;
  font-weight: 800;
  box-shadow:
    inset 0 2px 3px rgba(255,255,255,0.8),
    inset 0 -3px 5px rgba(138,108,74,0.35),
    0 6px 16px rgba(0,0,0,0.45);
}
.budget-val {
  font-family: var(--font-mono);
  font-size: 16px;
  color: var(--clay-coral-dark);
}

.aisle-tabs {
  display: flex;
  gap: 7px;
  justify-content: center;
}
.aisle-pill {
  border: none;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(34, 25, 20, 0.72);
  color: #e8d8c2;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.18), 0 4px 10px rgba(0,0,0,0.35);
  transition: all 0.16s;
}
.aisle-pill.active {
  background: linear-gradient(180deg, #a7dbca, #7db9a6);
  color: #16332a;
}

.shop-hint-banner {
  align-self: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(22, 16, 12, 0.66);
  font-size: 11px;
  color: #f6dcb0;
}

/* Swipeable 2-Aisle Clay Shelf Container */
.shelf-swiper {
  position: absolute;
  inset: 0;
  z-index: 10;
  width: 100%;
  height: 100%;
}
.shelf-slide {
  position: relative;
  width: 100%;
  height: 100%;
}

/* Exact 3 Wooden Ledge Rows aligned flush onto bg_shelf_stage.jpg! */
.shelf-row {
  position: absolute;
  left: 12.5%;
  width: 75%;
  display: flex;
  justify-content: space-around;
  align-items: flex-end;
  pointer-events: none;
}
.shelf-row-1 { bottom: 56.8%; height: 15%; }
.shelf-row-2 { bottom: 40.0%; height: 15.5%; }
.shelf-row-3 { bottom: 20.8%; height: 16.5%; }

.clay-item-slot {
  position: relative;
  width: 44%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  cursor: pointer;
  pointer-events: auto;
  border: none;
  background: transparent;
  transition: transform 0.2s cubic-bezier(.34,1.56,.64,1);
}
.clay-item-slot:hover {
  transform: translateY(-5px) scale(1.04);
}
.clay-item-slot:active {
  transform: scale(0.93);
}
.clay-item-slot.in-basket {
  opacity: 0.28;
  filter: grayscale(0.4);
  transform: scale(0.88);
}

/* Soft grounded contact shadow right on the wooden clay board */
.clay-shadow {
  position: absolute;
  bottom: -2px;
  width: 68%;
  height: 11px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(24, 14, 7, 0.62) 0%, rgba(24, 14, 7, 0) 72%);
  pointer-events: none;
}

.clay-sprite {
  position: relative;
  z-index: 2;
  max-height: 90px;
  max-width: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(24, 14, 6, 0.48));
  pointer-events: none;
}

/* Cute miniature kraft price tag hanging right below the wooden shelf edge */
.kraft-tag {
  position: absolute;
  bottom: -24px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f5e6cc;
  border: 1px solid #cbb18b;
  color: var(--clay-ink);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
}
.kraft-tag b {
  color: var(--clay-coral-dark);
  font-family: var(--font-mono);
}

/* Bottom Floor Dock: Chunky Red Clay Basket + Checkout Clay Button */
.basket-dock {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 10px;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.red-basket-btn {
  position: relative;
  width: 144px;
  height: 114px;
  border: none;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  transition: transform 0.16s cubic-bezier(.34,1.56,.64,1);
}
.red-basket-btn:hover { transform: scale(1.04); }
.red-basket-btn:active { transform: scale(0.95); }

.basket-peeking-items {
  position: absolute;
  bottom: 50px;
  left: 10px;
  right: 10px;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  z-index: 3;
  pointer-events: none;
}
.basket-peeking-items img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  margin: 0 -8px;
  filter: drop-shadow(0 4px 5px rgba(42, 12, 8, 0.55));
}

.basket-front-img {
  position: relative;
  z-index: 2;
  width: 128px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.65));
}

.basket-count-badge {
  position: absolute;
  right: 8px;
  bottom: 12px;
  z-index: 4;
  min-width: 26px;
  height: 26px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--clay-gold);
  color: var(--clay-ink);
  font-size: 12px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 2px 2px rgba(255,255,255,0.6), 0 4px 8px rgba(0,0,0,0.45);
}

.checkout-cta-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  padding-bottom: 10px;
  pointer-events: auto;
}
.checkout-mini-note {
  font-size: 11px;
  color: #f3dfbf;
  text-shadow: 0 1px 4px rgba(0,0,0,0.9);
  padding-right: 4px;
}

/* ==========================================================================
   SCENE 3: CLAY CHECKOUT COUNTER & 3 DILEMMAS (bg_checkout_counter.jpg)
   ========================================================================== */
.scene-checkout {
  position: relative;
  width: 100%;
  height: 100%;
  background: url('../assets/scenes/bg_checkout_counter.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px 14px 18px;
}

.clerk-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(247, 239, 225, 0.94);
  color: var(--clay-ink);
  box-shadow:
    inset 0 3px 4px rgba(255, 255, 255, 0.85),
    inset 0 -4px 6px rgba(164, 134, 98, 0.35),
    0 12px 26px rgba(0, 0, 0, 0.48);
}
.clerk-av {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid #fff;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25);
}
.clerk-text-wrap { flex: 1; }
.clerk-name {
  font-size: 11px;
  font-weight: 800;
  color: var(--clay-coral-dark);
  margin-bottom: 3px;
}
.clerk-line {
  font-size: 12.8px;
  line-height: 1.55;
  font-weight: 600;
}

.counter-stage {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.counter-tray {
  padding: 14px 12px;
  border-radius: 24px;
  background: rgba(34, 24, 18, 0.84);
  border: 1px solid rgba(255, 228, 190, 0.22);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.55);
}

.scan-items-row {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.scan-item-btn {
  position: relative;
  width: 78px;
  padding: 8px 6px 6px;
  border-radius: 18px;
  border: 2px solid rgba(255, 232, 198, 0.22);
  background: rgba(255, 246, 230, 0.1);
  color: var(--clay-cream);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.16s;
}
.scan-item-btn:hover { background: rgba(255, 246, 230, 0.2); transform: translateY(-2px); }
.scan-item-btn.scanned {
  border-color: var(--clay-mint);
  background: rgba(147, 201, 182, 0.2);
}
.scan-item-btn img {
  width: 54px;
  height: 54px;
  object-fit: contain;
  filter: drop-shadow(0 4px 5px rgba(0, 0, 0, 0.45));
}
.scan-item-btn span { font-size: 10.5px; font-weight: 700; text-align: center; }

.scanner-laser {
  position: absolute;
  left: 8px; right: 8px; top: 44%;
  height: 3px;
  border-radius: 99px;
  background: #ff4b4b;
  box-shadow: 0 0 10px #ff4b4b;
  opacity: 0;
  pointer-events: none;
}

/* ==========================================================================
   FULL-STAGE ZOOMED CLAY BLIND-BAG UNBOXING (Shake -> Physical Foil Tear -> Reveal)
   ========================================================================== */
.unbox-overlay {
  position: absolute;
  inset: 0;
  z-index: 26;
  background: radial-gradient(circle at 50% 44%, rgba(68, 49, 28, 0.9) 0%, rgba(14, 11, 16, 0.96) 72%);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px 18px;
  overflow: hidden;
}

.unbox-flash {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(255, 240, 185, 0.95), rgba(246, 196, 83, 0.4) 55%, transparent 80%);
  opacity: 0;
  pointer-events: none;
  z-index: 35;
}

.unbox-bag-arena {
  position: relative;
  flex: 1;
  min-height: 310px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.unbox-halo {
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(246, 196, 83, 0.28) 0%, rgba(231, 111, 94, 0.08) 52%, transparent 72%);
  filter: blur(12px);
  pointer-events: none;
  animation: haloPulse 2.4s ease-in-out infinite;
}
@keyframes haloPulse {
  0%, 100% { transform: scale(0.95); opacity: 0.72; }
  50% { transform: scale(1.08); opacity: 1; }
}

/* Giant 220x303 interactive clay pouch rig (exact 247:340 prop_blindbag.png ratio) */
.unbox-bag-rig {
  position: relative;
  width: 220px;
  height: 303px;
  cursor: grab;
  touch-action: none;
  user-select: none;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.68));
}
.unbox-bag-rig:active { cursor: grabbing; }

/* Exact 2-piece polygon split along prop_blindbag.png tilted gold crimp (17.5% -> 22.5%) */
.bag-layer-top,
.bag-layer-body {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}
.bag-layer-top {
  clip-path: polygon(0% 0%, 100% 0%, 100% 23.2%, 0% 18.2%);
  transform-origin: 95% 22.5%;
  z-index: 5;
}
.bag-layer-body {
  clip-path: polygon(0% 17.6%, 100% 22.6%, 100% 100%, 0% 100%);
  transform-origin: 50% 72%;
  z-index: 3;
}

.bag-tear-glow {
  position: absolute;
  left: 5%;
  right: 5%;
  top: 14%;
  height: 36px;
  border-radius: 999px;
  background: radial-gradient(ellipse at center, #fff7d1 0%, #f6c453 45%, transparent 78%);
  filter: blur(6px);
  transform: rotate(3.9deg) scaleY(0.25);
  opacity: 0;
  z-index: 4;
  pointer-events: none;
}

/* Interactive Swipe-to-Tear Golden Seam Overlay (hugs exact pouch width, center y=20%, tilt +3.9deg) */
.tear-track-overlay {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 11.5%;
  height: 54px;
  transform: rotate(3.9deg);
  z-index: 12;
  touch-action: none;
  display: flex;
  align-items: center;
  cursor: ew-resize;
}

.tear-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}

.tear-handle {
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 2.5px solid #fff8dc;
  background: linear-gradient(180deg, #ffe38e 0%, #f6b73c 65%, #d68516 100%);
  color: #3d2104;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 18px rgba(246, 196, 83, 0.85), 0 6px 14px rgba(0, 0, 0, 0.5);
  cursor: grab;
  z-index: 4;
}
.tear-handle:active { cursor: grabbing; transform: translateY(-50%) scale(1.08); }

.tear-guide-pill {
  position: absolute;
  left: 36px;
  top: -28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(24, 17, 13, 0.88);
  border: 1px solid rgba(246, 196, 83, 0.55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #fff6cf;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.55);
  pointer-events: none;
  animation: guideShift 1.5s ease-in-out infinite;
}
@keyframes guideShift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(7px); }
}

.tear-spark {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffdf0 0%, #f6c453 70%, transparent 100%);
  box-shadow: 0 0 8px #f6c453;
  pointer-events: none;
  z-index: 15;
}

.shake-meter-wrap {
  padding: 12px 14px;
  border-radius: 22px;
  background: rgba(34, 24, 18, 0.86);
  border: 1px solid rgba(255, 228, 190, 0.22);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.shake-meter-track {
  height: 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
  padding: 2px;
}
.shake-meter-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f6c453, #e76f5e);
  transition: width 0.16s ease;
}

/* Holographic Prism Shimmer Soul Gift Card (inspired by pokemon-cards-css) */
.holo-gift-card {
  position: relative;
  width: 100%;
  padding: 18px 16px;
  border-radius: 24px;
  background: linear-gradient(145deg, #2d2642 0%, #1d1a2e 55%, #34252d 100%);
  border: 2px solid rgba(246, 196, 83, 0.65);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.65), 0 0 28px rgba(246, 196, 83, 0.24);
  text-align: center;
  overflow: hidden;
  margin-bottom: 10px;
}
.holo-gift-card::after {
  content: "";
  position: absolute;
  inset: -40%;
  background: linear-gradient(
    115deg,
    transparent 30%,
    rgba(255, 240, 170, 0.28) 44%,
    rgba(147, 201, 182, 0.26) 50%,
    rgba(231, 111, 94, 0.24) 56%,
    transparent 70%
  );
  mix-blend-mode: color-dodge;
  animation: holoSweep 3.2s ease-in-out infinite;
  pointer-events: none;
}
@keyframes holoSweep {
  0% { transform: translateX(-55%) rotate(10deg); }
  50% { transform: translateX(55%) rotate(10deg); }
  100% { transform: translateX(-55%) rotate(10deg); }
}

.torn-pouch-preview {
  width: 120px;
  height: 112px;
  margin: 0 auto 6px;
  object-fit: contain;
  clip-path: polygon(0% 21%, 14% 25%, 28% 20%, 44% 26%, 60% 21%, 76% 26%, 90% 22%, 100% 25%, 100% 100%, 0% 100%);
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}

.dilemma-choices {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dilemma-btn {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(180deg, #fff9ee, #ecdcc2);
  color: var(--clay-ink);
  font-family: var(--font-round);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.45;
  cursor: pointer;
  box-shadow: inset 0 2px 3px rgba(255,255,255,0.85), inset 0 -3px 4px rgba(154,124,88,0.32), 0 4px 10px rgba(0,0,0,0.3);
  transition: transform 0.12s;
}
.dilemma-btn:active { transform: scale(0.97); }
.dilemma-btn.coral-opt {
  background: linear-gradient(180deg, #f59486, #e26d5c);
  color: #fff;
}

/* ==========================================================================
   SCENE 4: THERMAL RECEIPT PRINTER & SHAREABLE SOUL RECEIPT
   ========================================================================== */
.scene-receipt {
  position: relative;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(180deg, rgba(20, 15, 12, 0.72), rgba(14, 11, 9, 0.92)),
    url('../assets/scenes/bg_checkout_counter.jpg') center/cover no-repeat;
  display: flex;
  flex-direction: column;
  padding: 12px 14px 16px;
  overflow-y: auto;
}
.scene-receipt::-webkit-scrollbar { width: 4px; }
.scene-receipt::-webkit-scrollbar-thumb { background: rgba(255, 232, 198, 0.25); border-radius: 4px; }

.printer-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 8px;
}
.printer-slot img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.55));
}

/* Authentic Zigzag-Edge Thermal Paper Receipt */
.thermal-paper {
  position: relative;
  background: #fdfaf2;
  color: #2b231d;
  padding: 18px 16px 20px;
  border-radius: 4px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65);
  font-family: var(--font-mono);
  margin-bottom: 12px;
  clip-path: polygon(
    0% 0%, 100% 0%, 100% 98.4%,
    97% 100%, 94% 98.4%, 91% 100%, 88% 98.4%, 85% 100%, 82% 98.4%, 79% 100%,
    76% 98.4%, 73% 100%, 70% 98.4%, 67% 100%, 64% 98.4%, 61% 100%, 58% 98.4%,
    55% 100%, 52% 98.4%, 49% 100%, 46% 98.4%, 43% 100%, 40% 98.4%, 37% 100%,
    34% 98.4%, 31% 100%, 28% 98.4%, 25% 100%, 22% 98.4%, 19% 100%, 16% 98.4%,
    13% 100%, 10% 98.4%, 7% 100%, 4% 98.4%, 0% 100%
  );
}
.tp-head {
  text-align: center;
  border-bottom: 1.5px dashed #b9aa96;
  padding-bottom: 10px;
  margin-bottom: 10px;
}
.tp-store {
  font-family: var(--font-round);
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
}
.tp-meta { font-size: 10px; color: #7a6a58; margin-top: 3px; }

.tp-archetype {
  text-align: center;
  padding: 10px 8px;
  border-radius: 10px;
  background: #f3ead8;
  margin-bottom: 11px;
}
.tp-rarity {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  background: var(--clay-coral);
  color: #fff;
  margin-bottom: 4px;
}
.tp-rarity.ssr { background: linear-gradient(90deg, #d97706, #ef4444); }
.tp-title {
  font-family: var(--font-round);
  font-size: 15.5px;
  font-weight: 900;
  color: #2b1d14;
  line-height: 1.35;
}

.tp-items {
  border-bottom: 1.5px dashed #b9aa96;
  padding-bottom: 8px;
  margin-bottom: 9px;
  font-size: 11.5px;
}
.tp-item-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.tp-item-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-round);
  font-weight: 600;
}
.tp-item-left img { width: 22px; height: 22px; object-fit: contain; }

.tp-hesitation {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff4e0;
  border: 1px dashed #d69e4e;
  font-family: var(--font-round);
  font-size: 11.5px;
  line-height: 1.5;
  color: #5c3a16;
  margin-bottom: 10px;
}

.tp-bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
  margin-bottom: 10px;
  font-family: var(--font-round);
  font-size: 10.5px;
}
.tp-bar-track {
  height: 6px;
  border-radius: 99px;
  background: #e5dac6;
  overflow: hidden;
  margin-top: 2px;
}
.tp-bar-fill {
  height: 100%;
  background: var(--clay-coral);
  border-radius: 99px;
}

.tp-quote {
  font-family: var(--font-round);
  font-size: 12px;
  line-height: 1.62;
  color: #3d2d22;
  padding-top: 8px;
  border-top: 1.5px dashed #b9aa96;
  margin-bottom: 10px;
}

.tp-barcode {
  height: 34px;
  width: 82%;
  margin: 0 auto 4px;
  background: repeating-linear-gradient(
    90deg,
    #2b231d 0px, #2b231d 2px,
    transparent 2px, transparent 4px,
    #2b231d 4px, #2b231d 7px,
    transparent 7px, transparent 9px,
    #2b231d 9px, #2b231d 10px,
    transparent 10px, transparent 13px
  );
  opacity: 0.82;
}
.tp-code-num {
  text-align: center;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: #7c6d5c;
}

.receipt-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* ==========================================================================
   MODAL LAYER (3D Clay Item Card Flip, Basket Sheet, Codex)
   ========================================================================== */
.modal-layer {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(12, 9, 7, 0.8);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.clay-modal-card {
  width: 100%;
  max-height: 88%;
  overflow-y: auto;
  border-radius: 28px;
  padding: 18px 16px;
  background: linear-gradient(180deg, #fbf4e6 0%, #efe2cb 100%);
  color: var(--clay-ink);
  box-shadow:
    inset 0 4px 6px rgba(255, 255, 255, 0.85),
    inset 0 -6px 10px rgba(145, 114, 78, 0.32),
    0 24px 60px rgba(0, 0, 0, 0.72);
}

.inspect-stage {
  position: relative;
  height: 174px;
  border-radius: 20px;
  background: radial-gradient(circle at 50% 42%, #3a2b20 0%, #1d1510 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  perspective: 800px;
  overflow: hidden;
}
.inspect-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inspect-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}
.inspect-face.back {
  transform: rotateY(180deg);
  background: radial-gradient(circle at 50% 40%, #f6ead4, #e5d2b2);
  color: var(--clay-ink);
  text-align: left;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
}
.inspect-sprite {
  width: 132px;
  height: 132px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.55));
}

.toast-pill {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(42, 30, 22, 0.94);
  border: 1px solid rgba(246, 196, 83, 0.45);
  color: #fef3dc;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.58);
  white-space: nowrap;
}
