/* =========================================================
   EternautApp — estética de historieta argentina de los 50:
   papel de diario, tinta china, tramas de puntos, viñetas,
   cuadros de narración y una nevada que lo envuelve todo.
   ========================================================= */
:root {
  color-scheme: light;
  --bg: #ebe5d5;            /* papel de diario */
  --surface: #f6f2e6;
  --surface-soft: #e2dbc8;
  --tint: #ddd4bd;
  --ink: #151515;           /* tinta china */
  --ink-2: #2e2d2a;
  --muted: #55514a;
  --faint: #857f71;
  --line: #c9c0a9;
  --frame: #151515;         /* borde de viñeta */
  --accent: #b83c1c;        /* rojo señal */
  --accent-hover: #942e13;
  --accent-soft: #f0d8cb;
  --on-accent: #fffaf0;
  --btn: #151515;
  --btn-ink: #f6f2e6;
  --btn-hover: #b83c1c;
  --snow: #ffffff;
  --lamp: #e8c35a;
  --ok: #3d6a35;
  --ok-bg: #dfe8d2;
  --ok-line: #6f9a5f;
  --bad: #a4321a;
  --bad-bg: #f3dbd0;
  --bad-line: #c97a62;
  --warn-bg: #f2e3b5;
  --warn-ink: #6b4f0b;
  --dots: rgba(21, 21, 21, .16);
  --shadow-hard: 5px 5px 0 var(--frame);
  --shadow-hover: 8px 8px 0 var(--frame);
  --display: "Anton", "Impact", "Arial Narrow", sans-serif;
  --type: "Special Elite", "Courier New", monospace;
  --body: "DM Sans", system-ui, sans-serif;
  --radius: 3px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0e0f11; --surface: #17181b; --surface-soft: #1f2024; --tint: #26272b;
    --ink: #ece6d6; --ink-2: #d7d1c1; --muted: #aaa494; --faint: #7d786c; --line: #34353a; --frame: #ece6d6;
    --accent: #ff7a52; --accent-hover: #ff9b7b; --accent-soft: #3b1f16; --on-accent: #120c09;
    --btn: #ece6d6; --btn-ink: #0e0f11; --btn-hover: #ff7a52;
    --ok: #9fd18a; --ok-bg: #1d2a1a; --ok-line: #4f7a43; --bad: #ff9a7c; --bad-bg: #36201a; --bad-line: #8c4d3b;
    --warn-bg: #3a3017; --warn-ink: #f2d98c; --dots: rgba(236, 230, 214, .1);
    --shadow-hard: 5px 5px 0 #000; --shadow-hover: 8px 8px 0 #000;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0e0f11; --surface: #17181b; --surface-soft: #1f2024; --tint: #26272b;
  --ink: #ece6d6; --ink-2: #d7d1c1; --muted: #aaa494; --faint: #7d786c; --line: #34353a; --frame: #ece6d6;
  --accent: #ff7a52; --accent-hover: #ff9b7b; --accent-soft: #3b1f16; --on-accent: #120c09;
  --btn: #ece6d6; --btn-ink: #0e0f11; --btn-hover: #ff7a52;
  --ok: #9fd18a; --ok-bg: #1d2a1a; --ok-line: #4f7a43; --bad: #ff9a7c; --bad-bg: #36201a; --bad-line: #8c4d3b;
  --warn-bg: #3a3017; --warn-ink: #f2d98c; --dots: rgba(236, 230, 214, .1);
  --shadow-hard: 5px 5px 0 #000; --shadow-hover: 8px 8px 0 #000;
}

/* ============ Base ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 90px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background-color: var(--bg);
  /* grano de papel */
  background-image: radial-gradient(var(--dots) .6px, transparent .8px);
  background-size: 4px 4px;
  transition: background-color .25s, color .25s;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
h1, h2, h3, p { margin-top: 0; }
cite { font-style: italic; }
[hidden] { display: none !important; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
::selection { background: var(--accent); color: var(--on-accent); }

.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 14px; background: var(--btn); color: var(--btn-ink); font-weight: 700; text-decoration: none; transition: top .2s; }
.skip-link:focus { top: 12px; }

.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; }

/* Cuadro de narración (como los textos del narrador en la historieta) */
.caption { position: relative; display: inline-block; max-width: 560px; margin: 0; padding: 10px 14px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink-2); font-family: var(--type); font-size: 16px; line-height: 1.55; box-shadow: 3px 3px 0 var(--frame); }

/* Viñeta genérica */
.panel-frame { border: 3px solid var(--frame); box-shadow: var(--shadow-hard); }

/* ============ Topbar ============ */
.topbar { position: sticky; top: 0; z-index: 20; border-bottom: 3px solid var(--frame); background: var(--bg); }
.topbar-inner { max-width: 1180px; height: 70px; margin: 0 auto; padding: 0 32px; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 24px var(--display); letter-spacing: .02em; text-transform: uppercase; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; flex: none; border-radius: 50%; background: var(--accent); color: var(--on-accent); border: 2px solid var(--frame); font: 400 19px var(--display); }
.brand-mark.small { width: 30px; height: 30px; font-size: 16px; }
.brand-light { color: var(--accent); }
.main-nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link { position: relative; padding: 8px 12px; color: var(--muted); font-size: 15px; font-weight: 600; text-decoration: none; transition: color .2s, background .2s; }
.nav-link:hover { color: var(--ink); background: var(--surface-soft); }
.nav-link[aria-current="page"] { color: var(--btn-ink); background: var(--btn); }
.nav-link-mobile { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.progress-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px 0 6px; border: 2px solid var(--frame); background: var(--surface); font-size: 14px; font-weight: 700; text-decoration: none; transition: transform .15s, box-shadow .15s; }
.progress-chip:hover, .progress-chip[aria-current="page"] { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--frame); }
.chip-label { color: var(--muted); font-weight: 500; }
.chip-ring { width: 26px; height: 26px; }
.chip-ring svg, .big-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--line); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 5; transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.icon-button { display: inline-grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 2px solid var(--frame); background: var(--surface); font-size: 17px; transition: transform .15s, box-shadow .15s, background .2s; }
.icon-button:hover { transform: translate(-2px, -2px); box-shadow: 3px 3px 0 var(--frame); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: inline; }
}
.menu-toggle { display: none; }
.burger { display: grid; gap: 4px; width: 18px; }
.burger span { display: block; height: 2.5px; background: currentColor; transition: transform .25s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ============ Layout ============ */
main { max-width: 1180px; min-height: calc(100vh - 160px); margin: 0 auto; padding: 36px 32px 88px; }
.view { display: none; }
.view.active { display: block; animation: appear .35s ease both; }
@keyframes appear { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ Buttons ============ */
.button { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 0 20px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink); font-size: 15px; font-weight: 700; letter-spacing: .02em; text-decoration: none; box-shadow: 3px 3px 0 var(--frame); transition: transform .15s, box-shadow .15s, background .15s, color .15s; }
.button:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--frame); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--frame); }
.button span { font-size: 17px; line-height: 1; }
.button-primary { background: var(--btn); color: var(--btn-ink); }
.button-primary:hover { background: var(--btn-hover); color: var(--on-accent); }
.button-secondary { background: var(--surface); }
.button-ghost { background: transparent; }
.button.full { width: 100%; }
.text-button { padding: 6px 0; border: 0; background: transparent; color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: transparent; text-underline-offset: 4px; transition: text-decoration-color .2s; }
.text-button:hover { text-decoration-color: currentColor; }
.text-button.danger { color: var(--bad); }

/* ============ Hero (página de historieta) ============ */
.hero { display: grid; grid-template-columns: 1fr 1.05fr; gap: 18px; }
.hero-copy { position: relative; display: flex; flex-direction: column; justify-content: center; padding: 44px 40px; background: var(--surface); overflow: hidden; }
.hero-copy::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 220px; height: 220px; background-image: radial-gradient(var(--ink) 1.6px, transparent 1.8px); background-size: 9px 9px; opacity: .12; border-radius: 50%; pointer-events: none; }
.hero-copy .caption { --rot: -1deg; align-self: flex-start; margin-bottom: 22px; font-size: 15px; transform: rotate(var(--rot)); }
.hero h1, .page-intro h1 { margin: 0 0 18px; font: 400 76px/.95 var(--display); letter-spacing: .005em; text-transform: uppercase; }
.hero h1 em, .page-intro h1 em { color: var(--accent); font-style: normal; }
.hero-lead { position: relative; z-index: 1; max-width: 430px; margin-bottom: 26px; color: var(--ink-2); font-size: 17px; line-height: 1.65; }
.hero-actions { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 12px; }
.hero-note { margin: 22px 0 0; color: var(--muted); font-size: 14px; }
.hero-note span:first-child { color: var(--accent); }
.hero-art { position: relative; min-height: 440px; overflow: hidden; background: #151515; }
.hero-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.art-caption { position: absolute; right: 16px; bottom: 16px; margin: 0; padding: 6px 12px; border: 2px solid #151515; background: #ebe5d5; color: #151515; font-family: var(--type); font-size: 15px; transform: rotate(1.5deg); box-shadow: 3px 3px 0 #151515; }

/* Nevada: tres capas de copos a distinta velocidad */
.snow { position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(2.5px 2.5px at 20px 30px, #fff 50%, transparent 52%),
    radial-gradient(2px 2px at 80px 120px, #fff 50%, transparent 52%),
    radial-gradient(3px 3px at 140px 60px, rgba(255,255,255,.9) 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 50px 170px, rgba(255,255,255,.8) 50%, transparent 52%),
    radial-gradient(2.2px 2.2px at 170px 190px, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 110px 10px, rgba(255,255,255,.7) 50%, transparent 52%);
  background-size: 200px 200px, 200px 200px, 200px 200px, 160px 160px, 220px 220px, 140px 140px;
  animation: snowfall 14s linear infinite;
}
@keyframes snowfall {
  to { background-position: 30px 200px, -20px 200px, 40px 200px, 10px 160px, -30px 220px, 20px 140px; }
}

/* ============ Section heading & cards ============ */
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin: 60px 0 22px; padding-bottom: 12px; border-bottom: 3px solid var(--frame); }
.section-heading.compact { margin-top: 52px; }
.section-heading.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.section-heading .eyebrow { margin-bottom: 4px; }
.section-heading h2 { margin: 0; font: 400 38px/1 var(--display); text-transform: uppercase; letter-spacing: .01em; }
.heading-aside { margin: 0; color: var(--muted); font-family: var(--type); font-size: 14px; line-height: 1.5; text-align: right; }

.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.feature-card { position: relative; display: flex; flex-direction: column; min-height: 250px; padding: 22px 24px; overflow: hidden; border: 3px solid var(--frame); background: var(--surface); text-decoration: none; box-shadow: var(--shadow-hard); transition: transform .15s, box-shadow .15s; }
.feature-card::before { content: ""; position: absolute; top: 0; right: 0; width: 45%; height: 100%; background-image: radial-gradient(var(--ink) 1.2px, transparent 1.4px); background-size: 8px 8px; opacity: .07; -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); pointer-events: none; }
.feature-card:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hover); }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.chapter-num { font: 400 46px/1 var(--display); color: var(--accent); }
.card-icon { position: absolute; top: 72px; right: 24px; font-size: 40px; line-height: 1; filter: grayscale(.25); }
.card-state { padding: 3px 10px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.card-state.is-done, .mission-state.is-done { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.card-state.is-progress, .mission-state.is-progress { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
.card-kicker { display: block; margin-bottom: 4px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.feature-card strong { display: block; max-width: 80%; margin-bottom: 6px; font: 400 28px/1.05 var(--display); text-transform: uppercase; }
.card-description { display: block; max-width: 85%; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.card-foot { display: block; margin-top: auto; padding-top: 18px; }
.mini-progress { display: block; height: 10px; overflow: hidden; border: 2px solid var(--frame); background: var(--surface); }
.mini-progress span, .progress-track span { display: block; width: 0; height: 100%; background-color: var(--accent); background-image: linear-gradient(-45deg, rgba(0,0,0,.2) 25%, transparent 25% 50%, rgba(0,0,0,.2) 50% 75%, transparent 75%); background-size: 14px 14px; transition: width .7s cubic-bezier(.3, 1.4, .5, 1); animation: stripes 1s linear infinite; }
@keyframes stripes { to { background-position: 14px 0; } }
.progress-label { display: block; margin-top: 8px; color: var(--muted); font-family: var(--type); font-size: 13px; }

/* ============ Mapa de la aventura ============ */
.adventure-map { position: relative; width: 100%; margin-bottom: 70px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); color: var(--ink); }
.adventure-map.narrow { max-width: 860px; margin-left: auto; margin-right: auto; }
.adventure-map.is-tall { max-width: 460px; margin-left: auto; margin-right: auto; margin-bottom: 24px; }
.map-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: hidden; }
.m-dots { fill: url(#map-dots); opacity: .1; }
.m-river { fill: none; stroke: var(--tint); stroke-width: 46; stroke-linecap: round; }
.m-river-lines { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-dasharray: 10 14; opacity: .35; animation: river-flow 3s linear infinite; }
@keyframes river-flow { to { stroke-dashoffset: -48; } }
.m-blocks rect { fill: url(#map-hatch); stroke: currentColor; stroke-width: 2; opacity: .2; }
.m-streets path { fill: none; stroke: currentColor; stroke-width: 10; opacity: .06; }
.m-trees circle { fill: var(--surface); stroke: currentColor; stroke-width: 2.5; opacity: .45; }
.m-compass circle { fill: var(--surface); stroke: currentColor; stroke-width: 2.5; }
.m-compass path { fill: currentColor; opacity: .35; }
.m-compass .m-compass-n { fill: var(--accent); opacity: 1; }
.m-compass text { fill: currentColor; font: 400 18px var(--display); text-anchor: middle; }
.m-compass { animation: none; }
.seg-under { fill: none; stroke: var(--surface); stroke-width: 16; stroke-linecap: round; }
.seg { fill: none; stroke-linecap: round; }
.seg.done { stroke: var(--accent); stroke-width: 7; stroke-dasharray: 100; }
.seg.todo { stroke: currentColor; stroke-width: 3.5; stroke-dasharray: 1.6 1.8; opacity: .55; }
.seg.next { opacity: .9; stroke-width: 4; animation: march 1.2s linear infinite; }
@keyframes march { to { stroke-dashoffset: -3.4; } }
.view.active .seg.done { animation: draw-path .7s var(--d, 0ms) cubic-bezier(.5, 0, .3, 1) backwards; }
@keyframes draw-path { from { stroke-dashoffset: 100; } }
.m-start path { fill: var(--surface); stroke: currentColor; stroke-width: 3.5; stroke-linejoin: round; }
.m-start rect { fill: currentColor; }
.m-finish line { stroke: currentColor; stroke-width: 4; }
.m-finish ellipse { fill: currentColor; opacity: .2; }
.m-flag { fill: var(--surface); stroke: currentColor; stroke-width: 3; stroke-linejoin: round; transform-box: fill-box; transform-origin: left center; animation: flag-wave 2.4s ease-in-out infinite; }
.m-finish.reached .m-flag { fill: var(--accent); }
@keyframes flag-wave { 50% { transform: skewY(6deg) scaleX(.9); } }

.map-stops { margin: 0; padding: 0; list-style: none; }
.map-stop { position: absolute; width: 0; height: 0; z-index: 2; }
.map-stop:hover, .map-stop:focus-within { z-index: 3; }
.map-stop a { color: inherit; text-decoration: none; }
.stop-pin { position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 58px; height: 58px; border: 3px solid var(--frame); border-radius: 50%; background: var(--surface); box-shadow: 3px 3px 0 var(--frame); transform: translate(-50%, -50%); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.stop-num { font: 400 26px/1 var(--display); }
.map-stop a:hover .stop-pin, .map-stop a:focus-visible .stop-pin { transform: translate(-50%, -50%) scale(1.12) rotate(-6deg); }
.map-stop.is-done .stop-pin { background: var(--accent); color: var(--on-accent); }
.map-stop.is-started .stop-pin { background: var(--warn-bg); }
.map-stop.is-current .stop-pin { background: var(--btn); color: var(--btn-ink); }
.map-stop.is-current .stop-pin::before, .map-stop.is-current .stop-pin::after { content: ""; position: absolute; inset: -9px; border: 3px solid var(--accent); border-radius: 50%; animation: ping 1.8s ease-out infinite; pointer-events: none; }
.map-stop.is-current .stop-pin::after { animation-delay: .9s; }
@keyframes ping { from { opacity: .9; transform: scale(.85); } to { opacity: 0; transform: scale(1.6); } }
.stop-check { position: absolute; top: -10px; right: -12px; display: grid; place-items: center; width: 26px; height: 26px; border: 2.5px solid var(--frame); border-radius: 50%; background: var(--lamp); color: #151515; font-size: 14px; font-weight: 700; transform: rotate(12deg); }

.stop-label { position: absolute; display: block; width: 200px; padding: 9px 12px 10px; border: 2px solid var(--frame); background: var(--surface); box-shadow: 3px 3px 0 var(--frame); text-align: left; transition: transform .2s, box-shadow .2s; }
.map-stop a:hover .stop-label { box-shadow: 5px 5px 0 var(--frame); }
.map-stop.is-current .stop-label { border-color: var(--accent); box-shadow: 3px 3px 0 var(--accent); }
.stop-label strong { display: block; font: 400 21px/1.05 var(--display); text-transform: uppercase; }
.stop-kicker { display: block; margin: 2px 0 7px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stop-label .mini-progress { height: 8px; }
.stop-status { display: block; margin-top: 5px; color: var(--muted); font-family: var(--type); font-size: 12px; }
.stop-chip { display: inline-block; margin-bottom: 5px; padding: 1px 7px; border: 1.5px solid var(--frame); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.is-done .stop-chip { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.is-current .stop-chip { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.is-started .stop-chip { background: var(--warn-bg); color: var(--warn-ink); border-color: var(--warn-ink); }
.stop-label.pos-below { top: 42px; left: 0; transform: translateX(-50%); }
.stop-label.pos-above { bottom: 42px; left: 0; transform: translateX(-50%); }
.stop-label.pos-below-right { top: 30px; left: 26px; }
.stop-label.pos-left { top: 0; right: 42px; transform: translateY(-50%); }
.stop-label.pos-right { top: 0; left: 42px; transform: translateY(-50%); }

.map-tag { position: absolute; z-index: 1; padding: 3px 9px; border: 2px solid var(--frame); background: var(--surface); font-family: var(--type); font-size: 13px; white-space: nowrap; box-shadow: 2px 2px 0 var(--frame); }
.map-tag.pos-above-start { transform: translate(-30%, -260%) rotate(-3deg); }
.map-tag.pos-right-start { transform: translate(30px, -50%) rotate(-2deg); }
.map-tag.finish.pos-below-left { transform: translate(-100%, 22px) rotate(2deg); }
.map-tag.finish.pos-left { transform: translate(calc(-100% - 28px), -90%) rotate(2deg); }
.map-tag.finish.reached { background: var(--accent); color: var(--on-accent); font-weight: 700; }

/* Entrada del mapa: paradas que se estampan una tras otra */
.view.active .map-stop .stop-pin { animation: stop-pop .5s calc(var(--i, 0) * 180ms + 250ms) cubic-bezier(.3, 1.7, .5, 1) backwards; }
.view.active .map-stop .stop-label { animation: fade-up .45s calc(var(--i, 0) * 180ms + 420ms) ease backwards; }
.view.active .map-stop .stop-label.pos-below, .view.active .map-stop .stop-label.pos-above { animation-name: fade-in; }
.view.active .map-stop .stop-label.pos-left, .view.active .map-stop .stop-label.pos-right { animation-name: fade-in; }
@keyframes stop-pop { from { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-40deg); } }
@keyframes fade-in { from { opacity: 0; } }
.view.active .map-tag { animation: fade-in .5s .2s backwards; }

@media (max-width: 960px) {
  .stop-label { width: 172px; padding: 7px 10px 8px; }
  .stop-label strong { font-size: 18px; }
  .stop-pin { width: 50px; height: 50px; }
  .stop-num { font-size: 22px; }
}
@media (max-width: 720px) {
  .adventure-map { margin-bottom: 24px; }
  .stop-label { width: 150px; }
  .stop-label.pos-left { right: 36px; }
  .stop-label.pos-right { left: 36px; }
}

/* Cita destacada */
.quote-panel { position: relative; margin: 56px 0 0; padding: 44px 48px; overflow: hidden; border: 3px solid var(--frame); background: #151515; color: #ebe5d5; box-shadow: var(--shadow-hard); }
.quote-dots { position: absolute; inset: 0; background-image: radial-gradient(#ebe5d5 1.4px, transparent 1.6px); background-size: 10px 10px; opacity: .14; -webkit-mask-image: radial-gradient(circle at 100% 0, #000, transparent 70%); mask-image: radial-gradient(circle at 100% 0, #000, transparent 70%); pointer-events: none; }
.quote-panel blockquote { position: relative; margin: 0; }
.quote-panel blockquote p { max-width: 900px; margin: 0; font: 400 44px/1.1 var(--display); text-transform: uppercase; }
.quote-panel figcaption { position: relative; margin-top: 18px; color: #e8c35a; font-family: var(--type); font-size: 16px; }
.quote-panel figcaption::before { content: "— "; }
.quote-panel.small { margin: 0; padding: 26px 24px; }
.quote-panel.small blockquote p { font-size: 26px; }
.quote-panel.small figcaption { font-size: 14px; }

.numbers-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.number-card { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 3px solid var(--frame); background: var(--surface); text-decoration: none; box-shadow: 3px 3px 0 var(--frame); transition: transform .15s, box-shadow .15s; }
.number-card:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--frame); }
.number-card strong { min-width: 60px; color: var(--accent); font: 400 40px/1 var(--display); }
.number-card span { display: flex; flex-direction: column; font-size: 14px; font-weight: 700; line-height: 1.3; }
.number-card small { color: var(--muted); font-size: 12px; font-weight: 500; }

.safety-strip { display: flex; align-items: center; gap: 16px; margin-top: 24px; padding: 16px 20px; border: 2px dashed var(--frame); background: var(--surface-soft); }
.safety-icon { color: var(--accent); font-size: 24px; }
.safety-strip div { flex: 1; }
.safety-strip strong { font-size: 15px; }
.safety-strip p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.safety-strip a { color: var(--accent); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; }
.safety-strip a:hover { text-decoration: underline; }

/* ============ Page intro ============ */
.page-intro { max-width: 760px; margin: 16px auto 40px; text-align: center; }
.page-intro h1 { font-size: 68px; }
.page-intro .caption { --rot: -.6deg; margin-top: 6px; text-align: left; transform: rotate(var(--rot)); }

/* ============ Panels ============ */
.module-layout { display: grid; grid-template-columns: 1.55fr .9fr; gap: 24px; max-width: 1000px; margin: 0 auto; align-items: start; }
.panel { padding: 26px 28px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.panel-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.panel-heading .eyebrow { margin-bottom: 2px; }
.panel-heading h2 { margin: 0; font: 400 30px/1.05 var(--display); text-transform: uppercase; }
.count-pill { flex: none; padding: 4px 12px; border: 2px solid var(--frame); background: var(--btn); color: var(--btn-ink); font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.progress-track { height: 14px; margin: 18px 0 6px; overflow: hidden; border: 2px solid var(--frame); background: var(--bg); }
.side-stack { display: grid; gap: 20px; position: sticky; top: 92px; }

/* Checklists */
.item-group { margin-top: 18px; }
.item-group h3 { display: flex; justify-content: space-between; margin: 0 0 4px; padding: 4px 8px; background: var(--btn); color: var(--btn-ink); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
.item-group h3 small { font-size: 12px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.item-row { display: flex; align-items: center; gap: 4px; border-bottom: 1.5px dashed var(--line); }
.item-row:last-child { border-bottom: 0; }
.item-main { display: flex; flex: 1; align-items: center; gap: 14px; min-height: 64px; padding: 8px 6px; cursor: pointer; transition: background .2s; }
.item-main:hover { background: var(--surface-soft); }
.item-main input { appearance: none; -webkit-appearance: none; display: grid; place-items: center; flex: none; width: 26px; height: 26px; margin: 0; border: 2.5px solid var(--frame); background: var(--surface); cursor: pointer; transition: background .15s; }
.item-main input::after { content: "✕"; color: var(--on-accent); font: 700 16px/1 var(--body); transform: scale(0) rotate(-20deg); transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.item-main input:checked { background: var(--accent); }
.item-main input:checked::after { transform: scale(1) rotate(0); }
.item-emoji { width: 36px; height: 36px; display: grid; place-items: center; flex: none; border: 2px solid var(--frame); border-radius: 50%; background: var(--bg); font-size: 17px; }
.item-copy { display: flex; flex: 1; flex-direction: column; gap: 2px; }
.item-copy strong { font-size: 16px; font-weight: 700; transition: color .2s; }
.item-copy small { color: var(--muted); font-size: 14px; line-height: 1.45; }
.item-row.checked .item-copy strong { color: var(--faint); text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: var(--accent); }
.remove-item { width: 34px; height: 34px; color: var(--faint); font-size: 14px; }
.remove-item:hover { color: var(--bad); }
.add-item { margin-top: 20px; padding-top: 18px; border-top: 2px dashed var(--frame); }
.add-item label { display: block; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.add-item-row { display: flex; gap: 10px; }
.add-item-row input { flex: 1; min-width: 0; }
.panel-footer { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-top: 18px; }
.fine-print { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.panel-footer .text-button { flex: none; font-size: 13px; }

.review-card { padding: 22px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.review-card h3 { margin-bottom: 8px; font: 400 26px/1.05 var(--display); text-transform: uppercase; }
.review-card > p:not(.eyebrow) { color: var(--muted); font-size: 14px; line-height: 1.6; }
.review-card.is-due { background: var(--bad-bg); }
.review-card.is-due h3 { color: var(--bad); }
.review-card.is-ok h3 { color: var(--ok); }
.tip-card { position: relative; padding: 22px; border: 2px dashed var(--frame); background: var(--surface-soft); }
.tip-card h3 { margin-bottom: 10px; font: 400 24px/1.05 var(--display); text-transform: uppercase; }
.tip-card > p:not(.eyebrow) { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.65; }

/* ============ Forms ============ */
input:not([type="checkbox"]), textarea { width: 100%; min-height: 48px; padding: 0 14px; border: 2px solid var(--frame); border-radius: 0; background: var(--bg); color: var(--ink); font-size: 16px; transition: box-shadow .15s, background .2s; }
textarea { padding: 12px 14px; resize: vertical; line-height: 1.5; font-family: var(--type); }
input:not([type="checkbox"]):focus, textarea:focus { outline: none; background: var(--surface); box-shadow: 3px 3px 0 var(--accent); }
input::placeholder, textarea::placeholder { color: var(--faint); }
input[aria-invalid="true"] { border-color: var(--bad); background: var(--bad-bg); }

.plan-form fieldset { margin: 0 0 28px; padding: 0; border: 0; }
.form-section-title { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 8px; padding: 0; }
.form-section-title > span { display: grid; width: 40px; height: 40px; flex: none; place-items: center; border: 2px solid var(--frame); background: var(--accent); color: var(--on-accent); font: 400 20px var(--display); }
.form-section-title strong { display: block; font: 400 24px/1.1 var(--display); text-transform: uppercase; }
.form-section-title small { display: block; color: var(--muted); font-size: 14px; }
.plan-form label { display: block; margin: 16px 0 6px; color: var(--ink-2); font-size: 14px; font-weight: 700; }
.optional { color: var(--faint); font-weight: 500; }
.contact-list { display: grid; gap: 4px; }
.contact-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 10px; align-items: end; }
.contact-row .remove-contact { margin-bottom: 4px; color: var(--muted); font-size: 14px; }
.contact-row:only-child .remove-contact { visibility: hidden; }
#add-contact { margin-top: 10px; }
.field-error { display: block; margin-top: 6px; color: var(--bad); font-size: 13px; font-weight: 700; }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.save-status { color: var(--ok); font-family: var(--type); font-size: 14px; }
.privacy-note { margin: 16px 0 0; color: var(--muted); font-size: 13px; }

.plan-card { padding: 22px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.plan-card-head { display: flex; gap: 12px; align-items: center; padding-bottom: 14px; margin-bottom: 4px; border-bottom: 3px solid var(--frame); }
.plan-card-head .eyebrow { margin-bottom: 2px; font-size: 11px; }
.plan-card-head strong { font: 400 22px/1.05 var(--display); text-transform: uppercase; }
.plan-summary { margin: 0; }
.plan-summary > div { padding: 12px 0; border-bottom: 1.5px dashed var(--line); }
.plan-summary dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.plan-summary dd { margin: 3px 0 0; font-family: var(--type); font-size: 16px; overflow-wrap: anywhere; }
.plan-summary dd.empty { color: var(--faint); }
.plan-summary dd a { color: var(--accent); text-decoration: none; }
.plan-card-numbers { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.plan-card-numbers span { padding: 3px 8px; border: 1.5px solid var(--frame); font-size: 12px; font-weight: 600; }
.plan-card-numbers b { color: var(--accent); }
.plan-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.side-hint { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }

/* ============ Simulator ============ */
.scenario-picker { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 920px; margin: 0 auto; }
.scenario-option { position: relative; display: flex; flex-direction: column; min-height: 230px; padding: 24px; overflow: hidden; border: 3px solid var(--frame); background: var(--surface); text-align: left; box-shadow: var(--shadow-hard); transition: transform .15s, box-shadow .15s; }
.scenario-option:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hover); }
.scenario-option .card-icon { position: static; margin-bottom: 14px; font-size: 40px; }
.scenario-option strong { font: 400 32px/1.05 var(--display); text-transform: uppercase; }
.scenario-option p { margin: 6px 0 0; color: var(--ink-2); font-size: 15px; line-height: 1.55; }
.scenario-option .scenario-meta { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 18px; color: var(--muted); font-family: var(--type); font-size: 14px; }
.scenario-option .scenario-meta span { color: var(--accent); font-family: var(--body); font-weight: 700; }
.scenario-option .card-state { position: absolute; top: 24px; right: 24px; }

.scenario-card { display: grid; grid-template-columns: .8fr 1.2fr; max-width: 980px; min-height: 440px; margin: 0 auto; overflow: hidden; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.scenario-visual { position: relative; overflow: hidden; min-height: 440px; border-right: 3px solid var(--frame); background-color: #2b2c2f; background-image: radial-gradient(rgba(235,229,213,.22) 1.3px, transparent 1.5px); background-size: 8px 8px; }
.scene { position: absolute; inset: 0; transition: opacity .4s; }
.scenario-visual .scene { opacity: 0; }
.scenario-visual[data-scene="flood"] .scene-flood, .scenario-visual[data-scene="power"] .scene-power, .scenario-visual[data-scene="heat"] .scene-heat, .scenario-visual[data-scene="storm"] .scene-storm { opacity: 1; }
.scenario-visual[data-scene="power"] { background-color: #121316; }
.cloud { position: absolute; top: 60px; left: 50%; color: #ebe5d5; font-size: 96px; line-height: 1; transform: translateX(-50%); text-shadow: 4px 4px 0 #000; }
.rain { position: absolute; inset: 0; background-image: repeating-linear-gradient(105deg, transparent 0 14px, rgba(235, 229, 213, .55) 14px 15.5px, transparent 15.5px 30px); background-size: 60px 60px; -webkit-mask-image: linear-gradient(to bottom, transparent 24%, #000 36%, #000 70%, transparent 85%); mask-image: linear-gradient(to bottom, transparent 24%, #000 36%, #000 70%, transparent 85%); animation: rain .6s linear infinite; }
@keyframes rain { to { background-position: -16px 60px; } }
.waterline { position: absolute; right: -15%; bottom: -50px; left: -15%; height: 150px; border-top: 4px solid #151515; border-radius: 50% 50% 0 0; background-color: #ebe5d5; background-image: repeating-linear-gradient(0deg, transparent 0 8px, rgba(21,21,21,.35) 8px 10px); transform: rotate(-6deg); animation: tide 5s ease-in-out infinite; }
@keyframes tide { 50% { transform: rotate(-4deg) translateY(-10px); } }
.little-house { position: absolute; z-index: 1; bottom: 66px; left: 44%; color: #ebe5d5; font-size: 92px; line-height: 1; text-shadow: 4px 4px 0 #000; }
.moon { position: absolute; top: 50px; right: 56px; width: 80px; height: 80px; border-radius: 50%; box-shadow: -18px 10px 0 0 #ebe5d5; }
.building { position: absolute; bottom: 0; left: 50%; display: grid; grid-template-columns: repeat(2, 30px); gap: 18px 22px; width: 150px; height: 240px; padding: 30px 34px; border: 3px solid #ebe5d5; border-bottom: 0; background: #151515; transform: translateX(-50%); }
.building i { display: block; height: 28px; border: 2px solid #3d3e42; background: #1d1e21; }
.building i:nth-child(4) { background: #e8c35a; border-color: #e8c35a; box-shadow: 0 0 22px 4px rgba(232, 195, 90, .45); animation: flicker 3.2s steps(1) infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 47% { opacity: .5; } 50% { opacity: 1; } }
.beam { position: absolute; bottom: 74px; left: 6%; width: 200px; height: 70px; background: linear-gradient(90deg, rgba(232, 195, 90, .6), transparent); clip-path: polygon(0 45%, 100% 0, 100% 100%, 0 55%); }
.scenario-tag { position: absolute; top: 16px; left: 16px; z-index: 2; padding: 4px 10px; border: 2px solid #151515; background: #ebe5d5; color: #151515; font-family: var(--type); font-size: 13px; box-shadow: 2px 2px 0 #151515; }
.scenario-content { display: flex; flex-direction: column; justify-content: center; padding: 30px 34px; }
.sim-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.sim-counter { color: var(--muted); font-family: var(--type); font-size: 14px; }
.stepper { display: flex; gap: 6px; margin-bottom: 18px; }
.stepper span { flex: 1; height: 10px; border: 2px solid var(--frame); background: var(--surface); transition: background .3s; }
.stepper span.is-current { background: var(--ink); }
.stepper span.is-right { background: var(--ok-line); }
.stepper span.is-wrong { background: var(--bad-line); }
.sim-context { display: block; max-width: none; margin-bottom: 18px; font-size: 15px; }
.scenario-content h2 { margin-bottom: 18px; font: 400 32px/1.08 var(--display); text-transform: uppercase; }
.choice-list { display: grid; gap: 12px; }
.choice { display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; min-height: 56px; padding: 14px 16px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink); text-align: left; font-size: 15px; font-weight: 500; line-height: 1.45; box-shadow: 3px 3px 0 var(--frame); transition: transform .15s, box-shadow .15s, background .2s; }
.choice:hover:not(:disabled) { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--frame); }
.choice .choice-mark { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--frame); border-radius: 50%; font-size: 14px; font-weight: 700; }
.choice:disabled { cursor: default; box-shadow: none; }
.choice:disabled:not(.correct):not(.incorrect) { opacity: .45; }
.choice.correct { background: var(--ok-bg); border-color: var(--ok); }
.choice.correct .choice-mark { background: var(--ok); border-color: var(--ok); color: var(--surface); }
.choice.incorrect { background: var(--bad-bg); border-color: var(--bad); }
.choice.incorrect .choice-mark { background: var(--bad); border-color: var(--bad); color: var(--surface); }
/* Respuesta como globo de diálogo */
.feedback { position: relative; margin-top: 22px; padding: 14px 18px; border: 2.5px solid var(--frame); border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 15px; line-height: 1.6; box-shadow: 3px 3px 0 var(--frame); transform-origin: 44px -10px; animation: balloon-pop .45s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.feedback::before { content: ""; position: absolute; top: -14px; left: 34px; width: 22px; height: 14px; background: var(--frame); clip-path: polygon(0 100%, 30% 0, 100% 100%); }
.feedback::after { content: ""; position: absolute; top: -9px; left: 38px; width: 15px; height: 11px; background: var(--surface); clip-path: polygon(0 100%, 30% 0, 100% 100%); }
.feedback strong { display: block; margin-bottom: 2px; color: var(--ok); font: 400 20px var(--display); text-transform: uppercase; letter-spacing: .02em; }
.feedback.error strong { color: var(--bad); }
#sim-next { align-self: flex-start; margin-top: 18px; }

.summary-card { max-width: 660px; margin: 0 auto; padding: 40px 36px; border: 3px solid var(--frame); background: var(--surface); text-align: center; box-shadow: var(--shadow-hard); animation: appear .4s ease both; }
.summary-emoji { display: inline-grid; place-items: center; width: 80px; height: 80px; margin-bottom: 16px; border: 3px solid var(--frame); border-radius: 50%; background: var(--warn-bg); font-size: 36px; animation: pop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.summary-card h2 { font: 400 40px/1.05 var(--display); text-transform: uppercase; }
.summary-card > p:not(.eyebrow) { color: var(--muted); font-size: 16px; }
.summary-points { display: grid; gap: 10px; margin: 22px 0 26px; padding: 0; list-style: none; text-align: left; }
.summary-points li { display: flex; gap: 10px; padding: 12px 14px; border: 2px solid var(--frame); background: var(--bg); font-family: var(--type); font-size: 15px; line-height: 1.5; }
.summary-points li::before { content: "✱"; color: var(--accent); }
.summary-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.disclaimer { max-width: 980px; margin: 24px auto 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.disclaimer strong { color: var(--ink-2); }

/* ============ Progress ============ */
.progress-overview { display: flex; align-items: center; gap: 36px; max-width: 860px; margin: 0 auto 32px; padding: 28px 32px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.big-ring { position: relative; flex: none; width: 150px; height: 150px; }
.big-ring .ring-bg, .big-ring .ring-fg { stroke-width: 12; }
.big-ring-value { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.big-ring-value strong { font: 400 44px/1 var(--display); }
.big-ring-value small { margin-top: 4px; color: var(--muted); font-family: var(--type); font-size: 13px; }
.overview-copy h2 { margin-bottom: 6px; font: 400 36px/1.05 var(--display); text-transform: uppercase; }
.overview-copy p { color: var(--muted); font-size: 16px; }
.mission-list { max-width: 860px; margin: 0 auto; border-top: 3px solid var(--frame); }
.mission-row { display: flex; align-items: center; width: 100%; min-height: 92px; gap: 18px; padding: 16px 12px; border-bottom: 2px dashed var(--line); text-decoration: none; transition: background .2s; }
.mission-row:hover { background: var(--surface); }
.mission-number { width: 44px; color: var(--accent); font: 400 34px/1 var(--display); }
.mission-emoji { display: grid; width: 48px; height: 48px; flex: none; place-items: center; border: 2px solid var(--frame); border-radius: 50%; background: var(--surface); font-size: 22px; }
.mission-info { display: flex; flex: 1; flex-direction: column; gap: 4px; }
.mission-info strong { font: 400 24px/1.05 var(--display); text-transform: uppercase; }
.mission-info small { color: var(--muted); font-size: 14px; }
.mission-info .mini-progress { max-width: 280px; margin-top: 4px; }
.mission-state { flex: none; padding: 3px 10px; border: 2px solid var(--frame); color: var(--ink); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; max-width: 860px; margin: 0 auto; padding: 0; list-style: none; }
.badge { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 10px; border: 2px dashed var(--line); text-align: center; transition: background .3s, border-color .3s; }
.badge-icon { display: grid; place-items: center; width: 60px; height: 60px; border: 2px dashed var(--faint); border-radius: 50%; font-size: 26px; filter: grayscale(1); opacity: .4; transition: filter .3s, opacity .3s; }
.badge strong { font: 400 17px/1.1 var(--display); text-transform: uppercase; }
.badge small { color: var(--muted); font-size: 12px; line-height: 1.4; }
.badge.earned { border: 3px solid var(--frame); background: var(--surface); box-shadow: 3px 3px 0 var(--frame); }
.badge.earned .badge-icon { border: 3px solid var(--accent); background: var(--accent-soft); filter: none; opacity: 1; transform: rotate(-8deg); }
.community-note { display: flex; align-items: center; gap: 14px; max-width: 860px; margin: 28px auto 0; padding: 18px 20px; border: 2px dashed var(--frame); background: var(--surface-soft); }
.community-note > span { color: var(--accent); font-size: 24px; }
.community-note p { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.danger-zone { max-width: 860px; margin: 22px auto 0; text-align: center; }

/* ============ Download cards ============ */
.download-card { display: flex; align-items: center; gap: 16px; margin-top: 28px; padding: 20px 22px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.download-card.narrow { max-width: 860px; margin: 28px auto 0; }
.download-card > div { flex: 1; }
.download-card strong { font: 400 24px/1.05 var(--display); text-transform: uppercase; }
.download-card p { margin: 4px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.download-card .button { flex: none; }
.download-icon { display: grid; place-items: center; flex: none; width: 50px; height: 50px; border: 2px solid var(--frame); background: var(--accent); color: var(--on-accent); font-size: 24px; }
.download-card.stacked { flex-wrap: wrap; align-items: flex-start; margin-top: 0; padding: 20px; }
.download-card.stacked > div { min-width: calc(100% - 66px); }
.download-card.stacked .download-icon { width: 42px; height: 42px; font-size: 20px; }

/* ============ Footer & toast ============ */
.footer { border-top: 3px solid var(--frame); background: var(--bg); color: var(--muted); font-size: 13px; }
.footer-inner { max-width: 1180px; margin: 0 auto; padding: 20px 32px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.footer-brand { flex: none; color: var(--ink); font-size: 20px; }
.footer-brand .brand-mark { width: 28px; height: 28px; font-size: 15px; }
.tribute { max-width: 560px; margin: 0; font-family: var(--type); line-height: 1.5; text-align: center; }
.footer-links { display: flex; flex: none; flex-wrap: wrap; gap: 6px 18px; }
.footer-links a { color: var(--accent); font-weight: 700; text-decoration: none; }
.footer-links a:hover, .credit:hover { text-decoration: underline; text-decoration-thickness: 2px; }
.credit { color: var(--ink); font-family: var(--body); font-weight: 700; text-decoration: none; }
.privacy-note a { color: var(--accent); font-weight: 700; }

/* ============ Privacidad y cookies ============ */
.policy { max-width: 860px; margin: 0 auto; }
.policy-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 28px; }
.policy-point { padding: 20px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.policy-point > span { display: block; margin-bottom: 8px; font-size: 30px; }
.policy-point strong { display: block; font: 400 24px/1.05 var(--display); text-transform: uppercase; }
.policy-point p { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.policy-body { padding: 8px 32px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); }
.policy-section { padding: 24px 0; border-bottom: 2px dashed var(--line); }
.policy-section:last-child { border-bottom: 0; }
.policy-section h2 { display: flex; align-items: baseline; gap: 12px; margin-bottom: 12px; font: 400 26px/1.1 var(--display); text-transform: uppercase; }
.policy-section h2 span { color: var(--accent); font-size: 22px; }
.policy-section p, .policy-section li { color: var(--ink-2); font-size: 16px; line-height: 1.7; }
.policy-section p:last-child { margin-bottom: 0; }
.policy-section ul { margin: 0 0 14px; padding-left: 22px; }
.policy-section li { margin-bottom: 6px; }
.policy-section li::marker { content: "✱  "; color: var(--accent); }
.policy-section a { color: var(--accent); font-weight: 700; }
.legal-note { padding: 14px 16px; border: 2px solid var(--frame); background: var(--bg); font-family: var(--type); font-size: 14px !important; line-height: 1.6 !important; }
.table-wrap { overflow-x: auto; margin: 4px 0 14px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.data-table th { padding: 8px 12px; background: var(--btn); color: var(--btn-ink); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 10px 12px; border-bottom: 1.5px dashed var(--line); color: var(--ink-2); vertical-align: top; line-height: 1.5; }
.data-table td:first-child { color: var(--ink); font-weight: 700; white-space: nowrap; }
.policy-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

/* Aviso de privacidad (primera visita) */
.privacy-notice { position: fixed; left: 20px; bottom: 20px; z-index: 55; display: flex; gap: 14px; max-width: 400px; padding: 18px 20px; border: 3px solid var(--frame); background: var(--surface); box-shadow: var(--shadow-hard); animation: notice-in .6s 1.2s cubic-bezier(.2, 1.3, .4, 1) backwards; }
.privacy-notice.leaving { animation: notice-out .35s ease forwards; }
.notice-icon { font-size: 30px; line-height: 1; }
.privacy-notice strong { display: block; font: 400 22px/1.05 var(--display); text-transform: uppercase; }
.privacy-notice p { margin: 6px 0 12px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.notice-actions { display: flex; align-items: center; gap: 16px; }
.notice-actions .button { min-height: 40px; padding: 0 16px; font-size: 14px; }
@keyframes notice-in { from { opacity: 0; transform: translateY(40px) rotate(-3deg); } }
@keyframes notice-out { to { opacity: 0; transform: translateY(40px) rotate(2deg); } }
@media (max-width: 640px) {
  .policy-summary { grid-template-columns: 1fr; gap: 12px; }
  .policy-body { padding: 4px 18px; }
  .policy-section h2 { font-size: 22px; }
  .policy-section p, .policy-section li { font-size: 15px; }
  .privacy-notice { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  .data-table td:first-child { white-space: normal; }
}
@media print { .privacy-notice { display: none !important; } }
.toast-region { position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 60; transform: translateX(-50%); pointer-events: none; }
.toast { padding: 12px 18px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink); box-shadow: 4px 4px 0 var(--frame); font-family: var(--type); font-size: 15px; white-space: nowrap; animation: toast-in .3s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) rotate(-4deg) scale(.85); } 60% { transform: translateY(-3px) rotate(1deg) scale(1.03); } }

/* ============ Responsive ============ */
@media (max-width: 1040px) {
  .topbar-inner { padding: 0 20px; gap: 12px; }
  .nav-link { padding: 8px 9px; font-size: 14px; }
  .chip-label { display: none; }
}
@media (max-width: 960px) {
  main { padding: 28px 20px 64px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { min-height: 380px; }
  .hero h1 { font-size: 66px; }
  .numbers-grid { grid-template-columns: repeat(2, 1fr); }
  .module-layout { grid-template-columns: 1fr; }
  .side-stack { position: static; grid-template-columns: 1fr 1fr; }
  .plan-layout .side-stack { grid-template-columns: 1fr; }
  .scenario-card { grid-template-columns: .7fr 1.3fr; }
  .badge-grid { grid-template-columns: repeat(3, 1fr); }
  .quote-panel blockquote p { font-size: 36px; }
  .footer-inner { flex-wrap: wrap; padding: 20px; }
  .tribute { order: 3; max-width: none; text-align: left; }
}
@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .main-nav { position: absolute; top: 73px; right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; padding: 12px 16px 18px; border-bottom: 3px solid var(--frame); background: var(--bg); }
  .main-nav.open { display: flex; animation: appear .2s ease both; }
  .nav-link { padding: 14px; font-size: 17px; }
  .nav-link-mobile { display: block; }
  .topbar-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .topbar-inner { height: 62px; padding: 0 16px; }
  .main-nav { top: 65px; }
  .brand { font-size: 21px; }
  main { padding: 20px 16px 56px; }
  .hero-copy { padding: 28px 20px; }
  .hero h1 { font-size: 52px; }
  .hero-lead { font-size: 16px; }
  .hero-actions .button { flex: 1 1 auto; }
  .hero-art { min-height: 280px; }
  .section-heading { align-items: flex-start; margin-top: 44px; }
  .section-heading h2 { font-size: 30px; }
  .heading-aside { display: none; }
  .feature-grid { grid-template-columns: 1fr; gap: 16px; }
  .feature-card { min-height: 0; padding: 18px 20px; }
  .card-icon { top: 66px; right: 18px; font-size: 32px; }
  .quote-panel { padding: 28px 22px; }
  .quote-panel blockquote p { font-size: 28px; }
  .numbers-grid { gap: 10px; }
  .number-card { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px; }
  .safety-strip { flex-wrap: wrap; align-items: flex-start; }
  .safety-strip div { min-width: calc(100% - 40px); }
  .safety-strip a { margin-left: 40px; }
  .page-intro { margin: 12px auto 28px; }
  .page-intro h1 { font-size: 48px; }
  .page-intro .caption { font-size: 15px; }
  .panel { padding: 20px 16px; }
  .panel-heading h2 { font-size: 25px; }
  .panel-footer { flex-direction: column; }
  .side-stack { grid-template-columns: 1fr; }
  .item-main { gap: 10px; padding: 8px 2px; }
  .item-emoji { width: 32px; height: 32px; font-size: 15px; }
  .contact-row { grid-template-columns: 1fr 40px; padding-bottom: 12px; border-bottom: 1.5px dashed var(--line); }
  .contact-row .field:nth-child(2) { grid-column: 1; grid-row: 2; }
  .contact-row .remove-contact { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .scenario-picker { grid-template-columns: 1fr; }
  .scenario-card { grid-template-columns: 1fr; }
  .scenario-visual { min-height: 200px; border-right: 0; border-bottom: 3px solid var(--frame); }
  .cloud { top: 24px; font-size: 64px; }
  .little-house { bottom: 30px; font-size: 62px; }
  .waterline { height: 90px; bottom: -45px; }
  .building { height: 150px; padding: 20px 28px; gap: 12px 18px; }
  .moon { top: 26px; right: 40px; width: 54px; height: 54px; }
  .beam { bottom: 40px; }
  .scenario-content { padding: 22px 18px 26px; }
  .scenario-content h2 { font-size: 27px; }
  .summary-card { padding: 30px 20px; }
  .progress-overview { flex-direction: column; text-align: center; gap: 20px; padding: 24px 18px; }
  .mission-row { gap: 12px; padding: 14px 4px; }
  .mission-number { display: none; }
  .mission-info strong { font-size: 20px; }
  .mission-state { font-size: 11px; padding: 3px 7px; }
  .badge-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .download-card { flex-wrap: wrap; align-items: flex-start; }
  .download-card > div { min-width: calc(100% - 66px); }
  .download-card .button { width: 100%; }
  .toast { white-space: normal; text-align: center; }
}

/* =========================================================
   Animaciones
   ========================================================= */

/* Pase de página entre secciones (View Transitions API) */
.topbar { view-transition-name: topbar; }
::view-transition-old(root) { animation: vt-out .38s ease both; }
::view-transition-new(root) { animation: vt-wipe .5s cubic-bezier(.7, 0, .25, 1) both; }
@keyframes vt-out { to { opacity: .35; transform: translateX(-36px); } }
@keyframes vt-wipe { from { clip-path: inset(0 0 0 100%); } to { clip-path: inset(0 0 0 0); } }

/* Entrada del inicio: cuadro de narración que cae, título que se estampa */
.view.active .hero-copy .caption { animation: drop-in .55s .1s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.view.active .hero h1 { animation: stamp .45s .25s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.hero h1 em, .page-intro h1 em { display: inline-block; }
.view.active .hero h1 em { animation: stamp-em .55s .62s cubic-bezier(.3, 1.8, .5, 1) backwards; }
.view.active .hero-lead { animation: fade-up .5s .8s ease backwards; }
.view.active .hero-actions { animation: fade-up .5s .92s ease backwards; }
.view.active .hero-note { animation: fade-up .5s 1.04s ease backwards; }
.view.active .hero-art { animation: panel-in .7s .15s cubic-bezier(.2, 1.2, .4, 1) backwards; }
.view.active .art-caption { animation: drop-in .5s 1s cubic-bezier(.3, 1.5, .5, 1) backwards; --rot: 1.5deg; }

/* Entrada de cada sección */
.view.active .page-intro .eyebrow { animation: fade-up .4s .05s ease backwards; }
.view.active .page-intro h1 { animation: stamp .45s .12s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.view.active .page-intro h1 em { animation: stamp-em .5s .42s cubic-bezier(.3, 1.8, .5, 1) backwards; }
.view.active .page-intro .caption { animation: drop-in .5s .55s cubic-bezier(.3, 1.5, .5, 1) backwards; }

@keyframes stamp { from { opacity: 0; transform: scale(1.35); filter: blur(3px); } }
@keyframes stamp-em { from { opacity: 0; transform: scale(2.2) rotate(-10deg); } }
@keyframes drop-in { from { opacity: 0; transform: translateY(-28px) rotate(calc(var(--rot, 0deg) - 7deg)); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes panel-in { from { opacity: 0; transform: translateX(40px) rotate(2.5deg); } }

/* Viñetas que aparecen al hacer scroll */
.reveal { opacity: 0; }
.reveal.in { opacity: 1; animation: reveal-in .6s var(--d, 0ms) cubic-bezier(.2, 1.1, .35, 1) backwards; }
@keyframes reveal-in { from { opacity: 0; transform: translateY(30px) rotate(-1.2deg) scale(.98); } }

/* Insignias que se estampan en cascada */
.view.active .badge { animation: badge-in .5s calc(var(--i, 0) * 80ms + 150ms) cubic-bezier(.3, 1.5, .5, 1) backwards; }
@keyframes badge-in { from { opacity: 0; transform: scale(.6) rotate(-6deg); } }
.badge.just-earned .badge-icon { animation: earn 1s cubic-bezier(.3, 1.6, .5, 1) both; }
@keyframes earn { 0% { transform: scale(2.4) rotate(-30deg); opacity: 0; } 60% { transform: scale(.9) rotate(-4deg); opacity: 1; } 100% { transform: rotate(-8deg); } }

/* Menú móvil en cascada */
.main-nav.open .nav-link { animation: fade-up .3s backwards; }
.main-nav.open .nav-link:nth-child(2) { animation-delay: .04s; }
.main-nav.open .nav-link:nth-child(3) { animation-delay: .08s; }
.main-nav.open .nav-link:nth-child(4) { animation-delay: .12s; }
.main-nav.open .nav-link:nth-child(5) { animation-delay: .16s; }
.main-nav.open .nav-link:nth-child(6) { animation-delay: .2s; }

/* Microinteracciones */
.button span { display: inline-block; transition: transform .2s cubic-bezier(.3, 1.6, .5, 1); }
.button:hover span:last-child { transform: translateX(4px); }
.feature-card:hover .card-icon, .scenario-option:hover .card-icon { animation: wobble .6s ease; }
@keyframes wobble { 25% { transform: rotate(-12deg) scale(1.1); } 50% { transform: rotate(9deg) scale(1.1); } 75% { transform: rotate(-4deg); } }
.feature-card:hover .chapter-num { animation: jolt .35s ease; }
@keyframes jolt { 40% { transform: translate(-2px, -3px) skewX(-6deg); } }
.number-card:hover strong { animation: ring .5s ease; }
@keyframes ring { 20% { transform: rotate(-8deg); } 40% { transform: rotate(7deg); } 60% { transform: rotate(-5deg); } 80% { transform: rotate(3deg); } }
.download-card:hover .download-icon { animation: drop-bounce .6s ease; }
@keyframes drop-bounce { 30% { transform: translateY(6px); } 55% { transform: translateY(-3px); } }
.theme-toggle:hover span { display: inline-block; animation: spin .6s ease; }
@keyframes spin { to { transform: rotate(360deg); } }
.brand:hover .brand-mark { animation: wobble .6s ease; }

/* Checklists: tilde con sello */
.item-row.just-checked { animation: row-flash .9s ease; }
.item-row.just-checked .item-main input { animation: stamp-check .45s cubic-bezier(.3, 1.8, .5, 1); }
.item-row.just-checked .item-emoji { animation: wobble .6s ease; }
@keyframes row-flash { from { background: var(--accent-soft); } }
@keyframes stamp-check { from { transform: scale(1.7) rotate(-14deg); } }

/* Simulador */
.view.active #choice-list .choice.incorrect { animation: shake .45s ease; animation-delay: 0s; }
.view.active #choice-list .choice.correct { animation: pulse-ok .55s cubic-bezier(.3, 1.6, .5, 1); animation-delay: 0s; }
@keyframes shake { 20% { transform: translateX(-8px) rotate(-1deg); } 40% { transform: translateX(7px) rotate(1deg); } 60% { transform: translateX(-5px); } 80% { transform: translateX(3px); } }
@keyframes pulse-ok { 40% { transform: scale(1.03); } }
@keyframes balloon-pop { from { opacity: 0; transform: scale(.4); } }
.step-in { animation: drop-in .45s cubic-bezier(.3, 1.5, .5, 1) backwards; }
.step-in-late { animation: stamp .4s .1s cubic-bezier(.3, 1.6, .5, 1) backwards; }
.view.active #choice-list .choice { animation: fade-up .4s backwards; }
#choice-list .choice:nth-child(2) { animation-delay: .07s; }
#choice-list .choice:nth-child(3) { animation-delay: .14s; }
.scene-flood::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: lightning 7s infinite; }
@keyframes lightning { 0%, 88%, 100% { opacity: 0; } 89% { opacity: .75; } 90% { opacity: .1; } 91.5% { opacity: .55; } 93% { opacity: 0; } }
.cloud { animation: cloud-drift 6s ease-in-out infinite; }
@keyframes cloud-drift { 50% { transform: translateX(calc(-50% + 12px)); } }
.beam { transform-origin: 0 50%; animation: sweep 3.5s ease-in-out infinite alternate; }
@keyframes sweep { from { transform: rotate(-10deg); } to { transform: rotate(8deg); } }
.moon { animation: float 8s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* Ilustración del inicio */
.hero-svg .win { animation: win-flicker 6s steps(1) infinite; }
@keyframes win-flicker { 0%, 100% { fill: #e8c35a; } 61% { fill: #b8922f; } 62% { fill: #e8c35a; } 64% { fill: #a7832a; } 66% { fill: #e8c35a; } }
.hero-svg .cone { animation: cone-pulse 3s ease-in-out infinite; }
@keyframes cone-pulse { 50% { opacity: .22; } }
.hero-svg .lamp { animation: lamp-glow 3s ease-in-out infinite; }
@keyframes lamp-glow { 50% { fill: #fff2b8; } }
.hero-svg .tw rect { animation: twinkle-win 5s steps(1) infinite; }
.hero-svg .tw rect:nth-child(2) { animation-delay: -1.5s; }
.hero-svg .tw rect:nth-child(3) { animation-delay: -3s; }
.hero-svg .tw rect:nth-child(4) { animation-delay: -4.2s; }
@keyframes twinkle-win { 0%, 100% { opacity: 1; } 40% { opacity: 0; } 70% { opacity: 1; } }
.hero-svg .smoke circle { transform-box: fill-box; transform-origin: center; opacity: 0; animation: smoke 4.5s ease-out infinite; }
.hero-svg .smoke circle:nth-child(2) { animation-delay: 1.5s; }
.hero-svg .smoke circle:nth-child(3) { animation-delay: 3s; }
@keyframes smoke { 0% { opacity: 0; transform: translate(0, 0) scale(.5); } 15% { opacity: .55; } 100% { opacity: 0; transform: translate(26px, -90px) scale(2.6); } }

/* Segunda capa de nieve, más cercana y rápida (paralaje) */
.snow::after { content: ""; position: absolute; inset: 0;
  background-image:
    radial-gradient(4px 4px at 40px 60px, #fff 50%, transparent 52%),
    radial-gradient(3.5px 3.5px at 190px 10px, rgba(255,255,255,.95) 50%, transparent 52%),
    radial-gradient(4.5px 4.5px at 120px 200px, rgba(255,255,255,.85) 50%, transparent 52%);
  background-size: 260px 260px, 300px 300px, 280px 280px;
  animation: snowfall-near 7s linear infinite;
}
@keyframes snowfall-near { to { background-position: -40px 260px, 30px 300px, -20px 280px; } }
.snow.slow { animation-duration: 22s; opacity: .55; }
.snow.slow::after { animation-duration: 12s; }

/* Onomatopeyas y explosión de copos */
.fx-layer { position: fixed; z-index: 70; width: 0; height: 0; pointer-events: none; }
.fx-word { position: absolute; left: 0; top: 0; display: grid; place-items: center; padding: 22px 26px; color: #b83c1c; font: 400 30px/1 var(--display); letter-spacing: .02em; text-transform: uppercase; white-space: nowrap; transform: translate(-50%, -50%); animation: fx-word 1.1s cubic-bezier(.3, 1.6, .5, 1) forwards; }
.fx-word::before { content: ""; position: absolute; inset: -6px -10px; z-index: -1; background: #e8c35a; border: 3px solid #151515; clip-path: polygon(50% 0, 61% 18%, 82% 6%, 78% 29%, 100% 32%, 84% 50%, 100% 68%, 78% 71%, 82% 94%, 61% 82%, 50% 100%, 39% 82%, 18% 94%, 22% 71%, 0 68%, 16% 50%, 0 32%, 22% 29%, 18% 6%, 39% 18%); filter: drop-shadow(3px 3px 0 #151515); }
.fx-word::after { content: ""; position: absolute; inset: 2px -2px; z-index: -1; background: #151515; clip-path: polygon(50% 0, 61% 18%, 82% 6%, 78% 29%, 100% 32%, 84% 50%, 100% 68%, 78% 71%, 82% 94%, 61% 82%, 50% 100%, 39% 82%, 18% 94%, 22% 71%, 0 68%, 16% 50%, 0 32%, 22% 29%, 18% 6%, 39% 18%); transform: translate(5px, 5px); opacity: .9; z-index: -2; }
@keyframes fx-word {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.2) rotate(-25deg); }
  25% { opacity: 1; transform: translate(-50%, -80%) scale(1.15) rotate(-6deg); }
  70% { opacity: 1; transform: translate(-50%, -90%) scale(1) rotate(-8deg); }
  100% { opacity: 0; transform: translate(-50%, -130%) scale(.9) rotate(-10deg); }
}
.fx-flake { position: absolute; left: -5px; top: -5px; width: var(--s, 9px); height: var(--s, 9px); border: 2px solid #151515; background: #ebe5d5; animation: fx-flake .9s cubic-bezier(.15, .7, .3, 1) forwards; }
.fx-flake:nth-child(3n) { border-radius: 50%; background: #b83c1c; }
.fx-flake:nth-child(3n+1) { background: #e8c35a; transform: rotate(45deg); }
@keyframes fx-flake {
  from { opacity: 1; transform: translate(0, 0) rotate(0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(.4); }
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; }
  .fx-layer { display: none; }
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ============ Hoja para PDF / impresión ============ */
.print-sheet { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  html, body { background: #fff !important; color: #151515 !important; }
  body > *:not(.print-sheet) { display: none !important; }
  .print-sheet { display: block; font-family: var(--body); font-size: 11pt; line-height: 1.45; color: #151515; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-sheet * { animation: none !important; transition: none !important; }
}
.ps-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 10pt; margin-bottom: 14pt; border-bottom: 3pt solid #151515; }
.ps-brand { display: flex; align-items: center; gap: 8pt; font: 400 15pt var(--display); text-transform: uppercase; letter-spacing: .02em; }
.ps-brand .brand-mark { width: 22pt; height: 22pt; border: 1.5pt solid #151515; background: #b83c1c; color: #fff; font-size: 12pt; }
.ps-brand span:last-child span { color: #b83c1c; }
.ps-head h1 { margin: 6pt 0 0; font: 400 28pt/1 var(--display); text-transform: uppercase; }
.ps-head p { margin: 4pt 0 0; color: #55514a; font-family: var(--type); font-size: 10pt; }
.ps-date { color: #55514a; font-family: var(--type); font-size: 9pt; text-align: right; white-space: pre-line; }
.ps-section { margin-bottom: 16pt; break-inside: avoid-page; }
.ps-section.allow-break { break-inside: auto; }
.ps-section.page-start { break-before: page; }
.ps-section h2 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8pt; padding: 3pt 7pt; background: #151515; color: #fff; font: 400 14pt var(--display); text-transform: uppercase; letter-spacing: .03em; }
.ps-section h2 small { color: #e8c35a; font: 600 9pt var(--body); text-transform: none; }
.ps-groups { columns: 2; column-gap: 18pt; }
.ps-group { break-inside: avoid; margin-bottom: 10pt; }
.ps-group h3 { margin: 0 0 4pt; color: #b83c1c; font-size: 8.5pt; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.ps-checklist { margin: 0; padding: 0; }
.ps-check { display: flex; gap: 7pt; padding: 4pt 0; border-bottom: .6pt dashed #b9b2a0; list-style: none; break-inside: avoid; }
.ps-box { display: grid; place-items: center; flex: none; width: 11pt; height: 11pt; margin-top: 1.5pt; border: 1.4pt solid #151515; color: #fff; font-size: 8pt; font-weight: 700; line-height: 1; }
.ps-box.on { background: #b83c1c; }
.ps-check strong { display: block; font-size: 10.5pt; font-weight: 700; }
.ps-check small { display: block; color: #55514a; font-size: 8.5pt; line-height: 1.35; }
.ps-review { display: flex; gap: 24pt; margin-top: 6pt; font-size: 9.5pt; }
.ps-review span { flex: 1; }
.ps-review b { display: inline-block; min-width: 90pt; border-bottom: .8pt solid #151515; font-family: var(--type); font-weight: 400; }
.ps-fields { display: grid; gap: 8pt; margin: 0; }
.ps-field dt { color: #55514a; font-size: 8.5pt; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.ps-field dd { min-height: 18pt; margin: 2pt 0 0; padding-bottom: 2pt; border-bottom: .8pt solid #151515; font-family: var(--type); font-size: 12pt; }
.ps-field dd.multi { min-height: 40pt; background: repeating-linear-gradient(transparent 0 19pt, #b9b2a0 19pt 19.8pt); border-bottom: 0; white-space: pre-wrap; }
.ps-contacts { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.ps-contacts th { padding: 0 0 3pt; color: #55514a; font-size: 8.5pt; font-weight: 700; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
.ps-contacts td { height: 20pt; padding: 3pt 8pt 2pt 0; border-bottom: .8pt solid #151515; font-family: var(--type); font-size: 11.5pt; }
.ps-numbers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6pt; }
.ps-number { padding: 7pt 9pt; border: 1.5pt solid #151515; }
.ps-number strong { display: block; color: #b83c1c; font: 400 22pt/1 var(--display); }
.ps-number span { display: block; margin-top: 3pt; font-size: 9pt; font-weight: 700; }
.ps-number small { display: block; color: #55514a; font-size: 7.5pt; }
.ps-note { margin: 6pt 0 0; color: #55514a; font-size: 8.5pt; }
.ps-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 12pt; }
.ps-keys h3 { margin: 0 0 4pt; font: 400 13pt var(--display); text-transform: uppercase; }
.ps-keys ul { margin: 0; padding-left: 13pt; font-size: 9.5pt; }
.ps-keys li { margin-bottom: 3pt; }
.ps-foot { display: flex; gap: 8pt; margin-top: 14pt; padding: 8pt 10pt; border: 1.5pt solid #151515; color: #2e2d2a; font-family: var(--type); font-size: 8.5pt; line-height: 1.45; break-inside: avoid; }
.ps-foot b { color: #151515; }

/* =========================================================
   Áreas seguras (app de Android de borde a borde y celulares con notch).
   Capacitor inyecta --safe-area-inset-*; en la web se usa env().
   ========================================================= */
:root {
  --sa-top: var(--safe-area-inset-top, env(safe-area-inset-top, 0px));
  --sa-bottom: var(--safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sa-left: var(--safe-area-inset-left, env(safe-area-inset-left, 0px));
  --sa-right: var(--safe-area-inset-right, env(safe-area-inset-right, 0px));
}
html { scroll-padding-top: calc(90px + var(--sa-top)); }
body { padding-left: var(--sa-left); padding-right: var(--sa-right); }
.topbar { padding-top: var(--sa-top); }
.footer-inner { padding-bottom: calc(20px + var(--sa-bottom)); }
.privacy-notice { bottom: calc(20px + var(--sa-bottom)); }
.toast-region { bottom: calc(20px + var(--sa-bottom)); }
@media (max-width: 860px) { .main-nav { top: calc(73px + var(--sa-top)); } }
@media (max-width: 640px) {
  .main-nav { top: calc(65px + var(--sa-top)); }
  .privacy-notice { bottom: calc(12px + var(--sa-bottom)); }
}

/* =========================================================
   Intro: nevada nocturna, nombre estampado y telón
   ========================================================= */
.intro { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden; padding: calc(24px + var(--sa-top)) 20px calc(24px + var(--sa-bottom)); background: #0e0f11; color: #ebe5d5; animation: intro-failsafe .01s 20s forwards; }
.intro[hidden] { display: none !important; }
@keyframes intro-failsafe { to { visibility: hidden; pointer-events: none; } }
.intro-snow { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 2; pointer-events: none; }
.intro-dots { position: absolute; inset: 0; background-image: radial-gradient(rgba(235, 229, 213, .16) 1.3px, transparent 1.6px); background-size: 9px 9px; -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 75%); mask-image: linear-gradient(to bottom, #000 0%, transparent 75%); }
.intro-city { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 34vh; z-index: 1; }
.intro-lamp { animation: lamp-glow 2.4s ease-in-out infinite; }
.intro-cone { animation: cone-pulse 2.4s ease-in-out infinite; }
.iw { animation: twinkle-win 4s steps(1) infinite; }
.iw2 { animation-delay: -1.3s; } .iw3 { animation-delay: -2.6s; } .iw4 { animation-delay: -3.4s; }

.intro-stage { position: relative; z-index: 3; display: grid; justify-items: center; gap: 18px; max-width: 920px; margin-bottom: 14vh; text-align: center; }
.intro-caption { min-height: 2.6em; margin: 0; padding: 10px 16px; border: 2px solid #ebe5d5; background: rgba(14, 15, 17, .82); color: #ebe5d5; font: 18px/1.5 var(--type); box-shadow: 4px 4px 0 #000; transform: rotate(-1.2deg); }
.intro-caption:empty { visibility: hidden; }
.intro-caption .cursor { display: inline-block; width: .55em; margin-left: 2px; border-bottom: 2px solid currentColor; animation: blink .8s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.intro-title { display: flex; align-items: center; justify-content: center; gap: .18em; margin: 0; font: 400 clamp(54px, 13vw, 150px)/.9 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.intro-mark { display: grid; place-items: center; width: 1.05em; height: 1.05em; border: .06em solid #ebe5d5; border-radius: 50%; background: #b83c1c; font-size: .72em; line-height: 1; box-shadow: .06em .06em 0 #000; opacity: 0; }
.intro-word { display: inline-flex; }
.intro-word .ch { display: inline-block; opacity: 0; text-shadow: .045em .045em 0 #000; }
.intro-word .ch.red { color: #e0552f; }
.intro.show-title .intro-mark { animation: intro-stamp .5s cubic-bezier(.3, 1.7, .5, 1) forwards; }
.intro-word .ch.on { animation: intro-letter .32s cubic-bezier(.3, 1.6, .5, 1) forwards; }
@keyframes intro-stamp { from { opacity: 0; transform: scale(3) rotate(-30deg); } to { opacity: 1; transform: rotate(-6deg); } }
@keyframes intro-letter { from { opacity: 0; transform: translateY(-.45em) scale(1.6) rotate(-8deg); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

.intro-tagline { margin: 0; font: 400 clamp(26px, 5vw, 46px)/1 var(--display); text-transform: uppercase; opacity: 0; }
.intro-tagline em { display: inline-block; color: #e0552f; font-style: normal; }
.intro.show-tagline .intro-tagline { animation: fade-up .5s ease forwards; }
.intro.show-tagline .intro-tagline em { animation: stamp-em .55s .35s cubic-bezier(.3, 1.8, .5, 1) backwards; }

.intro-actions { display: grid; justify-items: center; gap: 10px; min-height: 92px; }
.button-intro { min-height: 54px; padding: 0 26px; border-color: #ebe5d5; background: #ebe5d5; color: #0e0f11; font-size: 17px; box-shadow: 4px 4px 0 #b83c1c; animation: fade-up .5s ease backwards, nudge 2.2s 1s ease-in-out infinite; }
.button-intro:hover { background: #fff; color: #0e0f11; box-shadow: 6px 6px 0 #b83c1c; }
@keyframes nudge { 0%, 80%, 100% { transform: none; } 88% { transform: translateY(-4px); } 94% { transform: translateY(1px); } }
.intro-hint { margin: 0; color: rgba(235, 229, 213, .7); font: 13px var(--type); }
.intro-skip { position: absolute; z-index: 4; top: calc(16px + var(--sa-top)); right: 16px; padding: 8px 12px; border: 1.5px solid rgba(235, 229, 213, .5); background: rgba(14, 15, 17, .6); color: #ebe5d5; font: 13px var(--type); cursor: pointer; }
.intro-skip:hover { border-color: #ebe5d5; }

/* Modo corto (visitas siguientes): todo aparece solo */
.intro.short .intro-actions, .intro.short .intro-caption { display: none; }

/* Salida: el telón sube y deja ver la app */
.intro.leaving { animation: intro-curtain .95s cubic-bezier(.7, 0, .3, 1) forwards; pointer-events: none; }
@keyframes intro-curtain { to { clip-path: inset(0 0 100% 0); } }
.intro.flash::after { content: ""; position: absolute; inset: 0; z-index: 5; background: #fff; pointer-events: none; animation: intro-flash .35s ease-out forwards; }
@keyframes intro-flash { from { opacity: .55; } to { opacity: 0; } }
html.intro-open { overflow: hidden; }

/* Botón de sonido */
.sound-toggle .icon-sound-off { display: none; }
.sound-off .sound-toggle .icon-sound-on { display: none; }
.sound-off .sound-toggle .icon-sound-off { display: inline; }

@media (max-width: 640px) {
  .intro-caption { font-size: 15px; }
  .intro-stage { margin-bottom: 18vh; gap: 14px; }
  .intro-city { height: 28vh; }
}
@media (prefers-reduced-motion: reduce) {
  .intro-mark, .intro-word .ch, .intro-tagline { opacity: 1 !important; }
}
@media print { .intro { display: none !important; } }
@media (max-width: 420px) {
  .topbar-actions { gap: 6px; }
  .topbar-actions .icon-button { width: 36px; height: 36px; font-size: 15px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand-mark { width: 30px; height: 30px; font-size: 16px; }
}
@media (max-width: 370px) { .progress-chip { display: none; } }
.intro.js-ready:not(.leaving) { animation: none; }
.intro.show-tagline .intro-tagline { opacity: 1; animation: fade-up .5s ease backwards; }
.intro-actions { align-content: start; }
.intro-actions > .button { justify-self: center; }
.notice-actions { flex-wrap: wrap; row-gap: 8px; }
.notice-actions .button-secondary { min-height: 40px; padding: 0 14px; font-size: 14px; }

/* =========================================================
   Portada que se desintegra y deja paso al mapa
   ========================================================= */
#view-inicio.hero-gone .hero { display: none; }
#view-inicio .hero + .section-heading { transition: margin-top .6s cubic-bezier(.6, 0, .3, 1); }
#view-inicio.hero-collapsing .hero + .section-heading,
#view-inicio.hero-gone .hero + .section-heading { margin-top: 8px; }
.hero.dissolving {
  filter: url(#dissolve);
  -webkit-mask-image: linear-gradient(90deg, transparent 0 42%, #000 58% 100%);
  mask-image: linear-gradient(90deg, transparent 0 42%, #000 58% 100%);
  -webkit-mask-size: 300% 100%; mask-size: 300% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: 100% 0; mask-position: 100% 0;
  will-change: transform, mask-position;
}
.hero.dissolving * { animation-play-state: paused !important; }
.hero.collapsing { overflow: hidden; opacity: 0; transition: height .6s cubic-bezier(.6, 0, .3, 1), opacity .2s; }
.fx-dust { position: fixed; inset: 0; z-index: 60; width: 100%; height: 100%; pointer-events: none; }

/* Escena: ola de calor */
.scenario-visual[data-scene="heat"] { background-color: #3a2416; background-image: radial-gradient(rgba(240, 190, 110, .28) 1.3px, transparent 1.6px); }
.heat-sun { position: absolute; top: 46px; left: 50%; width: 120px; height: 120px; margin-left: -60px; border: 4px solid #151515; border-radius: 50%; background: #e8c35a; box-shadow: 0 0 0 14px rgba(232, 195, 90, .25), 0 0 0 30px rgba(232, 195, 90, .12); animation: sun-pulse 3s ease-in-out infinite; }
@keyframes sun-pulse { 50% { box-shadow: 0 0 0 20px rgba(232, 195, 90, .3), 0 0 0 42px rgba(232, 195, 90, .1); } }
.heat-waves { position: absolute; left: 0; right: 0; top: 200px; height: 120px; background: repeating-linear-gradient(0deg, transparent 0 14px, rgba(235, 229, 213, .22) 14px 16px); -webkit-mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent); mask-image: linear-gradient(to bottom, transparent, #000 40%, transparent); animation: heat-shimmer 1.6s ease-in-out infinite alternate; }
@keyframes heat-shimmer { from { transform: skewX(-6deg) translateY(4px); } to { transform: skewX(6deg) translateY(-4px); } }
.heat-city { position: absolute; left: 0; right: 0; bottom: 0; height: 110px; display: flex; align-items: flex-end; gap: 10px; padding: 0 16px; }
.heat-city i { flex: 1; height: 60%; border: 3px solid #ebe5d5; border-bottom: 0; background: #151515; }
.heat-city i:nth-child(2) { height: 90%; } .heat-city i:nth-child(3) { height: 45%; } .heat-city i:nth-child(4) { height: 75%; }
.heat-thermo { position: absolute; right: 26px; top: 56px; width: 22px; height: 120px; border: 3px solid #ebe5d5; border-radius: 12px; background: #151515; overflow: hidden; }
.heat-thermo b { position: absolute; left: 0; right: 0; bottom: 0; height: 85%; background: #e0552f; animation: thermo 3s ease-in-out infinite; }
@keyframes thermo { 50% { height: 95%; } }

/* Escena: tormenta fuerte */
.scenario-visual[data-scene="storm"] { background-color: #1a1d24; }
.storm-cloud { position: absolute; color: #ebe5d5; line-height: 1; text-shadow: 4px 4px 0 #000; animation: cloud-sway 4s ease-in-out infinite; }
.storm-cloud.c1 { top: 40px; left: 12%; font-size: 92px; }
.storm-cloud.c2 { top: 70px; right: 8%; font-size: 70px; opacity: .85; animation-delay: -2s; }
@keyframes cloud-sway { 50% { transform: translateX(10px); } }
.storm-hail { position: absolute; inset: 0; background-image: radial-gradient(circle, #ebe5d5 2.2px, transparent 2.6px), radial-gradient(circle, rgba(235, 229, 213, .7) 1.6px, transparent 2px); background-size: 46px 46px, 31px 31px; background-position: 0 0, 14px 9px; -webkit-mask-image: linear-gradient(to bottom, transparent 28%, #000 40%, #000 88%, transparent); mask-image: linear-gradient(to bottom, transparent 28%, #000 40%, #000 88%, transparent); animation: hail .55s linear infinite; }
@keyframes hail { to { background-position: -10px 46px, 4px 40px; } }
.storm-bolt { position: absolute; top: 120px; left: 46%; font-size: 64px; filter: drop-shadow(3px 3px 0 #000); opacity: 0; animation: bolt 5s infinite; }
@keyframes bolt { 0%, 86%, 100% { opacity: 0; } 87% { opacity: 1; } 89% { opacity: .2; } 90.5% { opacity: 1; } 93% { opacity: 0; } }
.scene-storm::after { content: ""; position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; animation: lightning 5s infinite; }
.storm-tree { position: absolute; bottom: 0; left: 14%; width: 16px; height: 130px; background: #151515; border: 3px solid #ebe5d5; border-bottom: 0; transform-origin: bottom center; animation: tree-bend 2.2s ease-in-out infinite; }
.storm-tree::before { content: ""; position: absolute; left: 50%; top: -70px; width: 110px; height: 90px; margin-left: -55px; border: 3px solid #ebe5d5; border-radius: 50%; background: #151515; }
@keyframes tree-bend { 50% { transform: rotate(7deg); } }
@media (max-width: 640px) {
  .heat-sun { top: 24px; width: 80px; height: 80px; margin-left: -40px; }
  .heat-thermo { top: 24px; height: 90px; }
  .storm-cloud.c1 { top: 16px; font-size: 64px; } .storm-cloud.c2 { top: 30px; font-size: 50px; }
  .storm-bolt { top: 60px; font-size: 44px; }
  .storm-tree { height: 80px; } .storm-tree::before { top: -50px; width: 80px; height: 64px; margin-left: -40px; }
}

/* =========================================================
   Modo emergencia
   ========================================================= */
.sos-fab { position: fixed; right: calc(18px + var(--sa-right)); bottom: calc(18px + var(--sa-bottom)); z-index: 45; display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 18px 0 14px; border: 3px solid #151515; border-radius: 999px; background: #c8361a; color: #fff; font: 400 20px/1 var(--display); letter-spacing: .03em; text-transform: uppercase; text-decoration: none; box-shadow: 4px 4px 0 #151515; transition: transform .15s, box-shadow .15s; }
.sos-fab::before { content: ""; position: absolute; inset: -3px; border-radius: inherit; border: 3px solid #c8361a; animation: ping 2.2s ease-out infinite; pointer-events: none; }
.sos-fab:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 #151515; }
.sos-fab > span:first-child { font-size: 22px; }
body.in-emergency .sos-fab, html.intro-open .sos-fab { display: none; }
@media (max-width: 640px) {
  .sos-fab { height: 52px; padding: 0 14px 0 12px; font-size: 17px; }
}

.emergency .sos-head { max-width: 760px; margin: 8px auto 26px; text-align: center; }
.emergency .sos-head .eyebrow { color: #c8361a; font-size: 14px; }
.emergency h1 { margin: 0 0 14px; font: 400 64px/.95 var(--display); text-transform: uppercase; }
.emergency h1 em { color: #c8361a; font-style: normal; }
.emergency .caption { text-align: left; }

.sos-calls { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; max-width: 1000px; margin: 0 auto 26px; }
.sos-call { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 128px; padding: 14px; border: 3px solid #151515; background: #c8361a; color: #fff; text-align: center; text-decoration: none; box-shadow: var(--shadow-hard); transition: transform .15s, box-shadow .15s; }
.sos-call:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow-hover); }
.sos-call strong { font: 400 54px/1 var(--display); }
.sos-call span { font-size: 15px; font-weight: 700; }
.sos-call small { font-size: 12px; opacity: .9; }
.sos-call:nth-child(n+2) { background: #151515; }
:root[data-theme="dark"] .sos-call:nth-child(n+2) { background: #26272b; border-color: #ece6d6; }

.sos-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; max-width: 1000px; margin: 0 auto; }
.sos-card h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font: 400 28px/1 var(--display); text-transform: uppercase; }
.sos-label { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; font-weight: 700; }
.sos-card textarea { font-size: 16px; }
.sos-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 12px 0 8px; }
.sos-actions .button { flex: 1 1 auto; }
.sos-text { color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.sos-torch[aria-pressed="true"] { background: #e8c35a; border-color: #151515; color: #151515; }
.sos-card .text-button { margin-top: 10px; }

.sos-plan-row { padding: 10px 0; border-bottom: 1.5px dashed var(--line); }
.sos-plan-row:last-child { border-bottom: 0; }
.sos-plan-row dt { color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.sos-plan-row dd { margin: 4px 0 0; font: 400 24px/1.1 var(--display); text-transform: uppercase; }
.sos-plan-row dd.empty { color: var(--faint); font: italic 15px var(--body); text-transform: none; }
.sos-contact { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 10px 12px; border: 2px solid var(--frame); background: var(--bg); color: var(--ink); text-decoration: none; }
.sos-contact b { font-size: 16px; }
.sos-contact span { color: var(--accent); font-weight: 700; white-space: nowrap; }
.sos-plan-empty { color: var(--muted); font-size: 15px; }
.sos-plan-empty a { color: var(--accent); font-weight: 700; }

.sos-tips details { border-bottom: 1.5px dashed var(--line); }
.sos-tips summary { display: flex; align-items: center; gap: 10px; min-height: 52px; font-weight: 700; cursor: pointer; list-style: none; }
.sos-tips summary::-webkit-details-marker { display: none; }
.sos-tips summary::after { content: "+"; margin-left: auto; color: var(--accent); font: 400 24px var(--display); }
.sos-tips details[open] summary::after { content: "−"; }
.sos-tips ul { margin: 0 0 14px; padding-left: 22px; }
.sos-tips li { margin-bottom: 6px; color: var(--ink-2); line-height: 1.5; }
.sos-tips li::marker { content: "✱  "; color: var(--accent); }

.screen-light { position: fixed; inset: 0; z-index: 120; display: grid; place-items: end center; padding-bottom: calc(30px + var(--sa-bottom)); background: #fff; cursor: pointer; }
.screen-light span { color: #9a9a9a; font: 14px var(--body); }

@media (max-width: 960px) {
  .sos-calls { grid-template-columns: repeat(2, 1fr); }
  .sos-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .emergency h1 { font-size: 46px; }
  .sos-call { min-height: 104px; }
  .sos-call strong { font-size: 44px; }
}
@media print { .sos-fab, .screen-light { display: none !important; } }
body.in-emergency .privacy-notice { display: none !important; }

/* =========================================================
   Ajustes para celular
   ========================================================= */
h1, h2, h3, .caption, .stop-label strong { text-wrap: balance; }
.nav-tools { display: none; }

@media (max-width: 860px) {
  /* Pie de página: los enlaces bajan de línea en vez de desbordar */
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .footer-links { flex: 1 1 auto; width: 100%; gap: 10px 20px; }
  .tribute { text-align: left; }
  /* Preferencias dentro del menú */
  .nav-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 2px dashed var(--line); }
  .nav-tool { min-height: 46px; padding: 0 10px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; text-align: left; }
}

@media (max-width: 640px) {
  /* Encabezado más despejado: sonido y tema van al menú */
  .topbar-actions .sound-toggle, .topbar-actions .theme-toggle { display: none; }
  .progress-chip { height: 38px; }
  /* Que el botón de emergencia no tape el final */
  .footer-inner { padding-bottom: calc(92px + var(--sa-bottom)); }
  /* Títulos y textos */
  .page-intro h1 { font-size: 44px; }
  .emergency h1 { font-size: 44px; }
  .plan-tools .button { padding: 0 10px; font-size: 14px; white-space: nowrap; gap: 8px; }
  .plan-card-head .eyebrow { font-size: 12px; }
  .stop-chip { font-size: 11px; }
  .numbers-grid .number-card strong { font-size: 36px; }
  .download-card strong { font-size: 22px; }
}

/* Mapa en vertical: carteles más anchos y legibles */
.adventure-map.is-tall .stop-label { width: min(232px, calc(100vw - 150px)); padding: 9px 11px 10px; }
.adventure-map.is-tall .stop-label strong { font-size: 20px; }
.adventure-map.is-tall .stop-kicker, .adventure-map.is-tall .stop-status { font-size: 13px; }
.adventure-map.is-tall .stop-pin { width: 50px; height: 50px; }
.adventure-map.is-tall .stop-num { font-size: 22px; }
.adventure-map.is-tall .stop-label.pos-left { right: 34px; }
.adventure-map.is-tall .stop-label.pos-right { left: 34px; }
@media (max-width: 370px) { .progress-chip { display: inline-flex; padding: 0 10px 0 5px; } .brand { font-size: 18px; } }
/* Nada puede generar desplazamiento lateral (ni siquiera las animaciones de entrada).
   overflow-x: clip no rompe el encabezado fijo (sticky), a diferencia de hidden. */
html, body { overflow-x: clip; }
@supports not (overflow: clip) { body { overflow-x: hidden; } }
@media (max-width: 640px) { .stop-chip { font-size: 12px; } }
.map-tag.finish.pos-right { transform: translate(30px, -95%) rotate(2deg); }
.choice-letter { color: var(--accent); margin-right: 2px; } .trivia-play { max-width: 760px; margin: 0 auto; } .trivia-question { margin: 6px 0 18px; font: 400 32px/1.08 var(--display); text-transform: uppercase; } .trivia-start { margin-bottom: 0; } @media (max-width: 640px) { .trivia-question { font-size: 26px; } }

/* Capítulo 05 · El barrio */
.place-row { padding: 12px 4px 14px; border-bottom: 1.5px dashed var(--line); }
.place-row:last-child { border-bottom: 0; }
.place-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.place-head .item-copy strong { font-size: 16px; }
.place-star { font-size: 13px; }
.place-check { display: grid; place-items: center; flex: none; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 50%; color: var(--on-accent); font-weight: 700; }
.place-row.filled .place-check { border-color: var(--frame); background: var(--ok); color: var(--surface); }
.place-fields { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 8px; padding-left: 48px; }
.place-fields input { min-height: 44px; font-size: 15px; }
.place-search { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 12px; border: 2px solid var(--frame); background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; box-shadow: 2px 2px 0 var(--frame); }
.place-search:hover { background: var(--accent-soft); }
.place-search.empty { visibility: hidden; padding: 0; border: 0; box-shadow: none; min-width: 0; }
.sos-place { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1.5px dashed var(--line); }
.sos-place:last-child { border-bottom: 0; }
.sos-place-name { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 6px; min-width: 0; }
.sos-place-name b { font-size: 15px; }
.sos-place-name small { flex-basis: 100%; padding-left: 26px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.sos-place-actions { display: flex; gap: 6px; flex: none; }
.sos-place-actions a { display: grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--frame); background: var(--surface); text-decoration: none; font-size: 19px; }
.ps-places td:first-child { width: 34%; font-family: var(--body); font-size: 10pt; font-weight: 600; }
@media (max-width: 640px) {
  .place-fields { grid-template-columns: 1fr 1fr; padding-left: 0; }
  .place-fields input[data-field="name"] { grid-column: 1 / -1; }
  .place-search { font-size: 13px; padding: 0 8px; }
}
/* Con 7 enlaces en el menú, el menú hamburguesa aparece antes */
@media (max-width: 1100px) {
  .menu-toggle { display: inline-grid; }
  .main-nav { position: absolute; top: calc(73px + var(--sa-top)); right: 0; left: 0; display: none; flex-direction: column; align-items: stretch; gap: 4px; margin: 0; padding: 12px 16px 18px; border-bottom: 3px solid var(--frame); background: var(--bg); }
  .main-nav.open { display: flex; animation: appear .2s ease both; }
  .nav-link { padding: 14px; font-size: 17px; }
  .nav-link-mobile { display: block; }
  .topbar-actions { margin-left: auto; }
}
