:root {
  --fondo: #fbf7f2;
  --fondo-2: #f3ece3;
  --panel: #ffffff;
  --borde: #e6dccf;
  --texto: #1d1a17;
  --suave: #6f665c;
  --rojo: #d4212f;
  --rojo-oscuro: #a3121e;
  --ambar: #f59e0b;
  --verde: #15803d;
  --verde-suave: #dcfce7;
  --rojo-suave: #fee2e2;
  --agua: #0ea5e9;
  --sombra: 0 1px 2px rgba(40, 20, 0, .06), 0 6px 20px rgba(40, 20, 0, .06);
  --radio: 16px;
  --titulo: "Bebas Neue", Impact, "Arial Narrow", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #14110f; --fondo-2: #1c1815; --panel: #211c18; --borde: #3a322b;
    --texto: #f5efe8; --suave: #b3a79a; --rojo: #ef4444; --rojo-oscuro: #b91c1c;
    --verde: #4ade80; --verde-suave: #12321f; --rojo-suave: #3b1417;
    --sombra: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --fondo: #14110f; --fondo-2: #1c1815; --panel: #211c18; --borde: #3a322b;
  --texto: #f5efe8; --suave: #b3a79a; --rojo: #ef4444; --rojo-oscuro: #b91c1c;
  --verde: #4ade80; --verde-suave: #12321f; --rojo-suave: #3b1417;
  --sombra: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--fondo); color: var(--texto); font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--rojo); }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--titulo); font-weight: 400; letter-spacing: .02em; line-height: 1.05; margin: 0 0 .4em; }
h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.45rem; }
main { max-width: 1180px; margin: 0 auto; padding: 20px 16px 40px; outline: none; min-height: 70vh; }

/* ---------- Cabecera ---------- */
.cabecera { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; background: color-mix(in srgb, var(--fondo) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 3px solid var(--rojo); }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); }
.marca-luz { width: 14px; height: 14px; border-radius: 50%; background: var(--rojo); box-shadow: 0 0 0 0 var(--rojo); animation: rotativo 1.1s infinite; }
@keyframes rotativo { 0%,49% { background: var(--rojo); box-shadow: 0 0 14px 4px color-mix(in srgb, var(--rojo) 60%, transparent); } 50%,100% { background: #2563eb; box-shadow: 0 0 14px 4px rgba(37,99,235,.5); } }
.marca-texto { font-family: var(--titulo); font-size: 2rem; color: var(--rojo); line-height: 1; }
.marca-sub { font-size: .72rem; color: var(--suave); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; max-width: 9em; line-height: 1.15; }
.menu { display: flex; gap: 4px; flex-wrap: wrap; }
.menu a { text-decoration: none; color: var(--texto); font-weight: 600; font-size: .92rem; padding: 7px 11px; border-radius: 999px; }
.menu a:hover { background: var(--fondo-2); }
.menu a.activo { background: var(--rojo); color: #fff; }
.herramientas { display: flex; align-items: center; gap: 8px; margin-left: auto; flex: 1 1 260px; justify-content: flex-end; }
.buscador { display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1.5px solid var(--borde); border-radius: 999px; padding: 6px 12px; flex: 1; max-width: 380px; }
.buscador:focus-within { border-color: var(--rojo); }
.buscador input { border: 0; background: none; outline: none; width: 100%; min-width: 0; }
.buscador kbd { font-size: .72rem; color: var(--suave); border: 1px solid var(--borde); border-radius: 5px; padding: 0 5px; }
.icono { background: var(--panel); border: 1.5px solid var(--borde); border-radius: 50%; width: 38px; height: 38px; cursor: pointer; font-size: 1.05rem; flex: none; }

/* ---------- Piezas comunes ---------- */
.panel { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--sombra); padding: 20px; }
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 12px 18px; font-weight: 700; cursor: pointer; text-decoration: none; transition: transform .08s, filter .15s; }
.boton:active { transform: translateY(1px) scale(.99); }
.boton:disabled { opacity: .5; cursor: default; }
.boton.rojo { background: var(--rojo); color: #fff; box-shadow: 0 4px 0 var(--rojo-oscuro); }
.boton.rojo:hover { filter: brightness(1.07); }
.boton.claro { background: var(--fondo-2); color: var(--texto); border: 1px solid var(--borde); }
.boton.grande { font-size: 1.15rem; padding: 16px 24px; }
.chip { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--fondo-2); color: var(--suave); border: 1px solid var(--borde); }
.chip.rojo { background: var(--rojo-suave); color: var(--rojo); border-color: transparent; }
.chip.verde { background: var(--verde-suave); color: var(--verde); border-color: transparent; }
.suave { color: var(--suave); }
.rejilla { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.fila { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.migas { font-size: .9rem; margin-bottom: 10px; }
.migas a { text-decoration: none; }
mark { background: color-mix(in srgb, var(--ambar) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 2px; }
.vacio { text-align: center; padding: 40px 16px; color: var(--suave); }
.vacio .grande-emoji { font-size: 3.5rem; display: block; margin-bottom: 8px; }

/* ---------- Parque (inicio) ---------- */
.hero { position: relative; overflow: hidden; border-radius: 24px; padding: 28px 24px; color: #fff; background: radial-gradient(circle at 85% 20%, #ff7a18 0, transparent 45%), linear-gradient(135deg, #b3121f, #6d0a12 70%); box-shadow: var(--sombra); display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: center; }
.hero h1 { color: #fff; margin-bottom: .15em; }
.hero p { margin: 0 0 14px; color: #ffe4e1; max-width: 46ch; }
.hero .boton.rojo { background: #fff; color: var(--rojo-oscuro); box-shadow: 0 4px 0 #f2c2c2; }
.hero .boton.claro { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }
.camion { width: 100%; max-width: 380px; justify-self: center; filter: drop-shadow(0 10px 14px rgba(0,0,0,.35)); }
.camion .baliza-a { animation: baliza 0.8s infinite; }
.camion .baliza-b { animation: baliza 0.8s infinite .4s; }
@keyframes baliza { 0%,49% { opacity: 1; } 50%,100% { opacity: .15; } }
.camion .rueda { transform-box: fill-box; transform-origin: center; animation: girar 1s linear infinite; }
.hero.en-marcha .camion { animation: arrancar .6s ease-in-out infinite alternate; }
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes arrancar { from { transform: translateX(-4px); } to { transform: translateX(4px); } }
.rango { display: flex; align-items: center; gap: 12px; background: rgba(0,0,0,.22); border-radius: 14px; padding: 10px 14px; margin: 14px 0; max-width: 460px; }
.rango-emoji { font-size: 2rem; }
.rango-nombre { font-family: var(--titulo); font-size: 1.5rem; line-height: 1; }
.barra-xp { height: 8px; background: rgba(255,255,255,.2); border-radius: 99px; overflow: hidden; margin-top: 5px; }
.barra-xp > i { display: block; height: 100%; background: linear-gradient(90deg, #ffd166, #ff9f1c); border-radius: 99px; transition: width .6s; }
.rango small { color: #ffd9d3; }

.cifras { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.cifra { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px 16px; box-shadow: var(--sombra); }
.cifra b { display: block; font-family: var(--titulo); font-size: 2.2rem; line-height: 1; color: var(--rojo); }
.cifra span { font-size: .85rem; color: var(--suave); font-weight: 600; }

.mapa-titulo { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.mapa { display: grid; grid-template-columns: repeat(10, 1fr); gap: 8px; }
.foco { position: relative; aspect-ratio: 1; border-radius: 12px; border: 1px solid var(--borde); background: var(--panel); display: grid; place-items: center; text-decoration: none; color: var(--texto); font-size: 1.5rem; transition: transform .12s; }
.foco:hover { transform: translateY(-2px) scale(1.05); z-index: 1; box-shadow: var(--sombra); }
.foco .num { position: absolute; top: 3px; left: 6px; font-size: .68rem; font-weight: 800; color: var(--suave); }
.foco.ardiendo .llama { display: inline-block; animation: llama 1.3s ease-in-out infinite alternate; transform-origin: 50% 90%; }
.foco.ardiendo:nth-child(3n) .llama { animation-duration: 1.05s; }
.foco.ardiendo:nth-child(4n) .llama { animation-duration: 1.6s; }
@keyframes llama { from { transform: scale(.9) rotate(-5deg); filter: saturate(1); } to { transform: scale(1.12) rotate(5deg); filter: saturate(1.5); } }
.foco.controlado { background: color-mix(in srgb, var(--ambar) 16%, var(--panel)); }
.foco.apagado { background: var(--verde-suave); border-color: transparent; }
.foco.sin-datos { opacity: .45; }
.leyenda { display: flex; gap: 14px; flex-wrap: wrap; font-size: .85rem; color: var(--suave); }

.dos-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.oposicion-datos li { margin: 4px 0; }

/* ---------- Temario ---------- */
.filtros { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 18px; }
.filtros button { border: 1.5px solid var(--borde); background: var(--panel); border-radius: 999px; padding: 6px 14px; cursor: pointer; font-weight: 600; font-size: .9rem; }
.filtros button.activo { background: var(--texto); color: var(--fondo); border-color: var(--texto); }
.tarjeta-tema { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--texto); background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); transition: transform .12s, border-color .12s; }
.tarjeta-tema:hover { transform: translateY(-2px); border-color: var(--rojo); }
.tarjeta-tema .emoji { font-size: 2rem; line-height: 1; }
.tarjeta-tema h3 { font-family: Inter, sans-serif; font-weight: 700; font-size: 1rem; letter-spacing: 0; margin: 2px 0 6px; line-height: 1.3; }
.tarjeta-tema .meta { display: flex; gap: 6px; flex-wrap: wrap; }
.anillo { --p: 0; flex: none; width: 46px; height: 46px; border-radius: 50%; background: conic-gradient(var(--verde) calc(var(--p) * 1%), var(--fondo-2) 0); display: grid; place-items: center; margin-left: auto; }
.anillo span { width: 36px; height: 36px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: .72rem; font-weight: 800; }

/* ---------- Tema ---------- */
.tema-cab { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.tema-cab .emoji-grande { font-size: 4rem; line-height: 1; filter: drop-shadow(0 4px 6px rgba(0,0,0,.15)); }
.tema-cab .acciones { margin-left: auto; }
.indice { display: flex; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.indice a { text-decoration: none; font-weight: 600; font-size: .88rem; padding: 6px 12px; border-radius: 999px; background: var(--fondo-2); color: var(--texto); border: 1px solid var(--borde); }
.seccion { margin-top: 26px; scroll-margin-top: 90px; }
.resumen p { margin: 0 0 1em; max-width: 72ch; }
.claves { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.claves li { background: var(--panel); border: 1px solid var(--borde); border-left: 5px solid var(--rojo); border-radius: 10px; padding: 10px 12px; font-weight: 500; }
.nota-caja { border-radius: var(--radio); padding: 16px 18px; display: flex; gap: 14px; align-items: flex-start; }
.nota-caja .emoji { font-size: 1.8rem; line-height: 1; }
.nota-caja.truco { background: color-mix(in srgb, var(--ambar) 18%, var(--panel)); border: 1px dashed var(--ambar); }
.nota-caja.curiosidad { background: color-mix(in srgb, var(--agua) 14%, var(--panel)); border: 1px dashed var(--agua); }
.nota-caja p { margin: 2px 0 0; }
details.oficial { background: var(--fondo-2); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 16px; }
details.oficial summary { cursor: pointer; font-weight: 700; }
details.oficial p { font-size: .92rem; color: var(--suave); margin: 10px 0 0; }
.fuentes { padding-left: 1.1em; }

/* ---------- Videos ---------- */
.videos { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.video { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.video-marco { position: relative; aspect-ratio: 16/9; background: #000; }
.video-marco button { position: absolute; inset: 0; width: 100%; border: 0; padding: 0; cursor: pointer; background: #000; }
.video-marco img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: .92; transition: opacity .15s, transform .3s; }
.video-marco button:hover img { opacity: 1; transform: scale(1.03); }
.video-marco .play { position: absolute; left: 50%; top: 50%; translate: -50% -50%; width: 68px; height: 48px; border-radius: 14px; background: var(--rojo); display: grid; place-items: center; color: #fff; font-size: 1.4rem; box-shadow: 0 6px 18px rgba(0,0,0,.4); }
.video-marco iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-info { padding: 12px 14px 14px; }
.video-info b { display: block; line-height: 1.3; }
.video-info .canal { font-size: .82rem; color: var(--suave); font-weight: 600; margin: 3px 0 6px; }
.video-info p { margin: 0; font-size: .9rem; }
.video.visto .video-info b::after { content: " ✓"; color: var(--verde); }

/* ---------- Test ---------- */
.test { max-width: 820px; margin: 0 auto; }
.test-cab { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.progreso { flex: 1 1 200px; height: 10px; background: var(--fondo-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--borde); }
.progreso > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ambar), var(--rojo)); transition: width .35s; }
.combo { font-weight: 800; color: var(--rojo); min-width: 5.5em; text-align: right; }
.combo.caliente { animation: latir .5s ease-in-out infinite alternate; }
@keyframes latir { to { transform: scale(1.12); } }
.reloj { font-family: var(--titulo); font-size: 1.6rem; padding: 0 10px; border-radius: 8px; background: var(--fondo-2); }
.reloj.poco { background: var(--rojo); color: #fff; animation: latir .5s infinite alternate; }
.pregunta { position: relative; }
.pregunta .origen { font-size: .8rem; font-weight: 700; color: var(--suave); text-decoration: none; }
.pregunta h2 { font-family: Inter, sans-serif; font-weight: 700; font-size: clamp(1.1rem, 2.4vw, 1.35rem); letter-spacing: 0; line-height: 1.4; margin: 8px 0 16px; }
.opciones { display: grid; gap: 10px; }
.opcion { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; background: var(--panel); border: 2px solid var(--borde); border-radius: 14px; padding: 14px 16px; cursor: pointer; font-weight: 500; transition: border-color .12s, background .12s, transform .08s; }
.opcion:hover:not(:disabled) { border-color: var(--rojo); }
.opcion .letra { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--fondo-2); display: grid; place-items: center; font-weight: 800; font-size: .9rem; }
.opcion.bien { border-color: var(--verde); background: var(--verde-suave); }
.opcion.bien .letra { background: var(--verde); color: #fff; }
.opcion.mal { border-color: var(--rojo); background: var(--rojo-suave); }
.opcion.mal .letra { background: var(--rojo); color: #fff; }
.opcion.elegida { border-color: var(--texto); }
.opcion.elegida .letra { background: var(--texto); color: var(--fondo); }
.opcion:disabled { cursor: default; }
.temblor { animation: temblor .35s; }
@keyframes temblor { 20%,60% { transform: translateX(-7px); } 40%,80% { transform: translateX(7px); } }
.explicacion { margin-top: 14px; border-radius: 12px; padding: 12px 14px; background: var(--fondo-2); border: 1px solid var(--borde); }
.explicacion b { display: block; margin-bottom: 3px; }
.test-pie { display: flex; justify-content: space-between; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.navegador { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 18px; }
.navegador button { width: 34px; height: 30px; border-radius: 7px; border: 1px solid var(--borde); background: var(--panel); font-size: .78rem; font-weight: 700; cursor: pointer; }
.navegador button.hecha { background: var(--texto); color: var(--fondo); }
.navegador button.actual { outline: 2px solid var(--rojo); outline-offset: 1px; }

.resultado { text-align: center; }
.resultado .nota { font-family: var(--titulo); font-size: clamp(4rem, 12vw, 7rem); line-height: 1; color: var(--rojo); }
.resultado .nota.apto { color: var(--verde); }
.repaso { text-align: left; margin-top: 24px; display: grid; gap: 10px; }
.repaso .item { background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.repaso .item.mal { border-left: 5px solid var(--rojo); }
.repaso .item.blanco { border-left: 5px solid var(--suave); }
.repaso .item p { margin: 4px 0; }

/* ---------- Fisicas ---------- */
.fisicas { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.prueba { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); }
.prueba h3 { display: flex; align-items: center; gap: 8px; }
.prueba label { display: block; font-size: .85rem; font-weight: 600; color: var(--suave); margin-bottom: 4px; }
.prueba input[type="text"] { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1.5px solid var(--borde); background: var(--fondo); font-size: 1.1rem; font-weight: 700; }
.prueba input:focus { outline: none; border-color: var(--rojo); }
.prueba .limite { font-size: .8rem; color: var(--suave); margin: 6px 0 0; }
.medidor { height: 12px; border-radius: 99px; background: var(--fondo-2); margin-top: 12px; overflow: hidden; position: relative; }
.medidor > i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--rojo), var(--ambar) 50%, var(--verde)); transition: width .4s; }
.veredicto { margin-top: 8px; font-weight: 800; font-size: 1.05rem; }
.veredicto.apto { color: var(--verde); }
.veredicto.no-apto { color: var(--rojo); }
.sexo { display: inline-flex; border: 1.5px solid var(--borde); border-radius: 999px; overflow: hidden; }
.sexo button { border: 0; background: var(--panel); padding: 8px 16px; cursor: pointer; font-weight: 700; }
.sexo button.activo { background: var(--rojo); color: #fff; }
.total-fisicas { position: sticky; bottom: 10px; margin-top: 18px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.total-fisicas b { font-family: var(--titulo); font-size: 2.6rem; line-height: 1; }

/* ---------- Buscador ---------- */
.resultados h3 { margin-top: 24px; }
.res { display: block; text-decoration: none; color: var(--texto); background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; }
.res:hover { border-color: var(--rojo); }
.res small { color: var(--suave); font-weight: 700; }
.res p { margin: 4px 0 0; font-size: .93rem; }
.res details summary { cursor: pointer; font-weight: 600; }

/* ---------- Avisos y efectos ---------- */
.aviso { position: fixed; left: 50%; bottom: 22px; translate: -50% 20px; background: var(--texto); color: var(--fondo); padding: 12px 18px; border-radius: 12px; font-weight: 700; opacity: 0; pointer-events: none; transition: opacity .25s, translate .25s; z-index: 50; max-width: calc(100vw - 32px); text-align: center; box-shadow: var(--sombra); }
.aviso.visible { opacity: 1; translate: -50% 0; }
.lluvia { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.lluvia span { position: absolute; top: -40px; font-size: 1.6rem; animation: caer linear forwards; }
@keyframes caer { to { transform: translateY(110vh) rotate(var(--giro, 180deg)); } }
.salpicadura { position: absolute; pointer-events: none; font-size: 1.3rem; animation: salpicar .7s ease-out forwards; }
@keyframes salpicar { to { transform: translate(var(--dx), var(--dy)) scale(.4); opacity: 0; } }

.pie { border-top: 1px solid var(--borde); padding: 20px 16px 30px; text-align: center; font-size: .82rem; color: var(--suave); }
.pie p { max-width: 780px; margin: 0 auto; }
.pie p + p { margin-top: 6px; }

[hidden] { display: none !important; }

/* ---------- Premium, candados y cuenta ---------- */
.boton-premium { text-decoration: none; font-weight: 800; font-size: .88rem; padding: 7px 12px; border-radius: 999px; background: linear-gradient(135deg, #ffd166, #ff9f1c); color: #3a2200; white-space: nowrap; box-shadow: 0 2px 0 #c77a00; }
.boton-premium:hover { filter: brightness(1.05); }
.icono.con-texto { width: auto; border-radius: 999px; padding: 0 12px; font-weight: 700; font-size: .88rem; text-decoration: none; display: inline-grid; place-items: center; color: var(--texto); }
a.icono { display: inline-grid; place-items: center; text-decoration: none; color: var(--texto); }
.candado { max-width: 640px; margin: 20px auto; text-align: center; }
.candado-icono { font-size: 3.6rem; display: block; animation: latir .9s ease-in-out infinite alternate; }
.ventajas { list-style: none; padding: 0; margin: 16px 0; display: grid; gap: 10px; text-align: left; }
.ventajas li { display: flex; gap: 12px; align-items: flex-start; }
.ventajas li > span { font-size: 1.5rem; line-height: 1.2; }
.ventajas b { display: block; }
.ventajas small { color: var(--suave); }
.hero-premium { background: radial-gradient(circle at 85% 20%, #ffd16655 0, transparent 45%), linear-gradient(135deg, #3a2200, #1d1208 75%); }
.hero-premium p { color: #f5e6c8; }
.planes { display: grid; gap: 12px; }
.plan { background: #fff; color: #1d1a17; border-radius: 16px; padding: 16px 18px; display: grid; gap: 4px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.plan h3 { font-family: Inter, sans-serif; font-weight: 800; letter-spacing: 0; font-size: 1.1rem; margin: 4px 0 0; }
.plan .precio { font-family: var(--titulo); font-size: 2.8rem; line-height: 1; color: #d4212f; }
.plan .suave { color: #6f665c; margin: 0 0 6px; }
.plan.destacado { outline: 3px solid #ffd166; order: -1; }
.plan .chip { background: #fff4d6; color: #7a4a00; border-color: transparent; justify-self: start; }
.hero .plan .boton.rojo { background: var(--rojo); color: #fff; box-shadow: 0 4px 0 #8f0f1a; }
.hero .plan .boton.claro { background: #f3efe9; color: #1d1a17; border-color: #d9d2c8; }
.hero .plan .boton[disabled] { opacity: .6; }
.acceso { max-width: 520px; margin: 20px auto; }
.acceso form { display: grid; gap: 8px; margin: 14px 0; }
.acceso label { font-weight: 700; font-size: .9rem; }
.acceso input { font-size: 1.1rem; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--borde); background: var(--fondo); }
.acceso input:focus { outline: none; border-color: var(--rojo); }
#codigo { letter-spacing: .4em; font-weight: 800; text-align: center; font-size: 1.5rem; }
.estado-premium { background: linear-gradient(135deg, #fff4d6, #ffe7b0); color: #3a2200; border-radius: 12px; padding: 10px 14px; }
details summary { cursor: pointer; }
section details { margin: 8px 0; }

/* ---------- Portada de BomberOpo y oposiciones ---------- */
.hero-marca h1 { font-size: clamp(3.2rem, 9vw, 6rem); line-height: .9; }
.hero-marca .lema { font-family: var(--titulo); font-size: clamp(1.5rem, 3.4vw, 2.2rem); color: #ffd166; margin: 0 0 10px; letter-spacing: .03em; }
.chips-hero { gap: 6px; margin-bottom: 6px; }
.chip-opo { background: #fff !important; color: var(--rojo-oscuro) !important; border-color: transparent !important; text-decoration: none; }
.chip-opo:hover { filter: brightness(.95); }
.aviso-prep { background: rgba(0,0,0,.2); border-radius: 10px; padding: 6px 10px; font-size: .88rem; }
.opos { grid-template-columns: repeat(auto-fill, minmax(min(290px, 100%), 1fr)); }
.tarjeta-opo { background: var(--panel); border: 2px solid var(--borde); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); display: flex; flex-direction: column; gap: 6px; transition: transform .12s, border-color .12s; }
.tarjeta-opo:hover { transform: translateY(-3px); border-color: var(--rojo); }
.tarjeta-opo.elegida { border-color: var(--verde); }
.tarjeta-opo h3 { font-family: Inter, sans-serif; font-weight: 800; font-size: 1.2rem; letter-spacing: 0; margin: 0; }
.tarjeta-opo p { margin: 0; }
.tarjeta-opo .meta { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.tarjeta-opo .aviso-prep { background: color-mix(in srgb, var(--ambar) 16%, var(--panel)); }
.tarjeta-opo .boton { margin-top: auto; }
.emoji-opo { font-size: 2.4rem; line-height: 1; }
.plazas-opo b { font-family: var(--titulo); font-size: 2.2rem; color: var(--rojo); line-height: 1; margin-right: 4px; }
.plazo { font-size: .92rem; }
.plazo.urgente { color: var(--rojo); font-weight: 700; }
.lista-conv { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.convocatoria { display: flex; gap: 14px; background: var(--panel); border: 1px solid var(--borde); border-radius: 14px; padding: 14px; box-shadow: var(--sombra); }
.conv-plazas { flex: none; width: 74px; text-align: center; background: var(--fondo-2); border-radius: 12px; padding: 8px 4px; align-self: flex-start; }
.conv-plazas b { display: block; font-family: var(--titulo); font-size: 1.9rem; line-height: 1; color: var(--rojo); }
.conv-plazas span { font-size: .72rem; font-weight: 700; color: var(--suave); text-transform: uppercase; }
.conv-cuerpo { min-width: 0; }
.conv-cuerpo h3 { font-family: Inter, sans-serif; font-weight: 800; font-size: 1rem; letter-spacing: 0; margin: 6px 0 2px; line-height: 1.3; }
.conv-cuerpo p { margin: 3px 0; font-size: .9rem; }
.conv-cuerpo a { font-size: .88rem; font-weight: 600; }
.nota-conv { font-size: .82rem !important; }
.chip.estado.verde { background: var(--verde-suave); color: var(--verde); border-color: transparent; }
.chip.estado.ambar { background: color-mix(in srgb, var(--ambar) 22%, var(--panel)); color: color-mix(in srgb, var(--ambar) 60%, var(--texto)); border-color: transparent; }
.chip.estado.azul { background: color-mix(in srgb, var(--agua) 18%, var(--panel)); color: color-mix(in srgb, var(--agua) 60%, var(--texto)); border-color: transparent; }
a.filtro { text-decoration: none; color: var(--texto); border: 1.5px solid var(--borde); background: var(--panel); border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: .9rem; }
a.filtro.activo { background: var(--texto); color: var(--fondo); border-color: var(--texto); }
a.filtro small { opacity: .6; margin-left: 2px; }
.selector { border: 1.5px solid var(--borde); background: var(--panel); border-radius: 999px; padding: 8px 14px; font-weight: 600; }

/* ---------- Cuenta atrás y avisos ---------- */
.cuenta { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 12px; }
.cuenta span { background: rgba(0,0,0,.22); border-radius: 12px; padding: 6px 12px; font-size: .85rem; color: #ffe4e1; }
.cuenta b { font-family: var(--titulo); font-size: 1.5rem; color: #fff; margin-right: 4px; letter-spacing: .03em; }
.reportar { background: none; border: 0; color: var(--suave); text-decoration: underline; cursor: pointer; font-size: .82rem; padding: 0; }
.reportar:hover { color: var(--rojo); }
.dialogo { border: 0; border-radius: var(--radio); padding: 0; max-width: min(520px, calc(100vw - 32px)); width: 100%; background: var(--panel); color: var(--texto); box-shadow: 0 20px 60px rgba(0,0,0,.35); }
.dialogo::backdrop { background: rgba(20,10,5,.55); backdrop-filter: blur(2px); }
.dialogo form { padding: 20px; display: grid; gap: 10px; }
.dialogo textarea { width: 100%; min-height: 110px; border-radius: 10px; border: 1.5px solid var(--borde); background: var(--fondo); padding: 10px 12px; font: inherit; resize: vertical; }
.dialogo textarea:focus { outline: none; border-color: var(--rojo); }
.legal h2 { margin-top: 26px; }
.legal p, .legal li { max-width: 75ch; }
.falta { background: color-mix(in srgb, var(--ambar) 30%, transparent); border-radius: 4px; padding: 0 4px; font-weight: 700; }

/* ---------- Callejero ---------- */
.carga-camion { display: inline-block; animation: arrancar .35s ease-in-out infinite alternate; }
.hero-callejero { background: radial-gradient(circle at 85% 15%, #22d3ee55 0, transparent 45%), linear-gradient(135deg, #0f3d5e, #0b1f33 72%); }
.hero-callejero .boton.rojo { background: #fff; color: #0b1f33; box-shadow: 0 4px 0 #9cc9e6; }
.hero-callejero p { color: #d7ecfa; }
.cifras-mini { margin: 4px 0 16px; gap: 8px 18px; }
.cifras-mini span { color: #cfe7f7; font-size: .9rem; }
.cifras-mini b { font-family: var(--titulo); font-size: 1.7rem; color: #fff; margin-right: 3px; }
.mapa-portada { aspect-ratio: 1; max-height: 380px; width: 100%; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.06); }
.filtro-callejero button { display: inline-flex; align-items: center; gap: 6px; }
.punto-color { width: 10px; height: 10px; border-radius: 50%; background: var(--g, var(--suave)); display: inline-block; }
.chip .punto-color { width: 8px; height: 8px; margin-right: 4px; vertical-align: 0; }
.juegos { margin-bottom: 8px; }
.tarjeta-juego { display: flex; gap: 14px; align-items: flex-start; text-decoration: none; color: var(--texto); background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px; box-shadow: var(--sombra); transition: transform .12s, border-color .12s; }
.tarjeta-juego:hover { transform: translateY(-3px) rotate(-.4deg); border-color: var(--agua); }
.tarjeta-juego .emoji { font-size: 2.3rem; line-height: 1; transition: transform .2s; }
.tarjeta-juego:hover .emoji { transform: scale(1.18) rotate(-8deg); }
.tarjeta-juego h3 { font-family: Inter, sans-serif; font-weight: 800; font-size: 1.05rem; letter-spacing: 0; margin: 2px 0 4px; }
.tarjeta-juego p { margin: 0 0 8px; font-size: .9rem; color: var(--suave); }

.juego-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.juego-cab h1 { margin: 0; }
.marcador { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.marcador .chip { font-size: .85rem; padding: 5px 11px; }
.juego-rejilla { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 16px; margin-top: 12px; align-items: start; }
.mapa-juego { position: relative; height: min(70vh, 620px); border-radius: var(--radio); overflow: hidden; border: 1px solid var(--borde); box-shadow: var(--sombra); position: sticky; top: 90px; }
.mapa-juego.grande { height: max(420px, calc(100vh - 270px)); position: relative; top: 0; margin-top: 12px; }
.aviso-datos { font-size: .78rem; margin-top: 10px; }

.mapa-madrid { position: relative; width: 100%; background: color-mix(in srgb, var(--agua) 7%, var(--fondo-2)); touch-action: none; user-select: none; -webkit-user-select: none; }
.mapa-madrid svg { width: 100%; height: 100%; display: block; cursor: grab; --k: 4; }
.mapa-madrid.arrastrando svg { cursor: grabbing; }
.capa-distritos path { fill: color-mix(in srgb, var(--g) 16%, var(--panel)); stroke: color-mix(in srgb, var(--g) 70%, var(--texto)); stroke-width: 1.4px; vector-effect: non-scaling-stroke; transition: fill .2s; cursor: pointer; }
.capa-distritos path:hover { fill: color-mix(in srgb, var(--g) 30%, var(--panel)); }
.capa-distritos path.acierto-d { fill: color-mix(in srgb, #22c55e 70%, var(--panel)); animation: latido-d .5s; }
.capa-distritos path.fallo-d { fill: color-mix(in srgb, #ef4444 65%, var(--panel)); }
.capa-distritos path.era-d { fill: color-mix(in srgb, #22c55e 50%, var(--panel)); stroke: #16a34a; stroke-width: 3px; }
.capa-distritos path.pista-d, .capa-distritos path.sel-d { fill: color-mix(in srgb, var(--g) 42%, var(--panel)); stroke-width: 3px; }
@keyframes latido-d { 50% { fill: color-mix(in srgb, #22c55e 90%, var(--panel)); } }
.capa-fondo path { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.capa-fondo .via-t { display: none; stroke: color-mix(in srgb, var(--texto) 13%, transparent); stroke-width: .7px; }
.cerca .capa-fondo .via-t { display: inline; }
.capa-fondo .via-s { stroke: color-mix(in srgb, var(--texto) 18%, transparent); stroke-width: .8px; }
.capa-fondo .via-p { stroke: color-mix(in srgb, var(--ambar) 55%, transparent); stroke-width: 1.4px; }
.capa-fondo .via-a { stroke: color-mix(in srgb, var(--rojo) 55%, transparent); stroke-width: 2.2px; }
.compacto .capa-fondo .via-s { display: none; }
.hero-callejero .mapa-madrid { background: transparent; }
.hero-callejero .capa-distritos path { fill: rgba(255,255,255,.07); stroke: rgba(255,255,255,.35); }
.hero-callejero .capa-distritos path:hover { fill: rgba(255,255,255,.14); }
.hero-callejero .capa-fondo .via-s { stroke: rgba(255,255,255,.12); }
.hero-callejero .capa-fondo .via-p { stroke: rgba(255,209,102,.55); }
.hero-callejero .capa-fondo .via-a { stroke: rgba(255,120,120,.7); }
.capa-etiquetas text { font-family: Inter, sans-serif; font-weight: 700; text-anchor: middle; font-size: calc(var(--k) * 12.5px); fill: color-mix(in srgb, var(--texto) 72%, transparent); paint-order: stroke; stroke: var(--panel); stroke-width: calc(var(--k) * 3px); stroke-linejoin: round; pointer-events: none; }
.capa-etiquetas .num { font-family: var(--titulo); font-size: calc(var(--k) * 20px); fill: var(--texto); }
.sin-etiquetas .capa-etiquetas { display: none; }
.trazo { fill: none; vector-effect: non-scaling-stroke; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.trazo.ok { stroke: #16a34a; stroke-width: 6px; filter: drop-shadow(0 0 3px rgba(22,163,74,.6)); }
.trazo.op { stroke-width: 4px; stroke-dasharray: 6 5; opacity: .9; }
.trazo.op-0 { stroke: #16a34a; } .trazo.op-1 { stroke: #dc2626; } .trazo.op-2 { stroke: #f59e0b; }
.trazo.fantasma { stroke: #a855f7; stroke-width: 7px; animation: fantasma 1.6s ease-in-out infinite alternate; }
@keyframes fantasma { from { filter: drop-shadow(0 0 2px #a855f7); opacity: .75; } to { filter: drop-shadow(0 0 9px #c084fc); opacity: 1; } }
.trazo.otra-calle { stroke: #94a3b8; stroke-width: 3px; stroke-dasharray: 4 4; }
.trazo.recta { stroke-width: 3px; stroke-dasharray: 8 6; }
.trazo.recta.cerca { stroke: #16a34a; } .trazo.recta.lejos { stroke: #ef4444; }
.marca .marca-halo { fill: var(--panel); stroke: var(--texto); stroke-width: 1.5; filter: drop-shadow(0 2px 3px rgba(0,0,0,.35)); }
.marca .marca-emoji, .camion-ruta .marca-emoji { font-size: 15px; text-anchor: middle; dominant-baseline: central; }
.marca.salida .marca-halo { stroke: #0ea5e9; stroke-width: 3; }
.marca.destino .marca-halo { stroke: #ef4444; stroke-width: 3; }
.marca.real .marca-halo { stroke: #16a34a; stroke-width: 3; }
.marca.tuya .marca-halo { stroke: #6366f1; stroke-width: 3; }
.marca.sel .marca-halo { stroke: var(--rojo); stroke-width: 3; }
.marca.parque-op .marca-halo { stroke: #f59e0b; stroke-width: 2.5; }
.marca.parque-op.ganador .marca-halo { stroke: #16a34a; stroke-width: 4; }
.marca.latido .marca-halo { animation: latir-halo 0.7s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
@keyframes latir-halo { to { transform: scale(1.25); } }
.marca.rebote > * { animation: rebote .6s cubic-bezier(.3,1.8,.5,1); transform-box: fill-box; transform-origin: center bottom; }
@keyframes rebote { from { transform: translateY(-30px) scale(.3); opacity: 0; } }
.camion-ruta .marca-halo { stroke: var(--rojo); stroke-width: 3; }
.punto circle { stroke: #fff; stroke-width: 1.2; cursor: pointer; transition: r .15s; }
.punto:hover circle { r: 8; }
.cat-bomberos circle { fill: #dc2626; } .cat-salud circle { fill: #0ea5e9; } .cat-seguridad circle { fill: #1e3a8a; }
.cat-gobierno circle { fill: #7c3aed; } .cat-monumento circle { fill: #b45309; } .cat-cultura circle { fill: #db2777; }
.cat-transporte circle { fill: #0f766e; } .cat-deporte circle { fill: #65a30d; } .cat-verde circle { fill: #16a34a; }
.cat-compras circle { fill: #ea580c; } .cat-hotel circle { fill: #64748b; } .cat-otros circle { fill: #334155; }
.mapa-botones { position: absolute; right: 10px; top: 10px; display: grid; gap: 6px; z-index: 2; }
.mapa-botones button { width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--borde); background: var(--panel); font-size: 1.2rem; font-weight: 800; cursor: pointer; box-shadow: var(--sombra); }
.compacto .mapa-botones { display: none; }

.recorrido .trayecto { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; background: var(--fondo-2); border-radius: 12px; padding: 12px; }
.trayecto > div { display: grid; gap: 2px; min-width: 0; }
.trayecto small { font-size: .7rem; font-weight: 800; color: var(--suave); letter-spacing: .06em; }
.trayecto b { line-height: 1.25; }
.trayecto .flecha { font-size: 1.6rem; color: var(--rojo); animation: arrancar .6s ease-in-out infinite alternate; }
.ruta-op .letra { background: color-mix(in srgb, var(--c) 18%, var(--fondo-2)); color: var(--c); }
.ruta-op .calles { line-height: 1.5; }
.ruta-op .calles i { color: var(--suave); font-style: normal; font-weight: 800; margin: 0 2px; }
.ruta-op .por { display: block; margin-top: 6px; font-weight: 600; color: var(--texto); }
.opcion.bien .por, .opcion.mal .por { color: inherit; }

.reto-mapa { margin-top: 12px; padding: 14px 18px; }
.reto { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.reto > div:nth-child(2) { flex: 1; min-width: 200px; display: grid; }
.reto small { font-size: .72rem; font-weight: 800; letter-spacing: .06em; }
.reto b { font-size: clamp(1.1rem, 2.6vw, 1.5rem); line-height: 1.25; }
.reto-emoji { font-size: 2.4rem; }
.pista { color: var(--ambar); font-weight: 700; font-size: .9rem; }
.resultado-toque { display: none; margin-top: 10px; padding: 10px 12px; border-radius: 12px; background: var(--fondo-2); animation: entrar .35s; }
.resultado-toque.visible { display: block; }
@keyframes entrar { from { opacity: 0; transform: translateY(6px); } }
.entra { animation: entrar-nombre .3s cubic-bezier(.3,1.5,.5,1); display: inline-block; }
@keyframes entrar-nombre { from { opacity: 0; transform: translateY(10px) scale(.96); } }

.carta-lista { max-width: 640px; margin: 20px auto; text-align: center; padding: 28px 20px; }
.nombre-carta { font-family: var(--titulo); font-size: clamp(2rem, 6vw, 3.2rem); line-height: 1.05; margin: 18px 0 22px; min-height: 2.2em; display: grid; place-items: center; }
.botones-lista { justify-content: center; }
.botones-lista .boton { min-width: 170px; }
.botones-lista .si { background: var(--verde); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--verde) 60%, #000); }
.botones-lista .no { background: var(--rojo); color: #fff; box-shadow: 0 4px 0 var(--rojo-oscuro); }
.botones-lista kbd { font-size: .7rem; opacity: .8; border: 1px solid rgba(255,255,255,.5); border-radius: 5px; padding: 0 5px; }

.explorador { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; margin-top: 12px; }
.explorador .mapa-juego.grande { margin-top: 0; height: min(76vh, 720px); }
.lateral { display: grid; gap: 12px; align-content: start; max-height: min(76vh, 720px); overflow: auto; }
.buscador-mapa { max-width: none; }
.cats { display: flex; flex-wrap: wrap; gap: 5px; }
.cats button { border: 1px solid var(--borde); background: var(--panel); border-radius: 999px; padding: 3px 9px; font-size: .75rem; font-weight: 700; cursor: pointer; opacity: .45; }
.cats button.activo { opacity: 1; background: var(--fondo-2); }
.ficha h3 { font-family: Inter, sans-serif; font-weight: 800; font-size: 1.1rem; letter-spacing: 0; }
.ficha p { margin: 6px 0; font-size: .92rem; }
.resultados-mapa { display: grid; gap: 4px; }
.resultados-mapa button { text-align: left; border: 1px solid var(--borde); background: var(--panel); border-radius: 10px; padding: 8px 10px; cursor: pointer; font-size: .9rem; }
.resultados-mapa button:hover { border-color: var(--rojo); }
.resultados-mapa small { display: block; color: var(--suave); font-size: .75rem; }
.panel-callejero { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-top: 22px; background: linear-gradient(135deg, color-mix(in srgb, var(--agua) 14%, var(--panel)), var(--panel)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition: none !important; }
}
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .camion { max-width: 260px; order: -1; }
  .cifras { grid-template-columns: repeat(2, 1fr); }
  .mapa { grid-template-columns: repeat(5, 1fr); }
  .dos-col { grid-template-columns: 1fr; }
  .marca-sub { display: none; }
  /* Móvil: el menú en dos filas de 4, icono con su nombre debajo */
  .menu { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; flex-basis: 100%; order: 3; }
  .menu a { display: flex; flex-direction: column; align-items: center; gap: 1px; font-size: 1.15rem; padding: 6px 2px; border-radius: 12px; text-align: center; }
  .menu a span { display: block; font-size: .66rem; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .menu a[hidden] { display: none !important; }
  /* Móvil: la cabecera no ocupa media pantalla al bajar, y el buscador va en su propia fila */
  .cabecera { position: relative; padding: 8px 12px; gap: 8px; }
  .herramientas { flex: 1 1 auto; flex-wrap: wrap; gap: 6px; }
  .buscador { order: 5; flex: 1 1 100%; max-width: none; padding: 7px 12px; }
  .buscador kbd { display: none; }
  .juego-rejilla, .explorador { grid-template-columns: 1fr; }
  .mapa-juego { position: relative; top: 0; height: 58vh; order: -1; }
  .juego-rejilla .mapa-juego { order: 0; height: 52vh; scroll-margin-top: 12px; }
  .explorador .mapa-juego.grande { height: 60vh; }
  .lateral { max-height: none; }
  .mapa-portada { max-height: 260px; order: -1; }
}
@media (max-width: 480px) {
  .herramientas { flex-basis: 100%; }
  .buscador { max-width: none; }
  .buscador kbd { display: none; }
  .videos { grid-template-columns: 1fr; }
}
