:root {
  color-scheme: dark;
  --night: #0b1f17;
  --night-2: #10291f;
  --pine: #14402e;
  --pine-2: #1c5a40;
  --red: #c8102e;
  --red-2: #e23a4f;
  --gold: #e9b949;
  --gold-2: #f7dd8f;
  --snow: #fbf7ef;
  --muted: #c9d6cd;
  --ink: #fffaf0;
  --card: rgba(255, 250, 240, 0.06);
  --card-line: rgba(233, 185, 73, 0.28);
  --ocean: #0e2e45;
  --ocean-2: #123a57;
  --land: #2d6b4d;
  --radius: 18px;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  --serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --sans: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background: radial-gradient(1200px 600px at 50% -10%, #1f5a40 0%, var(--night) 55%) fixed, var(--night);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
#snow { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.wrap { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 20px 16px 64px; }
header.brand { text-align: center; padding: 18px 0 8px; }
.brand .seal { width: 76px; height: 76px; margin: 0 auto 10px; display: block; filter: drop-shadow(0 6px 18px rgba(233, 185, 73, .35)); }
.brand h1 { font-family: var(--serif); font-weight: 700; font-size: clamp(30px, 8vw, 44px); line-height: 1.05; margin: 0; letter-spacing: .01em; }
.brand h1 span { color: var(--gold); }
.brand p { margin: 8px auto 0; color: var(--muted); max-width: 30em; }
.ribbon { height: 4px; border-radius: 4px; margin: 18px auto; width: 120px; background: linear-gradient(90deg, var(--red), var(--gold), var(--red)); }

.card { background: var(--card); border: 1px solid var(--card-line); border-radius: var(--radius); padding: 18px; margin: 16px 0; box-shadow: var(--shadow); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.card h2 { font-family: var(--serif); font-size: 22px; margin: 0 0 6px; color: var(--gold-2); }
.card h3 { margin: 12px 0 4px; font-size: 16px; }
.step { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; font-size: 14px; margin-right: 8px; vertical-align: 2px; }
.hint { color: var(--muted); font-size: 14px; margin: 4px 0 0; }
.small { font-size: 13px; color: var(--muted); }
label { display: block; font-weight: 700; margin: 14px 0 6px; }
input[type=text], input[type=time], input[type=url], input[type=password], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 12px; padding: 12px 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 96px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(233, 185, 73, .25); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 420px) { .row { grid-template-columns: 1fr; } }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: 15px; }
.check input { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--red); flex: none; }

.btn { appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; border-radius: 999px; padding: 14px 22px; color: #fff;
  background: linear-gradient(180deg, var(--red-2), var(--red)); box-shadow: 0 8px 20px rgba(200, 16, 46, .35), inset 0 1px 0 rgba(255,255,255,.25);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; transition: transform .08s, filter .15s; text-decoration: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.block { width: 100%; margin-top: 18px; }
.btn.gold { color: #3a2a00; background: linear-gradient(180deg, var(--gold-2), var(--gold)); box-shadow: 0 8px 20px rgba(233, 185, 73, .3); }
.btn.ghost { background: transparent; color: var(--gold-2); border: 1px solid var(--card-line); box-shadow: none; }
.btn.small-btn { padding: 8px 14px; min-height: 36px; font-size: 14px; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }

.notice { border-radius: 12px; padding: 12px 14px; margin: 12px 0 0; font-size: 15px; }
.notice.err { background: rgba(200, 16, 46, .18); border: 1px solid rgba(226, 58, 79, .55); }
.notice.ok { background: rgba(28, 90, 64, .45); border: 1px solid rgba(110, 200, 150, .4); }
.notice.info { background: rgba(233, 185, 73, .12); border: 1px solid var(--card-line); }
.hidden { display: none !important; }

.ios-steps { counter-reset: s; list-style: none; padding: 0; margin: 10px 0 0; }
.ios-steps li { counter-increment: s; display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.12); }
.ios-steps li::before { content: counter(s); flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--gold); color: #3a2a00; font-weight: 800; display: grid; place-items: center; }
.ios-icon { display: inline-block; width: 22px; height: 22px; vertical-align: -5px; }

footer.privacy { margin-top: 26px; font-size: 13px; color: var(--muted); text-align: center; }
footer.privacy a { color: var(--gold-2); }
details summary { cursor: pointer; color: var(--gold-2); font-weight: 700; }

/* tracker */
.status-line { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.big { font-family: var(--serif); font-size: 24px; color: var(--gold-2); }
.map-shell { position: relative; border-radius: 16px; overflow: hidden; border: 1px solid var(--card-line); background: var(--ocean); margin-top: 12px; }
.map-shell svg { display: block; width: 100%; height: auto; }
.land { fill: var(--land); stroke: rgba(247, 221, 143, .35); stroke-width: .25; }
.grat { stroke: rgba(255, 255, 255, .06); stroke-width: .3; fill: none; }
.city-dot { fill: var(--gold-2); opacity: .55; }
.city-dot.visited { fill: var(--gold); opacity: 1; }
.city-dot.home { fill: var(--red-2); opacity: 1; }
.trail { fill: none; stroke: var(--gold); stroke-width: .9; stroke-linecap: round; stroke-dasharray: 2 1.6; opacity: .9; }
.santa-glow { fill: url(#glow); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.stat { background: rgba(0,0,0,.22); border-radius: 12px; padding: 10px; text-align: center; }
.stat b { display: block; font-size: 20px; color: var(--gold-2); font-variant-numeric: tabular-nums; }
.stat span { font-size: 12px; color: var(--muted); }

.advent { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin-top: 10px; }
.door { aspect-ratio: 1; border-radius: 10px; border: 1px solid var(--card-line); background: linear-gradient(160deg, var(--pine-2), var(--pine)); color: var(--gold-2); font-weight: 800; display: grid; place-items: center; cursor: pointer; font-size: 16px; position: relative; }
.door.locked { opacity: .45; cursor: default; }
.door.open { background: linear-gradient(160deg, var(--red-2), var(--red)); color: #fff; }
.door.today { outline: 2px solid var(--gold); }
.door-note { margin-top: 12px; min-height: 1.5em; }

.mail-item { border-top: 1px dashed rgba(255,255,255,.14); padding: 12px 0; }
.mail-item:first-child { border-top: 0; }
.mail-item .from { font-weight: 800; color: var(--gold-2); }
.mail-item audio { width: 100%; margin-top: 8px; }
.badge { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: rgba(233,185,73,.18); color: var(--gold-2); border: 1px solid var(--card-line); }
.badge.red { background: rgba(200,16,46,.22); color: #ffd3da; border-color: rgba(226,58,79,.5); }
.badge.green { background: rgba(28,90,64,.55); color: #c9f2da; border-color: rgba(110,200,150,.4); }
.counter { font-size: 13px; color: var(--muted); text-align: right; }

.demo-bar { border: 1px dashed var(--gold); background: rgba(233, 185, 73, .08); }
.demo-bar h2 { color: var(--gold); }
.speed { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* toasts (in-page copy of every push, so the demo works even where browser notifications are blocked) */
#toasts { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); top: 12px; width: min(440px, calc(100% - 24px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: rgba(255, 250, 240, .97); color: #2a1a12; border-radius: 16px; padding: 12px 14px; box-shadow: 0 14px 30px rgba(0,0,0,.4); display: flex; gap: 12px; align-items: flex-start; animation: drop .35s ease-out; border-left: 5px solid var(--red); }
.toast img { width: 36px; height: 36px; border-radius: 9px; flex: none; }
.toast b { display: block; font-size: 15px; }
.toast p { margin: 2px 0 0; font-size: 14px; line-height: 1.35; }
.toast.out { animation: lift .3s ease-in forwards; }
@keyframes drop { from { transform: translateY(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes lift { to { transform: translateY(-16px); opacity: 0; } }

/* admin */
.queue-item { border: 1px solid var(--card-line); border-radius: 14px; padding: 14px; margin: 12px 0; background: rgba(0,0,0,.18); }
.queue-item .kid { white-space: pre-wrap; background: rgba(255,255,255,.06); border-radius: 10px; padding: 10px 12px; margin: 8px 0; }
.flags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.meta { font-size: 13px; color: var(--muted); }
.wide .wrap { max-width: 860px; }

@media (prefers-reduced-motion: reduce) { .toast { animation: none; } #snow { display: none; } }
