:root {
  --red: #C8102E;
  --gold: #FFCD00;
  --black: #2C2A29;
  --teal: #007698;
  --gray: #969496;
  --mid: #5A5758;
  --light: #F5F3F4;
  --white: #FFFFFF;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--white);
  color: var(--black);
  font-family: Calibri, "Segoe UI", Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--teal); }

/* ---------- Vote page (phones) ---------- */

.vote-wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.eyebrow {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--red);
  margin: 8px 0 6px;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 0 0 20px;
}

.choices { display: grid; gap: 12px; }

.choice {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  padding: 16px;
  border: 2px solid var(--light);
  border-radius: 12px;
  background: var(--light);
  color: var(--black);
  font: inherit;
  cursor: pointer;
  transition: border-color 120ms, background 120ms, transform 80ms;
}
.choice:hover { border-color: var(--gray); }
.choice:active { transform: scale(0.99); }
.choice:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.choice[aria-pressed="true"] { border-color: var(--red); background: #FBE7EA; }
.choice:disabled { cursor: default; }

.choice .num {
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--black);
  color: var(--white);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700;
}
.choice[aria-pressed="true"] .num { background: var(--red); }
.choice .label { font-size: 20px; font-weight: 700; display: block; }
.choice .desc { font-size: 15px; color: var(--mid); display: block; margin-top: 2px; }

.status {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 10px;
  font-size: 16px;
  display: none;
}
.status.show { display: block; }
.status.ok { background: #E4EDD8; }
.status.err { background: #F4D4D9; }

.footer {
  margin-top: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--mid);
  font-size: 13px;
}
.footer img { height: 30px; width: auto; }

.demo-banner {
  background: var(--gold);
  color: var(--black);
  font-size: 14px;
  padding: 8px 16px;
  text-align: center;
  display: none;
}
.demo-banner.show { display: block; }

/* ---------- Results page (projector) ---------- */

.results-body { min-height: 100vh; display: flex; flex-direction: column; }

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  padding: 36px 56px 8px;
}
.results-head h1 { font-size: clamp(30px, 3.4vw, 52px); margin: 0; }
.results-head .eyebrow { font-size: clamp(14px, 1.1vw, 18px); }

.qr-box { text-align: center; flex: 0 0 auto; }
.qr-box #qr { background: var(--white); padding: 10px; border: 1px solid var(--light); border-radius: 8px; display: inline-block; }
.qr-box #qr svg { display: block; width: clamp(140px, 13vw, 220px); height: auto; }
.qr-box .url { font-size: clamp(13px, 1vw, 17px); color: var(--mid); margin-top: 6px; word-break: break-all; max-width: 240px; }

.bars {
  flex: 1;
  display: grid;
  gap: clamp(14px, 2vh, 26px);
  padding: 16px 56px 16px;
  align-content: center;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(180px, 22%) 1fr minmax(120px, 11%);
  align-items: center;
  gap: 20px;
}
.bar-label { font-size: clamp(18px, 1.8vw, 30px); font-weight: 700; }
.bar-track { background: var(--light); border-radius: 8px; height: clamp(34px, 6vh, 64px); overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0;
  background: var(--black);
  border-radius: 8px;
  transition: width 600ms cubic-bezier(.2,.8,.2,1);
}
.bar-row.lead .bar-fill { background: var(--red); }
.bar-value { font-size: clamp(18px, 1.8vw, 30px); font-variant-numeric: tabular-nums; text-align: right; }
.bar-value small { color: var(--mid); font-size: 0.7em; margin-left: 6px; }

.results-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 56px 28px;
  color: var(--mid);
  font-size: clamp(14px, 1.1vw, 18px);
}
.results-foot img { height: 36px; width: auto; }
.total strong { color: var(--black); font-size: 1.4em; font-variant-numeric: tabular-nums; }
.live-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gray); margin-right: 8px; vertical-align: middle; }
.live-dot.on { background: #2E8B57; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

@media (max-width: 760px) {
  .results-head { flex-direction: column; padding: 20px 16px 4px; }
  .bars, .results-foot { padding-left: 16px; padding-right: 16px; }
  .bar-row { grid-template-columns: 1fr; gap: 6px; }
  .bar-value { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
  .bar-fill, .choice { transition: none; }
  .live-dot.on { animation: none; }
}
