:root {
  --bg: #0f1226;
  --card: #1b1f3b;
  --accent: #ff5c8a;
  --accent2: #7c5cff;
  --gold: #ffd34e;
  --text: #f4f5ff;
  --muted: #9aa0c7;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: radial-gradient(1200px 600px at 50% -10%, #2a2160 0%, var(--bg) 60%);
  color: var(--text);
  min-height: 100vh;
}
.hidden { display: none !important; }

#app { max-width: 480px; margin: 0 auto; padding: 14px; }
.loading { text-align: center; padding: 80px 0; color: var(--muted); }

.card {
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 18px;
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.25);
}

.product { text-align: center; }
.product-img-wrap { position: relative; width: 100%; min-height: 120px; }
.product-img {
  width: 100%; max-height: 180px; object-fit: cover; border-radius: 14px;
  display: none; background: rgba(255,255,255,0.06);
}
.product-img-fallback {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; border-radius: 14px;
  background: rgba(255,255,255,0.06); font-size: 48px;
}
.product-img-fallback.hidden { display: none; }
.product-name { font-size: 20px; margin: 12px 0 6px; }
.product-desc { font-size: 13px; color: var(--muted); margin: 0; }

.progress-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.progress-tag { font-size: 13px; color: var(--muted); font-weight: 500; }
.percent-label { font-size: 18px; font-weight: 800; color: var(--accent); }
.progress-bar { height: 14px; border-radius: 10px; background: rgba(255,255,255,0.08); overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent2), var(--accent), var(--gold));
  border-radius: 10px;
  transition: width 0.8s cubic-bezier(.22,1,.36,1);
}
.progress-fill.round-reset {
  transition: width 0.35s ease-out;
}
.progress-card.round-pulse .percent-label {
  animation: round-pulse 0.6s ease;
}
@keyframes round-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); color: var(--gold); }
}
.progress-hint {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--gold);
  font-weight: 600;
  text-align: center;
}
.helpers-meta {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}
.helpers-card {
  padding: 8px 12px;
}

.help-panel {
  text-align: center;
  padding: 18px 16px 20px;
}
.help-intro {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}
.help-note {
  margin: 12px 0 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
  min-height: 1.2em;
}
.btn-help {
  width: 100%;
  padding: 14px 16px;
  font-size: 17px;
  font-weight: 800;
}
.btn-help:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
body.help-mode .stage,
body.help-mode .actions {
  display: none !important;
}
body.help-mode #progress-hint {
  text-align: center;
}

.helpers-ticker {
  overflow: hidden;
}
.helpers-ticker-viewport {
  height: 30px;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    rgba(255, 92, 138, 0.14) 0%,
    rgba(255, 160, 90, 0.1) 50%,
    rgba(255, 211, 78, 0.12) 100%
  );
  border: 1px solid rgba(255, 140, 100, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.helpers-ticker-track {
  will-change: transform;
}
.helper-slide {
  height: 30px;
  line-height: 30px;
  padding: 0 10px;
  font-size: 12px;
  color: #ffc8a8;
  white-space: nowrap;
  overflow: hidden;
  text-align: center;
}
.helper-slide .helper-name {
  color: #ffe8c8;
  font-weight: 700;
}
.helper-slide .helper-pct {
  color: #ffd34e;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(255, 211, 78, 0.35);
}

.slots { display: none; }

/* 随机浮窗福袋 — 转盘右上角空白区 */
.play-area {
  position: relative;
  min-height: 280px;
  margin-bottom: 16px;
}
.mode-deco {
  text-align: center;
  font-size: 22px;
  letter-spacing: 6px;
  margin-bottom: 8px;
  min-height: 28px;
  opacity: 0.9;
}
.play-area[data-mode="puzzle"] .mode-deco {
  opacity: 1;
}
.play-area[data-mode="waterdrop"] .water-jar {
  box-shadow: 0 0 24px rgba(78, 193, 255, 0.35);
}
.play-area[data-mode="scratch"] .scratch-card {
  box-shadow: 0 0 28px rgba(255, 211, 78, 0.35);
}
.play-area[data-mode="flip"] .flip-card {
  box-shadow: 0 4px 16px rgba(255, 123, 84, 0.25);
}
.play-area[data-mode="gift"] .gift-box {
  filter: drop-shadow(0 8px 20px rgba(255, 92, 138, 0.35));
}
.play-area[data-mode="slot"] .reel {
  border-color: rgba(255, 211, 78, 0.55);
}
.float-layer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  width: 56px;
  pointer-events: none;
}
.float-bag {
  position: relative;
  pointer-events: auto;
  animation: bag-float 2.8s ease-in-out infinite;
}
@keyframes bag-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
.float-bag-inner {
  position: relative;
  cursor: pointer;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.35));
}
.float-bag-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(145deg, #ff6b6b, #ffd34e);
  border: 2px solid rgba(255,255,255,0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.float-bag-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
}
.float-bag-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 156px;
  padding: 12px;
  background: linear-gradient(160deg, #2a2250, #1b1f3b);
  border: 1px solid rgba(255,211,78,0.35);
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.45);
  opacity: 0;
  transform: scale(0.85) translateY(-4px);
  transform-origin: top right;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 20;
}
.float-bag.open .float-bag-panel {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}
.float-bag-title { font-size: 13px; font-weight: 800; color: var(--gold); margin: 0 0 4px; }
.float-bag-desc { font-size: 11px; color: var(--muted); margin: 0 0 8px; line-height: 1.4; }
.float-bag-timer {
  font-size: 16px; font-weight: 800; color: #fff;
  font-variant-numeric: tabular-nums; margin-bottom: 8px;
}
.float-bag-btn {
  width: 100%; padding: 8px 6px; border: none; border-radius: 10px;
  font-size: 12px; font-weight: 700; cursor: pointer; color: #3a2b00;
  background: linear-gradient(90deg, #ff9a3d, var(--gold));
}
.float-bag-btn:disabled { opacity: .45; cursor: not-allowed; }
.float-bag.leaving { animation: bag-out .35s ease forwards; }
@keyframes bag-out {
  to { opacity: 0; transform: translateY(20px) scale(0.8); }
}

.stage { text-align: center; }
.interaction-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: 0.6px;
  background: linear-gradient(90deg, #ffe8a3 0%, #ffd34e 45%, #ff8fb0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 转盘 */
.play-area-wheel {
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 10px;
  margin-bottom: 12px;
}
.wheel-wrap {
  position: relative;
  width: 300px;
  height: 300px;
  margin: 0 auto;
}
.wheel-wrap::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  background: repeating-conic-gradient(
    from -6deg,
    rgba(255, 255, 255, 0.92) 0deg 3deg,
    rgba(255, 211, 78, 0.85) 3deg 6deg,
    transparent 6deg 15deg
  );
  -webkit-mask: radial-gradient(circle, transparent 66%, #000 67%, #000 74%, transparent 75%);
  mask: radial-gradient(circle, transparent 66%, #000 67%, #000 74%, transparent 75%);
  pointer-events: none;
  z-index: 1;
}
.wheel-aura {
  position: absolute;
  inset: -32px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 211, 78, 0.18) 0%, rgba(124, 92, 255, 0.06) 50%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}
.wheel-wrap.is-spinning .wheel-aura {
  background: radial-gradient(circle, rgba(255, 211, 78, 0.28) 0%, rgba(124, 92, 255, 0.1) 50%, transparent 72%);
}
.wheel-outer-ring {
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(255, 211, 78, 0.55),
    0 0 0 9px rgba(255, 168, 30, 0.2),
    0 0 32px rgba(255, 211, 78, 0.28),
    inset 0 0 18px rgba(255, 255, 255, 0.12);
  pointer-events: none;
  z-index: 4;
}
.wheel {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  position: relative;
  overflow: hidden;
  z-index: 2;
  box-shadow:
    inset 0 0 0 3px rgba(255, 255, 255, 0.18),
    inset 0 4px 20px rgba(0, 0, 0, 0.35),
    0 10px 36px rgba(0, 0, 0, 0.45);
  transition: transform 3.6s cubic-bezier(0.17, 0.67, 0.12, 0.99);
  will-change: transform;
}
.wheel.is-spinning {
  filter: brightness(1.06) saturate(1.08);
}
.wheel-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wheel-svg svg {
  width: 100%;
  height: 100%;
  display: block;
}
.wheel-inner-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.22);
  pointer-events: none;
  z-index: 3;
}
.wheel-center {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #fff 0%, #ffe566 38%, #e8a317 78%, #b8740a 100%);
  box-shadow:
    0 4px 16px rgba(0, 0, 0, 0.45),
    inset 0 2px 5px rgba(255, 255, 255, 0.95),
    inset 0 -4px 8px rgba(160, 100, 0, 0.45);
  z-index: 6;
  pointer-events: none;
}
.wheel-center-gem {
  display: block;
  width: 20px;
  height: 20px;
  margin: 17px auto 0;
  border-radius: 50%;
  background: radial-gradient(circle at 28% 22%, #fff 0%, #ff8fb0 55%, #ff5c8a 100%);
  box-shadow: 0 0 10px rgba(255, 92, 138, 0.65);
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}
.wheel-pointer-body {
  display: block;
  width: 0;
  height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 30px solid #ffd34e;
  position: relative;
}
.wheel-pointer-body::before {
  content: "";
  position: absolute;
  left: -10px;
  top: -28px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 18px solid #fff8dc;
}
.wheel-pointer-body::after {
  content: "";
  position: absolute;
  left: -6px;
  top: -32px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff, #ffd34e);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.prize-result {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 92, 138, 0.22), rgba(255, 211, 78, 0.18));
  border: 1px solid rgba(255, 211, 78, 0.4);
  box-shadow: 0 4px 20px rgba(255, 211, 78, 0.12);
  font-size: 16px;
  font-weight: 800;
  color: #ffe8a3;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
}
.prize-result.hidden { display: none !important; }

/* 拼图 */
.puzzle-wrap {
  width: 280px;
  margin: 0 auto;
  text-align: center;
  transition: transform 0.25s ease;
}
.puzzle-wrap.puzzle-pop {
  transform: scale(1.03);
}
.puzzle-template-name {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: #d4c4ff;
}
.puzzle-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  width: 210px;
  margin: 0 auto 12px;
}
.puzzle-cell {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 2px dashed rgba(255, 255, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: background 0.3s, transform 0.3s, border-color 0.3s;
}
.puzzle-cell.filled {
  background: linear-gradient(135deg, #7c5cff, #4ec1ff);
  border-style: solid;
  border-color: transparent;
}
.puzzle-cell.just-got {
  animation: puzzle-got 0.6s ease;
}
@keyframes puzzle-got {
  0% { transform: scale(0.6); opacity: 0.4; }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); opacity: 1; }
}
.puzzle-cell.empty-slot {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.25);
  font-weight: 700;
}
.puzzle-draw-box {
  width: 88px;
  height: 88px;
  margin: 0 auto 12px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.35), rgba(78, 193, 255, 0.25));
  border: 2px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease;
}
.puzzle-draw-box.reveal {
  animation: puzzle-draw-shake 0.55s ease;
}
@keyframes puzzle-draw-shake {
  0%, 100% { transform: rotate(0deg) scale(1); }
  20% { transform: rotate(-6deg) scale(1.05); }
  40% { transform: rotate(6deg) scale(1.08); }
  60% { transform: rotate(-4deg) scale(1.06); }
  80% { transform: rotate(4deg) scale(1.04); }
}
.puzzle-draw-piece {
  font-size: 42px;
  line-height: 1;
}
.puzzle-inventory {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 8px;
}
.frag-meta { font-size: 12px; color: var(--muted); }
.puzzle-rules {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* 好运水滴 */
.waterdrop-wrap {
  width: 200px;
  margin: 8px auto 0;
  text-align: center;
  transition: transform 0.25s ease;
}
.waterdrop-wrap.waterdrop-pop {
  transform: scale(1.04);
}
.water-jar {
  position: relative;
  width: 120px;
  height: 160px;
  margin: 0 auto 12px;
  border-radius: 12px 12px 28px 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 3px solid rgba(78, 193, 255, 0.45);
  overflow: hidden;
}
.water-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0;
  background: linear-gradient(180deg, rgba(78, 193, 255, 0.55), rgba(52, 211, 153, 0.75));
  transition: height 0.45s ease;
}
.water-jar-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, 0.15), transparent 55%);
}
.waterdrop-status {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #b8e8ff;
}
.waterdrop-tip {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}

/* 老虎机 */
.slot-wrap { display: flex; gap: 10px; justify-content: center; margin: 10px auto 0; }
.reel {
  width: 64px; height: 84px; border-radius: 12px; overflow: hidden;
  background: #0d0f24; border: 2px solid #ffffff22;
  position: relative;
}
.reel-inner {
  display: flex;
  flex-direction: column;
  font-size: 36px;
  line-height: 84px;
  will-change: transform;
}
.reel-inner div,
.reel-cell {
  height: 84px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.reel-cell-result {
  font-size: 36px;
  line-height: 1;
}

/* 刮刮乐 */
.scratch-wrap {
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.scratch-wrap-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}
.scratch-wrap-hint.hidden {
  display: none;
}
.scratch-card {
  position: relative;
  width: min(100%, 320px);
  height: 180px;
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(145deg, #ffd34e, #ff9a3d);
  border: 2px solid rgba(255,255,255,0.35);
}
.scratch-prize {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 10px;
  text-align: center;
  background: linear-gradient(160deg, #2a2250, #1b1f3b);
}
.scratch-reveal-emoji {
  font-size: 52px;
  line-height: 1;
}
.scratch-reveal-main {
  font-size: 28px;
  font-weight: 800;
  color: #ffd34e;
  line-height: 1.2;
  letter-spacing: 0.02em;
}
.scratch-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
  border-radius: 14px;
  z-index: 2;
}
.scratch-card.scratch-active {
  animation: scratch-pulse 1.4s ease-in-out infinite;
}
@keyframes scratch-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 211, 78, 0.45); }
  50% { box-shadow: 0 0 0 10px rgba(255, 211, 78, 0.08); }
}
.scratch-card.scratch-done .scratch-canvas {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.scratch-hint {
  position: absolute;
  bottom: 6px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: rgba(255,255,255,0.75);
  pointer-events: none;
  z-index: 1;
}

/* 翻牌（2D 点击翻转，兼容 Telegram WebView） */
.flip-wrap {
  margin: 8px auto 0;
  width: 100%;
  max-width: 340px;
}
.flip-board {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: center;
  gap: 12px;
}
.flip-hint {
  margin: 10px 0 0;
  text-align: center;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
}
.flip-wrap.flip-active .flip-board {
  animation: flip-pulse 1.4s ease-in-out infinite;
}
@keyframes flip-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}
.flip-card {
  position: relative;
  flex: 0 0 96px;
  width: 96px;
  height: 132px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  border-radius: 14px;
}
.flip-card:disabled {
  cursor: default;
  opacity: 0.92;
}
.flip-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: 42px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.flip-card-back {
  background: linear-gradient(145deg, #7c5cff, #4ec1ff);
  opacity: 1;
  transform: scale(1);
}
.flip-card:nth-child(1) .flip-card-back {
  background: linear-gradient(145deg, #4a6cff, #4ec1ff);
}
.flip-card:nth-child(2) .flip-card-back {
  background: linear-gradient(145deg, #ff5c8a, #ff9a3d);
}
.flip-card:nth-child(3) .flip-card-back {
  background: linear-gradient(145deg, #7c5cff, #c084fc);
}
.flip-card-front {
  background: linear-gradient(145deg, #ff7b54, #ffd34e);
  opacity: 0;
  transform: scale(0.85);
}
.flip-card.flipped .flip-card-back {
  opacity: 0;
  transform: scale(0.85);
}
.flip-card.flipped .flip-card-front {
  opacity: 1;
  transform: scale(1);
}
.flip-card.flip-win .flip-card-front {
  box-shadow: 0 0 16px rgba(255, 211, 78, 0.65);
}

/* 拆礼盒 */
.gift-wrap {
  margin: 12px auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  min-height: 200px;
  justify-content: center;
}
.gift-hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  text-align: center;
}
.gift-wrap.gift-active .gift-box {
  animation: gift-pulse 1.4s ease-in-out infinite;
}
@keyframes gift-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.gift-box {
  position: relative;
  display: block;
  width: 140px;
  height: 150px;
  margin: 0 auto;
  padding: 0;
  border: none;
  background: transparent;
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.gift-closed {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  background: linear-gradient(160deg, #2a2250, #1b1f3b);
  border-radius: 16px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  box-sizing: border-box;
  transition: opacity 0.4s ease, background 0.35s ease;
}
.gift-closed.gift-theme-classic {
  background: linear-gradient(160deg, #2a2250, #1b1f3b);
  border-color: rgba(255, 255, 255, 0.28);
}
.gift-closed.gift-theme-lucky {
  background: linear-gradient(160deg, #8b1a1a, #c62828);
  border-color: rgba(255, 211, 78, 0.45);
}
.gift-closed.gift-theme-gem {
  background: linear-gradient(160deg, #1a3a6b, #4ec1ff);
  border-color: rgba(120, 220, 255, 0.4);
}
.gift-closed.gift-theme-party {
  background: linear-gradient(160deg, #6b2d8e, #ff5c8a);
  border-color: rgba(255, 180, 220, 0.4);
}
.gift-closed.gift-theme-coin {
  background: linear-gradient(160deg, #5c4a00, #ffd34e);
  border-color: rgba(255, 240, 160, 0.45);
}
.gift-closed.gift-theme-magic {
  background: linear-gradient(160deg, #2d1f5c, #7c5cff);
  border-color: rgba(180, 150, 255, 0.4);
}
.gift-closed.gift-theme-sweet {
  background: linear-gradient(160deg, #6b2040, #ff9a9e);
  border-color: rgba(255, 200, 210, 0.42);
}
.gift-closed.gift-theme-star {
  background: linear-gradient(160deg, #1a3352, #ffd34e);
  border-color: rgba(255, 230, 140, 0.4);
}
.gift-closed.gift-theme-bloom {
  background: linear-gradient(160deg, #1f4d3a, #7dffb3);
  border-color: rgba(180, 255, 210, 0.42);
}
.gift-box:disabled {
  cursor: default;
}
.gift-body {
  display: block;
  font-size: 64px;
  line-height: 1;
  margin-top: 8px;
}
.gift-lid {
  display: block;
  font-size: 28px;
  transition: transform 0.45s ease, opacity 0.45s ease;
}
.gift-prize {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -20%) scale(0.3);
  font-size: 44px;
  opacity: 0;
  transition: transform 0.5s ease, opacity 0.4s ease;
  pointer-events: none;
}
.gift-box.shake {
  animation: gift-shake 0.55s ease-in-out;
}
.gift-box.open .gift-lid {
  transform: translateY(-36px) rotate(-12deg);
  opacity: 0.6;
}
.gift-box.open .gift-prize {
  opacity: 1;
  transform: translate(-50%, -55%) scale(1);
}
@keyframes gift-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-6deg); }
  40% { transform: rotate(6deg); }
  60% { transform: rotate(-4deg); }
  80% { transform: rotate(4deg); }
}

.btn {
  display: block; width: 100%; padding: 14px; border: none; border-radius: 14px;
  font-size: 16px; font-weight: 700; cursor: pointer; margin-top: 8px; color: #fff;
  transition: transform .1s, opacity .2s;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: .5; }
.btn-primary { background: linear-gradient(90deg, var(--accent2), var(--accent)); }
.btn-accent { background: linear-gradient(90deg, #ff9a3d, var(--gold)); color: #3a2b00; }
.btn-ghost { background: rgba(255,255,255,0.08); }
.chance-tip { font-size: 12px; color: var(--muted); margin-top: 10px; min-height: 16px; }

.modal {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal-box {
  background: var(--card); border-radius: 18px; padding: 24px; width: 100%; max-width: 340px;
  text-align: center; border: 1px solid #ffffff1a;
}
.modal-box h2 { margin: 6px 0 10px; }
.modal-box p { color: var(--muted); font-size: 14px; margin: 0 0 16px; }
.follow-links { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
.follow-links .btn { margin-top: 0; }
.done-emoji { font-size: 52px; animation: pop .5s ease; }

.hype-box { position: relative; }
.hype-icon { font-size: 48px; margin-bottom: 8px; animation: pop .45s ease; }
.hype-steps {
  list-style: none;
  padding: 0;
  margin: 12px 0 0;
  text-align: left;
  font-size: 13px;
  color: var(--muted);
}
.hype-steps li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.hype-steps li.done { color: var(--gold); }
.hype-steps li.active { color: var(--text); font-weight: 600; }
.hype-box .btn { margin-top: 14px; }
@keyframes pop { 0%{transform:scale(0)} 70%{transform:scale(1.3)} 100%{transform:scale(1)} }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%);
  background: #000a; color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 14px; z-index: 60; max-width: 90%;
}
