:root {
  --ink: #14121f;
  --paper: #fffaf0;
  --paper2: #fff1d6;
  --pink: #ff2e9a;
  --hotpink: #ff5cc8;
  --purple: #7b2ff7;
  --violet: #b16bff;
  --yellow: #ffe600;
  --orange: #ff7a00;
  --green: #00e676;
  --cyan: #00e5ff;
  --red: #ff3b3b;
  --shadow: 5px 5px 0 var(--ink);
  --shadow-sm: 3px 3px 0 var(--ink);
  --radius-blob: 42% 58% 61% 39% / 45% 41% 59% 55%;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: "Fredoka", system-ui, sans-serif;
  font-weight: 500;
  line-height: 1.4;
  max-width: 720px;
  margin: 0 auto;
  padding: 14px 12px 70px;
  position: relative;
  overflow-x: hidden;
  background: linear-gradient(135deg, #ff2e9a, #7b2ff7 38%, #00e5ff 72%, #ffe600);
  background-size: 300% 300%;
  animation: gradientshift 14s ease infinite;
}

@keyframes gradientshift {
  0% { background-position: 0% 30%; }
  50% { background-position: 100% 70%; }
  100% { background-position: 0% 30%; }
}

/* ---------- decorative blobfield ---------- */
.blobfield { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.blob {
  position: absolute; border-radius: var(--radius-blob);
  filter: blur(2px); opacity: .55; mix-blend-mode: soft-light;
  animation: blobmove 16s ease-in-out infinite alternate;
}
.blob.b1 { width: 220px; height: 220px; background: var(--yellow); top: -60px; left: -60px; animation-duration: 18s; }
.blob.b2 { width: 260px; height: 260px; background: var(--cyan); top: 30%; right: -100px; animation-duration: 22s; }
.blob.b3 { width: 180px; height: 180px; background: var(--green); bottom: 10%; left: -70px; animation-duration: 20s; }
.blob.b4 { width: 200px; height: 200px; background: var(--pink); bottom: -80px; right: -40px; animation-duration: 15s; }
@keyframes blobmove {
  0% { transform: translate(0,0) rotate(0deg) scale(1); border-radius: 42% 58% 61% 39% / 45% 41% 59% 55%; }
  50% { transform: translate(20px,-15px) rotate(30deg) scale(1.12); border-radius: 58% 42% 39% 61% / 55% 60% 40% 45%; }
  100% { transform: translate(-15px,10px) rotate(-15deg) scale(0.95); border-radius: 42% 58% 61% 39% / 45% 41% 59% 55%; }
}
.sparkle { position: absolute; font-size: 26px; animation: twinkle 2.4s ease-in-out infinite; }
.sparkle.s1 { top: 12%; right: 8%; animation-delay: .2s; }
.sparkle.s2 { top: 55%; left: 4%; animation-delay: .9s; }
.sparkle.s3 { bottom: 18%; right: 14%; animation-delay: 1.5s; }
@keyframes twinkle { 0%,100% { opacity: .2; transform: scale(.7) rotate(0deg); } 50% { opacity: 1; transform: scale(1.15) rotate(15deg); } }

/* ---------- header ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  position: relative; z-index: 1; padding: 10px 4px 16px;
}
.logo-wrap { display: flex; flex-direction: column; }
.logo {
  font-family: "Bangers", cursive; font-size: 40px; line-height: .95; letter-spacing: 1px;
  color: var(--yellow); -webkit-text-stroke: 3px var(--ink); text-stroke: 3px var(--ink);
  text-shadow: 4px 4px 0 var(--pink), 8px 8px 0 var(--ink);
  transform: rotate(-2deg); display: inline-block;
}
.logo-sa { display: block; color: var(--paper); -webkit-text-stroke: 3px var(--ink); text-shadow: 4px 4px 0 var(--purple), 8px 8px 0 var(--ink); font-size: 34px; margin-top: -6px; }
.logo-emoji { display: none; }
.tagline {
  font-family: "Fredoka", sans-serif; font-weight: 700; font-size: 13px; margin-top: 8px;
  background: var(--ink); color: var(--yellow); display: inline-block; padding: 4px 10px;
  border-radius: 999px; transform: rotate(-1deg); width: fit-content;
}
.badge-demo {
  font-family: "Luckiest Guy", cursive; font-size: 12px; letter-spacing: .5px;
  color: var(--ink); background: var(--green);
  padding: 8px 12px; border-radius: 16px; text-transform: uppercase;
  border: 3px solid var(--ink); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transform: rotate(4deg); animation: wiggle 3.5s ease-in-out infinite;
}
@keyframes wiggle { 0%,100% { transform: rotate(4deg); } 50% { transform: rotate(-3deg); } }

/* ---------- evento ---------- */
.evento {
  position: relative; z-index: 1; margin-bottom: 14px;
  background: repeating-linear-gradient(135deg, var(--red), var(--red) 12px, var(--yellow) 12px, var(--yellow) 24px);
  border: 4px solid var(--ink); border-radius: 20px; padding: 4px;
  box-shadow: var(--shadow); transform: rotate(-1deg);
}
.evento-marquee {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper); border-radius: 16px; padding: 10px 14px;
}
.evento-emoji { font-size: 34px; animation: bounce 1.2s ease-in-out infinite; }
@keyframes bounce { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-6px) rotate(-8deg); } }
.evento-texto { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.evento-texto strong { font-family: "Bangers", cursive; font-size: 18px; letter-spacing: .5px; color: var(--pink); -webkit-text-stroke: 1px var(--ink); }
.evento-texto span { font-size: 12px; font-weight: 600; color: var(--ink); }
.evento-timer { text-align: center; min-width: 66px; background: var(--ink); border-radius: 12px; padding: 6px 4px; }
.evento-timer span { font-family: "Luckiest Guy", cursive; font-size: 20px; color: var(--yellow); display: block; }
.evento-timer small { color: var(--paper); font-size: 8px; text-transform: uppercase; letter-spacing: .5px; display: block; }

/* ---------- layout / panels ---------- */
.layout { display: flex; flex-direction: column; gap: 16px; position: relative; z-index: 1; }

.panel {
  background: var(--paper); border: 4px solid var(--ink);
  border-radius: 26px; padding: 14px; position: relative; z-index: 1;
  box-shadow: var(--shadow);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.panel-head h2 { font-family: "Bangers", cursive; font-size: 24px; letter-spacing: .5px; color: var(--ink); }
.panel-head .sub { color: #6b5f7a; font-size: 11px; font-weight: 600; }
.live {
  color: var(--paper); background: var(--red); font-family: "Luckiest Guy", cursive; font-size: 11px;
  letter-spacing: .5px; padding: 4px 9px; border-radius: 999px; border: 2px solid var(--ink);
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .6; transform: scale(1.05); } }

.cargando { color: #8a7d99; font-size: 13px; font-weight: 600; padding: 20px 4px; text-align: center; }

/* ---------- carrera ---------- */
.carrera { display: flex; flex-direction: column; gap: 10px; }
.carrera-row { display: grid; grid-template-columns: 30px 1fr; gap: 4px 8px; align-items: center; }
.carrera-pos {
  font-family: "Luckiest Guy", cursive; font-size: 16px; color: var(--purple);
  text-align: center; grid-row: 1 / 3; position: relative;
}
.carrera-pos.top3 { color: var(--orange); font-size: 19px; }
.carrera-pos .crown { position: absolute; top: -16px; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 16px; }
.carrera-track {
  background: #efe4ff; border: 3px solid var(--ink); border-radius: 999px; height: 34px;
  overflow: visible; position: relative; grid-column: 2;
}
.carrera-track-inner { position: absolute; inset: 0; border-radius: 999px; overflow: hidden; }
.carrera-blob {
  height: 100%; min-width: 14px; border-radius: 999px 0 0 999px;
  transition: width 1.1s cubic-bezier(.34,1.56,.64,1);
  position: relative; display: flex; align-items: center;
  animation: jelly 2.6s ease-in-out infinite;
  transform-origin: left center;
}
@keyframes jelly { 0%,100% { transform: scaleY(1); } 45% { transform: scaleY(1.08); } 55% { transform: scaleY(.94); } }
.carrera-nombre {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12px; font-weight: 700; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6);
  white-space: nowrap; max-width: 75%; overflow: hidden; text-overflow: ellipsis; z-index: 2;
}
.carrera-emoji-rider {
  position: absolute; right: -6px; top: 50%; transform: translateY(-50%);
  font-size: 26px; z-index: 3; filter: drop-shadow(1px 2px 0 rgba(0,0,0,.4));
  animation: rider-bounce .5s ease-in-out infinite alternate;
}
@keyframes rider-bounce { from { transform: translateY(-56%) rotate(-6deg); } to { transform: translateY(-44%) rotate(6deg); } }
.carrera-info { grid-column: 2; display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.carrera-votos { font-family: "Luckiest Guy", cursive; font-size: 13px; color: var(--ink); }
.carrera-votos small { color: var(--green); font-weight: 800; margin-left: 4px; font-family: "Fredoka", sans-serif; font-size: 10px; }
.carrera-votos small.neg { color: var(--red); }
.flecha-up { color: var(--green); }
.flecha-down { color: var(--red); }

/* ---------- candidatos ---------- */
.votos-gratis {
  font-family: "Luckiest Guy", cursive; font-size: 11px; color: var(--ink);
  background: var(--cyan); border: 2px solid var(--ink); padding: 5px 10px; border-radius: 999px;
}
.votos-gratis span { color: var(--pink); font-size: 14px; }
.candidatos { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 12px; }
.cand {
  background: var(--paper2); border: 3px solid var(--ink); border-radius: var(--radius-blob);
  padding: 12px 10px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px;
  box-shadow: var(--shadow-sm); transition: transform .15s;
}
.cand:hover { transform: translateY(-4px) rotate(-1deg); }
.cand-avatar {
  width: 58px; height: 58px; border-radius: 50%; font-size: 30px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  border: 3px solid var(--ink); box-shadow: 2px 2px 0 var(--ink);
  animation: avatarwiggle 3s ease-in-out infinite;
}
@keyframes avatarwiggle { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.cand-nombre { font-family: "Bangers", cursive; font-size: 16px; letter-spacing: .3px; color: var(--ink); line-height: 1.05; }
.cand-lema {
  position: relative; background: #fff; border: 2px solid var(--ink); border-radius: 12px;
  padding: 5px 8px; font-size: 10.5px; font-weight: 600; font-style: italic; color: #4a3f57;
}
.cand-frases { font-size: 10px; color: #6b5f7a; line-height: 1.3; font-weight: 600; }
.cand-frases li { list-style: none; }
.cand-frases li::before { content: "“ "; color: var(--pink); font-weight: 800; }
.cand-frases li::after { content: " ”"; color: var(--pink); font-weight: 800; }
.cand-votos { font-family: "Luckiest Guy", cursive; font-size: 17px; color: var(--purple); }
.cand-votos small { color: #8a7d99; font-weight: 600; font-size: 10px; font-family: "Fredoka", sans-serif; }
.cand-actions { display: flex; gap: 7px; width: 100%; margin-top: 2px; }
.btn {
  font-family: "Luckiest Guy", cursive; font-size: 12px; letter-spacing: .3px; cursor: pointer;
  border-radius: 999px; padding: 9px 10px; border: 3px solid var(--ink); width: 100%;
  transition: transform .1s, box-shadow .1s; box-shadow: 3px 3px 0 var(--ink);
}
.btn:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-votar { background: var(--green); color: var(--ink); }
.btn-votar:disabled { background: #d8d2df; color: #a99fb3; cursor: not-allowed; box-shadow: none; transform: none; }

/* ---------- manipular ---------- */
.tier-block { margin-bottom: 18px; }
.tier-block:last-child { margin-bottom: 0; }
.tier-head {
  display: inline-flex; align-items: center; gap: 6px; margin-bottom: 10px;
  font-family: "Bangers", cursive; font-size: 17px; color: var(--paper);
  background: var(--purple); border: 3px solid var(--ink); border-radius: 10px 10px 10px 0;
  padding: 5px 12px; box-shadow: var(--shadow-sm); transform: rotate(-1deg);
}
.ops-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.op-item {
  position: relative; display: flex; flex-direction: column; gap: 6px;
  background: #fff; border: 3px solid var(--ink); border-radius: 18px;
  padding: 12px 10px 10px; cursor: pointer; transition: transform .12s;
  box-shadow: var(--shadow-sm);
}
.op-item:hover { transform: translateY(-3px) rotate(1deg); }
.op-item .op-emoji { font-size: 26px; }
.op-item .op-info strong { font-family: "Bangers", cursive; font-size: 13px; display: block; color: var(--ink); letter-spacing: .2px; }
.op-item .op-info small { color: #7a6d88; font-size: 10px; font-weight: 600; }
.op-item .op-line2 { display: flex; align-items: center; justify-content: space-between; }
.op-item .op-x {
  font-family: "Luckiest Guy", cursive; font-size: 13px; color: var(--paper); background: var(--orange);
  border: 2px solid var(--ink); border-radius: 999px; padding: 2px 8px; white-space: nowrap;
}
.op-item .op-precio {
  position: absolute; top: -10px; right: -8px; font-family: "Luckiest Guy", cursive; font-size: 11px;
  color: var(--ink); background: var(--yellow); border: 2px solid var(--ink); border-radius: 999px;
  padding: 3px 8px; transform: rotate(6deg); box-shadow: 2px 2px 0 var(--ink);
}

/* ---------- modal ---------- */
.modal {
  position: fixed; inset: 0; background: rgba(20,14,31,.72); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 16px;
}
.modal-card {
  background: var(--paper); border: 4px solid var(--ink); border-radius: 26px;
  width: 100%; max-width: 400px; padding: 22px; position: relative; max-height: 88vh; overflow-y: auto;
  box-shadow: 8px 8px 0 var(--ink); animation: popin .25s cubic-bezier(.34,1.56,.64,1);
}
@keyframes popin { from { transform: scale(.85) rotate(-2deg); opacity: 0; } to { transform: scale(1) rotate(0); opacity: 1; } }
.modal-close {
  position: absolute; top: -12px; right: -12px; background: var(--red); border: 3px solid var(--ink); color: var(--paper);
  font-size: 16px; font-weight: 800; cursor: pointer; width: 32px; height: 32px; border-radius: 50%;
  box-shadow: 2px 2px 0 var(--ink);
}
.modal-card h3 { font-family: "Bangers", cursive; font-size: 22px; margin-bottom: 6px; color: var(--purple); }
.modal-card .modal-sub { color: #6b5f7a; font-size: 12px; margin-bottom: 14px; font-weight: 600; }
.sel-label { display: block; font-size: 12px; font-weight: 700; color: #6b5f7a; margin: 4px 0 6px; }
.cand-select {
  width: 100%; padding: 11px 12px; font-size: 14px; font-weight: 700; font-family: "Fredoka", sans-serif;
  background: #fff; color: var(--ink); border: 3px solid var(--ink);
  border-radius: 12px; margin-bottom: 12px; cursor: pointer;
}
.cand-select:focus { outline: none; border-color: var(--pink); }
.checkout-resumen { background: #fff; border: 3px dashed var(--ink); border-radius: 14px; padding: 12px; margin: 12px 0; }
.checkout-resumen .fila { display: flex; justify-content: space-between; font-size: 13px; padding: 3px 0; font-weight: 600; }
.checkout-resumen .fila.total { border-top: 2px solid var(--ink); margin-top: 6px; padding-top: 8px; font-family: "Luckiest Guy", cursive; font-size: 15px; }
.btn-pagar {
  width: 100%; padding: 15px; font-family: "Luckiest Guy", cursive; font-size: 16px; letter-spacing: .5px;
  background: var(--green); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; cursor: pointer;
  box-shadow: 4px 4px 0 var(--ink); transition: transform .1s, box-shadow .1s;
}
.btn-pagar:active { transform: translate(2px,2px); box-shadow: 2px 2px 0 var(--ink); }
.btn-pagar:disabled { opacity: .6; cursor: wait; }
.checkout-nota { font-size: 10.5px; color: #8a7d99; margin-top: 10px; font-weight: 600; text-align: center; }
.checkout-ok { padding: 10px 0; text-align: center; }
.checkout-ok .ok-emoji { font-size: 58px; display: block; margin-bottom: 8px; animation: bounce 1s ease-in-out infinite; }
.checkout-ok h3 { margin-bottom: 6px; color: var(--green); }
.checkout-ok p { color: #6b5f7a; font-size: 13px; margin-bottom: 4px; font-weight: 600; }
.checkout-ok .ok-votos { font-family: "Luckiest Guy", cursive; font-size: 30px; color: var(--pink); margin: 8px 0; }
.btn-cerrar {
  margin-top: 10px; padding: 11px 22px; font-family: "Luckiest Guy", cursive; font-size: 13px;
  background: var(--yellow); color: var(--ink); border: 3px solid var(--ink); border-radius: 999px; cursor: pointer;
  box-shadow: 3px 3px 0 var(--ink);
}
.btn-cerrar:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--ink); }

/* ---------- toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  background: var(--ink); border: 3px solid var(--yellow); color: var(--paper);
  padding: 12px 20px; border-radius: 999px; font-size: 13px; font-weight: 700;
  box-shadow: 4px 4px 0 rgba(0,0,0,.35); z-index: 60; max-width: 90vw; text-align: center;
  transition: opacity .3s, transform .3s; font-family: "Fredoka", sans-serif;
}
.toast.hidden { opacity: 0; transform: translateX(-50%) translateY(14px) scale(.9); pointer-events: none; }

/* ---------- confetti ---------- */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i {
  position: absolute; top: -12px; width: 10px; height: 16px; opacity: .95;
  animation: caer linear forwards;
}
@keyframes caer { to { transform: translateY(105vh) rotate(720deg); } }

/* ---------- footer ---------- */
.foot { position: relative; z-index: 1; margin-top: 18px; color: #fff; font-size: 11px; line-height: 1.5; text-align: center; padding: 10px 14px; font-weight: 600; text-shadow: 1px 1px 0 rgba(0,0,0,.4); }
.foot strong { color: var(--yellow); }

.hidden { display: none !important; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: var(--purple); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

@media (min-width: 560px) {
  .logo { font-size: 52px; }
  .logo-sa { font-size: 44px; }
  .panel-head h2 { font-size: 28px; }
}

/* ============================================================
   MODO SIMULADOR (COPERO presidencial)
   ============================================================ */
.badge-link { text-decoration: none; display: inline-block; }
.badge-link span { display: inline-block; }
.badge-link:hover { transform: rotate(-2deg) scale(1.05); }

.sim-sub {
  font-family: "Luckiest Guy", cursive; font-size: 17px; color: var(--ink);
  background: var(--cyan); border: 3px solid var(--ink); border-radius: 999px;
  padding: 8px 14px; display: inline-block; margin-bottom: 14px; transform: rotate(-1deg);
}
.sim-sub strong { color: var(--purple); }

.sim-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.sim-contador {
  font-family: "Luckiest Guy", cursive; font-size: 14px; color: var(--ink);
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 999px; padding: 8px 14px;
}
.btn-grande {
  font-family: "Bangers", cursive; font-size: 22px; letter-spacing: 1px; color: var(--ink);
  background: var(--yellow); border: 4px solid var(--ink); border-radius: 999px; padding: 12px 26px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .1s;
}
.btn-grande:hover:not(:disabled) { transform: rotate(-1.5deg) scale(1.04); }
.btn-grande:disabled { opacity: .45; cursor: not-allowed; }
.btn-grande.btn-outline { background: var(--paper); text-decoration: none; display: inline-block; }

.sim-cand { cursor: pointer; position: relative; transition: transform .12s; }
.sim-cand:hover { transform: translateY(-3px) rotate(-.5deg); }
.sim-cand.sel { border-color: var(--yellow); box-shadow: var(--shadow); transform: rotate(-1deg); }
.sim-cand.sel::after {
  content: "✓"; position: absolute; top: -10px; right: -8px;
  font-family: "Luckiest Guy", cursive; font-size: 18px; color: var(--ink);
  background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%;
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
}
.sim-pct { font-family: "Luckiest Guy", cursive; font-size: 20px; color: var(--purple); margin-top: 2px; }
.sim-pct small { font-family: "Fredoka", sans-serif; font-size: 11px; color: var(--ink); opacity: .6; font-weight: 600; }

/* timeline */
.timeline { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 14px; }
.tl-chip {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 14px;
  padding: 6px 10px; min-width: 84px; opacity: .55;
}
.tl-chip.now { background: var(--yellow); opacity: 1; box-shadow: var(--shadow-sm); transform: rotate(-1deg); }
.tl-chip.done { opacity: .8; }
.tl-emoji { font-size: 20px; }
.tl-label { font-family: "Luckiest Guy", cursive; font-size: 10px; text-align: center; text-transform: uppercase; }

/* grid simulador */
.sim-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 620px) { .sim-grid { grid-template-columns: 1fr; } }
.sim-block-titulo {
  font-family: "Bangers", cursive; font-size: 17px; letter-spacing: .5px; color: var(--ink);
  border-bottom: 3px dashed var(--ink); padding-bottom: 4px; margin-bottom: 10px;
}

/* probabilidades */
.sim-barras { display: flex; flex-direction: column; gap: 9px; }
.sim-barra-row { display: grid; grid-template-columns: 30px 1fr 52px; align-items: center; gap: 8px; }
.sim-barra-emoji { font-size: 22px; text-align: center; }
.sim-track { height: 28px; border-width: 3px; }
.sim-barra-fill {
  height: 100%; min-width: 10px; border-radius: 999px 0 0 999px; position: relative;
  transition: width 1s cubic-bezier(.34,1.56,.64,1);
}
.sim-barra-nombre {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 700; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.55);
  white-space: nowrap; max-width: 75%; overflow: hidden; text-overflow: ellipsis;
}
.sim-barra-pct { font-family: "Luckiest Guy", cursive; font-size: 15px; color: var(--ink); text-align: right; }

/* evento de ronda */
.sim-evento { min-height: 74px; }
.sim-evento-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px;
  box-shadow: var(--shadow-sm); animation: pop .35s ease;
}
@keyframes pop { 0% { transform: scale(.7); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.sim-evento-card strong { font-family: "Bangers", cursive; font-size: 16px; letter-spacing: .4px; }
.sim-evento-card p { font-size: 12px; color: var(--ink); opacity: .85; }

/* controles */
.sim-controles .sel-label { margin-top: 6px; }
.sim-estrategias { display: flex; flex-direction: column; gap: 7px; max-height: 300px; overflow-y: auto; padding-right: 4px; }
.sim-op {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 12px; padding: 8px 10px;
  transition: transform .1s, box-shadow .1s;
}
.sim-op:hover { transform: translateX(2px); }
.sim-op.sel { background: var(--yellow); box-shadow: var(--shadow-sm); }
.sim-op.no-plata { opacity: .4; cursor: not-allowed; }
.sim-op .op-info { flex: 1; min-width: 0; }
.sim-op .op-info strong { font-size: 12px; display: block; }
.sim-op .op-info small { font-size: 10px; opacity: .8; }
.sim-op .op-x { font-family: "Luckiest Guy", cursive; font-size: 12px; color: var(--purple); white-space: nowrap; }
.sim-op .op-precio { font-size: 10px; font-weight: 800; white-space: nowrap; }
/* plan de campaña (estrategia por candidato) */
.sim-hint { font-size: 11px; color: var(--ink); opacity: .75; margin: 4px 0 10px; line-height: 1.35; }
.sim-plan { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.sim-plan-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 14px; padding: 7px 10px;
}
.plan-emoji { font-size: 24px; flex: 0 0 auto; }
.plan-body { flex: 1; min-width: 0; }
.plan-nombre { font-size: 12px; font-weight: 800; margin-bottom: 3px; }
.plan-select {
  width: 100%; font-family: "Fredoka", sans-serif; font-size: 12px; font-weight: 600;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 10px;
  padding: 5px 6px; cursor: pointer;
}
.plan-presu { font-family: "Luckiest Guy", cursive; font-size: 13px; color: var(--ink); white-space: nowrap; flex: 0 0 auto; }
.plan-presu.rojo { color: var(--red); }
.plan-aviso { display: block; font-size: 10px; color: var(--red); font-weight: 700; margin-top: 2px; }
.sim-plan-actions { display: flex; gap: 8px; margin-top: 10px; }
.btn-chico {
  font-family: "Bangers", cursive; font-size: 14px; letter-spacing: .5px; color: var(--ink);
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 14px;
  cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .1s;
}
.btn-chico:hover { transform: rotate(-1.5deg) scale(1.05); }
.sim-controles .btn-grande { width: 100%; margin-top: 12px; }

/* escenario inicial (barras editables que suman 100) */
.sim-escenario-barras { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.sim-esc-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 14px; padding: 8px 10px;
}
.sim-esc-emoji { font-size: 22px; flex: 0 0 auto; }
.sim-esc-body { flex: 1; min-width: 0; }
.sim-esc-nombre { font-size: 12px; font-weight: 800; margin-bottom: 4px; }
.sim-esc-track { height: 14px; background: rgba(20,18,31,.08); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; }
.sim-esc-fill { height: 100%; min-width: 4px; border-radius: 999px; transition: width .15s ease; }
.sim-esc-slider { width: 100%; margin-top: 6px; accent-color: var(--pink); cursor: pointer; }
.sim-esc-pct { font-family: "Luckiest Guy", cursive; font-size: 15px; color: var(--ink); flex: 0 0 auto; min-width: 40px; text-align: right; }
.sim-suma { margin-top: 8px; font-size: 12px; font-weight: 800; }
.sim-suma.ok { color: var(--green); }

/* presupuestos */
.sim-presupuestos { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.sim-presu {
  display: flex; align-items: center; gap: 7px;
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 999px; padding: 6px 12px;
  font-size: 12px; font-weight: 700;
}
.sim-presu .rojo { color: var(--red); }

/* bitácora */
.sim-log { background: var(--paper2); border: 3px solid var(--ink); border-radius: 16px; padding: 10px 12px; max-height: 200px; overflow-y: auto; }
.sim-log-line {
  font-size: 12px; padding: 5px 0; border-bottom: 1px dashed rgba(20,18,31,.2);
}
.sim-log-line:last-child { border-bottom: none; }

/* resultado */
.res-card { text-align: center; }
.res-tipo {
  font-family: "Bangers", cursive; font-size: 26px; letter-spacing: 1px; color: var(--pink);
  -webkit-text-stroke: 1px var(--ink); margin-bottom: 4px;
}
.res-sub { font-family: "Luckiest Guy", cursive; font-size: 14px; color: var(--ink); margin-bottom: 12px; }
.res-winner {
  border-radius: 26px; padding: 22px 16px; margin-bottom: 16px;
  box-shadow: var(--shadow); animation: winner-in .6s cubic-bezier(.34,1.56,.64,1);
}
@keyframes winner-in { 0% { transform: scale(.5) rotate(-6deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.res-emoji { font-size: 64px; display: block; margin-bottom: 6px; animation: jelly 2.6s ease-in-out infinite; }
.res-winner h3 { font-family: "Bangers", cursive; font-size: 34px; letter-spacing: 1px; color: var(--ink); }
.res-votos { font-family: "Luckiest Guy", cursive; font-size: 42px; color: var(--green); -webkit-text-stroke: 1px var(--ink); margin: 4px 0; }
.res-lema { font-size: 13px; font-style: italic; color: var(--ink); opacity: .8; }
.res-barras { display: flex; flex-direction: column; gap: 9px; margin-bottom: 14px; }
.res-nota { font-size: 11px; color: var(--ink); opacity: .6; margin-top: 6px; }

/* balotaje */
.sim-barra-row.finalista { background: rgba(255,230,0,.25); border-radius: 999px; padding: 3px 4px; }

/* ===== SITUACIÓN DEL PAÍS (variables macro) ===== */
.pais-panel {
  background: var(--paper2); border: 3px solid var(--ink); border-radius: 18px;
  padding: 10px 12px 12px; margin-bottom: 16px; box-shadow: var(--shadow);
}
.pais-pulso {
  font-family: "Bangers", cursive; font-size: 16px; letter-spacing: .5px; color: var(--ink);
  background: rgba(255,230,0,.35); border: 2px dashed var(--ink); border-radius: 12px;
  padding: 7px 10px; margin-bottom: 10px; line-height: 1.25;
}
.pais-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
@media (max-width: 620px) { .pais-cards { grid-template-columns: repeat(2, 1fr); } }
.pais-card {
  display: flex; align-items: center; gap: 8px;
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px; padding: 7px 9px;
  box-shadow: 3px 3px 0 var(--ink);
}
.pais-card.mal { background: #ffe1e6; }
.pais-card.bien { background: #d9f7e8; }
.pais-card.neutro { background: #fff; }
.pais-emoji { font-size: 20px; flex: 0 0 auto; }
.pais-body { flex: 1; min-width: 0; }
.pais-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .4px; color: var(--ink); opacity: .7; }
.pais-val { font-family: "Luckiest Guy", cursive; font-size: 17px; color: var(--ink); line-height: 1.05; white-space: nowrap; }
.pais-arrow { font-size: 11px; margin-left: 3px; }
.pais-card.mal .pais-arrow { color: var(--red); }
.pais-card.bien .pais-arrow { color: var(--green); }
.pais-unidad { font-size: 9px; color: var(--ink); opacity: .55; }

/* ===== resumen del país en el resultado ===== */
.pais-resumen { text-align: left; margin-bottom: 14px; }
.pais-res-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 620px) { .pais-res-grid { grid-template-columns: 1fr; } }
.pais-res {
  background: #fff; border: 2.5px solid var(--ink); border-radius: 14px;
  padding: 8px 10px; box-shadow: 3px 3px 0 var(--ink);
}
.pais-res-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: var(--ink); }
.pais-res-top .mal { color: var(--red); }
.pais-res-top .bien { color: var(--green); }
.pais-spark {
  display: flex; align-items: flex-end; gap: 2px; height: 52px; margin-top: 6px;
  border-bottom: 2px solid rgba(20,18,31,.25); padding-bottom: 2px;
}
.pais-spark i { flex: 1; min-width: 3px; background: var(--ink); opacity: .85; border-radius: 3px 3px 0 0; }
.pais-spark.mal i { background: var(--red); }
.pais-spark.bien i { background: var(--green); }
.pais-viento-txt {
  font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 10px; line-height: 1.45;
  background: rgba(255,230,0,.25); border-radius: 10px; padding: 8px 10px;
}
