/* 中秋夜色：深蓝夜空 × 暖金月光。只做手机竖屏（web-view 里就是这个尺寸）。 */
:root {
  --night: #0b1533; --night-2: #17224f; --ink: #1c1a2e;
  --gold: #f6c453; --gold-2: #ffdf8a; --gold-deep: #c98d1c;
  --paper: rgba(255, 250, 240, 0.96); --paper-2: rgba(255, 244, 220, 0.9);
  --red: #d9483f; --text: #2b2418; --muted: #7a6f5c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: radial-gradient(120% 70% at 50% -10%, #2a3a7a 0%, var(--night-2) 40%, var(--night) 100%);
  background-attachment: fixed;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

/* ── 夜空 ── */
.sky { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.moon {
  position: absolute; right: 8%; top: 4%; width: 92px; height: 92px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8dc, #f6d98a 60%, #e5b95a);
  box-shadow: 0 0 40px 12px rgba(246, 217, 138, 0.35), 0 0 120px 40px rgba(246, 217, 138, 0.15);
  animation: moonFloat 9s ease-in-out infinite;
}
@keyframes moonFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.stars {
  position: absolute; inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff 60%, transparent 62%),
    radial-gradient(1px 1px at 28% 8%, #fff 60%, transparent 62%),
    radial-gradient(1.5px 1.5px at 40% 22%, #ffe9a8 60%, transparent 62%),
    radial-gradient(1px 1px at 63% 12%, #fff 60%, transparent 62%),
    radial-gradient(1px 1px at 78% 28%, #fff 60%, transparent 62%),
    radial-gradient(1.5px 1.5px at 90% 45%, #ffe9a8 60%, transparent 62%),
    radial-gradient(1px 1px at 5% 50%, #fff 60%, transparent 62%),
    radial-gradient(1px 1px at 52% 40%, #fff 60%, transparent 62%);
  animation: twinkle 3.2s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: 0.55; } to { opacity: 1; } }
.cloud {
  position: absolute; height: 26px; border-radius: 30px; opacity: 0.16; background: #fff;
  filter: blur(1px); animation: drift linear infinite;
}
.cloud::before { content: ""; position: absolute; left: 20%; top: -60%; width: 45%; height: 160%; border-radius: 50%; background: #fff; }
.c1 { width: 160px; top: 12%; left: -170px; animation-duration: 60s; }
.c2 { width: 110px; top: 30%; left: -120px; animation-duration: 85s; animation-delay: -30s; }
@keyframes drift { to { transform: translateX(calc(100vw + 200px)); } }
.lantern {
  position: absolute; top: -6px; width: 34px; height: 46px; border-radius: 10px 10px 14px 14px;
  background: linear-gradient(180deg, #ff6b57, #c62828); color: #ffe6a3; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 22px rgba(255, 107, 87, 0.55); transform-origin: 50% -30px; animation: sway 4s ease-in-out infinite;
}
.lantern::before { content: ""; position: absolute; top: -30px; left: 50%; width: 2px; height: 30px; background: #f6c453; transform: translateX(-50%); }
.lantern::after { content: ""; position: absolute; bottom: -12px; left: 50%; width: 3px; height: 12px; background: #f6c453; transform: translateX(-50%); }
.l1 { left: 8%; } .l2 { left: 20%; top: 2%; animation-delay: -2s; }
@keyframes sway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.petals i {
  position: absolute; top: -20px; width: 8px; height: 8px; border-radius: 50% 0; background: #ffd97a; opacity: 0.85;
  animation: fall linear infinite;
}
.petals i:nth-child(1){left:6%;animation-duration:14s} .petals i:nth-child(2){left:18%;animation-duration:17s;animation-delay:-5s}
.petals i:nth-child(3){left:31%;animation-duration:12s;animation-delay:-8s} .petals i:nth-child(4){left:44%;animation-duration:16s;animation-delay:-2s}
.petals i:nth-child(5){left:57%;animation-duration:19s;animation-delay:-11s} .petals i:nth-child(6){left:70%;animation-duration:13s;animation-delay:-6s}
.petals i:nth-child(7){left:83%;animation-duration:15s;animation-delay:-3s} .petals i:nth-child(8){left:94%;animation-duration:18s;animation-delay:-9s}
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }

/* ── 门 ── */
.gate { position: relative; z-index: 1; min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.gate-card {
  width: 100%; max-width: 360px; padding: 32px 24px; border-radius: 22px; text-align: center;
  background: var(--paper); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45), inset 0 0 0 2px var(--gold);
}
.gate-icon { font-size: 56px; }
.gate-title { margin: 8px 0 6px; font-size: 22px; color: var(--ink); }
.gate-text { margin: 0; color: var(--text); }
.gate-sub { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ── 主体 ── */
.app { position: relative; z-index: 1; max-width: 480px; margin: 0 auto; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); }
.hd { text-align: center; color: #fff; padding: 8px 0 10px; }
.hd-eyebrow { font-size: 12px; letter-spacing: 3px; color: var(--gold-2); opacity: 0.9; }
.hd-title {
  margin: 4px 0 2px; font-size: 30px; font-weight: 900; letter-spacing: 2px;
  background: linear-gradient(180deg, #fff6d5, var(--gold) 55%, var(--gold-deep)); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 2px 18px rgba(246, 196, 83, 0.25);
}
.hd-sub { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.85); }
.chips { display: flex; gap: 8px; justify-content: center; margin: 6px 0 14px; flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-size: 13px;
  background: rgba(255, 255, 255, 0.12); color: #fff; border: 1px solid rgba(255, 255, 255, 0.22); backdrop-filter: blur(6px);
}
.chip b { font-size: 15px; color: var(--gold-2); }
.chip-me b { color: #fff; font-weight: 600; }

/* ── 转盘 ── */
.wheel-wrap { position: relative; margin: 8px auto 14px; width: min(88vw, 340px); }
.pointer {
  position: absolute; left: 50%; top: -6px; z-index: 3; width: 0; height: 0; transform: translateX(-50%);
  border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 34px solid var(--red);
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.45));
}
.pointer::after { content: ""; position: absolute; left: -9px; top: -40px; width: 18px; height: 18px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px var(--red); }
.wheel-ring {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%;
  padding: 10px;
  background: conic-gradient(from 0deg, var(--gold-deep), var(--gold-2), var(--gold-deep), var(--gold-2), var(--gold-deep));
  box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12), 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 0 18px rgba(0, 0, 0, 0.35);
}
.wheel-ring::before {
  /* 环上的灯泡 */
  content: ""; position: absolute; inset: 2px; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, #fff8dc 0 4deg, transparent 4deg 18deg);
  -webkit-mask: radial-gradient(circle, transparent 0 calc(50% - 9px), #000 calc(50% - 8px) calc(50% - 3px), transparent calc(50% - 2px));
  mask: radial-gradient(circle, transparent 0 calc(50% - 9px), #000 calc(50% - 8px) calc(50% - 3px), transparent calc(50% - 2px));
  animation: bulbs 0.9s steps(2) infinite; pointer-events: none;
}
@keyframes bulbs { to { transform: rotate(9deg); } }
.wheel {
  display: block; width: 100%; height: 100%; border-radius: 50%;
  background: #fff; box-shadow: inset 0 0 0 3px var(--gold-deep);
  transform: rotate(0deg); will-change: transform;
}
.wheel.spinning { transition: transform 5.2s cubic-bezier(0.12, 0.62, 0.04, 1); }
.seg-text { font-size: 7.5px; font-weight: 800; fill: #3a2a0a; text-anchor: middle; }
.seg-emoji { font-size: 12px; text-anchor: middle; }
.seg-sub { font-size: 5.5px; fill: #6b5a3a; text-anchor: middle; }
.spin-btn {
  position: absolute; left: 50%; top: 50%; z-index: 2; width: 26%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; border: 4px solid #fff; cursor: pointer; padding: 0;
  background: radial-gradient(circle at 40% 35%, #ff8a75, var(--red) 65%, #a32a22);
  color: #fff; font-weight: 900; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45), 0 0 0 5px var(--gold);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform 0.15s ease;
}
.spin-btn:active { transform: translate(-50%, -50%) scale(0.94); }
.spin-btn[disabled] { filter: grayscale(0.5) brightness(0.8); cursor: not-allowed; }
.spin-main { font-size: 20px; letter-spacing: 2px; }
.spin-sub { font-size: 10px; opacity: 0.95; font-weight: 600; }
.wheel-meta { margin-top: 12px; text-align: center; font-size: 13px; color: rgba(255, 255, 255, 0.85); }
.wheel-meta .dot { margin: 0 8px; opacity: 0.5; }
.closed { margin-top: 10px; padding: 10px 14px; border-radius: 12px; text-align: center; font-size: 14px; color: #fff; background: rgba(217, 72, 63, 0.75); }

/* ── 喜报 ── */
.ticker { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; padding: 8px 12px; border-radius: 999px; background: rgba(246, 196, 83, 0.16); border: 1px solid rgba(246, 196, 83, 0.35); color: #fff; }
.ticker-label { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--gold-2); }
.ticker-track { flex: 1; min-width: 0; overflow: hidden; }
.ticker-inner { display: inline-block; white-space: nowrap; font-size: 13px; animation: ticker linear infinite; animation-duration: 28s; padding-right: 60px; }
@keyframes ticker { from { transform: translateX(100%); } to { transform: translateX(-100%); } }

/* ── 面板 ── */
.panel { margin: 12px 0; padding: 16px; border-radius: 18px; background: var(--paper); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), inset 0 0 0 1.5px rgba(246, 196, 83, 0.55); }
.panel-title { margin: 0 0 10px; font-size: 15px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.panel-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: linear-gradient(180deg, var(--gold), var(--gold-deep)); }
.prize-list, .rec-list { list-style: none; margin: 0; padding: 0; }
.prize-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed rgba(122, 111, 92, 0.25); }
.prize-list li:last-child, .rec-list li:last-child { border-bottom: 0; }
.prize-dot { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,0.12); }
.prize-name { flex: 1; min-width: 0; font-weight: 600; }
.prize-name small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.prize-prob { font-variant-numeric: tabular-nums; color: var(--gold-deep); font-weight: 700; }
.prize-out { color: var(--muted); text-decoration: line-through; }
.rec-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed rgba(122, 111, 92, 0.25); font-size: 14px; }
.rec-name { flex: 1; min-width: 0; }
.rec-cost { font-size: 12px; color: var(--muted); }
.rec-time { font-size: 12px; color: var(--muted); }
.rec-empty { color: var(--muted); font-size: 14px; }
.notice { white-space: pre-wrap; font-size: 14px; color: var(--text); line-height: 1.7; }
.ft { margin: 18px 4px 0; font-size: 11px; line-height: 1.6; color: rgba(255, 255, 255, 0.55); text-align: center; }

/* ── 结果弹窗 ── */
.mask { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; background: rgba(5, 10, 30, 0.72); padding: 24px; }
.result {
  position: relative; width: 100%; max-width: 320px; padding: 28px 22px 22px; border-radius: 24px; text-align: center; overflow: hidden;
  background: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,0.6), inset 0 0 0 3px var(--gold);
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}
@keyframes pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.result-glow { position: absolute; inset: -40%; background: conic-gradient(from 0deg, transparent 0 20deg, rgba(246,196,83,0.18) 20deg 40deg); animation: spinGlow 8s linear infinite; pointer-events: none; }
@keyframes spinGlow { to { transform: rotate(360deg); } }
.result-emoji { position: relative; font-size: 64px; line-height: 1; }
.result-title { position: relative; margin-top: 10px; font-size: 14px; letter-spacing: 3px; color: var(--muted); }
.result-name { position: relative; margin-top: 4px; font-size: 24px; font-weight: 900; color: var(--ink); }
.result-desc { position: relative; margin-top: 6px; font-size: 13px; color: var(--muted); min-height: 1.5em; }
.result-btn {
  position: relative; margin-top: 18px; width: 100%; height: 46px; border: 0; border-radius: 999px; cursor: pointer;
  background: linear-gradient(180deg, var(--gold-2), var(--gold) 60%, var(--gold-deep)); color: #3a2a0a; font-size: 16px; font-weight: 900;
  box-shadow: 0 6px 0 #9a6a10;
}
.result-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 #9a6a10; }

/* ── toast ── */
.toast { position: fixed; left: 50%; bottom: 14%; z-index: 60; transform: translateX(-50%); max-width: 80vw; padding: 10px 16px; border-radius: 12px; background: rgba(0,0,0,0.78); color: #fff; font-size: 14px; text-align: center; }
