/* =====================================================
   Yiopop Mystery Box — Sports Energy Theme
   运动活力 · 霓虹光效 · 紫蓝粉渐变
   ===================================================== */

/* === CSS Variables === */
:root {
  /* Core palette */
  --deep-purple: #E9DDFF;
  --mid-purple: #C9A7FF;
  --bright-purple: #C9A7FF;
  --neon-pink: #FFB6C1;
  --neon-cyan: #7AA6FF;
  --energy-gold: #FFD58A;
  --energy-orange: #FFB6C1;

  /* Surfaces */
  --bg-deep: #E9DDFF;
  --bg-gradient: linear-gradient(170deg, #FFFFFF 0%, #E9DDFF 48%, #F8F3FF 100%);
  --bg-surface: rgba(255, 255, 255, 0.72);
  --bg-card: rgba(255, 255, 255, 0.86);
  --bg-card-hover: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, 0.78);

  /* Text */
  --text-primary: #332947;
  --text-secondary: #746782;
  --text-muted: #9b8aa9;

  /* Borders */
  --border-subtle: rgba(201, 167, 255, 0.22);
  --border-card: rgba(201, 167, 255, 0.3);
  --border-glow: rgba(201, 167, 255, 0.3);
  --border-neon: rgba(122, 166, 255, 0.34);

  /* Glows */
  --glow-pink: 0 12px 28px rgba(201, 167, 255, 0.26);
  --glow-purple: 0 18px 42px rgba(201, 167, 255, 0.2);
  --glow-cyan: 0 12px 26px rgba(122, 166, 255, 0.22);
  --glow-gold: 0 12px 28px rgba(255, 213, 138, 0.36);

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #C9A7FF 0%, #FFB6C1 62%, #FFFFFF 100%);
  --gradient-hero: linear-gradient(135deg, #FFFFFF 0%, #E9DDFF 40%, #C9A7FF 68%, #FFB6C1 100%);
  --gradient-gold: linear-gradient(135deg, #FFD58A 0%, #FFB6C1 100%);
  --gradient-card: linear-gradient(160deg, #FFFFFF, #fbf7ff);
  --gradient-won: linear-gradient(160deg, #FFFFFF, #fff7fb);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  --bottom-bar-height: 72px;
  --safe-bottom: env(safe-area-inset-bottom, 12px);
}

/* === Reset & Base === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
  overflow-x: hidden;
}

/* Animated gradient background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 0%, rgba(255, 45, 120, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 0%, rgba(108, 60, 240, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 80%, rgba(0, 212, 240, 0.06) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
  animation: bgPulse 8s ease-in-out infinite alternate;
}

@keyframes bgPulse {
  0% { opacity: 0.7; }
  100% { opacity: 1; }
}

/* =====================================================
   POSTER PAGE
   ===================================================== */
.poster-page {
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  display: grid;
  place-items: center;
  background: #090512;
}

.poster-page::before { display: none; }

.poster-stage {
  position: relative;
  width: min(100vw, 480px);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: #120a24;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.45);
}

.poster-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, #0E0628 0%, #1A1050 35%, #281478 70%, #150838 100%);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  z-index: 0;
}

.poster-bg.has-image {
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
}

.poster-bg::before {
  display: none;
}

.poster-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(42px + var(--safe-bottom));
  z-index: 2;
  text-align: center;
  padding: 0 28px;
  animation: fadeInUp 0.8s ease-out;
}

.poster-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 18px 52px;
  font-size: 20px;
  font-weight: 800;
  font-family: var(--font);
  letter-spacing: 3px;
  background: var(--gradient-primary);
  color: #FFFFFF;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: var(--glow-pink);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.poster-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.2) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.poster-btn:active {
  transform: scale(0.95);
  box-shadow: 0 0 40px rgba(255, 45, 120, 0.5);
}

.poster-btn:active::after {
  transform: translateX(100%);
}

.poster-btn-icon {
  font-size: 26px;
  animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* =====================================================
   TOP BAR
   ===================================================== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(14, 6, 40, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border-subtle);
}

.top-logo {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 6px;
  filter: drop-shadow(0 0 6px rgba(255, 45, 120, 0.4));
}

.top-brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--text-primary);
  background: linear-gradient(135deg, #C4B5FD, #FF6B9D);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.main-content {
  position: relative;
  z-index: 1;
  padding-bottom: 20px;
}

/* =====================================================
   PRIZE IMAGE CAROUSEL
   ===================================================== */
.carousel-section {
  position: relative;
  width: 100%;
  aspect-ratio: 750 / 350;
  max-height: 260px;
  overflow: hidden;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  width: 100%;
  height: 100%;
  scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  scroll-snap-align: start;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #150838, #1A1050);
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1A1050, #150838);
  color: var(--text-muted);
}

.carousel-slide-placeholder .ph-icon {
  font-size: 64px;
  margin-bottom: 12px;
  opacity: 0.7;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.carousel-slide-placeholder .ph-text {
  font-size: 15px;
  letter-spacing: 3px;
  opacity: 0.6;
  font-weight: 700;
}

/* Carousel dots */
.carousel-dots {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 5;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  transition: all 0.3s ease;
  cursor: pointer;
}

.carousel-dot.active {
  width: 24px;
  border-radius: 4px;
  background: var(--neon-pink);
  box-shadow: 0 0 10px rgba(255, 45, 120, 0.6);
}

/* Carousel slide prize label */
.carousel-slide-label {
  position: absolute;
  bottom: 48px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(20, 10, 50, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 6px 18px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2px;
  color: var(--text-primary);
  border: 1px solid rgba(255, 45, 120, 0.3);
  white-space: nowrap;
}

/* =====================================================
   ACTIVITY INFO
   ===================================================== */
.activity-info {
  padding: 20px 20px 8px;
  text-align: center;
}

.activity-title {
  font-size: 28px;
  font-weight: 900;
  letter-spacing: 2px;
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
  filter: drop-shadow(0 0 12px rgba(255, 45, 120, 0.2));
}

.activity-meta {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 10px;
}

.duration-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.duration-badge.ending-soon {
  border-color: rgba(255, 45, 120, 0.5);
  color: #FF8FAA;
  animation: pulse-badge 1.5s ease-in-out infinite;
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; border-color: rgba(255, 45, 120, 0.5); }
  50% { opacity: 0.7; border-color: rgba(255, 215, 64, 0.7); }
}

.badge-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--neon-pink);
}

.activity-desc {
  font-size: 14px;
  color: var(--text-secondary);
  letter-spacing: 1px;
  line-height: 1.8;
  padding: 16px 20px;
  margin-top: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

/* =====================================================
   THEME PRODUCTS
   ===================================================== */
.theme-section {
  padding: 10px 16px 18px;
}

.theme-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 0 12px;
  scrollbar-width: none;
}

.theme-tabs::-webkit-scrollbar { display: none; }

.theme-tab {
  flex: 0 0 auto;
  min-width: 76px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-card);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.theme-tab.active {
  color: #fff;
  border-color: rgba(255, 45, 120, 0.65);
  background: linear-gradient(135deg, rgba(255, 45, 120, 0.95), rgba(255, 109, 58, 0.92));
  box-shadow: 0 8px 22px rgba(255, 45, 120, 0.22);
}

.theme-panel {
  border: 1px solid var(--border-card);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
  padding: 14px;
}

.theme-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.theme-summary h2 {
  font-size: 18px;
  line-height: 1.25;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.theme-summary p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.points-chip {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-width: 84px;
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 17px;
  background: rgba(255, 215, 64, 0.14);
  color: #FFD740;
  font-size: 12px;
  font-weight: 900;
}

.product-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 112px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.product-strip::-webkit-scrollbar { display: none; }

.product-card {
  min-height: 162px;
  border-radius: 12px;
  background: rgba(10, 6, 30, 0.52);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 8px;
}

.product-image {
  width: 96px;
  height: 96px;
  border-radius: 10px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.08);
  color: var(--neon-pink);
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-name {
  min-height: 34px;
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  overflow: hidden;
}

.product-meta {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  color: var(--text-muted);
  font-size: 11px;
  margin-top: 6px;
}

/* =====================================================
   DRAW SECTION
   ===================================================== */
.draw-section {
  padding: 8px 20px 0;
}

.draw-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon { font-size: 22px; }

.draw-count-badge {
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: 20px;
  padding: 6px 16px;
}

.draw-count-badge strong {
  color: var(--neon-cyan);
  font-size: 17px;
  font-weight: 800;
}

.draw-hint {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 16px;
  transition: all 0.3s;
}

.draw-hint.ready {
  color: var(--energy-gold);
  font-weight: 600;
  text-shadow: 0 0 12px rgba(255, 215, 64, 0.3);
}

/* === Blind Box Grid === */
.box-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 4px 8px;
}

@media (min-width: 420px) {
  .box-grid { grid-template-columns: repeat(6, 1fr); }
}
@media (min-width: 600px) {
  .box-grid { grid-template-columns: repeat(8, 1fr); }
}
@media (max-width: 350px) {
  .box-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
}

/* Blind box card */
.mystery-box {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--gradient-card);
  border: 1.5px solid var(--border-card);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.mystery-box.lit {
  border-color: rgba(108, 60, 240, 0.5);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.3),
    0 0 16px rgba(108, 60, 240, 0.25);
}

.mystery-box.lit::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 40%, rgba(108, 60, 240, 0.15) 0%, transparent 70%);
  opacity: 1;
  transition: opacity 0.4s;
}

/* Dimmed */
.mystery-box.dimmed {
  border-color: rgba(255, 255, 255, 0.04);
  background: rgba(10, 6, 30, 0.5);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
  cursor: not-allowed;
  pointer-events: none;
}

.mystery-box.dimmed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  border-radius: inherit;
}

/* Box image */
.box-image-wrapper {
  position: relative;
  z-index: 1;
  width: 85%;
  height: 85%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.4s;
}

.box-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.lit .box-image-wrapper {
  filter: drop-shadow(0 0 10px rgba(108, 60, 240, 0.5));
}

.dimmed .box-image-wrapper {
  opacity: 0.15;
  filter: none;
}

/* Fallback SVG icon */
.box-icon-svg {
  width: 32px;
  height: 32px;
}

.box-icon-svg .icon-shape {
  fill: none;
  stroke: #A78BFA;
  stroke-width: 1.8;
  transition: all 0.4s;
}

.lit .box-icon-svg .icon-shape { stroke: #C4B5FD; }
.dimmed .box-icon-svg .icon-shape { stroke: #3A3A4A; }

/* Tap feedback */
.mystery-box.lit:active {
  transform: scale(0.93);
  border-color: var(--neon-pink);
  box-shadow: var(--glow-pink);
}

/* Shaking */
.mystery-box.shaking {
  animation: boxShake 0.35s ease-in-out 4;
  border-color: var(--energy-gold) !important;
  box-shadow: var(--glow-gold) !important;
}

@keyframes boxShake {
  0%, 100% { transform: translateX(0) rotate(0); }
  20% { transform: translateX(-5px) rotate(-2deg); }
  40% { transform: translateX(5px) rotate(2deg); }
  60% { transform: translateX(-3px) rotate(-1deg); }
  80% { transform: translateX(3px) rotate(1deg); }
}

/* Reveal */
.mystery-box.revealing {
  animation: boxReveal 0.6s ease-out forwards;
}

@keyframes boxReveal {
  0% { transform: perspective(400px) rotateY(0); }
  45% { transform: perspective(400px) rotateY(95deg); }
  55% { transform: perspective(400px) rotateY(95deg); }
  100% { transform: perspective(400px) rotateY(0); }
}

/* Won */
.mystery-box.won {
  border-color: var(--energy-gold) !important;
  box-shadow: var(--glow-gold) !important;
  background: var(--gradient-won) !important;
}

.mystery-box.won .box-icon-svg .icon-shape { stroke: #FFD740; }

/* =====================================================
   RULES SECTION
   ===================================================== */
.rules-section {
  margin: 24px 20px;
  padding: 18px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.rules-title {
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: 2px;
  font-weight: 700;
}

.rules-list { list-style: none; padding: 0; }

.rules-list li {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 2.2;
  padding-left: 18px;
  position: relative;
}

.rules-list li::before {
  content: '⚡';
  position: absolute;
  left: 0;
  font-size: 10px;
  opacity: 0.7;
}

/* =====================================================
   BOTTOM BAR
   ===================================================== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  display: flex;
  gap: 8px;
  padding: 10px 16px;
  padding-bottom: calc(10px + var(--safe-bottom));
  background: rgba(14, 6, 40, 0.94);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(255, 45, 120, 0.15);
}

.bottom-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 54px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: all 0.25s;
  padding: 10px 8px;
  -webkit-tap-highlight-color: transparent;
}

.bottom-btn:active { transform: scale(0.96); }

.bottom-btn svg {
  width: 22px;
  height: 22px;
}

.bottom-btn-secondary {
  flex: 1;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}

.bottom-btn-secondary:active {
  background: var(--bg-card-hover);
  border-color: rgba(255, 45, 120, 0.3);
}

.bottom-btn-primary {
  flex: 1.15;
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: var(--glow-pink);
  position: relative;
  overflow: hidden;
}

.bottom-btn.active {
  outline: 2px solid rgba(255, 215, 64, 0.78);
  color: #fff;
}

.bottom-btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 35%, rgba(255,255,255,0.15) 50%, transparent 65%);
  transform: translateX(-100%);
  transition: transform 0.6s;
}

.bottom-btn-primary:active::after { transform: translateX(100%); }

/* Bottom spacer */
.bottom-spacer {
  height: calc(var(--bottom-bar-height) + var(--safe-bottom) + 20px);
}

/* =====================================================
   MODAL SYSTEM
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 4, 20, 0.8);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Bottom Sheet */
.modal-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(180deg, #1E1650, #150C3A);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 16px 20px 28px;
  padding-bottom: calc(28px + var(--safe-bottom));
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 501;
  border-top: 1px solid rgba(255, 45, 120, 0.2);
}

.modal-overlay.active .modal-sheet { transform: translateY(0); }
.modal-sheet-tall { max-height: 75vh; }

.modal-handle {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  margin: 0 auto 18px;
  flex-shrink: 0;
}

.modal-sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.modal-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Code Input */
.modal-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  margin-bottom: 20px;
}

.code-input-wrapper { margin-bottom: 14px; }

.code-input {
  width: 100%;
  padding: 14px 16px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 8px;
  text-align: center;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid var(--border-card);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: all 0.3s;
  font-family: 'SF Mono', 'Consolas', 'Courier New', monospace;
}

.code-input:focus {
  border-color: var(--neon-pink);
  box-shadow: 0 0 0 4px rgba(255, 45, 120, 0.1);
}

.code-input::placeholder {
  letter-spacing: 1px;
  font-size: 15px;
  font-weight: 400;
  color: var(--text-muted);
}

.error-msg {
  color: #FF6B7A;
  font-size: 13px;
  text-align: center;
  margin-bottom: 8px;
  min-height: 20px;
}

.modal-btn {
  display: block;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.2s;
  font-family: var(--font);
}

.modal-btn:active { transform: scale(0.97); }

.modal-btn-confirm {
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: var(--glow-pink);
  margin-bottom: 8px;
}

.modal-btn-cancel {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-card);
}

.claim-form {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
}

.form-input {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  border: 1px solid var(--border-card);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  font-size: 15px;
  font-family: var(--font);
  outline: none;
}

.form-input:focus {
  border-color: rgba(255, 45, 120, 0.7);
  box-shadow: 0 0 0 3px rgba(255, 45, 120, 0.12);
}

.form-textarea {
  min-height: 88px;
  resize: vertical;
}

.points-balance-card {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 16px;
  background: rgba(255, 215, 64, 0.12);
  color: var(--energy-gold);
  font-size: 14px;
  font-weight: 800;
}

.points-balance-card strong {
  font-size: 28px;
}

/* Close button */
.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: transparent;
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.modal-close-btn:active {
  background: var(--bg-card);
  color: var(--neon-pink);
}

/* Result Card */
.modal-card {
  background: linear-gradient(160deg, #1E1650, #251878);
  border: 1px solid rgba(255, 45, 120, 0.3);
  border-radius: var(--radius-lg);
  padding: 40px 28px;
  text-align: center;
  max-width: 340px;
  width: 88%;
  box-shadow: var(--glow-purple);
  transform: translateY(30px) scale(0.95);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  z-index: 501;
}

.modal-overlay.active .modal-card {
  transform: translateY(0) scale(1);
}

.auth-card .modal-btn-cancel {
  margin-top: 8px;
}

.modal-emoji {
  font-size: 72px;
  display: block;
  margin-bottom: 16px;
  animation: popIn 0.5s ease-out;
}

@keyframes popIn {
  0% { transform: scale(0) rotate(-10deg); opacity: 0; }
  60% { transform: scale(1.2) rotate(3deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

.modal-result-title {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 10px;
  letter-spacing: 1px;
}

.modal-prize-name {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: 2px;
  background: var(--gradient-gold);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 14px 0;
  filter: drop-shadow(0 0 12px rgba(255, 215, 64, 0.3));
}

.modal-result-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.modal-btn-result {
  display: block;
  width: 100%;
  padding: 14px 32px;
  font-size: 16px;
  font-weight: 800;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  letter-spacing: 2px;
  transition: all 0.2s;
  font-family: var(--font);
  background: var(--gradient-primary);
  color: #FFFFFF;
  box-shadow: var(--glow-pink);
}

.modal-btn-result:active { transform: scale(0.97); }

/* =====================================================
   LIST ITEMS
   ===================================================== */
.record-item, .prize-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  transition: all 0.2s;
}

.record-item:active, .prize-item:active {
  background: rgba(255, 45, 120, 0.06);
  border-color: rgba(255, 45, 120, 0.2);
}

.record-icon, .prize-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.record-icon.win, .prize-icon.win {
  background: rgba(255, 215, 64, 0.15);
}

.record-icon.lose {
  background: rgba(180, 160, 255, 0.08);
}

.record-info, .prize-info { flex: 1; min-width: 0; }

.record-prize, .prize-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.record-date, .prize-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.record-status, .prize-status {
  font-size: 12px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 12px;
  flex-shrink: 0;
}

.record-status.win, .prize-status.win {
  background: rgba(255, 215, 64, 0.15);
  color: var(--energy-gold);
}

.claim-btn {
  flex: 0 0 auto;
  min-width: 58px;
  height: 32px;
  border: 0;
  border-radius: 16px;
  background: var(--gradient-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(255, 45, 120, 0.22);
}

.claim-all-btn {
  width: 100%;
  min-height: 42px;
  margin-bottom: 10px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(255, 215, 64, 0.95), rgba(255, 109, 58, 0.95));
  color: #221100;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(255, 180, 40, 0.2);
}

.point-order-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border-subtle);
}

.point-order-item strong,
.point-order-item span,
.point-order-item em {
  display: block;
}

.point-order-item span,
.point-order-item em {
  color: var(--text-muted);
  font-size: 12px;
  font-style: normal;
}

.record-status.lose {
  background: rgba(180, 160, 255, 0.08);
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 52px;
  margin-bottom: 14px;
  opacity: 0.5;
  animation: float 3s ease-in-out infinite;
}

.empty-state .empty-text {
  font-size: 14px;
  line-height: 1.6;
}

/* =====================================================
   CONFETTI
   ===================================================== */
.confetti-container {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 600;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(-10vh) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(720deg); opacity: 0; }
}

/* =====================================================
   SPINNER
   ===================================================== */
.spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 2.5px solid var(--border-card);
  border-top-color: var(--neon-pink);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   ANIMATIONS
   ===================================================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (min-width: 480px) {
  .carousel-section {
    max-height: 240px;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    margin: 0 16px;
    overflow: hidden;
  }

  .carousel-section .carousel-track {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }

  .box-grid { gap: 10px; }

  .bottom-bar {
    max-width: 480px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  }

  body {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .main-content, .top-bar {
    max-width: 480px;
    width: 100%;
  }

}

@media (max-width: 360px) {
  .activity-title { font-size: 22px; }
  .box-image-wrapper { width: 75%; height: 75%; }
}

/* =====================================================
   VISUAL REFRESH — Yiopop Gift Blind Box
   ===================================================== */
:root {
  --yiopop-purple: #C9A7FF;
  --yiopop-bg: #E9DDFF;
  --yiopop-card: #FFFFFF;
  --sport-blue: #7AA6FF;
  --active-pink: #FFB6C1;
  --rare-gold: #FFD58A;
  --cream: #fffdf7;
  --paper: #fffaf0;
  --soft-yellow: var(--rare-gold);
  --lavender: var(--yiopop-purple);
  --lavender-deep: #8b62d5;
  --mint: #d7f1df;
  --ink: #332947;
  --line: rgba(201, 167, 255, 0.3);
  --shadow-soft: 0 18px 48px rgba(119, 84, 180, 0.13);
  --shadow-tight: 0 8px 24px rgba(119, 84, 180, 0.1);
  --bg-deep: var(--yiopop-bg);
  --bg-card: rgba(255, 255, 255, 0.86);
  --bg-card-hover: var(--yiopop-card);
  --bg-surface: #f6f0ff;
  --text-primary: var(--ink);
  --text-secondary: #746782;
  --text-muted: #9b8aa9;
  --border-card: rgba(201, 167, 255, 0.3);
  --border-subtle: rgba(201, 167, 255, 0.22);
  --gradient-primary: linear-gradient(135deg, var(--yiopop-purple) 0%, var(--active-pink) 62%, var(--yiopop-card) 100%);
  --gradient-gold: linear-gradient(135deg, var(--rare-gold) 0%, var(--active-pink) 100%);
  --gradient-card: linear-gradient(180deg, var(--yiopop-card) 0%, #fbf7ff 100%);
  --glow-pink: 0 12px 28px rgba(201, 167, 255, 0.26);
  --glow-purple: 0 18px 42px rgba(201, 167, 255, 0.2);
  --glow-gold: 0 12px 28px rgba(255, 213, 138, 0.36);
}

body {
  background:
    radial-gradient(circle at 18% 8%, rgba(255, 182, 193, 0.28), transparent 32%),
    radial-gradient(circle at 88% 14%, rgba(122, 166, 255, 0.24), transparent 34%),
    linear-gradient(180deg, #fbf8ff 0%, var(--yiopop-bg) 100%);
  color: var(--ink);
}

body::before {
  background:
    radial-gradient(ellipse at 20% 20%, rgba(255,255,255,0.64), transparent 34%),
    linear-gradient(135deg, transparent 0 36px, rgba(255,255,255,0.18) 37px, transparent 38px),
    linear-gradient(-35deg, transparent 0 52px, rgba(122,166,255,0.12) 53px, transparent 54px);
  animation: none;
}

.poster-page {
  background:
    linear-gradient(90deg, rgba(245,234,167,0.78) 0 4%, transparent 4% 96%, rgba(245,234,167,0.78) 96%),
    #fffdf7;
}

.poster-stage {
  background: #fffdf7;
  border-left: 1px solid rgba(118,81,161,0.08);
  border-right: 1px solid rgba(118,81,161,0.08);
  box-shadow: 0 0 80px rgba(118,81,161,0.16);
}

.poster-stage::before,
.poster-stage::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  z-index: 1;
  pointer-events: none;
  background-image:
    linear-gradient(45deg, rgba(245,234,167,0.92) 25%, transparent 25% 75%, rgba(245,234,167,0.92) 75%),
    linear-gradient(45deg, rgba(245,234,167,0.92) 25%, transparent 25% 75%, rgba(245,234,167,0.92) 75%);
  background-size: 44px 44px;
  background-position: 0 0, 22px 22px;
  opacity: 0.86;
}

.poster-stage::before { top: 0; }
.poster-stage::after { bottom: 0; }

.poster-bg {
  background-color: #fffdf7;
}

.poster-content {
  bottom: calc(28px + var(--safe-bottom));
}

.poster-btn {
  min-width: min(72vw, 310px);
  justify-content: center;
  border-radius: 999px;
  padding: 16px 34px;
  font-size: 17px;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(135deg, var(--yiopop-purple) 0%, var(--active-pink) 72%, var(--yiopop-card) 140%);
  box-shadow: 0 18px 34px rgba(201, 167, 255, 0.34);
}

.poster-btn-icon {
  animation: none;
  font-size: 22px;
}

.top-bar {
  background: rgba(255, 253, 247, 0.86);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 10px 24px rgba(118,81,161,0.08);
}

.top-logo {
  filter: none;
  border-radius: 50%;
}

.top-brand {
  color: var(--lavender-deep);
  background: none;
  -webkit-text-fill-color: currentColor;
  letter-spacing: 0.08em;
}

.main-content {
  background:
    linear-gradient(90deg, rgba(245,234,167,0.38) 0 4%, transparent 4% 96%, rgba(245,234,167,0.38) 96%),
    transparent;
}

.carousel-section {
  margin: 12px 14px 0;
  width: auto;
  min-height: 220px;
  border-radius: 16px;
  border: 1px solid rgba(118,81,161,0.14);
  background: var(--yiopop-card);
  box-shadow: var(--shadow-soft);
}

.carousel-section::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.42) 45%, rgba(233,221,255,0.2) 100%),
    radial-gradient(circle at 78% 18%, rgba(122,166,255,0.2), transparent 30%);
  pointer-events: none;
  z-index: 2;
}

.hero-info {
  position: absolute;
  left: 18px;
  right: 44%;
  bottom: 16px;
  z-index: 4;
  padding: 0;
  text-align: left;
}

.hero-info .activity-title {
  font-size: 22px;
  line-height: 1.18;
  margin-bottom: 10px;
}

.hero-info .activity-meta {
  justify-content: flex-start;
  margin-bottom: 0;
}

.carousel-slide {
  background: #fffdf7;
}

.carousel-slide img {
  object-fit: cover;
}

.carousel-dots {
  right: 14px;
  left: auto;
  bottom: 12px;
  transform: none;
  z-index: 5;
}

.carousel-dot {
  background: rgba(118,81,161,0.22);
}

.carousel-dot.active {
  background: var(--lavender);
  box-shadow: none;
}

.activity-info {
  padding: 18px 20px 6px;
}

.activity-title {
  color: var(--lavender-deep);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: 24px;
  letter-spacing: 0.02em;
  filter: none;
}

.duration-badge,
.draw-count-badge {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--lavender-deep);
  box-shadow: var(--shadow-tight);
}

.duration-badge.ending-soon {
  border-color: rgba(216,90,158,0.34);
  color: #b84683;
  animation: none;
}

.badge-icon {
  color: var(--lavender);
}

.theme-section {
  padding: 12px 14px 18px;
}

.theme-tab {
  height: 38px;
  border-radius: 999px;
  background: #fff;
  color: var(--lavender-deep);
  border: 1px solid var(--line);
  box-shadow: 0 6px 16px rgba(118,81,161,0.07);
}

.theme-tab.active {
  background: var(--lavender-deep);
  border-color: var(--lavender-deep);
  color: #fff;
  box-shadow: 0 10px 22px rgba(118,81,161,0.22);
}

.theme-panel,
.rules-section {
  background: rgba(255,255,255,0.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.theme-summary h2,
.section-title {
  color: var(--ink);
}

.theme-summary p {
  color: var(--text-secondary);
}

.points-chip {
  color: #6f5b15;
  background: rgba(245,234,167,0.72);
  border: 1px solid rgba(218,190,72,0.38);
}

.product-strip {
  grid-auto-columns: 118px;
}

.product-card {
  position: relative;
  background: #fff;
  border-color: rgba(118,81,161,0.13);
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(118,81,161,0.08);
}

.rarity-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  color: #fff;
  box-shadow: 0 8px 18px rgba(118,81,161,0.16);
}

.product-card .rarity-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
}

.rarity-S { background: linear-gradient(135deg, #ffd58a, #ff9fb5); color: #593b12; }
.rarity-A { background: linear-gradient(135deg, #c9a7ff, #ffb6c1); }
.rarity-B { background: linear-gradient(135deg, #7aa6ff, #c9a7ff); }
.rarity-C { background: linear-gradient(135deg, #c7ead2, #7aa6ff); color: #27535d; }
.rarity-D { background: linear-gradient(135deg, #d8d1e2, #b9adc8); color: #4d4358; }

.product-image {
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  background: #fff8df;
  color: var(--lavender);
}

.product-name {
  color: var(--ink);
}

.draw-section {
  padding: 12px 16px 0;
}

.draw-hint {
  color: var(--text-secondary);
}

.draw-hint.ready {
  color: var(--lavender-deep);
  text-shadow: none;
}

.box-grid {
  gap: 10px;
  padding: 6px 0;
}

.mystery-box {
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fff6cf 100%);
  border: 1px solid rgba(118,81,161,0.16);
  box-shadow: 0 10px 24px rgba(118,81,161,0.1);
}

.mystery-box.lit {
  border-color: rgba(169,133,198,0.42);
  box-shadow: 0 10px 24px rgba(118,81,161,0.12);
}

.mystery-box.lit::before {
  background:
    radial-gradient(circle at 30% 24%, rgba(245,234,167,0.62), transparent 34%),
    radial-gradient(circle at 70% 76%, rgba(199,234,210,0.46), transparent 38%);
}

.mystery-box.lit::after {
  content: '';
  position: absolute;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  border: 1px solid rgba(201,167,255,0.38);
  transform: scale(0.82);
  opacity: 0;
}

.mystery-box.shaking::after {
  animation: softRing 0.8s ease-out infinite;
}

@keyframes softRing {
  0% { transform: scale(0.7); opacity: 0.6; }
  100% { transform: scale(1.18); opacity: 0; }
}

.mystery-box.dimmed {
  background: #eee9f1;
  border-color: rgba(118,81,161,0.08);
}

.mystery-box.dimmed::after {
  background: rgba(255,255,255,0.58);
}

.lit .box-image-wrapper {
  filter: drop-shadow(0 8px 12px rgba(118,81,161,0.16));
}

.mystery-box.lit:active {
  border-color: var(--lavender-deep);
  box-shadow: 0 12px 28px rgba(118,81,161,0.24);
}

.mystery-box.won {
  border-color: rgba(218,190,72,0.66) !important;
  background: linear-gradient(180deg, #fff9da 0%, #fff 100%) !important;
  box-shadow: var(--glow-gold) !important;
}

.rules-title,
.rules-list li {
  color: var(--text-secondary);
}

.rules-list li::before {
  color: var(--lavender);
}

.bottom-bar {
  background: rgba(255,253,247,0.94);
  border-top: 1px solid var(--line);
  box-shadow: 0 -14px 36px rgba(118,81,161,0.12);
}

.bottom-btn {
  border-radius: 16px;
  letter-spacing: 0;
}

.bottom-btn-secondary {
  background: #fff;
  color: var(--lavender-deep);
  border-color: var(--line);
}

.bottom-btn-primary {
  background: linear-gradient(135deg, #805bb5 0%, #d85a9e 100%);
  box-shadow: 0 12px 24px rgba(128,91,181,0.22);
}

.bottom-btn.active {
  outline: 2px solid rgba(240,214,111,0.95);
}

.modal-overlay {
  background: rgba(51,41,71,0.34);
}

.modal-sheet,
.modal-card {
  background: #fffdf7;
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.result-prize-card {
  position: relative;
  width: 180px;
  min-height: 180px;
  margin: 0 auto 18px;
  display: grid;
  place-items: center;
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.86), rgba(233,221,255,0.8)),
    radial-gradient(circle at 50% 84%, rgba(255,213,138,0.45), transparent 46%);
  box-shadow: 0 24px 56px rgba(118,81,161,0.18);
  overflow: hidden;
}

.result-prize-card::before {
  content: '';
  position: absolute;
  inset: -30%;
  background: conic-gradient(from 40deg, transparent, rgba(201,167,255,0.28), transparent, rgba(255,182,193,0.26), transparent);
  animation: resultSpin 8s linear infinite;
}

@keyframes resultSpin {
  to { transform: rotate(360deg); }
}

.result-prize-card img,
.result-prize-card .modal-emoji {
  position: relative;
  z-index: 1;
}

.result-prize-card img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  filter: drop-shadow(0 18px 22px rgba(71,45,93,0.18));
}

.result-prize-card .rarity-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

.modal-handle {
  background: rgba(118,81,161,0.24);
}

.modal-title,
.modal-result-title {
  color: var(--ink);
}

.modal-desc,
.modal-result-subtitle {
  color: var(--text-secondary);
}

.code-input,
.form-input {
  background: #fff;
  color: var(--ink);
  border-color: var(--line);
}

.code-input:focus,
.form-input:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 3px rgba(169,133,198,0.16);
}

.modal-btn-confirm,
.modal-btn-result,
.claim-btn {
  background: linear-gradient(135deg, #805bb5 0%, #d85a9e 100%);
  box-shadow: 0 12px 24px rgba(128,91,181,0.22);
}

.modal-btn-cancel {
  color: var(--lavender-deep);
  border-color: var(--line);
}

.record-item,
.prize-item {
  background: #fff;
  border-color: var(--line);
  border-radius: 14px;
}

.record-prize,
.prize-name {
  color: var(--ink);
}

.record-status.win,
.prize-status.win {
  background: rgba(245,234,167,0.72);
  color: #6f5b15;
}

.record-status.lose {
  background: #f0edf4;
  color: var(--text-muted);
}

.empty-state {
  color: var(--text-secondary);
}

/* Token enforcement: soft sport-lifestyle theme */
.app-container,
.code-panel,
.records-panel,
.myprizes-panel,
.claim-panel,
.points-panel,
.result-card,
.modal-content,
.modal-card {
  background: var(--yiopop-card);
  color: var(--ink);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
}

.bottom-bar,
.bottom-nav {
  background: rgba(255, 255, 255, 0.9);
  border-top-color: var(--line);
  box-shadow: 0 -14px 36px rgba(201, 167, 255, 0.18);
}

.bottom-btn,
.bottom-nav-btn,
.code-mode-btn,
.claim-trigger-btn,
.modal-btn-secondary,
.modal-btn-cancel {
  background: var(--yiopop-card);
  color: var(--lavender-deep);
  border-color: var(--line);
}

.bottom-btn.active,
.bottom-btn.primary,
.bottom-nav-btn.active,
.bottom-nav-btn.primary,
.code-mode-btn.active,
.claim-trigger-btn.primary,
.modal-btn-confirm,
.modal-btn-primary,
.modal-btn-result,
.btn-submit-code,
.btn-submit-claim,
.claim-btn {
  background: var(--gradient-primary);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 12px 28px rgba(201, 167, 255, 0.28);
}

.code-input,
.form-input,
.claim-input,
.points-input,
.modal-input,
input,
select,
textarea {
  background: var(--yiopop-card);
  color: var(--ink);
  border-color: var(--line);
}

.code-input:focus,
.form-input:focus,
.claim-input:focus,
.points-input:focus,
.modal-input:focus,
input:focus,
select:focus,
textarea:focus {
  border-color: var(--yiopop-purple);
  box-shadow: 0 0 0 3px rgba(201, 167, 255, 0.18);
}

.modal-overlay,
.modal-backdrop,
.code-modal,
.records-modal,
.myprizes-modal,
.claim-modal,
.points-modal,
.result-modal {
  background: rgba(51, 41, 71, 0.32);
  backdrop-filter: blur(10px);
}

/* =====================================================
   Visual Target Step 1: Cream Draw Section + Box Grid
   ===================================================== */
:root {
  --yp-white: #ffffff;
  --yp-cream: #fff3c8;
  --yp-cream-soft: #fff9e8;
  --yp-cream-light: #fffdf5;
  --yp-yellow: #f6c85f;
  --yp-yellow-deep: #dca846;
  --yp-purple: #c9a7ff;
  --yp-purple-soft: #efe4ff;
  --yp-purple-deep: #8b63c7;
  --yp-blue: #a8c7ff;
  --yp-pink: #ffcbdc;
  --yp-text: #241b35;
  --yp-text-soft: #5f566d;
  --yp-muted: #91869d;
  --yp-card: rgba(255, 255, 255, 0.94);
  --yp-border: rgba(236, 205, 136, 0.52);
  --yp-shadow-soft: 0 14px 32px rgba(176, 132, 62, 0.14);
  --yp-shadow-card: 0 10px 24px rgba(164, 128, 72, 0.12);
  --yp-radius-xl: 26px;
  --yp-radius-lg: 22px;
  --yp-radius-md: 16px;
  --yp-radius-sm: 12px;
}

.draw-section {
  position: relative;
  margin: 18px 12px 18px;
  padding: 18px 14px 20px;
  border-radius: var(--yp-radius-xl);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 243, 200, 0.9), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(255, 249, 232, 0.92));
  border: 1px solid var(--yp-border);
  box-shadow: var(--yp-shadow-soft);
  overflow: hidden;
}

.draw-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(120deg, transparent 0%, rgba(201, 167, 255, 0.11) 38%, transparent 72%),
    radial-gradient(circle at 90% 10%, rgba(201, 167, 255, 0.14), transparent 28%);
}

.draw-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.draw-header .section-title {
  margin: 0;
  font-size: 22px;
  font-weight: 950;
  color: var(--yp-text);
  letter-spacing: 0;
}

.draw-header .section-icon {
  margin-right: 6px;
}

.draw-count-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(246, 200, 95, 0.5);
  color: var(--yp-muted);
  font-size: 12px;
  box-shadow: 0 8px 18px rgba(174, 129, 61, 0.1);
  white-space: nowrap;
}

.draw-count-badge strong {
  color: var(--yp-purple-deep);
  font-size: 18px;
  font-weight: 950;
  letter-spacing: 0;
}

.count-icon {
  color: var(--yp-yellow);
  font-size: 14px;
}

.draw-hint {
  position: relative;
  z-index: 1;
  margin: 4px 0 16px;
  padding: 10px 12px;
  border-radius: var(--yp-radius-md);
  background: rgba(255, 249, 232, 0.92);
  border: 1px solid rgba(246, 200, 95, 0.34);
  color: #6c5d78;
  font-size: 13px;
  line-height: 1.45;
  text-shadow: none;
}

.draw-hint.ready {
  color: var(--yp-purple-deep);
  background: linear-gradient(135deg, var(--yp-cream-soft), var(--yp-purple-soft));
  border-color: rgba(201, 167, 255, 0.32);
}

.box-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px 10px;
  padding: 6px 0 2px;
}

@media (min-width: 420px) {
  .box-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 600px) {
  .box-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px 16px;
  }
}

.mystery-box {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  aspect-ratio: auto;
  min-width: 0;
  min-height: 104px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  cursor: pointer;
  transition: transform 0.18s ease;
}

.blind-box-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 247, 220, 0.95));
  border: 1px solid rgba(241, 210, 148, 0.58);
  box-shadow:
    0 10px 22px rgba(180, 135, 72, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.blind-box-frame::after {
  content: none;
}

.box-index {
  position: absolute;
  z-index: 4;
  top: -6px;
  left: 2px;
  min-width: 26px;
  height: 22px;
  padding: 0 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: linear-gradient(180deg, var(--yp-purple), #b792ef);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 6px 12px rgba(139, 99, 199, 0.22);
}

.box-image-wrapper {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease, opacity 0.18s ease, filter 0.18s ease;
}

.box-image,
.blind-box-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 12px;
  filter: drop-shadow(0 10px 10px rgba(129, 92, 50, 0.14));
}

.box-icon-svg {
  width: 68%;
  height: 68%;
  filter: drop-shadow(0 10px 10px rgba(129, 92, 50, 0.12));
}

.box-icon-svg .icon-shape {
  stroke: var(--yp-yellow-deep);
}

.box-state-text {
  min-height: 16px;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--yp-purple-deep);
}

.mystery-box.lit {
  border: 0;
  box-shadow: none;
}

.mystery-box.lit::before,
.mystery-box.lit::after {
  content: none;
}

.mystery-box.lit .box-state-text::before {
  content: "可开启";
}

.mystery-box.lit:active {
  transform: translateY(-3px) scale(1.03);
  border-color: transparent;
  box-shadow: none;
}

.mystery-box.lit:active .blind-box-frame {
  border-color: rgba(201, 167, 255, 0.75);
  box-shadow:
    0 16px 30px rgba(180, 135, 72, 0.18),
    0 0 0 4px rgba(201, 167, 255, 0.14);
}

.mystery-box.shaking .blind-box-frame {
  animation: boxShakeCream 0.72s ease-in-out infinite;
}

.mystery-box.revealing .blind-box-frame {
  animation: boxRevealCream 0.45s ease-out both;
}

@keyframes boxShakeCream {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  25% { transform: translateY(-4px) rotate(-2deg); }
  50% { transform: translateY(1px) rotate(2deg); }
  75% { transform: translateY(-2px) rotate(-1deg); }
}

@keyframes boxRevealCream {
  0% { transform: scale(1); }
  60% { transform: scale(1.08); }
  100% { transform: scale(0.96); }
}

.mystery-box.dimmed {
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}

.mystery-box.dimmed::after {
  content: none;
}

.mystery-box.dimmed .blind-box-frame {
  background: linear-gradient(180deg, #f4f1ed, #e7e2da);
  border-color: rgba(180, 174, 166, 0.45);
  box-shadow: 0 8px 18px rgba(80, 70, 60, 0.08);
}

.mystery-box.dimmed .box-image-wrapper,
.mystery-box.dimmed .box-icon-svg {
  opacity: 0.52;
  filter: grayscale(1) drop-shadow(0 8px 8px rgba(80, 70, 60, 0.1));
}

.mystery-box.dimmed .box-state-text {
  color: #9a938b;
}

.mystery-box.dimmed .box-state-text::before {
  content: "已开启";
}

.mystery-box.won .blind-box-frame {
  border-color: rgba(246, 200, 95, 0.76);
  background: linear-gradient(180deg, #fff9da 0%, #fff 100%);
  box-shadow: var(--yp-shadow-card);
}

@media (max-width: 380px) {
  .box-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px 8px;
  }

  .blind-box-frame {
    border-radius: 15px;
    padding: 6px;
  }

  .draw-header .section-title {
    font-size: 20px;
  }

  .draw-count-badge strong {
    font-size: 16px;
  }
}

/* =====================================================
   Visual Target Step 2: TopBar + Banner + Theme + Prizes
   ===================================================== */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 16px;
  background: rgba(255, 253, 247, 0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(236, 205, 136, 0.28);
  box-shadow: none;
}

.top-logo {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 12px;
  background: var(--yp-white);
  box-shadow: 0 8px 18px rgba(174, 129, 61, 0.12);
}

.top-brand {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  color: var(--yp-text);
  background: none;
  -webkit-text-fill-color: currentColor;
}

.main-content {
  padding-left: 12px;
  padding-right: 12px;
  background: transparent;
}

.carousel-section {
  position: relative;
  margin: 14px 0 16px;
  min-height: 0;
  border-radius: var(--yp-radius-xl);
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255,249,232,0.86));
  box-shadow: var(--yp-shadow-soft);
  border: 1px solid rgba(236, 205, 136, 0.44);
}

.carousel-section::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,253,247,0.16) 46%, rgba(255,249,232,0.84) 100%),
    radial-gradient(circle at 90% 12%, rgba(201,167,255,0.16), transparent 28%);
}

.carousel-track {
  position: relative;
  width: 100%;
  min-height: 188px;
  height: 188px;
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: var(--yp-radius-xl);
  scroll-snap-type: x mandatory;
}

.carousel-slide {
  min-width: 100%;
  height: 188px;
  background:
    linear-gradient(135deg, var(--yp-purple-soft), var(--yp-cream-soft));
  scroll-snap-align: start;
}

.carousel-track img,
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carousel-slide-placeholder {
  height: 100%;
  border-radius: inherit;
  background:
    radial-gradient(circle at 18% 18%, rgba(255,255,255,0.82), transparent 32%),
    linear-gradient(135deg, var(--yp-purple-soft), var(--yp-cream-soft));
  color: var(--yp-purple-deep);
}

.carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 94px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 6px;
  transform: none;
}

.carousel-dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.72);
  box-shadow: 0 2px 8px rgba(91, 72, 48, 0.12);
}

.carousel-dot.active {
  width: 18px;
  background: var(--yp-cream);
  box-shadow: none;
}

.activity-info.hero-info {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: 4;
  margin: -28px 12px 12px;
  padding: 16px 16px 14px;
  text-align: center;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(236, 205, 136, 0.48);
  box-shadow: 0 12px 26px rgba(164, 128, 72, 0.13);
}

.activity-title,
.hero-info .activity-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.18;
  font-weight: 950;
  color: var(--yp-purple-deep);
  letter-spacing: 0;
  filter: none;
}

.activity-meta,
.hero-info .activity-meta {
  margin-top: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.duration-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 11px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--yp-cream-soft), var(--yp-purple-soft));
  color: var(--yp-purple-deep);
  font-size: 12px;
  font-weight: 800;
  border: 1px solid rgba(201, 167, 255, 0.32);
  box-shadow: none;
}

.badge-icon {
  color: var(--yp-purple-deep);
}

.theme-section {
  margin: 16px 0;
  padding: 0;
}

.theme-tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}

.theme-tabs::-webkit-scrollbar {
  display: none;
}

.theme-tab {
  flex: 0 0 auto;
  min-height: 38px;
  height: 38px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(236, 205, 136, 0.5);
  background: rgba(255, 255, 255, 0.78);
  color: var(--yp-text-soft);
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 8px 18px rgba(164, 128, 72, 0.08);
}

.theme-tab.active {
  color: var(--yp-text);
  background: linear-gradient(135deg, var(--yp-white), var(--yp-cream));
  border-color: rgba(246, 200, 95, 0.72);
  box-shadow: 0 12px 24px rgba(176, 132, 62, 0.14);
}

.theme-panel {
  border-radius: var(--yp-radius-xl);
  background: rgba(255,255,255,0.9);
  border: 1px solid rgba(236, 205, 136, 0.44);
  box-shadow: var(--yp-shadow-card);
  padding: 16px;
  overflow: hidden;
}

.theme-summary {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-radius: 20px;
  background:
    radial-gradient(circle at 8% 0%, rgba(255, 243, 200, 0.86), transparent 34%),
    linear-gradient(135deg, var(--yp-white), #fffaf0);
  border: 1px solid rgba(236, 205, 136, 0.4);
}

.theme-name,
.theme-summary h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 950;
  color: var(--yp-text);
  letter-spacing: 0;
}

.theme-description,
.theme-summary p {
  margin: 8px 0 0;
  font-size: 13px;
  color: var(--yp-text-soft);
  line-height: 1.5;
}

.points-chip,
.points-cost-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-top: 0;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 243, 200, 0.72);
  border: 1px solid rgba(246, 200, 95, 0.48);
  color: var(--yp-yellow-deep);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.product-strip,
.prize-list {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.product-strip::-webkit-scrollbar,
.prize-list::-webkit-scrollbar {
  display: none;
}

.product-card,
.prize-card {
  position: relative;
  flex: 0 0 132px;
  min-width: 132px;
  padding: 10px;
  border-radius: 20px;
  background: var(--yp-white);
  border: 1px solid rgba(236, 205, 136, 0.4);
  box-shadow: 0 10px 22px rgba(164, 128, 72, 0.1);
  overflow: hidden;
}

.product-card::before,
.prize-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,243,200,0.38), transparent 55%);
  pointer-events: none;
}

.product-image,
.prize-image {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: var(--yp-cream-soft);
  color: var(--yp-purple-deep);
  overflow: hidden;
}

.product-image img,
.prize-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.product-name {
  position: relative;
  z-index: 1;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 850;
  color: var(--yp-text);
  line-height: 1.3;
}

.product-meta,
.stock-info {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 11px;
  color: var(--yp-muted);
}

.rarity-tag,
.grade-tag {
  position: absolute;
  z-index: 2;
  top: 8px;
  left: 8px;
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  box-shadow: 0 8px 16px rgba(0,0,0,0.12);
}

.rarity-S,
.grade-s {
  background: linear-gradient(135deg, #f6c85f, #dca846);
  color: #fff;
}

.rarity-A,
.grade-a {
  background: linear-gradient(135deg, var(--yp-purple), var(--yp-purple-deep));
}

.rarity-B,
.grade-b {
  background: linear-gradient(135deg, var(--yp-blue), #6f9ee9);
}

.rarity-C,
.grade-c {
  background: linear-gradient(135deg, var(--yp-pink), #e89eb7);
}

.rarity-D,
.grade-d {
  background: linear-gradient(135deg, #bdb6aa, #8d857a);
}

/* =====================================================
   Visual Target Step 3: Bottom Navigation Dock
   ===================================================== */
.bottom-bar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 12px;
  width: min(calc(100vw - 24px), 456px);
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr) minmax(0, 0.8fr);
  gap: 10px;
  padding: 10px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid rgba(236, 205, 136, 0.48);
  box-shadow: 0 18px 40px rgba(122, 94, 48, 0.18);
}

.bottom-btn {
  min-width: 0;
  min-height: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 7px 4px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: rgba(255, 249, 232, 0.88);
  color: var(--yp-text-soft);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.15;
  letter-spacing: 0;
  box-shadow: none;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.bottom-btn svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.2;
}

.bottom-btn span {
  display: block;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-btn:active {
  transform: translateY(1px) scale(0.98);
}

.bottom-btn-secondary {
  flex: initial;
  background: rgba(255, 249, 232, 0.88);
  color: var(--yp-text-soft);
  border-color: rgba(236, 205, 136, 0.32);
}

.bottom-btn-secondary:active {
  background: var(--yp-cream-soft);
  border-color: rgba(246, 200, 95, 0.52);
}

.bottom-btn-primary,
#btn-draw-code {
  flex: initial;
  color: var(--yp-text);
  min-height: 62px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff4c9 0%, #ffffff 44%, #eadcff 100%);
  border-color: rgba(246, 200, 95, 0.68);
  box-shadow: 0 12px 24px rgba(176, 132, 62, 0.16), 0 6px 16px rgba(139, 99, 199, 0.10);
}

#btn-draw-code svg {
  width: 23px;
  height: 23px;
}

#btn-draw-code span {
  font-size: 13px;
  font-weight: 900;
}

.bottom-btn-primary::after {
  content: none;
}

.bottom-btn.active {
  outline: none;
  color: var(--yp-purple-deep);
  background: linear-gradient(135deg, var(--yp-purple-soft), var(--yp-cream-soft));
  border-color: rgba(201, 167, 255, 0.52);
  box-shadow: 0 10px 22px rgba(139, 99, 199, 0.14);
}

.bottom-spacer {
  height: calc(96px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 360px) {
  .bottom-bar {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    gap: 6px;
    padding: 8px;
    border-radius: 20px;
  }

  .bottom-btn {
    font-size: 11px;
    min-height: 46px;
  }

  .bottom-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* =====================================================
   Visual Target Step 4: Result + Sheet Modals
   ===================================================== */
.modal-overlay {
  background: rgba(45, 35, 54, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal-sheet {
  left: 50%;
  right: auto;
  bottom: 10px;
  width: min(calc(100vw - 24px), 456px);
  max-width: calc(100vw - 24px);
  max-height: min(76vh, 720px);
  box-sizing: border-box;
  transform: translate(-50%, calc(100% + 24px));
  padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  border-radius: 26px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 243, 200, 0.78), transparent 32%),
    rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(236, 205, 136, 0.48);
  box-shadow: 0 22px 52px rgba(96, 72, 36, 0.22);
  color: var(--yp-text);
  overflow: hidden;
}

.modal-overlay.active .modal-sheet {
  transform: translate(-50%, 0);
}

.modal-sheet-tall {
  max-height: min(82vh, 760px);
}

.modal-handle {
  width: 42px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: rgba(236, 205, 136, 0.72);
}

.modal-sheet-header {
  margin-bottom: 14px;
  padding: 0 2px;
}

.modal-sheet-body {
  padding-right: 2px;
}

.modal-title,
.modal-result-title {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
  text-align: center;
  color: var(--yp-text);
}

.modal-desc,
.modal-result-subtitle {
  color: var(--yp-text-soft);
  font-size: 13px;
  line-height: 1.55;
  text-align: center;
}

.modal-close-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(236, 205, 136, 0.52);
  background: rgba(255, 255, 255, 0.88);
  color: var(--yp-text-soft);
}

.modal-close-btn:active {
  background: var(--yp-cream-soft);
  color: var(--yp-purple-deep);
}

.code-input,
.form-input,
.claim-form input,
.claim-form textarea,
.claim-form select {
  width: 100%;
  min-height: 44px;
  box-sizing: border-box;
  border-radius: 14px;
  border: 1px solid rgba(236, 205, 136, 0.52);
  background: rgba(255, 255, 255, 0.92);
  color: var(--yp-text);
  padding: 10px 12px;
  outline: none;
  box-shadow: none;
}

.code-input {
  min-height: 52px;
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  font-weight: 850;
}

.code-input:focus,
.form-input:focus,
.claim-form input:focus,
.claim-form textarea:focus,
.claim-form select:focus {
  border-color: rgba(201, 167, 255, 0.8);
  box-shadow: 0 0 0 4px rgba(201, 167, 255, 0.13);
}

.modal-btn,
.modal-btn-result,
.claim-btn,
.claim-all-btn {
  border-radius: 999px;
  letter-spacing: 0;
}

.modal-btn-confirm,
.modal-btn-result,
.claim-btn {
  border: 0;
  background: linear-gradient(135deg, var(--yp-cream), var(--yp-purple-soft));
  color: var(--yp-text);
  font-weight: 900;
  box-shadow: 0 12px 24px rgba(176, 132, 62, 0.13);
}

.modal-btn-cancel {
  border: 1px solid rgba(236, 205, 136, 0.52);
  background: rgba(255, 255, 255, 0.88);
  color: var(--yp-text-soft);
}

.points-balance-card {
  border-radius: 20px;
  background:
    linear-gradient(135deg, var(--yp-cream-soft), var(--yp-purple-soft));
  border: 1px solid rgba(236, 205, 136, 0.46);
  color: var(--yp-text);
  box-shadow: var(--yp-shadow-card);
}

.points-balance-card strong {
  color: var(--yp-purple-deep);
}

.modal-card {
  width: min(calc(100vw - 48px), 340px);
  max-width: 340px;
  padding: 28px 24px 24px;
  border-radius: 26px;
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 243, 200, 0.82), transparent 34%),
    linear-gradient(180deg, #fff, var(--yp-cream-soft));
  border: 1px solid rgba(236, 205, 136, 0.52);
  box-shadow: 0 22px 52px rgba(96, 72, 36, 0.22);
  color: var(--yp-text);
}

.result-prize-card {
  width: min(190px, 62vw);
  min-height: 156px;
  margin: 0 auto 16px;
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,249,232,0.9)),
    radial-gradient(circle at 50% 84%, rgba(246,200,95,0.28), transparent 48%);
  border: 1px solid rgba(236, 205, 136, 0.46);
  box-shadow: var(--yp-shadow-card);
}

.result-prize-card::before {
  opacity: 0.5;
}

.result-prize-card img,
.result-prize-card .modal-emoji {
  max-width: 78%;
  max-height: 112px;
  object-fit: contain;
  filter: drop-shadow(0 14px 18px rgba(96,72,36,0.14));
}

.modal-prize-name {
  margin: 10px 0 8px;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: 0;
  color: var(--yp-text);
  background: none;
  -webkit-text-fill-color: currentColor;
  filter: none;
}

.record-item,
.prize-item,
.my-prize-card,
.point-order-item {
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(236, 205, 136, 0.42);
  box-shadow: 0 10px 22px rgba(164, 128, 72, 0.08);
}

.record-item,
.prize-item,
.my-prize-card {
  padding: 12px;
}

.record-icon,
.prize-icon {
  background: var(--yp-cream-soft);
}

.record-icon.win,
.prize-icon.win {
  background: rgba(255, 243, 200, 0.92);
}

.record-prize,
.prize-name {
  color: var(--yp-text);
  font-weight: 850;
}

.record-date,
.prize-date,
.point-order-item span,
.point-order-item em {
  color: var(--yp-muted);
}

.record-status.win,
.prize-status.win {
  background: rgba(255, 243, 200, 0.84);
  color: var(--yp-yellow-deep);
}

.record-status.lose {
  background: rgba(201, 167, 255, 0.12);
  color: var(--yp-muted);
}

.claim-all-btn {
  background: linear-gradient(135deg, var(--yp-cream), var(--yp-purple-soft));
  color: var(--yp-text);
  box-shadow: 0 10px 22px rgba(176, 132, 62, 0.12);
}

.point-order-item {
  margin-top: 8px;
  padding: 12px;
  border-bottom: 1px solid rgba(236, 205, 136, 0.42);
}

.empty-state {
  color: var(--yp-muted);
}

@media (min-width: 480px) {
  .poster-stage,
  .main-content,
  .top-bar {
    max-width: 480px;
  }

  .bottom-bar {
    max-width: 456px;
  }

  .poster-stage {
    border-radius: 0;
  }

}

/* =====================================================
   High Fidelity Pass: poster-like soft integrated UI
   ===================================================== */
:root {
  --hf-bg: #fffaf0;
  --hf-surface: rgba(255, 255, 255, 0.72);
  --hf-card: rgba(255, 255, 255, 0.9);
  --hf-line: rgba(238, 207, 151, 0.5);
  --hf-text: #2a2035;
  --hf-purple: #8b63c7;
  --hf-purple-soft: #efe4ff;
  --hf-yellow: #f6c85f;
  --hf-shadow: 0 12px 30px rgba(135, 103, 56, 0.11);
  --hf-shadow-soft: 0 8px 22px rgba(135, 103, 56, 0.075);
}

html,
body {
  background:
    radial-gradient(circle at 12% 2%, rgba(255, 238, 184, 0.92), transparent 24%),
    radial-gradient(circle at 88% 8%, rgba(201, 167, 255, 0.22), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, #fff7e5 44%, #fbf3ff 100%);
}

body::before {
  background:
    linear-gradient(140deg, transparent 0 46px, rgba(201,167,255,0.08) 47px, transparent 48px),
    radial-gradient(circle at 88% 4%, rgba(246,200,95,0.12), transparent 26%);
}

.top-bar {
  position: relative;
  top: auto;
  z-index: 5;
  width: min(100vw, 480px);
  min-height: 58px;
  margin: 0 auto;
  padding: 14px 20px 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.top-logo {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 12px;
  background: rgba(255,255,255,0.78);
  box-shadow: var(--hf-shadow-soft);
}

.top-brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding-left: 2px;
  font-size: 18px;
  font-weight: 950;
  color: var(--hf-purple);
}

.top-brand::before {
  content: none;
}

.main-content {
  width: min(100vw, 480px);
  margin: 0 auto;
  padding: 0 14px calc(104px + env(safe-area-inset-bottom, 0px));
  background: transparent;
}

.carousel-section,
.theme-panel,
.draw-section,
.rules-section {
  border: 1px solid var(--hf-line);
  background: var(--hf-card);
  box-shadow: var(--hf-shadow);
}

.carousel-section {
  margin: 6px 0 14px;
  padding: 0;
  border-radius: 28px;
  overflow: hidden;
}

.carousel-section::after {
  content: none;
}

.carousel-track {
  aspect-ratio: 16 / 7.6;
  height: auto;
  min-height: 188px;
  border-radius: inherit;
  background:
    radial-gradient(circle at 16% 0%, rgba(255,255,255,0.86), transparent 30%),
    linear-gradient(135deg, #efe4ff 0%, #fff3c8 100%);
  box-shadow: none;
}

.carousel-slide {
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-slide-placeholder {
  gap: 8px;
  color: rgba(139,99,199,0.68);
}

.carousel-slide-placeholder .ph-icon {
  font-size: 28px;
}

.carousel-slide-placeholder .ph-text {
  font-size: 13px;
  font-weight: 850;
}

.carousel-dots {
  bottom: 18px;
}

.activity-info.hero-info {
  margin: 8px 0 0;
  padding: 0 6px 2px;
  border: 0;
  box-shadow: none;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.activity-title,
.hero-info .activity-title {
  display: none;
}

.activity-meta,
.hero-info .activity-meta {
  margin-top: 0;
  margin-bottom: 0;
}

.duration-badge {
  min-height: 30px;
  padding: 6px 12px;
  background: rgba(255,255,255,0.94);
  border-color: rgba(201,167,255,0.32);
  color: var(--hf-purple);
  box-shadow: var(--hf-shadow-soft);
}

.theme-section {
  margin: 14px 0;
  padding: 0;
}

.theme-tabs {
  padding: 2px 2px 10px;
  gap: 9px;
}

.theme-tab {
  min-height: 34px;
  height: 34px;
  padding: 0 14px;
  border: 0;
  color: var(--hf-purple);
  background: rgba(255,255,255,0.72);
  box-shadow: var(--hf-shadow-soft);
}

.theme-tab.active {
  color: #fff;
  background: linear-gradient(135deg, #9b74d7, #7d56b9);
  box-shadow: 0 10px 20px rgba(139,99,199,0.18);
}

.theme-panel {
  padding: 12px;
  border-radius: 26px;
}

.theme-summary {
  padding: 2px 2px 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.theme-name,
.theme-summary h2 {
  font-size: 18px;
}

.theme-description,
.theme-summary p {
  font-size: 12px;
}

.points-chip,
.points-cost-chip {
  background: #fff6d7;
  color: #8a641d;
  border-color: rgba(246,200,95,0.42);
}

.theme-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-time-chip {
  min-height: 30px;
  max-width: 100%;
  flex: 1 1 150px;
  justify-content: center;
  white-space: nowrap;
}

.product-strip,
.prize-list {
  gap: 10px;
  margin-top: 8px;
}

.product-card,
.prize-card {
  flex-basis: 116px;
  min-width: 116px;
  padding: 9px;
  border-radius: 18px;
  box-shadow: var(--hf-shadow-soft);
}

.product-image,
.prize-image {
  border-radius: 14px;
  background: #fff8e5;
}

.draw-section {
  margin: 14px 0;
  padding: 14px 12px 16px;
  border-radius: 28px;
}

.draw-section::before {
  content: none;
}

.draw-header {
  margin-bottom: 8px;
}

.draw-header .section-title {
  font-size: 22px;
}

.draw-count-badge {
  min-height: 32px;
  padding: 6px 11px;
  background: rgba(255,255,255,0.92);
}

.draw-hint {
  margin-bottom: 14px;
  background: transparent;
  border: 0;
  padding: 0 2px;
  color: #5f566d;
}

.draw-hint.ready {
  padding: 8px 10px;
  border: 1px solid rgba(201,167,255,0.24);
}

.box-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px 8px;
}

.mystery-box {
  min-height: 92px;
}

.blind-box-frame {
  padding: 4px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  box-shadow: none;
}

.box-image,
.blind-box-img {
  border-radius: 0;
  filter: drop-shadow(0 10px 12px rgba(129,92,50,0.16));
}

.box-index {
  top: 0;
  left: 0;
  min-width: 24px;
  height: 20px;
  font-size: 11px;
}

.box-state-text {
  margin-top: 2px;
  font-size: 10px;
}

.rules-section {
  margin: 14px 0 0;
  padding: 14px;
  border-radius: 24px;
  box-shadow: var(--hf-shadow-soft);
}

.bottom-bar {
  background: rgba(255,255,255,0.94);
}

@media (max-width: 380px) {
  .main-content {
    padding-left: 12px;
    padding-right: 12px;
  }

  .box-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .product-card,
  .prize-card {
    flex-basis: 108px;
    min-width: 108px;
  }
}

/* Product preview: show all boxes in rows instead of hiding extra items in a horizontal strip. */
.theme-panel .product-strip,
.theme-panel .prize-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  overflow: visible;
  padding-bottom: 0;
}

.theme-panel .product-card,
.theme-panel .prize-card {
  width: auto;
  min-width: 0;
  flex: initial;
  flex-basis: auto;
}

.theme-panel .product-meta,
.theme-panel .stock-info {
  align-items: center;
  font-size: 10px;
}

/* Final mobile-safe prize preview layout. Keep product cards visible in 3 columns. */
#theme-panel .product-strip.prize-list {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  align-items: stretch;
  width: 100%;
  gap: 10px;
  overflow: visible !important;
  padding-bottom: 0;
}

#theme-panel .product-card.prize-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: none !important;
  flex-basis: auto !important;
  display: flex;
  flex-direction: column;
}

#theme-panel .product-image.prize-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  flex: 0 0 auto;
}

#theme-panel .product-image.prize-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

#theme-panel .product-name {
  word-break: break-word;
  overflow-wrap: anywhere;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.result-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
}

.bottom-bar.points-disabled {
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
}

.bottom-bar.points-disabled #btn-points {
  display: none;
}

.bottom-bar.points-disabled #btn-draw-code {
  min-height: 62px;
}
