:root {
  --ink: #071a1f;
  --ink-soft: #0d2c33;
  --foam: #e8f4f1;
  --mist: #9bb8b0;
  --gold: #d4b56a;
  --gold-bright: #f0d78c;
  --gold-deep: #a8843a;
  --sea: #1a6b6a;
  --sea-bright: #2f9e96;
  --danger: #c45c4a;
  --ok: #3d9b7a;
  --font-display: "Instrument Serif", "Noto Serif SC", serif;
  --font-cn: "Noto Serif SC", "Songti SC", serif;
  --font-ui: "DM Sans", "Noto Serif SC", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  color: var(--foam);
  font-family: var(--font-ui);
  background: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

.sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, #143f45 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 100%, #0a2a28 0%, transparent 50%),
    linear-gradient(165deg, #061418 0%, #0a2228 45%, #071a1f 100%);
}

.sky__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.55;
  animation: drift 18s ease-in-out infinite;
}

.sky__glow--a {
  width: min(60vw, 520px);
  height: min(60vw, 520px);
  left: -10%;
  top: 20%;
  background: radial-gradient(circle, rgba(47, 158, 150, 0.45), transparent 70%);
}

.sky__glow--b {
  width: min(50vw, 420px);
  height: min(50vw, 420px);
  right: -8%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(212, 181, 106, 0.28), transparent 70%);
  animation-delay: -7s;
}

.sky__grain {
  position: absolute;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  pointer-events: none;
}

.sky__stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.stage {
  position: relative;
  z-index: 1;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: clamp(1.25rem, 4vw, 2.5rem);
}

.brand {
  text-align: center;
}

.brand__mark {
  margin: 0;
  font-family: var(--font-cn);
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 700;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  background: linear-gradient(120deg, var(--gold-bright), var(--foam) 45%, var(--sea-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: brandIn 1.1s ease both;
}

.hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-bottom: 2rem;
}

.hero__title {
  margin: 0.5rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(1.85rem, 5.5vw, 3.2rem);
  letter-spacing: 0.04em;
  color: var(--foam);
  animation: rise 0.9s 0.15s ease both;
}

.hero__lead {
  margin: 0.85rem 0 0;
  max-width: 22rem;
  font-family: var(--font-cn);
  font-size: clamp(0.95rem, 2.4vw, 1.1rem);
  line-height: 1.7;
  color: var(--mist);
  animation: rise 0.9s 0.28s ease both;
}

.orb {
  position: relative;
  width: min(42vw, 180px);
  height: min(42vw, 180px);
  margin: clamp(1.75rem, 5vw, 2.75rem) 0;
  animation: rise 0.9s 0.4s ease both;
}

.orb__core {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 30%, #fff6d6, var(--gold) 40%, var(--gold-deep) 75%, transparent 76%),
    radial-gradient(circle at 70% 70%, rgba(47, 158, 150, 0.5), transparent 60%);
  box-shadow:
    0 0 40px rgba(212, 181, 106, 0.45),
    0 0 80px rgba(47, 158, 150, 0.25);
  animation: pulse 3.6s ease-in-out infinite;
}

.orb__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(232, 244, 241, 0.18);
}

.orb__ring--1 {
  animation: spin 14s linear infinite;
  border-top-color: rgba(240, 215, 140, 0.7);
  border-right-color: transparent;
}

.orb__ring--2 {
  inset: 12%;
  animation: spin 9s linear infinite reverse;
  border-bottom-color: rgba(47, 158, 150, 0.65);
  border-left-color: transparent;
}

.orb.is-spinning .orb__core {
  animation: pulseFast 0.45s ease-in-out infinite;
}

.orb.is-spinning .orb__ring--1 {
  animation-duration: 1.2s;
}

.orb.is-spinning .orb__ring--2 {
  animation-duration: 0.8s;
}

.draw-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 0;
  cursor: pointer;
  min-width: 12.5rem;
  padding: 1rem 2.4rem;
  border-radius: 999px;
  font-family: var(--font-cn);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: #122226;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold) 50%, var(--gold-deep));
  box-shadow:
    0 10px 30px rgba(168, 132, 58, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
  animation: rise 0.9s 0.5s ease both;
}

.draw-btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow:
    0 16px 36px rgba(168, 132, 58, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.draw-btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

.draw-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  filter: grayscale(0.25);
}

.draw-btn__shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.45) 48%, transparent 62%);
  transform: translateX(-120%);
  animation: shine 3.8s ease-in-out infinite;
  pointer-events: none;
}

.draw-btn:disabled .draw-btn__shine {
  animation: none;
}

.meta {
  margin: 1.35rem 0 0;
  min-height: 1.5em;
  font-size: 0.92rem;
  color: var(--mist);
  letter-spacing: 0.04em;
  animation: rise 0.9s 0.62s ease both;
}

.veil {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(4, 14, 18, 0.72);
  backdrop-filter: blur(10px);
  animation: fadeIn 0.35s ease;
}

.veil[hidden] {
  display: none !important;
}

.reveal {
  width: min(100%, 26rem);
  padding: 2rem 1.6rem 1.6rem;
  text-align: center;
  border: 1px solid rgba(232, 244, 241, 0.12);
  background:
    linear-gradient(160deg, rgba(20, 55, 58, 0.92), rgba(8, 24, 28, 0.96));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  animation: popIn 0.45s cubic-bezier(0.2, 0.9, 0.2, 1);
}

.reveal.is-win {
  border-color: rgba(240, 215, 140, 0.45);
}

.reveal__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--mist);
}

.reveal__title {
  margin: 0.7rem 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 5vw, 2.2rem);
  font-weight: 400;
}

.reveal__body {
  margin: 0.75rem 0 0;
  color: var(--mist);
  line-height: 1.65;
  font-family: var(--font-cn);
}

.reveal__code {
  margin-top: 1.25rem;
  display: flex;
  gap: 0.6rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.reveal__code[hidden] {
  display: none !important;
}

.reveal__code code {
  display: inline-block;
  padding: 0.7rem 1rem;
  font-family: ui-monospace, "DM Sans", monospace;
  font-size: 1.15rem;
  letter-spacing: 0.14em;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid rgba(212, 181, 106, 0.35);
}

.copy-btn,
.reveal__close {
  border: 0;
  cursor: pointer;
  font-family: var(--font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.copy-btn {
  padding: 0.7rem 1rem;
  color: var(--ink);
  background: var(--gold);
}

.reveal__close {
  margin-top: 1.4rem;
  width: 100%;
  padding: 0.9rem 1rem;
  color: var(--foam);
  background: transparent;
  border: 1px solid rgba(232, 244, 241, 0.22) !important;
  transition: background 0.2s ease;
}

.reveal__close:hover {
  background: rgba(232, 244, 241, 0.08);
}

@keyframes drift {
  0%, 100% { transform: translate(0, 0); }
  50% { transform: translate(24px, -18px); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.06); opacity: 0.92; }
}

@keyframes pulseFast {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.12); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shine {
  0%, 55% { transform: translateX(-120%); }
  75%, 100% { transform: translateX(120%); }
}

@keyframes brandIn {
  from { opacity: 0; letter-spacing: 0.5em; filter: blur(6px); }
  to { opacity: 1; letter-spacing: 0.28em; filter: blur(0); }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
  .brand__mark {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
  }
}

/* 中奖独立页 */
.win-stage {
  align-items: center;
}

.win-panel {
  width: min(100%, 28rem);
  margin: 1rem auto 2rem;
  text-align: center;
  animation: rise 0.9s ease both;
}

.win-panel[hidden],
.win-panel--empty[hidden] {
  display: none !important;
}

.win-panel__eyebrow {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.28em;
  color: var(--gold);
}

.win-panel__title {
  margin: 0.7rem 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 6vw, 3rem);
}

.win-panel__lead {
  margin: 0.9rem auto 0;
  max-width: 22rem;
  color: var(--mist);
  line-height: 1.7;
  font-family: var(--font-cn);
}

.win-panel__code {
  margin: 1.75rem 0;
}

.win-panel__code code {
  display: inline-block;
  padding: 1rem 1.25rem;
  font-family: ui-monospace, "DM Sans", monospace;
  font-size: clamp(1.15rem, 4vw, 1.45rem);
  letter-spacing: 0.16em;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(212, 181, 106, 0.45);
  user-select: all;
  word-break: break-all;
}

.win-copy {
  min-width: 14rem;
}

.win-back {
  display: inline-block;
  margin-top: 1.5rem;
  color: var(--mist);
  text-decoration: none;
  letter-spacing: 0.08em;
  border-bottom: 1px solid rgba(155, 184, 176, 0.35);
  padding-bottom: 0.15rem;
}

.win-back:hover {
  color: var(--foam);
}

.win-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1.5rem;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
