:root {
  --orange: #F27232;
  --orange-d: #D9561A;
  --orange-l: #FFA36B;
  --orange-bg: #FFF1E7;
  --cream: #FFFBF8;
  --green: #43B546;
  --ink: #2B1D14;
  --ink-2: #6B5344;
  --muted: #A08A7B;
  --line: #F4E5D9;
  --card: #FFFFFF;
  --shadow-sm: 0 4px 14px rgba(190, 120, 70, .07);
  --shadow: 0 12px 34px rgba(190, 120, 70, .10);
}

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

[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  background: linear-gradient(180deg, #FFF8F2 0%, #FFFCFA 32%, #FFF9F5 100%);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* ---------------- 背景光斑 ---------------- */
.bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.bg__blob { position: absolute; border-radius: 50%; filter: blur(80px); }
.bg__blob--1 { width: 460px; height: 460px; background: #FFE0C6; opacity: .55; top: -190px; right: -160px; }
.bg__blob--2 { width: 420px; height: 420px; background: #FFF0D6; opacity: .6; top: 34%; left: -220px; }
.bg__blob--3 { width: 380px; height: 380px; background: #FFE6D4; opacity: .45; bottom: -180px; right: -120px; }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: 30px 20px 46px;
}

/* ---------------- 头部 ---------------- */
.hero { text-align: center; padding-top: 12px; }

.hero__title {
  font-size: 34px;
  line-height: 1.24;
  margin: 0;
  font-weight: 800;
  letter-spacing: .01em;
  background: linear-gradient(104deg, #F58B4C 0%, #E04A16 46%, #F27232 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__sub {
  margin: 10px 0 0;
  font-size: 14px;
  color: var(--ink-2);
  letter-spacing: .01em;
}
.hero__sub:empty { display: none; }

/* ---------------- 转盘 ---------------- */
.wheel-sec {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 30px 0 32px;
}

.wheel-stage {
  position: relative;
  width: min(88vw, 500px);
  aspect-ratio: 1 / 1;
}

/* 外圈光晕 */
.wheel-halo {
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, #FFD3AE, #F27232, #FFE2C8, #F27232, #FFD3AE);
  filter: blur(26px);
  opacity: .35;
  animation: haloSpin 16s linear infinite;
  z-index: 0;
}
@keyframes haloSpin { to { transform: rotate(360deg); } }

.wheel-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(160deg, #FFFFFF 0%, #FFF6EE 100%);
  box-shadow:
    0 2px 0 rgba(255, 255, 255, .9) inset,
    0 0 0 1px rgba(242, 114, 50, .14),
    0 18px 42px rgba(205, 115, 55, .18),
    0 6px 14px rgba(205, 115, 55, .10);
  z-index: 1;
}

/* canvas 是替换元素：必须写死宽高，只给 inset 会按 900x900 固有尺寸绘制，撑破容器 */
#wheel {
  position: absolute;
  left: 12px;
  top: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  display: block;
  border-radius: 50%;
  z-index: 2;
}

/* 指针 */
.pointer {
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: linear-gradient(155deg, #FF9C5E, #D9561A);
  box-shadow: 0 5px 12px rgba(200, 85, 30, .4), inset 0 1px 0 rgba(255, 255, 255, .5);
  z-index: 6;
}
.pointer i {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid #D9561A;
  filter: drop-shadow(0 2px 3px rgba(180, 70, 20, .35));
}

/* 中心按钮 */
.spin-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 6px solid #fff;
  background: linear-gradient(158deg, #FFA167 0%, #F27232 46%, #D1510F 100%);
  color: #fff;
  cursor: pointer;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0;
  box-shadow:
    0 10px 24px rgba(210, 85, 25, .38),
    inset 0 -4px 10px rgba(150, 50, 10, .28),
    inset 0 2px 4px rgba(255, 210, 175, .55);
  transition: transform .16s ease, box-shadow .2s;
}
.spin-btn::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(242, 114, 50, .45);
  animation: btnPulse 2.4s ease-out infinite;
  pointer-events: none;
}
@keyframes btnPulse {
  0% { transform: scale(1); opacity: .55; }
  70% { transform: scale(1.22); opacity: 0; }
  100% { transform: scale(1.22); opacity: 0; }
}
.spin-btn:active { transform: translate(-50%, -50%) scale(.95); }
.spin-btn:disabled { cursor: not-allowed; filter: saturate(.7) brightness(.98); }
.spin-btn:disabled::after { animation: none; opacity: 0; }

.spin-btn__main {
  font-size: clamp(17px, 4.6vw, 22px);
  font-weight: 800;
  letter-spacing: .1em;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(140, 50, 10, .25);
}
.spin-btn__hint {
  font-size: clamp(9px, 2.4vw, 11px);
  opacity: .92;
  letter-spacing: .02em;
}

.wheel-tip {
  margin: 22px 0 0;
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: .02em;
}

/* ---------------- 卡片通用 ---------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px 20px 8px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}

.card__title {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  position: relative;
  padding-left: 12px;
  letter-spacing: .01em;
}
.card__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  width: 3px;
  height: 15px;
  border-radius: 2px;
  background: linear-gradient(180deg, #FFA36B, #F27232);
}

.card__extra { font-size: 12px; color: var(--muted); }

.dot-live {
  font-size: 11.5px;
  color: var(--green);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot-live i {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(67, 181, 70, .14);
  animation: pulse 1.8s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .35; transform: scale(.7); }
}

/* ---------------- 奖品 ---------------- */
.prize-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding-bottom: 14px;
}

.prize {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 5px;
  min-height: 68px;
  padding: 14px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #FFFDFB, #FFF9F5);
  border: 1px solid #F7E8DC;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.prize:hover {
  transform: translateY(-2px);
  border-color: #F6D3B8;
  box-shadow: var(--shadow-sm);
}

.prize__name {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
  overflow-wrap: break-word;
  word-break: break-word;
}

.prize__meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.5;
  overflow-wrap: break-word;
  word-break: break-word;
}

.prize__tag {
  margin-top: 2px;
  font-size: 10.5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--orange-bg);
  color: #C0491A;
  white-space: nowrap;
  line-height: 1.7;
}

.prize.is-empty { opacity: .62; }
.prize.is-empty .prize__tag { background: #F4F1EE; color: #9C8F85; }

.empty {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  padding: 20px 0 24px;
  margin: 0;
}

/* ---------------- 中奖名单 ---------------- */
.winner-list {
  list-style: none;
  margin: 0;
  padding: 0 0 14px;
  max-height: 232px;
  overflow-y: auto;
}
.winner-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed #F7EBE1;
  font-size: 12.5px;
}
.winner-list li:last-child { border-bottom: 0; }

.w-avatar {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--orange-bg);
  color: var(--orange-d);
  font-size: 11.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.w-name { width: 62px; flex: none; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-prize {
  flex: 1;
  color: var(--orange-d);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.w-time { color: var(--muted); font-size: 11px; flex: none; }

/* ---------------- 规则 ---------------- */
.rules__body {
  font-size: 13px;
  color: var(--ink-2);
  white-space: pre-wrap;
  padding-bottom: 18px;
  line-height: 2;
}

/* ---------------- 页脚 ---------------- */
.foot {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: #BCA898;
  margin-top: 26px;
}

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal[hidden] { display: none !important; }

.modal__mask {
  position: absolute;
  inset: 0;
  background: rgba(60, 35, 20, .42);
  backdrop-filter: blur(3px);
  animation: fade .2s ease;
}

.modal__box {
  position: relative;
  width: min(88vw, 350px);
  background: #fff;
  border-radius: 22px;
  padding: 28px 24px 24px;
  text-align: center;
  box-shadow: 0 26px 64px rgba(120, 60, 20, .28);
  animation: pop .3s cubic-bezier(.2, .9, .3, 1.2);
  overflow: hidden;
}
.modal__box--sm { width: min(80vw, 300px); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(.94); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal__icon { font-size: 44px; line-height: 1; margin-bottom: 10px; position: relative; z-index: 1; }
.modal__title { font-size: 18px; margin: 0 0 6px; font-weight: 800; position: relative; z-index: 1; }
.modal__desc { font-size: 13px; color: var(--muted); margin: 0 0 20px; position: relative; z-index: 1; }

.result__rays {
  position: absolute;
  top: -110px;
  left: 50%;
  transform: translateX(-50%);
  width: 320px;
  height: 320px;
  background: conic-gradient(from 0deg, rgba(255, 190, 130, .55) 0 8deg, transparent 8deg 22deg);
  border-radius: 50%;
  animation: haloSpin 22s linear infinite;
  opacity: .8;
  pointer-events: none;
}

.result__prize {
  font-size: 21px;
  font-weight: 800;
  color: var(--orange-d);
  margin: 0 0 8px;
  line-height: 1.4;
  position: relative;
  z-index: 1;
}

.result__note {
  font-size: 11px;
  color: #C0AC9E;
  margin: 12px 0 0;
  position: relative;
  z-index: 1;
}

.btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: transform .12s, filter .2s;
  position: relative;
  z-index: 1;
}
.btn:active { transform: scale(.97); }
.btn--primary {
  background: linear-gradient(160deg, #FF9556, var(--orange) 50%, var(--orange-d));
  color: #fff;
  box-shadow: 0 10px 22px rgba(217, 86, 26, .3);
  width: 100%;
}
.btn--ghost {
  background: #FFF4EC;
  color: var(--ink-2);
  flex: 0 0 auto;
}

.modal__actions { display: flex; gap: 10px; margin-top: 6px; }
.modal__actions .btn--primary { flex: 1; }

.field { display: block; text-align: left; margin-bottom: 13px; }
.field span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 6px; }
.field input {
  width: 100%;
  border: 1px solid var(--line);
  background: #FFFBF8;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--ink);
  outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.field input:focus {
  border-color: var(--orange-l);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(242, 114, 50, .1);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 44px;
  transform: translateX(-50%);
  background: rgba(43, 29, 20, .9);
  color: #fff;
  font-size: 13px;
  padding: 11px 22px;
  border-radius: 999px;
  z-index: 60;
  animation: pop .2s ease;
  max-width: 80vw;
  text-align: center;
}
.toast[hidden] { display: none !important; }

/* ---------------- 响应式 ---------------- */
@media (min-width: 560px) {
  .prize-grid { grid-template-columns: repeat(3, 1fr); }
  .hero__title { font-size: 38px; }
  .wheel-sec { margin: 34px 0 36px; }
}

@media (min-width: 900px) {
  .wrap { padding-top: 40px; }
  .wheel-stage { width: 520px; }
}
