:root {
  --paper: #F2F3F5;
  --surface: #FFFFFF;
  --ink: #15171C;
  --muted: #5E636E;
  --rule: #D5D8DE;
  --seat-empty: #D5D8DE;
  --warn: #B4410E;
  --ok: #1F7A44;
  --gold: #E8B52E;
  --night: #101218;
  --night-2: #1C2030;
  --night-text: #EEF0F3;
  --night-muted: #9CA2AE;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "Public Sans", system-ui, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161B; --surface: #1C1F26; --ink: #EEF0F3; --muted: #A2A7B1;
    --rule: #333844; --seat-empty: #39404D; --warn: #F08A4B; --ok: #5CC38A;
    --night: #0B0C10; --night-2: #171A24;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14161B; --surface: #1C1F26; --ink: #EEF0F3; --muted: #A2A7B1;
  --rule: #333844; --seat-empty: #39404D; --warn: #F08A4B; --ok: #5CC38A;
  --night: #0B0C10; --night-2: #171A24;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.55 var(--text); -webkit-font-smoothing: antialiased;
  padding-bottom: 76px;
}
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 0.95; margin: 0; letter-spacing: -0.01em; }
h2 { font-size: clamp(36px, 5vw, 56px); margin-bottom: 12px; }
h3 { font-size: 28px; }
main > section { padding: 56px var(--gutter); max-width: 1180px; margin: 0 auto; }
img { max-width: 100%; }

/* Barra de progreso de lectura (scroll-driven animations) */
@supports (animation-timeline: scroll()) {
  body::before {
    content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 30;
    background: var(--gold); transform-origin: 0 50%; transform: scaleX(0);
    animation: read-progress linear both; animation-timeline: scroll(root);
  }
  @keyframes read-progress { to { transform: scaleX(1); } }
}

/* Cabecera, sobre el plató oscuro */
.top {
  display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap;
  padding: 16px var(--gutter); background: var(--night); color: var(--night-text);
}
.brand { font: 800 26px/1 var(--display); text-decoration: none; }
.by { font-size: 14px; color: var(--night-muted); text-decoration: none; }
.by:hover { color: var(--night-text); }
.top nav { display: flex; gap: 20px; font-size: 15px; margin-left: auto; }
.top nav a { text-decoration: none; color: var(--night-muted); }
.top nav a:hover { color: var(--night-text); }

/* Hero: plató de noche electoral, el hemiciclo es el protagonista */
main > .hero {
  max-width: none; margin: 0; padding: 24px var(--gutter) 56px;
  background: radial-gradient(120% 90% at 70% 100%, var(--night-2), var(--night) 70%);
  color: var(--night-text);
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 40px; align-items: center;
}
.hero .chamber { width: 100%; max-width: 720px; }
.kicker { font-weight: 600; color: var(--gold); margin: 0 0 8px; }
.hero h1 { font-size: clamp(64px, 10vw, 136px); font-weight: 800; letter-spacing: -0.02em; }
.hero h1.shared { font-size: clamp(48px, 6.5vw, 88px); overflow-wrap: anywhere; }
.lede { font-size: 20px; max-width: 34ch; margin: 20px 0; }
.lede strong { color: var(--gold); }
.clock { display: flex; gap: 8px; }
.clock span { display: grid; justify-items: center; min-width: 64px; padding: 8px 6px 6px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 10px; font-size: 12px; color: var(--night-muted); }
.clock b { font: 800 34px/1 var(--display); color: var(--night-text); font-variant-numeric: tabular-nums; }
.deadline { color: var(--night-muted); margin: 10px 0 0; font-size: 14px; }

.chamber { margin: 0; }
.chamber-art { position: relative; }
.chamber svg { width: 100%; height: auto; display: block; touch-action: none; cursor: ew-resize; }
.chamber circle { transition: fill 0.25s ease, opacity 0.2s ease; }
.chamber circle.empty { fill: #2A2E39; }
.chamber svg.booting circle { fill: #2A2E39 !important; }
.chamber svg.reveal circle { transition: fill .35s ease calc(var(--i) * 3ms); }
.chamber circle.dim { opacity: 0.35; }
.chamber circle.lit { opacity: 1; }
.majority-line { stroke: var(--night-text); stroke-width: 1.5; stroke-dasharray: 3 3; opacity: .7; }
.mini circle.empty { fill: var(--seat-empty); }
.mini .majority-line { stroke: var(--ink); }
.tally { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); text-align: center; line-height: 1; pointer-events: none; }
.tally-num { display: block; font: 800 clamp(48px, 7vw, 84px)/0.85 var(--display); font-variant-numeric: tabular-nums; }
.tally-of { font-size: 14px; color: var(--night-muted); }
.chamber figcaption { text-align: center; margin-top: 12px; font-weight: 600; min-height: 1.6em; }
body.off .tally-num, body.off .chamber figcaption { color: #FF9A5C; }
.hint { text-align: center; color: var(--night-muted); font-size: 14px; margin: 4px 0 0; transition: opacity .4s; }
.hint.learned { opacity: 0; }
.drag-tip {
  position: absolute; transform: translateX(-50%); display: flex; gap: 10px; pointer-events: none;
  background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-size: 14px; white-space: nowrap;
  box-shadow: 0 6px 24px rgba(0,0,0,.35);
}
.drag-tip span { display: inline-flex; gap: 5px; align-items: center; }
.drag-tip span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.drag-tip b { font: 700 18px/1 var(--display); }
.drag-tip[hidden] { display: none; }

.versus {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
}
.versus-text { display: grid; }
.versus-text strong { font: 700 24px/1.1 var(--display); }
.versus-text span { color: var(--night-muted); font-size: 15px; }
body.ai-view .chamber-art { filter: drop-shadow(0 0 18px rgba(232,181,46,.35)); }
body.ai-view .hint { opacity: 0; }

/* Botones */
.primary, .secondary { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; font: 600 17px var(--text); text-decoration: none; cursor: pointer; }
.primary { background: var(--ink); color: var(--paper); border: 0; }
.primary:disabled { opacity: 0.55; cursor: progress; }
.secondary { background: transparent; color: var(--ink); border: 1.5px solid var(--ink); }
.small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.hero .secondary { color: var(--night-text); border-color: rgba(255,255,255,.4); }
.hero .secondary[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #15171C; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 15px; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Candidatos */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 24px; margin-bottom: 24px; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); flex: 1 1 280px; }
.cand-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.cand {
  position: relative; display: grid; grid-template-columns: 76px 1fr; column-gap: 14px; row-gap: 6px;
  padding: 18px 14px 0; background: var(--surface); border-radius: 16px; overflow: hidden;
}
.face {
  grid-row: 1 / span 2; position: relative; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--c); box-shadow: 0 0 0 3px var(--c); transition: box-shadow .25s, filter .25s, transform .2s, opacity .25s;
}
.face:hover { transform: scale(1.05) rotate(-2deg); }
.face img, .face .initials { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 18%; display: grid; place-items: center; }
.initials { font: 700 26px var(--display); color: #fff; background: var(--c); }
.badge {
  position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); white-space: nowrap;
  font: 700 12px/1 var(--text); padding: 4px 8px; border-radius: 999px; background: var(--ink); color: var(--paper);
}
.cand[data-state="majority"] .face { box-shadow: 0 0 0 3px var(--c), 0 0 0 7px var(--gold); }
.cand[data-state="majority"] .badge { background: var(--gold); color: #15171C; }
.face::after { content: attr(data-react); position: absolute; top: -14px; right: -12px; font-size: 28px; line-height: 1; pointer-events: none; }
.face.pop::after { animation: react-pop .6s cubic-bezier(.2,1.6,.4,1); }
@keyframes react-pop { 0% { transform: scale(0) rotate(-30deg); } 60% { transform: scale(1.35) rotate(8deg); } 100% { transform: scale(1) rotate(0); } }
.pop-react { position: absolute; top: -10px; right: -16px; font-size: 52px; }
.cand[data-state="out"] .face { filter: grayscale(1); opacity: .55; box-shadow: 0 0 0 3px var(--rule); }
.cand[data-state="out"] .who strong { color: var(--muted); }
.who { display: grid; align-self: end; line-height: 1.2; }
.who strong { font: 700 24px/1 var(--display); }
.who span { font-size: 14px; color: var(--muted); }
.stepper { display: flex; align-items: center; gap: 2px; align-self: start; }
.step { width: 38px; height: 38px; flex: none; border: 1px solid var(--rule); background: var(--surface); color: var(--ink); border-radius: 50%; font: 600 22px/1 var(--text); cursor: pointer; touch-action: manipulation; user-select: none; }
.step:hover { border-color: var(--ink); }
.stepper input { width: 64px; height: 42px; text-align: center; border: 0; background: transparent; color: var(--ink); font: 800 36px/1 var(--display); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.delta { grid-column: 1 / -1; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-bottom: 12px; }
.delta[data-dir="up"] { color: var(--ok); }
.delta[data-dir="down"] { color: var(--warn); }
.bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: color-mix(in srgb, var(--c) 18%, transparent); }
.bar span { display: block; height: 100%; background: var(--c); transition: width 0.2s ease; }

.pacts { margin-top: 32px; padding: 24px; background: var(--surface); border-radius: 16px; }
.pacts p { margin: 6px 0 14px; color: var(--muted); }
.pact-chips, .interest-chips, .size-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1.5px solid var(--rule); background: transparent; color: var(--ink); border-radius: 999px; padding: 4px 12px 4px 4px; font: 500 15px var(--text); cursor: pointer; font-variant-numeric: tabular-nums; }
.chip b { font-weight: 700; }
.chip .mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; font-size: 12px; display: grid; place-items: center; }
.chip[aria-pressed="true"] { background: var(--c, var(--ink)); border-color: var(--c, var(--ink)); color: #fff; }
.choice { padding: 8px 14px; }
.choice[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pact-meter { position: relative; height: 10px; border-radius: 999px; background: var(--paper); margin: 18px 0 0; }
.pact-meter span { display: block; height: 100%; border-radius: 999px; background: var(--ink); transition: width .3s ease; width: 0; }
.pact-meter i { position: absolute; top: -5px; bottom: -5px; left: calc(176 / 350 * 100%); width: 2px; background: var(--gold); }
.pact-sum { font-weight: 600; margin: 12px 0 0 !important; color: var(--ink) !important; }
.pact-sum.yes { color: var(--ok) !important; }
.pact-sum.no { color: var(--warn) !important; }

/* Formulario */
.send { display: grid; justify-items: start; }
#entry-form, .done { width: 100%; max-width: 680px; }
.field { display: grid; gap: 6px; margin: 18px 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field > span:first-child { font-weight: 600; }
.field em { font-style: normal; color: var(--muted); font-weight: 400; }
.field small { color: var(--muted); font-size: 14px; }
.field input[type="text"], .field input[type="email"], .prefixed, .turnout input[type="number"] {
  font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 10px; padding: 12px 14px; width: 100%;
}
.field input:focus-visible, .prefixed:focus-within { outline: 2px solid var(--ink); outline-offset: 1px; }
.prefixed { display: flex; align-items: center; gap: 4px; padding: 0 0 0 14px; }
.prefixed span { color: var(--muted); }
.prefixed input { border: 0 !important; outline: none !important; padding-left: 0 !important; }
.turnout { display: flex; align-items: center; gap: 12px; }
.turnout input[type="range"] { flex: 1; accent-color: var(--ink); }
.turnout input[type="number"] { width: 92px; text-align: center; font: 700 26px/1 var(--display); padding: 8px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--ink); flex: none; }
.form-error { color: var(--warn); font-weight: 600; }
#submit-btn { width: 100%; margin-top: 16px; font-size: 19px; min-height: 60px; }
.fineprint { color: var(--muted); font-size: 14px; }
.done h2 { font-size: clamp(44px, 6vw, 72px); }
.done canvas { width: 100%; height: auto; border-radius: 12px; margin: 20px 0; border: 1px solid var(--rule); }
.share-row { display: flex; flex-wrap: wrap; gap: 10px; }
.lead-step { margin-top: 32px; padding: 24px; background: var(--surface); border-radius: 16px; border: 2px solid var(--ink); }
.lead-step > p { color: var(--muted); margin: 8px 0 16px; }
.size-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 16px 0 0; }
.size-row > span { font-weight: 600; }

/* Estudio */
main > .studio {
  max-width: none; margin: 0; padding: 64px var(--gutter);
  background: var(--night); color: var(--night-text);
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: end;
}
.studio h2 { font-size: clamp(40px, 6vw, 76px); max-width: 16ch; }
.studio p { color: var(--night-muted); max-width: 58ch; }
.studio-cta { display: flex; flex-direction: column; gap: 10px; }
.studio .primary { background: var(--gold); color: #15171C; }
.studio .secondary { color: var(--night-text); border-color: rgba(255,255,255,.4); }

/* Premio */
.prize-lede { max-width: 56ch; color: var(--muted); }
.pot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 20px; margin: 24px 0; }
.pot-num { font: 800 clamp(80px, 13vw, 168px)/0.85 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.pot-label { font-size: 18px; max-width: 32ch; }
.tiers { list-style: none; padding: 0; margin: 0 0 32px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 4px solid var(--rule); }
.tiers li { padding: 12px 12px 0 0; display: grid; gap: 2px; color: var(--muted); font-size: 14px; position: relative; }
.tiers li.reached { color: var(--ink); }
.tiers li.reached::before { content: ""; position: absolute; top: -4px; left: 0; right: 0; height: 4px; background: var(--gold); }
.tiers strong { font: 700 28px/1 var(--display); }
.split { border-collapse: collapse; min-width: 260px; }
.split caption { text-align: left; font-weight: 600; margin-bottom: 8px; }
.split th, .split td { padding: 8px 0; border-bottom: 1px solid var(--rule); text-align: left; font-variant-numeric: tabular-nums; }
.split th { font: 700 22px var(--display); width: 64px; }
.split td { font: 700 24px var(--display); text-align: right; }

/* Cómo se gana: es una secuencia real */
.steps { padding: 0; margin: 0; list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.steps li { counter-increment: s; }
.steps li::before { content: counter(s); display: block; font: 800 64px/1 var(--display); margin-bottom: 8px; }
.steps strong { display: block; font-size: 19px; }

/* Ranking y media */
#ranking-lede { color: var(--muted); max-width: 60ch; }
.avg-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; }
.mini { width: 100%; height: auto; display: block; }
.avg { list-style: none; padding: 0; margin: 0; }
.avg li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.avg .mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; box-shadow: 0 0 0 2px var(--c); display: grid; place-items: center; font-size: 12px; background: var(--c); color: #fff; }
.avg strong { margin-left: auto; font: 700 22px var(--display); font-variant-numeric: tabular-nums; }
.ai-score { font-weight: 600; }
.rank { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.rank th { text-align: left; font-size: 14px; color: var(--muted); font-weight: 500; padding: 8px 8px 8px 0; border-bottom: 2px solid var(--ink); }
.rank td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--rule); }
.rank td:first-child { font: 700 24px var(--display); width: 70px; }
.handle { color: var(--muted); }

/* Preguntas */
.faq details { border-bottom: 1px solid var(--rule); padding: 14px 0; max-width: 760px; }
.faq summary { font-weight: 600; cursor: pointer; font-size: 18px; }
.faq details p { margin: 10px 0 0; color: var(--muted); max-width: 64ch; }

.foot { padding: 32px var(--gutter) 40px; max-width: 1180px; margin: 0 auto; color: var(--muted); font-size: 14px; border-top: 1px solid var(--rule); }
.foot-links a { margin-right: 16px; }
.credits ul { padding-left: 18px; }

/* Popovers (Popover API + @starting-style) */
[popover] {
  border: 0; border-radius: 20px; padding: 24px; background: var(--surface); color: var(--ink);
  width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  box-shadow: 0 30px 80px rgba(0,0,0,.35);
  transition: opacity .2s, transform .25s cubic-bezier(.2,.9,.3,1.2), overlay .25s allow-discrete, display .25s allow-discrete;
}
[popover]:not(:popover-open) { opacity: 0; transform: translateY(16px) scale(.96); }
@starting-style { [popover]:popover-open { opacity: 0; transform: translateY(16px) scale(.96); } }
[popover]::backdrop { background: rgba(10,12,16,.55); backdrop-filter: blur(6px); }
.lead-pop { width: min(560px, calc(100vw - 32px)); }
.lead-pop > form > p { color: var(--muted); }
.pop-close { position: absolute; top: 10px; right: 12px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--paper); color: var(--ink); font-size: 22px; cursor: pointer; z-index: 1; }
.gif { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: var(--paper); margin-bottom: 16px; }
.gif iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.pop-face { position: relative; width: 160px; height: 160px; margin: 0 auto 16px; border-radius: 50%; box-shadow: 0 0 0 5px var(--c); }
.pop-face img, .pop-face .initials { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; object-position: 50% 18%; display: grid; place-items: center; }
.cand-pop h3 { font-size: 36px; }
.pop-party { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; margin: 6px 0; }
.pop-party::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.pop-seats { margin: 6px 0 0; }
.pop-seats b { font: 800 44px/1 var(--display); }
.pop-delta { color: var(--muted); margin: 4px 0 8px; }

/* Barra fija: el total siempre a la vista */
.dock { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px var(--gutter); background: var(--surface); border-top: 1px solid var(--rule); z-index: 10; }
.dock-tally { flex: none; white-space: nowrap; font: 600 18px var(--text); font-variant-numeric: tabular-nums; }
.dock .primary.warn { font-size: 15px; text-align: center; line-height: 1.2; }
.dock-tally strong { font: 800 32px var(--display); }
body.off .dock-tally strong { color: var(--warn); }
.dock .primary { min-height: 46px; }
body.sent .dock { display: none; }
body.sent { padding-bottom: 0; }

#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 40; }

::view-transition-old(root), ::view-transition-new(root) { animation-duration: .35s; }

@media (max-width: 860px) {
  main > .hero { grid-template-columns: 1fr; gap: 20px; }
  main > .studio { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; gap: 20px; }
  .tiers { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 16px; border-top: 0; }
  .tiers li { border-top: 4px solid var(--rule); }
  .avg-wrap { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .top nav { gap: 14px; font-size: 14px; }
  main > section { padding-top: 40px; padding-bottom: 40px; }
}
@media (max-width: 520px) {
  .top nav { display: none; }
  .hero h1 { font-size: 60px; }
  .clock span { min-width: 0; flex: 1; }
  .cand-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .cand { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 18px 8px 0; }
  .face { grid-row: auto; width: 64px; height: 64px; margin-bottom: 8px; }
  .who { align-self: auto; }
  .who strong { font-size: 20px; }
  .who span { font-size: 12px; }
  .step { width: 34px; height: 34px; }
  .stepper input { width: 52px; font-size: 30px; }
}

/* ---------- Barra de patrocinador principal ---------- */
.sponsor-bar {
  display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap;
  padding: 8px var(--gutter); background: var(--night); color: var(--night-muted); font-size: 13px;
  border-top: 1px solid rgba(255,255,255,.08);
}
.sponsor-bar a { color: var(--night-text); display: inline-flex; align-items: center; }
.sponsor-bar img { height: 22px; width: auto; }
.ad-empty {
  border: 1px dashed currentColor; background: transparent; color: var(--gold); border-radius: 999px;
  padding: 3px 12px; font: 600 13px var(--text); cursor: pointer;
}

/* ---------- Marcador ---------- */
main > .board { max-width: none; margin: 0; padding: 0 var(--gutter) 28px; background: var(--night); color: var(--night-text); }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin: 0; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.1); border-radius: 16px; overflow: hidden; max-width: 1180px; margin-inline: auto; }
.stats > div { background: var(--night); padding: 18px 20px; display: grid; gap: 2px; }
.stats dt { font-size: 13px; color: var(--night-muted); }
.stats dd { margin: 0; font: 800 clamp(40px, 5vw, 64px)/1 var(--display); font-variant-numeric: tabular-nums; }
.stats small { color: var(--night-muted); font-size: 13px; }
.stats > div:first-child dd { color: var(--gold); }
.board-sponsor { max-width: 1180px; margin: 10px auto 0; text-align: right; font-size: 12px; color: var(--night-muted); }
.board-sponsor:empty { display: none; }
.board-sponsor a { color: var(--night-text); }
.board-sponsor img { height: 18px; vertical-align: middle; }

/* Porras en directo: cinta que avanza sola */
.ticker { max-width: 1180px; margin: 14px auto 0; display: flex; align-items: center; gap: 12px; overflow: hidden; }
.ticker[hidden] { display: none; }
.live { flex: none; display: inline-flex; align-items: center; gap: 6px; font: 700 12px var(--text); color: #FF5A5A; }
.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; animation: blink 1.4s infinite; }
@keyframes blink { 50% { opacity: .25; } }
.ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.ticker-track ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 28px; width: max-content; animation: tick var(--dur, 40s) linear infinite; }
.ticker-track:hover ul { animation-play-state: paused; }
@keyframes tick { to { transform: translateX(-50%); } }
.ticker li { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; color: var(--night-muted); }
.ticker li b { color: var(--night-text); }
.ticker li span { display: inline-flex; align-items: center; gap: 4px; color: var(--night-text); font-variant-numeric: tabular-nums; }
.ticker li span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.ticker li i { font-style: normal; font-size: 12px; }

/* ---------- Gobiernos posibles ---------- */
.gov-title { font: 700 22px var(--display); margin: 28px 0 10px; }
.govs { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px; }
.govs li { display: grid; grid-template-columns: auto 1fr auto; grid-template-rows: auto auto; align-items: center; column-gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--paper); border: 1.5px solid transparent; }
.govs li.yes { border-color: var(--ok); }
.govs li.no { opacity: .75; }
.gov-faces { grid-row: 1 / span 2; display: flex; }
.gov-faces .mini { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; object-position: 50% 18%; border: 2px solid var(--surface); margin-left: -8px; display: grid; place-items: center; font-size: 11px; color: #fff; }
.gov-faces .mini:first-child { margin-left: 0; }
.gov-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.govs b { font: 800 26px/1 var(--display); grid-row: 1 / span 2; grid-column: 3; font-variant-numeric: tabular-nums; }
.govs em { font-style: normal; font-size: 13px; color: var(--muted); }
.govs li.yes em { color: var(--ok); font-weight: 600; }

/* ---------- Premio en proyectos ---------- */
.prize-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 40px; align-items: end; }
.prize-head h2 { font-size: clamp(40px, 6vw, 72px); max-width: 14ch; }
.prize-head .pot { margin: 0; flex-direction: column; align-items: flex-start; gap: 4px; }
.podium { display: grid; grid-template-columns: 1.4fr 1.15fr 1fr 1fr 1fr; gap: 8px; align-items: end; margin: 8px 0 40px; }
.bono { display: grid; gap: 2px; padding: 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--rule); }
.bono strong { font: 800 clamp(28px, 3.4vw, 44px)/1 var(--display); font-variant-numeric: tabular-nums; }
.bono span { font-size: 13px; color: var(--muted); }
.bono-place { font: 700 16px var(--display) !important; color: var(--ink) !important; }
.bono[data-place="1"] { background: var(--night); color: var(--night-text); border-color: var(--night); padding-top: 28px; }
.bono[data-place="1"] strong { color: var(--gold); font-size: clamp(40px, 5vw, 64px); }
.bono[data-place="1"] span, .bono[data-place="1"] .bono-place { color: var(--night-muted) !important; }
.bono[data-place="2"] { padding-top: 22px; }
.catalog-title { font-size: 32px; margin: 0 0 14px; }
.catalog { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 10px; }
.catalog li { display: grid; gap: 6px; padding: 18px; background: var(--surface); border-radius: 14px; border-top: 4px solid var(--ink); }
.catalog strong { font: 700 24px/1.05 var(--display); }
.catalog span { color: var(--muted); font-size: 15px; }
.wish-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Espacio para anunciantes ---------- */
.ad-slot { padding-top: 0 !important; }
.ad-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ad-card { display: flex; align-items: center; gap: 20px; padding: 22px 24px; border-radius: 16px; background: var(--surface); text-decoration: none; }
.ad-card img { max-height: 48px; width: auto; }
.ad-card-empty { justify-content: space-between; flex-wrap: wrap; border: 2px dashed var(--rule); background: transparent; }
.ad-card-empty div { display: grid; gap: 4px; max-width: 60ch; }
.ad-card-empty strong { font: 700 26px/1.1 var(--display); }
.ad-card-empty span { color: var(--muted); }
.ad-card-empty .ad-empty { color: var(--ink); border-style: solid; border-width: 1.5px; padding: 10px 20px; font-size: 15px; }
.foot-sponsors:empty { display: none; }
.foot-sponsors img { height: 20px; vertical-align: middle; }

@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prize-head { grid-template-columns: 1fr; }
  .podium { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bono[data-place="1"] { grid-column: 1 / -1; }
}
.prize-head .pot-num { font-size: clamp(64px, 8vw, 112px); white-space: nowrap; }

/* ---------- El tablón ---------- */
main > .hero { position: relative; isolation: isolate; overflow: hidden; }
.hero > :not(.scatter) { position: relative; z-index: 1; }

.tablon .section-head .primary { flex: none; }
.wall-note { color: var(--muted); }
.wall {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-rows: 1fr; grid-auto-flow: dense; gap: 6px;
}
.tile { grid-column: span min(var(--span), 12); grid-row: span var(--span); aspect-ratio: 1; min-width: 0; }
.tile button { position: relative; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--night-2); display: block; }
.tile img, .tile-ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tile-ph { display: grid; place-items: center; font: 800 clamp(20px, 4vw, 56px) var(--display); color: rgba(255,255,255,.85);
  background: linear-gradient(135deg, hsl(var(--h) 55% 45%), hsl(calc(var(--h) + 40) 60% 30%)); }
.tile-text { position: absolute; inset: auto 0 0 0; padding: 18px 8px 6px; display: grid; text-align: left; color: #fff; font-size: 12px; line-height: 1.25;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.tile-text b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-text span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile[style*="--span:1"] .tile-text { padding: 10px 4px 3px; }
.tile[style*="--span:1"] .tile-text b { font-size: 10px; }
.tile button:hover img { transform: scale(1.04); transition: transform .3s; }
.wall-empty { grid-column: 1 / -1; padding: 40px; text-align: center; border: 2px dashed var(--rule); border-radius: 14px; color: var(--muted); }
.tile-big { width: 100%; border-radius: 12px; margin-bottom: 12px; }
.tile-msg { font-size: 20px; margin: 6px 0; }

.photo-drop { position: relative; display: grid; place-items: center; min-height: 140px; border: 2px dashed var(--rule); border-radius: 14px; cursor: pointer; text-align: center; color: var(--muted); overflow: hidden; margin: 12px 0; }
.photo-drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-drop img { max-height: 220px; width: auto; border-radius: 10px; }
.photo-drop small { font-size: 12px; }
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.amount-other { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-top: 8px; }
.amount-other input { width: 90px; font: 700 20px var(--display); padding: 6px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); color: var(--ink); }
.wall-preview { display: grid; grid-template-columns: 140px 1fr; gap: 14px; align-items: center; padding: 12px; background: var(--paper); border-radius: 12px; margin: 8px 0; }
.wall-preview p { margin: 0; font-size: 14px; color: var(--muted); }
.wall-preview p strong { color: var(--ink); }
.preview-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; }
.preview-grid .tile { grid-column: span var(--span); grid-row: span var(--span); }

.toast { position: fixed; left: 50%; bottom: 88px; transform: translateX(-50%); z-index: 50; max-width: min(560px, calc(100vw - 32px));
  background: var(--ink); color: var(--paper); padding: 14px 18px; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.3); font-weight: 500; }
.toast[hidden] { display: none; }

@media (max-width: 860px) {
  .wall { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .tile { grid-column: span min(var(--span), 6); }
}

/* ---------- Envío destacado, justo debajo del hemiciclo ---------- */
main > .send {
  max-width: 1180px; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 40px; align-items: start; justify-items: stretch;
  padding-top: 48px;
}
.send-pitch { position: sticky; top: 24px; }
.send-pitch h2 { font-size: clamp(52px, 7vw, 96px); font-weight: 800; }
.send-lede { font-size: 20px; margin: 14px 0 20px; max-width: 30ch; }
.send-prize { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: var(--night); color: var(--night-text); margin-bottom: 18px; }
.send-prize-num { font: 800 clamp(44px, 5vw, 64px)/1 var(--display); color: var(--gold); font-variant-numeric: tabular-nums; }
.send-prize span:last-child { color: var(--night-muted); max-width: 22ch; }
.send-points { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.send-points li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.send-points li::before { content: "✓"; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--gold); color: #15171C; font-weight: 800; font-size: 14px; flex: none; }
.send-card { background: var(--surface); border-radius: 22px; padding: 28px; border: 3px solid var(--gold); box-shadow: 0 24px 60px rgba(21,23,28,.12); }
.send-card #entry-form, .send-card .done { max-width: none; }
.send-card-title { font-size: 26px; margin-bottom: 4px; }
.send-card .field:first-of-type { margin-top: 10px; }
#submit-btn { background: var(--gold); color: #15171C; font-size: 21px; min-height: 64px; box-shadow: 0 8px 0 #B98C14; transition: transform .1s, box-shadow .1s; }
#submit-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 0 #B98C14; }
#submit-btn:active { transform: translateY(6px); box-shadow: 0 2px 0 #B98C14; }

/* ---------- Tablón: banda oscura con CTA dorado ---------- */
main > .tablon { max-width: none; margin: 0; padding: 64px var(--gutter); background: var(--night); color: var(--night-text); }
.tablon > * { max-width: 1180px; margin-inline: auto; }
.tablon-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 24px 40px; align-items: end; margin-bottom: 28px; }
.tablon-head h2 { font-size: clamp(44px, 6.5vw, 88px); font-weight: 800; max-width: 13ch; }
.tablon-head p { color: var(--night-muted); max-width: 56ch; font-size: 18px; margin: 14px 0 18px; }
.tablon-cta { display: grid; gap: 10px; }
.tablon-cta small { color: var(--night-muted); font-size: 13px; }
.primary.big { min-height: 68px; font-size: 21px; background: var(--gold); color: #15171C; box-shadow: 0 8px 0 #B98C14; }
.primary.big:hover { transform: translateY(-2px); }
.tier-legend { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.tier-legend li { display: grid; grid-template-columns: auto auto; grid-template-rows: auto auto; column-gap: 8px; align-items: end; }
.tier-legend i { grid-row: 1 / span 2; width: calc(var(--span) * 8px + 6px); height: calc(var(--span) * 8px + 6px); border-radius: 4px; background: var(--gold); opacity: calc(.35 + var(--span) * .13); }
.tier-legend b { font: 700 20px/1 var(--display); }
.tier-legend span { font-size: 12px; color: var(--night-muted); }
.tablon .wall .tile button { background: var(--night-2); }
.tile.ghost button { border: 2px dashed rgba(232,181,46,.45); background: rgba(232,181,46,.06); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--gold); font: 600 13px var(--text); }
.tile.ghost button:hover { background: rgba(232,181,46,.16); border-style: solid; }
.tile.ghost b { font: 800 clamp(22px, 3vw, 40px)/1 var(--display); color: var(--night-text); text-align: center; padding: 0 12px; }
.tile.ghost span { font-size: 12px; opacity: .85; }
.tile.ghost[style*="--span:5"] span { font-size: 16px; font-weight: 700; }

@media (max-width: 860px) {
  main > .send { grid-template-columns: 1fr; gap: 20px; }
  .send-pitch { position: static; }
  .tablon-head { grid-template-columns: 1fr; }
}
.field-row { align-items: end; }

/* ---------- Fotos del tablón esparcidas (como en un corcho) ---------- */
.scatter { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.polaroid {
  position: absolute; pointer-events: auto; cursor: pointer; border: 0; margin: 0;
  padding: 5px 5px 20px; background: #FDFBF6; border-radius: 3px;
  box-shadow: 0 10px 24px rgba(0,0,0,.35); transform: rotate(var(--r)); transition: transform .2s, box-shadow .2s;
}
.polaroid img, .polaroid .tile-ph { position: static; display: grid; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 1px; }
.polaroid > span { position: absolute; left: 6px; right: 6px; bottom: 3px; font: 600 11px/14px var(--text); color: #15171C; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.polaroid:hover, .polaroid:focus-visible { transform: rotate(0) scale(1.08); z-index: 2; box-shadow: 0 16px 36px rgba(0,0,0,.45); }
.polaroid::before { content: ""; position: absolute; top: -7px; left: 50%; width: 34px; height: 13px; transform: translateX(-50%) rotate(-3deg); background: rgba(232,181,46,.75); }
.polaroid.ghost { background: rgba(232,181,46,.07); border: 2px dashed rgba(232,181,46,.6); box-shadow: none; aspect-ratio: 1 / 1.15; display: grid; place-content: center; gap: 2px; color: var(--gold); text-align: center; padding: 8px; }
.polaroid.ghost::before { display: none; }
.polaroid.ghost b { font: 800 22px/1 var(--display); }
.polaroid.ghost span { position: static; color: inherit; font-size: 12px; }
.send .polaroid.ghost { color: #9A7413; border-color: rgba(154,116,19,.45); }
/* Zona de envío a todo lo ancho para que las fotos ocupen los márgenes */
main > .send { max-width: none; margin: 0; padding-inline: max(var(--gutter), calc((100% - 1180px) / 2)); position: relative; overflow: hidden; }
.send > :not(.scatter) { position: relative; z-index: 1; }

/* Móvil: tira de fotos bajo el hemiciclo */
.scatter-strip { display: none; }
@media (max-width: 699px) {
  .scatter-strip:not(:empty) { display: flex; align-items: center; gap: 14px; overflow-x: auto; padding: 14px 4px 18px; margin: 0 calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
  .scatter-strip .polaroid { position: relative; left: auto !important; top: auto !important; flex: none; }
}

/* ---------- Tu grupo ---------- */
.grupo-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: 32px; align-items: start; }
.grupo-main { background: var(--surface); border-radius: 22px; padding: 28px; border: 3px solid var(--ink); }
.grupo-main h2 { font-size: clamp(40px, 5vw, 64px); }
.grupo-lede { color: var(--muted); max-width: 52ch; font-size: 18px; }
.grupo-create { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; }
.grupo-create .field { margin: 0; }
.kicker-dark { font-weight: 600; color: var(--muted); margin: 0 0 4px; }
.grupo-name { overflow-wrap: anywhere; }
.grupo-stats { display: flex; gap: 12px; margin: 16px 0; }
.grupo-stats div { display: grid; padding: 12px 18px; border-radius: 14px; background: var(--paper); }
.grupo-stats b { font: 800 44px/1 var(--display); font-variant-numeric: tabular-nums; }
.grupo-stats span { font-size: 13px; color: var(--muted); }
.grupo-join { width: 100%; margin: 4px 0 14px; background: var(--gold); color: #15171C; }
.grupo-share { display: flex; flex-wrap: wrap; gap: 8px; }
.grupo-share .primary, .grupo-share .secondary { min-height: 46px; font-size: 15px; padding: 0 18px; }
.grupo-link code { font-size: 13px; color: var(--muted); }
.grupo-sub { margin: 24px 0 8px; }
.grupo-empty { color: var(--muted); padding: 18px; border: 2px dashed var(--rule); border-radius: 14px; }
.members { list-style: none; margin: 0 0 12px; padding: 0; }
.members li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 12px; row-gap: 6px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.members li.me { background: color-mix(in srgb, var(--gold) 14%, transparent); border-radius: 10px; padding-inline: 8px; }
.m-n { grid-row: 1 / span 2; font: 700 20px var(--display); color: var(--muted); }
.m-who b { font-size: 17px; }
.tag { font-style: normal; font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 999px; background: var(--gold); color: #15171C; }
.m-top { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; grid-column: 2; }
.m-top span { display: inline-flex; align-items: center; gap: 4px; }
.m-top span::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.seat-bar { grid-column: 2; grid-row: 2; display: flex; height: 10px; border-radius: 999px; overflow: hidden; }
.seat-bar i { display: block; background: var(--c); }
.members li .m-top { grid-row: 1; grid-column: 3; justify-content: flex-end; }
.m-see { grid-column: 3; grid-row: 2; font-size: 13px; text-align: right; }
.m-hidden { grid-column: 2 / span 2; font-size: 13px; color: var(--muted); }
.grupo-top { background: var(--night); color: var(--night-text); border-radius: 22px; padding: 24px; position: sticky; top: 24px; }
.grupo-top h3 { font-size: 28px; margin-bottom: 12px; }
.grupo-top ol { list-style: none; margin: 0; padding: 0; }
.grupo-top li { display: grid; grid-template-columns: 26px 1fr auto; grid-template-rows: auto 6px; column-gap: 10px; row-gap: 4px; align-items: center; padding: 8px 0; }
.grupo-top li.is-you .t-name { color: var(--gold); }
.t-n { grid-row: 1 / span 2; font: 700 20px var(--display); color: var(--night-muted); }
.t-name { text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.grupo-top b { font: 800 22px var(--display); font-variant-numeric: tabular-nums; }
.t-bar { grid-column: 2 / span 2; height: 6px; background: rgba(255,255,255,.08); border-radius: 999px; overflow: hidden; }
.t-bar i { display: block; height: 100%; background: var(--gold); border-radius: 999px; }
.grupo-top .fineprint { color: var(--night-muted); margin-bottom: 0; }
.t-empty { color: var(--night-muted); grid-template-columns: 1fr !important; }
@media (max-width: 860px) {
  .grupo-grid { grid-template-columns: 1fr; }
  .grupo-top { position: static; }
  .grupo-create { grid-template-columns: 1fr; }
  .members li { grid-template-columns: 24px minmax(0, 1fr); }
  .members li .m-top { grid-row: auto; grid-column: 2; justify-content: flex-start; }
  .m-see { grid-column: 2; grid-row: auto; text-align: left; }
}

/* ---------- Aviso si el reparto no suma 350 ---------- */
[hidden] { display: none !important; }
.sum-alert { display: grid; gap: 6px; justify-items: start; margin: 0 0 18px; padding: 16px 18px; border-radius: 14px; background: #FFF1E8; border: 2px solid var(--warn); color: #6B2408; }
.sum-alert strong { font: 800 24px/1.1 var(--display); color: var(--warn); }
.sum-alert span { font-size: 15px; }
.sum-alert .secondary { margin-top: 4px; border-color: var(--warn); color: var(--warn); }
#submit-btn:disabled { background: var(--rule); color: var(--muted); box-shadow: none; cursor: not-allowed; transform: none; opacity: 1; }
.dock .primary.warn { background: var(--warn); color: #fff; }
body.locked .cand .step, body.locked .cand input { opacity: .45; cursor: not-allowed; }
body.locked .chamber svg { cursor: default; }
