:root {
    --r-s: 14px;
    --r-m: 22px;
    --r-l: 30px;
    --sombra-1: 0 2px 6px rgba(80, 20, 30, .08), 0 8px 20px rgba(80, 20, 30, .08);
    --sombra-2: 0 4px 10px rgba(80, 20, 30, .10), 0 18px 40px rgba(80, 20, 30, .16);
    --suave: cubic-bezier(.22, 1, .36, 1);
}


html { scroll-padding-top: 80px; }
::selection { background: var(--amarillo, #F4C20D); color: #1b1b1b; }
:focus-visible { outline: 3px solid var(--amarillo, #F4C20D); outline-offset: 3px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--azul, #8E1B2B) 55%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--azul, #8E1B2B) 50%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }


.hero-welcome .hero-title { text-shadow: 0 4px 24px rgba(0, 0, 0, .45); }
.hero-welcome .hero-desc { text-shadow: 0 2px 10px rgba(0, 0, 0, .4); }
.hero-welcome::after {
    display: none;
    content: none;
}


.simu-intro { border-left: 6px solid var(--amarillo, #F4C20D); padding: 14px 20px; background: #fff; border-radius: 0 var(--r-m) var(--r-m) 0; box-shadow: var(--sombra-1); }
.simu-sec { position: relative; padding-bottom: 12px; }
.simu-sec::after { content: ''; position: absolute; left: 0; bottom: 0; height: 4px; width: 72px; border-radius: 4px; background: linear-gradient(90deg, var(--amarillo, #F4C20D), var(--turquesa, #C96F5E)); }
.simu-card { box-shadow: var(--sombra-1); }
.simu-art { height: 150px; }
.simu-info h3 { font-family: 'Oswald', 'Poppins', sans-serif; font-weight: 700; letter-spacing: .02em; line-height: 1.15; }
.simu-info p { font-size: .94em; }
.simu-tags span { border: 1px solid color-mix(in srgb, var(--azul, #8E1B2B) 18%, transparent); }
.simu-go { box-shadow: 0 6px 14px color-mix(in srgb, var(--c) 40%, transparent); }

/* ---------- 4. Paneles de herramientas ---------- */
.simu-todo .tool-panel { border-top: 0; }
.simu-todo .tool-panel::after { content: ''; position: absolute; top: 0; left: 40px; right: 40px; border-top: 3px dotted color-mix(in srgb, var(--turquesa, #C96F5E) 70%, transparent); }
.tool-panel::before { background: linear-gradient(135deg, var(--azul, #8E1B2B), color-mix(in srgb, var(--azul, #8E1B2B) 70%, #000)); box-shadow: 0 6px 14px rgba(142, 27, 43, .3); }
.tool-panel h2, .insp-h, .sis-h { font-family: 'Oswald', 'Poppins', sans-serif; letter-spacing: .01em; }

/* ---------- 5. Botones: misma familia ---------- */
.insp-btn, .sis-btn, .lin-btn, .plan-btn, .card-btn, .pl-btn, .sis-sonido, .rp-btns a, .rp-btns button, .cp-nav button, .cp-decks button, .s3-b {
    border-radius: 999px; letter-spacing: .01em;
    transition: transform .3s var(--suave), box-shadow .3s, background .25s, color .25s, filter .25s;
}
.sis-btn, .rp-btns a, .rp-btns button { box-shadow: 0 6px 16px color-mix(in srgb, var(--azul, #8E1B2B) 30%, transparent); }
.sis-btn:hover, .rp-btns a:hover, .rp-btns button:hover, .pl-btn:hover, .cp-nav button:hover { transform: translateY(-2px); }
.insp-btn:active, .sis-btn:active, .rp-btns a:active, .rp-btns button:active, .pl-btn:active { transform: scale(.96); }

/* ---------- 6. Inspector de riesgos ---------- */
.hud-item { border-radius: var(--r-m); border-bottom: 4px solid var(--amarillo, #F4C20D); }
.hud-item b { font-variant-numeric: tabular-nums; }
.insp-escena { border-radius: var(--r-l); box-shadow: 0 22px 50px rgba(20, 10, 40, .35), inset 0 0 0 4px rgba(255, 255, 255, .06); }
.insp-lista li { border-radius: var(--r-m); transition: transform .3s var(--suave), box-shadow .3s; }
.insp-lista li:not(.lock):hover { transform: translateY(-3px); box-shadow: var(--sombra-2); }
.insp-fin { border-radius: var(--r-l); box-shadow: var(--sombra-2); }

/* ---------- 7. Alerta sísmica ---------- */
.sis-juego { border-radius: var(--r-l); box-shadow: 0 22px 50px rgba(142, 27, 43, .22); }
.sis-chip { letter-spacing: .1em; text-transform: uppercase; }
.sis-op { border-radius: var(--r-m); transition: transform .3s var(--suave), border-color .25s, background .25s, box-shadow .3s; }
.sis-op:hover:not(:disabled) { box-shadow: var(--sombra-1); }
.sis-fb { border-radius: var(--r-m); border-left: 6px solid var(--amarillo, #F4C20D); }
.sis-fb.bien { border-left-color: #1E8449; }
.sis-fb.mal { border-left-color: #C0392B; }
.sis-final-n { text-shadow: 0 6px 24px rgba(244, 194, 13, .45); }
#sismo { box-shadow: inset 0 0 20px rgba(0, 0, 0, .5); }

/* ---------- 8. Extintor ---------- */
.ex-escena { border-radius: var(--r-l); box-shadow: 0 22px 50px rgba(20, 10, 40, .3); }
.ex-msg { backdrop-filter: blur(8px); background: rgba(79, 17, 28, .85); border: 1px solid rgba(255, 255, 255, .15); }
.ex-pasos li { transition: background .35s, transform .35s var(--suave); }
.ex-pasos li.ok { transform: scale(1.02); }
.ex-b { box-shadow: inset 0 1px 3px rgba(0, 0, 0, .12); }
.ex-fin { border-left: 6px solid transparent; }
.ex-fin.bien { border-left-color: #1E8449; }
.ex-fin.mal { border-left-color: #C0392B; }

/* ---------- 9. Línea del tiempo y comparador ---------- */
.tl-card { transition: transform .4s var(--suave), box-shadow .4s; }
.tl-card:hover { transform: translateY(-4px); box-shadow: var(--sombra-2); }
.tl-fecha { text-transform: uppercase; letter-spacing: .06em; font-size: .92em; }
.tl-cambio { border-left: 4px solid var(--amarillo, #F4C20D); border-radius: 0 var(--r-s) var(--r-s) 0; }
.cmp { border-radius: var(--r-l); box-shadow: var(--sombra-2); }
.cmp-viz { box-shadow: inset 0 2px 12px rgba(0, 0, 0, .25); }

/* ---------- 10. Mapa de México y cápsulas ---------- */
.mx-mapa { box-shadow: var(--sombra-1); }
.mx-lado { border-radius: var(--r-m); box-shadow: var(--sombra-2); }
.lt-tabs button.activa { box-shadow: 0 6px 14px color-mix(in srgb, var(--azul, #8E1B2B) 30%, transparent); }
.cp-card { box-shadow: 0 22px 50px rgba(79, 17, 28, .4); }

/* ---------- 11. Planeador y reporte ---------- */
.pl-mapa { box-shadow: var(--sombra-1); }
.pl-caja { border-radius: var(--r-m); }
.pl-aviso { border-left: 6px solid var(--amarillo, #F4C20D); border-radius: var(--r-m); }
.pl-aviso.bien { border-left-color: #1E8449; }
.pl-aviso.mal { border-left-color: #C0392B; }
.rp-form { border-top: 6px solid var(--amarillo, #F4C20D); }
.rp-form input[type=text], .rp-form select, .rp-form textarea, #rpTexto, .pl-caja select { transition: border-color .25s, box-shadow .25s; }
.rp-form input:focus, .rp-form select:focus, .rp-form textarea:focus, #rpTexto:focus, .pl-caja select:focus {
    outline: none; border-color: var(--azul, #8E1B2B); box-shadow: 0 0 0 4px color-mix(in srgb, var(--azul, #8E1B2B) 14%, transparent);
}
.rp-urg label { cursor: pointer; transition: background .2s, color .2s; }
.rp-urg label:has(input:checked) { background: var(--azul, #8E1B2B); color: #fff; }
.rp-mapa { box-shadow: var(--sombra-1); }

/* ---------- 12. Galería de casos ---------- */
.acc-gal::before { content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(0deg, rgba(8, 6, 16, .6), transparent 30%); }
.acc-txt h3 { text-shadow: 0 6px 30px rgba(0, 0, 0, .5); }
.acc-k { display: inline-block; background: var(--amarillo, #F4C20D); color: #1b1b1b; border-radius: 999px; padding: 3px 14px; font-size: .8em; font-weight: 600; margin-bottom: 12px; }
.acc-th { border: 2px solid rgba(255, 255, 255, .18); }
.acc-th:hover { border-color: #fff; }
.acc-det > div { border-radius: var(--r-l); box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }

/* ---------- 13. Ayuda, buscador y accesibilidad ---------- */
.ay-box, .bq-box, .ac-panel { border-radius: var(--r-l); box-shadow: 0 30px 70px rgba(40, 8, 14, .45); }
.ay-ov, .bq-ov { backdrop-filter: blur(6px); }
.ay-box li a, .bq-box li a { border: 1px solid transparent; }
.ay-box li a:hover, .bq-box li a:hover { border-color: color-mix(in srgb, var(--azul, #8E1B2B) 25%, transparent); }

/* ---------- 14. Escuela 3D (señalamientos e iluminación) ---------- */
.s3-vp { box-shadow: 0 22px 50px rgba(80, 20, 30, .25), inset 0 0 0 4px rgba(255, 255, 255, .35); }
.s3-info { border-radius: var(--r-l); }
.s3-chips button { transition: transform .25s var(--suave), border-color .2s, box-shadow .25s; }
.s3-chips button:hover { transform: translateY(-2px); box-shadow: var(--sombra-1); }

/* ---------- 15. Página de infraestructura ---------- */
.inf-stats { border-radius: var(--r-l); }
.inf-stat { transition: background .3s; }
.inf-stat:hover { background: color-mix(in srgb, var(--amarillo, #F4C20D) 12%, #fff); }
.inf-nivel { transition: transform .35s var(--suave), box-shadow .35s; }
.inf-nivel:hover { transform: translateY(-6px); box-shadow: var(--sombra-2); }
.inf-duo-item { transition: transform .3s var(--suave), border-color .3s; }
.inf-duo-item:hover { transform: translateX(6px); border-left-color: var(--azul, #8E1B2B); }
.inf-fila { transition: background .3s; }
.inf-fila h3 .ico { box-shadow: 0 6px 14px color-mix(in srgb, var(--amarillo, #F4C20D) 55%, transparent); }
.inf-llamado, .inf-descarga { box-shadow: var(--sombra-2); }
.inf-subtitulo, .inf-trio-item h3, .inf-nivel h3 { letter-spacing: .01em; }

/* ---------- 16. Teléfono ---------- */
@media (max-width: 768px) {
    .simu-intro { padding: 12px 16px; }
    .simu-todo .tool-panel::after { left: 12px; right: 12px; }
    .simu-art { height: 120px; }
    .sis-op:hover:not(:disabled) { transform: none; }
}

/* ---------- 17. Reducir movimiento ---------- */
@media (prefers-reduced-motion: reduce) {
    .tl-card, .sis-op, .insp-lista li, .inf-nivel, .inf-duo-item, .s3-chips button { transition: none; }
}

/* =====================================================================
18. RESPONSIVO (teléfono y tableta)
   ===================================================================== */
html, body { max-width: 100%; }
body { overflow-x: clip; }
img, video, svg, canvas { max-width: 100%; }

/* pantallas táctiles: sin efectos que dependen del cursor */
@media (hover: none) {
    .simu-card, .simu-card:hover { transform: none; }
    .simu-card::after { display: none; }
    .tl-card:hover, .inf-nivel:hover, .insp-lista li:hover { transform: none; }
}

/* ---- tableta ---- */
@media (max-width: 1024px) {
    .simu-todo .tool-panel::after { left: 16px; right: 16px; }
    .hero-welcome { min-height: 360px; }
    .pl-grid { grid-template-columns: 1fr; }
    .pl-lado { position: static; }
    .mx-lado, .s3-info { position: static; }
}

/* ---- teléfono ---- */
@media (max-width: 768px) {
    /* barra superior igual a styles.css */
    .logo { font-size: 1.3em; }
    .logo-sub { display: none; }
    .top-nav > a { margin-left: 14px; font-size: .85em; }
    .nav-secciones-btn { margin-left: 14px; font-size: .85em; }
    .nav-secciones-menu { top: calc(100% + 14px); right: 0; left: auto; min-width: 220px; max-width: calc(100vw - 24px); }

    /* textos y espacios */
    .tool-panel h2, .insp-h, .sis-h { font-size: 1.45em; }
    .simu-sec { font-size: 1.3em; }
    .inf-seccion, .inf-seccion.alt-bg { padding: 40px 16px; }
    .inf-subtitulo { font-size: 1.4em; }
    .inf-trio-item::before { font-size: 5em; }

    /* controles táctiles de 44 px y sin zoom automático de iOS */
    .s3-b, .lt-tabs button, .cp-nav button, .cp-decks button, .pl-btn, .sis-sonido, .rp-btns a, .rp-btns button, .insp-btn, .sis-btn { min-height: 44px; }
    input[type=text], input[type=search], select, textarea { font-size: 16px; }
    .rp-btns a, .rp-btns button, .insp-acciones .insp-btn { flex: 1 1 100%; text-align: center; }
    .lt-tabs { display: flex; width: 100%; border-radius: 26px; }
    .lt-tabs button { flex: 1 1 auto; padding: 9px 12px; }
    .cp-nav button { flex: 1; }

    /* juegos y mapas */
    .insp-hud { gap: 8px; }
    .hud-item { padding: 7px 12px; min-width: 0; flex: 1 1 auto; }
    .hud-item b { font-size: 1.4em; }
    .insp-escena { min-height: 290px; display: flex; align-items: center; }
    .insp-escena > svg { width: 100%; min-height: 290px; object-fit: cover; }
    .insp-start { padding: 16px 14px; justify-content: center; gap: 6px; }
    .insp-start h3 { font-size: 1.25em; line-height: 1.15; margin: 0 0 4px; }
    .insp-start p { font-size: .84em; line-height: 1.4; margin: 0 0 10px; max-width: 100%; }
    .insp-btn.grande { font-size: .95em; padding: 10px 20px; min-height: 42px; }
    .insp-lista { grid-template-columns: 1fr; }
    .sis-pantalla { min-height: 0; }
    .sis-lema { font-size: 1.35em; }
    .sis-final-n { font-size: 2.8em; }
    .ex-msg { font-size: .8em; padding: 8px 12px; left: 8px; right: 8px; top: 8px; bottom: auto; }
    .ex-pasos { grid-template-columns: 1fr 1fr; }
    .ex-barras { grid-template-columns: 1fr 1fr; }
    .pl-hit { stroke-width: 64px; }
    .pl-orig circle { r: 22px; }
    .pl-orig text { font-size: 20px; }
    .pl-meta text { font-size: 22px; }
    .pl-dato b { font-size: 1.3em; }
    .cp-b { font-size: 2.4em; }
    .cp-card { min-height: 0; padding: 22px 20px 18px; }
    .cmp { padding: 22px 16px 24px; }
    .cmp-viz { height: 190px; }
    .cmp-viz > div { zoom: .6; }
    .cmp-sel { flex-direction: column; align-items: stretch; }
    .cmp select { width: 100%; }
    .tl-mag b { font-size: 2.4em; }
    .mx-wrap { gap: 14px; }

    /* galería de casos a pantalla completa */
    .acc-txt p { display: -webkit-box; -webkit-line-clamp: 3; line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
    .acc-txt h3 { font-size: clamp(2.2rem, 12vw, 3.4rem); margin-bottom: 8px; }
    .acc-top { left: 6vw; font-size: .7em; }
    .acc-det > div { padding: 22px 18px 20px; }
    .acc-det h4 { font-size: 1.8em; }

    /* escuela 3D */
    .s3-bar, .s3-views { gap: 6px; }
    .s3-views .sep { flex-basis: 100%; height: 0; }

    /* paneles flotantes */
    .ac-panel { top: 64px; right: 8px; width: calc(100vw - 16px); }
    .bq-ov { padding: 64px 8px 8px; }
    .ay-ov { padding: 8px; }
    .ay-box { padding: 20px 16px 22px; max-height: 92vh; }
}

/* ---- teléfono pequeño ---- */
@media (max-width: 420px) {
    .hero-welcome .hero-title { font-size: 2em; }
    .simu-grid { grid-template-columns: 1fr; }
    .ex-pasos { grid-template-columns: 1fr; }
    .inf-stat-num { font-size: 2.2em; }
    .tool-panel::before { font-size: .6em; padding: 3px 12px; }
    .rp-form { padding: 16px; }
    .hud-item { padding: 6px 10px; }
    .hud-item b { font-size: 1.25em; }
}

/* ---- notch y barra inferior de iPhone ---- */
.rt-btn { bottom: max(16px, env(safe-area-inset-bottom)); right: max(16px, env(safe-area-inset-right)); }
.rt-panel .rt-in input { font-size: 16px; }