:root {
  --bg: #0a1520;
  --bg-2: #0f1e2c;
  --card: #122434;
  --line: rgba(220, 235, 245, 0.09);
  --frost: #e8eff4;
  --muted: #8ba1b3;
  --ice: #a9d4ea;
  --berry: #d2463c;
  --berry-dark: #a9322a;
  --gold: #e6c27f;
  --pine: #2f5d50;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Noto Serif", Georgia, serif;
  --sans: -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r: 18px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { background: var(--bg); }
body {
  font: 15px/1.45 var(--sans);
  color: var(--frost);
  background:
    radial-gradient(120% 60% at 50% -10%, #1b3347 0%, transparent 60%),
    linear-gradient(var(--bg), var(--bg-2));
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
#snow { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
#app { position: relative; z-index: 1; max-width: 520px; margin: 0 auto; padding: 14px 16px calc(28px + env(safe-area-inset-bottom)); }

.top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 26px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: 0.02em; }
.flake { width: 20px; height: 20px; color: var(--ice); }
nav { display: flex; gap: 6px; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.chip:active { background: var(--line); }

.hero { margin-bottom: 22px; }
.eyebrow { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ice); margin-bottom: 10px; }
h1 { font: 500 44px/1.02 var(--serif); letter-spacing: -0.01em; }
h1 em { font-style: italic; color: var(--gold); }
.lead { color: var(--muted); margin-top: 12px; max-width: 32ch; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 12px; }
.card h2 { font: 500 22px/1.15 var(--serif); margin-bottom: 6px; }
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tag { font-size: 12px; color: var(--ice); white-space: nowrap; }
.muted { color: var(--muted); font-size: 13.5px; }

/* reel */
.reel { position: relative; height: 92px; overflow: hidden; border-radius: 14px; background: #0c1a26; border: 1px solid var(--line);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 18%, #000 82%, transparent); }
.reel-track { position: absolute; top: 10px; left: 0; display: flex; gap: 8px; will-change: transform; }
.tile { flex: 0 0 72px; height: 72px; border-radius: 12px; display: grid; place-items: center; font-size: 36px; background: #13283a; border: 1px solid var(--line); }
.tile.empty { color: rgba(169, 212, 234, 0.22); }
.tile.empty svg { width: 26px; height: 26px; }
.tile.win { border-color: var(--gold); box-shadow: 0 0 0 1px var(--gold) inset; }
.reel-marker { position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: linear-gradient(var(--gold) 14px, transparent 14px, transparent calc(100% - 14px), var(--gold) calc(100% - 14px)); }
.reel-marker::before, .reel-marker::after { content: ""; position: absolute; left: 50%; margin-left: -6px; border: 6px solid transparent; }
.reel-marker::before { top: 0; border-top-color: var(--gold); }
.reel-marker::after { bottom: 0; border-bottom-color: var(--gold); }

.spin-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.counter { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 4px; min-width: 0; }
.counter .label { width: 100%; font-size: 12px; color: var(--muted); }
.counter strong { font: 600 26px/1 var(--sans); }
.counter .of { color: var(--muted); }
.counter .bonus { color: var(--gold); font-size: 13px; margin-left: 6px; }
.counter .refill { width: 100%; font-size: 12px; color: var(--ice); margin-top: 4px; }
.cta { flex: 0 0 auto; min-width: 150px; padding: 15px 22px; border-radius: 14px; background: var(--berry); color: #fff; font-weight: 650; font-size: 16px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.18) inset, 0 6px 18px -8px var(--berry); transition: transform 0.12s, background 0.2s; }
.cta:active { transform: scale(0.97); background: var(--berry-dark); }
.cta:disabled { background: #2a3a48; color: var(--muted); box-shadow: none; }
.ghost { padding: 11px 16px; border-radius: 12px; border: 1px solid var(--ice); color: var(--ice); font-weight: 600; white-space: nowrap; }
.ghost:active { background: rgba(169, 212, 234, 0.1); }

/* advent */
.advent { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 14px; }
.door { aspect-ratio: 1; border-radius: 10px; display: grid; place-items: center; font-size: 13px; font-weight: 600; background: #0f2030; border: 1px solid var(--line); color: var(--muted); position: relative; }
.door.future { opacity: 0.45; }
.door.missed { opacity: 0.35; text-decoration: line-through; }
.door.opened { background: var(--pine); color: #dff0e8; border-color: transparent; }
.door.opened small { position: absolute; bottom: 3px; font-size: 9.5px; font-weight: 500; opacity: 0.85; }
.door.today { border: 1.5px solid var(--berry); color: var(--frost); background: #2a1c22; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 4px rgba(210, 70, 60, 0.18); } }
.door.flip { animation: flip 0.5s ease; }
@keyframes flip { 50% { transform: rotateY(90deg); } }
.advent-off { grid-column: 1 / -1; padding: 18px 0 4px; text-align: center; color: var(--muted); font-size: 13.5px; }

.invite { display: flex; align-items: center; justify-content: space-between; gap: 14px; }

.catalog { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-top: 10px; }
.catalog li { padding: 10px 8px; border-radius: 12px; background: #0f2030; border: 1px solid var(--line); text-align: center; }
.catalog .e { font-size: 28px; display: block; }
.catalog .n { font-size: 12.5px; display: block; margin-top: 2px; }
.catalog .s { font-size: 11.5px; color: var(--gold); }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* sheet */
.sheet-wrap { position: fixed; inset: 0; z-index: 10; background: rgba(4, 10, 16, 0.62); display: flex; align-items: flex-end; justify-content: center; animation: fade 0.2s; }
.sheet { position: relative; width: 100%; max-width: 520px; max-height: 86vh; overflow: auto; background: #10202e; border: 1px solid var(--line); border-bottom: 0;
  border-radius: 22px 22px 0 0; padding: 22px 18px calc(22px + env(safe-area-inset-bottom)); animation: up 0.28s cubic-bezier(0.2, 0.9, 0.3, 1); }
.sheet h3 { font: 500 26px/1.1 var(--serif); margin-bottom: 12px; padding-right: 36px; }
.sheet p { color: var(--muted); margin-bottom: 10px; }
.close { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: var(--line); font-size: 22px; line-height: 1; color: var(--muted); }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.rows { margin: 4px 0 14px; }
.row { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.row span:first-child { color: var(--muted); }
.prize-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.prize-row .e { font-size: 28px; }
.prize-row .t { flex: 1; min-width: 0; }
.prize-row .t small { display: block; color: var(--muted); font-size: 12px; }
.status { font-size: 12.5px; color: var(--muted); }
.status.done { color: #8fd1b0; }
.status.pending { color: var(--gold); }
.small-btn { padding: 8px 12px; border-radius: 10px; background: var(--berry); color: #fff; font-weight: 600; font-size: 13px; }
.links { display: grid; gap: 8px; margin: 14px 0; }
.links a { display: block; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--frost); text-decoration: none; font-weight: 600; text-align: center; }
.sheet .cta { width: 100%; }
.result { text-align: center; padding: 6px 0 4px; }
.result .big { font-size: 72px; line-height: 1.1; display: block; margin: 6px 0; }
.result h3 { padding: 0; }

.gate { position: relative; z-index: 1; min-height: 100vh; display: grid; place-items: center; text-align: center; padding: 24px; }
.gate h1 { font-size: 34px; margin-bottom: 12px; }
.gate p { color: var(--muted); max-width: 30ch; margin: 0 auto 18px; }

.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 20; background: #1d3346; border: 1px solid var(--line);
  padding: 10px 16px; border-radius: 12px; font-size: 14px; max-width: 90vw; animation: up 0.2s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
