:root {
    --navy: #102d47;
    --navy-2: #173f5f;
    --institutional: #8b1748;
    --institutional-dark: #641033;
    --institutional-green: #0f6658;
    --blue: #147ba6;
    --sky: #dff5fb;
    --cream: #fffaf0;
    --yellow: #ffd64a;
    --orange: #f08a3c;
    --green: #16865a;
    --red: #c83f4e;
    --ink: #18364d;
    --muted: #5e7589;
    --line: #dce8ef;
    --shadow: 0 18px 50px rgba(16, 45, 71, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: #f5f9fb;
    font-family: "Nunito", system-ui, sans-serif;
}
button, input { font: inherit; }
button { color: inherit; }
.skip-link { position: fixed; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: white; border-radius: 10px; }
.skip-link:focus { top: 12px; }

.government-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 34px;
    padding: 7px max(24px, calc((100vw - 1240px) / 2));
    color: white;
    background: linear-gradient(90deg, var(--institutional-dark), var(--institutional));
    border-bottom: 3px solid var(--institutional-green);
    font-size: 11px;
    letter-spacing: .04em;
}
.government-bar div { display: flex; align-items: center; gap: 10px; }
.government-bar i { display: block; width: 1px; height: 14px; background: rgba(255,255,255,.42); }
.government-bar strong { text-transform: uppercase; font-size: 10px; letter-spacing: .1em; }

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 90px;
    padding: 9px max(24px, calc((100vw - 1240px) / 2));
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid rgba(16, 45, 71, .09);
    backdrop-filter: blur(14px);
}
.institutional-identity { display: flex; align-items: center; gap: 15px; min-width: 0; }
.ssp-logo { width: 142px; height: 66px; object-fit: contain; }
.identity-divider { width: 1px; height: 50px; background: #d6dde1; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--navy); text-decoration: none; }
.guardia-logo { width: 58px; height: 58px; object-fit: contain; filter: drop-shadow(0 3px 4px rgba(16,45,71,.16)); }
.brand span:last-child { display: grid; line-height: 1.1; }
.brand strong { font-size: 18px; font-weight: 900; letter-spacing: -.01em; }
.brand small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 700; }
nav { display: flex; align-items: center; gap: 8px; }
.nav-button { border: 0; background: transparent; color: var(--navy); text-decoration: none; padding: 10px 13px; border-radius: 12px; font-weight: 800; cursor: pointer; }
.nav-button:hover, .nav-button:focus-visible { background: #edf5f8; }
.nav-primary { color: white; background: var(--navy); }
.nav-primary:hover, .nav-primary:focus-visible { background: var(--navy-2); }

.app-view { display: none; }
.app-view.is-active { display: block; }
.hero-shell {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(440px, .86fr);
    min-height: 570px;
    overflow: hidden;
    background: linear-gradient(120deg, #e8f8f9 0%, #dff5fb 55%, #bceaf1 100%);
}
.hero-copy { z-index: 2; align-self: center; max-width: 670px; padding: 72px 32px 76px max(32px, calc((100vw - 1240px) / 2)); }
.official-badge { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 20px; padding: 8px 15px 8px 8px; border: 1px solid rgba(16,45,71,.12); border-left: 4px solid var(--institutional); border-radius: 14px; color: var(--navy); background: rgba(255,255,255,.72); box-shadow: 0 8px 25px rgba(16,45,71,.08); font-size: 12px; font-weight: 900; line-height: 1.2; }
.official-badge img { width: 39px; height: 39px; object-fit: contain; }
.official-badge small { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.eyebrow { color: var(--blue); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 900; }
h1, h2, h3, p { margin-top: 0; }
.hero-copy h1 { margin: 15px 0 20px; color: var(--navy); font-size: clamp(42px, 5.5vw, 72px); line-height: .98; letter-spacing: -.045em; font-weight: 900; }
.hero-copy h1 em { color: var(--institutional); font-style: normal; }
.hero-copy > p { max-width: 610px; color: #48687d; font-size: 18px; line-height: 1.6; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 27px 0 15px; }
.button { border: 0; border-radius: 15px; padding: 13px 19px; font-weight: 900; cursor: pointer; transition: transform .18s ease, box-shadow .18s ease; }
.button:hover { transform: translateY(-2px); }
.button:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid rgba(20, 123, 166, .35); outline-offset: 3px; }
.button-primary { background: linear-gradient(135deg, var(--navy), #1a496d); color: white; box-shadow: 0 12px 25px rgba(16, 45, 71, .2); }
.button-light { background: white; color: var(--navy); border: 1px solid #d1e2e9; }
.button-large { padding: 16px 24px; }
.hero-note { font-size: 13px !important; font-weight: 800; }

.road-hero { position: relative; overflow: hidden; min-height: 570px; }
.sun { position: absolute; top: 70px; right: 20%; width: 94px; height: 94px; background: var(--yellow); border-radius: 50%; box-shadow: 0 0 0 22px rgba(255, 214, 74, .15); }
.mountain { position: absolute; bottom: 180px; width: 400px; height: 260px; background: #88c7b5; clip-path: polygon(50% 0, 100% 100%, 0 100%); opacity: .55; }
.mountain-one { right: 25%; }
.mountain-two { right: -15%; bottom: 150px; background: #5fb3ae; }
.road { position: absolute; right: -25%; bottom: -40px; width: 125%; height: 390px; background: #426071; clip-path: polygon(42% 0, 60% 0, 91% 100%, 4% 100%); transform: rotate(-7deg); }
.road-line { position: absolute; left: 51%; width: 9px; height: 66px; background: #fff7cf; border-radius: 6px; transform: translateX(-50%); }
.line-one { top: 20px; } .line-two { top: 112px; height: 85px; } .line-three { top: 230px; height: 115px; } .line-four { top: 375px; }
.hero-car { position: absolute; z-index: 3; right: 26%; bottom: 85px; font-size: 92px; filter: drop-shadow(0 18px 10px rgba(16,45,71,.25)); transform: rotate(-5deg); animation: carFloat 2.5s ease-in-out infinite; }
.road-sign { position: absolute; z-index: 3; right: 9%; bottom: 205px; display: grid; place-items: center; width: 62px; height: 62px; border: 7px solid var(--red); border-radius: 50%; background: white; font-weight: 900; box-shadow: 0 0 0 6px white; }
.road-sign::after { content: ""; position: absolute; top: 58px; width: 7px; height: 95px; background: #415667; z-index: -1; }
@keyframes carFloat { 50% { transform: translateY(-6px) rotate(-5deg); } }

.home-section { max-width: 1240px; margin: 0 auto; padding: 76px 24px 20px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 28px; }
.section-heading h2 { margin: 7px 0 0; color: var(--navy); font-size: clamp(30px, 4vw, 43px); line-height: 1.05; }
.section-heading p { max-width: 460px; margin: 0; color: var(--muted); line-height: 1.55; }
.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.game-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.mode-card { display: grid; grid-template-columns: auto 1fr; gap: 16px; min-height: 190px; padding: 24px; text-align: left; border: 1px solid var(--line); border-radius: 24px; background: white; box-shadow: var(--shadow); cursor: pointer; transition: transform .2s ease, border-color .2s ease; }
.mode-card:hover { transform: translateY(-5px); border-color: #9fc8d7; }
.mode-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 16px; background: var(--sky); font-size: 27px; }
.mode-card strong { display: block; color: var(--navy); font-size: 22px; font-weight: 900; }
.mode-card small { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.45; }
.mode-card b { grid-column: 2; color: var(--blue); }
.mode-card.practice .mode-icon { background: #fff0d9; }
.mode-card.exam .mode-icon { background: #e8e2ff; }
.games-section { padding-bottom: 42px; }
.game-card { position: relative; min-height: 360px; overflow: hidden; padding: 28px; text-align: left; border: 0; border-radius: 27px; color: white; cursor: pointer; box-shadow: var(--shadow); transition: transform .2s ease; }
.game-card:hover { transform: translateY(-6px) rotate(-.4deg); }
.game-card.hazard { background: linear-gradient(155deg, #0a7992, #07566c); }
.game-card.priority { background: linear-gradient(155deg, #ec8b3d, #c65738); }
.game-card.decision { background: linear-gradient(155deg, #514a9d, #28306f); }
.game-card.journey { background: linear-gradient(155deg, #15715f, #0d3d4b); }
.game-art { display: grid; place-items: center; min-height: 155px; font-size: 85px; filter: drop-shadow(0 15px 18px rgba(0,0,0,.18)); }
.game-number { position: absolute; top: 18px; right: 22px; opacity: .45; font-weight: 900; font-size: 28px; }
.game-card strong, .game-card small, .game-card b { display: block; }
.game-card strong { font-size: 25px; font-weight: 900; }
.game-card small { margin-top: 5px; opacity: .83; font-size: 15px; }
.game-card b { margin-top: 22px; }
.disclaimer { display: flex; gap: 14px; max-width: 1192px; margin: 30px auto 70px; padding: 18px 22px; border-radius: 18px; color: #526c80; background: #eaf3f7; }
.disclaimer p { margin: 0; line-height: 1.5; }

.workspace { min-height: calc(100vh - 150px); max-width: 1080px; margin: 0 auto; padding: 42px 24px 70px; }
.workspace-bar { display: grid; grid-template-columns: 160px 1fr 160px; align-items: center; gap: 20px; margin-bottom: 28px; }
.workspace-bar h1 { margin: 3px 0 0; color: var(--navy); text-align: center; font-size: 34px; }
.workspace-bar .eyebrow { display: block; text-align: center; }
.back-button { justify-self: start; border: 1px solid var(--line); border-radius: 13px; padding: 11px 15px; background: white; font-weight: 900; cursor: pointer; }
.timer, .score-pill { justify-self: end; min-width: 108px; padding: 11px 16px; border-radius: 999px; text-align: center; background: var(--navy); color: white; font-weight: 900; }
.timer.is-low { background: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .72; } }
.setup-card, .question-shell, .result-card, .game-shell { padding: clamp(22px, 4vw, 42px); background: white; border: 1px solid var(--line); border-radius: 28px; box-shadow: var(--shadow); }
.setup-card { text-align: center; }
.setup-icon { font-size: 62px; }
.setup-card h2 { margin: 15px 0 10px; color: var(--navy); font-size: 34px; }
.setup-card p { max-width: 620px; margin: 0 auto 22px; color: var(--muted); line-height: 1.55; }
.setup-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin: 24px 0; }
.setup-stats span { padding: 9px 14px; border-radius: 999px; background: #edf5f8; font-weight: 800; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin: 24px 0; text-align: left; }
.topic-button { padding: 15px; border: 1px solid var(--line); border-radius: 15px; background: white; cursor: pointer; font-weight: 800; }
.topic-button:hover { background: var(--sky); }
.progress-row { display: flex; justify-content: space-between; gap: 15px; margin-bottom: 10px; color: var(--muted); font-weight: 800; }
.progress-track { height: 9px; margin-bottom: 25px; overflow: hidden; border-radius: 99px; background: #e6eef2; }
.progress-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #26bda8); transition: width .25s ease; }
.question-grid { display: grid; grid-template-columns: minmax(230px, .8fr) 1.25fr; gap: 30px; align-items: start; }
.question-image { width: 100%; aspect-ratio: 4/3; object-fit: contain; border-radius: 20px; background: #eaf3f7; }
.category-chip { display: inline-block; margin-bottom: 13px; padding: 7px 11px; border-radius: 99px; background: #eaf5f7; color: var(--blue); font-size: 12px; font-weight: 900; }
.question-copy h2 { margin-bottom: 22px; color: var(--navy); font-size: clamp(22px, 3vw, 31px); line-height: 1.25; }
.answers { display: grid; gap: 10px; }
.answer-button { display: grid; grid-template-columns: 35px 1fr; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; text-align: left; border: 2px solid var(--line); border-radius: 15px; background: white; cursor: pointer; font-weight: 700; }
.answer-button:hover:not(:disabled) { border-color: #81b9cd; background: #f4fbfd; }
.answer-letter { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 10px; background: #edf3f6; font-weight: 900; }
.answer-button.is-selected { border-color: var(--blue); background: #edf9fc; }
.answer-button.is-correct { border-color: var(--green); background: #e9f7f1; }
.answer-button.is-wrong { border-color: var(--red); background: #fff0f1; }
.feedback { margin-top: 16px; padding: 14px 17px; border-left: 5px solid var(--green); border-radius: 10px; background: #eaf7f1; line-height: 1.5; }
.feedback.wrong { border-color: var(--red); background: #fff0f1; }
.question-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; }
.button:disabled, button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.result-card { text-align: center; }
.result-ring { position: relative; display: grid; place-items: center; width: 145px; height: 145px; margin: 0 auto 22px; border-radius: 50%; background: conic-gradient(var(--green) var(--score), #e4edf1 0); }
.result-ring::before { content: ""; position: absolute; width: 110px; height: 110px; border-radius: 50%; background: white; }
.result-ring span { position: relative; font-size: 29px; font-weight: 900; }
.result-card h2 { color: var(--navy); font-size: 34px; }
.result-card > p { color: var(--muted); }
.review-list { display: grid; gap: 10px; margin: 26px 0; text-align: left; }
.review-item { padding: 14px 16px; border-radius: 14px; background: #f2f7f9; }
.review-item.wrong { border-left: 4px solid var(--red); }

.game-shell h2 { color: var(--navy); }
.game-intro { color: var(--muted); line-height: 1.55; }
.scene-image { position: relative; overflow: hidden; min-height: 360px; margin: 22px 0; border-radius: 22px; background: #dceef3 center/cover no-repeat; }
.scene-image img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; display: block; }
.hazard-target { position: absolute; border: 3px dashed rgba(255,255,255,.1); border-radius: 50%; background: transparent; cursor: crosshair; }
.hazard-target:hover { border-color: var(--yellow); background: rgba(255,214,74,.12); }
.hazard-target.is-revealed { border-color: var(--red); background: rgba(200,63,78,.2); animation: pulse 1s infinite; }
.game-feedback { padding: 17px; border-radius: 15px; background: #edf7f4; line-height: 1.5; }
.game-feedback.bad { background: #fff0f1; }
.order-list { display: grid; gap: 10px; margin: 22px 0; }
.order-item { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; padding: 13px; border: 2px solid var(--line); border-radius: 15px; background: #fff; }
.order-rank { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: var(--navy); color: white; font-weight: 900; }
.order-item strong, .order-item small { display: block; }
.order-item small { color: var(--muted); margin-top: 2px; }
.order-controls { display: flex; gap: 5px; }
.order-controls button { width: 35px; height: 35px; border: 1px solid var(--line); border-radius: 9px; background: #f4f8fa; cursor: pointer; }
.decision-grid { display: grid; gap: 11px; margin-top: 20px; }
.decision-choice { padding: 16px; text-align: left; border: 2px solid var(--line); border-radius: 15px; background: white; cursor: pointer; font-weight: 800; }
.decision-choice:hover { border-color: var(--blue); }

/* Ports fieles de los minijuegos de la aplicación Flutter. */
.mav-game { color: var(--navy); }
.mav-level-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #567185; font-size: 13px; font-weight: 900; letter-spacing: .04em; }
.mav-pill { display: inline-flex; padding: 7px 11px; border-radius: 999px; color: white; background: var(--navy); }
.mav-level-progress { height: 7px; margin: 10px 0 22px; overflow: hidden; border-radius: 99px; background: #e2ebef; }
.mav-level-progress i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #18a576, #2a91bd); transition: width .25s ease; }
.mav-game-heading { margin-bottom: 18px; }
.mav-game-heading h2 { margin: 0 0 5px; font-size: clamp(25px, 3vw, 36px); }
.mav-game-heading p { margin: 0; color: var(--muted); line-height: 1.5; }
.mav-scene-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; user-select: none; pointer-events: none; }
.mav-action, .mav-secondary { display: inline-flex; justify-content: center; align-items: center; min-height: 48px; padding: 12px 20px; border: 0; border-radius: 14px; font: inherit; font-weight: 900; cursor: pointer; }
.mav-action { color: white; background: var(--navy); box-shadow: 0 10px 22px rgba(16,45,71,.16); }
.mav-action:hover { transform: translateY(-1px); }
.mav-action-green { background: var(--green); }
.mav-action-red { background: var(--red); }
.mav-secondary { color: var(--navy); background: #e9f1f4; }
.mav-tutorial { position: fixed; z-index: 100; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(7,26,43,.72); backdrop-filter: blur(5px); }
.mav-tutorial-inner { width: min(460px, 100%); padding: 34px; border-radius: 28px; text-align: center; background: white; box-shadow: 0 30px 80px rgba(0,0,0,.32); }
.mav-tutorial-icon { display: grid; place-items: center; width: 82px; height: 82px; margin: 0 auto 17px; border-radius: 25px; color: white; background: linear-gradient(145deg, var(--blue), var(--navy)); font-size: 42px; font-weight: 900; }
.mav-tutorial-inner > b { color: var(--green); font-size: 12px; letter-spacing: .12em; }
.mav-tutorial-inner h2 { margin: 8px 0 10px; font-size: 30px; }
.mav-tutorial-inner p { margin: 0; color: #4f687a; line-height: 1.6; }
.mav-tutorial-inner small { display: block; margin: 13px 0 20px; color: #738997; }

.mav-hazard-wrap { width: min(620px, 100%); margin: 0 auto; }
.mav-hazard-wrap.landscape { width: min(860px, 100%); }
.mav-hazard-scene { position: relative; overflow: hidden; width: 100%; aspect-ratio: 3 / 4; border-radius: 24px; background: #b7d2dc; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 16px 35px rgba(16,45,71,.13); cursor: crosshair; touch-action: manipulation; }
.mav-hazard-scene.landscape { aspect-ratio: 4 / 3; }
.mav-hazard-sprite, .mav-occluder { position: absolute; z-index: 3; object-fit: fill; pointer-events: none; user-select: none; }
.mav-occluder { inset: 0; width: 100%; height: 100%; }
.mav-door { transform-origin: right center; }
.mav-driveway-car { transform: rotate(-6deg); }
.mav-scene-shade { position: absolute; z-index: 4; inset: 0; pointer-events: none; box-shadow: inset 0 -130px 90px -85px rgba(5,24,39,.5); }
.mav-scene-chip, .mav-map-tag, .mav-countdown, .mav-map-status, .mav-decision-status { position: absolute; z-index: 8; top: 14px; padding: 7px 10px; border-radius: 9px; color: white; background: rgba(11,39,60,.88); font-size: 11px; font-weight: 900; letter-spacing: .06em; backdrop-filter: blur(4px); }
.mav-scene-chip, .mav-map-tag { left: 14px; }
.mav-countdown, .mav-map-status, .mav-decision-status { right: 14px; }
.mav-countdown.urgent { background: var(--red); animation: pulse .65s infinite; }
.mav-timebar { position: absolute; z-index: 9; right: 0; bottom: 0; left: 0; height: 8px; background: rgba(255,255,255,.32); }
.mav-timebar i { display: block; height: 100%; background: var(--green); transition: width .08s linear; }
.mav-timebar i.urgent, .mav-timebar i.bad { background: var(--red); }
.mav-timebar i.medium { background: #f4a62f; }
.mav-timebar i.good { background: var(--green); }
.mav-rain-canvas { position: absolute; z-index: 6; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mav-risk-marker { position: absolute; z-index: 10; display: grid; place-items: center; width: 58px; height: 58px; translate: -50% -50%; border: 5px solid currentColor; border-radius: 50%; color: var(--red); background: rgba(255,255,255,.8); font-size: 31px; font-weight: 900; animation: mav-marker .7s ease both; }
.mav-risk-marker.good { color: var(--green); }
@keyframes mav-marker { from { opacity: 0; scale: .45; } 70% { scale: 1.16; } }
.mav-bottom-panel { width: min(760px, 100%); min-height: 64px; margin: 18px auto 0; padding: 16px 18px; border-radius: 17px; text-align: center; background: #edf6f4; }
.mav-bottom-panel > strong { display: block; padding: 5px; }
.mav-bottom-panel .bad { color: var(--red); }
.mav-result-copy strong { font-size: 20px; }
.mav-result-copy.good strong { color: var(--green); }
.mav-result-copy.bad strong { color: var(--red); }
.mav-result-copy p { margin: 8px auto 14px; line-height: 1.5; }

.mav-priority-layout, .mav-decision-layout { display: grid; grid-template-columns: minmax(0, 1.22fr) minmax(310px, .78fr); gap: 24px; align-items: start; }
.mav-map { padding: 11px; border-radius: 24px; background: var(--navy); box-shadow: 0 17px 36px rgba(16,45,71,.2); }
.mav-map-inner { position: relative; overflow: hidden; aspect-ratio: 1000 / 880; border-radius: 16px; background: #a8c7bb; }
.mav-map-status.good { background: var(--green); }
.mav-map-status.bad { background: var(--red); }
.mav-map-note { margin: 10px 4px 0; color: #607b8e; font-size: 13px; line-height: 1.45; }
.mav-map-actor { position: absolute; z-index: 5; translate: -50% -50%; filter: drop-shadow(0 5px 4px rgba(0,0,0,.28)); }
.mav-map-actor img { width: 100%; height: 100%; object-fit: fill; }
.mav-map-actor b { position: absolute; top: -8px; left: -8px; display: grid; place-items: center; width: 26px; height: 26px; border: 3px solid white; border-radius: 50%; color: white; background: var(--tag); font-size: 12px; box-shadow: 0 3px 7px rgba(0,0,0,.24); }
.mav-map-actor.active { z-index: 7; filter: drop-shadow(0 0 12px rgba(255,214,74,.9)); }
.mav-map-actor::after { content: ''; position: absolute; inset: -12px; border: 5px solid rgba(200,63,78,var(--pulse,0)); border-radius: 50%; pointer-events: none; }
.mav-order-panel, .mav-decision-panel { padding: 21px; border: 1px solid var(--line); border-radius: 21px; background: #f8fbfc; }
.mav-order-panel h3, .mav-decision-panel h3 { margin: 0 0 7px; font-size: 16px; }
.mav-order-panel > p, .mav-decision-panel > p { margin: 0 0 17px; color: var(--muted); line-height: 1.45; }
.mav-order-list { display: grid; gap: 9px; margin: 17px 0; }
.mav-order-item { display: grid; grid-template-columns: 30px 34px minmax(0,1fr) auto; align-items: center; gap: 9px; padding: 11px; border: 2px solid #dce7eb; border-radius: 14px; background: white; cursor: grab; }
.mav-order-item.dragging { opacity: .45; }
.mav-order-item.right { border-color: var(--green); background: #ebf8f2; }
.mav-order-item.wrong { border-color: var(--red); background: #fff1f2; }
.mav-order-item > b { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 9px; color: white; background: var(--navy); }
.mav-user-tag { display: grid; place-items: center; width: 31px; height: 31px; border-radius: 50%; color: white; background: var(--tag); font-weight: 900; }
.mav-order-item strong, .mav-order-item small { display: block; }
.mav-order-item small { margin-top: 2px; color: var(--muted); font-size: 11px; }
.mav-order-item > i { color: var(--green); font-size: 21px; font-style: normal; font-weight: 900; }
.mav-order-item.wrong > i { color: var(--red); }
.mav-order-tools { display: flex; align-items: center; gap: 4px; }
.mav-order-tools button { width: 30px; height: 30px; border: 0; border-radius: 8px; color: var(--navy); background: #e8f0f3; cursor: pointer; }
.mav-order-tools em { color: #8aa0ad; font-size: 20px; font-style: normal; }
.mav-order-feedback { margin: 12px 0; padding: 13px; border-radius: 13px; background: #e9f7f1; }
.mav-order-feedback.bad { background: #fff0f1; }
.mav-order-feedback strong { color: var(--green); }
.mav-order-feedback.bad strong { color: var(--red); }
.mav-order-feedback p { margin: 5px 0 0; font-size: 13px; line-height: 1.45; }
.mav-order-panel > .mav-action { width: 100%; }

.mav-decision-scene { position: relative; overflow: hidden; aspect-ratio: 4 / 3; border-radius: 23px; background: #a8c5d1; box-shadow: 0 17px 36px rgba(16,45,71,.2); }
.mav-decision-scene canvas, .mav-decision-scene [data-mav-decision-objects] { position: absolute; z-index: 4; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.mav-decision-scene canvas { z-index: 6; }
.mav-decision-sprite { position: absolute; object-fit: fill; transform-origin: center; filter: drop-shadow(0 5px 5px rgba(0,0,0,.25)); }
.mav-decision-status { background: #8354a5; }
.mav-decision-panel h2 { margin: 0 0 5px; font-size: 27px; }
.mav-choice-list { display: grid; gap: 10px; margin: 16px 0; }
.mav-choice-list button { display: grid; grid-template-columns: 38px 1fr; align-items: center; gap: 11px; padding: 12px; border: 2px solid #dce7eb; border-radius: 13px; text-align: left; color: var(--navy); background: white; font: inherit; font-weight: 800; cursor: pointer; }
.mav-choice-list button:hover { border-color: var(--blue); transform: translateX(2px); }
.mav-choice-list b { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: white; background: var(--navy); }
.mav-consequence { margin: 18px 0; padding: 18px; border-radius: 16px; background: #fff0f1; }
.mav-consequence.safety-2 { background: #e9f7f1; }
.mav-consequence.safety-1 { background: #fff6df; }
.mav-consequence i { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 10px; border-radius: 50%; color: white; background: var(--red); font-size: 24px; font-style: normal; font-weight: 900; }
.mav-consequence.safety-2 i { background: var(--green); }
.mav-consequence.safety-1 i { background: #e79a26; }
.mav-consequence strong { display: block; font-size: 18px; }
.mav-consequence p { margin: 7px 0 0; line-height: 1.5; }
.mav-decision-panel > .mav-secondary, .mav-decision-panel > .mav-action { width: 100%; margin-top: 9px; }

.mav-game-result { max-width: 650px; margin: 0 auto; padding: 22px 0; text-align: center; }
.mav-stars { display: flex; justify-content: center; gap: 8px; margin-bottom: 12px; }
.mav-stars span { color: #cbd8de; font-size: 50px; filter: drop-shadow(0 5px 5px rgba(0,0,0,.12)); }
.mav-stars span.on { color: var(--yellow); }
.mav-game-result > span { color: var(--green); font-size: 12px; font-weight: 900; letter-spacing: .14em; }
.mav-game-result h2 { margin: 8px 0; font-size: 35px; }
.mav-game-result > strong { display: block; color: var(--blue); font-size: 31px; }
.mav-result-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin: 25px 0; }
.mav-result-stats div { padding: 17px 10px; border-radius: 15px; background: #edf4f6; }
.mav-result-stats b, .mav-result-stats small { display: block; }
.mav-result-stats b { font-size: 25px; }
.mav-result-stats small { margin-top: 3px; color: var(--muted); }
.mav-game-result > .mav-action, .mav-game-result > .mav-secondary { margin: 5px; }

/* Ruta segura: recorrido vial aleatorio. */
.mav-route-setup { display: grid; grid-template-columns: minmax(300px,.82fr) minmax(0,1.18fr); gap: 34px; align-items: stretch; padding: clamp(20px,4vw,42px); border: 1px solid var(--line); border-radius: 28px; background: white; box-shadow: var(--shadow); }
.mav-route-setup-art { position: relative; min-height: 480px; overflow: hidden; border-radius: 23px; color: white; background: linear-gradient(155deg,#c8ead9,#75bd9b); }
.mav-route-setup-art::before, .mav-route-setup-art::after { content:''; position:absolute; z-index:2; width:88px; height:125px; border-radius:14px 14px 4px 4px; background:linear-gradient(90deg,#e28b67 0 16%,#f7dfb1 16% 84%,#e28b67 84%); box-shadow:inset 0 15px #f4b77e; }
.mav-route-setup-art::before { left:22px; top:70px; }
.mav-route-setup-art::after { right:22px; bottom:80px; }
.mav-mini-road { position:absolute; inset:-25px 30%; background:#405767; box-shadow:inset 6px 0 #f6e2a7,inset -6px 0 #f6e2a7; }
.mav-mini-road i { position:absolute; inset:0 47%; background:repeating-linear-gradient(to bottom,#fff4b8 0 34px,transparent 34px 72px); animation:mav-road-scroll .8s linear infinite; }
.mav-mini-road img { position:absolute; z-index:3; bottom:74px; left:50%; width:82px; height:120px; translate:-50% 0; object-fit:contain; filter:drop-shadow(0 9px 5px rgba(0,0,0,.3)); }
.mav-route-setup-art > span { position:absolute; z-index:4; top:38px; left:50%; translate:-50% 0; font-size:48px; filter:drop-shadow(0 5px 5px rgba(0,0,0,.2)); }
.mav-route-setup-art > b { position:absolute; z-index:4; top:92px; left:50%; translate:-50% 0; padding:7px 11px; border-radius:8px; background:var(--navy); font-size:11px; letter-spacing:.08em; }
.mav-route-setup-copy { align-self:center; }
.mav-route-setup-copy h2 { margin:7px 0 12px; color:var(--navy); font-size:clamp(34px,4vw,49px); }
.mav-route-setup-copy > p { color:var(--muted); font-size:17px; line-height:1.6; }
.mav-route-features { display:flex; flex-wrap:wrap; gap:8px; margin:22px 0 28px; }
.mav-route-features span { padding:8px 11px; border-radius:999px; color:#12624f; background:#e4f5ee; font-size:12px; font-weight:900; }
.mav-route-setup-copy h3 { margin-bottom:12px; }
.mav-route-lengths { display:grid; grid-template-columns:repeat(3,1fr); gap:10px; }
.mav-route-lengths button { padding:18px 10px; border:2px solid #dae6e9; border-radius:16px; color:var(--navy); background:#fff; cursor:pointer; }
.mav-route-lengths button:hover { border-color:var(--green); background:#eef9f4; transform:translateY(-2px); }
.mav-route-lengths b, .mav-route-lengths span, .mav-route-lengths small { display:block; }
.mav-route-lengths b { color:var(--green); font-size:32px; }
.mav-route-lengths span { font-weight:900; }
.mav-route-lengths small { margin-top:5px; color:var(--muted); font-size:10px; }

.mav-route-status { display:grid; grid-template-columns:auto minmax(220px,1fr) auto auto; align-items:center; gap:14px; margin-bottom:15px; padding:13px 17px; border-radius:17px; color:white; background:var(--navy); }
.mav-route-status > div:first-child, .mav-route-status > div:last-child { display:grid; }
.mav-route-status span { color:#a9c0cf; font-size:9px; font-weight:900; letter-spacing:.12em; }
.mav-route-status strong { margin-top:2px; font-size:13px; }
.mav-route-status > div:last-child { text-align:right; }
.mav-route-meter { display:grid; grid-template-columns:1fr auto; align-items:center; gap:9px; height:24px; padding:4px; border-radius:99px; background:rgba(255,255,255,.13); }
.mav-route-meter::before { content:''; grid-column:1; grid-row:1; height:8px; border-radius:99px; background:rgba(255,255,255,.2); }
.mav-route-meter i { z-index:2; grid-column:1; grid-row:1; height:8px; border-radius:99px; background:#40d29e; transition:width .3s ease; }
.mav-route-meter b { padding-right:7px; font-size:10px; white-space:nowrap; }
.mav-route-sound { display:grid; place-items:center; width:39px; height:39px; border:1px solid rgba(255,255,255,.23); border-radius:11px; color:white; background:rgba(255,255,255,.1); cursor:pointer; font-size:18px; }
.mav-route-sound:hover { background:rgba(255,255,255,.2); transform:translateY(-1px); }
.mav-route-layout { display:grid; grid-template-columns:minmax(0,1.15fr) minmax(320px,.85fr); gap:22px; align-items:stretch; }
.mav-route-map { position:relative; overflow:hidden; min-height:590px; border:12px solid var(--navy); border-radius:27px; background:#bfe5ce; box-shadow:0 18px 40px rgba(16,45,71,.18); }
.mav-route-scene-bg { position:absolute; z-index:0; inset:0; width:100%; height:100%; object-fit:cover; }
.mav-route-map.phase-driving .mav-route-scene-bg { animation:mav-scene-arrive 1.9s cubic-bezier(.2,.72,.25,1) both; }
@keyframes mav-scene-arrive { from { scale:1.22; filter:blur(2px); } to { scale:1; filter:blur(0); } }
.mav-route-road { position:absolute; z-index:2; inset:-5% 21%; overflow:hidden; background:#3d5667; box-shadow:inset 7px 0 #f2de9f,inset -7px 0 #f2de9f; }
.mav-route-line { position:absolute; top:0; bottom:0; width:6px; translate:-50% 0; background:repeating-linear-gradient(to bottom,#fff0ae 0 32px,transparent 32px 72px); }
.mav-route-line.line-a { left:33.33%; }
.mav-route-line.line-b { left:66.66%; }
.mav-route-line.line-c { display:none; }
.mav-route-map.phase-driving .mav-route-line { animation:mav-road-scroll .62s linear infinite; }
@keyframes mav-road-scroll { to { background-position:0 72px; } }
.mav-route-side { position:absolute; z-index:1; top:0; bottom:0; width:21%; background:linear-gradient(#cae9d4,#a8d4b8); }
.mav-route-side.side-left { left:0; }
.mav-route-side.side-right { right:0; }
.mav-route-side i, .mav-route-side b { position:absolute; left:13%; width:74%; height:118px; border:8px solid rgba(16,45,71,.12); border-radius:12px; background:linear-gradient(90deg,#ca846c 0 16%,#f1d7b8 16% 84%,#ca846c 84%); box-shadow:inset 0 18px #e8a57e; }
.mav-route-side i { top:7%; }
.mav-route-side b { bottom:8%; }
.mav-route-side em { position:absolute; top:42%; left:50%; width:58px; height:58px; translate:-50% 0; border-radius:50%; background:#2f9d70; box-shadow:18px 7px 0 #23845e,-15px 12px 0 #42b786,0 42px 0 -23px #72523c; }
.mav-route-event-label { position:absolute; z-index:9; top:11%; left:50%; translate:-50% 0; max-width:78%; padding:5px 9px; border-radius:8px; color:white; background:rgba(16,45,71,.92); font-size:10px; text-align:center; white-space:nowrap; }
.mav-route-event { position:absolute; z-index:5; top:18%; left:50%; display:grid; justify-items:center; translate:-50% 0; transition:all .5s ease; }
.mav-route-event span { display:grid; place-items:center; width:76px; height:76px; border:5px solid white; border-radius:50%; background:#fff5d6; font-size:40px; box-shadow:0 9px 17px rgba(0,0,0,.24); }
.mav-route-event .mav-route-event-label { position:static; translate:none; max-width:none; margin-top:7px; }
.mav-route-map.phase-driving .mav-route-event { animation:mav-risk-approach 1.9s ease-out both; }
@keyframes mav-risk-approach { from { top:-18%; scale:.55; opacity:.2; } to { top:18%; scale:1; opacity:1; } }
.mav-route-prop { position:absolute; z-index:5; }
.prop-breakdown { top:17%; left:50%; width:92px; height:138px; translate:-50% 0; }
.prop-breakdown img { width:100%; height:100%; object-fit:contain; filter:grayscale(.22) drop-shadow(0 7px 5px rgba(0,0,0,.3)); }
.prop-breakdown > span { position:absolute; top:-10px; right:-15px; display:grid; place-items:center; width:35px; height:35px; border:3px solid white; border-radius:50%; background:#e99f2c; font-size:20px; }
.prop-breakdown .mav-route-event-label { top:100%; }
.mav-route-rival, .mav-route-cross-car, .mav-route-special, .mav-route-parked { position:absolute; z-index:6; object-fit:contain; filter:drop-shadow(0 7px 5px rgba(0,0,0,.3)); }
.mav-route-rival { bottom:-26%; left:19%; width:78px; height:116px; opacity:0; }
.mav-route-impact { position:absolute; z-index:12; top:55%; left:42%; color:#ffd74e; opacity:0; font-size:82px; text-shadow:0 0 18px #c83f4e; }

.scene-intersection .mav-route-side { display:none; }
.scene-intersection .mav-route-road { z-index:2; inset:0; overflow:visible; background:transparent; box-shadow:none; }
.scene-intersection .mav-route-line, .scene-intersection .mav-cross-street { display:none; }
.mav-cross-street { position:absolute; z-index:3; top:17%; right:-80%; left:-80%; height:29%; background:#3d5667; border-top:6px solid #f2de9f; border-bottom:6px solid #f2de9f; box-shadow:0 0 0 3px rgba(16,45,71,.12); }
.mav-cross-street::after { content:''; position:absolute; top:48%; right:0; left:0; height:6px; background:repeating-linear-gradient(to right,#fff0ae 0 35px,transparent 35px 72px); }
.mav-traffic-light { position:absolute; z-index:8; top:12%; right:-17%; display:grid; place-items:center; width:43px; height:43px; border-radius:10px; background:var(--navy); font-size:23px; }
.mav-route-cross-car { z-index:7; top:22%; right:-27%; width:82px; height:120px; transform:rotate(90deg); }
.scene-intersection .mav-traffic-light { top:31%; right:14%; }
.scene-intersection .mav-route-cross-car { top:42%; right:2%; width:76px; height:112px; }
.scene-intersection .mav-route-event-label { top:29%; }

.mav-route-crosswalk { position:absolute; z-index:4; top:22%; left:2%; width:96%; height:78px; background:repeating-linear-gradient(to right,#f9f7e9 0 18px,transparent 18px 34px); transform:perspective(200px) rotateX(12deg); }
.mav-route-person { position:absolute; z-index:7; top:21%; left:17%; font-size:48px; filter:drop-shadow(0 5px 4px rgba(0,0,0,.3)); }
.scene-crosswalk.phase-driving .mav-route-person, .scene-school.phase-driving .mav-route-person, .scene-hidden-person.phase-driving .mav-route-person { animation:mav-person-cross 1.9s ease-out both; }
@keyframes mav-person-cross { from { left:-12%; } to { left:17%; } }
.mav-route-ball { position:absolute; z-index:7; top:28%; right:20%; font-size:39px; animation:mav-ball-roll 1.2s ease-in-out infinite alternate; }
@keyframes mav-ball-roll { to { right:43%; transform:rotate(150deg); } }
.hidden-child { left:7%; opacity:0; }
.scene-ball.phase-outcome .hidden-child { opacity:1; animation:mav-child-reveal .65s ease both; }
@keyframes mav-child-reveal { from { left:-10%; } to { left:7%; } }

.mav-route-roundabout { position:absolute; z-index:4; top:13%; left:50%; display:grid; place-items:center; width:210px; height:210px; translate:-50% 0; border:58px solid #3d5667; border-radius:50%; background:#70b889; box-shadow:0 0 0 6px #f2de9f; }
.mav-route-roundabout i { color:white; font-size:46px; font-style:normal; }
.scene-roundabout .mav-route-side { display:none; }
.scene-roundabout .mav-route-road { z-index:2; inset:0; overflow:visible; background:transparent; box-shadow:none; }
.scene-roundabout .mav-route-line { display:none; }
.scene-roundabout .mav-route-cross-car { top:37%; right:17%; width:72px; height:108px; transform:rotate(-42deg); }
.scene-roundabout .mav-route-event-label { top:13%; }
.scene-curve .mav-route-side { display:none; }
.scene-curve .mav-route-road { z-index:2; inset:0; overflow:visible; background:transparent; box-shadow:none; }
.scene-curve .mav-route-line { display:none !important; }
.scene-curve .mav-route-car { left:58%; }
.scene-curve .mav-route-event-label { top:9%; }
.mav-route-curve-sign { position:absolute; z-index:8; top:15%; right:19%; display:grid; place-items:center; width:58px; height:58px; border:5px solid white; border-radius:14px; color:var(--navy); background:#ffd64a; font-size:35px; font-weight:900; box-shadow:0 7px 13px rgba(0,0,0,.22); }
.mav-route-oncoming.curve-oncoming { left:52%; }

.mav-route-rails { position:absolute; z-index:5; top:23%; right:-30%; left:-30%; height:66px; background:repeating-linear-gradient(to right,#7a5b43 0 13px,transparent 13px 28px); border-top:7px solid #ccd5d8; border-bottom:7px solid #ccd5d8; }
.mav-route-barrier { position:absolute; z-index:8; top:19%; left:8%; width:84%; height:13px; border-radius:7px; background:repeating-linear-gradient(to right,#fff 0 28px,#cf3f4d 28px 56px); transform-origin:left; }
.mav-route-train { position:absolute; z-index:7; top:18%; left:-96%; width:390px; height:130px; object-fit:contain; opacity:0; filter:drop-shadow(0 8px 5px rgba(0,0,0,.34)); }
.scene-railroad.phase-driving .mav-route-barrier { animation:mav-barrier-lower 1.9s ease-out both; }
.scene-railroad.phase-driving .mav-route-train { animation:mav-train-preview 1.9s ease-out both; }
.scene-railroad.phase-outcome.choice-0 .mav-route-car { animation:mav-rail-stop .85s ease-out both; }
.scene-railroad.phase-outcome.choice-0 .mav-route-train { animation:mav-train-pass 1.65s linear both; }
.scene-railroad.phase-outcome.choice-1 .mav-route-car { animation:mav-rail-enter 1s ease-in both; }
.scene-railroad.phase-outcome.choice-1 .mav-route-train { animation:mav-train-hit 1s linear both; }
.scene-railroad.phase-outcome.choice-1 .mav-route-impact { top:28%; left:48%; animation:mav-impact 1s ease-in both; }
.scene-railroad.phase-outcome.choice-2 .mav-route-car { animation:mav-rail-trapped 1s ease-out both; }
.scene-railroad.phase-outcome.choice-2 .mav-route-train { animation:mav-train-near 1.15s ease-out both; }
@keyframes mav-barrier-lower { from { transform:rotate(-76deg); } to { transform:rotate(0); } }
@keyframes mav-train-preview { 0%,45% { left:-96%; opacity:0; } 100% { left:-72%; opacity:.8; } }
@keyframes mav-train-pass { 0% { left:-100%; opacity:1; } 100% { left:105%; opacity:1; } }
@keyframes mav-train-hit { 0% { left:-100%; opacity:1; } 82%,100% { left:-3%; opacity:1; } }
@keyframes mav-train-near { 0% { left:-100%; opacity:1; } 100% { left:-36%; opacity:1; } }
@keyframes mav-rail-stop { to { transform:translateY(-145px); } }
@keyframes mav-rail-enter { to { transform:translateY(-275px) rotate(3deg); } }
@keyframes mav-rail-trapped { to { transform:translateY(-245px); } }

.mav-route-special { top:18%; left:50%; translate:-50% 0; }
.prop-emergency { width:100px; height:148px; }
.prop-cycle { left:65%; width:65px; height:105px; }
.prop-motorcycle { left:70%; width:67px; height:110px; }
.mav-route-large-vehicle { position:absolute; z-index:6; top:14%; left:50%; translate:-50% 0; font-size:90px; filter:drop-shadow(0 8px 5px rgba(0,0,0,.3)); }
.mav-route-heavy { position:absolute; z-index:6; top:14%; left:50%; translate:-50% 0; object-fit:contain; filter:drop-shadow(0 8px 6px rgba(0,0,0,.32)); }
.prop-truck { left:68%; width:104px; height:158px; }
.prop-bus { width:108px; height:164px; }
.mav-route-oncoming { position:absolute; z-index:6; top:-24%; left:27%; width:72px; height:110px; object-fit:contain; opacity:0; transform:rotate(180deg); filter:drop-shadow(0 7px 5px rgba(0,0,0,.3)); }
.scene-truck .mav-route-line.line-a, .scene-hill .mav-route-line.line-a, .scene-night .mav-route-line.line-a { display:block; left:50%; width:7px; background:repeating-linear-gradient(to bottom,#f5d56d 0 35px,transparent 35px 72px); }
.scene-truck .mav-route-line.line-b, .scene-hill .mav-route-line.line-b, .scene-night .mav-route-line.line-b { display:none; }
.scene-truck .mav-route-car, .scene-hill .mav-route-car, .scene-night .mav-route-car { left:68%; }
.scene-truck .mav-route-event-label { left:68%; }
.mav-route-cones { position:absolute; z-index:6; top:23%; left:50%; translate:-50% 0; color:#f28b35; font-size:44px; white-space:nowrap; text-shadow:0 4px white; }
.mav-route-animal { position:absolute; z-index:7; top:24%; right:16%; font-size:52px; }
.mav-route-puddle { position:absolute; z-index:5; top:28%; left:50%; display:grid; place-items:center; width:190px; height:65px; translate:-50% 0; border-radius:50%; color:#bce8f5; background:#277b9c; font-size:55px; }
.mav-route-parked { top:13%; right:3%; width:91px; height:136px; }
.mav-route-door { position:absolute; z-index:8; top:26%; right:21%; color:#e39c2e; font-size:48px; }
.mav-route-merge { position:absolute; z-index:6; top:17%; right:17%; color:white; font-size:65px; }
.merge-car { bottom:29%; left:auto; right:-4%; opacity:1; transform:rotate(-12deg); }
.aggressive-car { bottom:-2%; left:19%; opacity:1; }
.phone-rival { bottom:32%; left:18%; opacity:1; }
.weather-rival { top:17%; bottom:auto; left:50%; opacity:.72; }
.night-oncoming { top:13%; left:30%; opacity:1; }
.mav-route-crash-tree { position:absolute; z-index:8; top:25%; right:-28%; font-size:74px; filter:drop-shadow(0 8px 4px rgba(0,0,0,.28)); }
.mav-route-seatbelt { position:absolute; z-index:8; top:20%; left:50%; width:66px; height:70px; translate:-50% 0; color:#d39a31; opacity:0; font-size:70px; font-weight:900; transform:rotate(-12deg); }

/* El recorrido de llegada conserva la escena: el auto entra al encuadre y el riesgo se acerca. */
.mav-route-map.phase-driving.scene-intersection .mav-route-car,
.mav-route-map.phase-driving.scene-roundabout .mav-route-car,
.mav-route-map.phase-driving.scene-curve .mav-route-car { animation:mav-special-approach 1.9s cubic-bezier(.25,.7,.3,1) both; }
@keyframes mav-special-approach { from { bottom:-27%; scale:.78; } to { bottom:7%; scale:1; } }

/* Consecuencias visibles: frenar, evadir o chocar según la opción. */
.scene-breakdown.phase-outcome.choice-0 .mav-route-car { animation:mav-pass-obstacle 1.15s ease-in-out both; }
.scene-breakdown.phase-outcome.choice-1 .mav-route-car { animation:mav-last-swerve .85s ease-in both; }
.scene-breakdown.phase-outcome.choice-1 .mav-route-rival { animation:mav-rival-hit .85s ease-in both; }
.scene-breakdown.phase-outcome.choice-1 .mav-route-impact { animation:mav-impact .85s ease-in both; }
.scene-breakdown.phase-outcome.choice-2 .mav-route-car { animation:mav-stop-short .8s ease-out both; }
@keyframes mav-pass-obstacle { 45% { transform:translate(-92px,-120px) rotate(-5deg); } 100% { transform:translate(-92px,-245px); } }
@keyframes mav-last-swerve { 55% { transform:translate(-105px,-115px) rotate(-11deg); } 100% { transform:translate(-80px,-145px) rotate(8deg); } }
@keyframes mav-rival-hit { 0% { opacity:0; bottom:-24%; } 35% { opacity:1; } 100% { opacity:1; bottom:27%; left:25%; transform:rotate(7deg); } }
@keyframes mav-impact { 0%,72% { opacity:0; scale:.2; } 83% { opacity:1; scale:1.4; } 100% { opacity:.8; scale:1; } }
@keyframes mav-stop-short { to { transform:translateY(-105px); } }

.scene-intersection.phase-outcome.choice-0 .mav-route-car { animation:mav-stop-short .8s ease-out both; }
.scene-intersection.phase-outcome.choice-0 .mav-route-cross-car { animation:mav-cross-safe 1.15s ease-in-out both; }
.scene-intersection.phase-outcome.choice-1 .mav-route-car { animation:mav-enter-crossing .9s ease-in both; }
.scene-intersection.phase-outcome.choice-1 .mav-route-cross-car { animation:mav-cross-hit .9s ease-in both; }
.scene-intersection.phase-outcome.choice-1 .mav-route-impact { top:43%; left:48%; animation:mav-impact .9s ease-in both; }
.scene-intersection.phase-outcome.choice-2 .mav-route-car { animation:mav-enter-late .85s ease-out both; }
@keyframes mav-cross-safe { from { right:2%; } to { right:102%; } }
@keyframes mav-enter-crossing { to { transform:translateY(-160px); } }
@keyframes mav-cross-hit { to { right:35%; } }
@keyframes mav-enter-late { to { transform:translateY(-125px); } }
.scene-breakdown.phase-outcome .mav-route-signal, .scene-intersection.phase-outcome .mav-route-signal { opacity:0; animation:mav-show-result .28s .88s ease forwards; }
@keyframes mav-show-result { to { opacity:1; } }

.scene-roundabout.phase-outcome.choice-0 .mav-route-car { animation:mav-roundabout-yield .85s ease-out both; }
.scene-roundabout.phase-outcome.choice-0 .mav-route-cross-car { animation:mav-roundabout-pass 1.2s ease-in-out both; }
.scene-roundabout.phase-outcome.choice-1 .mav-route-car { animation:mav-roundabout-enter .9s ease-in both; }
.scene-roundabout.phase-outcome.choice-1 .mav-route-cross-car { animation:mav-roundabout-conflict .9s ease-in both; }
.scene-roundabout.phase-outcome.choice-1 .mav-route-impact { top:56%; left:56%; animation:mav-impact .9s ease-in both; }
.scene-roundabout.phase-outcome.choice-2 .mav-route-car { animation:mav-roundabout-stop-inside 1s ease-out both; }
@keyframes mav-roundabout-yield { to { transform:translateY(-55px); } }
@keyframes mav-roundabout-pass { 0% { top:37%; right:17%; transform:rotate(-42deg); } 45% { top:28%; right:35%; transform:rotate(-108deg); } 100% { top:44%; right:51%; transform:rotate(-185deg); } }
@keyframes mav-roundabout-enter { 0%,30% { transform:translateY(-55px); } 100% { transform:translate(74px,-158px) rotate(24deg); } }
@keyframes mav-roundabout-conflict { 0% { top:37%; right:17%; transform:rotate(-42deg); } 100% { top:50%; right:27%; transform:rotate(-74deg); } }
@keyframes mav-roundabout-stop-inside { 0%,25% { transform:translateY(-55px); } 100% { transform:translate(42px,-185px) rotate(20deg); } }

.scene-truck.phase-outcome.choice-0 .mav-route-car { animation:mav-truck-distance .9s ease-out both; }
.scene-truck.phase-outcome.choice-0 .prop-truck { animation:mav-truck-away .9s ease-out both; }
.scene-truck.phase-outcome.choice-1 .mav-route-car { animation:mav-tailgate .9s ease-in both; }
.scene-truck.phase-outcome.choice-1 .mav-route-impact { top:43%; left:67%; animation:mav-impact .9s ease-in both; }
.scene-truck.phase-outcome.choice-2 .mav-route-car { animation:mav-peek-left 1s ease-in-out both; }
.scene-truck.phase-outcome.choice-2 .mav-route-oncoming { animation:mav-oncoming-near 1s ease-in both; }
@keyframes mav-truck-distance { to { transform:translateY(34px); } }
@keyframes mav-truck-away { to { top:7%; scale:.82; } }
@keyframes mav-tailgate { to { transform:translateY(-245px); } }
@keyframes mav-peek-left { 55%,100% { left:48%; transform:translateY(-125px) rotate(-6deg); } }
@keyframes mav-oncoming-near { 0% { opacity:0; top:-24%; } 35% { opacity:1; } 100% { opacity:1; top:47%; } }
.scene-roundabout.phase-outcome .mav-route-signal, .scene-truck.phase-outcome .mav-route-signal { opacity:0; animation:mav-show-result .28s 1s ease forwards; }
.scene-curve.phase-outcome.choice-0 .mav-route-car { animation:mav-follow-curve 1.25s ease-in-out both; }
.scene-curve.phase-outcome.choice-1 .mav-route-car { animation:mav-curve-brake 1s ease-out both; }
.scene-curve.phase-outcome.choice-2 .mav-route-car { animation:mav-cut-curve 1s ease-in both; }
.scene-curve.phase-outcome.choice-2 .curve-oncoming { animation:mav-curve-oncoming 1s ease-in both; }
.scene-curve.phase-outcome.choice-2 .mav-route-impact { top:43%; left:45%; animation:mav-impact 1s ease-in both; }
@keyframes mav-follow-curve { 35% { transform:translate(-18px,-85px) rotate(-7deg); } 70% { transform:translate(-78px,-165px) rotate(-19deg); } 100% { transform:translate(-55px,-235px) rotate(7deg); } }
@keyframes mav-curve-brake { 55% { transform:translate(-16px,-82px) rotate(-8deg); } 70% { transform:translate(-16px,-66px) rotate(-8deg); } 100% { transform:translate(-18px,-92px) rotate(-7deg); } }
@keyframes mav-cut-curve { to { transform:translate(-118px,-185px) rotate(-22deg); } }
@keyframes mav-curve-oncoming { 0% { opacity:0; top:-22%; } 25% { opacity:1; } 100% { opacity:1; top:43%; left:43%; transform:rotate(180deg); } }
.scene-curve.phase-outcome .mav-route-signal { opacity:0; animation:mav-show-result .28s 1.05s ease forwards; }

/* Peatones y riesgos que aparecen desde una zona oculta. */
.scene-crosswalk.phase-outcome.choice-0 .mav-route-car,
.scene-school.phase-outcome.choice-0 .mav-route-car,
.scene-hidden-person.phase-outcome.choice-0 .mav-route-car,
.scene-ball.phase-outcome.choice-0 .mav-route-car { animation:mav-pedestrian-stop .9s ease-out both; }
.scene-crosswalk.phase-outcome.choice-0 .mav-route-person,
.scene-school.phase-outcome.choice-0 .mav-route-person,
.scene-hidden-person.phase-outcome.choice-0 .mav-route-person { animation:mav-person-finish 1.2s .25s ease-in-out both; }
.scene-crosswalk.phase-outcome.result-medium .mav-route-car,
.scene-school.phase-outcome.result-medium .mav-route-car,
.scene-hidden-person.phase-outcome.result-medium .mav-route-car,
.scene-ball.phase-outcome.result-medium .mav-route-car { animation:mav-late-brake 1s ease-out both; }
.scene-crosswalk.phase-outcome.result-danger .mav-route-car,
.scene-school.phase-outcome.result-danger .mav-route-car,
.scene-hidden-person.phase-outcome.result-danger .mav-route-car,
.scene-ball.phase-outcome.result-danger .mav-route-car { animation:mav-pedestrian-conflict 1s ease-in both; }
.scene-crosswalk.phase-outcome.result-danger .mav-route-impact,
.scene-school.phase-outcome.result-danger .mav-route-impact,
.scene-hidden-person.phase-outcome.result-danger .mav-route-impact,
.scene-ball.phase-outcome.result-danger .mav-route-impact { top:29%; left:48%; animation:mav-impact 1s ease-in both; }
@keyframes mav-pedestrian-stop { to { transform:translateY(-105px); } }
@keyframes mav-person-finish { to { left:77%; } }
@keyframes mav-late-brake { 70% { transform:translateY(-205px); } 100% { transform:translateY(-170px); } }
@keyframes mav-pedestrian-conflict { to { transform:translateY(-265px); } }

/* Pérdida de adherencia o de control: el auto abandona el carril; no es solo una vibración. */
.scene-tire .mav-route-road, .scene-fatigue .mav-route-road, .scene-hill .mav-route-road { overflow:visible; }
.scene-tire.phase-outcome.choice-0 .mav-route-car { animation:mav-controlled-shoulder 1.3s ease-out both; }
.scene-tire.phase-outcome.choice-1 .mav-route-car { animation:mav-spin-tree 1.25s cubic-bezier(.4,0,.8,1) both; }
.scene-tire.phase-outcome.choice-1 .mav-route-impact { top:31%; left:116%; animation:mav-impact 1.25s ease-in both; }
.scene-tire.phase-outcome.choice-2 .mav-route-car { animation:mav-swerve-shoulder 1.15s ease-in-out both; }
.scene-fatigue.phase-outcome.result-danger .mav-route-car,
.scene-hill.phase-outcome.result-danger .mav-route-car { animation:mav-spin-tree 1.25s cubic-bezier(.4,0,.8,1) both; }
.scene-fatigue.phase-outcome.result-danger .mav-route-impact,
.scene-hill.phase-outcome.result-danger .mav-route-impact { top:31%; left:116%; animation:mav-impact 1.25s ease-in both; }
.scene-fatigue.phase-outcome.result-safe .mav-route-car,
.scene-hill.phase-outcome.result-safe .mav-route-car { animation:mav-controlled-shoulder 1.2s ease-out both; }
.scene-fatigue.phase-outcome.result-medium .mav-route-car,
.scene-hill.phase-outcome.result-medium .mav-route-car { animation:mav-wander-lane 1.15s ease-in-out both; }
@keyframes mav-controlled-shoulder { 45% { transform:translate(28px,-80px) rotate(4deg); } 100% { transform:translate(118px,-145px) rotate(7deg); } }
@keyframes mav-spin-tree { 35% { transform:translate(42px,-95px) rotate(13deg); } 72% { transform:translate(145px,-190px) rotate(62deg); } 100% { transform:translate(205px,-230px) rotate(104deg); } }
@keyframes mav-swerve-shoulder { 30% { transform:translate(84px,-72px) rotate(16deg); } 68% { transform:translate(148px,-140px) rotate(29deg); } 100% { transform:translate(104px,-175px) rotate(-7deg); } }
@keyframes mav-wander-lane { 35% { transform:translate(-48px,-85px) rotate(-8deg); } 72% { transform:translate(54px,-155px) rotate(11deg); } 100% { transform:translate(24px,-190px) rotate(3deg); } }

/* Clima y visibilidad: el desenlace usa el vehículo que realmente estaba oculto. */
.scene-rain.phase-outcome.choice-0 .mav-route-car,
.scene-fog.phase-outcome.choice-0 .mav-route-car { animation:mav-weather-distance 1.1s ease-out both; }
.scene-rain.phase-outcome.choice-0 .weather-rival,
.scene-fog.phase-outcome.choice-0 .weather-rival { animation:mav-weather-away 1.1s ease-out both; }
.scene-rain.phase-outcome.choice-1 .mav-route-car,
.scene-fog.phase-outcome.choice-2 .mav-route-car { animation:mav-weather-tailgate 1s ease-in both; }
.scene-rain.phase-outcome.choice-2 .mav-route-car,
.scene-fog.phase-outcome.choice-1 .mav-route-car { animation:mav-weather-collision 1.1s ease-in both; }
.scene-rain.phase-outcome.choice-2 .mav-route-impact,
.scene-fog.phase-outcome.choice-1 .mav-route-impact { top:34%; left:49%; animation:mav-impact 1.1s ease-in both; }
.scene-night.phase-outcome.choice-0 .mav-route-car { animation:mav-steady-drive 1.1s ease-out both; }
.scene-night.phase-outcome.choice-0 .night-oncoming { animation:mav-night-pass 1.2s ease-in both; }
.scene-night.phase-outcome.choice-1 .mav-route-car { animation:mav-night-conflict 1.1s ease-in both; }
.scene-night.phase-outcome.choice-1 .night-oncoming { animation:mav-night-swerve 1.1s ease-in both; }
.scene-night.phase-outcome.choice-1 .mav-route-impact { top:48%; left:48%; animation:mav-impact 1.1s ease-in both; }
.scene-night.phase-outcome.choice-2 .mav-route-car { animation:mav-wander-lane 1.15s ease-in-out both; }
@keyframes mav-weather-distance { to { transform:translateY(28px); } }
@keyframes mav-weather-away { to { top:5%; scale:.75; opacity:.55; } }
@keyframes mav-weather-tailgate { to { transform:translateY(-190px); } }
@keyframes mav-weather-collision { to { transform:translateY(-285px) rotate(5deg); } }
@keyframes mav-night-pass { to { top:75%; opacity:1; } }
@keyframes mav-night-conflict { to { transform:translate(-58px,-205px) rotate(-11deg); } }
@keyframes mav-night-swerve { to { top:49%; left:43%; transform:rotate(168deg); } }
.scene-hill.phase-outcome.choice-0 .mav-route-car { animation:mav-steady-drive 1.1s ease-out both; }

/* Cinturón: se muestra colocado, tardío o la inercia del pasajero sin protección. */
.scene-seatbelt.phase-outcome.choice-0 .mav-route-seatbelt { animation:mav-belt-fasten .75s ease-out both; }
.scene-seatbelt.phase-outcome.choice-1 .mav-route-car { animation:mav-seatbelt-creep 1s ease-out both; }
.scene-seatbelt.phase-outcome.choice-1 .mav-route-seatbelt { animation:mav-belt-late 1s ease-out both; }
.scene-seatbelt.phase-outcome.choice-2 .mav-route-car { animation:mav-brake-check 1s ease-out both; }
.scene-seatbelt.phase-outcome.choice-2 .seatbelt-event { animation:mav-passenger-lurch 1s ease-in both; }
.scene-seatbelt.phase-outcome.choice-2 .passenger-impact { top:24%; left:50%; animation:mav-impact 1s ease-in both; }
@keyframes mav-belt-fasten { from { opacity:0; transform:rotate(-12deg) scale(.55); } to { opacity:1; transform:rotate(-12deg) scale(1); } }
@keyframes mav-seatbelt-creep { to { transform:translateY(-80px); } }
@keyframes mav-belt-late { 0%,60% { opacity:0; } 100% { opacity:.65; } }
@keyframes mav-passenger-lurch { 65% { transform:translate(-50%,-20px) rotate(-7deg); } 100% { transform:translate(-50%,50px) rotate(18deg); } }

/* Vehículos vulnerables y obstáculos: cada mala decisión alcanza físicamente el conflicto. */
.scene-emergency.phase-outcome.choice-0 .mav-route-car { animation:mav-yield-right 1.1s ease-out both; }
.scene-emergency.phase-outcome.choice-0 .prop-emergency { animation:mav-emergency-pass 1.15s ease-in both; }
.scene-emergency.phase-outcome.choice-1 .mav-route-car { animation:mav-stop-short .8s ease-out both; }
.scene-emergency.phase-outcome.choice-2 .mav-route-car { animation:mav-rear-conflict 1s ease-in both; }
.scene-emergency.phase-outcome.choice-2 .mav-route-impact { top:42%; left:50%; animation:mav-impact 1s ease-in both; }
.scene-cyclist.phase-outcome.choice-0 .mav-route-car { animation:mav-pass-wide 1.15s ease-in-out both; }
.scene-cyclist.phase-outcome.choice-1 .mav-route-car { animation:mav-pass-close 1s ease-in-out both; }
.scene-cyclist.phase-outcome.choice-2 .mav-route-car,
.scene-motorcycle.phase-outcome.choice-1 .mav-route-car { animation:mav-side-hit 1s ease-in both; }
.scene-cyclist.phase-outcome.choice-2 .mav-route-impact,
.scene-motorcycle.phase-outcome.choice-1 .mav-route-impact { top:35%; left:65%; animation:mav-impact 1s ease-in both; }
.scene-motorcycle.phase-outcome.choice-0 .mav-route-car { animation:mav-stop-short .9s ease-out both; }
.scene-motorcycle.phase-outcome.choice-2 .mav-route-car { animation:mav-pass-close 1s ease-in-out both; }
@keyframes mav-yield-right { to { transform:translate(92px,-100px) rotate(4deg); } }
@keyframes mav-emergency-pass { to { top:73%; } }
@keyframes mav-rear-conflict { to { transform:translateY(-210px); } }
@keyframes mav-pass-wide { 50% { transform:translate(-78px,-120px); } 100% { transform:translate(-78px,-260px); } }
@keyframes mav-pass-close { 55% { transform:translate(35px,-145px) rotate(4deg); } 100% { transform:translate(12px,-250px); } }
@keyframes mav-side-hit { to { transform:translate(54px,-245px) rotate(9deg); } }

.scene-bus.phase-outcome.choice-0 .mav-route-car,
.scene-animal.phase-outcome.choice-0 .mav-route-car,
.scene-works.phase-outcome.choice-0 .mav-route-car { animation:mav-pedestrian-stop .9s ease-out both; }
.scene-bus.phase-outcome.result-danger .mav-route-car,
.scene-animal.phase-outcome.result-danger .mav-route-car,
.scene-works.phase-outcome.result-danger .mav-route-car { animation:mav-obstacle-hit 1s ease-in both; }
.scene-bus.phase-outcome.result-danger .mav-route-impact,
.scene-animal.phase-outcome.result-danger .mav-route-impact,
.scene-works.phase-outcome.result-danger .mav-route-impact { top:28%; left:50%; animation:mav-impact 1s ease-in both; }
.scene-bus.phase-outcome.result-medium .mav-route-car,
.scene-animal.phase-outcome.result-medium .mav-route-car,
.scene-works.phase-outcome.result-medium .mav-route-car { animation:mav-late-brake 1s ease-out both; }
@keyframes mav-obstacle-hit { to { transform:translateY(-270px); } }

/* Riesgos laterales y de incorporación. */
.scene-puddle.phase-outcome.choice-0 .mav-route-car { animation:mav-puddle-safe 1.1s ease-out both; }
.scene-puddle.phase-outcome.choice-1 .mav-route-car { animation:mav-puddle-swerve 1.1s ease-in-out both; }
.scene-puddle.phase-outcome.choice-1 .mav-route-impact { top:43%; left:17%; animation:mav-impact 1.1s ease-in both; }
.scene-puddle.phase-outcome.choice-2 .mav-route-car { animation:mav-aquaplane 1.15s ease-in both; }
.scene-door.phase-outcome.choice-0 .mav-route-car { animation:mav-door-clear 1.1s ease-in-out both; }
.scene-door.phase-outcome.choice-1 .mav-route-car { animation:mav-door-hit 1s ease-in both; }
.scene-door.phase-outcome.choice-1 .mav-route-impact { top:30%; left:82%; animation:mav-impact 1s ease-in both; }
.scene-door.phase-outcome.choice-2 .mav-route-car { animation:mav-pass-close 1s ease-in-out both; }
.scene-merge.phase-outcome.choice-0 .merge-car { animation:mav-merge-safe 1.1s ease-out both; }
.scene-merge.phase-outcome.choice-1 .mav-route-car { animation:mav-merge-block 1s ease-in both; }
.scene-merge.phase-outcome.choice-1 .merge-car { animation:mav-merge-hit 1s ease-in both; }
.scene-merge.phase-outcome.choice-1 .mav-route-impact { top:55%; left:67%; animation:mav-impact 1s ease-in both; }
.scene-merge.phase-outcome.choice-2 .mav-route-car { animation:mav-merge-parallel 1s ease-in-out both; }
.scene-aggressive.phase-outcome.choice-0 .aggressive-car { animation:mav-aggressor-pass 1.1s ease-in-out both; }
.scene-aggressive.phase-outcome.choice-1 .mav-route-car { animation:mav-brake-check 1s ease-out both; }
.scene-aggressive.phase-outcome.choice-1 .aggressive-car { animation:mav-rear-hit 1s ease-in both; }
.scene-aggressive.phase-outcome.choice-1 .mav-route-impact { top:77%; left:49%; animation:mav-impact 1s ease-in both; }
.scene-aggressive.phase-outcome.choice-2 .mav-route-car { animation:mav-race-away 1s ease-in both; }
@keyframes mav-puddle-safe { 50% { transform:translateY(-90px); } 100% { transform:translateY(-210px); } }
@keyframes mav-puddle-swerve { 45% { transform:translate(-105px,-110px) rotate(-14deg); } 100% { transform:translate(-125px,-205px) rotate(-8deg); } }
@keyframes mav-aquaplane { 40% { transform:translateY(-135px) rotate(3deg); } 100% { transform:translate(72px,-245px) rotate(35deg); } }
@keyframes mav-door-clear { 45% { transform:translate(-75px,-110px); } 100% { transform:translate(-70px,-245px); } }
@keyframes mav-door-hit { to { transform:translate(56px,-255px) rotate(8deg); } }
@keyframes mav-merge-safe { to { right:42%; bottom:52%; transform:rotate(0); } }
@keyframes mav-merge-block { to { transform:translate(34px,-180px); } }
@keyframes mav-merge-hit { to { right:27%; bottom:39%; transform:rotate(-5deg); } }
@keyframes mav-merge-parallel { to { transform:translate(40px,-190px); } }
@keyframes mav-aggressor-pass { 45% { left:3%; bottom:25%; } 100% { left:8%; bottom:72%; } }
@keyframes mav-brake-check { 55%,100% { transform:translateY(42px); } }
@keyframes mav-rear-hit { to { bottom:8%; left:43%; } }
@keyframes mav-race-away { to { transform:translateY(-255px); } }

/* Distracción: mirar el teléfono desplaza el auto hasta el vehículo contiguo. */
.scene-phone.phase-outcome.choice-0 .mav-route-car { animation:mav-steady-drive 1s ease-out both; }
.scene-phone.phase-outcome.choice-1 .mav-route-car { animation:mav-phone-drift 1.1s ease-in both; }
.scene-phone.phase-outcome.choice-1 .mav-route-impact { top:45%; left:26%; animation:mav-impact 1.1s ease-in both; }
.scene-phone.phase-outcome.choice-2 .mav-route-car { animation:mav-wander-lane 1.15s ease-in-out both; }
@keyframes mav-steady-drive { to { transform:translateY(-190px); } }
@keyframes mav-phone-drift { to { transform:translate(-72px,-180px) rotate(-8deg); } }

.scene-railroad.phase-outcome .mav-route-signal,
.scene-tire.phase-outcome .mav-route-signal,
.scene-crosswalk.phase-outcome .mav-route-signal,
.scene-school.phase-outcome .mav-route-signal,
.scene-hidden-person.phase-outcome .mav-route-signal,
.scene-ball.phase-outcome .mav-route-signal { opacity:0; animation:mav-show-result .28s 1.15s ease forwards; }
.mav-route-car { position:absolute; z-index:6; bottom:7%; left:50%; width:96px; height:142px; translate:-50% 0; object-fit:contain; filter:drop-shadow(0 10px 6px rgba(0,0,0,.35)); transition:transform .6s ease,left .6s ease; }
.mav-route-map.phase-driving .mav-route-car { animation:mav-car-drive .65s ease-in-out infinite; }
@keyframes mav-car-drive { 50% { transform:translateY(-4px); } }
.mav-route-map.result-safe .mav-route-car { transform:translateX(-34px); }
.mav-route-map.result-medium .mav-route-car { animation:mav-brake .42s ease 2; }
.mav-route-map.result-danger .mav-route-car { animation:mav-skid .16s linear 5; }
@keyframes mav-brake { 50% { transform:translateY(18px); } }
@keyframes mav-skid { 25% { transform:translateX(-12px) rotate(-3deg); } 75% { transform:translateX(12px) rotate(3deg); } }
.mav-route-map.result-safe::after, .mav-route-map.result-medium::after, .mav-route-map.result-danger::after { content:''; position:absolute; z-index:7; inset:0; pointer-events:none; }
.mav-route-map.result-safe::after { box-shadow:inset 0 0 70px rgba(22,134,90,.55); }
.mav-route-map.result-medium::after { box-shadow:inset 0 0 70px rgba(244,166,47,.55); }
.mav-route-map.result-danger::after { box-shadow:inset 0 0 90px rgba(200,63,78,.65); }
.mav-route-signal { position:absolute; z-index:9; top:45%; left:50%; display:grid; place-items:center; width:70px; height:70px; translate:-50% -50%; border-radius:50%; color:white; font-size:43px; font-weight:900; }
.result-safe .mav-route-signal { background:var(--green); }
.result-medium .mav-route-signal { background:#e9a12e; }
.result-danger .mav-route-signal { background:var(--red); }
.mav-route-zone, .mav-route-counter { position:absolute; z-index:10; top:12px; padding:7px 10px; border-radius:9px; color:white; background:rgba(16,45,71,.9); font-size:10px; font-weight:900; letter-spacing:.06em; }
.mav-route-zone { left:12px; }
.mav-route-counter { right:12px; }
.mav-route-map.theme-night { filter:saturate(.72) brightness(.78); }
.mav-route-map.theme-rain::before, .mav-route-map.theme-fog::before { content:''; position:absolute; z-index:8; inset:0; pointer-events:none; }
.mav-route-map.theme-rain::before { background:linear-gradient(rgba(83,137,160,.2),rgba(34,75,96,.34)); }
.mav-route-map.theme-rain .mav-route-road::after { content:''; position:absolute; z-index:5; inset:0; pointer-events:none; opacity:.62; background-image:radial-gradient(ellipse at center,rgba(220,244,253,.9) 0 24%,transparent 28%); background-size:27px 39px; transform:skewX(-9deg); animation:mav-route-rain .48s linear infinite; }
@keyframes mav-route-rain { from { background-position:0 -39px; } to { background-position:-10px 39px; } }
.mav-route-map.theme-fog::before { background:linear-gradient(rgba(238,247,248,.52),rgba(238,247,248,.72)); }
.mav-route-map.theme-works .mav-route-side { background:#dfcfa8; }
.mav-route-map.theme-rural .mav-route-side, .mav-route-map.theme-highway .mav-route-side { background:#a6d49c; }
.mav-route-map.theme-rural .mav-route-side i, .mav-route-map.theme-rural .mav-route-side b, .mav-route-map.theme-highway .mav-route-side i, .mav-route-map.theme-highway .mav-route-side b { display:none; }
.mav-route-panel { display:flex; flex-direction:column; justify-content:center; padding:clamp(20px,3vw,31px); border:1px solid var(--line); border-radius:24px; background:white; box-shadow:var(--shadow); }
.mav-route-panel h2 { margin:7px 0 10px; color:var(--navy); font-size:clamp(25px,3vw,34px); }
.mav-route-panel > p, .mav-route-driving-copy p { color:var(--muted); font-size:15px; line-height:1.55; }
.mav-route-panel h3 { margin:14px 0 10px; }
.mav-route-kicker, .mav-route-driving-copy > span { color:var(--green); font-size:11px; font-weight:900; letter-spacing:.12em; }
.mav-route-choices { display:grid; gap:9px; }
.mav-route-choices button { display:grid; grid-template-columns:36px 1fr; align-items:center; gap:10px; padding:12px; border:2px solid #dce7eb; border-radius:13px; text-align:left; color:var(--navy); background:white; cursor:pointer; font-weight:800; }
.mav-route-choices button:hover { border-color:var(--green); background:#edf8f3; transform:translateX(2px); }
.mav-route-choices b { display:grid; place-items:center; width:32px; height:32px; border-radius:9px; color:white; background:var(--navy); }
.mav-route-driving-copy { text-align:center; }
.mav-route-driving-copy h2 { margin-top:12px; }
.mav-route-loading { display:flex; justify-content:center; gap:7px; margin-top:20px; }
.mav-route-loading i { width:10px; height:10px; border-radius:50%; background:var(--green); animation:pulse .8s infinite alternate; }
.mav-route-loading i:nth-child(2) { animation-delay:.2s; }.mav-route-loading i:nth-child(3) { animation-delay:.4s; }
.mav-route-outcome { padding:19px; border-radius:18px; background:#fff0f1; }
.mav-route-outcome.safety-2 { background:#e8f7f0; }.mav-route-outcome.safety-1 { background:#fff5dc; }
.mav-route-outcome > i { display:grid; place-items:center; width:52px; height:52px; margin-bottom:10px; border-radius:50%; color:white; background:var(--red); font-size:30px; font-style:normal; font-weight:900; }
.mav-route-outcome.safety-2 > i { background:var(--green); }.mav-route-outcome.safety-1 > i { background:#e9a12e; }
.mav-route-outcome > span { font-size:10px; font-weight:900; letter-spacing:.1em; }
.mav-route-outcome h2 { margin-top:5px; }
.mav-route-outcome p { margin-bottom:0; line-height:1.55; }
.mav-route-panel > .mav-action { width:100%; margin-top:12px; }

.institutional-footer { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; padding: 28px max(24px, calc((100vw - 1240px) / 2)); color: white; background: linear-gradient(115deg, #0b2338, var(--navy)); border-top: 5px solid var(--institutional); }
.footer-identity { display: flex; align-items: center; gap: 14px; }
.footer-identity img:first-child { width: 150px; height: 55px; object-fit: contain; }
.footer-identity span { width: 1px; height: 45px; background: rgba(255,255,255,.25); }
.footer-identity .footer-guardia { width: 55px; height: 55px; object-fit: contain; }
.footer-copy, .footer-motto { display: grid; gap: 4px; }
.footer-copy strong { font-size: 16px; }
.footer-copy small, .footer-motto small { color: #b8c9d5; font-size: 11px; }
.footer-motto { text-align: right; }
.footer-motto strong { font-size: 13px; }
noscript { display: block; padding: 20px; text-align: center; background: #fff0f1; color: var(--red); }

@media (max-width: 900px) {
    .site-header { align-items: flex-start; flex-wrap: wrap; }
    .institutional-identity { width: 100%; }
    .site-header nav { margin-left: auto; }
    nav { overflow-x: auto; max-width: 60vw; }
    .hero-shell { grid-template-columns: 1fr; }
    .hero-copy { padding: 64px 24px 42px; }
    .road-hero { min-height: 360px; }
    .mode-grid, .game-grid { grid-template-columns: 1fr; }
    .game-card { min-height: 290px; }
    .game-art { min-height: 110px; }
    .question-grid { grid-template-columns: 1fr; }
    .question-image { max-height: 310px; }
    .topic-grid { grid-template-columns: repeat(2, 1fr); }
    .mav-priority-layout, .mav-decision-layout { grid-template-columns: 1fr; }
    .mav-map, .mav-decision-scene { max-width: 650px; margin: 0 auto; }
    .mav-route-setup { grid-template-columns:1fr; }
    .mav-route-setup-art { min-height:350px; }
    .mav-route-layout { grid-template-columns:1fr; }
    .mav-route-map { min-height:540px; }
    .institutional-footer { grid-template-columns: 1fr 1fr; }
    .footer-motto { grid-column: 1 / -1; text-align: left; }
}

@media (max-width: 620px) {
    body[data-mav-view="academy"] .site-header nav,
    body[data-mav-view="game"] .site-header nav { display:none; }
    body[data-mav-view="academy"] .site-header,
    body[data-mav-view="game"] .site-header { padding:6px 12px; border-bottom-width:1px; }
    body[data-mav-view="academy"] .ssp-logo,
    body[data-mav-view="game"] .ssp-logo { width:86px; height:38px; }
    body[data-mav-view="academy"] .identity-divider,
    body[data-mav-view="game"] .identity-divider { height:32px; }
    body[data-mav-view="academy"] .guardia-logo,
    body[data-mav-view="game"] .guardia-logo { width:38px; height:38px; }
    body[data-mav-view="academy"] .brand small,
    body[data-mav-view="game"] .brand small { display:none; }
    body[data-mav-view="academy"] .brand strong,
    body[data-mav-view="game"] .brand strong { font-size:13px; }
    body[data-mav-view="academy"] .institutional-footer,
    body[data-mav-view="game"] .institutional-footer { display:none; }
    .government-bar { display: block; padding: 7px 16px; text-align: center; }
    .government-bar div { justify-content: center; }
    .government-bar strong { display: none; }
    .site-header { position: static; display: block; padding: 10px 16px; }
    .ssp-logo { width: 108px; height: 52px; }
    .identity-divider { height: 42px; }
    .guardia-logo { width: 49px; height: 49px; }
    .brand strong { font-size: 15px; }
    .brand small { display: none; }
    nav { max-width: none; margin-top: 11px; padding-bottom: 2px; }
    .nav-button { white-space: nowrap; font-size: 13px; }
    .hero-copy h1 { font-size: 44px; }
    .section-heading { display: block; }
    .section-heading p { margin-top: 13px; }
    .workspace { min-height:calc(100svh - 52px); padding:12px 10px 30px; }
    .workspace-bar { position:sticky; z-index:40; top:0; grid-template-columns:auto 1fr auto; gap:8px; margin:0 -2px 10px; padding:7px 5px; border-bottom:1px solid var(--line); background:rgba(244,248,250,.94); backdrop-filter:blur(9px); }
    .workspace-bar > div:nth-child(2) { grid-column:2; grid-row:1; min-width:0; }
    .workspace-bar .eyebrow { display:none; }
    .workspace-bar h1 { overflow:hidden; margin:0; font-size:18px; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
    .back-button { grid-row:1; padding:9px 10px; font-size:0; }
    .back-button::after { content:'←'; font-size:20px; }
    .timer, .score-pill { grid-row:1; min-width:0; padding:8px 10px; font-size:12px; white-space:nowrap; }
    .setup-card, .question-shell, .result-card, .game-shell { padding:14px 11px; border-radius:18px; }
    .progress-row { margin-bottom:6px; font-size:12px; }
    .progress-track { height:6px; margin-bottom:11px; }
    .question-grid { gap:12px; }
    .question-image { height:min(29svh,235px); min-height:170px; aspect-ratio:auto; object-fit:contain; border-radius:14px; }
    .category-chip { margin-bottom:7px; padding:5px 9px; font-size:10px; }
    .question-copy h2 { margin:0 0 10px; font-size:19px; line-height:1.2; }
    .answers { gap:7px; }
    .answer-button { grid-template-columns:31px 1fr; gap:8px; min-height:47px; padding:8px 10px; border-radius:12px; font-size:13px; line-height:1.25; }
    .answer-letter { width:28px; height:28px; border-radius:8px; }
    .feedback { margin-top:9px; padding:10px 12px; font-size:13px; }
    .topic-grid { grid-template-columns: 1fr; }
    .scene-image, .scene-image img { min-height:0; }
    .scene-image { aspect-ratio:4/3; }
    .scene-image img { object-fit:contain; }
    .question-actions { position:sticky; z-index:25; bottom:6px; flex-direction:row; margin-top:10px; padding:7px; border:1px solid rgba(209,226,233,.9); border-radius:14px; background:rgba(255,255,255,.94); box-shadow:0 8px 24px rgba(16,45,71,.15); backdrop-filter:blur(8px); }
    .question-actions .button { width:auto; min-height:44px; flex:1; padding:10px 12px; }
    .institutional-footer { display: grid; grid-template-columns: 1fr; text-align: center; }
    .footer-identity { justify-content: center; }
    .footer-motto { grid-column: auto; text-align: center; }
    .mav-tutorial { padding:10px; }
    .mav-tutorial-inner { max-height:calc(100svh - 20px); overflow:auto; padding:20px 16px; border-radius:20px; }
    .mav-tutorial-icon { width: 68px; height: 68px; font-size: 34px; }
    .mav-level-head { font-size:11px; }
    .mav-level-progress { margin:7px 0 11px; }
    .mav-game-heading { margin-bottom:10px; }
    .mav-game-heading h2 { margin-bottom:3px; font-size:21px; }
    .mav-game-heading p { font-size:12px; line-height:1.3; }
    .mav-hazard-scene { max-height:62svh; border-radius:17px; }
    .mav-bottom-panel { margin-top:9px; padding:10px 12px; font-size:13px; }
    .mav-result-copy strong { font-size:16px; }
    .mav-result-copy p { margin:5px auto 9px; font-size:12px; }
    .mav-priority-layout, .mav-decision-layout { gap: 16px; }
    .mav-map { padding:7px; border-radius:18px; }
    .mav-map-inner { border-radius:12px; }
    .mav-map-note { margin-top:6px; font-size:10px; }
    .mav-order-panel, .mav-decision-panel { padding:12px 10px; border-radius:16px; }
    .mav-order-panel > p, .mav-decision-panel > p { margin-bottom:9px; font-size:12px; }
    .mav-order-list { gap:6px; margin:9px 0; }
    .mav-order-item { grid-template-columns:27px 30px minmax(0,1fr) auto; gap:6px; padding:7px 6px; }
    .mav-order-item small { display:none; }
    .mav-order-tools em { display: none; }
    .mav-decision-scene { border-radius:17px; }
    .mav-decision-panel h2 { font-size:21px; }
    .mav-choice-list { gap:7px; margin:9px 0; }
    .mav-choice-list button { grid-template-columns:32px 1fr; min-height:46px; padding:8px; font-size:13px; }
    .mav-choice-list b { width:29px; height:29px; }
    .mav-consequence { margin:9px 0; padding:12px; }
    .mav-consequence i { width:36px; height:36px; margin-bottom:6px; }
    .mav-consequence p { font-size:12px; }
    .mav-result-stats { grid-template-columns: 1fr; }
    .mav-route-setup { padding:12px; gap:14px; }
    .mav-route-setup-art { min-height:210px; }
    .mav-route-setup-copy h2 { font-size:30px; }
    .mav-route-setup-copy > p { font-size:14px; line-height:1.4; }
    .mav-route-features { margin:12px 0 16px; }
    .mav-route-lengths { grid-template-columns:1fr; }
    .mav-route-lengths button { display:grid; grid-template-columns:50px 1fr; align-items:center; text-align:left; }
    .mav-route-lengths b { grid-row:1 / 3; }.mav-route-lengths small { margin:0; }
    .mav-route-status { grid-template-columns:1fr auto; gap:7px; }
    .mav-route-status .mav-route-meter { grid-column:1 / -1; grid-row:2; }
    .mav-route-sound { grid-column:2; grid-row:1; }
    .mav-route-status > div:last-child { display:none; }
    .mav-route-layout { gap:0; }
    .mav-route-map { height:min(52svh,430px); min-height:360px; border-width:7px; border-radius:20px; }
    .mav-route-road { inset:-5% 18%; }
    .mav-route-side { width:18%; }
    .mav-route-side i, .mav-route-side b { height:85px; border-width:5px; }
    .mav-route-event span { width:62px; height:62px; font-size:31px; }
    .mav-route-car { width:76px; height:112px; }
    .mav-route-panel { position:relative; z-index:15; margin:-18px 5px 0; padding:16px 12px; border-radius:18px; }
    .mav-route-panel h2 { margin:5px 0 7px; font-size:23px; }
    .mav-route-panel > p, .mav-route-driving-copy p { font-size:13px; line-height:1.4; }
    .mav-route-panel h3 { margin:9px 0 7px; font-size:15px; }
    .mav-route-choices { gap:6px; }
    .mav-route-choices button { grid-template-columns:31px 1fr; min-height:46px; gap:7px; padding:8px; font-size:13px; }
    .mav-route-choices b { width:28px; height:28px; }
    .mav-route-outcome { padding:12px; }
    .mav-route-outcome > i { float:left; width:40px; height:40px; margin:0 10px 5px 0; font-size:23px; }
    .mav-route-outcome h2 { font-size:21px; }
    .mav-route-outcome p { clear:both; font-size:12px; }
}

@media (max-width: 420px) {
    .question-image { height:min(27svh,205px); min-height:150px; }
    .mav-hazard-scene { max-height:58svh; }
    .mav-route-map { height:min(49svh,390px); min-height:335px; }
    .mav-scene-chip, .mav-map-tag, .mav-countdown, .mav-map-status, .mav-decision-status { top:8px; padding:5px 7px; font-size:9px; }
    .mav-scene-chip, .mav-map-tag { left:8px; }
    .mav-countdown, .mav-map-status, .mav-decision-status { right:8px; }
}

@media (orientation: landscape) and (max-height: 540px) {
    body[data-mav-view="academy"] .site-header,
    body[data-mav-view="game"] .site-header { display:none; }
    .workspace { min-height:100svh; padding:6px 10px 12px; }
    .workspace-bar { padding:4px; margin-bottom:6px; }
    .question-grid { grid-template-columns:minmax(230px,.72fr) 1.28fr; gap:12px; }
    .question-image { position:sticky; top:54px; height:calc(100svh - 108px); min-height:0; }
    .question-copy h2 { font-size:17px; }
    .answer-button { min-height:40px; padding:6px 9px; }
    .mav-priority-layout, .mav-decision-layout, .mav-route-layout { grid-template-columns:minmax(0,1.08fr) minmax(290px,.92fr); gap:10px; }
    .mav-route-map { height:calc(100svh - 83px); min-height:0; }
    .mav-route-panel { max-height:calc(100svh - 83px); overflow:auto; margin:0; }
    .mav-map, .mav-decision-scene { position:sticky; top:54px; }
    .mav-hazard-wrap { width:auto; }
    .mav-hazard-scene { width:auto; max-width:100%; height:calc(100svh - 118px); margin:auto; aspect-ratio:4/3; }
}

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