/* DTI Awards 2026 — western posada theme. Shared by voting (phone), screen (projector) and host pages. */

:root {
  --night: #170a12;
  --dusk: #3a1428;
  --ember: #8a2b22;
  --sunset: #d9622b;
  --glow: #f2a93b;

  --wood-900: #24130b;
  --wood-700: #4a2a16;
  --wood-500: #6b3f22;
  --wood-300: #9a6236;

  --paper: #f3e3c3;
  --paper-2: #e3c795;
  --ink: #3a1d12;
  --ink-soft: #6a4128;

  --wine: #8e1b1b;
  --wine-2: #b3261e;
  --gold: #e9b44c;
  --gold-2: #b9832b;
  --pine: #2f5d3a;

  --text: #fbeedd;
  --text-muted: #dcc3a3;
  --danger: #ff8a70;

  --font-display: 'Rye', Georgia, serif;
  --font-body: 'Bitter', Georgia, serif;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;
  --shadow-1: 0 2px 0 rgb(0 0 0 / .25), 0 6px 14px rgb(0 0 0 / .35);
  --shadow-2: 0 4px 0 rgb(0 0 0 / .3), 0 18px 40px rgb(0 0 0 / .45);
  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .42 0 0 0 0 .25 0 0 0 0 .1 0 0 0 .55 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--night);
  line-height: 1.45;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }

/* ---------- Scene: dusk sky, mesas, cacti with lights ---------- */
.sky {
  background:
    radial-gradient(60% 45% at 50% 100%, rgb(242 169 59 / .55), transparent 70%),
    linear-gradient(180deg, #140812 0%, var(--dusk) 38%, var(--ember) 72%, var(--sunset) 100%);
}
.stars { overflow: hidden; }
.stars .star {
  position: absolute; width: 2px; height: 2px; border-radius: 50%;
  background: #fff6dc; box-shadow: 0 0 4px #fff6dc;
  animation: star var(--d, 3s) ease-in-out var(--t, 0s) infinite alternate;
}
.stars .star.big { width: 3px; height: 3px; box-shadow: 0 0 7px 1px #ffe7a8; }
@keyframes star { from { opacity: .2; transform: translate(0, 0) scale(.7); } to { opacity: 1; transform: translate(3px, -2px) scale(1.2); } }
.constellation { position: absolute; top: 9%; left: 64%; width: clamp(110px, 15vw, 260px); opacity: .75; overflow: visible; animation: drift 70s ease-in-out infinite alternate; }
.constellation circle { filter: drop-shadow(0 0 2px #ffe7a8); animation: twinkle 2.2s ease-in-out infinite alternate; }
.constellation circle:nth-of-type(2n) { animation-delay: -1.1s; }
.constellation circle:nth-of-type(3n) { animation-delay: -.6s; }
@keyframes drift { from { transform: translate(0, 0) rotate(-5deg); } to { transform: translate(-9vw, 3vh) rotate(5deg); } }
.shooting {
  position: absolute; top: 8%; left: 12%; width: 110px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, #fff6dc);
  opacity: 0; transform: rotate(18deg);
  animation: shoot 11s ease-in 4s infinite;
}
@keyframes shoot { 0%, 90% { opacity: 0; transform: translate(0, 0) rotate(18deg); } 92% { opacity: 1; } 100% { opacity: 0; transform: translate(36vw, 11.7vw) rotate(18deg); } }
.mesas { position: relative; width: 100%; aspect-ratio: 1200 / 220; overflow: hidden; }
/* Parallax: layers are 2 tiles wide and pan -50% forever; paused everywhere except the lobby screen */
.mesas .layer { position: absolute; left: 0; bottom: 0; width: 200%; max-width: none; height: 100%; animation: pan var(--pan) linear infinite paused; }
.mesas .far { --pan: 150s; opacity: .85; }
.mesas .mid { --pan: 75s; }
.mesas .near { --pan: 34s; }
@keyframes pan { to { transform: translateX(-50%); } }
.mesas .blades { transform-box: fill-box; transform-origin: center; animation: spin 5s linear infinite paused; }
.mesas .tumbleweed { position: absolute; bottom: 3%; left: 100%; width: 3.2%; aspect-ratio: 1; display: none; }
.mesas .tumbleweed svg { display: block; width: 100%; height: 100%; animation: spin 1s linear infinite reverse; }
.screen.is-lobby .mesas .layer, .screen.is-lobby .mesas .blades { animation-play-state: running; }
.screen.is-lobby .mesas .tumbleweed { display: block; animation: tumble-x 12s linear 3s infinite, tumble-y .5s ease-in-out infinite alternate; }
@keyframes tumble-x { from { left: 100%; } 70%, to { left: -5%; } }
@keyframes tumble-y { to { translate: 0 -45%; } }
.mesas .bulb { animation: twinkle 1.6s ease-in-out infinite alternate; }
.mesas .bulb:nth-child(2n) { animation-delay: -.8s; }
.mesas .bulb:nth-child(3n) { animation-delay: -.4s; }
@keyframes twinkle { from { opacity: .35; } to { opacity: 1; } }

/* String of lights along the top edge */
.lights {
  position: absolute;
  inset: 0 0 auto 0;
  height: 22px;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 12px, #ffd27a 0 4px, rgb(255 210 122 / .35) 5px, transparent 9px) 0 0 / 44px 22px repeat-x,
    linear-gradient(#2b1a10, #2b1a10) 0 7px / 100% 2px no-repeat;
  z-index: 3;
}
.lights::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 12px, #ff6b4a 0 4px, rgb(255 107 74 / .35) 5px, transparent 9px) 22px 0 / 44px 22px repeat-x;
  animation: twinkle 1.2s ease-in-out infinite alternate;
}

/* ---------- Components ---------- */
.parchment {
  position: relative;
  color: var(--ink);
  background:
    var(--noise),
    radial-gradient(120% 90% at 50% 40%, #f8ecd4 0%, var(--paper) 55%, var(--paper-2) 100%);
  border-radius: var(--r-md);
  box-shadow:
    inset 0 0 0 2px rgb(122 72 40 / .25),
    inset 0 0 48px rgb(140 85 40 / .4),
    var(--shadow-2);
}
/* Nails in the corners */
.nailed::after {
  content: '';
  position: absolute;
  inset: 10px;
  pointer-events: none;
  background:
    radial-gradient(circle at 0 0, #e9c27a 0 2px, #5a3a14 2.5px 4px, transparent 4.5px) top left / 10px 10px no-repeat,
    radial-gradient(circle at 100% 0, #e9c27a 0 2px, #5a3a14 2.5px 4px, transparent 4.5px) top right / 10px 10px no-repeat,
    radial-gradient(circle at 0 100%, #e9c27a 0 2px, #5a3a14 2.5px 4px, transparent 4.5px) bottom left / 10px 10px no-repeat,
    radial-gradient(circle at 100% 100%, #e9c27a 0 2px, #5a3a14 2.5px 4px, transparent 4.5px) bottom right / 10px 10px no-repeat;
}

.display {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: .01em;
  margin: 0;
}
.title-wine { color: var(--wine); text-shadow: 0 2px 0 rgb(255 255 255 / .35); }

.ribbon {
  display: inline-block;
  margin: 0;
  padding: .5em 2.4em;
  color: #fff3dc;
  font-weight: 800;
  font-size: .9em;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(180deg, var(--wine-2), var(--wine));
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.1em) 50%, 100% 100%, 0 100%, 1.1em 50%);
}

/* Riveted wooden / red signboard button (rectangular, never a pill) */
.btn {
  --rivet: radial-gradient(circle, #f1d08a 0 2.5px, #6b4310 3px 3.6px, transparent 4.2px);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 52px;
  padding: .7em 2.2em;
  border: 2px solid #4a0e0e;
  border-radius: var(--r-sm);
  color: #fff3dc;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 4.2vw, 1.35rem);
  letter-spacing: .04em;
  text-shadow: 0 2px 0 rgb(0 0 0 / .35);
  text-decoration: none;
  cursor: pointer;
  background:
    var(--rivet) 10px 50% / 10px 10px no-repeat,
    var(--rivet) calc(100% - 10px) 50% / 10px 10px no-repeat,
    linear-gradient(180deg, #c9392d, var(--wine) 60%, #6e1414);
  box-shadow: inset 0 0 0 3px rgb(233 180 76 / .55), 0 4px 0 #3d0b0b, 0 10px 18px rgb(0 0 0 / .4);
  transition: transform .12s var(--ease-out), box-shadow .12s var(--ease-out), filter .2s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(3px); box-shadow: inset 0 0 0 3px rgb(233 180 76 / .55), 0 1px 0 #3d0b0b, 0 4px 8px rgb(0 0 0 / .4); }
.btn:disabled, .btn[aria-disabled='true'] { filter: grayscale(.7) brightness(.85); opacity: .65; cursor: not-allowed; transform: none; }
.btn.wood {
  border-color: var(--wood-900);
  background:
    var(--rivet) 10px 50% / 10px 10px no-repeat,
    var(--rivet) calc(100% - 10px) 50% / 10px 10px no-repeat,
    repeating-linear-gradient(178deg, rgb(0 0 0 / .07) 0 2px, transparent 2px 7px),
    linear-gradient(180deg, var(--wood-300), var(--wood-500) 60%, var(--wood-700));
  box-shadow: inset 0 0 0 2px rgb(255 220 160 / .25), 0 4px 0 var(--wood-900), 0 10px 18px rgb(0 0 0 / .4);
}
.btn.small { min-height: 44px; padding: .45em 1.6em; font-size: 1rem; }
.btn.block { width: 100%; }

.spinner {
  width: 1em; height: 1em; border-radius: 50%;
  border: 3px solid rgb(255 243 220 / .35); border-top-color: #fff3dc;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Avatar with cowboy hat */
.avatar { --size: 72px; position: relative; display: inline-block; width: var(--size); height: var(--size); flex: none; }
.avatar .face {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  overflow: hidden;
  border-radius: 50%;
  border: max(2px, calc(var(--size) * .05)) solid var(--gold);
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--tone) 55%, #fff), var(--tone) 70%);
  box-shadow: 0 3px 0 rgb(0 0 0 / .3);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar .initials { font-family: var(--font-display); color: #fff3dc; font-size: calc(var(--size) * .34); text-shadow: 0 2px 0 rgb(0 0 0 / .3); padding-top: 18%; }
.avatar .hat { position: absolute; z-index: 2; width: 120%; max-width: none; left: -10%; top: -40%; transform: rotate(-7deg); filter: drop-shadow(0 3px 2px rgb(0 0 0 / .35)); }

.brand { display: flex; align-items: center; gap: .6rem; }
.brand .emblem { width: 2.2rem; height: auto; flex: none; }
.brand-name { font-family: var(--font-display); color: var(--text); text-shadow: 0 2px 0 rgb(0 0 0 / .5), 0 0 18px rgb(242 169 59 / .35); line-height: 1; }
.brand-name small { display: block; font-family: var(--font-body); font-weight: 700; font-size: .55em; letter-spacing: .18em; color: var(--gold); margin-top: .2em; }

.alert {
  margin: 1rem 0 0;
  padding: .75rem 1rem;
  border-radius: var(--r-sm);
  background: #fde3d6;
  color: #7a1408;
  border-left: 5px solid var(--wine-2);
  font-weight: 600;
}

/* =====================================================================
   PHONE — voting page
   ===================================================================== */
.page-vote { min-height: 100dvh; display: flex; flex-direction: column; background-attachment: fixed; }
.page-vote .stars { position: fixed; inset: 0 0 50% 0; pointer-events: none; }
.page-vote .horizon { position: fixed; inset: auto 0 0 0; pointer-events: none; z-index: 0; }
.vote-wrap { position: relative; z-index: 1; width: min(100%, 34rem); margin: 0 auto; padding: 34px 16px 140px; flex: 1; }
.vote-head { display: flex; justify-content: center; margin-bottom: 1.1rem; }
.vote-head .brand-name { font-size: clamp(1.5rem, 7vw, 1.9rem); }

.closing-bar {
  position: sticky; top: 8px; z-index: 5;
  margin-bottom: 1rem;
  padding: .6rem 1rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, var(--wine-2), var(--wine));
  box-shadow: inset 0 0 0 2px rgb(233 180 76 / .6), var(--shadow-1);
  font-weight: 800;
}
.closing-bar .secs { font-family: var(--font-display); font-size: 1.6rem; color: var(--gold); min-width: 3ch; text-align: right; }
.closing-bar .meter { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--gold); border-radius: 0 0 0 var(--r-sm); transition: width 1s linear; }

.card { padding: clamp(1.25rem, 5vw, 1.9rem); text-align: center; }
.card h1 { font-size: clamp(1.7rem, 8vw, 2.35rem); }
.card .ribbon { margin: .8rem 0 .4rem; }
.card .blurb { color: var(--ink-soft); margin: .6rem auto 1.2rem; max-width: 32ch; font-size: 1rem; }
.card .hint { color: var(--ink-soft); font-size: .9rem; margin: .7rem 0 0; }

fieldset.choices { position: relative; border: 0; margin: 0; padding: 0; min-width: 0; }
.choice-grid { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.choice-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 6px); }
.choice {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: 40px 8px 12px;
  border-radius: var(--r-md);
  border: 2px solid rgb(122 72 40 / .3);
  background: rgb(255 250 238 / .45);
  cursor: pointer;
  transition: transform .18s var(--ease-out), background .18s, border-color .18s;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .avatar { --size: clamp(64px, 20vw, 84px); }
.choice .name { font-weight: 800; color: var(--ink); line-height: 1.2; font-size: .98rem; }
.choice:hover { transform: translateY(-2px); background: rgb(255 250 238 / .75); }
.choice:has(input:checked) { background: #fffaf0; border-color: transparent; }
.choice:has(input:focus-visible) { outline: 3px solid var(--wine-2); outline-offset: 3px; }
.choice .pick {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--wine); color: var(--gold); font-size: 14px;
  transform: scale(0); transition: transform .3s var(--ease-spring);
}
.choice:has(input:checked) .pick { transform: scale(1); }
fieldset:disabled .choice { cursor: default; opacity: .6; transform: none; }
/* Single ring that glides to the selected card (inspired by Arc radio cards) */
.choice-ring {
  position: absolute; z-index: 1; pointer-events: none;
  border-radius: var(--r-md);
  border: 3px solid var(--wine);
  box-shadow: 0 0 0 4px rgb(233 180 76 / .55), 0 8px 20px rgb(58 29 18 / .25);
  opacity: 0;
  transition: top .38s var(--ease-spring), left .38s var(--ease-spring), width .38s var(--ease-spring), height .38s var(--ease-spring), opacity .2s;
}
.vote-actions { margin-top: 1.3rem; }
/* Revolver sight that swings onto the picked nominee */
.choice .aim { position: relative; display: grid; place-items: center; }
.crosshair {
  position: absolute; left: 50%; top: 50%; z-index: 3; width: 140%; aspect-ratio: 1; pointer-events: none;
  opacity: 0; transform: translate(-50%, -50%) scale(1.9) rotate(-120deg);
  filter: drop-shadow(0 2px 1px rgb(58 29 18 / .35));
  transition: opacity .18s, transform .55s var(--ease-spring);
}
.choice:has(input:checked) .crosshair { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); animation: sway 2.6s ease-in-out .55s infinite; }
.crosshair .ch-cyl { transform-box: view-box; transform-origin: 50% 50%; }
.choice:has(input:checked) .ch-cyl { animation: cylinder .5s var(--ease-out) .45s both; }
.crosshair .ch-dot { transform-box: fill-box; transform-origin: center; animation: bead .8s ease-in-out infinite alternate; }
@keyframes sway { 0%, 100% { translate: 0 0; } 25% { translate: 2px -1px; } 50% { translate: -1px 2px; } 75% { translate: -2px -1px; } }
@keyframes cylinder { from { transform: rotate(0deg); } to { transform: rotate(60deg); } }
@keyframes bead { from { transform: scale(.75); } to { transform: scale(1.25); } }
.section-label { margin: 0 0 .8rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; color: var(--wine); }
.page-vote .confetti { position: fixed; z-index: 2; opacity: .8; }
.page-vote .wanted { --ring: 24px; z-index: 1; width: 100%; padding: 2rem 1.4rem 1.8rem; animation-name: drop-in; }
.page-vote .wanted .kicker { font-size: clamp(2.2rem, 11vw, 3rem); margin-bottom: 1.6rem; }
.page-vote .wanted .avatar { --size: clamp(110px, 36vw, 150px); margin: 2.6rem auto 1rem; }
.page-vote .wanted .avatars { gap: .8rem; }
.page-vote .wanted .avatars .avatar { --size: clamp(72px, 22vw, 96px); margin-top: 2rem; }
.page-vote .wanted h2 { font-size: clamp(1.8rem, 9vw, 2.4rem); }
.page-vote .wanted .for { font-size: 1.05rem; }
.page-vote .wanted .reward { text-wrap: balance; font-size: clamp(1.1rem, 5.6vw, 1.4rem); margin-top: 1.1rem; }
@keyframes drop-in { from { transform: translateY(-30px) rotate(-6deg) scale(.9); opacity: 0; } to { transform: rotate(-1.5deg); opacity: 1; } }
.after-note { position: relative; z-index: 4; margin: 1.4rem auto 0; max-width: 30ch; text-align: center; color: var(--text); font-weight: 600; text-shadow: 0 1px 3px rgb(0 0 0 / .6); }


/* Waiting / closed / voted states */
.state-icon { width: 120px; margin: .2rem auto .6rem; animation: bob 1.6s ease-in-out infinite alternate; }
@keyframes bob { from { transform: translateY(0) rotate(-4deg); } to { transform: translateY(-8px) rotate(4deg); } }
.lineup { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; gap: .45rem; text-align: left; }
.lineup li { display: flex; align-items: center; gap: .6rem; padding: .55rem .8rem; border-radius: var(--r-sm); background: rgb(255 250 238 / .5); color: var(--ink); font-weight: 700; }
.lineup li::before { content: '★'; color: var(--wine-2); }
.lineup li.is-pending { color: var(--ink-soft); font-weight: 600; }
.lineup li.is-pending::after { content: 'Pronto'; margin-left: auto; font-size: .75rem; letter-spacing: .1em; text-transform: uppercase; color: var(--wine); }

.stamp {
  display: inline-grid; place-items: center;
  margin: .6rem auto 1rem;
  padding: .8rem 1.4rem;
  border: 4px double var(--wine-2);
  border-radius: var(--r-md);
  color: var(--wine-2);
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 7vw, 1.9rem);
  line-height: 1.05;
  transform: rotate(-6deg);
  animation: stamp .55s var(--ease-spring) both;
}
@keyframes stamp { from { transform: rotate(-14deg) scale(1.8); opacity: 0; } to { transform: rotate(-6deg) scale(1); opacity: 1; } }
.voted-for { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin: 1.6rem 0 .4rem; }
.voted-for .avatar { --size: 96px; }
.voted-for strong { font-size: 1.15rem; }

/* =====================================================================
   SCREEN — projector race
   ===================================================================== */
.page-screen { height: 100dvh; overflow: hidden; }
.screen {
  position: relative;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  background: linear-gradient(180deg, transparent 0 40%, #5b3420 40%, #3a2012 100%);
}
.screen > .sky { position: absolute; inset: 0 0 auto 0; height: 46%; overflow: hidden; }
.screen > .sky .stars { position: absolute; inset: 0; }
.screen > .sky .mesas { position: absolute; left: 0; bottom: 0; }

.screen-head {
  position: relative; z-index: 2;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 2vw;
  padding: 3.2vh 2.2vw 1.6vh;
}
.screen-head .brand-name { font-size: clamp(1.4rem, 2.4vw, 2.8rem); }
.screen-head .brand .emblem { width: clamp(2.4rem, 3.4vw, 4rem); }

.cat-sign { padding: 2.2vh 3.4vw 2vh; text-align: center; min-width: 34vw; }
.cat-sign .crest { position: absolute; left: 50%; top: 0; width: clamp(48px, 4.4vw, 80px); transform: translate(-50%, -55%); filter: drop-shadow(0 3px 2px rgb(0 0 0 / .4)); }
.cat-sign h1 { font-size: clamp(1.8rem, 3.6vw, 4.4rem); }
.cat-sign .ribbon { margin-top: 1vh; font-size: clamp(.8rem, 1.05vw, 1.2rem); }

.status { display: flex; justify-content: flex-end; align-items: flex-start; gap: 1.2vw; }
.qr-card { padding: 1.1vh; text-align: center; width: clamp(130px, 11.5vw, 220px); }
.qr-card .qr { aspect-ratio: 1; width: 100%; display: grid; place-items: center; font-size: .7rem; word-break: break-all; }
.qr-card .qr img, .qr-card .qr canvas { width: 100% !important; height: auto !important; }
.qr-card p { margin: .5vh 0 0; font-weight: 800; font-size: clamp(.75rem, .95vw, 1.1rem); color: var(--wine); text-transform: uppercase; letter-spacing: .06em; }

.tally-board { text-align: center; padding: 1.2vh 1.4vw; border-radius: var(--r-md); background: rgb(23 10 18 / .55); box-shadow: inset 0 0 0 2px rgb(233 180 76 / .35); }
.tally-board .label { font-size: clamp(.7rem, .9vw, 1rem); letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); font-weight: 700; }
.tally-board .num { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 3.4rem); color: var(--gold); line-height: 1.1; }

.clock {
  position: absolute; z-index: 6; left: 50%; top: 50%;
  translate: -50% -50%;
  display: grid; place-items: center;
  padding: 2vh 3vw 2.4vh;
  min-width: 18vw;
  border: 3px solid var(--wood-900);
  border-radius: var(--r-md);
  background:
    repeating-linear-gradient(178deg, rgb(0 0 0 / .08) 0 2px, transparent 2px 9px),
    linear-gradient(180deg, var(--wood-300), var(--wood-500) 60%, var(--wood-700));
  box-shadow: inset 0 0 0 3px rgb(233 180 76 / .5), var(--shadow-2), 0 0 0 100vmax rgb(23 10 18 / .25);
  text-align: center;
}
.clock .label { font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: #fff3dc; font-size: clamp(.9rem, 1.3vw, 1.5rem); }
.clock .secs { font-family: var(--font-display); font-size: clamp(4rem, 11vw, 12rem); line-height: 1; color: var(--gold); text-shadow: 0 5px 0 rgb(0 0 0 / .4); }
.clock .secs.tick { animation: tick .45s var(--ease-spring); }
.clock.is-urgent .secs { color: #ffb199; }
.clock.is-urgent { animation: shake .5s ease-in-out infinite; }
@keyframes tick { from { transform: scale(1.35); } to { transform: scale(1); } }
@keyframes shake { 0%, 100% { rotate: 0deg; } 25% { rotate: -1.2deg; } 75% { rotate: 1.2deg; } }

/* Race track */
.race {
  position: relative; z-index: 1;
  margin: 0 2.2vw 2.6vh;
  display: grid;
  grid-template-rows: repeat(var(--lanes, 5), minmax(0, 1fr));
  border-radius: var(--r-lg);
  background:
    var(--noise),
    repeating-linear-gradient(90deg, rgb(0 0 0 / .05) 0 3px, transparent 3px 26px),
    linear-gradient(180deg, #b47a46, #94603a);
  box-shadow: inset 0 10px 0 var(--wood-700), inset 0 14px 0 var(--wood-900), inset 0 0 60px rgb(0 0 0 / .35), var(--shadow-2);
  padding-top: calc(14px + 3.5vh); /* room for the top rider's hat */
}
.lane { position: relative; display: grid; grid-template-columns: clamp(190px, 19vw, 340px) minmax(0, 1fr); min-height: 0; }
.lane + .lane { border-top: 2px dashed rgb(255 240 210 / .35); }
.plate {
  display: flex; align-items: center; gap: .8vw;
  padding: 0 1.1vw;
  margin: .9vh 0 .9vh .8vw;
  border-radius: var(--r-sm);
  border: 2px solid var(--wood-900);
  background:
    repeating-linear-gradient(178deg, rgb(0 0 0 / .07) 0 2px, transparent 2px 8px),
    linear-gradient(180deg, var(--wood-500), var(--wood-700));
  box-shadow: inset 0 0 0 2px rgb(255 220 160 / .18), var(--shadow-1);
  min-width: 0;
  transition: box-shadow .3s, transform .3s var(--ease-out);
}
.plate .swatch { width: .7vw; min-width: 8px; align-self: stretch; margin: 1vh 0; border-radius: 2px; background: var(--tone); }
.plate .who { flex: 1; min-width: 0; font-weight: 800; font-size: clamp(.95rem, 1.35vw, 1.7rem); line-height: 1.15; color: var(--text); overflow-wrap: anywhere; }
.plate .count { font-family: var(--font-display); font-size: clamp(1.6rem, 2.7vw, 3.2rem); color: var(--gold); min-width: 2ch; text-align: right; line-height: 1; }
.plate .count.bump { animation: tick .5s var(--ease-spring); }
.lane.is-leader .plate { box-shadow: inset 0 0 0 3px var(--gold), 0 0 24px rgb(233 180 76 / .45); }
.lane.is-leader .who::after { content: ' ★'; color: var(--gold); }

.track { position: relative; container-type: size; min-height: 0; }
.track::after { /* finish post */
  content: ''; position: absolute; right: 1.4vw; top: 0; bottom: 0; width: 12px;
  background: repeating-linear-gradient(180deg, #f6ead2 0 14px, var(--wine) 14px 28px);
  box-shadow: 0 0 0 2px rgb(0 0 0 / .25);
}
.runner {
  --p: 0;
  position: absolute; z-index: 2; left: 0; bottom: 5%;
  height: 78cqh; aspect-ratio: 3 / 2;
  transform: translateX(calc(var(--p) * (100cqw - 100% - 1.4vw)));
  transition: transform 1.5s var(--ease-out);
}
.runner .horse { width: 100%; height: 100%; overflow: visible; animation: gallop-bob .26s ease-in-out infinite alternate; }
.runner .avatar { --size: 46cqh; position: absolute; left: 26%; top: -22%; z-index: 3; animation: gallop-bob .26s ease-in-out -.08s infinite alternate; }
.horse .leg { transform-box: fill-box; transform-origin: 50% 6%; animation: leg .52s ease-in-out infinite alternate; }
.horse .leg.b path { filter: brightness(.62); }
.horse .leg.a { animation-delay: -.26s; }
.horse .leg.front { animation-direction: alternate-reverse; }
.horse .tail { transform-box: fill-box; transform-origin: 100% 0; animation: tail .52s ease-in-out infinite alternate; }
@keyframes leg { from { transform: rotate(28deg); } to { transform: rotate(-30deg); } }
@keyframes tail { from { transform: rotate(-8deg); } to { transform: rotate(10deg); } }
@keyframes gallop-bob { from { transform: translateY(0); } to { transform: translateY(-5%); } }
.dust {
  position: absolute; left: -22%; bottom: -4%; width: 45%; height: 40%;
  background: radial-gradient(closest-side, rgb(246 222 186 / .7), transparent);
  animation: dust .52s ease-out infinite;
  pointer-events: none;
}
@keyframes dust { from { transform: translateX(20%) scale(.5); opacity: .9; } to { transform: translateX(-40%) scale(1.3); opacity: 0; } }
.pop {
  position: absolute; z-index: 4; left: 55%; top: -10%;
  font-family: var(--font-display); color: var(--gold); font-size: 16cqh;
  text-shadow: 0 2px 0 rgb(0 0 0 / .5);
  animation: pop 1s var(--ease-out) forwards;
  pointer-events: none;
}
@keyframes pop { from { transform: translateY(0) scale(.6); opacity: 0; } 20% { opacity: 1; transform: translateY(-20%) scale(1.1); } to { transform: translateY(-120%) scale(1); opacity: 0; } }

/* Idle (lobby or closed): horses stand still */
.race.is-still .horse, .race.is-still .avatar, .race.is-still .leg, .race.is-still .tail { animation-play-state: paused; }
.race.is-still .dust { display: none; }
.race.is-still .lane.is-winner .horse, .race.is-still .lane.is-winner .avatar,
.race.is-still .lane.is-winner .leg, .race.is-still .lane.is-winner .tail { animation-play-state: running; }
.race.is-still .lane.is-winner .dust { display: block; }
.race.is-finished .lane:not(.is-winner) { filter: saturate(.5) brightness(.75); }
.race.is-finished .lane.is-winner .runner { transition-duration: 2.2s; }

/* Lobby poster */
.lobby {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center;
  padding: 6vh 4vw;
}
.lobby .poster { display: grid; grid-template-columns: auto auto; align-items: center; gap: 3vw; padding: 5vh 4vw; }
.lobby h1 { font-size: clamp(2.4rem, 5.6vw, 6.4rem); }
.lobby .ribbon { font-size: clamp(.9rem, 1.4vw, 1.6rem); margin: 2vh 0; }
.lobby p:not(.ribbon) { font-size: clamp(1rem, 1.6vw, 1.9rem); margin: 0; color: var(--ink-soft); font-weight: 600; }
.lobby .url { font-weight: 800; color: var(--wine); }
.lobby .qr { width: clamp(200px, 22vw, 420px); aspect-ratio: 1; padding: 1vw; background: #f6ead2; border: 4px solid var(--wood-700); border-radius: var(--r-md); display: grid; place-items: center; }
.lobby .qr img, .lobby .qr canvas { width: 100% !important; height: auto !important; }
.screen.is-lobby .race, .screen.is-lobby .status, .screen.is-lobby .cat-sign { visibility: hidden; }

/* Nominee presentation (before voting opens) */
.screen.is-stage .race, .screen.is-stage .tally-board { display: none; }

/* Category presentation: medallion with original art per category */
.present { position: relative; z-index: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; padding: 0 3vw 5vh; }
.present .medallion { height: min(56vh, 40vw); width: auto; max-width: none; overflow: visible; filter: drop-shadow(0 14px 22px rgb(0 0 0 / .5)); animation: med-in 1s var(--ease-spring) both; }
@keyframes med-in { from { opacity: 0; transform: scale(.5) rotate(-25deg); } }
.medallion .rays { transform-box: view-box; transform-origin: 0 0; /* viewBox is centered on 0,0 */ animation: spin 80s linear infinite; }
.med-art .swing { transform-box: view-box; transform-origin: 0 56px; animation: swing 2.4s ease-in-out infinite alternate; }
.med-art .tilt { transform-box: view-box; transform-origin: 0 0; animation: swing 3.2s ease-in-out infinite alternate; }
@keyframes swing { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.med-art .note { animation: float 3s ease-in-out infinite; animation-delay: calc(var(--k) * -1s); }
@keyframes float { 0% { transform: translateY(8px); opacity: 0; } 25%, 70% { opacity: 1; } 100% { transform: translateY(-16px); opacity: 0; } }
.med-art .beat { transform-box: fill-box; transform-origin: center; animation: beat 1.6s ease-in-out infinite; }
@keyframes beat { 0%, 60%, 100% { transform: scale(1); } 15% { transform: scale(1.06); } 30% { transform: scale(.98); } 45% { transform: scale(1.04); } }
.med-art .hop { animation: hop 1.8s ease-in-out infinite; animation-delay: calc(var(--k) * -.6s); }
@keyframes hop { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.med-art .glow { animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { from { opacity: .25; } to { opacity: .8; } }
.med-art .spark { transform-box: fill-box; transform-origin: center; animation: spark .25s ease-in-out infinite alternate; }
@keyframes spark { from { transform: scale(.8) rotate(0deg); } to { transform: scale(1.15) rotate(22deg); } }
.med-art .flick { animation: twinkle .35s ease-in-out infinite alternate; }
.med-art .twk { transform-box: fill-box; transform-origin: center; animation: twk 1.6s ease-in-out infinite alternate; animation-delay: calc(var(--k) * -.5s); }
@keyframes twk { from { opacity: .2; transform: scale(.6); } to { opacity: 1; transform: scale(1.1); } }
.intro { position: relative; z-index: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; padding: 1vh 3vw 6vh; }
.intro .blurb, .present .blurb { margin: 0; max-width: 56ch; text-align: center; font-weight: 700; font-size: clamp(1.1rem, 1.7vw, 2.1rem); color: var(--text); text-shadow: 0 2px 8px rgb(0 0 0 / .7); }
.intro .nominees { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2.2vw; }
.intro li {
  display: flex; flex-direction: column; align-items: center; gap: 2vh;
  width: clamp(150px, 16vw, 300px); padding: 8vh 1vw 2.6vh;
  animation: enter .8s var(--ease-spring) both; animation-delay: calc(var(--i) * .2s + .2s);
}
.intro li:nth-child(odd) { rotate: -1.5deg; }
.intro li:nth-child(even) { rotate: 1.5deg; }
.intro .avatar { --size: clamp(100px, 11vw, 220px); animation: bob 2s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -.45s); }
.intro .name { font-family: var(--font-display); color: var(--ink); text-align: center; line-height: 1.1; font-size: clamp(1.1rem, 1.7vw, 2.1rem); }
@keyframes enter { from { opacity: 0; transform: translateY(10vh) rotate(-8deg) scale(.8); } }


/* Winner: WANTED poster */
.winner {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgb(242 169 59 / .35), rgb(23 10 18 / .82) 65%);
  animation: fade .5s ease-out both;
}
@keyframes fade { from { opacity: 0; } }
.wanted {
  --ring: 34px; /* coffee-cup ring */
  position: relative; isolation: isolate;
  width: min(92vw, 46vh + 220px);
  padding: 3.6vh 3vw 3.2vh;
  text-align: center; color: var(--ink);
  filter: drop-shadow(0 18px 28px rgb(0 0 0 / .55));
  animation: drop .8s var(--ease-spring) both .15s;
}
/* Old paper: coffee ring + splashes, scorched rim, ragged burnt edge (#burnt filter in art.js) */
.wanted::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle var(--ring) at 87% 12%, rgb(130 75 30 / .06) 0 calc(var(--ring) - 3px), rgb(110 60 20 / .24) calc(var(--ring) - 1.2px), transparent var(--ring)),
    radial-gradient(ellipse 24% 15% at 13% 82%, rgb(122 70 28 / .16), rgb(122 70 28 / .05) 60%, transparent 72%),
    radial-gradient(ellipse 7% 5% at 26% 74%, rgb(122 70 28 / .22), transparent 70%),
    radial-gradient(ellipse 12% 8% at 74% 90%, rgb(122 70 28 / .16), transparent 70%),
    radial-gradient(130% 100% at 50% 45%, transparent 52%, rgb(150 82 30 / .35) 74%, rgb(92 42 12 / .8) 92%, #2a1206 100%),
    var(--noise),
    linear-gradient(172deg, #f2dfb6, #e4c78f 55%, #d3ad70);
  box-shadow: inset 0 0 0 3px #3b1a08, inset 0 0 26px 8px rgb(80 34 8 / .7);
  filter: url(#burnt);
}
.wanted::after { /* nail */
  content: ""; position: absolute; left: 50%; top: 12px; width: 14px; height: 14px; translate: -50% 0; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #e9c27a 0 25%, #5a3a14 60%, #2a1a08);
}
@keyframes drop { from { transform: translateY(-40vh) rotate(-8deg); opacity: 0; } to { transform: translateY(0) rotate(-1.5deg); opacity: 1; } }
.wanted .kicker { font-family: var(--font-display); color: var(--ink); font-size: clamp(2.4rem, 6vh, 5rem); line-height: 1; border-bottom: 4px double var(--ink); padding-bottom: 1vh; margin: 0 0 3.4vh; }
.wanted .avatar { --size: clamp(120px, 26vh, 300px); margin: 6vh auto 2.4vh; }
.wanted .avatars { display: flex; justify-content: center; gap: 2vw; flex-wrap: wrap; }
.wanted .avatars .avatar { --size: clamp(90px, 18vh, 200px); margin-top: 5vh; }
.wanted h2 { font-size: clamp(2rem, 5.4vh, 4.4rem); color: var(--wine); overflow-wrap: anywhere; }
.wanted .for { margin: 1.4vh 0 0; font-size: clamp(1rem, 2.4vh, 1.8rem); color: var(--ink-soft); font-weight: 700; }
.wanted .reward { display: inline-block; margin-top: 2.2vh; padding: .3em 1.2em; border: 3px solid var(--ink); font-family: var(--font-display); font-size: clamp(1.2rem, 3.2vh, 2.4rem); color: var(--ink); }

.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i {
  position: absolute; top: -6vh;
  font-style: normal; color: var(--gold); font-size: clamp(14px, 2.4vh, 28px);
  animation: fall linear infinite;
}
.confetti i:nth-child(3n) { color: var(--wine-2); }
.confetti i:nth-child(4n) { color: #6fb27c; }
@keyframes fall { to { transform: translateY(112vh) rotate(540deg); } }

/* =====================================================================
   HOST — admin panel
   ===================================================================== */
.page-host {
  min-height: 100dvh;
  background:
    repeating-linear-gradient(178deg, rgb(0 0 0 / .12) 0 2px, transparent 2px 11px),
    linear-gradient(180deg, #2a160d, #170c07);
}
.host-wrap { width: min(100%, 72rem); margin: 0 auto; padding: 28px 16px 48px; }
.host-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.host-top .brand-name { font-size: 1.6rem; }
.host-links { display: flex; flex-wrap: wrap; gap: .6rem; }
.host-links a { color: var(--gold); font-weight: 700; padding: .5rem .2rem; }
.live-banner {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.2rem; margin-bottom: 1.4rem;
  border-radius: var(--r-md);
  background: rgb(0 0 0 / .3);
  box-shadow: inset 0 0 0 2px rgb(233 180 76 / .3);
}
.live-banner strong { font-size: 1.15rem; }
.live-banner .secs { font-family: var(--font-display); color: var(--gold); font-size: 1.6rem; }
.host-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); gap: 1.1rem; }
.host-card {
  display: flex; flex-direction: column; gap: .9rem;
  padding: 1.2rem;
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #3a2213, #2a170d);
  border: 2px solid #5a3820;
  box-shadow: var(--shadow-1);
}
.host-card.is-live { border-color: var(--gold); box-shadow: 0 0 0 3px rgb(233 180 76 / .3), var(--shadow-1); }
.host-card h2 { margin: 0; font-family: var(--font-display); font-weight: 400; font-size: 1.35rem; color: var(--text); line-height: 1.1; }
.host-card .sub { margin: .2rem 0 0; color: var(--text-muted); font-size: .92rem; }
.tag { align-self: flex-start; padding: .2rem .6rem; border-radius: var(--r-sm); font-size: .78rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; background: rgb(255 255 255 / .08); color: var(--text-muted); }
.tag.intro { background: var(--gold); color: var(--ink); }
.tag.open { background: #2f6b3a; color: #e6ffe9; }
.tag.closing { background: var(--wine-2); color: #fff3dc; }
.tag.closed { background: #5a3820; color: #fbeedd; }
.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .6rem; font-size: .92rem; }
.bars .bar { grid-column: 1 / -1; height: 8px; border-radius: 2px; background: rgb(255 255 255 / .08); overflow: hidden; }
.bars .bar i { display: block; height: 100%; background: var(--tone); transition: width .6s var(--ease-out); }
.bars b { font-variant-numeric: tabular-nums; color: var(--gold); }
.host-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: auto; }
.host-actions .btn { flex: 1 1 auto; font-size: .95rem; padding-inline: 1.4em; }
.host-actions .btn.confirming { background: linear-gradient(180deg, #e0662a, #a8361b); }
.sim { margin-top: 1.6rem; padding: 1rem 1.2rem; border: 2px dashed rgb(233 180 76 / .4); border-radius: var(--r-md); color: var(--text-muted); }
.sim h3 { margin: 0 0 .6rem; color: var(--text); font-size: 1rem; }
.sim .row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .runner { transition-duration: .3s !important; }
  .confetti, .dust { display: none !important; }
}

/* Host/screen sign-in overlay (firebase.js) */
.login-overlay { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgb(23 10 18 / .92); }
.login-overlay form { width: min(100%, 380px); display: grid; gap: 14px; }
.login-overlay label { display: grid; gap: 6px; font-weight: 700; color: var(--ink, #3a1d12); }
.login-overlay input { font: inherit; padding: 12px; min-height: 44px; border: 2px solid #6b3f22; border-radius: 4px; background: #fffaf0; color: #3a1d12; }
.login-overlay input:focus-visible { outline: 3px solid #e9b44c; outline-offset: 2px; }

/* Long nominee names wrap inside the vote button instead of overflowing */
.btn { text-align: center; text-wrap: balance; line-height: 1.15; }

/* Rehearsal mode badge (store.js, localhost only) */
.rehearsal-badge { position: fixed; z-index: 60; top: 8px; left: 50%; translate: -50% 0; margin: 0; padding: .35em .9em; border-radius: var(--r-sm); background: #e9b44c; color: #2a1208; font-weight: 800; font-size: .85rem; box-shadow: 0 4px 12px rgb(0 0 0 / .4); pointer-events: none; white-space: nowrap; }

/* Host: Firebase connection health */
.net-status { display: flex; align-items: center; gap: .6em; margin: 0 0 1rem; padding: .7rem 1rem; border-radius: var(--r-md); font-weight: 700; }
.net-status::before { content: ''; width: .7em; height: .7em; border-radius: 50%; background: currentColor; flex: none; }
.net-status.ok { color: #8fd18a; background: rgb(60 140 60 / .14); }
.net-status.warn { color: #f0c862; background: rgb(233 180 76 / .14); }
.net-status.bad { color: #fff3dc; background: #8e1b1b; }
