/* ══════════════════════════════════════════
   印尼版抽奖 — 手机 H5 界面
   深色主题 + 玻璃拟态 + 底部抽屉
   ══════════════════════════════════════════ */

:root {
  --bg: #14101d;
  --bg-2: #1c1628;
  --card: #221b30;
  --card-2: #2a2239;
  --line: #372c4a;

  --pink: #ff3d71;
  --pink-2: #e0295a;
  --purple: #8b5cf6;
  --gold: #ffc93c;
  --gold-2: #ff9500;
  --cyan: #22d3ee;
  --green: #34d399;

  --text: #ffffff;
  --text-2: #a89fc0;
  --text-3: #6f6688;

  --r-lg: 22px;
  --r-md: 16px;
  --r-sm: 12px;

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html {
  height: 100%;
  overscroll-behavior: none;
}

body {
  margin: 0;
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", "Noto Sans", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

/* ── 背景光效 ───────────────── */
.bg-fx {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: .5;
}
.orb-1 {
  width: 300px; height: 300px;
  top: -110px; left: -90px;
  background: radial-gradient(circle, #ff3d71, transparent 68%);
  animation: float1 15s ease-in-out infinite;
}
.orb-2 {
  width: 260px; height: 260px;
  top: 120px; right: -110px;
  background: radial-gradient(circle, #8b5cf6, transparent 68%);
  animation: float2 19s ease-in-out infinite;
}
.orb-3 {
  width: 240px; height: 240px;
  bottom: 60px; left: -100px;
  background: radial-gradient(circle, #22d3ee, transparent 70%);
  opacity: .28;
  animation: float1 22s ease-in-out infinite reverse;
}
@keyframes float1 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(26px,32px) scale(1.14); }
}
@keyframes float2 {
  0%,100% { transform: translate(0,0) scale(1); }
  50% { transform: translate(-28px,22px) scale(1.1); }
}

/* ── App 容器 ─────────────────── */
.app {
  position: relative;
  z-index: 1;
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: rgba(20,16,29,.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* ── 顶部栏 ─────────────────── */
.topbar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 12px) 16px 10px;
  background: linear-gradient(180deg, rgba(20,16,29,.96), rgba(20,16,29,0));
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-size: 14.5px; font-weight: 800; letter-spacing: -.01em; }
.brand-tag { font-size: 9.5px; color: var(--text-2); font-weight: 500; }

.topbar-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: rgba(255,255,255,.07);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
}
.topbar-btn:active { background: rgba(255,255,255,.12); }
.topbar-btn .dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 6px var(--cyan);
}

/* ── 滚动区 ─────────────────── */
.scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding: 0 16px calc(20px + var(--safe-bottom));
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { display: none; }

/* ── Hero ───────────────────── */
.hero { padding: 8px 0 18px; text-align: center; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: .1em;
  color: var(--gold);
  background: rgba(255,201,60,.12);
  border: 1px solid rgba(255,201,60,.26);
  padding: 5px 11px;
  border-radius: 999px;
  margin-bottom: 13px;
}
.pulse {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.8); }
}

.hero-title {
  margin: 0 0 16px;
  font-size: 25px;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -.025em;
}
.hero-title em {
  font-style: normal;
  background: linear-gradient(100deg, var(--gold) 0%, var(--pink) 55%, var(--purple) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: rgba(255,255,255,.05);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 8px;
}
.hs { display: flex; flex-direction: column; align-items: center; gap: 2px; flex: 1; }
.hs b {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
  background: linear-gradient(180deg, #fff, #b9aecd);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hs span { font-size: 9.5px; color: var(--text-3); font-weight: 600; letter-spacing: .02em; }
.hs-div { width: 1px; height: 22px; background: var(--line); }

/* ── 转盘 ───────────────────── */
.wheel-wrap {
  position: relative;
  margin: 4px 0 20px;
  padding: 8px;
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(255,61,113,.16), rgba(139,92,246,.14));
  border: 1px solid rgba(255,255,255,.09);
}
.wheel-glow {
  position: absolute;
  inset: -12px;
  border-radius: 34px;
  background: radial-gradient(ellipse at 50% 40%, rgba(255,201,60,.24), transparent 66%);
  filter: blur(18px);
  pointer-events: none;
  animation: glowPulse 3.2s ease-in-out infinite;
}
@keyframes glowPulse {
  0%,100% { opacity: .55; }
  50% { opacity: 1; }
}

.wheel {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
  background: rgba(12,9,18,.6);
  border-radius: 21px;
  padding: 3px;
}

.cell {
  aspect-ratio: 1 / .94;
  border-radius: 14px;
  background: linear-gradient(155deg, #2c2340, #241d34);
  border: 1px solid rgba(255,255,255,.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  position: relative;
  overflow: hidden;
  transition: transform .13s ease, background .13s ease, box-shadow .13s ease;
}
.cell .emoji {
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,.4));
}
.cell .name {
  font-size: 8.5px;
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  line-height: 1.12;
  padding: 0 1px;
  letter-spacing: -.01em;
}

/* 高亮格子 */
.cell.active {
  background: linear-gradient(155deg, #ff3d71, #d6204f);
  border-color: rgba(255,255,255,.34);
  box-shadow: 0 0 0 2px rgba(255,201,60,.85), 0 6px 20px rgba(255,61,113,.5);
  transform: scale(1.055);
  z-index: 2;
}
.cell.active .name { color: #fff; }
.cell.active .emoji { transform: scale(1.12); }

.cell.win {
  background: linear-gradient(155deg, #ffc93c, #ff9500);
  border-color: rgba(255,255,255,.5);
  box-shadow: 0 0 0 2.5px #fff, 0 8px 26px rgba(255,201,60,.64);
  animation: winPop .52s cubic-bezier(.24,1.5,.4,1) 2;
}
@keyframes winPop {
  0%,100% { transform: scale(1.055); }
  50% { transform: scale(1.13); }
}
.cell.win .name { color: #4a2800; }

/* 中心按钮 */
.cell.center {
  background: linear-gradient(155deg, var(--pink), #b91c46);
  border: none;
  cursor: pointer;
  box-shadow: 0 5px 18px rgba(255,61,113,.5), inset 0 -3px 0 rgba(0,0,0,.24),
    inset 0 2px 0 rgba(255,255,255,.16);
  gap: 1px;
}
.cell.center:active { transform: scale(.94); }
.cell.center .c-icon { font-size: 19px; line-height: 1; }
.cell.center .c-text {
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
}
.cell.center:disabled { opacity: .5; }

/* 指针 */
.wheel-pointer {
  position: absolute;
  top: -3px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 12px solid var(--gold);
  filter: drop-shadow(0 2px 5px rgba(255,201,60,.6));
  z-index: 5;
}

/* ── 抽奖区 ─────────────────── */
.play-zone { margin-bottom: 22px; }

.input-wrap {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,.06);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-bottom: 10px;
  transition: border-color .16s, background .16s;
}
.input-wrap:focus-within {
  border-color: var(--pink);
  background: rgba(255,61,113,.07);
}
.input-wrap.valid { border-color: rgba(52,211,153,.6); }

.input-wrap input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 16px;
  font-weight: 600;
  padding: 14px 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  font-family: inherit;
}
.input-wrap input::placeholder { color: var(--text-3); font-weight: 500; letter-spacing: .06em; }

.input-check {
  padding: 0 14px 0 0;
  color: var(--green);
  font-size: 15px;
  font-weight: 900;
  opacity: 0;
  transform: scale(.6);
  transition: opacity .18s, transform .18s;
}
.input-wrap.valid .input-check { opacity: 1; transform: scale(1); }

/* 主按钮 */
.cta {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--r-md);
  padding: 15px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .02em;
  color: #fff;
  background: linear-gradient(100deg, var(--pink) 0%, #e0295a 50%, var(--purple) 100%);
  background-size: 200% 100%;
  box-shadow: 0 6px 22px rgba(255,61,113,.38);
  cursor: pointer;
  font-family: inherit;
  transition: transform .1s, box-shadow .1s, background-position .4s;
  position: relative;
  overflow: hidden;
}
.cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,.28) 50%, transparent 80%);
  transform: translateX(-120%);
  animation: shine 3.4s ease-in-out infinite;
}
@keyframes shine {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}
.cta:active { transform: scale(.975); box-shadow: 0 3px 12px rgba(255,61,113,.34); }
.cta:disabled {
  background: rgba(255,255,255,.08);
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
}
.cta:disabled::before { display: none; }
.cta-icon { font-size: 16px; }

.play-note {
  margin: 10px 0 0;
  font-size: 10.5px;
  color: var(--text-3);
  text-align: center;
}
.play-note b { color: var(--text-2); }

/* ── 名单 ───────────────────── */
.winners { margin-bottom: 22px; }

.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.sec-head h2 {
  margin: 0;
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -.01em;
}
.live-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--pink);
  background: rgba(255,61,113,.14);
  padding: 4px 8px;
  border-radius: 999px;
}
.live-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--pink);
  animation: pulse 1.3s infinite;
}

.win-list {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: none;
}
.win-list::-webkit-scrollbar { display: none; }

.win-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid rgba(255,255,255,.045);
}
.win-item:last-child { border-bottom: none; }
.win-item.fresh { animation: freshFlash 1.8s ease-out; }
@keyframes freshFlash {
  0% { background: rgba(255,201,60,.2); }
  100% { background: transparent; }
}

.win-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex: 0 0 auto;
  background: linear-gradient(140deg, var(--purple), var(--pink));
}
.win-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.win-phone {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
  color: var(--text-2);
}
.win-time { font-size: 9.5px; color: var(--text-3); }
.win-prize {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  text-align: right;
  flex: 0 0 auto;
  max-width: 42%;
  line-height: 1.25;
}

.win-empty {
  padding: 26px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ── 奖品列表 ───────────────── */
.prize-info { margin-bottom: 16px; }

.prize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.prize-cell {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 11px;
}
.prize-cell .prize-cell .pc-body { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.prize-cell .pc-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.prize-cell .pc-odds {
  font-size: 9px;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
}

.disclaimer {
  text-align: center;
  font-size: 10px;
  color: var(--text-3);
  line-height: 1.65;
  margin: 0 0 8px;
}

/* ══ 底部抽屉 ═══════════════ */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(8,5,14,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: maskIn .2s ease-out;
}
.sheet-mask[hidden] { display: none; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.sheet {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, var(--card-2), var(--card));
  border-radius: 26px 26px 0 0;
  border-top: 1px solid rgba(255,255,255,.1);
  padding: 8px 20px calc(20px + var(--safe-bottom));
  text-align: center;
  animation: sheetUp .3s cubic-bezier(.2,.9,.3,1);
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255,255,255,.2);
  margin: 0 auto 18px;
}

.result-icon {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 14px;
  animation: iconBounce .9s ease-in-out infinite alternate;
  filter: drop-shadow(0 6px 18px rgba(255,201,60,.5));
}
@keyframes iconBounce {
  from { transform: translateY(0) rotate(-3deg); }
  to { transform: translateY(-9px) rotate(3deg); }
}

.result-title {
  margin: 0 0 4px;
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -.025em;
}
.result-sub {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-2);
}

.prize-box {
  background: linear-gradient(135deg, rgba(255,201,60,.16), rgba(255,61,113,.14));
  border: 1.5px solid rgba(255,201,60,.4);
  border-radius: var(--r-lg);
  padding: 18px 14px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.prize-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.16) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: shine 2.6s ease-in-out infinite;
}
.prize-emoji { font-size: 38px; line-height: 1; margin-bottom: 7px; }
.prize-name {
  font-size: 21px;
  font-weight: 900;
  color: var(--gold);
  letter-spacing: -.015em;
  line-height: 1.25;
}

.result-desc {
  margin: 0 0 20px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.6;
}

.sheet-actions { display: flex; flex-direction: column; gap: 9px; }

.btn-text {
  border: none;
  background: transparent;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 600;
  padding: 11px;
  cursor: pointer;
  font-family: inherit;
  border-radius: var(--r-sm);
}
.btn-text:active { background: rgba(255,255,255,.05); }

/* 领取表单 */
.claim-sheet { text-align: left; }
.claim-title {
  margin: 0 0 4px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -.02em;
  text-align: center;
}
.claim-sub {
  margin: 0 0 20px;
  font-size: 12px;
  color: var(--text-2);
  text-align: center;
}

.form-group { margin-bottom: 13px; }
.form-group label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 6px;
  letter-spacing: .01em;
}
.form-group input,
.form-group textarea {
  width: 100%;
  background: rgba(255,255,255,.055);
  border: 1.5px solid var(--line);
  border-radius: var(--r-sm);
  padding: 12px 13px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color .16s, background .16s;
  resize: vertical;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--pink);
  background: rgba(255,61,113,.07);
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-3); }

.rules-list {
  margin: 0 0 20px;
  padding-left: 20px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.75;
}
.rules-list li { margin-bottom: 8px; }
.rules-list b { color: var(--gold); }

/* ══ 撒花 ═══════════════════ */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 150;
  overflow: hidden;
}
.confetti[hidden] { display: none; }
.confetti i {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  opacity: 0;
  animation: fall linear forwards;
}
@keyframes fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(105vh) rotate(640deg); }
}

/* ══ Toast ══════════════════ */
.toast {
  position: fixed;
  bottom: calc(28px + var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(40,32,54,.97);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 8px 26px rgba(0,0,0,.5);
  z-index: 200;
  max-width: 88vw;
  text-align: center;
  line-height: 1.4;
  animation: toastIn .24s cubic-bezier(.2,.9,.3,1.2);
}
.toast[hidden] { display: none; }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.94); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}

/* ══ 小屏适配 ══════════════ */
@media (max-height: 700px) {
  .hero-title { font-size: 21px; margin-bottom: 12px; }
  .hero { padding: 4px 0 12px; }
  .wheel-wrap { margin-bottom: 14px; }
  .cell .emoji { font-size: 21px; }
  .cell .name { font-size: 8px; }
  .cta { padding: 13px; }
  .result-icon { font-size: 44px; }
  .prize-emoji { font-size: 32px; }
}

@media (max-height: 600px) {
  .hero-stats { display: none; }
  .hero-title { font-size: 19px; }
}

/* 横屏 */
@media (orientation: landscape) and (max-height: 500px) {
  .hero { display: none; }
  .scroll { padding-top: 8px; }
}

/* 大屏居中模拟手机 */
@media (min-width: 481px) {
  body { background: #0d0a14; }
  .app {
    box-shadow: 0 0 70px rgba(139,92,246,.16);
    border-left: 1px solid rgba(255,255,255,.06);
    border-right: 1px solid rgba(255,255,255,.06);
  }
}
