/* ============================================================
   幸运抽奖 · 参与者页面
   深夜书房 / 墨蓝 + 暖金
   ============================================================ */

:root {
  --ink: #070b14;
  --ink-2: #0b1220;
  --ink-3: #111b2e;
  --gold: #e7c98b;
  --gold-deep: #b98d45;
  --gold-soft: #f7e8c6;
  --cream: #f2e9d8;
  --muted: #a39a86;
  --muted-2: #6f6858;
  --line: rgba(231, 201, 139, 0.22);
  --line-strong: rgba(231, 201, 139, 0.55);
  --seal: #9e2b2b;
  --serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans SC", system-ui, sans-serif;
  --reel-h: 96px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-width: none;
}

html::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ink);
  color: var(--cream);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

button,
input {
  font-family: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: rgba(231, 201, 139, 0.28);
  color: #fff8e9;
}

/* ---------- 背景 ---------- */

.bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  background:
    radial-gradient(1200px 820px at 50% 20%, #1a2439 0%, #0c1423 52%, #070b14 100%);
}

.bg-glow {
  position: absolute;
  left: 50%;
  top: 36%;
  width: min(96vw, 760px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(231, 201, 139, 0.16) 0%, rgba(231, 201, 139, 0.05) 38%, transparent 66%);
  filter: blur(12px);
  animation: breathe 9s ease-in-out infinite;
}

#dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0.85;
}

.bg-vignette {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 40%, rgba(2, 4, 9, 0.55) 100%),
    linear-gradient(180deg, rgba(2, 4, 9, 0.25), transparent 20%, transparent 80%, rgba(2, 4, 9, 0.5));
  pointer-events: none;
}

/* ---------- 画框 ---------- */

.frame {
  position: fixed;
  inset: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  z-index: 1;
  pointer-events: none;
}

.corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border: 0 solid rgba(231, 201, 139, 0.34);
}

.corner.tl {
  top: 0;
  left: 0;
  border-top-width: 1px;
  border-left-width: 1px;
}

.corner.tr {
  top: 0;
  right: 0;
  border-top-width: 1px;
  border-right-width: 1px;
}

.corner.bl {
  bottom: 0;
  left: 0;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.corner.br {
  bottom: 0;
  right: 0;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

/* ---------- 页面骨架 ---------- */

.page {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) clamp(18px, 5vw, 40px) max(16px, env(safe-area-inset-bottom));
}

.topbar {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  animation: fade-down 0.9s ease both;
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 201, 139, 0.5);
  transform: rotate(45deg);
  background: linear-gradient(135deg, rgba(231, 201, 139, 0.12), rgba(231, 201, 139, 0.02));
  box-shadow: 0 0 22px rgba(231, 201, 139, 0.08);
}

.brand-mark i {
  transform: rotate(-45deg);
  font-family: var(--serif);
  font-style: normal;
  font-size: 19px;
  line-height: 1;
  color: var(--gold);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-text b {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 14px;
  letter-spacing: 0.2em;
  color: #e7ddc8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text small {
  font-size: 7.5px;
  letter-spacing: 0.26em;
  color: var(--muted-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sound-toggle {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 201, 139, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.02);
  color: var(--muted);
  cursor: pointer;
  transition: color 0.3s, border-color 0.3s, background 0.3s;
}

.sound-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sound-toggle .icon-sound-on {
  display: none;
}

body.sound-on .sound-toggle {
  color: var(--gold);
  border-color: rgba(231, 201, 139, 0.45);
  background: rgba(231, 201, 139, 0.07);
}

body.sound-on .sound-toggle .icon-sound-on {
  display: block;
}

body.sound-on .sound-toggle .icon-sound-off {
  display: none;
}

.main {
  flex: 1;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vh, 42px) 0 18px;
}

.view {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: view-in 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.view[hidden] {
  display: none !important;
}

/* ---------- 加载 ---------- */

.view-loading {
  gap: 18px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2em;
}

.loader {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(231, 201, 139, 0.18);
  border-radius: 50%;
  position: relative;
  display: block;
}

.loader i {
  position: absolute;
  inset: -1px;
  border: 1px solid transparent;
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1.1s linear infinite;
}

/* ---------- 首屏 ---------- */

.eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin: 0 0 20px;
  font-size: 10px;
  letter-spacing: 0.38em;
  color: var(--gold-deep);
  text-transform: uppercase;
}

.eyebrow-dot {
  width: 3px;
  height: 3px;
  margin: 0 12px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.7;
}

.title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(36px, 9.6vw, 58px);
  line-height: 1.16;
  letter-spacing: 0.08em;
  background: linear-gradient(180deg, #fff8ea 0%, #ecd39a 46%, #be9550 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 8px 30px rgba(231, 201, 139, 0.12));
  text-wrap: balance;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.subtitle {
  margin: 15px 0 0;
  max-width: 26em;
  font-size: 12.5px;
  line-height: 1.9;
  letter-spacing: 0.08em;
  color: #b6ad99;
  text-wrap: balance;
}

.case-wrap {
  position: relative;
  width: min(80vw, 330px);
  height: 264px;
  margin: 20px 0 4px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.case-halo {
  position: absolute;
  left: 50%;
  top: 54%;
  width: 310px;
  height: 310px;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(231, 201, 139, 0.3) 0%, rgba(231, 201, 139, 0.08) 38%, transparent 68%);
  filter: blur(18px);
  animation: breathe 5.5s ease-in-out infinite;
  pointer-events: none;
}

.case-beam {
  position: absolute;
  left: 50%;
  bottom: 46px;
  width: 130px;
  height: 190px;
  transform: translateX(-50%);
  background: linear-gradient(to top, rgba(255, 238, 195, 0.42), rgba(231, 201, 139, 0.08) 55%, transparent);
  filter: blur(14px);
  opacity: 0;
  pointer-events: none;
}

.gift-case {
  position: relative;
  width: 236px;
  height: 210px;
  z-index: 2;
  animation: float 5.4s ease-in-out infinite;
  filter: drop-shadow(0 30px 36px rgba(0, 0, 0, 0.48));
  will-change: transform;
}

.gift-body {
  position: absolute;
  left: 6px;
  bottom: 0;
  width: 224px;
  height: 146px;
  border-radius: 4px 4px 12px 12px;
  background: linear-gradient(158deg, #293a60 0%, #15203a 52%, #0b1322 100%);
  border: 1px solid rgba(231, 201, 139, 0.28);
  box-shadow: inset 0 0 46px rgba(231, 201, 139, 0.06);
  overflow: hidden;
}

.gift-body::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 -34px 44px rgba(0, 0, 0, 0.38);
  pointer-events: none;
}

.ribbon {
  position: absolute;
  display: block;
  background: linear-gradient(90deg, #8a6a32, #f2dca8 46%, #b8904f);
  box-shadow: 0 0 18px rgba(231, 201, 139, 0.16);
  opacity: 0.92;
}

.ribbon-v {
  left: 50%;
  top: 0;
  width: 30px;
  height: 100%;
  transform: translateX(-50%);
}

.ribbon-h {
  left: 0;
  top: 42px;
  width: 100%;
  height: 26px;
  background: linear-gradient(180deg, #8a6a32, #f2dca8 46%, #b8904f);
}

.gift-lid {
  position: absolute;
  left: 0;
  top: 30px;
  width: 236px;
  height: 48px;
  z-index: 3;
  border-radius: 6px;
  background: linear-gradient(180deg, #f7e7bf 0%, #e1c184 38%, #c39b58 72%, #a4793b 100%);
  border: 1px solid rgba(255, 247, 224, 0.45);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -10px 16px rgba(120, 80, 20, 0.22);
  transform-origin: 50% 100%;
}

.gift-lid::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(90, 60, 15, 0.18);
  border-radius: 3px;
  pointer-events: none;
}

.gift-bow {
  position: absolute;
  left: 50%;
  top: -34px;
  width: 118px;
  height: 48px;
  transform: translateX(-50%);
  z-index: 4;
}

.bow-l,
.bow-r {
  position: absolute;
  top: 4px;
  width: 48px;
  height: 33px;
  border: 5px solid #e8ce93;
  border-radius: 52% 52% 46% 46%;
  background: rgba(231, 201, 139, 0.12);
  box-shadow: inset 0 0 10px rgba(255, 245, 210, 0.25);
}

.bow-l {
  left: 3px;
  transform: rotate(-17deg);
}

.bow-r {
  right: 3px;
  transform: rotate(17deg);
}

.bow-knot {
  position: absolute;
  left: 50%;
  top: 12px;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fbeecb, #d6ad66 55%, #a97b39);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  z-index: 2;
}

.gift-seal {
  position: absolute;
  left: 50%;
  top: 120px;
  width: 58px;
  height: 58px;
  margin-left: -29px;
  z-index: 5;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 30%, #c54545, #8f2323 58%, #661515);
  border: 1px solid rgba(255, 226, 178, 0.55);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 225, 175, 0.12), inset 0 0 14px rgba(0, 0, 0, 0.4);
  transform: rotate(-5deg);
}

.gift-seal span {
  font-family: var(--serif);
  font-size: 23px;
  color: #f6dfb0;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.spark {
  position: absolute;
  width: 7px;
  height: 7px;
  background: linear-gradient(135deg, #fff6dd, #d9b46b);
  transform: rotate(45deg);
  box-shadow: 0 0 12px rgba(255, 236, 190, 0.8);
  opacity: 0.35;
  animation: twinkle 3.4s ease-in-out infinite;
  z-index: 6;
}

.spark.s1 {
  top: 6px;
  left: 8px;
  animation-delay: 0.2s;
}

.spark.s2 {
  top: 74px;
  right: -5px;
  width: 5px;
  height: 5px;
  animation-delay: 1.1s;
}

.spark.s3 {
  bottom: 34px;
  left: -7px;
  width: 5px;
  height: 5px;
  animation-delay: 1.9s;
}

.spark.s4 {
  bottom: 12px;
  right: 16px;
  width: 4px;
  height: 4px;
  animation-delay: 2.6s;
}

/* 开箱 */

.case-wrap.opening .gift-case {
  animation: case-shake 0.78s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.case-wrap.opening .gift-lid {
  animation: lid-away 1s cubic-bezier(0.55, 0.06, 0.68, 0.19) 0.16s forwards;
}

.case-wrap.opening .gift-seal {
  animation: seal-pop 0.52s ease-out forwards;
}

.case-wrap.opening .case-halo {
  animation: halo-burst 1.1s ease-out forwards;
}

.case-wrap.opening .case-beam {
  animation: beam-up 1s ease-out forwards;
}

.case-wrap.opening .spark {
  animation: spark-fly 0.9s ease-out forwards;
}

/* ---------- 昵称 ---------- */

.name-wrap {
  width: min(84vw, 330px);
  margin: 4px 0 18px;
  text-align: left;
}

.name-wrap label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 2px 8px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--muted-2);
}

.name-wrap label span {
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  opacity: 0.8;
}

.name-wrap input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border-radius: 11px;
  border: 1px solid rgba(231, 201, 139, 0.2);
  background: rgba(255, 255, 255, 0.028);
  color: var(--cream);
  font-size: 16px;
  text-align: center;
  outline: none;
  transition: border-color 0.3s, background 0.3s, box-shadow 0.3s;
  appearance: none;
}

.name-wrap input::placeholder {
  color: #645e51;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.name-wrap input:focus {
  border-color: rgba(231, 201, 139, 0.66);
  background: rgba(231, 201, 139, 0.055);
  box-shadow: 0 0 0 4px rgba(231, 201, 139, 0.06);
}

.name-wrap.required label {
  color: #d8bd84;
}

/* ---------- 按钮 ---------- */

.btn-draw {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 58px;
  padding: 0 34px;
  border-radius: 999px;
  border: 1px solid rgba(231, 201, 139, 0.55);
  background: linear-gradient(180deg, rgba(231, 201, 139, 0.17), rgba(231, 201, 139, 0.05));
  color: #f7e8c6;
  font-family: var(--serif);
  font-size: 18px;
  letter-spacing: 0.16em;
  cursor: pointer;
  overflow: hidden;
  box-shadow: 0 14px 40px rgba(201, 162, 95, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.btn-draw .btn-shine {
  position: absolute;
  top: 0;
  left: -130%;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.26), transparent);
  transform: skewX(-20deg);
  animation: shine 4.6s ease-in-out infinite 1.2s;
  pointer-events: none;
}

.btn-draw .btn-label,
.btn-draw .btn-arrow {
  position: relative;
  z-index: 1;
}

.btn-draw .btn-arrow {
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 0;
  opacity: 0.7;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.btn-draw:active {
  transform: scale(0.97);
}

.btn-draw:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

.btn-draw:focus-visible,
.btn-ghost:focus-visible,
.sound-toggle:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 4px;
}

.btn-ghost {
  margin-top: 6px;
  height: 42px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1px solid rgba(231, 201, 139, 0.3);
  background: transparent;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.18em;
  cursor: pointer;
  transition: background 0.3s, border-color 0.3s;
}

.hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0 0;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--muted-2);
}

.hint-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--gold-deep);
  box-shadow: 0 0 8px rgba(231, 201, 139, 0.5);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

/* ---------- 抽奖转盘 ---------- */

.view-spin {
  padding: 8px 0 4px;
}

.reel-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 6px;
  width: 100%;
}

.reel-window {
  position: relative;
  width: min(78vw, 344px);
  height: calc(var(--reel-h) * 3);
  overflow: hidden;
  border-top: 1px solid rgba(231, 201, 139, 0.28);
  border-bottom: 1px solid rgba(231, 201, 139, 0.28);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), rgba(231, 201, 139, 0.035), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.35);
}

.reel {
  position: relative;
  will-change: transform;
  transition: filter 0.45s ease;
}

.reel.spinning {
  filter: blur(2.3px);
}

.reel-item {
  height: var(--reel-h);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  font-family: var(--serif);
  font-size: clamp(24px, 6.6vw, 33px);
  line-height: 1;
  letter-spacing: 0.08em;
  color: #d8cdb6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0.55;
}

.reel-item.long {
  font-size: clamp(17px, 4.6vw, 23px);
  letter-spacing: 0.04em;
}

.reel-item.winner {
  opacity: 1;
  color: #fff3d3;
  text-shadow: 0 0 26px rgba(231, 201, 139, 0.5);
}

.reel-center {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--reel-h);
  height: var(--reel-h);
  z-index: 2;
  border-top: 1px solid rgba(231, 201, 139, 0.55);
  border-bottom: 1px solid rgba(231, 201, 139, 0.55);
  background: linear-gradient(90deg, transparent, rgba(231, 201, 139, 0.09) 50%, transparent);
  box-shadow: inset 0 0 34px rgba(231, 201, 139, 0.08);
  pointer-events: none;
}

.reel-center::before,
.reel-center::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 0;
  height: 0;
  margin-top: -6px;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
}

.reel-center::before {
  left: -1px;
  border-left: 8px solid var(--gold);
}

.reel-center::after {
  right: -1px;
  border-right: 8px solid var(--gold);
}

.reel-fade {
  position: absolute;
  left: 0;
  right: 0;
  height: 38%;
  z-index: 3;
  pointer-events: none;
}

.reel-fade.top {
  top: 0;
  background: linear-gradient(180deg, #080d18 0%, rgba(8, 13, 24, 0.78) 42%, transparent 100%);
}

.reel-fade.bottom {
  bottom: 0;
  background: linear-gradient(0deg, #080d18 0%, rgba(8, 13, 24, 0.78) 42%, transparent 100%);
}

.reel-arrow {
  flex: none;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  opacity: 0.75;
}

.reel-arrow.left {
  border-right: 9px solid var(--gold);
}

.reel-arrow.right {
  border-left: 9px solid var(--gold);
}

.spin-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin: 28px 0 0;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: #a99e86;
}

.spin-dots {
  display: flex;
  gap: 6px;
}

.spin-dots b {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--gold);
  opacity: 0.3;
  animation: dot-wave 1.25s ease-in-out infinite;
}

.spin-dots b:nth-child(2) {
  animation-delay: 0.15s;
}

.spin-dots b:nth-child(3) {
  animation-delay: 0.3s;
}

/* ---------- 结果 ---------- */

.view-result {
  position: relative;
  padding: 4px 0 0;
}

.result-rays {
  position: absolute;
  left: 50%;
  top: 44%;
  width: 150vmax;
  height: 150vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg at 50% 50%, rgba(231, 201, 139, 0.055) 0deg 1.6deg, transparent 1.6deg 13deg);
  -webkit-mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 36%, transparent 63%);
  mask-image: radial-gradient(circle, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 36%, transparent 63%);
  animation: spin 70s linear infinite;
  pointer-events: none;
  z-index: 0;
}

.result-card {
  position: relative;
  z-index: 1;
  width: min(88vw, 430px);
  padding: 36px 28px 28px;
  border-radius: 20px;
  border: 1px solid rgba(231, 201, 139, 0.42);
  background: linear-gradient(180deg, rgba(25, 35, 57, 0.94), rgba(10, 16, 28, 0.97));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 60px rgba(231, 201, 139, 0.06);
  overflow: hidden;
  animation: card-in 0.9s cubic-bezier(0.16, 0.84, 0.24, 1) both;
}

.result-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 55%;
  height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 246, 219, 0.14), transparent);
  transform: translateX(-160%) skewX(-18deg);
  animation: card-sweep 2.6s ease 0.5s;
  pointer-events: none;
}

.result-card.history {
  animation: none;
}

.result-card.history::before {
  display: none;
}

.card-corner {
  position: absolute;
  width: 18px;
  height: 18px;
  border: 0 solid rgba(231, 201, 139, 0.5);
  z-index: 2;
  pointer-events: none;
}

.card-corner.tl {
  top: 11px;
  left: 11px;
  border-top-width: 1px;
  border-left-width: 1px;
}

.card-corner.tr {
  top: 11px;
  right: 11px;
  border-top-width: 1px;
  border-right-width: 1px;
}

.card-corner.bl {
  bottom: 11px;
  left: 11px;
  border-bottom-width: 1px;
  border-left-width: 1px;
}

.card-corner.br {
  bottom: 11px;
  right: 11px;
  border-bottom-width: 1px;
  border-right-width: 1px;
}

.result-kicker {
  margin: 0 0 18px;
  font-size: 9px;
  letter-spacing: 0.42em;
  color: var(--gold-deep);
  text-indent: 0.42em;
}

.result-congrats {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.22em;
  color: #a99e86;
}

.result-prize {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(40px, 11.5vw, 60px);
  line-height: 1.18;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #fff9ec 0%, #ecd39a 52%, #b98d45 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  overflow-wrap: anywhere;
  text-wrap: balance;
  filter: drop-shadow(0 10px 26px rgba(231, 201, 139, 0.18));
}

.result-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 18px auto 16px;
  width: 150px;
}

.result-divider i {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 201, 139, 0.4));
}

.result-divider i:last-child {
  background: linear-gradient(90deg, rgba(231, 201, 139, 0.4), transparent);
}

.result-divider span {
  font-size: 9px;
  color: var(--gold);
}

.result-name {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.12em;
  color: #e9ddc3;
}

.result-note {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.9;
  letter-spacing: 0.06em;
  color: #b8ad96;
}

.result-meta {
  margin: 16px 0 0;
  font-size: 9.5px;
  letter-spacing: 0.12em;
  color: var(--muted-2);
}

.result-once {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid rgba(231, 201, 139, 0.12);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #978d78;
}

.result-tip {
  position: relative;
  z-index: 1;
  margin: 20px 0 0;
  font-size: 10px;
  letter-spacing: 0.18em;
  color: var(--muted-2);
}

/* ---------- 空 / 关闭 / 错误 ---------- */

.view-notice {
  gap: 0;
  padding: 10px 0;
}

.notice-icon {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(231, 201, 139, 0.24);
  border-radius: 50%;
  color: var(--gold);
  margin-bottom: 24px;
  background: radial-gradient(circle, rgba(231, 201, 139, 0.07), transparent 70%);
}

.notice-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.notice-kicker {
  margin: 0 0 14px;
  font-size: 9px;
  letter-spacing: 0.38em;
  color: var(--gold-deep);
  text-indent: 0.38em;
}

.notice-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(27px, 7.4vw, 36px);
  line-height: 1.5;
  letter-spacing: 0.06em;
  color: #efe4cd;
  text-wrap: balance;
}

.notice-text {
  margin: 16px 0 22px;
  font-size: 12px;
  line-height: 2;
  letter-spacing: 0.05em;
  color: #a99e86;
}

/* ---------- 页脚 ---------- */

.foot {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 0 2px;
  text-align: center;
}

.foot p {
  margin: 0;
}

#noticeText {
  font-size: 9.5px;
  line-height: 1.8;
  letter-spacing: 0.1em;
  color: #6f6858;
}

.foot-tiny {
  margin-top: 7px !important;
  font-size: 7.5px;
  letter-spacing: 0.34em;
  color: #4c473c;
}

/* ---------- 浮层 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(30px + env(safe-area-inset-bottom));
  z-index: 130;
  max-width: 86vw;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid rgba(231, 201, 139, 0.28);
  background: rgba(14, 21, 36, 0.96);
  color: #eadfc9;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 16px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.flash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: radial-gradient(circle at 50% 44%, rgba(255, 244, 209, 0.55), rgba(255, 232, 175, 0.12) 38%, transparent 66%);
  opacity: 0;
  pointer-events: none;
}

.flash.show {
  animation: flash 0.7s ease-out;
}

.fx {
  position: fixed;
  inset: 0;
  z-index: 95;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.noscript {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 30px;
  background: var(--ink);
  color: var(--cream);
  font-size: 14px;
  text-align: center;
}

/* ---------- 动效 ---------- */

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(14px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

@keyframes fade-down {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(-0.3deg);
  }
  50% {
    transform: translateY(-10px) rotate(0.3deg);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.65;
    transform: translate(-50%, -50%) scale(0.94);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: rotate(45deg) scale(0.7);
  }
  50% {
    opacity: 0.9;
    transform: rotate(45deg) scale(1.15);
  }
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.4;
    transform: scale(0.85);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes shine {
  0%,
  62% {
    left: -130%;
  }
  82%,
  100% {
    left: 160%;
  }
}

@keyframes case-shake {
  0%,
  100% {
    transform: translateX(0) rotate(0);
  }
  15% {
    transform: translateX(-7px) rotate(-1.2deg);
  }
  30% {
    transform: translateX(6px) rotate(1deg);
  }
  45% {
    transform: translateX(-5px) rotate(-0.8deg);
  }
  60% {
    transform: translateX(4px) rotate(0.6deg);
  }
  75% {
    transform: translateX(-2px) rotate(-0.3deg);
  }
}

@keyframes lid-away {
  0% {
    transform: translate(0, 0) rotate(0);
    opacity: 1;
  }
  22% {
    transform: translate(0, -26px) rotate(-4deg);
    opacity: 1;
  }
  100% {
    transform: translate(-64px, -190px) rotate(-26deg);
    opacity: 0;
  }
}

@keyframes seal-pop {
  0% {
    transform: rotate(-5deg) scale(1);
    opacity: 1;
  }
  45% {
    transform: rotate(7deg) scale(1.18);
    opacity: 1;
  }
  100% {
    transform: rotate(16deg) scale(0.2);
    opacity: 0;
  }
}

@keyframes halo-burst {
  0% {
    opacity: 0.8;
    transform: translate(-50%, -50%) scale(0.9);
  }
  40% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.35);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.8);
  }
}

@keyframes beam-up {
  0% {
    opacity: 0;
    transform: translateX(-50%) scaleY(0.2);
  }
  35% {
    opacity: 0.9;
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) scaleY(1.6);
  }
}

@keyframes spark-fly {
  0% {
    opacity: 0.9;
    transform: rotate(45deg) translate(0, 0) scale(1);
  }
  100% {
    opacity: 0;
    transform: rotate(45deg) translate(var(--fx, 20px), -60px) scale(0.2);
  }
}

@keyframes dot-wave {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 0.95;
    transform: translateY(-3px);
  }
}

@keyframes card-in {
  0% {
    opacity: 0;
    transform: translateY(26px) scale(0.94);
    filter: blur(6px);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes card-sweep {
  0% {
    transform: translateX(-160%) skewX(-18deg);
  }
  100% {
    transform: translateX(320%) skewX(-18deg);
  }
}

@keyframes flash {
  0% {
    opacity: 0;
  }
  18% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes reel-land {
  0% {
    filter: brightness(1);
  }
  35% {
    filter: brightness(1.5);
  }
  100% {
    filter: brightness(1);
  }
}

.reel.landed {
  animation: reel-land 0.7s ease-out;
}

/* ---------- 桌面增强 ---------- */

@media (hover: hover) and (pointer: fine) {
  .btn-draw:hover {
    transform: translateY(-1px);
    border-color: rgba(231, 201, 139, 0.85);
    background: linear-gradient(180deg, rgba(231, 201, 139, 0.24), rgba(231, 201, 139, 0.08));
    box-shadow: 0 18px 50px rgba(201, 162, 95, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  }

  .btn-draw:hover .btn-arrow {
    transform: translateX(4px);
    opacity: 1;
  }

  .btn-ghost:hover {
    background: rgba(231, 201, 139, 0.08);
    border-color: rgba(231, 201, 139, 0.55);
  }

  .sound-toggle:hover {
    color: var(--gold);
    border-color: rgba(231, 201, 139, 0.42);
  }
}

@media (min-width: 720px) {
  .title {
    font-size: 60px;
  }

  .case-wrap {
    height: 280px;
  }

  .result-card {
    padding: 42px 36px 32px;
  }
}

@media (max-height: 720px) {
  .main {
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .title {
    font-size: clamp(30px, 8.4vw, 46px);
  }

  .subtitle {
    margin-top: 9px;
    font-size: 11.5px;
  }

  .case-wrap {
    height: 224px;
    margin-top: 10px;
    transform: scale(0.88);
    transform-origin: center bottom;
  }

  .name-wrap {
    margin-bottom: 14px;
  }

  .btn-draw {
    height: 52px;
    font-size: 17px;
  }

  .hint {
    margin-top: 12px;
  }

  .foot {
    padding-top: 6px;
  }
}

@media (max-height: 620px) {
  .topbar {
    display: none;
  }

  .case-wrap {
    height: 200px;
    transform: scale(0.74);
  }

  .eyebrow {
    margin-bottom: 12px;
  }

  .subtitle {
    display: none;
  }
}

@media (max-width: 360px) {
  :root {
    --reel-h: 82px;
  }

  .page {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .brand-mark i {
    font-size: 16px;
  }

  .brand-text b {
    font-size: 12px;
    letter-spacing: 0.12em;
  }

  .name-wrap,
  .reel-window {
    width: 88vw;
  }

  .gift-case {
    transform: scale(0.9);
    transform-origin: center bottom;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .gift-case,
  .bg-glow,
  .case-halo,
  .btn-shine,
  .spark {
    animation: none !important;
  }
}
