:root {
  color-scheme: dark;
  --night: #071623;
  --deep: #050e19;
  --surface: #0c202c;
  --line: #2b4853;
  --text: #f1f8f6;
  --muted: #acc3ca;
  --gold: #f9d99d;
  --gold-dark: #523616;
  --reel-step: clamp(88px, 17.5vw, 176px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--deep); }
body {
  margin: 0;
  color: var(--text);
  background: radial-gradient(ellipse at 50% 70%, #102937, transparent 56%), var(--deep);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #fff0c8; outline-offset: 5px; }
.wrap { width: min(1120px, calc(100% - 64px)); margin-inline: auto; }
.snow { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 4; pointer-events: none; }
.topbar {
  position: relative; z-index: 5;
  min-height: 78px; display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center; gap: 20px; border-bottom: 1px solid #b2d8de2b;
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 15px; font-weight: 750; letter-spacing: .085em; justify-self: start; white-space: nowrap; }
.brand-light { color: #b7d0cd; font-weight: 500; }
.topbar nav { display: flex; gap: clamp(14px, 3vw, 36px); color: var(--muted); font-size: 14px; }
.topbar nav a:hover, .footer a:hover { color: var(--gold); }
.edition { justify-self: end; color: var(--gold); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .11em; white-space: nowrap; }
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  margin-top: -79px; padding-top: 79px;
  background: radial-gradient(ellipse at 77% 33%, #124249, transparent 60%), #061524;
}
.landscape { display: block; position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, #06111b80, transparent 76%), linear-gradient(0deg, #050e19, transparent 30%); pointer-events: none; }
.hero-content { min-height: 540px; display: grid; grid-template-columns: 1.15fr 1fr; align-items: center; gap: 30px; padding: 46px 0 100px; }
.hero-copy { position: relative; z-index: 1; }
.eyebrow { color: var(--gold); text-transform: uppercase; font-weight: 750; font-size: 12px; letter-spacing: .14em; margin: 0 0 16px; }
.eyebrow span { margin-right: 7px; color: #fff3d2; }
h1, h2, h3, p { margin-top: 0; }
.hero h1, h2 { font-weight: 700; }
.hero h1 { margin-bottom: 18px; font-size: clamp(53px, 7.3vw, 106px); letter-spacing: -.045em; line-height: 1.03; }
em { color: var(--gold); font-style: normal; font-weight: inherit; }
.intro { max-width: 24em; font-size: clamp(15px, 2vw, 19px); color: #d3e6e9; margin-bottom: 26px; }
.gold-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 26px;
  min-height: 50px; border: 1px solid #ffe6ae; border-radius: 6px; padding: 0 23px;
  color: #22180b; background: linear-gradient(150deg,#fff1ce,#e7b974);
  box-shadow: inset 0 1px #fffbea, 0 6px 26px #e6aa5840;
  font-size: 14px; font-weight: 700; cursor: pointer; transition: background .2s, box-shadow .2s;
}
.gold-button:hover { background: #ffe7b0; box-shadow: 0 6px 34px #ffd08662; }
.gold-button:disabled { cursor: wait; opacity: .73; }
.ornament { position: relative; justify-self: center; width: min(85%, 328px); aspect-ratio: 1; }
.ornament-hook { position: absolute; left: 50%; width: 1px; bottom: calc(100% + 15px); height: 45vh; background: linear-gradient(transparent, #d6ba79ad); }
.ornament-cap { position: absolute; z-index: 1; left: 44%; top: -13px; width: 12%; height: 19px; border-radius: 6px 6px 2px 2px; background: repeating-linear-gradient(90deg,#967445 0 2px,#e6c689 3px 5px,#be955c 6px 8px); }
.ornament-ball {
  position: absolute; inset: 0; border-radius: 50%; display: grid; place-items: center;
  border: 1px solid #d5efdc9c;
  background: radial-gradient(ellipse at 31% 18%, #d2f3dd8c, transparent 29%), radial-gradient(ellipse at 45% 88%, #73eac253, transparent 55%), radial-gradient(ellipse at 80% 34%,#edd5a54f,transparent 58%), #183b43a8;
  box-shadow: inset 0 0 18px #d2fcfc66, inset 0 -18px 35px #0e2534, 0 0 80px #79efd52b, 0 26px 52px #030a17a3;
}
.ornament-ball::after { content: ""; position: absolute; inset: 7%; border-radius: inherit; border: 1px solid #def4e233; }
.ornament-ball img { width: 35%; transform: rotate(-12deg); filter: drop-shadow(0 6px 10px #0a1623) drop-shadow(0 0 23px #9fffd986); }
.ornament-star, .ornament-sparkle { position: absolute; color: #fff1c8; text-shadow: 0 0 12px #fff0b7; }
.star-a { left: 19%; top: 31%; font-size: clamp(12px, 2vw, 21px); }
.star-b { right: 18%; bottom: 23%; font-size: clamp(14px, 3vw, 26px); }
.star-c { left: 36%; bottom: 14%; font-size: 11px; }
.ornament-sparkle { right: -9%; top: 14%; font-size: 32px; }
.spin-section { position: relative; z-index: 1; margin-top: -52px; scroll-margin-top: 24px; }
.cabinet {
  position: relative; padding: 38px 26px 23px; border: 1px solid #af936591; border-radius: 18px;
  background: radial-gradient(ellipse at 50% 0%, #203c42, transparent 66%), linear-gradient(#112834,#0a1c29);
  box-shadow: inset 0 0 0 4px #07162091, 0 18px 44px #02070b75;
}
.lights {
  position: absolute; top: -4px; left: 20px; right: 20px; height: 15px; pointer-events: none;
  background: radial-gradient(circle, #fff4d8 0 2px, #f8cf8994 2.8px, #eab15100 7px) 0 center / 28px 14px repeat-x;
}
.cabinet-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 8px 18px; }
.cabinet-heading h2, .how h2 { margin: 0; font-size: clamp(27px, 3.6vw, 40px); letter-spacing: -.028em; line-height: 1.1; }
.cabinet-heading p { color: var(--gold); font-size: 13px; margin: 0; text-align: right; }
.reel-frame { position: relative; }
.reel-window { position: relative; overflow: hidden; border: 1px solid #47626a; border-radius: 11px; background: #07121e; }
.reel-window::before { content: ""; pointer-events: none; position: absolute; z-index: 2; inset: 0; background: linear-gradient(90deg, #07111fee, transparent 20% 80%, #07111fee); }
.reel-window::after {
  content: ""; pointer-events: none; position: absolute; z-index: 1; inset: 3px auto 3px 50%; width: calc(var(--reel-step) - 9px);
  transform: translateX(-50%); border: 1px solid #edcd8c9e; border-radius: 9px;
  box-shadow: inset 0 0 25px #f1ce872b, 0 0 16px #f1ce872b;
}
.pointer { position: absolute; z-index: 3; left: 50%; top: -6px; transform: translateX(-50%); border: 8px solid transparent; border-top: 13px solid #ffe3a0; filter: drop-shadow(0 1px 5px #fdd18c); }
.reel { display: flex; width: max-content; }
.reel.spinning { transition: transform 5.2s cubic-bezier(.08,.65,.1,1); }
.reel-cell {
  flex: 0 0 var(--reel-step); width: var(--reel-step); height: clamp(120px, 15vw, 157px); display: grid;
  align-content: center; justify-items: center; gap: 3px; border-inline-end: 1px solid #6aabc02d;
  background: radial-gradient(ellipse at 50% 0,#23535b80,transparent 75%),#102330;
}
.reel-cell:nth-child(3n) { background-color: #132d37; }
.reel-cell.zero { background: #101c2a; color: #9eb4be; }
.sol-icon { width: 27px; height: 27px; object-fit: contain; margin: 0 0 3px; }
.zero-icon { display: grid; place-items: center; border: 1px solid #657783; border-radius: 100%; color: #a3bcc5; }
.amount { font-size: clamp(25px, 4vw, 36px); font-weight: 700; font-variant-numeric: lining-nums tabular-nums; line-height: 1.1; }
.unit { font-size: 10px; letter-spacing: .07em; color: #b7cfd5; }
.spin-actions { display: grid; justify-items: center; gap: 11px; padding-top: 21px; }
.spin-actions .gold-button { min-width: 170px; }
.spin-actions p { min-height: 1.5em; color: var(--muted); font-size: 13px; margin: 0; text-align: center; }
.how { padding: clamp(46px, 7vw, 82px) 0; }
.how h2 { margin-bottom: 24px; }
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.how article {
  padding: clamp(19px, 3vw, 30px); border: 1px solid #587b8661; border-radius: 12px;
  background: radial-gradient(ellipse at top left,#1a3b46,transparent 75%), #101f2a;
}
.feature-icon { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 50%; border: 1px solid #bf9b606b; color: var(--gold); background: #101e28; font-size: 22px; margin-bottom: 19px; }
.how h3 { margin-bottom: 6px; font-size: 17px; }
.how article p { color: var(--muted); margin: 0; font-size: 14px; }
.footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; border-top: 1px solid var(--line); padding-block: 25px max(25px, env(safe-area-inset-bottom)); color: var(--muted); font-size: 13px; }
.footer p { margin: 0; }
.footer span { color: var(--gold); }
.footer a { white-space: nowrap; }
.reward-dialog {
  width: min(440px, calc(100% - 30px)); max-height: calc(100% - 30px); border: 1px solid #e7c68c8f; border-radius: 17px;
  background: radial-gradient(ellipse at 50% 5%, #245356,transparent 68%), #0b1b2b;
  color: var(--text); box-shadow: inset 0 0 0 4px #0c1a23, 0 24px 80px #000b; padding: 0;
}
.reward-dialog::backdrop { background: #030d18c9; }
.reward-panel { padding: 36px 22px; text-align: center; }
.reward-medallion { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 21px; border-radius: 50%; border: 1px solid #f9d99da3; background: radial-gradient(circle at 30% 24%, #5d8a85, #193a43 70%); box-shadow: 0 0 30px #a0edce30; }
.reward-medallion img { width: 45%; }
.reward-panel h2 { margin: 0 0 9px; font-size: clamp(50px, 13vw, 74px); line-height: 1.04; letter-spacing: -.035em; }
#rewardDescription { color: var(--muted); margin-bottom: 22px; }
.modal-close { position: absolute; right: 11px; top: 11px; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: #0b1d29; color: var(--text); font-size: 24px; line-height: 1; cursor: pointer; }
.modal-close:hover { background: #254451; }

@media (max-width: 680px) {
  .wrap { width: calc(100% - 36px); }
  .topbar { min-height: 64px; grid-template-columns: 1fr auto; gap: 10px; }
  .topbar nav { gap: 14px; }
  .edition { display: none; }
  .hero { margin-top: -65px; padding-top: 65px; }
  .hero-content { min-height: 0; grid-template-columns: 1fr; padding: 26px 0 62px; gap: 10px; }
  .hero-copy { text-align: center; }
  .hero h1 { font-size: clamp(40px, 11vw, 72px); }
  .intro { margin-inline: auto; margin-bottom: 0; }
  .ornament { width: 96px; grid-row: 1; }
  .ornament-cap { top: -8px; height: 11px; }
  .ornament-sparkle { font-size: 20px; }
  .cabinet { padding: 28px 10px 20px; }
  .cabinet-heading { margin-bottom: 15px; }
  .cabinet-heading p { max-width: 85px; line-height: 1.2; }
  .how-grid { grid-template-columns: 1fr; gap: 10px; }
  .how article { display: grid; grid-template-columns: auto 1fr; column-gap: 13px; }
  .feature-icon { grid-row: span 2; margin-bottom: 0; align-self: center; }
  .footer { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; }
}

/* Native dialogs: no transformed ancestor or z-index dependency. */
.reward-dialog { position: fixed; inset: 0; margin: auto; height: fit-content; max-height: calc(100% - 24px); max-height: calc(100dvh - 24px); overflow: auto; }
.reward-panel { position: relative; padding-top: 52px; }
.modal-close { z-index: 3; display: grid; place-items: center; padding: 0; width: 44px; height: 44px; line-height: 1; touch-action: manipulation; }
.check-dialog { width: min(350px, calc(100% - 42px)); }
.check-dialog::backdrop { background: #030d1860; }
.check-panel { padding: 54px 18px 22px; }
.check-panel h3 { font-size: 24px; margin-bottom: 12px; }
.check-panel p:not(.eyebrow) { color: var(--muted); margin-bottom: 18px; }
.check-panel .eyebrow { margin-bottom: 8px; }
html:has(dialog[open]) { overflow: hidden; }
.gold-button:disabled { cursor: default; }
.reel-window { contain: paint; }
.reel.spinning { will-change: transform; }
/* One repeating texture per compositor layer; no JS or layout on scroll. */
.snow { bottom: auto; height: 100vh; height: 100lvh; overflow: hidden; contain: strict; }
.snow-layer { position: absolute; inset: -384px 0 0; pointer-events: none; background-repeat: repeat; background-size: 384px 384px; will-change: transform; animation: snow-fall 24s linear infinite; }
.snow-far { background-image: url('assets/snow-far.svg'); }
.snow-near { background-image: url('assets/snow-near.svg'); animation-duration: 13s; }
@keyframes snow-fall { from { transform: translate3d(0,0,0); } to { transform: translate3d(0,384px,0); } }
.snow.paused .snow-layer { animation-play-state: paused; }
@media (max-width: 680px) {
  .snow-near { display: none; }
  .snow-far { animation-duration: 19s; }
  .hero h1 { margin-bottom: 10px; }
  .hero .eyebrow { margin-bottom: 8px; }
  .ornament-hook { height: 120px; }
}
@media (prefers-reduced-motion: reduce) { .snow-layer { animation: none; will-change: auto; } }

/* A closed dialog must never remain visible. */
.reward-dialog:not([open]) { display: none !important; }

/* Explicitly hide the result even if author dialog styles change. */
#rewardModal[hidden], #rewardModal:not([open]) { display: none !important; }
