/* QR Vote: one stylesheet for the MC console, the projector, the phones and the
   judges, dressed for YIC Halloween Day (see the tokens). The projector (.stage)
   is a 16:9 size container and sets everything in cqh, so the preview on the
   console and the fullscreen projector are one picture. */

:root {
  /* YIC Halloween Day: the key visual's pumpkin sky, night-ink silhouettes,
     bone-white lettering and the full moon. Anton carries the poster's condensed
     display voice (with Vietnamese); Be Vietnam Pro everything else. */
  --font: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Anton", "Be Vietnam Pro", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --bg: #10121a;
  --c1: #191c27;
  --c2: #232736;
  --bd: #2f3446;
  --bd2: #444b63;
  --t1: #f7f0e4;
  --t2: rgba(247, 240, 228, .72);
  --t3: rgba(247, 240, 228, .58);
  --pri: #f18642;
  --pri-ink: #1d0e04;
  --pri-bg: rgba(241, 134, 66, .14);
  --pri-line: rgba(241, 134, 66, .5);
  --ok: #8fd14f;
  --ok-bg: rgba(143, 209, 79, .12);
  --ok-line: rgba(143, 209, 79, .45);
  --err: #ff6a55;
  --err-bg: rgba(255, 106, 85, .12);
  --moon: #f6e3a1;
  --ember: #e2552a;
  --sky: #f18642;
  --sky-deep: #e06a2c;
  --ink: #232634;
  --silver: #e8e1d4;
  --bronze: #e2552a;
  color-scheme: dark;
  accent-color: var(--pri);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; background: var(--bg); color: var(--t1);
  font: 400 14px/1.5 var(--font); font-variant-numeric: tabular-nums;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p, ol, ul { margin: 0; }
::selection { background: var(--pri); color: var(--pri-ink); }
* { scrollbar-color: var(--bd2) transparent; scrollbar-width: thin; }
:focus-visible { outline: 2px solid var(--pri); outline-offset: 2px; }
.muted { color: var(--t2); }
.small { font-size: 13px; }
.err { color: var(--err); font-weight: 600; }
.ok { color: var(--ok); }

/* --- icons, logo ------------------------------------------------------------ */
.ic { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.logo { display: inline-flex; align-items: center; gap: 10px; color: var(--t1); text-decoration: none; }
.logo svg { width: 28px; height: 28px; flex: none; }
.logo img { height: 28px; width: auto; }
.logo b { font-size: 16px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; }

/* --- controls ----------------------------------------------------------------- */
input, button, select, textarea { font: inherit; color: inherit; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 36px; padding: 0 16px; border-radius: 8px; border: 1px solid var(--bd2);
  background: transparent; color: var(--t1); font: 500 14px/1 var(--font);
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: border-color .2s, color .2s, background-color .2s, filter .2s;
}
.btn:hover:not(:disabled) { border-color: var(--pri); color: var(--pri); }
.btn.p { background: var(--pri); border-color: var(--pri); color: var(--pri-ink); }
.btn.p:hover:not(:disabled) { filter: brightness(1.1); color: var(--pri-ink); }
.btn.d { border-color: var(--err); color: var(--err); background: var(--err-bg); }
.btn.d:hover:not(:disabled) { filter: brightness(1.15); color: var(--err); }
.btn.q { border-color: transparent; color: var(--t2); }
.btn.sq { width: 36px; padding: 0; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn.lg { height: 44px; padding: 0 18px; font-size: 15px; font-weight: 600; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.is-busy { cursor: progress; opacity: .7; }

.fld {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--bd2);
  background: var(--bg); color: var(--t1); font: 400 14px var(--font);
  transition: border-color .2s, box-shadow .2s;
}
.fld::placeholder { color: var(--t3); opacity: 1; }
.fld:hover { border-color: var(--pri); }
.fld:focus { outline: none; border-color: var(--pri); box-shadow: 0 0 0 2px var(--pri-bg); }
.fld[aria-invalid="true"] { border-color: var(--err); }
.lbl { font-size: 13px; font-weight: 500; color: var(--t2); }
.field { display: grid; gap: 6px; }
.hint { font-size: 13px; color: var(--t3); }

.in {
  height: 32px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--bd2);
  background: var(--c1); color: var(--t1); font: 500 14px var(--font); text-align: center;
  transition: border-color .2s;
}
.in:hover, .in:focus { border-color: var(--pri); outline: none; }

.sw {
  appearance: none; -webkit-appearance: none; flex: none; width: 40px; height: 22px; margin: 0;
  border: 0; border-radius: 999px; background: var(--bd2); position: relative; cursor: pointer;
  transition: background-color .2s;
}
.sw::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform .2s; }
.sw:checked { background: var(--pri); }
.sw:checked::after { transform: translateX(18px); }

.tag {
  display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 6px;
  font-size: 13px; line-height: 22px; border: 1px solid var(--bd2); color: var(--t2); white-space: nowrap;
}
.tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.ok { color: var(--ok); background: var(--ok-bg); border-color: var(--ok-line); }
.tag.warn { color: var(--pri); background: var(--pri-bg); border-color: var(--pri-line); }
.tag.err { color: var(--err); background: var(--err-bg); border-color: rgba(255, 77, 79, .45); }

.cd { background: var(--c1); border: 1px solid var(--bd); border-radius: 12px; }
.code {
  font-family: var(--mono); font-weight: 700; font-size: 14px; letter-spacing: .12em; color: var(--pri);
  padding: 2px 10px; border-radius: 6px; border: 1px dashed var(--bd2);
}

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  z-index: 60; margin: 0; max-width: min(30rem, calc(100vw - 32px)); width: max-content;
  background: var(--c2); color: var(--t1); border: 1px solid var(--bd2); font-weight: 500;
  border-radius: 10px; padding: 10px 16px; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .7);
  animation: toast-in .2s ease-out;
}
.toast.is-error { border-color: var(--err); color: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* --- login / code entry: the ticket card --------------------------------------------- */
.gate {
  min-height: 100dvh; display: grid; place-items: center; padding: 48px 16px;
  background-color: var(--bg); background-image: radial-gradient(#262626 1px, transparent 1.2px); background-size: 26px 26px;
}
.gate-in { width: min(25rem, 100%); display: grid; gap: 20px; justify-items: center; }
.ticket-card { width: 100%; background: var(--c1); border: 1px solid var(--bd); border-radius: 16px; }
.ticket-card .top { padding: 32px 32px 28px; display: grid; gap: 20px; }
.ticket-card .top h1 { font-size: 26px; line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
.ticket-card .perf { position: relative; border-top: 2px dashed var(--bd2); }
.ticket-card .perf::before, .ticket-card .perf::after {
  content: ""; position: absolute; top: -12px; width: 22px; height: 22px; border-radius: 50%; background: var(--bg);
}
.ticket-card .perf::before { left: -12px; }
.ticket-card .perf::after { right: -12px; }
.ticket-card form, .ticket-card .bottom { padding: 28px 32px 32px; display: grid; gap: 16px; }
.gate-foot { font-size: 13px; color: var(--t3); text-align: center; }
.code-in {
  font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: .35em; text-align: center;
  text-transform: uppercase; height: 60px; padding-left: .35em;
}

/* --- MC console shell ------------------------------------------------------------------ */
.host-head { background: var(--c1); border-bottom: 1px solid var(--bd); position: sticky; top: 0; z-index: 30; }
.host-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; padding: 0 24px; min-height: 56px; }
.host-row > .logo { padding: 8px 0; }
.nav { display: flex; flex-wrap: wrap; flex: 1 1 auto; }
.mi {
  display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px; color: var(--t2);
  background: none; border: 0; border-bottom: 2px solid transparent; font: 500 14px var(--font);
  cursor: pointer; transition: color .2s, border-color .2s;
}
.mi:hover { color: var(--t1); }
.mi.on { color: var(--pri); border-bottom-color: var(--pri); }
.head-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; }
.head-right .count { color: var(--t2); }
.head-right .count b { color: var(--t1); font-size: 16px; }

.quick {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; padding: 10px 24px;
  border-top: 1px solid var(--bd); background: var(--bg); font-size: 13px; color: var(--t2);
}
.quick label { display: flex; align-items: center; gap: 10px; }
.quick .in { width: 56px; }
.quick .spacer { flex: 1; }

.page { width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px; display: flex; flex-direction: column; gap: 20px; }
.page.wide { max-width: 1500px; gap: 16px; }
.page-title h1 { font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -.01em; }
.page-title p { margin-top: 4px; color: var(--t2); max-width: 65ch; }
.cols { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.cd.pad { padding: 20px; display: grid; gap: 16px; align-content: start; }
.cd h2 { font-size: 16px; font-weight: 600; }
.cd .sub { font-size: 13px; color: var(--t3); }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
  border-radius: 8px; background: var(--bg); border: 1px solid var(--bd); cursor: pointer;
}
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }

.er { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 10px; align-items: center; }
.pr { display: grid; grid-template-columns: 32px minmax(0, 1fr) minmax(0, 1fr); gap: 10px; align-items: center; }
.en { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--c2); color: var(--t2); font-weight: 700; font-size: 13px; }
.medal { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 14px; }
.medal.r1 { background: var(--pri); color: var(--pri-ink); }
.medal.r2 { background: var(--silver); color: #141414; }
.medal.r3 { background: var(--bronze); color: #fff; }
.medal.rx { background: var(--c2); color: var(--t2); }
.list { display: grid; gap: 10px; }
.empty { padding: 24px; text-align: center; color: var(--t2); border: 1px dashed var(--bd2); border-radius: 10px; }
@media (max-width: 640px) {
  .er { grid-template-columns: 32px minmax(0, 1fr) 36px; }
  .er .e2 { grid-column: 2; grid-row: 2; }
  .er .ed { grid-column: 3; grid-row: 1; }
  .pr { grid-template-columns: 32px minmax(0, 1fr); }
  .pr .p2 { grid-column: 2; }
  .host-row, .quick, .page { padding-left: 16px; padding-right: 16px; }
}

.savebar {
  position: sticky; bottom: 20px; margin-top: auto; display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: 12px 16px; padding: 10px 10px 10px 18px; border-radius: 12px;
  background: var(--c2); border: 1px solid var(--bd); box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .7);
}
.savebar.dirty { border-color: var(--pri-line); }
.savebar .st { display: inline-flex; align-items: center; gap: 10px; font-weight: 500; color: var(--t2); }
.savebar.dirty .st { color: var(--pri); }
.savebar .st i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }

.stage-frame { border-radius: 12px; overflow: hidden; border: 1px solid var(--bd); }
.controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px;
  padding: 16px 20px; border-radius: 12px; background: var(--c1); border: 1px solid var(--bd);
}
.sg { display: inline-flex; padding: 4px; border-radius: 8px; background: var(--c2); flex-wrap: wrap; }
.sgi { height: 30px; padding: 0 16px; border: 0; border-radius: 6px; background: transparent; color: var(--t2); font: 500 14px var(--font); cursor: pointer; transition: background-color .2s, color .2s; }
.sgi:hover { color: var(--t1); }
.sgi.on { background: var(--bd2); color: var(--t1); }
.steps { list-style: none; padding: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; }
.st-i { display: flex; align-items: center; gap: 8px; color: var(--t3); font-size: 14px; font-weight: 500; }
.st-i b { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; border: 1px solid currentColor; }
.st-i.done { color: var(--t2); }
.st-i.done b { background: var(--ok); border-color: var(--ok); color: #06210a; }
.st-i.now { color: var(--t1); }
.st-i.now b { background: var(--pri); border-color: var(--pri); color: var(--pri-ink); }
.steps .sl { width: 28px; height: 1px; background: var(--bd2); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

.wbar { display: flex; gap: 3px; height: 10px; border-radius: 99px; overflow: hidden; background: var(--c2); }
.wbar i { display: block; transition: flex .6s cubic-bezier(.22, 1, .36, 1); }
.wbar .a { background: #8c8c8c; }
.wbar .j { background: var(--pri); }
.wlab { display: flex; justify-content: space-between; font-size: 13px; font-weight: 500; color: var(--t2); }
.judge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg); border: 1px solid var(--bd);
}
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--pri-bg); color: var(--pri); font-weight: 700; }
.judge .who { flex: 1 1 200px; min-width: 0; }
.judge .who b { display: block; font-weight: 600; line-height: 1.3; }
.judge .who code { font-family: var(--mono); font-size: 12px; color: var(--t2); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.matrix { overflow-x: auto; border: 1px solid var(--bd); border-radius: 8px; }
.matrix table { border-collapse: collapse; width: 100%; min-width: 560px; }
.matrix th { background: var(--c2); font-size: 13px; font-weight: 600; color: var(--t2); padding: 10px 16px; text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix td { padding: 6px 16px; border-top: 1px solid var(--bd); text-align: center; }
.matrix td:first-child { font-weight: 500; }
.matrix .in { width: 76px; }
.matrix .avg { font-size: 15px; font-weight: 700; }
.matrix .avg.best { color: var(--pri); }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tile { padding: 18px 20px; display: grid; gap: 4px; }
.tile > span { font-size: 13px; color: var(--t2); }
.tile b { font-size: 30px; font-weight: 700; line-height: 1.2; letter-spacing: -.02em; }
.tile small { font-size: 13px; color: var(--t3); }
.glog { display: grid; gap: 8px; }
.g {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; border-radius: 8px; background: var(--bg); border: 1px solid var(--bd);
}
.g .gi { width: 44px; height: 44px; border-radius: 10px; display: grid; place-items: center; background: var(--pri-bg); font-size: 22px; }
.g .gw { font-size: 13px; color: var(--t2); }
.g .ga { display: grid; gap: 4px; justify-items: end; }
.g .ga b { font-size: 16px; font-weight: 700; white-space: nowrap; }

/* --- the projector --------------------------------------------------------------------------- */
.stage {
  width: 100%; aspect-ratio: 16 / 9; container-type: size; position: relative; overflow: hidden;
  background: #070707; color: rgba(255, 255, 255, .9); font-family: var(--font); line-height: 1.3;
}
.stage:fullscreen, .stage.full { aspect-ratio: auto; width: 100vw; height: 100vh; }
.stage .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 6cqh 6cqh; }
.stage .orb { position: absolute; border-radius: 50%; transition: left 7s ease-in-out, right 7s ease-in-out; pointer-events: none; }
.stage .orb.a { width: 80cqh; height: 80cqh; background: radial-gradient(closest-side, rgba(241,134,66,.24), transparent); left: -12cqh; top: -30cqh; }
.stage .orb.b { width: 70cqh; height: 70cqh; background: radial-gradient(closest-side, rgba(22,119,255,.16), transparent); right: -10cqh; bottom: -28cqh; }
.stage.drift .orb.a { left: 34cqh; }
.stage.drift .orb.b { right: 30cqh; }
.stage-in { position: absolute; inset: 0; padding: 4.5cqh 5.5cqh; display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 3cqh; }
.stage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 4cqh; }
.stage-kicker { font-size: 1.8cqh; font-weight: 700; letter-spacing: .34em; color: var(--pri); margin-bottom: 1cqh; text-transform: uppercase; }
.stage-head h1 { font-size: 5.6cqh; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.phases { list-style: none; padding: 0; display: flex; align-items: center; gap: 1cqh; flex: none; }
.phases li { display: flex; align-items: center; gap: 1cqh; padding: .9cqh 1.8cqh; border-radius: 5cqh; font-size: 2cqh; font-weight: 600; border: .2cqh solid rgba(255,255,255,.14); color: rgba(255,255,255,.5); transition: all .5s ease; }
.phases li span { width: 2.8cqh; height: 2.8cqh; border-radius: 50%; display: grid; place-items: center; font-size: 1.6cqh; font-weight: 800; }
.phases li.now { border-color: rgba(241,134,66,.6); background: rgba(241,134,66,.14); color: var(--pri); }
.phases li.now span { background: var(--pri); color: var(--pri-ink); }
.phases li.done { color: rgba(255,255,255,.65); }
.phases li.done span { background: var(--ok); color: #06210a; }
.view { min-height: 0; position: relative; }

.v-qr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7cqh; align-items: center; height: 100%; }
.v-qr .left { display: grid; gap: 2.4cqh; align-content: center; min-width: 0; }
.v-qr .big { font-size: 7cqh; font-weight: 800; letter-spacing: -.02em; line-height: 1.05; }
.v-qr .lead { font-size: 2.5cqh; color: rgba(255,255,255,.65); max-width: 64cqh; }
.v-qr .clock-row { display: flex; align-items: flex-end; gap: 2.4cqh; margin-top: 1cqh; }
.v-qr .clock { font-family: var(--mono); font-weight: 700; font-size: 17cqh; line-height: .9; letter-spacing: -.02em; color: var(--pri); text-shadow: 0 0 5cqh rgba(241,134,66,.45); }
.v-qr .clock-row span { font-size: 2.4cqh; color: rgba(255,255,255,.65); padding-bottom: 1.2cqh; }
.v-qr .bar { height: 1.2cqh; border-radius: 1cqh; background: rgba(255,255,255,.1); overflow: hidden; max-width: 64cqh; }
.v-qr .bar i { display: block; height: 100%; border-radius: 1cqh; background: var(--pri); box-shadow: 0 0 2cqh rgba(241,134,66,.7); transition: width 1s linear; }
.v-qr .joined { display: flex; align-items: center; gap: 1.2cqh; font-size: 2.8cqh; }
.v-qr .joined i { width: 1.4cqh; height: 1.4cqh; border-radius: 50%; background: var(--ok); animation: blink 1s ease-in-out infinite alternate; }
.v-qr .joined b { font-size: 4cqh; font-weight: 800; }
.v-qr .joined span { color: rgba(255,255,255,.65); }
.v-qr .right { display: grid; gap: 1.8cqh; justify-items: center; }
.qr-frame { padding: 2.2cqh; border-radius: 3cqh; background: #141414; border: .25cqh solid rgba(241,134,66,.5); box-shadow: 0 0 6cqh rgba(241,134,66,.28), 0 0 0 .8cqh rgba(241,134,66,.08); }
.qr-frame .qr { width: 44cqh; aspect-ratio: 1; background: #fff; border-radius: 1.8cqh; padding: 2cqh; display: grid; place-items: center; }
.qr-frame .qr svg { width: 100%; height: 100%; display: block; }
.v-qr .scode { font-family: var(--mono); font-weight: 700; font-size: 5cqh; letter-spacing: .16em; color: var(--pri); }
.v-qr .url { font-size: 1.9cqh; color: rgba(255,255,255,.6); }
.v-qr .rot { width: 44cqh; display: grid; gap: .8cqh; }
.v-qr .rot .bar { height: .8cqh; max-width: none; }
.v-qr .rot .bar i { background: #8c8c8c; box-shadow: none; }
.v-qr .rot small { font-size: 1.7cqh; color: rgba(255,255,255,.55); text-align: center; }
.v-qr.waiting .clock-row, .v-qr.waiting > .left > .bar { display: none; }
@keyframes blink { from { opacity: 1; } to { opacity: .3; } }

.v-race { display: grid; grid-template-rows: auto minmax(0, 1fr); gap: 2.6cqh; height: 100%; position: relative; }
.v-race .meta { display: flex; align-items: center; gap: 2cqh; }
.v-race .pill { display: flex; align-items: baseline; gap: 1.2cqh; padding: 1.2cqh 2.4cqh; border-radius: 1.6cqh; background: rgba(255,255,255,.05); border: .2cqh solid rgba(255,255,255,.12); }
.v-race .pill span { font-size: 1.9cqh; color: rgba(255,255,255,.65); }
.v-race .pill b { font-size: 4cqh; font-weight: 800; }
.v-race .pill b.mono { font-family: var(--mono); color: var(--pri); }
.v-race .vbar { flex: 1; height: 1cqh; border-radius: 1cqh; background: rgba(255,255,255,.1); overflow: hidden; }
.v-race .vbar i { display: block; height: 100%; border-radius: 1cqh; background: var(--ok); box-shadow: 0 0 1.6cqh rgba(82,196,26,.6); transition: width 1s linear; }
.v-race .live { display: flex; align-items: center; gap: 1cqh; font-size: 2cqh; font-weight: 600; color: var(--ok); }
.v-race .live i { width: 1.2cqh; height: 1.2cqh; border-radius: 50%; background: currentColor; animation: blink 1s ease-in-out infinite alternate; }
.v-race .live.closed { color: var(--err); }
.v-race .live.closed i { animation: none; }
.rows { position: relative; min-height: 0; }
.rrow {
  position: absolute; left: 0; right: 0; height: 9.6cqh; padding: 0 2.4cqh; border-radius: 2cqh;
  background: rgba(255,255,255,.035); border: .2cqh solid rgba(255,255,255,.08);
  display: grid; grid-template-columns: 6.4cqh minmax(0, 1fr) 13cqh; column-gap: 2.4cqh; align-items: center;
  transition: top .9s cubic-bezier(.22,1,.36,1), background-color .45s ease, box-shadow .6s ease, border-color .6s ease;
}
.rrow .rk { width: 6.4cqh; height: 6.4cqh; border-radius: 1.6cqh; display: grid; place-items: center; font-weight: 800; font-size: 3cqh; background: rgba(255,255,255,.08); color: rgba(255,255,255,.7); transition: background-color .5s, color .5s; }
.rrow .nm { min-width: 0; display: grid; gap: 1.1cqh; }
.rrow .nm div { font-size: 3.4cqh; font-weight: 700; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rrow .tr { height: 1.6cqh; border-radius: 1cqh; background: rgba(255,255,255,.08); overflow: hidden; }
.rrow .tr i { display: block; height: 100%; border-radius: 1cqh; background: #8c8c8c; transition: width .9s cubic-bezier(.22,1,.36,1), background-color .5s; }
.rrow .vt { font-size: 5.4cqh; font-weight: 800; line-height: 1; text-align: right; transition: color .5s; }
.rrow.lead { background: rgba(241,134,66,.08); border-color: rgba(241,134,66,.55); box-shadow: 0 0 4cqh rgba(241,134,66,.28); }
.rrow.lead .rk { background: var(--pri); color: var(--pri-ink); }
.rrow.lead .tr i { background: var(--pri); box-shadow: 0 0 1.6cqh rgba(241,134,66,.8); }
.rrow.lead .vt { color: var(--pri); }
.rrow.bump { background: rgba(241,134,66,.16); }
.go { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; opacity: 0; transition: opacity .8s ease; }
.go div { font-size: 11cqh; font-weight: 800; letter-spacing: -.02em; color: var(--pri); text-shadow: 0 0 8cqh rgba(241,134,66,.8); transform: scale(1.35); transition: transform 1.2s cubic-bezier(.22,1,.36,1); }
.go.on { opacity: 1; }
.go.on div { transform: scale(1); }

.v-podium { position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2.2cqh; height: 100%; }
.v-podium .beam { position: absolute; left: 50%; top: -6cqh; width: 34cqh; height: 78cqh; margin-left: -17cqh; background: linear-gradient(180deg, rgba(241,134,66,.34), transparent 88%); clip-path: polygon(38% 0, 62% 0, 100% 100%, 0 100%); opacity: 0; transition: opacity 1.2s ease; }
.v-podium.won .beam { opacity: 1; }
.podium { position: relative; display: flex; align-items: flex-end; justify-content: center; gap: 2.4cqh; flex: 1; min-height: 0; border-bottom: .3cqh solid rgba(255,255,255,.18); }
.pod { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.pod .who { display: grid; justify-items: center; gap: .6cqh; padding-bottom: 1.6cqh; text-align: center; opacity: 0; transform: translateY(3cqh); transition: opacity .7s ease, transform .8s cubic-bezier(.22,1,.36,1); }
.pod .who svg { width: 6cqh; height: 6cqh; fill: var(--pri); filter: drop-shadow(0 0 1.4cqh rgba(241,134,66,.8)); }
.pod .who b { font-size: 3.6cqh; font-weight: 800; line-height: 1.15; }
.pod .who span { font-size: 2.4cqh; color: rgba(255,255,255,.65); }
.pod .block { width: 100%; height: 1.2cqh; border-radius: 1.8cqh 1.8cqh 0 0; display: grid; place-items: center; align-content: center; gap: .6cqh; overflow: hidden; transition: height 1.2s cubic-bezier(.22,1,.36,1), box-shadow .8s; }
.pod .block b { font-size: 10cqh; font-weight: 800; line-height: 1; }
.pod .block span { font-size: 2.4cqh; font-weight: 700; }
.pod.r1 .block { background: var(--pri); color: var(--pri-ink); }
.pod.r2 .block { background: var(--silver); color: #141414; }
.pod.r3 .block { background: var(--bronze); color: #fff; }
.pod.shown .who { opacity: 1; transform: none; }
.pod.shown.r1 .block { height: 40cqh; box-shadow: 0 0 7cqh rgba(241,134,66,.55); }
.pod.shown.r2 .block { height: 30cqh; box-shadow: 0 0 3cqh rgba(217,217,217,.25); }
.pod.shown.r3 .block { height: 22cqh; box-shadow: 0 0 3cqh rgba(173,104,0,.3); }
.extras { display: flex; flex-wrap: wrap; gap: 1.4cqh; justify-content: center; min-height: 5.6cqh; }
.extras div { display: flex; align-items: center; gap: 1.4cqh; padding: 1cqh 2cqh; border-radius: 1.2cqh; border: .2cqh solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); font-size: 2.4cqh; opacity: 0; transition: opacity .7s ease; }
.extras div.shown { opacity: 1; }
.extras b { color: var(--pri); }
.extras span:last-child { color: rgba(255,255,255,.65); }
.confetti { position: absolute; left: 50%; top: 34%; width: 0; height: 0; }
.confetti i { position: absolute; left: 0; top: 0; border-radius: .3cqh; transition: transform 1.9s cubic-bezier(.1,.8,.25,1), opacity 1.6s ease; }
.stage-empty { display: grid; place-items: center; height: 100%; font-size: 4cqh; color: rgba(255,255,255,.6); text-align: center; }

/* --- the phone ---------------------------------------------------------------------------- */
.phone { max-width: 34rem; margin: 0 auto; padding: 16px 16px calc(112px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 16px; }
.phone-head { display: grid; gap: 8px; padding-top: 4px; }
.phone-head h1 { font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.status-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 12px; background: var(--c1); border: 1px solid var(--bd); }
.status-bar .st { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.status-bar .st i { width: 8px; height: 8px; border-radius: 50%; background: var(--t3); flex: none; }
.status-bar.open .st i { background: var(--ok); animation: blink 1s ease-in-out infinite alternate; }
.status-bar.closed .st i { background: var(--err); }
.status-bar.published .st i { background: var(--pri); }
.dots { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--t2); }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: var(--pri); }
.dots i.used { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bd2); }
.countdown { font-family: var(--mono); font-weight: 700; color: var(--pri); }

.entry-list { display: grid; gap: 10px; }
.entry {
  display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--c1); border: 1px solid var(--bd);
  color: var(--t1); text-align: left; cursor: pointer; transition: border-color .2s, background-color .2s;
}
.entry:hover:not(:disabled) { border-color: var(--bd2); }
.entry:disabled { cursor: default; }
.entry .rk { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--c2); color: var(--t2); font-weight: 800; }
.entry .nm b { display: block; font-size: 16px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.entry .nm span { font-size: 13px; color: var(--t2); }
.entry .side { text-align: right; font-weight: 600; color: var(--t2); font-size: 13px; }
.entry .side b { display: block; font-size: 20px; color: var(--t1); }
.entry .tr { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--c2); overflow: hidden; }
.entry .tr i { display: block; height: 100%; background: #8c8c8c; border-radius: 3px; transition: width .5s ease; }
.entry.lead .tr i { background: var(--pri); }
.entry.armed { border-color: var(--pri); background: var(--pri-bg); }
.entry.armed .rk { background: var(--pri); color: var(--pri-ink); }
.entry.mine { border-color: var(--ok-line); }
.entry.mine .rk { background: var(--ok); color: #06210a; }
.entry.mine .side { color: var(--ok); }
.entry.just { animation: pop .5s ease-out; }
@keyframes pop { 40% { transform: scale(1.02); } }
.confirm { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; margin-top: -4px; padding: 12px 14px; border-radius: 0 0 12px 12px; background: var(--c2); border: 1px solid var(--pri-line); border-top: 0; }
.confirm p { font-weight: 600; }
.confirm .actions { flex-wrap: nowrap; }

.gift-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.gift { display: grid; justify-items: start; gap: 2px; padding: 12px 14px; border-radius: 12px; background: var(--c1); border: 1px solid var(--bd); text-align: left; cursor: pointer; color: var(--t1); transition: border-color .2s; }
.gift:hover { border-color: var(--pri); }
.gift .gi { font-size: 26px; line-height: 1.2; }
.gift b { font-weight: 600; }
.gift .gp { color: var(--pri); font-weight: 700; font-size: 14px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 16px; font-weight: 600; }
.section-head p { font-size: 13px; color: var(--t3); }

.cheer-tray { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px)); background: rgba(20, 20, 20, .96); border-top: 1px solid var(--bd); }
.cheer-row { max-width: 34rem; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.cheer { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; background: transparent; border: 0; border-radius: 10px; color: var(--t2); font-size: 12px; font-weight: 500; cursor: pointer; transition: background-color .15s, transform .1s; }
.cheer span { font-size: 26px; line-height: 1.15; }
.cheer:hover { background: var(--c2); }
.cheer:active { transform: scale(.92); }
.page-vote .toast { bottom: calc(100px + env(safe-area-inset-bottom, 0px)); }

.sheet { width: min(26rem, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--bd); border-radius: 16px; background: var(--c1); color: var(--t1); box-shadow: 0 24px 64px -16px rgba(0, 0, 0, .8); }
.sheet::backdrop { background: rgba(0, 0, 0, .72); }
.sheet-body { padding: 20px; display: grid; gap: 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-head h2 { font-size: 18px; font-weight: 700; }
.pick-list { display: grid; gap: 6px; max-height: 46dvh; overflow: auto; }
.pick { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 8px; background: var(--bg); border: 1px solid var(--bd); cursor: pointer; }
.pick:has(input:checked) { border-color: var(--pri); background: var(--pri-bg); }
.pick input { margin: 0; width: 16px; height: 16px; }
.pay-qr { justify-self: center; width: min(15rem, 70vw); aspect-ratio: 1; background: #fff; border-radius: 12px; padding: 10px; }
.pay-ref { text-align: center; }
.pay-ref strong { display: block; font-family: var(--mono); font-size: 20px; letter-spacing: .06em; color: var(--pri); }
.bank-apps { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.jrow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--c1); border: 1px solid var(--bd); }
.jrow .rk { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--c2); color: var(--t2); font-weight: 800; }
.jrow .nm b { display: block; font-weight: 700; line-height: 1.3; }
.jrow .nm span { font-size: 13px; color: var(--t2); }
.jrow .saved { display: block; font-size: 12px; margin-top: 2px; }
.stepper { display: grid; grid-template-columns: 40px 64px 40px; gap: 6px; align-items: center; }
.stepper .btn { width: 40px; height: 40px; padding: 0; }
.stepper .fld { height: 40px; padding: 0 6px; text-align: center; font-size: 18px; font-weight: 700; }
@media (max-width: 420px) {
  .jrow { grid-template-columns: 40px minmax(0, 1fr); }
  .jrow .stepper { grid-column: 1 / -1; justify-content: end; }
}

/* --- effects layer ---------------------------------------------------------------------- */
#fx-layer { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
#fx-layer .fx { position: absolute; will-change: transform, opacity; }
#fx-layer .fx-emoji { font-size: 44px; }
#fx-layer img.fx-cat { width: 92px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  #fx-layer { display: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}

/* --- projector: idle, waiting, podium (anime.js drives the motion) ------------------ */
.v-idle, .v-wait { height: 100%; display: grid; place-items: center; align-content: center; gap: 2.4cqh; text-align: center; }
.idle-mark { width: 14cqh; height: 14cqh; border-radius: 3.2cqh; background: var(--pri); box-shadow: 0 0 8cqh rgba(241,134,66,.45); }
.idle-title { font-size: 7cqh; font-weight: 800; letter-spacing: -.02em; max-width: 120cqh; line-height: 1.1; }
.idle-sub, .wait-sub { font-size: 2.8cqh; color: rgba(255,255,255,.65); }
.wait-dots { display: flex; gap: 2cqh; height: 6cqh; align-items: flex-end; }
.wait-dots i { width: 2.4cqh; height: 2.4cqh; border-radius: 50%; background: var(--pri); }
.wait-title { font-size: 7cqh; font-weight: 800; letter-spacing: -.02em; }
.wait-total { font-size: 3cqh; color: rgba(255,255,255,.65); }
.wait-total b { color: var(--t1); font-size: 5cqh; font-weight: 800; }

.v-pod { position: relative; height: 100%; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 2cqh; }
.pod-title { min-height: 9cqh; display: grid; justify-items: center; align-content: end; gap: .6cqh; text-align: center; }
.pod-title .pt-name { font-size: 6cqh; font-weight: 800; color: var(--pri); letter-spacing: -.01em; text-shadow: 0 0 5cqh rgba(241,134,66,.35); }
.pod-title .pt-sub { font-size: 2.6cqh; color: rgba(255,255,255,.7); font-weight: 600; }
.pod-stage { display: flex; align-items: flex-end; justify-content: center; gap: 2.4cqh; border-bottom: .3cqh solid rgba(255,255,255,.18); min-height: 0; }
.pcol { width: 30cqh; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; }
.pcol.r1 { width: 34cqh; }
.pcard { display: grid; justify-items: center; gap: .5cqh; padding-bottom: 1.6cqh; text-align: center; opacity: 0; }
.pcol.shown .pcard { opacity: 1; }
.pcard svg { width: 6cqh; height: 6cqh; fill: var(--pri); }
.pcard b { font-size: 3.6cqh; font-weight: 800; line-height: 1.15; }
.pcard span { font-size: 2.3cqh; color: rgba(255,255,255,.65); }
.pblock { width: 100%; height: 0; border-radius: 1.6cqh 1.6cqh 0 0; display: grid; place-items: center; align-content: center; gap: .4cqh; overflow: hidden; }
.pblock b { font-size: 10cqh; font-weight: 800; line-height: 1; }
.pblock span { font-size: 2.4cqh; font-weight: 700; }
.pcol.r1 .pblock { background: linear-gradient(180deg, #fff3c4, var(--moon) 55%, #e7c25c); color: var(--ink); }
.pcol.r2 .pblock { background: linear-gradient(180deg, #fffaf1, var(--silver) 60%, #cfc5b3); color: var(--ink); }
.pcol.r3 .pblock { background: linear-gradient(180deg, #f07a45, var(--ember) 60%, #b33d1a); color: #fff7ec; }
.pcol.shown .pblock b, .pcol.shown .pblock span { opacity: 1; }
.pod-extras { display: flex; flex-wrap: wrap; gap: 1.4cqh; justify-content: center; min-height: 6cqh; }
.pchip { display: flex; align-items: center; gap: 1.4cqh; padding: 1cqh 2.2cqh; border-radius: 1.4cqh; border: .2cqh solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); font-size: 2.4cqh; opacity: 0; }
.pchip.shown { opacity: 1; }
.pchip b { color: var(--pri); font-size: 3cqh; }
.pchip span { font-weight: 700; }
.pchip small { color: rgba(255,255,255,.65); font-size: 2cqh; }
.pod-confetti { position: absolute; left: 50%; top: 40%; width: 0; height: 0; pointer-events: none; }
.pod-confetti i { position: absolute; left: 0; top: 0; border-radius: .3cqh; opacity: 0; }
/* A flex column shrinks its children by default; the podium blocks must keep their height. */
.pcol > .pcard, .pcol > .pblock { flex: none; }

/* =====================================================================================
   YIC Halloween Day. The projector and the phones live in the key visual's world:
   pumpkin sky, the full moon low in the middle, night-ink silhouettes at the sides,
   bone-white condensed lettering. Crops of the artwork sit on a sky painted in the
   same orange, their edges faded into it, so the scene can be laid out per view.
   ===================================================================================== */
.spooky { font-family: var(--display); font-weight: 400; letter-spacing: .01em; text-transform: uppercase; }

/* --- the projector scene --------------------------------------------------------------- */
.stage { background: var(--sky); color: #fff8ec; }
.stage .scene { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.stage .scene .sky {
  position: absolute; inset: 0;
  background:
    radial-gradient(60cqh 36cqh at 50% 104%, rgba(255, 246, 205, .9), rgba(246, 227, 161, .55) 45%, transparent 75%),
    radial-gradient(120cqh 60cqh at 50% 20%, rgba(255, 190, 120, .35), transparent 70%),
    linear-gradient(180deg, #f39552 0%, var(--sky) 45%, var(--sky-deep) 100%);
}
.stage .scene img { position: absolute; bottom: 0; height: auto; display: block; transition: opacity .8s ease, transform 1.2s cubic-bezier(.22, 1, .36, 1); }
.stage .scene .ghost {
  left: 0; width: 44cqh;
  -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent), linear-gradient(0deg, #000 70%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, #000 70%, transparent), linear-gradient(0deg, #000 70%, transparent); mask-composite: intersect;
}
.stage .scene .pump {
  right: 0; width: 50cqh;
  -webkit-mask-image: linear-gradient(270deg, #000 72%, transparent), linear-gradient(0deg, #000 70%, transparent); -webkit-mask-composite: source-in;
  mask-image: linear-gradient(270deg, #000 72%, transparent), linear-gradient(0deg, #000 70%, transparent); mask-composite: intersect;
}
.stage .scene .poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .8s ease; }
/* per view: the art steps back while there is something to read */
.stage[data-view="idle"] .scene .poster { opacity: 1; }
.stage[data-view="idle"] .scene .ghost, .stage[data-view="idle"] .scene .pump { opacity: 0; }
.stage[data-view="race"] .scene .ghost, .stage[data-view="race"] .scene .pump { opacity: .3; transform: translateY(10cqh); }
.stage[data-view="podium"] .scene .ghost, .stage[data-view="podium"] .scene .pump { opacity: .85; transform: translateY(16cqh) scale(.9); }

.stage-in { z-index: 1; }
.stage[data-view="idle"] .stage-head { visibility: hidden; }
.stage-head h1 { font-family: var(--display); font-weight: 400; font-size: 6.4cqh; letter-spacing: .01em; text-transform: uppercase; color: #fff8ec; text-shadow: 0 .5cqh 1.6cqh rgba(60, 22, 4, .45); }
.stage-kicker { display: inline-block; padding: .5cqh 1.6cqh; background: var(--ink); color: #fff8ec; font-family: var(--display); font-weight: 400; font-size: 2.2cqh; letter-spacing: .12em; margin-bottom: 1.4cqh; }
.phases li { border-color: rgba(35, 38, 52, .35); color: rgba(35, 38, 52, .78); background: rgba(255, 248, 236, .18); }
.phases li span { background: rgba(35, 38, 52, .2); }
.phases li.now { border-color: var(--ink); background: var(--ink); color: #fff8ec; }
.phases li.now span { background: var(--sky); color: var(--pri-ink); }
.phases li.done { color: var(--ink); }
.phases li.done span { background: var(--ink); color: #fff8ec; }

/* idle: the poster itself, with the session's name on a night-ink tag */
.v-idle { align-content: end; padding-bottom: 2cqh; }
.v-idle .idle-mark { display: none; }
.v-idle .idle-title { font-family: var(--display); font-weight: 400; font-size: 4.6cqh; text-transform: uppercase; letter-spacing: .02em; background: var(--ink); color: #fff8ec; padding: .8cqh 3cqh; }
.v-idle .idle-sub { color: #fff8ec; text-shadow: 0 .3cqh 1cqh rgba(0, 0, 0, .7); font-weight: 600; }

/* QR: the code on a bone card */
.v-qr .big { font-family: var(--display); font-weight: 400; font-size: 8.4cqh; text-transform: uppercase; letter-spacing: .01em; line-height: 1.02; color: #fff8ec; text-shadow: 0 .5cqh 1.6cqh rgba(60, 22, 4, .45); }
.v-qr .lead { color: var(--ink); font-weight: 600; font-size: 2.6cqh; }
.v-qr .clock { font-family: var(--display); font-weight: 400; font-size: 18cqh; color: var(--ink); text-shadow: none; }
.v-qr .clock-row span { color: var(--ink); font-weight: 600; }
.v-qr .bar { background: rgba(35, 38, 52, .2); }
.v-qr .bar i { background: var(--ink); box-shadow: none; }
.v-qr .joined { color: var(--ink); }
.v-qr .joined span { color: rgba(35, 38, 52, .85); }
.v-qr .joined i { background: var(--ink); }
.v-qr .joined b { font-family: var(--display); font-weight: 400; font-size: 5cqh; }
.qr-frame { background: #fff8ec; border: 0; padding: 2.4cqh; border-radius: 2.4cqh; box-shadow: 0 2.4cqh 6cqh -1.6cqh rgba(60, 22, 4, .55), 0 0 0 1.2cqh rgba(255, 248, 236, .25); }
.qr-frame .qr { border-radius: 1.2cqh; padding: 1cqh; }
.v-qr .scode { font-family: var(--display); font-weight: 400; letter-spacing: .14em; font-size: 5.4cqh; background: var(--ink); color: #fff8ec; padding: .4cqh 2.4cqh; }
.v-qr .url { color: var(--ink); font-weight: 600; }
.v-qr .rot .bar i { background: var(--ink); }
.v-qr .rot small { color: rgba(35, 38, 52, .85); }

/* race: night-ink rows over the sky */
.v-race .pill { background: var(--ink); border-color: transparent; }
.v-race .pill span { color: rgba(255, 248, 236, .72); }
.v-race .pill b { font-family: var(--display); font-weight: 400; color: #fff8ec; }
.v-race .pill b.mono { font-family: var(--display); color: var(--sky); }
.v-race .vbar { background: rgba(35, 38, 52, .25); }
.v-race .vbar i { background: var(--ink); box-shadow: none; }
.v-race .live { color: var(--ink); }
.v-race .live.closed { color: #7a1a06; }
.rrow { background: rgba(26, 28, 39, .88); border-color: rgba(255, 248, 236, .08); color: #fff8ec; }
.rrow .rk, .rrow .vt { font-family: var(--display); font-weight: 400; }
.rrow .tr { background: rgba(255, 248, 236, .1); }
.rrow .tr i { background: rgba(255, 248, 236, .45); }
.rrow.lead { background: rgba(26, 28, 39, .95); border-color: var(--moon); box-shadow: 0 1.6cqh 4cqh -1cqh rgba(60, 22, 4, .6); }
.rrow.lead .rk { background: var(--moon); color: var(--ink); }
.rrow.lead .tr i { background: linear-gradient(90deg, var(--sky), var(--moon)); box-shadow: none; }
.rrow.lead .vt { color: var(--moon); }
.rrow.bump { background: rgba(70, 44, 30, .96); }
.go div { font-family: var(--display); font-weight: 400; text-transform: uppercase; color: #fff8ec; text-shadow: 0 1cqh 4cqh rgba(60, 22, 4, .6); }

/* waiting and podium */
.v-wait .wait-title { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 8cqh; color: #fff8ec; text-shadow: 0 .5cqh 1.6cqh rgba(60, 22, 4, .45); }
.v-wait .wait-sub, .v-wait .wait-total { color: var(--ink); font-weight: 600; }
.v-wait .wait-total b { color: var(--ink); font-family: var(--display); font-weight: 400; }
.wait-dots i { background: var(--ink); }
.pod-title .pt-name { font-family: var(--display); font-weight: 400; text-transform: uppercase; font-size: 7cqh; color: #fff8ec; text-shadow: 0 .5cqh 2cqh rgba(60, 22, 4, .5); }
.pod-title .pt-sub { color: var(--ink); font-weight: 700; }
.pod-stage { border-bottom-color: rgba(35, 38, 52, .5); }
.pcard { color: #fff8ec; }
.pcard b { font-size: 3.8cqh; background: var(--ink); padding: .4cqh 1.6cqh; }
.pcard span { color: var(--ink); font-weight: 700; }
.pcard svg { fill: var(--moon); filter: drop-shadow(0 .6cqh 1.2cqh rgba(60, 22, 4, .5)); }
.pblock b { font-family: var(--display); font-weight: 400; font-size: 11cqh; }
.pblock span { font-family: var(--display); font-weight: 400; letter-spacing: .04em; text-transform: uppercase; }
.pchip { background: var(--ink); border-color: transparent; color: #fff8ec; }
.pchip b { color: var(--moon); }
.pod-confetti svg { position: absolute; left: 0; top: 0; width: 7cqh; height: 3.5cqh; fill: var(--ink); opacity: 0; }
.pod-confetti i { position: absolute; left: 0; top: 0; width: 1cqh; height: 1cqh; border-radius: 50%; background: var(--moon); box-shadow: 0 0 1.6cqh rgba(255, 220, 140, .9); opacity: 0; }
.stage-empty { color: var(--ink); font-weight: 600; }

/* --- the phone ------------------------------------------------------------------------- */
.hero {
  position: relative; margin: -16px -16px 0; aspect-ratio: 16 / 9; overflow: hidden;
  background: var(--sky) url("/static/img/halloween/banner-960.jpg") center / cover no-repeat;
}
.hero::after { content: ""; position: absolute; inset: 50% 0 0 0; background: linear-gradient(180deg, transparent, var(--bg)); }
.phone-head { margin-top: -40px; position: relative; z-index: 1; gap: 10px; }
.phone-head h1 { font-family: var(--display); font-weight: 400; font-size: 30px; line-height: 1.12; letter-spacing: .01em; text-transform: uppercase; color: var(--t1); text-wrap: balance; }
.phone-head .logo b { font-size: 14px; }
.status-bar.open { border-color: var(--ok-line); }
.status-bar.published { border-color: var(--pri-line); }
.status-bar .when { display: block; font-size: 13px; font-weight: 500; color: var(--t2); margin-top: 2px; }
.entry { border-radius: 14px; padding: 12px; grid-template-columns: 48px minmax(0, 1fr) auto; }
.entry .rk { width: 48px; height: 48px; border-radius: 12px; font-family: var(--display); font-weight: 400; font-size: 20px; background: var(--c2); color: var(--t1); overflow: hidden; }
.entry .rk img { width: 100%; height: 100%; object-fit: cover; }
.entry .nm b { font-size: 17px; }
.entry.armed { border-color: var(--pri); background: linear-gradient(180deg, rgba(241, 134, 66, .16), rgba(241, 134, 66, .06)); }
.entry.mine { border-color: var(--ok-line); background: var(--ok-bg); }
.entry.lead .tr i { background: linear-gradient(90deg, var(--sky), var(--moon)); }
.confirm { border-radius: 0 0 14px 14px; }
.confirm .btn.p { min-width: 96px; height: 44px; font-weight: 700; }

/* results on the phone once every prize is out */
.winners { display: grid; gap: 10px; }
.winners h2 { font-family: var(--display); font-weight: 400; font-size: 22px; text-transform: uppercase; letter-spacing: .02em; }
.win { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: 14px; background: var(--c1); border: 1px solid var(--bd); }
.win .wm { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; font-family: var(--display); font-size: 26px; }
.win.r1 { border-color: rgba(246, 227, 161, .6); background: linear-gradient(135deg, rgba(246, 227, 161, .16), var(--c1) 60%); }
.win.r1 .wm { background: var(--moon); color: var(--ink); }
.win.r2 .wm { background: var(--silver); color: var(--ink); }
.win.r3 .wm { background: var(--ember); color: #fff7ec; }
.win .wn b { display: block; font-size: 17px; font-weight: 700; line-height: 1.3; }
.win .wn span { font-size: 13px; color: var(--t2); }
.win .wv { text-align: right; font-size: 13px; color: var(--t2); }
.win .wv b { display: block; font-family: var(--display); font-weight: 400; font-size: 24px; color: var(--t1); }
.cheer-tray { background: rgba(16, 18, 26, .96); }

/* code entry */
.gate { background: var(--bg) url("/static/img/halloween/banner-1920.jpg") center top / 100% auto no-repeat; position: relative; }
.gate::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(16, 18, 26, .15), rgba(16, 18, 26, .7) 40%, var(--bg) 70%); }
.gate-in { position: relative; }
.ticket-card { background: rgba(25, 28, 39, .97); box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8); }
.ticket-card .top h1 { font-family: var(--display); font-weight: 400; font-size: 32px; text-transform: uppercase; letter-spacing: .01em; }
.ticket-card .perf::before, .ticket-card .perf::after { background: var(--bg); }
.code-in { font-family: var(--display); font-weight: 400; letter-spacing: .3em; }
.gate-foot { color: var(--t2); }

/* QR view: the artwork sinks below the reading line, and the small print sits on ink. */
.stage[data-view="qr"] .scene .ghost { opacity: .95; transform: translateY(24cqh) scale(.85); transform-origin: bottom left; }
.stage[data-view="qr"] .scene .pump { opacity: .95; transform: translateY(30cqh) scale(.85); transform-origin: bottom right; }
.v-qr .url { background: var(--ink); color: rgba(255, 248, 236, .85); padding: .6cqh 1.6cqh; font-weight: 500; }
.v-qr .rot { background: var(--ink); padding: 1cqh 1.6cqh; border-radius: 1cqh; }
.v-qr .rot .bar { background: rgba(255, 248, 236, .15); }
.v-qr .rot .bar i { background: var(--sky); }
.v-qr .rot small { color: rgba(255, 248, 236, .75); }
.v-qr .scode { font-family: var(--font); font-weight: 700; font-size: 3.2cqh; letter-spacing: 0; text-transform: none; padding: .8cqh 2.4cqh; }
/* idle: the line under the session name joins it on the tag */
.v-idle { gap: 0; }
.v-idle .idle-sub { background: var(--ink); padding: 0 3cqh 1cqh; text-shadow: none; color: rgba(255, 248, 236, .75); font-size: 2.2cqh; }
/* podium: names stay on one line, columns wide enough for them */
.pcol { width: 40cqh; }
.pcol.r1 { width: 46cqh; }
.pcard b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: 3.4cqh; }
.pod-title { min-height: 12cqh; }

.win-group { display: grid; gap: 8px; }
.win-group h3 { font-size: 14px; font-weight: 700; color: var(--pri); text-transform: uppercase; letter-spacing: .04em; }
.win-group h3 span { color: var(--t2); font-weight: 500; text-transform: none; letter-spacing: 0; }
.win.r4 .wm { background: #6b3a8e; color: #fff8ec; }

/* --- prizes as a board: several winners per prize, or more than three prizes ----- */
.pod-stage.board { flex-wrap: wrap; align-items: center; align-content: center; gap: 2.4cqh; border-bottom: 0; padding: 0 4cqh; }
.wcard { width: 40cqh; min-height: 14cqh; padding: 2.4cqh 2.8cqh; border-radius: 2cqh; display: grid; align-content: center; justify-items: center; gap: .8cqh; text-align: center;
  background: rgba(255, 248, 236, .08); border: .25cqh solid rgba(255, 248, 236, .18); box-shadow: 0 2cqh 5cqh -2cqh rgba(0, 0, 0, .6); opacity: 0; }
.wcard.shown { opacity: 1; }
.wcard b { font-size: 3.8cqh; font-weight: 800; line-height: 1.15; color: #fff8ec; overflow-wrap: anywhere; }
.wcard span { font-size: 2.2cqh; color: rgba(255, 248, 236, .75); }
.wcard.t1 { background: linear-gradient(180deg, #f8a466, var(--sky) 60%, #d65f25); border-color: transparent; }
.wcard.t1 b { color: var(--pri-ink); }
.wcard.t1 span { color: rgba(29, 14, 4, .75); }
.wcard.t2 { background: linear-gradient(180deg, #fffaf1, var(--silver)); border-color: transparent; }
.wcard.t2 b { color: var(--ink); }
.wcard.t2 span { color: rgba(35, 38, 52, .7); }
.wcard.t3 { background: linear-gradient(180deg, #8a4fb0, #6b3a8e); border-color: transparent; }
.board.many .wcard { width: 30cqh; min-height: 10cqh; padding: 1.6cqh 2cqh; }
.board.many .wcard b { font-size: 2.8cqh; }
.board.many .wcard span { font-size: 1.8cqh; }

/* --- the closing summary: every prize and everyone who won it ---------------------- */
.pod-stage.finale { display: grid; grid-template-columns: repeat(auto-fit, minmax(34cqh, 1fr)); gap: 2.4cqh; align-items: start; align-content: center; border-bottom: 0; padding: 0 2cqh; }
.fcol { border-radius: 2cqh; overflow: hidden; background: rgba(16, 18, 30, .92); border: .25cqh solid rgba(255, 248, 236, .14); box-shadow: 0 2cqh 5cqh -2cqh rgba(0, 0, 0, .6); }
.fcol .fh { padding: 1.6cqh 2.4cqh; display: grid; gap: .3cqh; background: rgba(255, 248, 236, .1); }
.fcol .fh b { font-family: var(--display); font-weight: 400; font-size: 4cqh; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; }
.fcol .fh span { font-size: 2cqh; font-weight: 600; opacity: .8; }
.fcol.t1 .fh { background: linear-gradient(180deg, #f8a466, var(--sky)); color: var(--pri-ink); }
.fcol.t2 .fh { background: linear-gradient(180deg, #fffaf1, var(--silver)); color: var(--ink); }
.fcol.t3 .fh { background: linear-gradient(180deg, #8a4fb0, #6b3a8e); color: #fff8ec; }
.fcol ol { list-style: none; margin: 0; padding: 1.6cqh 2.4cqh 2cqh; display: grid; gap: 1.1cqh; }
.fcol li { display: flex; justify-content: space-between; align-items: baseline; gap: 1.6cqh; font-size: 2.8cqh; font-weight: 700; color: #fff8ec; line-height: 1.2; }
.fcol li small { font-size: 1.9cqh; font-weight: 500; color: rgba(255, 248, 236, .65); white-space: nowrap; }
.finale.compact { grid-template-columns: repeat(auto-fit, minmax(28cqh, 1fr)); gap: 1.6cqh; }
.finale.compact .fcol .fh b { font-size: 3cqh; }
.finale.compact .fcol li { font-size: 2.1cqh; }
.finale.compact .fcol ol { gap: .7cqh; padding: 1.2cqh 2cqh 1.6cqh; }

/* --- prizes: night falls. A clean night sky, the full moon rising behind the podium,
   no cropped artwork; the podium and the names carry the moment. ------------------- */
.stage .scene .night { position: absolute; inset: 0; opacity: 0; transition: opacity 1.2s ease;
  background:
    radial-gradient(circle at 50% 108%, #fff6d2 0, #f6e3a1 34cqh, rgba(246, 227, 161, .55) 35cqh, rgba(246, 227, 161, .18) 52cqh, transparent 78cqh),
    radial-gradient(1.5px 1.5px at 12% 18%, rgba(255, 248, 236, .8), transparent),
    radial-gradient(1.5px 1.5px at 27% 9%, rgba(255, 248, 236, .6), transparent),
    radial-gradient(2px 2px at 71% 14%, rgba(255, 248, 236, .7), transparent),
    radial-gradient(1.5px 1.5px at 86% 27%, rgba(255, 248, 236, .6), transparent),
    radial-gradient(1.5px 1.5px at 58% 6%, rgba(255, 248, 236, .5), transparent),
    radial-gradient(2px 2px at 40% 22%, rgba(255, 248, 236, .45), transparent),
    linear-gradient(180deg, #121423 0%, #1b1d31 55%, #2b2032 100%);
}
.stage[data-view="podium"] .scene .night { opacity: 1; }
.stage[data-view="podium"] .scene .ghost, .stage[data-view="podium"] .scene .pump { opacity: 0; transform: translateY(20cqh); }
.stage[data-view="podium"] .stage-kicker { background: var(--sky); color: var(--pri-ink); }
.stage[data-view="podium"] .phases li { border-color: rgba(255, 248, 236, .22); color: rgba(255, 248, 236, .7); background: transparent; }
.stage[data-view="podium"] .phases li span { background: rgba(255, 248, 236, .14); }
.stage[data-view="podium"] .phases li.now { background: var(--sky); border-color: var(--sky); color: var(--pri-ink); }
.stage[data-view="podium"] .phases li.now span { background: var(--ink); color: #fff8ec; }
.stage[data-view="podium"] .phases li.done span { background: rgba(255, 248, 236, .85); color: var(--ink); }
.v-pod .pod-title .pt-name { color: var(--moon); text-shadow: 0 .6cqh 3cqh rgba(0, 0, 0, .55); }
.v-pod .pod-title .pt-sub { color: rgba(255, 248, 236, .85); }
.v-pod .pod-stage { border-bottom-color: rgba(255, 248, 236, .25); }
.v-pod .pcard b { background: none; padding: 0; font-size: 3.8cqh; color: #fff8ec; text-shadow: 0 .4cqh 1.6cqh rgba(0, 0, 0, .6); }
.v-pod .pcard span { color: rgba(255, 248, 236, .8); font-weight: 600; }
.v-pod .pcol.r1 .pblock { background: linear-gradient(180deg, #f8a466, var(--sky) 55%, #d65f25); color: var(--pri-ink); }
.v-pod .pcol.r2 .pblock { background: linear-gradient(180deg, #fffaf1, var(--silver) 60%, #cfc5b3); color: var(--ink); }
.v-pod .pcol.r3 .pblock { background: linear-gradient(180deg, #8a4fb0, #6b3a8e 60%, #4d2868); color: #fff8ec; }
.v-pod .pchip { background: rgba(255, 248, 236, .08); }
.pod-confetti svg { fill: #0c0d16; }
.wcard svg { width: 5cqh; height: 5cqh; fill: var(--pri-ink); }
.v-pod .pchip { background: rgba(16, 18, 30, .94); border-color: rgba(255, 248, 236, .14); }
