:root {
  --bg: #3a0710;
  --bg2: #5a0f1a;
  --card: #fff7ea;
  --ink: #3a0710;
  --muted: #7a4a50;
  --gold: #ffd86b;
  --green: #12452f;
  --green-hi: #1d6b49;
  --red: #a3121f;
  --line: #ead8bd;
  --gutter: 16px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, var(--bg2), var(--bg) 60%);
  background-attachment: fixed;
  min-height: 100vh;
  padding-bottom: 84px;
}
.snow {
  position: fixed; inset: 0; pointer-events: none; opacity: .55;
  background-image: radial-gradient(2px 2px at 20px 30px, #fff, transparent), radial-gradient(3px 3px at 90px 120px, #fff, transparent),
    radial-gradient(2px 2px at 160px 70px, #fff, transparent), radial-gradient(3px 3px at 240px 190px, #fff, transparent),
    radial-gradient(2px 2px at 310px 40px, #fff, transparent);
  background-size: 340px 240px;
  animation: fall 18s linear infinite;
}
@keyframes fall { to { background-position: 0 240px; } }
@media (prefers-reduced-motion: reduce) { .snow { animation: none; } }

.top { position: relative; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 18px var(--gutter) 8px; }
.brand { font-family: 'Mountains of Christmas', 'Bricolage Grotesque', cursive; font-size: 32px; font-weight: 700; color: var(--gold); line-height: 1; }
.who { color: #f6d9c4; font-size: 14px; font-weight: 500; }

main { position: relative; padding: 8px var(--gutter) 24px; max-width: 560px; margin: 0 auto; display: grid; gap: 14px; }
.card { background: var(--card); border-radius: 18px; padding: 16px; box-shadow: 0 6px 18px rgba(0, 0, 0, .28); }
.card h2 { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.muted { color: var(--muted); font-size: 14px; line-height: 1.4; margin: 0; }
.hello { color: #fff; font-size: 26px; font-weight: 800; margin: 4px 0 0; }

.balance { text-align: center; background: var(--green); color: #fff; }
.balance .big { font-size: 64px; font-weight: 800; color: var(--gold); line-height: 1; margin: 4px 0; font-variant-numeric: tabular-nums; }
.balance .label { font-size: 15px; font-weight: 600; color: #d8ebdf; }
.balance .row { display: flex; justify-content: center; gap: 22px; margin-top: 10px; font-size: 14px; color: #d8ebdf; }
.balance .row b { color: #fff; font-variant-numeric: tabular-nums; }

.bar { height: 14px; border-radius: 999px; background: #ead8bd; overflow: hidden; margin: 10px 0 6px; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--red), #e23a3a); border-radius: 999px; }

.prize { display: grid; grid-template-columns: 88px 1fr; gap: 14px; align-items: start; }
.thumb { width: 88px; height: 88px; border-radius: 14px; background: #f3e4cc; display: grid; place-items: center; overflow: hidden; font-size: 38px; border: 1px solid var(--line); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.prize .num { font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--red); }
.prize .name { font-size: 18px; font-weight: 800; line-height: 1.2; margin: 2px 0 4px; overflow-wrap: anywhere; }
.counts { font-size: 14px; color: var(--muted); }
.counts b { color: var(--green); font-size: 18px; font-variant-numeric: tabular-nums; }
.link { display: inline-block; margin-top: 6px; font-size: 14px; font-weight: 700; color: var(--red); }
.drop { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.step { display: inline-flex; align-items: center; border: 2px solid var(--green); border-radius: 12px; overflow: hidden; }
.step button { width: 44px; height: 44px; border: 0; background: #fff; font-size: 22px; font-weight: 800; color: var(--green); cursor: pointer; }
.step span { min-width: 40px; text-align: center; font-weight: 800; font-size: 18px; font-variant-numeric: tabular-nums; }
.btn { flex: 1; min-height: 46px; border: 0; border-radius: 12px; background: var(--green); color: #fff; font: inherit; font-weight: 800; font-size: 16px; cursor: pointer; }
.btn:disabled { background: #b7a68f; cursor: not-allowed; }
.btn:focus-visible, .step button:focus-visible, .tabs button:focus-visible, .opt:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.opt { position: relative; display: block; width: 100%; text-align: left; margin-top: 10px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font: inherit; font-weight: 700; font-size: 17px; color: var(--ink); overflow: hidden; cursor: pointer; min-height: 52px; }
.opt .fill { position: absolute; inset: 0 auto 0 0; background: #f6d9c4; z-index: 0; transition: width .4s; }
.opt .t { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 10px; }
.opt.mine { border-color: var(--green); }
.opt.mine .fill { background: #cfe8d9; }
.opt:disabled { cursor: default; }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; background: #2a050c; border-top: 1px solid #6d1d2a; padding-bottom: env(safe-area-inset-bottom); }
.tabs[hidden] { display: none; }
.tabs button { flex: 1; min-height: 60px; border: 0; background: transparent; color: #f6d9c4; font: inherit; font-weight: 700; font-size: 15px; cursor: pointer; }
.tabs button.on { color: var(--gold); box-shadow: inset 0 3px 0 var(--gold); }

.toast { position: fixed; left: 50%; bottom: 84px; transform: translate(-50%, 20px); background: #fff; color: var(--ink); padding: 12px 18px; border-radius: 12px; font-weight: 700; box-shadow: 0 6px 20px rgba(0, 0, 0, .35); opacity: 0; pointer-events: none; transition: .25s; max-width: 90vw; text-align: center; z-index: 5; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: #ffe3e0; color: #7a0c14; }

.gate input { width: 100%; min-height: 48px; margin-top: 10px; padding: 0 14px; font: inherit; font-size: 18px; border: 2px solid var(--line); border-radius: 12px; }
.empty { text-align: center; padding: 26px 12px; }
