/* Identidad alineada con Espacio Patrón (nueva-electomania): Montserrat,
   pizarra #374151 / #6c7280, tinta gray-800 y verde de marca EM. */
:root {
  --sticker-ink: #120E24; --lime: #D4FF3A; --pink: #FF4FA3;
  --slate: #374151;
  --slate-2: #6c7280;
  --ink: #1f2937;
  --muted: #6b7280;
  --paper: #ffffff;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --green: #00CB89;
  --green-deep: #0F9B6C;
  --red: #E5484D;
  --shadow: 0 10px 30px -8px rgba(17, 24, 39, .35), 0 2px 6px rgba(17, 24, 39, .12);
  --font: "Montserrat", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--slate); }
body { font-family: var(--font); color: var(--ink); -webkit-tap-highlight-color: transparent; }
button { font-family: inherit; }

#app {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 560px;
  overflow: hidden;
  overflow: clip; /* hidden aún permite scroll programático (foco, transform fuera de pantalla) */
}

#view { position: absolute; inset: 0; z-index: 0; background: var(--slate); }
.leaflet-container { background: var(--slate); }
.leaflet-control-attribution { font-size: 9px; opacity: .7; }
.vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(31,41,55,.55), transparent 20%),
    linear-gradient(to top, rgba(31,41,55,.6), transparent 40%);
}

/* ---------- Cabecera (estilo pegatina original) ---------- */
.top {
  --sticker-ink: #120E24; --lime: #D4FF3A; --pink: #FF4FA3;
  position: absolute; top: 12px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-start; gap: 8px;
  pointer-events: none;
}
.brand {
  font-family: "Unbounded", var(--font); font-weight: 800; font-size: 23px; line-height: .92;
  text-transform: uppercase; letter-spacing: -.02em; color: var(--sticker-ink);
  background: var(--lime); border: 3px solid var(--sticker-ink); box-shadow: 4px 4px 0 var(--sticker-ink);
  border-radius: 16px; padding: 10px 14px 9px; transform: rotate(-3deg);
}
.brand-t { display: block; }
.brand-t > span {
  color: var(--pink);
  /* contorno solo por fuera: -webkit-text-stroke pintaba los solapes internos de la fuente */
  text-shadow: 1px 0 var(--sticker-ink), -1px 0 var(--sticker-ink), 0 1px var(--sticker-ink), 0 -1px var(--sticker-ink),
    1px 1px var(--sticker-ink), -1px -1px var(--sticker-ink), 1px -1px var(--sticker-ink), -1px 1px var(--sticker-ink);
}
.stats { display: flex; gap: 6px; }
.stat {
  background: #FFFDF5; color: var(--sticker-ink);
  border: 3px solid var(--sticker-ink); box-shadow: 4px 4px 0 var(--sticker-ink);
  border-radius: 12px; padding: 4px 10px; text-align: center; min-width: 58px;
}
.stat b { display: block; font-family: "Unbounded", var(--font); font-size: 18px; line-height: 1.1; }
.stat small { font-size: 10px; font-weight: 700; text-transform: uppercase; opacity: .7; }
.stat.streak.hot { background: var(--pink); color: #fff; }
.stat.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.18) rotate(3deg); } }

.where {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  margin: -2px 0 6px; padding-bottom: 8px; border-bottom: 1px solid var(--gray-200);
}
.where .pin { font-size: 14px; align-self: center; }
.where b { font-weight: 500; font-size: 18px; line-height: 1.15; }
.where i {
  font-style: normal; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}
.proto-tag {
  position: absolute; top: 150px; left: 12px;
  font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: #fff; background: rgba(31,41,55,.7); border-radius: 4px; padding: 3px 7px;
}

.hud-right {
  position: absolute; top: 100px; right: 12px;
  display: flex; align-items: center; gap: 8px;
  --sticker-ink: #120E24;
}
.clock {
  position: relative; overflow: hidden; min-width: 104px; text-align: center;
  font-family: "Unbounded", var(--font); font-weight: 800; font-size: 26px; line-height: 1;
  font-variant-numeric: tabular-nums; color: var(--sticker-ink);
  background: #FFFDF5; border: 3px solid var(--sticker-ink); box-shadow: 4px 4px 0 var(--sticker-ink);
  border-radius: 14px; padding: 9px 12px 13px; transform: rotate(2deg);
  transition: background .2s, color .2s;
}
.clock .timebar { position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: rgba(18,14,36,.12); }
.clock .timebar div { height: 100%; width: 100%; background: var(--green); transform-origin: left; }
.clock.low { background: var(--red); color: #fff; }
.clock.low .timebar div { background: #fff; }
.clock.frozen { opacity: .85; }
.clock.beat { animation: beat .28s ease-out; }
@keyframes beat { 0% { transform: rotate(2deg) scale(1.14); } 100% { transform: rotate(2deg) scale(1); } }
.mute {
  appearance: none; cursor: pointer; width: 42px; height: 42px; font-size: 18px;
  background: #FFFDF5; border: 3px solid var(--sticker-ink); box-shadow: 3px 3px 0 var(--sticker-ink);
  border-radius: 50%; display: grid; place-items: center; padding: 0;
}
.mute:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 var(--sticker-ink); }

/* ---------- Panel de juego ---------- */
.dock, .sheet {
  position: absolute; left: 10px; right: 10px; bottom: calc(14px + env(safe-area-inset-bottom));
  max-width: 560px; margin: 0 auto;
  background: var(--paper); border-radius: 12px; box-shadow: var(--shadow);
}
.dock {
  padding: 14px 12px 12px;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.1), opacity .25s;
}
.dock.hide { transform: translateY(115%); opacity: 0; pointer-events: none; }
.dock-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.dock h2 {
  margin: 0; font-weight: 600; font-size: clamp(15px, 4.2vw, 19px); line-height: 1.15;
  text-transform: uppercase; letter-spacing: -.01em;
}
.dock h2 em { font-style: normal; color: var(--green-deep); }

.dock-tools { position: relative; display: flex; align-items: center; gap: 6px; flex: none; }

/* Aviso de poco tiempo: invita a pedir pista */
.hint-btn.nudging { background: var(--lime, #D4FF3A); border-color: #120E24; animation: nudge 1s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: scale(1) rotate(0); } 25% { transform: scale(1.1) rotate(-4deg); } 50% { transform: scale(1.1) rotate(4deg); } }
.nudge {
  position: absolute; right: 12px; bottom: calc(100% + 10px); z-index: 3; white-space: nowrap;
  background: #120E24; color: #fff; font-size: 12px; font-weight: 700;
  border-radius: 10px; padding: 8px 11px; box-shadow: var(--shadow);
  animation: nudgein .35s cubic-bezier(.2,1.5,.4,1);
}
.nudge b { color: #D4FF3A; }
.nudge::after {
  content: ""; position: absolute; right: 26px; top: 100%;
  border: 7px solid transparent; border-top-color: #120E24;
}
@keyframes nudgein { from { transform: translateY(8px) scale(.8); opacity: 0; } }

/* Popup de pistas: crece hacia arriba sobre el mapa, todas visibles y sin scroll. */
.picker {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; border-radius: 16px; background: var(--paper);
  display: flex; flex-direction: column; padding: 12px;
  border: 3px solid var(--sticker-ink); box-shadow: 4px 4px 0 var(--sticker-ink), 0 -10px 40px rgba(18,14,36,.35);
  animation: pickerin .22s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pickerin { from { transform: translateY(16px) scale(.97); opacity: 0; } }
.picker[hidden] { display: none; }
.picker-head { display: grid; grid-template-columns: 1fr auto; align-items: center; margin-bottom: 8px; }
.picker-head b { font-weight: 500; font-size: 16px; text-transform: uppercase; }
.picker-head span { grid-row: 2; font-size: 11px; font-weight: 600; color: var(--muted); }
.picker-close {
  grid-row: 1 / 3; grid-column: 2; appearance: none; border: 0; cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px; background: var(--gray-100); font-size: 20px; font-weight: 700;
}
.picker-list { display: grid; gap: 6px; }
.pk {
  appearance: none; cursor: pointer; text-align: left;
  display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center;
  background: var(--paper); border: 1px solid var(--gray-200); border-radius: 10px; padding: 8px 10px;
  transition: border-color .15s, transform .15s;
}
.pk:hover:not(:disabled) { border-color: var(--ink); transform: translateY(-1px); }
.pk:disabled { opacity: .4; cursor: default; }
.pk .ic { width: 34px; height: 34px; border-radius: 8px; background: var(--gray-100); display: grid; place-items: center; font-size: 18px; }
.pk b { display: block; font-weight: 700; font-size: 13px; }
.pk small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); line-height: 1.25; }
.pk .cost { font-weight: 700; font-size: 12px; color: var(--red); white-space: nowrap; }

.hint-btn {
  appearance: none; cursor: pointer; flex: none;
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--gray-100); color: var(--ink); border: 1px solid var(--gray-200);
  border-radius: 8px; padding: 7px 10px; font-size: 12px; font-weight: 700;
  transition: background .15s;
}
.hint-btn:hover { background: var(--gray-200); }
.hint-btn:disabled { opacity: .45; cursor: default; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); }
.dots i.used { background: var(--gray-300); }

.hints { display: grid; gap: 6px; margin-bottom: 10px; }
.hints:empty { display: none; }
.hint {
  display: flex; gap: 8px; align-items: baseline;
  background: var(--gray-50); border: 1px dashed var(--gray-300); border-radius: 8px;
  padding: 7px 10px; font-size: 13px; animation: slidein .3s ease backwards;
}
.hint b { font-weight: 600; }
.hint .k { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); flex: none; }
@keyframes slidein { from { transform: translateY(-6px); opacity: 0; } }

.options {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.options[data-n="4"] { grid-template-columns: repeat(4, 1fr); }
@media (min-width: 560px) {
  .options[data-n="5"], .options[data-n="6"] { grid-template-columns: repeat(var(--n, 3), 1fr); }
}
.opt {
  appearance: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: var(--paper); border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 9px 4px 8px;
  transition: transform .15s, border-color .15s, box-shadow .15s, opacity .25s;
  animation: popin .35s cubic-bezier(.2,1.3,.4,1) backwards;
}
.opt:hover { transform: translateY(-2px); border-color: var(--ink); box-shadow: 0 6px 14px -6px rgba(17,24,39,.35); }
.opt:active { transform: scale(.97); }
.opt .logo { width: 44px; height: 44px; }
.opt span { font-weight: 700; font-size: 12px; line-height: 1.1; text-align: center; }
.opt.out { opacity: .25; pointer-events: none; filter: grayscale(1); }
.opt.out::after { content: ""; }
@keyframes popin { from { transform: translateY(14px); opacity: 0; } }

.logo {
  display: grid; place-items: center; overflow: hidden; border-radius: 8px;
  font-weight: 800; font-size: 11px; color: #fff;
}
.logo img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- Resultado ---------- */
.sheet {
  overflow: hidden;
  transform: translateY(130%); transition: transform .45s cubic-bezier(.2,.9,.3,1.05);
  max-height: calc(100% - 140px); display: flex; flex-direction: column;
}
.sheet.show { transform: none; }
.verdict {
  position: relative; overflow: hidden;
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; color: #fff;
}
.verdict.ok { background: var(--green); }
.verdict.ko { background: var(--red); }
.verdict b { font-weight: 700; font-size: 22px; text-transform: uppercase; letter-spacing: -.01em; }
.verdict span { font-weight: 600; font-size: 15px; font-variant-numeric: tabular-nums; }
/* Brillo tipo animate-shine de nueva-electomania */
.verdict.ok::before {
  content: ""; position: absolute; top: 0; left: -100%; width: 75%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,.35), rgba(255,255,255,0));
  transform: skewX(-25deg); animation: shine 2.4s .3s infinite linear;
}
@keyframes shine { 100% { left: 125%; } }
.sheet.show .verdict b { animation: pop .45s cubic-bezier(.2,1.6,.4,1) .1s backwards; }
@keyframes pop { from { transform: scale(1.6); opacity: 0; } }

.sheet-body { padding: 14px 16px 14px; overflow-y: auto; }
.place { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.flag { width: 20px; height: 52px; object-fit: cover; flex: none; border-radius: 3px; box-shadow: 0 0 0 1px var(--gray-200); }
.sec { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.mun { font-weight: 500; font-size: 20px; line-height: 1.1; }
.geo { font-size: 12px; font-weight: 600; color: var(--muted); }

.bars { display: grid; gap: 6px; margin-bottom: 12px; }
.bar { display: grid; grid-template-columns: 28px 1fr 50px; gap: 8px; align-items: center; }
.bar .logo { width: 28px; height: 28px; border-radius: 6px; font-size: 7px; }
.track { height: 22px; background: var(--gray-100); border-radius: 5px; overflow: hidden; position: relative; }
.fill { height: 100%; width: 0; border-radius: 5px; opacity: .9; transition: width .8s cubic-bezier(.2,.9,.3,1); }
.track label {
  position: absolute; left: 8px; top: 50%; transform: translateY(-50%);
  font-size: 11px; font-weight: 600; color: var(--ink); white-space: nowrap;
  transition: color .25s .45s;   /* espera a que la barra animada cubra el texto */
}
.bar.win .track label { font-weight: 700; }
.track label.on-dark { color: #fff; }
.track label.outside { opacity: 0; animation: label-in .25s .6s forwards; }   /* aparece cuando la barra ya ha crecido */
@keyframes label-in { to { opacity: 1; } }
.track label.outlined {   /* blanco con contorno oscuro cuando no cabe fuera de la barra */
  text-shadow: 1px 0 #111, -1px 0 #111, 0 1px #111, 0 -1px #111,
               1px 1px #111, -1px 1px #111, 1px -1px #111, -1px -1px #111;
}
.pct { font-weight: 600; font-size: 14px; text-align: right; font-variant-numeric: tabular-nums; }
.bar.pick .track label::after {
  content: "TU VOTO"; margin-left: 6px; padding: 1px 5px; border-radius: 3px;
  background: var(--ink); color: #fff; font-size: 8px; letter-spacing: .05em; vertical-align: 1px;
}

.context-title { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.context-title.empty { display: none; }
.context { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.context:empty { display: none; }
.kpi { background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 8px; padding: 7px 8px; }
.kpi .k { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.kpi .v { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 10px; font-weight: 600; }
.kpi .d { color: var(--muted); white-space: nowrap; }

.next {
  appearance: none; cursor: pointer; width: 100%; position: relative; overflow: hidden;
  font-weight: 700; font-size: 16px; text-transform: uppercase; letter-spacing: .04em;
  background: var(--ink); color: #fff; border: 0; border-radius: 8px; padding: 13px;
  transition: background .15s;
}
.next:hover { background: #000; }
.next span { display: inline-block; transition: transform .2s; }
.next:hover span { transform: translateX(5px); }

.brand-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }

[hidden] { display: none !important; }

/* ---------- Efectos ---------- */
.press { animation: press .22s ease; }
@keyframes press { 40% { transform: scale(.92); } 100% { transform: scale(1); } }
.fx { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 5; }
.fx.flash-ko { animation: flashko .5s ease; }
.fx.flash-ok { animation: flashok .6s ease; }
@keyframes flashko { 0% { background: rgba(229,72,77,.45); } 100% { background: transparent; } }
@keyframes flashok { 0% { background: rgba(0,203,137,.35); } 100% { background: transparent; } }
.cf {
  position: absolute; width: 9px; height: 14px; border-radius: 2px;
  animation: confetti var(--d, 1.4s) cubic-bezier(.2,.6,.4,1) forwards;
}
@keyframes confetti {
  0% { transform: translate(0,0) rotate(0); opacity: 1; }
  100% { transform: translate(var(--x), var(--y)) rotate(var(--r)); opacity: 0; }
}
.sheet.shake { animation: shake .45s ease; }
@keyframes shake {
  20% { transform: translateX(-10px); } 40% { transform: translateX(9px); }
  60% { transform: translateX(-6px); } 80% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
  .cf, .sheet.shake, .clock.beat { animation: none; }
}


/* ---------- Animación de coste de pista ---------- */
.penalty {
  position: absolute; left: 50%; top: 42%; z-index: 6; pointer-events: none;
  font-family: "Unbounded", var(--font); font-weight: 800; font-size: clamp(56px, 18vw, 110px);
  line-height: 1; color: #fff; white-space: nowrap;
  background: var(--red); border: 4px solid #120E24; box-shadow: 7px 7px 0 #120E24;
  border-radius: 22px; padding: 12px 22px;
  animation: penalty 1.5s cubic-bezier(.2,.9,.3,1) forwards;
}
.penalty small { font-size: .32em; margin-left: .15em; vertical-align: .9em; }
@keyframes penalty {
  0%   { transform: translate(-50%, -50%) scale(.2) rotate(-14deg); opacity: 0; }
  18%  { transform: translate(-50%, -50%) scale(1.15) rotate(-6deg); opacity: 1; }
  30%  { transform: translate(-50%, -50%) scale(1) rotate(-6deg); }
  70%  { transform: translate(-50%, -50%) scale(1) rotate(-6deg); opacity: 1; }
  100% { transform: translate(-50%, -160%) scale(.5) rotate(-6deg); opacity: 0; }
}
.bonus {
  position: absolute; z-index: 6; pointer-events: none;
  font-family: "Unbounded", var(--font); font-weight: 800; font-size: 26px; color: #120E24;
  background: #D4FF3A; border: 3px solid #120E24; box-shadow: 4px 4px 0 #120E24;
  border-radius: 12px; padding: 6px 12px;
  transition: transform .8s cubic-bezier(.5,0,.3,1), opacity .8s;
  animation: popin .3s cubic-bezier(.2,1.5,.4,1);
}
.shake-screen { animation: shakescreen .35s ease; }
@keyframes shakescreen { 25% { transform: translate(-6px, 3px); } 50% { transform: translate(5px, -3px); } 75% { transform: translate(-3px, 2px); } }
@media (prefers-reduced-motion: reduce) { .penalty, .hint-btn.nudging { animation-duration: .01s; } }

/* ---------- Firma electomanía dentro del logo ---------- */
.byline {
  pointer-events: auto; text-decoration: none; color: var(--sticker-ink);
  display: flex; align-items: center; gap: 4px; margin-top: 6px;
  font-family: var(--font); font-size: 9px; font-weight: 700; letter-spacing: 0; text-transform: none;
}
.byline img { width: 15px; height: 15px; border-radius: 50%; display: block; }

/* ---------- Portada ---------- */
.splash {
  /* Flex + margin:auto centra, pero si la portada no cabe (iframe bajo en
     Android) se alinea arriba y se puede desplazar en vez de cortarse. */
  position: absolute; inset: 0; z-index: 10; overflow-x: hidden; overflow-y: auto;
  display: flex; flex-direction: column; padding: 24px 16px;
  background-color: var(--slate);
  background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 6px 6px;
  color: #fff; transition: opacity .45s, transform .45s;
}
.splash.gone { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash-deco img {
  position: absolute; left: var(--x); top: var(--y); width: 54px; height: 54px;
  border-radius: 12px; opacity: .22; transform: rotate(var(--r));
  animation: drift 7s ease-in-out infinite; animation-delay: var(--d);
}
@keyframes drift { 50% { transform: rotate(calc(var(--r) * -1)) translateY(-12px); } }

.hero { position: relative; display: flex; flex-direction: column; align-items: center; gap: 20px; text-align: center; margin: auto; }
.brand-hero {
  font-size: clamp(34px, 11vw, 58px); padding: 16px 22px 14px; border-radius: 22px; white-space: nowrap;
  border-width: 4px; box-shadow: 7px 7px 0 var(--sticker-ink);
  animation: heroin .6s cubic-bezier(.2,1.5,.4,1) backwards;
}
.brand-hero .byline { font-size: 13px; gap: 6px; margin-top: 12px; }
.brand-hero .byline img { width: 22px; height: 22px; }
@keyframes heroin { from { transform: rotate(-12deg) scale(.6); opacity: 0; } }

.hero-sub { margin: 0; max-width: 300px; font-size: 16px; font-weight: 700; line-height: 1.35; }
.hero-sub b { color: var(--lime); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.steps li {
  display: flex; align-items: center; gap: 6px;
  background: #FFFDF5; color: var(--sticker-ink);
  border: 2px solid var(--sticker-ink); box-shadow: 3px 3px 0 var(--sticker-ink);
  border-radius: 10px; padding: 6px 10px; font-size: 12px; font-weight: 700;
  animation: popin .4s cubic-bezier(.2,1.4,.4,1) backwards;
}
.steps li:nth-child(1) { transform: rotate(-2deg); animation-delay: .15s; }
.steps li:nth-child(2) { transform: rotate(1.5deg); animation-delay: .25s; }
.steps li:nth-child(3) { transform: rotate(-1deg); animation-delay: .35s; }
.steps span { font-size: 15px; }
.splash-msg { margin: 0; font-weight: 600; font-size: 13px; color: #d1d5db; }

.play {
  appearance: none; cursor: pointer;
  font-family: "Unbounded", var(--font); font-weight: 800; font-size: 26px; text-transform: uppercase;
  color: #fff; background: var(--pink); border: 4px solid var(--sticker-ink); box-shadow: 6px 6px 0 var(--sticker-ink);
  border-radius: 18px; padding: 14px 48px; transform: rotate(-2deg);
  animation: breathe 1.6s ease-in-out infinite;
}
.play:active { transform: rotate(-2deg) translate(4px,4px); box-shadow: 2px 2px 0 var(--sticker-ink); }
@keyframes breathe { 50% { transform: rotate(-2deg) scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .splash-deco img, .play { animation: none; } }

/* ---------- Nivel y progreso ---------- */
.level-pill {
  position: absolute; top: 110px; left: 12px;
  display: flex; align-items: center; gap: 6px;
  background: #120E24; color: #fff; border-radius: 999px; padding: 5px 10px 5px 6px;
  box-shadow: var(--shadow);
}
.level-pill b {
  font-family: "Unbounded", var(--font); font-size: 10px; font-weight: 800; text-transform: uppercase;
  background: var(--pink); border-radius: 999px; padding: 3px 7px;
}
.level-pill > span:not(.qdots) { font-size: 11px; font-weight: 700; }
.qdots { display: inline-flex; gap: 3px; margin-left: 2px; }
.qdots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.25); }
.qdots i.ok { background: var(--green); }
.qdots i.ko { background: var(--red); }
.qdots i.now { background: #fff; box-shadow: 0 0 0 2px rgba(255,255,255,.35); }
.next em { font-style: normal; }

/* ---------- Resumen de ronda y compartir ---------- */
.overlay {
  position: absolute; inset: 0; z-index: 8;
  display: grid; place-items: center; padding: 14px;
  background: rgba(18,14,36,.72); backdrop-filter: blur(3px);
  animation: fadein .25s ease;
}
@keyframes fadein { from { opacity: 0; } }
.ov-card {
  width: 100%; max-width: 440px; max-height: 100%; overflow-y: auto;
  background: var(--paper); border-radius: 16px; padding: 18px 16px 16px;
  border: 3px solid #120E24; box-shadow: 6px 6px 0 #120E24;
  animation: popin .4s cubic-bezier(.2,1.4,.4,1);
}
.sum-head { text-align: center; margin-bottom: 12px; }
.sum-head small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sum-head h3 {
  margin: 6px auto 0; display: inline-block;
  font-family: "Unbounded", var(--font); font-weight: 800; font-size: 24px; text-transform: uppercase;
  background: var(--lime); border: 3px solid #120E24; box-shadow: 4px 4px 0 #120E24;
  border-radius: 12px; padding: 6px 14px; transform: rotate(-2deg);
}
.sum-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 12px; }
.sum-stats div { text-align: center; background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 10px; padding: 8px 4px; }
.sum-stats b { display: block; font-family: "Unbounded", var(--font); font-weight: 800; font-size: 22px; }
.sum-stats small { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.sum-list { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; }
.sum-list li {
  display: grid; grid-template-columns: 26px 1fr 34px; gap: 10px; align-items: center;
  border: 1px solid var(--gray-200); border-radius: 10px; padding: 7px 9px;
  animation: slidein .3s ease backwards;
}
.sum-list .mark { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; }
.sum-list .mark.ok { background: var(--green); }
.sum-list .mark.ko { background: var(--red); }
.sum-list b { display: block; font-weight: 700; font-size: 14px; line-height: 1.15; }
.sum-list small { display: block; font-size: 11px; font-weight: 600; color: var(--muted); }
.sum-list .logo { width: 34px; height: 34px; border-radius: 7px; font-size: 8px; }
.sum-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.ghost {
  appearance: none; cursor: pointer; font-weight: 700; font-size: 14px;
  background: var(--paper); color: var(--ink); border: 2px solid var(--ink); border-radius: 8px; padding: 10px;
}
.ghost:hover { background: var(--gray-100); }

.share-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.share-head b { font-weight: 800; font-size: 16px; text-transform: uppercase; }
.share-preview {
  background: var(--gray-100); border-radius: 10px; padding: 8px; margin-bottom: 10px;
  display: grid; place-items: center; min-height: 180px;
}
.share-preview img { width: 100%; max-width: 300px; aspect-ratio: 1080 / 1350; border-radius: 8px; box-shadow: var(--shadow); }
.share-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 10px; }
.sn {
  appearance: none; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px;
  border: 0; border-radius: 10px; padding: 9px 2px 7px; color: #fff; font-size: 18px; font-weight: 800;
  transition: transform .12s;
}
.sn:hover { transform: translateY(-2px); }
.sn span { font-size: 10px; font-weight: 700; }
.sn-native { background: var(--ink); }
.sn-x { background: #000; }
.sn-bsky { background: #1185FE; }
.sn-ig { background: linear-gradient(45deg, #F58529, #DD2A7B 50%, #8134AF); }
.sn-threads { background: #101010; }
.sn-fb { background: #1877F2; font-family: Georgia, serif; }
.sn-wa { background: #25D366; }
.sn-copy { background: var(--slate-2); }
.share-note { margin: 8px 0 0; min-height: 1em; font-size: 12px; font-weight: 600; color: var(--muted); text-align: center; }
.splash-best { margin: 0; font-size: 13px; font-weight: 700; color: var(--lime); }

/* ---------- Selector de idioma ---------- */
.langs {
  position: absolute; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 2;
  display: flex; gap: 4px; background: rgba(18,14,36,.55); border-radius: 999px; padding: 4px;
}
.langs button {
  appearance: none; cursor: pointer; border: 0; border-radius: 999px; padding: 6px 10px;
  font-family: "Unbounded", var(--font); font-size: 11px; font-weight: 800; color: #fff; background: transparent;
}
.langs button[aria-pressed="true"] { background: var(--lime); color: var(--sticker-ink); }
.steps em, .hint-btn em { font-style: normal; }

/* "Street Votes WHAT?" es más largo que "Calle vota qué?": se compacta en inglés */
.brand-t { white-space: nowrap; }
:lang(en) .top .brand { font-size: 19px; }
:lang(en) .brand-hero { font-size: clamp(26px, 8.4vw, 50px); }

/* ---------- Modo España / Mundo ---------- */
.modes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 340px; }
.mode {
  appearance: none; cursor: pointer; display: grid; justify-items: center; gap: 1px;
  background: rgba(255,255,255,.08); color: #fff; border: 3px solid transparent; border-radius: 14px;
  padding: 9px 6px 8px; transition: transform .15s, background .15s;
}
.mode span { font-size: 22px; line-height: 1.1; }
.mode b { font-family: "Unbounded", var(--font); font-weight: 800; font-size: 14px; text-transform: uppercase; }
.mode small { font-size: 10px; font-weight: 700; opacity: .75; }
.mode[aria-pressed="true"] {
  background: #FFFDF5; color: var(--sticker-ink); border-color: var(--sticker-ink);
  box-shadow: 4px 4px 0 var(--sticker-ink); transform: rotate(-1.5deg);
}
.scopes { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 340px; }
.scope {
  appearance: none; cursor: pointer; border: 2px solid rgba(255,255,255,.35); background: transparent; color: #fff;
  border-radius: 999px; padding: 5px 11px; font-family: var(--font); font-size: 12px; font-weight: 700;
}
.scope[aria-pressed="true"] { background: var(--lime); color: var(--sticker-ink); border-color: var(--sticker-ink); }
.flag-intl { width: 52px; height: 39px; object-fit: cover; flex: none; border-radius: 6px; box-shadow: 0 0 0 1px rgba(18,14,36,.18); }
.flag-intl[hidden] { display: none; }
.flag-mini { width: 16px; height: 12px; border-radius: 2px; vertical-align: -1px; box-shadow: 0 0 0 1px rgba(18,14,36,.18); }
.opt small { font-size: 10px; font-weight: 600; color: var(--muted); margin-top: -4px; }

.brand-t > span { white-space: nowrap; }
/* Unbounded solo se carga en 600/700: los títulos quedan en 700 */
.brand, .stat b, .clock, .play, .sum-head h3, .sum-stats b, .penalty, .bonus, .mode b, .langs button { font-weight: 700; }

.scope-select {
  appearance: none; -webkit-appearance: none; cursor: pointer; max-width: 100%;
  border: 2px solid rgba(255,255,255,.35); background: transparent; color: #fff;
  border-radius: 999px; padding: 5px 30px 5px 12px; font-family: var(--font); font-size: 12px; font-weight: 700;
  background-image: linear-gradient(45deg, transparent 50%, #fff 50%), linear-gradient(135deg, #fff 50%, transparent 50%);
  background-position: calc(100% - 15px) 50%, calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.scope-select[aria-pressed="true"] { background-color: var(--lime); color: var(--sticker-ink); border-color: var(--sticker-ink);
  background-image: linear-gradient(45deg, transparent 50%, #120E24 50%), linear-gradient(135deg, #120E24 50%, transparent 50%); }
.scope-select option, .scope-select optgroup { color: #120E24; background: #fff; }

/* Mapa de situación: país + provincia/región resaltada + punto. Toca para ampliar. */
.locator {
  position: absolute; top: 166px; right: 12px; z-index: 5;
  width: 96px; height: 96px; padding: 5px; cursor: pointer;
  background: #FFFDF5; border: 3px solid var(--sticker-ink); box-shadow: 3px 3px 0 var(--sticker-ink);
  border-radius: 14px; transform: rotate(-2deg);
  transition: width .25s ease, height .25s ease, transform .25s ease;
}
.locator.big { width: 210px; height: 210px; transform: rotate(0); }
.locator svg { width: 100%; height: 100%; display: block; overflow: visible; }
.locator .lc-country { fill: #E8E4F3; stroke: var(--sticker-ink); stroke-width: 1.3; stroke-linejoin: round; }
.locator .lc-borders { fill: none; stroke: #A9A2C2; stroke-width: .6; }
.locator .lc-region { fill: var(--pink); stroke: var(--sticker-ink); stroke-width: .8; stroke-linejoin: round; }
.locator .lc-inset-bg { fill: #FFFDF5; stroke: var(--sticker-ink); stroke-width: 1; }
.locator .lc-dot { fill: var(--lime); stroke: var(--sticker-ink); stroke-width: 1.6; }
.locator .lc-ring { fill: none; stroke: var(--sticker-ink); stroke-width: 1.2; transform-box: fill-box; transform-origin: center; animation: lc-pulse 1.6s ease-out infinite; }
.locator * { vector-effect: non-scaling-stroke; }
@keyframes lc-pulse { from { transform: scale(.4); opacity: .9; } to { transform: scale(2.2); opacity: 0; } }

/* Referencia de calle dentro de la sección (CartoCiudad), con aire de placa de calle. */
.where .street-row { flex-basis: 100%; margin-top: 2px; }
.where .street-row[hidden] { display: none; }
.where .street {
  display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12px; font-weight: 600; line-height: 1; color: #1B2A6B;
  background: #fff; border: 2px solid #1B2A6B; border-radius: 5px; padding: 4px 8px;
  box-shadow: inset 0 0 0 1.5px #fff, inset 0 0 0 2.5px rgba(27,42,107,.35);
}

/* Modo Friki: interruptor en portada + gafas en la píldora de nivel. */
.nerd-toggle {
  appearance: none; cursor: pointer; display: flex; align-items: center; gap: 10px; text-align: left;
  width: 100%; max-width: 340px; padding: 8px 12px; border-radius: 14px;
  border: 2px solid rgba(255,255,255,.35); background: transparent; color: #fff; font-family: var(--font);
  transition: background .2s, border-color .2s, color .2s;
}
.nerd-toggle .nerd-glasses { width: 46px; flex: none; filter: drop-shadow(0 0 0 #fff); }
.nerd-toggle > span:not(.sw) { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nerd-toggle b { font-family: "Unbounded", var(--font); font-weight: 700; font-size: 13px; text-transform: uppercase; }
.nerd-toggle small { font-size: 10.5px; font-weight: 600; opacity: .75; }
.nerd-toggle .sw { width: 38px; height: 22px; border-radius: 999px; background: rgba(255,255,255,.25); position: relative; flex: none; transition: background .2s; }
.nerd-toggle .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s; }
.nerd-toggle[aria-pressed="true"] { background: var(--lime); color: var(--sticker-ink); border-color: var(--sticker-ink); box-shadow: 3px 3px 0 var(--sticker-ink); }
.nerd-toggle[aria-pressed="true"] .sw { background: var(--sticker-ink); }
.nerd-toggle[aria-pressed="true"] .sw::after { transform: translateX(16px); background: var(--lime); }
.nerd-toggle[aria-pressed="true"] .nerd-glasses { animation: nerd-pop .35s ease-out; }
@keyframes nerd-pop { 40% { transform: scale(1.25) rotate(-8deg); } }
.nerd-badge { display: inline-flex; background: var(--lime); border-radius: 999px; padding: 3px 5px; }
.nerd-badge[hidden] { display: none; }
.nerd-badge .nerd-glasses { width: 26px; height: auto; }

/* Puntos en juego de la pregunta actual (bajan al pedir pistas). */
.stake {
  display: inline-flex; flex-direction: column; align-items: center; line-height: 1;
  background: var(--sticker-ink); color: var(--lime); border-radius: 10px; padding: 4px 9px 5px;
  transition: color .2s;
}
.stake > span { font-size: 8.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #fff; opacity: .75; }
.stake b { font-family: "Unbounded", var(--font); font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.stake.low { color: #FF8A8E; }
.stake.bump { animation: stakebump .45s ease-out; }
@keyframes stakebump { 30% { transform: scale(1.25); } }

/* Resumen de nivel: igual que el tarjetón (minimapa, tu respuesta vs la real) + pistas usadas. */
.sum-list li { grid-template-columns: 26px 46px 1fr auto; gap: 9px; }
.sum-map.locator {
  position: static; width: 46px; height: 46px; padding: 3px; transform: none; cursor: default;
  border-width: 2px; border-radius: 9px; box-shadow: none; transition: none;
}
.sum-map .lc-ring { display: none; }
.sum-txt { min-width: 0; }
.sum-txt b, .sum-txt small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum-hints { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.sum-hints i { font-style: normal; font-size: 10px; font-weight: 700; color: var(--red); background: #FDECEC; border-radius: 999px; padding: 1px 6px; }
.sum-vs { display: flex; align-items: center; gap: 4px; }
.sum-vs .vs { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sum-vs .vs small { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.sum-vs .you { position: relative; }
.sum-vs .you .logo { opacity: .5; }
.sum-vs .you::after {
  content: ""; position: absolute; left: 3px; right: 3px; top: 16px; height: 3px; border-radius: 2px;
  background: var(--red); transform: rotate(-45deg);
}
.sum-vs .vs-time { background: var(--gray-100); display: grid; place-items: center; font-size: 16px; }
.sum-vs .arrow { font-weight: 800; font-size: 14px; color: var(--ink); margin-bottom: 12px; }

/* Elección de referencia encima de la pregunta. */
.q-wrap { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.election {
  align-self: flex-start; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--sticker-ink); background: var(--lime); border-radius: 999px; padding: 2px 8px;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}

/* Portada compacta en pantallas bajas (iframe en móvil con barras del navegador). */
@media (max-height: 720px) {
  .splash { padding: 14px 16px; }
  .hero { gap: 11px; }
  .brand-hero { font-size: clamp(30px, 9vw, 44px); padding: 12px 18px 10px; }
  :lang(en) .brand-hero { font-size: clamp(24px, 7.4vw, 40px); }
  .brand-hero .byline { margin-top: 8px; }
  .hero-sub { font-size: 14px; }
  .mode { padding: 6px 6px 5px; }
  .mode span { font-size: 18px; }
  .nerd-toggle { padding: 5px 12px; }
  .steps { gap: 6px; }
  .steps li { padding: 4px 8px; font-size: 11px; }
  .steps span { font-size: 13px; }
  .play { font-size: 22px; padding: 10px 40px; }
}
