:root {
  --bg: #0a0a0b;
  --ink: #f5f3ee;
  --muted: #9b9aa3;
  --line: rgba(245, 243, 238, 0.14);
  --amber: #f5a623;        /* the werewolf's eyes */
  --paper: #f3efe6;        /* ballot slip */
  --paper-ink: #121212;
  --moon: #f4ecd2;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: "Heebo", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

main {
  max-width: 460px;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* ---------------------------------------------------------------- brand */
.brand { text-align: center; margin: 6px 0 22px; }
.logo {
  font-family: "Frank Ruhl Libre", Georgia, serif;
  font-weight: 900;
  font-size: 44px;
  letter-spacing: 0.5px;
  line-height: 1;
}
.edition { color: var(--muted); font-weight: 600; font-size: 15px; margin-top: 4px; letter-spacing: 0.5px; }

.screen { flex: 1; }

/* the Loyalists' ballot slip */
.slip {
  width: 236px;
  margin: 4px auto 26px;
  padding: 18px 16px 16px;
  background: var(--paper);
  color: var(--paper-ink);
  text-align: center;
  border-radius: 3px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 2px 0 rgba(0, 0, 0, 0.2);
  transform: rotate(-3deg);
}
.slip-letter { font-weight: 900; font-size: 84px; line-height: 0.95; }
.slip-name { font-weight: 800; font-size: 22px; margin-top: 4px; }
.slip-slogan { font-size: 13px; margin-top: 6px; color: #444; }

h1, h2 { font-weight: 900; text-align: center; margin: 0; line-height: 1.1; }
h1 { font-size: 40px; }
h2 { font-size: 34px; }
.lead { text-align: center; color: var(--muted); font-size: 18px; margin: 10px 0 22px; }
.kicker { text-align: center; color: var(--muted); font-weight: 600; margin: 0 0 4px; }
.fine { text-align: center; color: var(--muted); font-size: 13px; margin: 14px 0 0; }

/* ---------------------------------------------------------------- form */
.picker {
  display: grid;
  place-items: center;
  position: relative;
  min-height: 230px;
  border: 1.5px dashed var(--line);
  border-radius: 20px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.03);
}
.picker:focus-within, .picker:hover { border-color: rgba(245, 243, 238, 0.4); }
.picker-empty { display: grid; justify-items: center; gap: 6px; padding: 28px 18px; text-align: center; }
.picker-empty svg { color: var(--amber); }
.picker-empty strong { font-size: 19px; }
.picker-empty small { color: var(--muted); }
#preview { display: block; width: 100%; max-height: 420px; object-fit: contain; background: #000; }
.picker-change {
  position: absolute;
  bottom: 12px;
  inset-inline: 0;
  margin: auto;
  width: max-content;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  font-size: 14px;
  font-weight: 600;
}

.consent {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 2px 18px;
  font-size: 16px;
  cursor: pointer;
}
.consent input { width: 22px; height: 22px; accent-color: var(--amber); flex: none; }

.cta, .ghost {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  font: inherit;
  font-weight: 900;
  font-size: 20px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  padding: 16px 20px;
  transition: transform 0.1s ease, opacity 0.2s ease;
}
.cta { background: var(--amber); color: #120c00; box-shadow: 0 10px 30px rgba(245, 166, 35, 0.25); }
.cta:active, .ghost:active { transform: scale(0.98); }
.cta:disabled { background: rgba(255, 255, 255, 0.12); color: rgba(245, 243, 238, 0.45); box-shadow: none; cursor: default; }
.ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); font-weight: 700; font-size: 17px; }

/* ---------------------------------------------------------------- night */
.night {
  position: relative;
  height: 300px;
  margin: 6px 0 22px;
  border-radius: 22px;
  overflow: hidden;
  background: radial-gradient(120% 90% at 50% 100%, #0d1424 0%, #06070c 60%, #030304 100%);
}
.moon {
  position: absolute;
  width: 108px;
  height: 108px;
  top: 40px;
  inset-inline-start: calc(50% - 54px);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fffaf0, var(--moon) 55%, #d8cfb0 100%);
  box-shadow: 0 0 60px 18px rgba(244, 236, 210, 0.25);
  animation: rise 6s ease-out both;
}
.stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 20%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 30% 70%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 78% 30%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 88% 62%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 55% 12%, #fff 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 82%, #fff 50%, transparent 51%),
    radial-gradient(1px 1px at 20% 88%, #fff 50%, transparent 51%);
  animation: twinkle 3s ease-in-out infinite alternate;
}
.eyes {
  position: absolute;
  bottom: 46px;
  inset-inline: 0;
  display: flex;
  justify-content: center;
  gap: 26px;
  animation: blink 5s infinite;
}
.eyes span {
  width: 18px;
  height: 9px;
  border-radius: 50% 50% 50% 50% / 100% 100% 0 0;
  background: var(--amber);
  box-shadow: 0 0 14px 4px rgba(245, 166, 35, 0.6);
  transform: rotate(8deg);
}
.eyes span:first-child { transform: rotate(-8deg); }
@keyframes rise { from { transform: translateY(70px); opacity: 0.3; } to { transform: none; opacity: 1; } }
@keyframes twinkle { from { opacity: 0.45; } to { opacity: 1; } }
@keyframes blink { 0%, 44%, 50%, 100% { opacity: 1; } 47% { opacity: 0; } 70%, 72% { opacity: 0.2; } }

.narrator { text-align: center; font-weight: 800; font-size: 26px; min-height: 1.4em; margin: 0; transition: opacity 0.6s ease; }
.narrator.fade { opacity: 0; }
.timer { text-align: center; color: var(--muted); font-variant-numeric: tabular-nums; margin: 10px 0 0; }

/* ---------------------------------------------------------------- morning */
.video-wrap { margin: 18px 0; border-radius: 20px; overflow: hidden; background: #000; }
.video-wrap video { display: block; width: 100%; max-height: 70dvh; background: #000; }
.actions { display: grid; gap: 10px; }

/* ---------------------------------------------------------------- footer */
footer { margin-top: 36px; text-align: center; color: var(--muted); font-size: 13px; line-height: 1.6; }
.endcard { font-family: "Frank Ruhl Libre", Georgia, serif; font-weight: 900; color: var(--ink); font-size: 16px; }
.paid { margin-top: 8px; font-size: 11px; letter-spacing: 0.3px; }

@media (prefers-reduced-motion: reduce) {
  .moon, .stars, .eyes { animation: none; }
  .narrator { transition: none; }
}
