:root {
  color-scheme: light;
  --red: #cb203a;
  --deep: #610e23;
  --gold: #ffe1a5;
  --paper: #fffaf5;
  --ink: #301b20;
  font: 16px/1.45 system-ui, sans-serif;
  color: var(--ink);
  background: var(--red);
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh;
  background: var(--red) radial-gradient(ellipse at 74% 35%, #e34554, var(--red) 40%, #8d1530 100%);
}
[hidden] { display: none !important; }
header, footer, .hero, .inventory { padding-inline: max(5vw, calc((100vw - 1260px) / 2)); }
header, main, footer { position: relative; z-index: 1; }
header { min-height: 78px; display: flex; align-items: center; gap: 1.25rem; background: white; }
.logo { display: inline-flex; align-items: center; min-height: 44px; }
.logo img { display: block; width: 125px; }
.mast, .eyebrow { font-size: .75rem; font-weight: 750; letter-spacing: .13em; }
.mast b { padding: 0 .4rem; color: var(--red); }
.hero {
  display: grid; grid-template-columns: minmax(250px, .78fr) minmax(0, 1.4fr);
  gap: clamp(1rem, 4vw, 4rem); align-items: center; padding-block: 2.3rem;
  color: white;
}
.intro > .eyebrow { color: var(--gold); }
h1, h2, p { margin: 0; }
h1 { margin-top: .4rem; font: 850 clamp(3.3rem, 6.9vw, 6.7rem)/1 system-ui, sans-serif; letter-spacing: -.08em; }
h1 i, h1 span { color: var(--gold); }
.lead { margin: .8rem 0 1.2rem; font-size: clamp(1rem, 1.6vw, 1.25rem); }
.wheel-action { padding: clamp(1rem, 2vw, 1.6rem); color: var(--ink); background: var(--paper); }
.wheel-action .eyebrow { margin-bottom: .25rem; color: var(--red); }
h2 { font-size: clamp(1.35rem, 2.5vw, 2rem); line-height: 1.15; letter-spacing: -.035em; }
label { display: block; margin: .8rem 0 .3rem; font-weight: 650; font-size: .88rem; }
input, select { width: 100%; min-width: 0; padding: .62rem .7rem; border: 1px solid #986e76; border-radius: 6px; font: inherit; color: var(--ink); background: white; }
.receipt-fields { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .5rem; }
#receiptCodeHelp { display: block; margin-top: .35rem; color: #67555a; }
#scanReceipt { margin-top: .8rem; }
#entryStatus { margin-top: .35rem; color: var(--deep); }
#entryStatus:empty { display: none; }
#receiptVideo { display: block; width: 100%; max-height: 34dvh; background: #171517; object-fit: contain; margin: .6rem 0; }
.receipt-links { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; margin-top: 1rem; }
#storeBoardLink { display: inline-block; color: var(--deep); padding-block: .4rem; }
button { cursor: pointer; border: 1px solid transparent; border-radius: 7px; padding: .64rem 1.1rem; font: 700 .95rem/1.2 system-ui; color: white; background: var(--red); }
button:disabled { cursor: not-allowed; opacity: .6; }
button.outline { background: transparent; color: var(--deep); border-color: #b9959c; }
:focus-visible { outline: 3px solid #236cc0; outline-offset: 3px; }
#notice { margin-top: .6rem; font-weight: 600; }
#notice:empty { display: none; }
.arena { overflow: hidden; border: 1px solid #af956f; border-radius: 20px; background: #101a30; box-shadow: 0 14px 45px #4b0b1d59; }
.stage-wrap {
  position: relative; height: clamp(330px, 38vw, 590px); overflow: hidden;
  background: #162746 url("./christmas-street.svg") center / 100% 100% no-repeat;
}
#stage { position: absolute; inset: 0; touch-action: pan-y; }
#stage canvas { position: relative; width: 100%; height: 100%; display: block; }
.illustrated-props { display: none; position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#stage[data-fallback] .illustrated-props { display: block; }
#stage[data-fallback] canvas { transform: translateX(-5%) scale(.96); }
/* Two seamless sheets of snow cover the viewport, even while the prize board scrolls. */
#snow { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; user-select: none; contain: strict; }
@media (prefers-reduced-motion: no-preference) {
  #snow::before, #snow::after {
    content: ""; position: absolute; inset: calc(0px - var(--fall)) -32px 0;
    background: url("./snowflakes.svg") var(--offset) 0 / auto var(--fall) repeat;
    animation: snowfall var(--duration) linear infinite;
  }
  #snow::before { --fall: 242px; --offset: 71px; --drift: -14px; --duration: 7.5s; opacity: .48; }
  #snow::after { --fall: 370px; --offset: 0px; --drift: 24px; --duration: 5.4s; opacity: .86; }
}
@keyframes snowfall {
  from { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(var(--drift), calc(var(--fall) / 2), 0); }
  to { transform: translate3d(0, var(--fall), 0); }
}
.spin-controls { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
.spin-controls p { margin: 0; font-weight: 650; }
.spin-controls button { min-width: 12rem; min-height: 48px; }
#spinButton:disabled { color: white; background: #777477; border-color: #777477; opacity: 1; }
.inventory { padding-block: 2rem; color: var(--paper); border-top: 1px solid #e4ceab38; }
.inventory .eyebrow { color: var(--gold); }
.result .eyebrow { color: var(--red); }
.inventory h2, .result h2 { margin: .25rem 0 .4rem; }
.result { position: relative; background: #ffe8d1; color: var(--ink); padding: 1.25rem; max-width: 400px; border-radius: 16px; overflow-wrap: anywhere; }
dialog#resultDialog { width: min(94vw, 500px); max-width: none; max-height: 92dvh; padding: 0; border: 0; border-radius: 16px; overflow: auto; background: transparent; box-shadow: 0 18px 60px #0008; }
dialog#resultDialog::backdrop { background: #10090dcc; backdrop-filter: blur(3px); }
#result { max-width: none; padding: clamp(1.25rem, 4vw, 2rem); text-align: center; }
#result h2 { margin: .25rem 0 .4rem; }
#celebrate { display: none; justify-content: center; gap: .35rem; margin: -.25rem 0 .35rem; font-size: clamp(1.7rem, 7vw, 2.5rem); line-height: 1; }
.result.win #celebrate { display: flex; }
#celebrate span { display: inline-block; animation: pop .55s cubic-bezier(.2, 1.6, .4, 1) both, float 2s ease-in-out .55s infinite alternate; }
#celebrate span:nth-child(2) { animation-delay: .07s, .62s; }
#celebrate span:nth-child(3) { animation-delay: .14s, .69s; }
#celebrate span:nth-child(4) { animation-delay: .21s, .76s; }
#celebrate span:nth-child(5) { animation-delay: .28s, .83s; }
#celebrate span:nth-child(6) { animation-delay: .35s, .9s; }
@keyframes pop { from { transform: scale(0) rotate(-18deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
@keyframes float { from { transform: translateY(0); } to { transform: translateY(-5px); } }
.result.win { background: linear-gradient(160deg, #fff4dc, #ffe1bd 55%, #ffd5ad); }
.result.win #resultType { margin: 0 0 .35rem; font-size: clamp(2.05rem, 9vw, 3.2rem); font-weight: 900; line-height: .98; letter-spacing: -.035em; color: var(--red); }
.result.win #resultTitle { font-size: clamp(1.5rem, 6vw, 2.1rem); line-height: 1.1; }
#resultRef { font-size: .72rem; line-height: 1.3; color: #7c6469; margin-top: .5rem; }
#resultRef:empty { display: none; }
#closeResult { width: 100%; min-height: 46px; margin-top: 1rem; }
@media (prefers-reduced-motion: reduce) {
  #celebrate span { animation: none; }
  #snow { display: none; }
}
#prizes { display: grid; gap: .65rem; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); padding: 0; list-style: none; }
#prizes li { border: 1px solid #cba5ab; border-top: 4px solid var(--red); border-radius: 7px; padding: .8rem; color: var(--ink); background: white; }
#prizes li.unavailable { background: #eeeded; border-color: #8a8586; color: #4a4748; }
#prizes li.claimed { border-style: dashed; background: #eceaeb; }
#prizes li.claimed strong { text-decoration: line-through; }
#prizes small { display: block; margin-top: .3rem; }
footer { background: var(--deep); color: white; padding-block: 1rem; font-size: .85rem; }
@media (max-width: 760px) {
  header { min-height: 60px; gap: .7rem; }
  .mast { font-size: .62rem; }
  .logo img { width: 88px; }
  .hero { display: flex; flex-direction: column; gap: 1rem; padding-block: .8rem 1rem; }
  .hero > .arena { order: 0; width: 100%; }
  .hero > .intro { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stage-wrap { height: clamp(260px, 72vw, 380px); }
  .spin-controls { flex-direction: column; align-items: stretch; gap: .6rem; }
  .spin-controls p { text-align: center; }
  .spin-controls button { width: 100%; min-height: 50px; }
  #receiptEntry button, #receiptForm input { min-height: 44px; }
  #receiptEntry input { font-size: 1rem; }
}
@media (max-width: 420px) {
  .receipt-fields { grid-template-columns: minmax(0, 1fr); }
  #scanReceipt { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; } }
