/* 抽奖弹窗：紫红品牌色、暖金灯圈和独立奖品插画。 */
.lottery-dialog {
  width: 400px;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 24px);
  padding: 32px 16px 20px;
  border: 1px solid #efc792;
  border-radius: 20px;
  overflow-x: hidden;
  overscroll-behavior: contain;
  color: #fff2d6;
  background:
    radial-gradient(ellipse at 50% 42%, #dc4a64 0%, transparent 65%),
    linear-gradient(160deg, #a81d4c, #86133e 70%, #6a1639);
  box-shadow: 0 20px 80px #260b2766, inset 0 1px 0 #ffe5b470;
}
.lottery-dialog::backdrop { background: #251321b8; }
.lottery-dialog[open] { animation: lottery-enter 280ms var(--ease) both; }
.lottery-dialog #dialog-body { position: relative; }
.lottery-dialog h2 {
  padding: 0 24px;
  color: #fff1c9;
  font-family: var(--display);
  font-size: 36px;
  line-height: 1.3;
  text-align: center;
  letter-spacing: .04em;
  text-shadow: 0 2px 0 #6b1539;
}
.lottery-dialog .close {
  right: -9px;
  top: -25px;
  z-index: 4;
  color: #ffe5cc;
}
.lottery-dialog :focus-visible { outline-color: #ffdc8e; }
.wheel-panel { text-align: center; }
.lottery-dialog p.wheel-intro {
  margin: 8px 0 12px;
  color: #f8d7da;
  font-size: 13px;
}
.chance-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 3px 16px;
  border: 1px solid #f5c79366;
  border-radius: 20px;
  background: #6c153d55;
  font-size: 12px;
  color: #ffe8c4;
}
.chance-pill b { font-size: 18px; line-height: 1.3; color: #ffdd8d; }
.wheel-stage { position: relative; isolation: isolate; margin: 20px auto 0; }
.wheel-wrap {
  position: relative;
  z-index: 1;
  width: min(100%, 328px);
  aspect-ratio: 1;
  margin: auto;
  border: 2px solid #ffe4a6;
  border-radius: 50%;
  background: linear-gradient(135deg, #e2a557, #ffe5a1 26%, #c1843b 55%, #ffde91 84%, #e6b25d);
  box-shadow: 0 6px 0 #943c3d, 0 11px 0 #65213d, 0 15px 24px #3d092e42;
}
.wheel-wrap::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1px solid #803143;
  background: linear-gradient(#be3654, #8d1d45);
}
.wheel {
  position: absolute;
  inset: 18px;
  overflow: hidden;
  border: 3px solid #ffe7aa;
  border-radius: 50%;
  background: repeating-conic-gradient(from -30deg, #fff3d6 0deg 60deg, #ffd8c5 60deg 120deg);
  box-shadow: inset 0 0 0 1px #bb825b, 0 0 0 2px #6f2145;
  transform: rotate(0deg);
}
.is-spinning .wheel { will-change: transform; }
.wheel-sector {
  position: absolute;
  inset: 0;
  transform: rotate(var(--angle));
}
.wheel-sector::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: conic-gradient(from -30deg, #ffc54f 0deg 60deg, transparent 60deg);
  transition: opacity 220ms ease;
}
.wheel-sector.is-winner::before { opacity: .7; }
.sector-content {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 74px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: #77353d;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
}
.prize-art { display: block; width: 52px; height: 52px; object-fit: contain; }
.wheel-lights { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; }
.wheel-lights i {
  position: absolute;
  inset: 0;
  transform: rotate(var(--bulb-angle));
}
.wheel-lights i::after {
  content: "";
  position: absolute;
  top: 8px;
  left: calc(50% - 3px);
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff2bd;
  box-shadow: 0 0 4px #ffdc8c;
}
.wheel-lights i:nth-child(even)::after { opacity: .48; }
.is-spinning .wheel-lights i::after {
  animation: wheel-light 720ms ease-in-out var(--bulb-delay) infinite alternate;
}
.pointer {
  position: absolute;
  z-index: 3;
  top: -10px;
  left: calc(50% - 15px);
  width: 30px;
  height: 48px;
  transform-origin: 50% 10px;
  filter: drop-shadow(0 2px 2px #76183180);
}
.pointer::before {
  content: "";
  position: absolute;
  inset: 0;
  clip-path: polygon(0 0, 100% 0, 100% 40%, 50% 100%, 0 40%);
  background: linear-gradient(110deg, #fff5cb, #e8af52);
}
.pointer span {
  display: block;
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  top: 7px;
  left: 10px;
  background: #9e2b4c;
  box-shadow: inset 0 1px 2px #6f173a;
}
.wheel-start {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 50%;
  width: 86px;
  height: 86px;
  transform: translate(-50%, -50%);
  border: 4px solid #f6cd86;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #df4d65, #ae194a 60%, #86183e);
  color: #fff1c7;
  box-shadow: 0 4px 0 #6e2143, 0 6px 12px #8c244940, inset 0 2px 0 #ffb4a9;
  transition: box-shadow 160ms ease, filter 160ms ease;
}
.wheel-start strong { font-size: 21px; line-height: 1.4; }
.wheel-start small { font-size: 12px; margin-top: 2px; color: #ffe0c4; }
.wheel-start:hover { filter: brightness(1.08); }
.wheel-start:active { box-shadow: 0 1px 0 #6e2143, inset 0 1px 8px #831438; }
.wheel-start:disabled { opacity: 1; cursor: wait; }
.is-settled .wheel-start:disabled { cursor: default; }
.wheel-plinth {
  position: relative;
  z-index: 0;
  margin: -14px auto 0;
  width: 62%;
  height: 30px;
  border-radius: 50%;
  background: #ffd48a;
  border: 4px solid #a24c4b;
  box-shadow: 0 5px 0 #69213d;
}
.lottery-dialog p.wheel-status {
  min-height: 23px;
  margin: 15px 0 10px;
  color: #ffe6b4;
  font-size: 13px;
}
.wheel-footnote { font-size: 12px; color: #f0b9c7; }
.wheel-footnote .icon { width: 13px; height: 13px; margin-right: 3px; }
/* 结果卡采用奖券形态。回看历史结果时不重复播放彩纸。 */
.reward-dialog { padding: 40px 24px 20px; }
.reward-dialog h2 { font-size: 31px; letter-spacing: .05em; }
.reward-content { position: relative; text-align: center; z-index: 1; }
.lottery-dialog p.reward-subtitle { font-size: 12px; color: #f7cfce; margin: 8px 0 24px; }
.reward-ticket {
  position: relative;
  padding: 22px 20px 16px;
  border: 1px solid #ffdc9a;
  border-radius: 15px;
  background: linear-gradient(135deg, #fff9e7, #ffe7c5);
  color: #742c40;
  box-shadow: 0 7px 0 #6e183957;
}
.reward-ticket::before, .reward-ticket::after {
  content: "";
  position: absolute;
  bottom: 44px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #8b1944;
}
.reward-ticket::before { left: -8px; }
.reward-ticket::after { right: -8px; }
.reward-art {
  width: 132px;
  height: 132px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle, #fff9e4 35%, #f6cf9330 68%, transparent 69%);
}
.reward-art .prize-art { width: 116px; height: 116px; }
.reward-ticket h3 { font-size: 30px; font-weight: 600; letter-spacing: .06em; }
.lottery-dialog .reward-ticket p { font-size: 12px; color: #93604f; margin: 4px 0 20px; }
.ticket-divider { border-top: 1px dashed #d5ad8d; margin-bottom: 13px; }
.reward-ticket > span { font-size: 12px; color: #866654; }
.reward-ticket > span .icon { width: 15px; height: 15px; margin-right: 3px; }
.lottery-dialog p.reward-note { color: #ffe1c5; font-size: 13px; margin: 20px 0 13px; }
.reward-done {
  width: 100%;
  min-height: 48px;
  border: 1px solid #ffe7ba;
  border-radius: 20px;
  background: linear-gradient(#ffe9ba, #f3c580);
  box-shadow: 0 3px 0 #be7a43;
  color: #7a293a;
  font-weight: 600;
  font-size: 16px;
}
.reward-done:hover { background: #ffdf9f; }
.lottery-dialog p.reward-disclaimer { color: #e8acbb; font-size: 12px; margin: 12px 0 0; }
.confetti { position: absolute; inset: 0; z-index: 3; pointer-events: none; overflow: hidden; }
.confetti i {
  position: absolute;
  top: -12px;
  left: var(--x);
  width: 6px;
  height: 12px;
  border-radius: 1px;
  background: var(--color);
  animation: confetti-fall 1450ms cubic-bezier(.15,.4,.6,1) var(--delay) both;
}
.confetti i:nth-child(3n) { width: 7px; height: 7px; border-radius: 50%; }
@keyframes lottery-enter { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes wheel-light { from { opacity: .45; } to { opacity: 1; } }
@keyframes confetti-fall {
  0% { opacity: 0; transform: translate3d(0, 0, 0) rotate(0deg); }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate3d(var(--drift), 430px, 0) rotate(var(--turn)); }
}
@media (max-width: 360px) {
  .lottery-dialog { padding-inline: 12px; }
  .lottery-dialog h2 { font-size: 30px; }
  .sector-content { top: 6px; font-size: 11px; gap: 0; }
  .sector-content .prize-art { width: 44px; height: 44px; }
  .wheel-start { width: 76px; height: 76px; }
  .wheel-start strong { font-size: 18px; }
  .wheel-footnote { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .lottery-dialog[open], .is-spinning .wheel-lights i::after, .confetti i { animation: none; }
  .confetti { display: none; }
}
