:root {
  color-scheme: dark;
  --bg: #4a05a7;          /* logo purple */
  --surface: #3a0488;     /* cards */
  --surface-2: #5a14bd;   /* raised / hover */
  --ink: #1d0147;         /* outlines + hard shadows */
  --fg: #ffffff;
  --muted: #cdb2f5;
  --pink: #fc2ccf;
  --pink-soft: rgba(252, 44, 207, .28);
  --radius: 22px;
  --shadow: 0 5px 0 var(--ink);
  --display: "Baloo 2", "Inter", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); overflow-x: clip; }
body { overflow-x: clip; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1000px 600px at 85% -10%, rgba(252, 44, 207, .22), transparent 60%),
    radial-gradient(rgba(255, 255, 255, .07) 1.5px, transparent 1.5px);
  background-size: auto, 22px 22px;
  background-attachment: fixed, scroll;
}
a { color: inherit; }
img { display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
h1, h2, h3, h4, .display { font-family: var(--display); }
::selection { background: var(--pink); color: #fff; }

/* buttons (sticker style) */
.pill-btn, .cta, .vote, .white-btn, .ghost-btn, .icon-btn, .close, .flip, .ca {
  border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink);
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.pill-btn:hover, .cta:hover, .vote:not(:disabled):hover, .white-btn:hover, .ghost-btn:hover, .icon-btn:hover, .close:hover, .flip:hover, .ca:hover {
  transform: translateY(-1px); box-shadow: 0 4px 0 var(--ink);
}
.pill-btn:active, .cta:active, .vote:not(:disabled):active, .white-btn:active, .ghost-btn:active, .icon-btn:active, .close:active, .flip:active, .ca:active {
  transform: translateY(3px); box-shadow: 0 0 0 var(--ink);
}

/* nav */
.nav {
  position: sticky; top: 0; z-index: 20; background: rgba(58, 4, 136, .88);
  backdrop-filter: saturate(1.3) blur(10px); border-bottom: 2.5px solid var(--ink);
  display: flex; align-items: center; justify-content: space-between; padding: 8px 20px;
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand img { height: 44px; width: auto; filter: drop-shadow(0 2px 0 var(--ink)); }
.nav-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { width: 38px; height: 38px; border-radius: 999px; display: grid; place-items: center; background: var(--surface-2); color: #fff; }
.pill-btn { height: 38px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 800; font-size: 15px; text-decoration: none; white-space: nowrap; background: var(--surface-2); color: #fff; }
.pill-btn.dark { background: var(--pink); color: #fff; }
.pill-btn.phantom.connected { background: #6a24cc; }
.ph-dot { width: 20px; height: 20px; border-radius: 6px; background: url("/phantom.png") center/cover no-repeat; flex-shrink: 0; }

/* hero — centered, stacked */
.hero { text-align: center; padding-top: 36px; padding-bottom: 36px; display: flex; flex-direction: column; align-items: center; }
.hero-logo { width: min(460px, 82%); height: auto; animation: bob 4s ease-in-out infinite; filter: drop-shadow(0 8px 0 var(--ink)) drop-shadow(0 24px 40px rgba(252, 44, 207, .35)); }
@keyframes bob { 0%, 100% { transform: rotate(-2deg) translateY(0); } 50% { transform: rotate(2deg) translateY(-8px); } }
h1 { font-size: clamp(40px, 6vw, 68px); line-height: 1; font-weight: 800; margin: 18px 0 12px; color: #fff; text-shadow: 0 4px 0 var(--ink); }
h1 .pop { color: var(--pink); -webkit-text-stroke: 3px var(--ink); paint-order: stroke fill; }
.lede { font-size: 17px; line-height: 1.55; color: #e8dcff; max-width: 520px; margin: 0 0 26px; }
.lede b { color: var(--pink); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; justify-content: center; align-items: center; max-width: 100%; }
.cta { display: inline-flex; align-items: center; gap: 10px; background: var(--pink); color: #fff; border-radius: 999px; padding: 0 32px; height: 62px; font-family: var(--display); font-weight: 800; font-size: 21px; box-shadow: var(--shadow); }
.cta:hover { box-shadow: 0 6px 0 var(--ink); }
.cta.small { height: 48px; padding: 0 20px; font-size: 17px; box-shadow: 0 3px 0 var(--ink); }
.cta:disabled { opacity: .6; cursor: default; transform: none; }
.fine { font-size: 12px; color: var(--muted); margin: 16px 0 0; }
.fine.center { text-align: center; margin: 14px 0 0; }
.ca { display: inline-flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 999px; height: 50px; padding: 0 18px 0 6px; max-width: 100%; color: #fff; }
.ca-label { font-family: var(--display); font-weight: 800; font-size: 14px; color: #fff; background: var(--pink); border-radius: 999px; padding: 3px 10px 1px; }
.ca code { min-width: 0; max-width: 240px; font-family: "JetBrains Mono", ui-monospace, monospace; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ca svg { flex-shrink: 0; color: var(--muted); }

/* marquee */
.marquee { background: var(--pink); border-block: 3px solid var(--ink); overflow: hidden; transform: rotate(-1.5deg); margin: 12px -10px 8px; box-shadow: 0 5px 0 var(--ink); }
.marquee-track { display: flex; gap: 28px; width: max-content; padding: 10px 0 6px; animation: scroll 28s linear infinite; font-family: var(--display); font-weight: 800; font-size: 26px; text-transform: uppercase; color: #fff; white-space: nowrap; }
.marquee-track i { font-style: normal; color: var(--ink); }
@keyframes scroll { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track, .hero-logo { animation: none; } }

/* how — tilted stickers */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; padding-top: 44px; padding-bottom: 44px; }
.sticker { background: var(--surface); border: 3px solid var(--ink); box-shadow: 0 6px 0 var(--ink); border-radius: 26px; padding: 30px 22px 22px; position: relative; transition: transform .2s ease; }
.sticker.s1 { transform: rotate(-2deg); }
.sticker.s2 { transform: rotate(1.5deg) translateY(10px); background: #5a14bd; }
.sticker.s3 { transform: rotate(-1deg); }
.sticker:hover { transform: rotate(0) translateY(-4px); }
.sticker .num { position: absolute; top: -20px; left: 20px; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--pink); color: #fff; font-family: var(--display); font-size: 22px; font-weight: 800; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.sticker h3 { margin: 0 0 6px; font-size: 26px; line-height: 1.1; color: #fff; }
.sticker p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.sticker p b { color: var(--pink); }

/* stage: sticky sidebar + reel */
.stage { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 28px; align-items: start; padding-top: 12px; padding-bottom: 56px; }
.side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 16px; }
.panel { background: var(--surface); border: 2.5px solid var(--ink); box-shadow: var(--shadow); border-radius: var(--radius); padding: 18px 16px; }
h2 { font-size: 30px; line-height: 1; margin: 0 0 6px; font-weight: 800; color: #fff; text-shadow: 0 3px 0 var(--ink); }
.sub { margin: 0 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* clock */
.clock { display: flex; align-items: center; gap: 16px; background: linear-gradient(145deg, #5a14bd, var(--surface)); }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 11; }
.ring-bg { stroke: var(--ink); }
.ring-fg { stroke: var(--pink); stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dashoffset .5s linear; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-family: var(--display); font-size: 34px; line-height: 1; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ring-label span { font-size: 10px; color: var(--muted); font-weight: 600; margin-top: 2px; }
.clock-stats { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.clock-stats span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.clock-stats b { font-family: var(--display); font-size: 24px; line-height: 1.1; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
#prize { color: var(--pink); }

/* podium */
.empty { border: 2.5px dashed rgba(255, 255, 255, .3); border-radius: 18px; padding: 22px; text-align: center; color: var(--muted); font-size: 14px; margin: 0; background: rgba(29, 1, 71, .25); }
.podium { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; align-items: end; margin-bottom: 10px; }
.pod { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pod .shot { position: relative; width: 100%; margin-bottom: 18px; }
.pod img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 2.5px solid var(--ink); cursor: zoom-in; background: var(--surface-2); }
.pod.p1 img { border-color: var(--pink); box-shadow: 0 0 0 3px var(--ink), 0 0 24px rgba(252, 44, 207, .5); }
.pod .shot .vote { position: absolute; left: 50%; bottom: -14px; transform: translateX(-50%); }
.pod .shot .vote:not(:disabled):hover { transform: translateX(-50%) translateY(-1px); }
.pod .shot .vote:not(:disabled):active { transform: translateX(-50%) translateY(2px); }
.pod .n { font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1; color: #fff; }
.pod .v { font-size: 11px; color: var(--muted); margin: 2px 0 6px; }
.pod .block { width: 100%; border: 2.5px solid var(--ink); border-bottom: 0; border-radius: 12px 12px 0 0; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 26px; color: #fff; background: var(--surface-2); }
.pod.p1 .block { height: 64px; background: var(--pink); }
.pod.p2 .block { height: 44px; }
.pod.p3 .block { height: 30px; font-size: 20px; }
.podium-base { height: 8px; background: var(--ink); border-radius: 4px; margin: -10px 0 12px; }
.runners { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.runners li { display: grid; grid-template-columns: 22px 38px 1fr auto auto; gap: 8px; align-items: center; background: rgba(29, 1, 71, .35); border-radius: 12px; padding: 5px 6px 5px 8px; }
.runners .pos { font-family: var(--display); font-weight: 800; color: var(--muted); text-align: center; }
.runners img { width: 38px; height: 38px; border-radius: 9px; object-fit: cover; border: 2px solid var(--ink); cursor: zoom-in; }
.runners b { font-family: var(--display); font-size: 15px; color: #fff; }
.runners .v { font-size: 12px; font-weight: 700; color: var(--muted); }

/* winners */
.winners h4 { margin: 0 0 8px; font-size: 22px; color: #fff; }
.winners ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.winners li { display: grid; grid-template-columns: 34px 1fr auto; gap: 8px; align-items: center; padding: 7px 0; border-top: 1.5px dashed rgba(255, 255, 255, .15); }
.winners li:first-child { border-top: 0; }
.winners li.muted { display: block; font-size: 13px; }
.winners img, .winners .ph { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; background: var(--surface-2); border: 2px solid var(--ink); }
.winners .w-meta { min-width: 0; }
.winners .w-meta b { font-family: var(--display); font-size: 15px; line-height: 1.1; display: block; color: #fff; }
.winners .w-meta span { font-family: "JetBrains Mono", monospace; font-size: 10px; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.winners .w-right { text-align: right; font-size: 12px; font-weight: 700; white-space: nowrap; color: var(--pink); }
.winners .w-status { display: block; font-weight: 500; font-size: 10px; color: var(--muted); }
.winners .w-right a { display: block; font-weight: 500; font-size: 10px; color: var(--muted); }

/* qr */
.phone { display: flex; align-items: center; gap: 14px; }
.phone .qr { border-radius: 12px; padding: 5px; background: #fff; border: 2.5px solid var(--pink); flex-shrink: 0; }
.phone h3 { margin: 0 0 2px; font-size: 18px; color: #fff; }
.phone p { margin: 0; color: var(--muted); font-size: 13px; }
@media (hover: none) and (pointer: coarse) { .phone { display: none; } }

/* reel — polaroids */
.reel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; gap: 12px; }
.reel-head h2 { font-size: 44px; }
.count { background: var(--ink); color: var(--muted); border-radius: 999px; padding: 5px 14px 3px; font-family: var(--display); font-weight: 700; font-size: 15px; }
.count b { color: var(--pink); }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px 18px; }
.tile { background: #fff; border: 2.5px solid var(--ink); box-shadow: 0 5px 0 var(--ink); border-radius: 14px; padding: 8px 8px 0; transition: transform .2s ease; }
.tile:nth-child(3n+1) { transform: rotate(-1.2deg); }
.tile:nth-child(3n+2) { transform: rotate(.8deg); }
.tile:nth-child(3n) { transform: rotate(-.4deg); }
.tile:hover { transform: rotate(0) translateY(-4px); }
.tile .shot { aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--pink-soft); }
.tile img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px 2px 9px; }
.tile-foot .id { font-family: var(--display); font-weight: 800; font-size: 18px; line-height: 1; color: var(--bg); }
.tile-foot .w { display: block; font-family: "JetBrains Mono", monospace; font-size: 10px; color: #8a6db8; margin-top: 2px; }
.tile.new { animation: pop .5s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.9) rotate(-4deg); } to { opacity: 1; } }
.vote { background: var(--pink); color: #fff; border-width: 2px; border-radius: 999px; height: 32px; padding: 0 14px; font-family: var(--display); font-size: 15px; font-weight: 800; box-shadow: 0 2px 0 var(--ink); flex-shrink: 0; }
.vote:disabled { opacity: .5; cursor: default; }
.vote.voted { background: var(--surface-2); }
.pod .vote { height: 28px; padding: 0 12px; font-size: 13px; }
.runners .vote { height: 28px; padding: 0 10px; font-size: 13px; }
#sentinel { height: 1px; }

.foot { background: var(--ink); margin-top: 20px; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 24px; font-size: 12px; color: #fff; font-weight: 600; }
.foot-inner img { height: 40px; width: auto; }
.foot .muted { font-weight: 400; }

/* modal */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 0, 38, .65); display: grid; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.sheet { background: var(--surface); border: 3px solid var(--ink); box-shadow: 0 7px 0 var(--ink); border-radius: 26px; width: min(460px, 100%); padding: 16px; max-height: calc(100dvh - 32px); overflow: auto; }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 2px 2px 12px; }
.sheet-head h3 { margin: 0; font-size: 24px; line-height: 1; color: #fff; }
.close { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: #fff; }
.viewer { position: relative; aspect-ratio: 1; background: var(--ink); border-radius: 18px; overflow: hidden; border: 2.5px solid var(--ink); }
.viewer video, .viewer #shot { width: 100%; height: 100%; object-fit: cover; }
.viewer video.mirror { transform: scaleX(-1); }
.guide { position: absolute; inset: 0; pointer-events: none; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; padding: 6% 6% 16px; }
.guide svg { position: absolute; inset: 7% 8% 13%; width: 84%; height: 80%; overflow: visible; }
.guide .prints { fill: rgba(252, 44, 207, .08); stroke: #fff; stroke-width: 3.5px; stroke-dasharray: 9 7; stroke-linecap: round; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 3px rgba(29, 1, 71, .8)); animation: breathe 2.4s ease-in-out infinite; }
.guide .prints use { vector-effect: non-scaling-stroke; }
@keyframes breathe { 50% { stroke: var(--pink); } }
.guide-hint { position: relative; background: var(--pink); color: #fff; font-family: var(--display); font-weight: 800; font-size: 16px; line-height: 1; padding: 8px 14px 6px; border-radius: 999px; border: 2.5px solid var(--ink); box-shadow: 0 3px 0 var(--ink); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .guide .prints { animation: none; } }
.cam-msg { position: absolute; inset: 0; display: grid; place-content: center; gap: 16px; text-align: center; color: #fff; padding: 24px; font-size: 14px; line-height: 1.5; }
.cam-msg p { margin: 0; }
.white-btn { justify-self: center; background: var(--pink); color: #fff; border-radius: 999px; height: 42px; padding: 0 20px; font-family: var(--display); font-weight: 800; font-size: 17px; }
.controls { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 14px 0 0; }
.shutter { width: 66px; height: 66px; border-radius: 50%; border: 3px solid var(--ink); background: var(--pink); box-shadow: inset 0 0 0 4px #fff, 0 4px 0 var(--ink); transition: transform .1s ease; }
.shutter:not(:disabled):active { transform: translateY(3px); box-shadow: inset 0 0 0 4px #fff; }
.shutter:disabled { opacity: .5; }
.flip { justify-self: end; width: 42px; height: 42px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; color: #fff; }
.submit { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; }
.submit label { font-size: 13px; font-weight: 700; color: #fff; }
.submit input { height: 46px; border-radius: 14px; border: 2.5px solid var(--ink); background: var(--ink); padding: 0 12px; font-family: "JetBrains Mono", monospace; font-size: 12px; outline: none; color: #fff; }
.submit input::placeholder { color: rgba(205, 178, 245, .6); }
.submit input:focus { border-color: var(--pink); }
.submit .row { display: flex; gap: 8px; justify-content: space-between; margin-top: 6px; }
.ghost-btn { height: 48px; border-radius: 999px; background: var(--surface-2); padding: 0 18px; font-family: var(--display); font-weight: 800; font-size: 17px; color: #fff; }
.err { color: #ff8fc8; font-size: 13px; font-weight: 600; margin: 2px 0 0; }

.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(15, 0, 38, .9); display: grid; place-items: center; padding: 20px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 90dvh; border-radius: 16px; border: 3px solid var(--pink); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--pink); color: #fff; padding: 10px 20px 8px; border-radius: 999px; font-family: var(--display); font-size: 17px; font-weight: 800; z-index: 70; border: 2.5px solid var(--ink); box-shadow: 0 4px 0 var(--ink); max-width: calc(100vw - 32px); text-align: center; }

@media (max-width: 960px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; }
  .grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 720px) {
  .how { grid-template-columns: 1fr; gap: 30px; }
  .sticker.s2 { transform: rotate(1deg); }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 14px 12px; }
  .reel-head h2 { font-size: 36px; }
  .marquee-track { font-size: 20px; }
  .pill-btn { padding: 0 12px; font-size: 14px; }
  .pill-btn .ticker { display: none; }
  .brand img { height: 36px; }
  .ca code { max-width: 150px; }
  .foot-inner { justify-content: center; text-align: center; }
}
