:root {
  --gold: #f0c85a;
  --gold-bright: #ffe9ab;
  --gold-deep: #c9972a;
  --gold-line: linear-gradient(180deg, #fff4c4 0%, #f0c85a 45%, #b8841b 100%);
  --bg: #0a0705;
  --panel: rgba(28, 20, 10, 0.86);
  --border: rgba(240, 200, 90, 0.35);
  --text: #f7e7b5;
  --muted: #b9a278;
  --danger: #ff6b6b;
  --safe: #3ecf8e;
  --red: #e5484d;
  --red-deep: #b3121c;
}

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  overscroll-behavior-y: none;
}

body {
  background:
    radial-gradient(ellipse 120% 60% at 50% -5%, rgba(240, 195, 80, 0.35), transparent 60%),
    radial-gradient(circle at 10% 22%, rgba(255, 224, 138, 0.10), transparent 26%),
    radial-gradient(circle at 92% 15%, rgba(255, 224, 138, 0.09), transparent 24%),
    radial-gradient(circle at 88% 78%, rgba(201, 151, 42, 0.14), transparent 30%),
    repeating-linear-gradient(135deg, rgba(255,255,255,0.012) 0px, rgba(255,255,255,0.012) 1px, transparent 1px, transparent 5px),
    linear-gradient(180deg, #1c1409 0%, #0a0705 40%, #100b06 100%);
  background-attachment: fixed;
  position: relative;
}

a { color: var(--gold); text-decoration: none; }

/* ===== Ambient background decor ===== */
.bg-decor { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: .55;
}
.bg-glow-1 { width: 260px; height: 260px; top: -80px; left: -60px; background: radial-gradient(circle, rgba(240,200,90,.35), transparent 70%); animation: drift1 14s ease-in-out infinite; }
.bg-glow-2 { width: 220px; height: 220px; bottom: 10%; right: -60px; background: radial-gradient(circle, rgba(255,150,90,.18), transparent 70%); animation: drift2 16s ease-in-out infinite; }
@keyframes drift1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(30px, 20px); } }
@keyframes drift2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-20px, -25px); } }

.bg-sparkle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 0 6px 2px rgba(255,224,138,.7);
  animation: sparkle 3.2s ease-in-out infinite;
  opacity: 0;
}
@keyframes sparkle {
  0%, 100% { opacity: 0; transform: scale(.4); }
  50% { opacity: .9; transform: scale(1.2); }
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 12px 14px 28px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.page.has-bottom-nav {
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
}

.page::before {
  content: "";
  position: absolute;
  pointer-events: none;
  inset: 6px;
  border: 1px solid rgba(240, 200, 90, 0.08);
  border-radius: 14px;
  z-index: 0;
}

/* ===== Header ===== */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 2;
  padding: 4px 2px;
}

.balance {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(180deg, rgba(40,28,12,.65), rgba(10,7,4,.65));
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px 6px 8px;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 4px 10px rgba(0,0,0,.3);
}

.coin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff8dd, #ffe08a 40%, #c9972a 85%);
  box-shadow: 0 0 8px rgba(240,200,90,.7), inset 0 0 0 1px rgba(150,100,20,.4);
  flex-shrink: 0;
  position: relative;
  animation: coinShine 3s ease-in-out infinite;
}
@keyframes coinShine {
  0%, 100% { box-shadow: 0 0 6px rgba(240,200,90,.5), inset 0 0 0 1px rgba(150,100,20,.4); }
  50% { box-shadow: 0 0 12px rgba(255,224,138,.9), inset 0 0 0 1px rgba(150,100,20,.4); }
}

.balance strong { color: var(--gold-bright); font-weight: 800; }

.top-actions { display: flex; gap: 6px; z-index: 2; }

.btn-ghost {
  border: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(40,28,12,.6), rgba(10,7,4,.5));
  color: var(--text);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  transition: transform .12s ease, border-color .12s ease;
}
.btn-ghost:active { transform: scale(.94); }
.btn-ghost#langBtn.active,
.btn-ghost.active {
  background: linear-gradient(180deg, #ffe08a, #d4a53a);
  color: #2a1c08;
  border-color: transparent;
  font-weight: 700;
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  margin: 20px 0 12px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 1px;
  color: #3a2708;
  background: linear-gradient(180deg, #ffe9ab, #d4a53a);
  padding: 3px 12px;
  border-radius: 999px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(212,165,58,.35);
  margin-bottom: 8px;
}

.hero h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: 3px;
  font-weight: 800;
  background: var(--gold-line);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 24px rgba(240,200,90,.3);
  filter: drop-shadow(0 4px 0 rgba(0,0,0,.35));
  position: relative;
  display: inline-block;
}

.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  opacity: .85;
}
.hero-divider::before, .hero-divider::after {
  content: "";
  height: 1px;
  width: 44px;
  background: linear-gradient(90deg, transparent, var(--gold-deep));
}
.hero-divider::after { background: linear-gradient(90deg, var(--gold-deep), transparent); }
.hero-divider .gem {
  width: 8px; height: 8px;
  background: var(--gold-bright);
  transform: rotate(45deg);
  box-shadow: 0 0 8px rgba(255,224,138,.8);
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: .5px;
}

/* ===== Ticker ===== */
.ticker-wrap {
  overflow: hidden;
  white-space: nowrap;
  border: 1px solid rgba(240,200,90,.25);
  background: linear-gradient(180deg, rgba(40,28,12,.55), rgba(8,6,3,.55));
  border-radius: 999px;
  padding: 9px 0 9px 40px;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), 0 4px 12px rgba(0,0,0,.25);
}

.ticker-wrap::before {
  content: "\1F4E3";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  filter: drop-shadow(0 0 4px rgba(240,200,90,.6));
}

.ticker {
  display: inline-block;
  padding-left: 100%;
  animation: ticker 40s linear infinite;
  color: var(--gold-bright);
  font-size: 12px;
  white-space: nowrap;
}

.ticker span { margin-right: 28px; }
.ticker span::before { content: "\1F389 "; }

@keyframes ticker {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.cost-tip {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 12px;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.cost-tip strong { color: var(--gold-bright); }

.rules-inline {
  color: var(--gold);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 11px;
  background: rgba(0,0,0,.25);
}

/* ===== Board frame ===== */
.board-frame {
  position: relative;
  z-index: 2;
  padding: 4px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255,224,138,.55), rgba(120,85,20,.15) 45%, rgba(255,224,138,.4));
  box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.4);
  overflow: hidden;
}

.board-frame .corner,
.card-stage .corner {
  position: absolute;
  width: 22px;
  height: 22px;
  border: 2px solid var(--gold-bright);
  opacity: .8;
  z-index: 3;
  filter: drop-shadow(0 0 4px rgba(255,224,138,.5));
}
.corner.tl { top: 6px; left: 6px; border-right: none; border-bottom: none; border-radius: 6px 0 0 0; }
.corner.tr { top: 6px; right: 6px; border-left: none; border-bottom: none; border-radius: 0 6px 0 0; }
.corner.bl { bottom: 6px; left: 6px; border-right: none; border-top: none; border-radius: 0 0 0 6px; }
.corner.br { bottom: 6px; right: 6px; border-left: none; border-top: none; border-radius: 0 0 6px 0; }

.board-shine {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  overflow: hidden;
  border-radius: 20px;
}
.board-shine::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -60%;
  width: 40%;
  height: 200%;
  background: linear-gradient(100deg, transparent 0%, rgba(255,255,255,.16) 45%, rgba(255,255,255,.32) 50%, rgba(255,255,255,.16) 55%, transparent 100%);
  transform: rotate(8deg);
  animation: boardSweep 5.5s ease-in-out infinite;
}
@keyframes boardSweep {
  0% { left: -60%; }
  35% { left: 130%; }
  100% { left: 130%; }
}

.board {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 8px;
  padding: 10px;
  background: linear-gradient(180deg, rgba(42,30,13,.85), rgba(14,10,5,.92));
  border-radius: 18px;
  box-shadow: inset 0 0 30px rgba(240,200,90,.08), inset 0 2px 6px rgba(0,0,0,.4);
  aspect-ratio: 1;
}

.board-5, .board-6, .board-7 { gap: 5px; padding: 8px; }
.board-5 .cell .name, .board-6 .cell .name, .board-7 .cell .name { font-size: 9px; padding: 8px 2px 2px; }
.board-5 .cell img, .board-6 .cell img, .board-7 .cell img { width: 62%; height: 62%; }
.board-6 .draw-btn, .board-7 .draw-btn { font-size: 24px; min-height: 0; }
.board-6 .draw-btn small, .board-7 .draw-btn small { font-size: 10px; }
.board-3 .draw-btn { font-size: 28px; }

.cell {
  border-radius: 12px;
  border: 1px solid rgba(240,200,90,.18);
  background: linear-gradient(160deg, rgba(58,42,16,.55), rgba(10,8,5,.75));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05), inset 0 -6px 10px rgba(0,0,0,.25);
  transition: box-shadow .12s ease, border-color .12s ease, transform .12s ease, background .12s ease;
}

.cell img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.45));
}

.cell .name {
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  color: #f3df9d;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* When a cell has an image, show the label as a compact overlay strip
   at the bottom instead of stacking it below (lets the artwork dominate). */
.cell img + .name {
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  color: #fff6d8;
  background: linear-gradient(180deg, rgba(20,14,6,0), rgba(12,8,4,.78) 55%);
  border-radius: 0 0 9px 9px;
  padding: 10px 2px 3px;
  font-weight: 600;
}

.cell.active {
  border-color: #ffe08a;
  box-shadow: 0 0 0 2px rgba(255,224,138,.7), 0 0 22px rgba(240,200,90,.75);
  transform: scale(1.06);
  background: linear-gradient(160deg, rgba(120,85,20,.75), rgba(60,40,10,.7));
  z-index: 2;
}

.cell.center-slot {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  aspect-ratio: auto;
}

.draw-btn {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: none;
  border-radius: 16px;
  color: #3a2708;
  font-size: clamp(20px, 7vw, 32px);
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(160deg, #fff0b0 0%, #f0c85a 40%, #c9972a 100%);
  box-shadow: 0 8px 22px rgba(201,151,42,.5), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 10px rgba(150,100,20,.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: relative;
  animation: drawPulse 2.2s ease-in-out infinite;
}
@keyframes drawPulse {
  0%, 100% { box-shadow: 0 8px 22px rgba(201,151,42,.5), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 10px rgba(150,100,20,.35), 0 0 0 0 rgba(255,224,138,.5); }
  50% { box-shadow: 0 8px 26px rgba(201,151,42,.65), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 10px rgba(150,100,20,.35), 0 0 0 8px rgba(255,224,138,0); }
}
.draw-btn:active { transform: scale(.96); animation: none; }

.draw-btn small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: .85;
}

.draw-btn:disabled {
  opacity: .65;
  filter: grayscale(.2);
  animation: none;
}

/* ===== Card blind-box lottery ===== */
.card-lottery {
  position: relative;
  z-index: 2;
  margin: 18px 0 6px;
}

.card-stage {
  position: relative;
  padding: 4px;
  border-radius: 22px;
  background: linear-gradient(155deg, rgba(255,224,138,.55), rgba(120,85,20,.15) 45%, rgba(255,224,138,.4));
  box-shadow: 0 16px 36px rgba(0,0,0,.5), 0 0 0 1px rgba(0,0,0,.4);
}

.card-rows {
  position: relative;
  background: linear-gradient(180deg, rgba(42,30,13,.85), rgba(14,10,5,.92));
  border-radius: 20px;
  padding: 26px 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  box-shadow: inset 0 0 34px rgba(240,200,90,.08), inset 0 2px 6px rgba(0,0,0,.4);
  overflow: hidden;
}

.stage-decor {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.stage-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(30px);
  opacity: .75;
  mix-blend-mode: screen;
}
.stage-glow.g1 {
  width: 190px; height: 190px;
  top: -60px; left: -40px;
  background: radial-gradient(circle, rgba(255,214,120,.6), transparent 70%);
  animation: stageDrift1 9s ease-in-out infinite;
}
.stage-glow.g2 {
  width: 170px; height: 170px;
  bottom: -65px; right: -35px;
  background: radial-gradient(circle, rgba(255,150,90,.48), transparent 70%);
  animation: stageDrift2 11s ease-in-out infinite;
}
.stage-glow.g3 {
  width: 150px; height: 150px;
  top: 22%; left: 40%;
  background: radial-gradient(circle, rgba(255,224,138,.4), transparent 70%);
  animation: stageDrift1 13s ease-in-out infinite reverse;
}
@keyframes stageDrift1 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(18px, 12px); } }
@keyframes stageDrift2 { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-16px, -14px); } }

.stage-sparkle {
  position: absolute;
  width: 4px; height: 4px;
  border-radius: 50%;
  background: #fff6d8;
  box-shadow: 0 0 9px 3px rgba(255,224,138,.95);
  animation: sparkle 2.8s ease-in-out infinite;
  opacity: 0;
}

.stage-decor-front {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 3;
}
.stage-float {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: radial-gradient(circle, #fffbe8, rgba(255,224,138,.2) 70%, transparent);
  box-shadow: 0 0 10px 3px rgba(255,224,138,.7);
  opacity: 0;
  animation: stageFloat 6s ease-in-out infinite;
}
.stage-float.f1 { left: 16%; top: 78%; animation-delay: .3s; }
.stage-float.f2 { left: 50%; top: 12%; animation-delay: 2.2s; }
.stage-float.f3 { left: 84%; top: 70%; animation-delay: 4.1s; }
@keyframes stageFloat {
  0% { opacity: 0; transform: translateY(0) scale(.6); }
  15% { opacity: .9; transform: translateY(-8px) scale(1); }
  50% { opacity: .6; transform: translateY(-26px) scale(1.1); }
  85% { opacity: 0; transform: translateY(-46px) scale(.7); }
  100% { opacity: 0; transform: translateY(-46px) scale(.7); }
}

.card-row {
  position: relative;
  z-index: 1;
  overflow: hidden;
  height: 190px;
  mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent);
}

.card-row-track {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  height: 100%;
  padding-left: 20px;
  will-change: transform;
}

.draw-card {
  flex: 0 0 auto;
  width: 122px;
  height: 172px;
  position: relative;
  perspective: 900px;
}

.draw-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform .65s cubic-bezier(.34, 1.56, .64, 1);
}

.draw-card.flipped .draw-card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  backface-visibility: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.card-face-back {
  background-image: linear-gradient(160deg, rgba(255,255,255,.08), rgba(0,0,0,.08)), url('/images/cards/card-back-gold.jpg');
  background-size: cover;
  background-position: center;
  box-shadow: 0 4px 12px rgba(0,0,0,.4), inset 0 0 0 1px rgba(255,255,255,.15);
}

.card-face-front {
  background: linear-gradient(160deg, #fff2c0 0%, #f0c85a 45%, #c9972a 100%);
  transform: rotateY(180deg);
  padding: 14px 8px 10px;
  gap: 6px;
  border: 2px solid rgba(255,247,214,.6);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), inset 0 0 0 5px rgba(120,80,10,.12), 0 4px 12px rgba(0,0,0,.35);
}

.card-face-front img {
  width: 62%;
  height: 48%;
  object-fit: contain;
  filter: drop-shadow(0 3px 6px rgba(0,0,0,.25));
}

.card-face-front .cf-name {
  font-size: 14px;
  font-weight: 700;
  color: #3a2708;
  text-align: center;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.card-pointer {
  position: absolute;
  left: 50%;
  top: 14px;
  bottom: 14px;
  width: 138px;
  transform: translateX(-50%);
  z-index: 5;
  pointer-events: none;
}

.card-pointer-frame {
  position: absolute;
  inset: 0;
  border: 2px solid var(--gold-bright);
  border-radius: 16px;
  box-shadow: 0 0 18px rgba(255,224,138,.6), inset 0 0 14px rgba(255,224,138,.25);
  animation: pointerGlow 1.6s ease-in-out infinite;
}
@keyframes pointerGlow {
  0%, 100% { box-shadow: 0 0 14px rgba(255,224,138,.45), inset 0 0 10px rgba(255,224,138,.2); }
  50% { box-shadow: 0 0 22px rgba(255,224,138,.75), inset 0 0 16px rgba(255,224,138,.3); }
}

.card-pointer-arrow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
}
.card-pointer-arrow.top {
  top: -13px;
  border-top: 12px solid var(--gold-bright);
  filter: drop-shadow(0 0 4px rgba(255,224,138,.7));
}
.card-pointer-arrow.bottom {
  bottom: -13px;
  border-bottom: 12px solid var(--gold-bright);
  filter: drop-shadow(0 0 4px rgba(255,224,138,.7));
}

.draw-btn-card {
  display: flex;
  width: 100%;
  margin-top: 18px;
  border: none;
  border-radius: 16px;
  padding: 15px;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: #3a2708;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 4px;
  background: linear-gradient(160deg, #fff0b0 0%, #f0c85a 40%, #c9972a 100%);
  box-shadow: 0 8px 22px rgba(201,151,42,.5), inset 0 1px 0 rgba(255,255,255,.5), inset 0 -6px 10px rgba(150,100,20,.35);
  animation: drawPulse 2.2s ease-in-out infinite;
}
.draw-btn-card small {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0;
  opacity: .85;
}
.draw-btn-card:active { transform: scale(.98); animation: none; }
.draw-btn-card:disabled {
  opacity: .65;
  filter: grayscale(.2);
  animation: none;
}

/* ===== Sections ===== */
.section {
  margin-top: 22px;
  position: relative;
  z-index: 2;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 12px;
}
.section-head::before, .section-head::after {
  content: "";
  height: 1px;
  width: 30px;
  background: linear-gradient(90deg, transparent, var(--gold-deep));
}
.section-head::after { background: linear-gradient(90deg, var(--gold-deep), transparent); }

.section h2 {
  text-align: center;
  font-size: 15px;
  margin: 0;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: 1px;
}

.prize-strip {
  overflow: hidden;
  width: 100%;
  -webkit-overflow-scrolling: touch;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  padding: 4px 0 10px;
}

.prize-strip-track {
  display: flex;
  gap: 12px;
  width: max-content;
  padding-bottom: 2px;
  will-change: transform;
  animation: prizeBounce var(--prize-duration, 18s) ease-in-out infinite alternate;
}

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

@keyframes prizeBounce {
  from { transform: translateX(0); }
  to { transform: translateX(var(--prize-shift, 0px)); }
}

.prize-chip {
  flex: 0 0 auto;
  width: 88px;
  text-align: center;
  background: linear-gradient(160deg, rgba(50,36,14,.6), rgba(10,7,4,.6));
  border: 1px solid rgba(240,200,90,.22);
  border-radius: 14px;
  padding: 12px 6px 9px;
  position: relative;
  box-shadow: 0 4px 12px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,255,255,.05);
}

.prize-chip:first-child {
  border-color: rgba(255,224,138,.55);
  box-shadow: 0 6px 16px rgba(240,200,90,.25), inset 0 1px 0 rgba(255,255,255,.08);
}

.prize-chip:first-child::before {
  content: "HOT";
  position: absolute;
  top: -6px;
  left: -6px;
  background: linear-gradient(135deg, #ff8a4c, #e5484d);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transform: rotate(-8deg);
  letter-spacing: .5px;
}

.prize-chip img {
  width: 56px;
  height: 56px;
  object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.35));
}

.prize-chip .n {
  margin-top: 7px;
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Bottom nav ===== */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 150;
  display: flex;
  justify-content: center;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  pointer-events: none;
}
.bottom-nav-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 480px;
  display: flex;
  background: linear-gradient(180deg, rgba(30,21,10,.94), rgba(10,7,4,.98));
  border-top: 1px solid var(--border);
  box-shadow: 0 -8px 24px rgba(0,0,0,.45);
  backdrop-filter: blur(8px);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 9px 0 7px;
  color: var(--muted);
  font-size: 11px;
  position: relative;
}
.bottom-nav-item svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.bottom-nav-item.active { color: var(--gold-bright); }
.bottom-nav-item.active svg { stroke: var(--gold-bright); filter: drop-shadow(0 0 5px rgba(255,224,138,.6)); }
.bottom-nav-item.center-item {
  transform: translateY(-12px);
}
.bottom-nav-item.center-item .nav-center-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff0b0, #f0c85a 45%, #c9972a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 16px rgba(201,151,42,.5), 0 0 0 4px rgba(10,7,4,1);
  margin-bottom: 2px;
}
.bottom-nav-item.center-item .nav-center-btn svg { stroke: #3a2708; width: 22px; height: 22px; }
.bottom-nav-item.center-item span { color: var(--gold); font-weight: 600; }

/* ===== Auth pages ===== */
.auth-card, .panel-card {
  max-width: 420px;
  margin: 46px auto 0;
  background: linear-gradient(180deg, rgba(34,24,11,.92), rgba(14,10,5,.94));
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 30px 22px 26px;
  position: relative;
  z-index: 2;
  box-shadow: 0 20px 44px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
}

.auth-avatar {
  width: 62px;
  height: 62px;
  margin: -54px auto 14px;
  border-radius: 50%;
  background: linear-gradient(160deg, #fff0b0, #f0c85a 45%, #c9972a);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 24px rgba(201,151,42,.5), 0 0 0 5px rgba(14,10,5,1);
}
.auth-avatar svg { width: 30px; height: 30px; fill: none; stroke: #3a2708; stroke-width: 1.8; }

.auth-card h1, .panel-card h1 {
  margin: 0 0 22px;
  text-align: center;
  background: var(--gold-line);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: 23px;
  letter-spacing: 2px;
  font-weight: 800;
}

.form-group { margin-bottom: 15px; position: relative; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .5px; }
.form-group .input-wrap { position: relative; }
.form-group .input-wrap svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.7;
  pointer-events: none;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  border: 1px solid rgba(240,200,90,.25);
  background: rgba(0,0,0,.35);
  color: var(--text);
  border-radius: 11px;
  padding: 12px 12px 12px 36px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(240,200,90,.15);
}
.form-group input::placeholder { color: rgba(185,162,120,.55); }

.btn-primary {
  width: 100%;
  border: none;
  border-radius: 13px;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #2a1c08;
  background: linear-gradient(180deg, #ffe08a, #d4a53a);
  box-shadow: 0 8px 20px rgba(212,165,58,.4), inset 0 1px 0 rgba(255,255,255,.4);
  margin-top: 6px;
  transition: transform .12s ease;
}
.btn-primary:active { transform: scale(.98); }

.muted-link { display: block; text-align: center; margin-top: 14px; color: var(--muted); font-size: 13px; }
.muted-link:hover { color: var(--gold); }
.error {
  color: #ffb3b3;
  font-size: 13px;
  margin: 0 0 14px;
  background: rgba(229,72,77,.12);
  border: 1px solid rgba(229,72,77,.35);
  border-radius: 10px;
  padding: 9px 12px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  background: rgba(20,14,8,.95);
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: 14px 18px;
  border-radius: 12px;
  z-index: 300;
  max-width: 86%;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
  display: none;
  font-size: 13px;
}

.toast.show { display: block; animation: pop .25s ease; }

@keyframes pop {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ===== User center: profile + lists ===== */
.profile-card {
  position: relative;
  z-index: 2;
  margin: 6px 0 20px;
  background: linear-gradient(160deg, rgba(50,36,14,.75), rgba(12,9,5,.85));
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 28px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.05);
  overflow: hidden;
}
.profile-card::after {
  content: "";
  position: absolute;
  right: -30px; top: -30px;
  width: 120px; height: 120px;
  background: radial-gradient(circle, rgba(240,200,90,.18), transparent 70%);
}
.profile-avatar {
  width: 54px; height: 54px;
  border-radius: 50%;
  flex-shrink: 0;
  background: linear-gradient(160deg, #fff0b0, #f0c85a 45%, #c9972a);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px rgba(201,151,42,.4);
  font-size: 22px; font-weight: 800; color: #3a2708;
}
.profile-info { flex: 1; min-width: 0; }
.profile-info .uname { font-size: 17px; font-weight: 700; color: var(--gold-bright); }
.profile-info .upoints { font-size: 13px; color: var(--muted); margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.profile-info .upoints strong { color: var(--gold); font-size: 15px; }

.list {
  background: linear-gradient(160deg, rgba(40,28,12,.5), rgba(8,6,3,.6));
  border: 1px solid rgba(240,200,90,.18);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid rgba(240,200,90,.08);
  font-size: 13px;
}

.list-item:last-child { border-bottom: none; }
.list-item .sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(240,200,90,.15);
  color: var(--gold);
  white-space: nowrap;
  align-self: flex-start;
}
.badge.badge-done { background: rgba(62,207,142,.15); color: var(--safe); }
.badge.badge-shipped { background: rgba(90,170,255,.15); color: #7cb3ff; }
.badge.badge-pending { background: rgba(240,200,90,.15); color: var(--gold); }

.point-change {
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}
.point-change.pos { color: var(--safe); }
.point-change.neg { color: var(--danger); }

.nav-bottom {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.nav-bottom a {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 13px;
  background: rgba(0,0,0,.25);
}

.pagination { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; padding: 0; margin: 0; }
.pagination li a, .pagination li span {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
}
.pagination li.active span { background: linear-gradient(180deg,#ffe08a,#d4a53a); color:#2a1c08; border-color: transparent; }


/* ===== Modals ===== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.overlay.show { display: flex; }
.overlay.center { align-items: center; }

.sheet {
  width: 100%;
  max-width: 480px;
  background: #fff;
  color: #222;
  border-radius: 20px 20px 0 0;
  padding: 18px 16px 20px;
  max-height: 92vh;
  overflow-y: auto;
  animation: sheetUp .28s ease;
  box-shadow: 0 -10px 40px rgba(0,0,0,.4);
}
.sheet::before {
  content: "";
  display: block;
  width: 36px; height: 4px;
  border-radius: 999px;
  background: #e5e5e5;
  margin: 0 auto 14px;
}
@keyframes sheetUp {
  from { transform: translateY(40px); opacity: .6; }
  to { transform: translateY(0); opacity: 1; }
}

.sheet-tip {
  font-size: 13px;
  color: #666;
  margin: 0 0 16px;
  line-height: 1.5;
  background: #fff8e8;
  border: 1px solid #ffe6ab;
  border-radius: 10px;
  padding: 9px 12px;
}
.sheet-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 15px;
}
.sheet-row .label { color: #333; }
.sheet-row .value { color: #111; font-weight: 600; }
.sheet-row .value.muted { color: #999; font-weight: 400; }
.sheet-row .value.deduct { color: #e53e3e; font-weight: 700; }

.pay-methods {
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
  margin: 4px 0;
}
.pay-method-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 2px;
  border-bottom: 1px solid #f5f5f5;
  cursor: pointer;
  border-radius: 10px;
  transition: background .15s ease;
}
.pay-method-item:active { background: #fafafa; }
.pay-method-item:last-child { border-bottom: none; }
.pay-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  position: relative;
}
.pay-method-item.active .pay-radio {
  border-color: #e53935;
}
.pay-method-item.active .pay-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #e53935;
}
.method-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.method-icon.balance-icon { background: linear-gradient(145deg, #f0c85a, #c9972a); color: #3a2708; box-shadow: 0 3px 8px rgba(201,151,42,.35); }
.method-icon.bank-icon { background: linear-gradient(145deg, #ff5a5a, #d62828); }
.method-info { flex: 1; min-width: 0; }
.method-name { font-size: 15px; color: #222; font-weight: 600; }
.method-sub { font-size: 12px; color: #999; margin-top: 2px; }
.method-switch-hint {
  font-size: 11px;
  color: #c62828;
  background: #fff0f0;
  border-radius: 999px;
  padding: 4px 9px;
  flex-shrink: 0;
  white-space: nowrap;
  font-weight: 600;
}

.method-bank-logo {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0,0,0,.15);
}
.bound-tag {
  display: inline-block;
  background: #e8f8ef;
  color: #0a9d56;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-right: 5px;
  font-weight: 600;
  vertical-align: middle;
}
.bank-mini-icons {
  display: flex;
  gap: 4px;
  margin-top: 7px;
  flex-wrap: wrap;
}
.bank-mini-icons img {
  width: 22px;
  height: 22px;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
}

.bank-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0 6px;
}
.bank-list-tip {
  margin: 0 0 2px;
  font-size: 12px;
  color: #999;
}
.bank-card-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border: 1px solid #eee;
  border-radius: 13px;
  background: #fafafa;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.bank-card-item img {
  width: 40px;
  height: 40px;
  border-radius: 9px;
  flex-shrink: 0;
}
.bank-card-meta { flex: 1; min-width: 0; }
.bank-card-name { font-size: 14px; color: #222; font-weight: 600; }
.bank-card-no { font-size: 12px; color: #888; margin-top: 2px; letter-spacing: 0.5px; }
.bank-card-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid #ccc;
  flex-shrink: 0;
  position: relative;
}
.bank-card-item.active {
  border-color: #e53935;
  background: #fff7f7;
}
.bank-card-item.active .bank-card-check {
  border-color: #e53935;
}
.bank-card-item.active .bank-card-check::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #e53935;
}

.agree-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font-size: 13px;
  color: #444;
  line-height: 1.5;
}
.agree-row input { margin-top: 3px; accent-color: #c62828; }
.agree-row a { color: #c62828; }

.protocol {
  margin-top: 12px;
  font-size: 12px;
  color: #888;
  line-height: 1.7;
  background: #fafafa;
  border-radius: 10px;
  padding: 10px 12px;
}
.protocol h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #555;
  font-weight: 600;
}
.protocol ol {
  margin: 0;
  padding-left: 18px;
}

.pay-btn {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 15px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  background: linear-gradient(90deg, #ff8a4c, #e53935);
  box-shadow: 0 8px 20px rgba(229,57,53,.35);
  transition: transform .12s ease;
}
.pay-btn:active { transform: scale(.98); }
.pay-btn:disabled {
  opacity: .45;
  filter: grayscale(.2);
}
.sheet-close {
  position: absolute;
  right: 14px;
  top: 12px;
  border: none;
  background: #f2f2f2;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 18px;
  color: #999;
  line-height: 1;
}
.sheet-wrap { position: relative; }

/* ===== Win modal ===== */
.win-card {
  width: 92%;
  max-width: 520px;
  background: linear-gradient(180deg, #2e1f0a 0%, #120d08 100%);
  border: 2px solid rgba(240,200,90,.55);
  border-radius: 24px;
  padding: 30px 22px 24px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0,0,0,.55), 0 0 50px rgba(240,200,90,.2);
  animation: popWin .3s ease;
  position: relative;
  z-index: 206;
}
.win-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255,224,138,.5), transparent 40%, transparent 60%, rgba(255,224,138,.5));
  z-index: -1;
  opacity: .8;
}
@keyframes popWin {
  from { transform: scale(.88); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.win-card h3 {
  margin: 0 0 18px;
  font-size: clamp(28px, 7vw, 36px);
  letter-spacing: 2px;
  background: var(--gold-line);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  line-height: 1.25;
}
.win-card .prize-img {
  width: min(240px, 56vw);
  height: min(240px, 56vw);
  object-fit: contain;
  margin: 0 auto 16px;
  display: block;
  filter: drop-shadow(0 0 20px rgba(240,200,90,.45));
  animation: prizeFloat 2.4s ease-in-out infinite;
}
@keyframes prizeFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.win-card .prize-name {
  font-size: clamp(24px, 6vw, 32px);
  color: #ffe08a;
  font-weight: 800;
  margin-bottom: 22px;
  line-height: 1.3;
  word-break: break-word;
}
.win-actions { display: flex; gap: 12px; position: relative; z-index: 1; }
.win-actions button {
  flex: 1;
  border: none;
  border-radius: 14px;
  padding: 16px 12px;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 700;
  cursor: pointer;
  transition: transform .12s ease;
}
.win-actions button:active { transform: scale(.97); }
.btn-again {
  color: #2a1c08;
  background: linear-gradient(180deg, #ffe08a, #d4a53a);
  box-shadow: 0 6px 16px rgba(212,165,58,.4);
}
.btn-close-win {
  color: #f7e7b5;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(240,200,90,.3) !important;
}

#confettiCanvas {
  position: fixed;
  inset: 0;
  z-index: 205;
  pointer-events: none;
}

.rules-modal .sheet {
  border-radius: 18px;
  margin: 16px;
  max-height: 80vh;
}
.rules-modal .sheet::before { display: none; }
