:root {
  --burgundy: #6b1d2a;
  --burgundy-soft: #8a3a45;
  --cream: #f7f1ea;
  --ink: #24181b;
  --muted: rgba(36, 24, 27, 0.68);
  --bar: #b07d5c;
  --gold: #c9a27a;
  --ground: #ebe3d8;
  --card: rgba(255, 252, 248, 0.72);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: "Avenir Next", "Segoe UI", "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--ground);
}

.stage-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(255, 252, 247, 0.7), transparent 50%),
    radial-gradient(ellipse at 85% 90%, rgba(176, 125, 92, 0.16), transparent 45%),
    linear-gradient(155deg, #f4ebe3 0%, #e5d8cb 52%, #d6c3b1 100%);
}

.slide {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.photo-slide,
.heroes-slide,
.qr-slide {
  display: grid;
  place-items: center;
  padding: 3vh 3vw;
}

.qr-card {
  width: min(760px, 92vw);
  text-align: center;
  padding: 5vh 4.5vw 4.2vh;
  background: var(--card);
  border: 1px solid rgba(36, 24, 27, 0.08);
  box-shadow: 0 30px 80px rgba(36, 24, 27, 0.14);
  backdrop-filter: blur(10px);
  animation: rise 0.55s ease;
}

.qr-card h1 { margin-bottom: 2.2vh; }

.qr-frame {
  width: min(400px, 68vw);
  margin: 0 auto 2vh;
  padding: 20px;
  background: #f3ebe3;
  border: 1px solid rgba(107, 29, 42, 0.16);
  box-shadow: inset 0 0 0 10px rgba(107, 29, 42, 0.05);
}

.qr-image { display: block; width: 100%; height: auto; }

.qr-hint {
  color: var(--muted);
  font-size: clamp(16px, 1.8vw, 22px);
  margin-bottom: 1.2vh;
}

.bot-link {
  display: inline-block;
  font-size: clamp(18px, 2.1vw, 28px);
  font-weight: 700;
  color: var(--burgundy);
  text-decoration: none;
  border-bottom: 2px solid rgba(107, 29, 42, 0.22);
  padding-bottom: 2px;
}

.photo-frame {
  width: min(96vw, 100%);
  height: min(94vh, 100%);
  display: grid;
  place-items: center;
}

.photo-shell {
  position: relative;
  display: inline-grid;
  max-width: 100%;
  max-height: 100%;
  animation: rise 0.55s ease;
}

.fit-photo {
  display: block;
  max-width: 100%;
  max-height: 94vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 22px 60px rgba(36, 24, 27, 0.16);
}

.heroes-layout {
  width: min(1400px, 96vw);
  height: min(92vh, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 2.2vw;
  align-items: center;
}

.heroes-frame { width: 100%; height: 100%; max-height: 92vh; }
.heroes-frame .fit-photo { max-height: 92vh; }

.photo-shade {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, transparent 52%, rgba(90, 45, 40, 0.14) 100%),
    radial-gradient(ellipse at center, transparent 45%, rgba(110, 70, 55, 0.16) 100%);
  mix-blend-mode: multiply;
}

.heroes-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 4vh 2vw;
  animation: rise 0.55s ease 0.08s both;
}

.heroes-copy .subtitle { max-width: 18ch; }

.frame {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  padding: 3.2vh 5vw 3.5vh;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  font-size: clamp(12px, 1.3vw, 16px);
  color: rgba(36, 24, 27, 0.5);
  border-bottom: 1px solid rgba(36, 24, 27, 0.1);
  padding-bottom: 1.2vh;
}

.brand { font-weight: 700; color: var(--burgundy); letter-spacing: 0.22em; }

main {
  display: grid;
  place-items: center;
  text-align: center;
}

.panel {
  width: min(1120px, 100%);
  animation: rise 0.5s ease;
}

.hidden { display: none !important; }

.eyebrow {
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--burgundy-soft);
  margin-bottom: 1.2vh;
  font-size: clamp(13px, 1.5vw, 20px);
}

h1 {
  font-size: clamp(32px, 4.8vw, 68px);
  line-height: 1.08;
  font-weight: 700;
  margin-bottom: 1.6vh;
  text-wrap: balance;
}

.subtitle, .hint, .body, .meta {
  font-size: clamp(17px, 2vw, 28px);
  color: var(--muted);
  line-height: 1.35;
}

#audience-text {
  font-size: clamp(28px, 4.2vw, 58px);
  max-width: 18ch;
  margin: 0 auto;
}

#audience-counter {
  margin-bottom: 1.5vh;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: clamp(14px, 1.4vw, 18px);
}

.options {
  margin-top: 2.6vh;
  display: grid;
  gap: 1.2vh;
  text-align: left;
}

.option {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1.15vh 1.15vw;
  border: 1px solid rgba(36, 24, 27, 0.08);
  background: var(--card);
  backdrop-filter: blur(6px);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.option.leader {
  border-color: rgba(107, 29, 42, 0.35);
  box-shadow: 0 10px 28px rgba(107, 29, 42, 0.12);
  transform: translateY(-1px);
}

.option .num {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--burgundy);
  color: var(--cream);
  font-weight: 700;
}

.option .text { font-size: clamp(15px, 1.55vw, 22px); line-height: 1.3; }
.option-body {
  margin-top: 0.35em;
  font-size: 0.88em;
  color: var(--muted);
}
.pick-badge {
  display: inline-block;
  margin-right: 0.5em;
  padding: 0.15em 0.55em;
  font-size: 0.72em;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cream);
  background: var(--burgundy);
  vertical-align: middle;
}
.option.picked {
  border-color: rgba(107, 29, 42, 0.45);
  background: rgba(255, 252, 247, 0.95);
}
.option .count {
  font-size: clamp(22px, 2.2vw, 34px);
  font-weight: 700;
  color: var(--bar);
  min-width: 1.5ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.results-panel h1,
.summary-panel h1 {
  color: var(--burgundy);
}

.summary-grid {
  margin-top: 2.2vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.4vw;
  text-align: left;
}

.summary-heading {
  font-size: clamp(1.1rem, 1.8vw, 1.6rem);
  margin: 0 0 1.2vh;
  color: var(--burgundy-soft);
}

.summary-list {
  display: grid;
  gap: 1.1vh;
}

.summary-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 1vh 0.9rem;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(122, 42, 54, 0.1);
}

.summary-num {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: var(--burgundy);
  color: var(--cream);
  font-weight: 700;
}

.summary-round {
  font-size: clamp(12px, 1.1vw, 15px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25em;
}

.summary-title {
  font-size: clamp(15px, 1.45vw, 21px);
  line-height: 1.25;
}

@media (max-width: 900px) {
  .summary-grid { grid-template-columns: 1fr; }
}

.live-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #c44;
  margin-right: 8px;
  animation: pulse 1.2s ease infinite;
  vertical-align: middle;
}

.bars { margin-top: 2.6vh; display: grid; gap: 1.1vh; text-align: left; }
.bar-row { display: grid; grid-template-columns: 40px 1fr 70px; gap: 0.8rem; align-items: center; }
.bar-track {
  height: 12px;
  background: rgba(36, 24, 27, 0.08);
  overflow: hidden;
  border-radius: 999px;
}
.bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--burgundy), var(--gold));
  width: 0;
  transition: width 0.45s cubic-bezier(.2,.8,.2,1);
}

.winner-panel h1 {
  color: var(--burgundy);
}

.winners-list {
  display: grid;
  gap: 1.6vh;
  margin-top: 1.2vh;
  text-align: left;
}

.winner-card {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1.4vh 1.2rem;
  background: rgba(255, 252, 247, 0.72);
  border: 1px solid rgba(122, 42, 54, 0.12);
  animation: rise 0.45s ease both;
}

.winner-card:nth-child(2) { animation-delay: 0.12s; }

.winner-rank {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 1.5rem;
  color: var(--cream);
  background: var(--burgundy);
}

.winner-title {
  font-family: var(--display);
  font-size: clamp(1.35rem, 2.4vw, 2.1rem);
  line-height: 1.2;
  color: var(--ink);
}

.bar-row.won .bar-fill {
  background: linear-gradient(90deg, var(--burgundy), #c9a14a);
}

.bar-row.won {
  font-weight: 600;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.85); }
}

@media (max-width: 900px) {
  .heroes-layout { grid-template-columns: 1fr; height: auto; max-height: 96vh; }
  .heroes-frame, .heroes-frame .fit-photo { max-height: 50vh; }
  .heroes-copy { padding: 2vh 1vw; text-align: center; align-items: center; }
  .heroes-copy .subtitle { max-width: 28ch; }
}
