/* ==========================================================================
   DIREÇÃO DEFENSIVA — TREINAMENTO INTERATIVO
   www.horadaseguranca.com
   ========================================================================== */

:root {
    --night-0: #070c16;
    --night-1: #0f1826;
    --night-2: #16233a;
    --panel:   #141f33;
    --panel-2: #1b2842;

    --asphalt: #2b3446;
    --line:    #26344d;

    --sky-1: #1b3a63;
    --sky-2: #2f5f8e;
    --sky-3: #6ea6cf;

    --neon:      #38bdf8;
    --neon-dark: #0284c7;
    --neon-glow: rgba(56, 189, 248, 0.35);

    --signal:  #facc15;
    --signal-2:#f59e0b;
    --danger:  #ef4444;
    --danger-2:#b91c1c;
    --safe:    #22c55e;
    --safe-2:  #15803d;

    --text:      #eef4ff;
    --text-soft: #b6c4dc;
    --text-mut:  #7f90ac;

    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.38);
    --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.5);

    --radius: 16px;
    --radius-lg: 22px;

    --font-heading: 'Outfit', -apple-system, sans-serif;
    --font-body: 'Plus Jakarta Sans', -apple-system, sans-serif;

    --t-fast: 0.18s ease;
    --t-bounce: 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: clamp(14px, 0.5vw + 12.6px, 17px); }

body {
    font-family: var(--font-body);
    color: var(--text);
    background: var(--night-0);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}

a { color: var(--neon); text-decoration: none; }
.hidden { display: none !important; }


/* ==========================================================================
   CENÁRIO DE ESTRADA ANIMADO (fundo)
   ========================================================================== */

.road-scene { position: fixed; inset: 0; z-index: -2; overflow: hidden; pointer-events: none; }

.rs-sky {
    position: absolute; inset: 0 0 42% 0;
    background: linear-gradient(180deg, var(--night-1) 0%, var(--sky-1) 45%, #3d6d99 78%, #7fa8c9 100%);
}

.rs-sun {
    position: absolute;
    bottom: 40%; left: 50%;
    transform: translateX(-50%);
    width: clamp(140px, 22vw, 280px); height: clamp(140px, 22vw, 280px);
    border-radius: 50%;
    background: radial-gradient(circle, #ffd28a 0%, #f9a03f 45%, rgba(249,160,63,0) 70%);
    opacity: 0.55;
    animation: sunGlow 9s ease-in-out infinite;
}

@keyframes sunGlow {
    0%, 100% { opacity: 0.45; transform: translateX(-50%) scale(1); }
    50%      { opacity: 0.62; transform: translateX(-50%) scale(1.06); }
}

/* --- skyline --- */
.rs-skyline { position: absolute; bottom: 40%; left: 0; width: 100%; height: 22vh; }

.bld {
    position: absolute;
    bottom: 0;
    background: linear-gradient(180deg, #16233a 0%, #0d1626 100%);
    border-radius: 3px 3px 0 0;
    box-shadow: inset 0 0 0 1px rgba(120, 160, 210, 0.08);
}
.bld::after {
    content: '';
    position: absolute; inset: 12% 18% 20% 18%;
    background-image:
        linear-gradient(rgba(250, 204, 21, 0.5) 2px, transparent 2px),
        linear-gradient(90deg, rgba(250, 204, 21, 0.5) 2px, transparent 2px);
    background-size: 9px 14px;
    opacity: 0.5;
}
.b1 { left: 2%;  width: 6%;  height: 55%; }
.b2 { left: 10%; width: 4.5%; height: 78%; }
.b3 { left: 16%; width: 7%;  height: 45%; }
.b4 { left: 26%; width: 5%;  height: 65%; }
.b5 { right: 28%; width: 6%; height: 72%; }
.b6 { right: 19%; width: 4.5%; height: 50%; }
.b7 { right: 11%; width: 7%; height: 84%; }
.b8 { right: 3%;  width: 5%; height: 58%; }

.rs-hills {
    position: absolute; bottom: 39%; left: 0; width: 100%; height: 10vh;
    background:
        radial-gradient(ellipse 40% 100% at 15% 100%, #16304a 0%, transparent 70%),
        radial-gradient(ellipse 50% 100% at 60% 100%, #12293f 0%, transparent 70%),
        radial-gradient(ellipse 35% 100% at 92% 100%, #16304a 0%, transparent 70%);
}

/* --- pista --- */
.rs-road {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 42%;
    background: linear-gradient(180deg, #313b4f 0%, var(--asphalt) 25%, #1c2432 100%);
    overflow: hidden;
}

.rs-guardrail {
    position: absolute; top: 0; left: 0; width: 100%; height: 6px;
    background: repeating-linear-gradient(90deg, #6b7a92 0 26px, #94a3b8 26px 34px);
    opacity: 0.4;
}

.rs-lane-marks {
    position: absolute; top: 12%; left: 50%;
    width: 14px; height: 100%;
    transform: translateX(-50%);
    background: repeating-linear-gradient(180deg, rgba(255,255,255,0.55) 0 52px, transparent 52px 118px);
    animation: laneRun 1.1s linear infinite;
}

@keyframes laneRun {
    from { background-position-y: 0; }
    to   { background-position-y: 170px; }
}

.rs-poles { position: absolute; bottom: 30%; left: 0; width: 100%; height: 26vh; }

.pole {
    position: absolute; bottom: 0;
    width: 5px; height: 100%;
    background: linear-gradient(180deg, #4a5872 0%, #2b3446 100%);
    opacity: 0.5;
}
.pole::before {
    content: '';
    position: absolute; top: 0; left: -3px;
    width: 34px; height: 7px; border-radius: 4px;
    background: #4a5872;
}
.pole::after {
    content: '';
    position: absolute; top: 5px; left: 22px;
    width: 14px; height: 8px; border-radius: 50%;
    background: #fde68a;
    box-shadow: 0 0 18px 6px rgba(253, 230, 138, 0.35);
}
.p1 { left: 6%;  height: 60%; }
.p2 { left: 24%; height: 48%; opacity: 0.35; }
.p3 { right: 20%; height: 52%; opacity: 0.4; transform: scaleX(-1); }
.p4 { right: 5%; height: 64%; transform: scaleX(-1); }

.rs-overlay {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(7,12,22,0.72) 0%, rgba(7,12,22,0.85) 45%, rgba(7,12,22,0.93) 100%);
}

@media (prefers-reduced-motion: reduce) {
    .rs-lane-marks, .rs-sun, .anim-pop, .dv-dashes, .drop, .fogbank, .hazard-pop { animation: none !important; }
}


/* ==========================================================================
   CABEÇALHO
   ========================================================================== */

.app-header {
    background: rgba(11, 18, 32, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem 1rem;
    position: sticky; top: 0; z-index: 100;
}

.header-container {
    max-width: 1180px; margin: 0 auto;
    display: flex; justify-content: space-between; align-items: center; gap: 0.7rem;
}

.brand-box { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }

.header-logo { width: 38px; height: 38px; object-fit: contain; border-radius: 9px; flex-shrink: 0; }

.brand-text { display: flex; flex-direction: column; min-width: 0; }

.brand-title {
    font-family: var(--font-heading);
    font-size: 1rem; font-weight: 900; letter-spacing: 0.04em;
    color: var(--neon); line-height: 1.1;
}

.brand-tagline {
    font-size: 0.68rem; color: var(--text-mut); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.site-link-btn {
    display: inline-flex; align-items: center; gap: 0.35rem;
    background: rgba(56, 189, 248, 0.12);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: var(--neon);
    font-weight: 700; font-size: 0.76rem;
    padding: 0.42rem 0.85rem; border-radius: 999px;
    white-space: nowrap; transition: var(--t-fast);
}
.site-link-btn:hover { background: var(--neon); color: #04121d; transform: translateY(-1px); }


/* ==========================================================================
   LAYOUT
   ========================================================================== */

.main-content {
    flex: 1; width: 100%; max-width: 1100px; margin: 0 auto;
    padding: 1.1rem 1rem 2.5rem;
}

.screen-box { animation: fadeUp 0.4s ease both; }

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}


/* ==========================================================================
   BOTÕES
   ========================================================================== */

.btn {
    font-family: var(--font-heading);
    font-weight: 800; font-size: 0.9rem;
    padding: 0.72rem 1.2rem;
    border: none; border-radius: 12px; cursor: pointer;
    transition: var(--t-bounce);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
    line-height: 1.2;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.985); }

.btn-lg { font-size: 1rem; padding: 0.88rem 1.5rem; }
.btn-sm { font-size: 0.78rem; padding: 0.4rem 0.8rem; }
.btn-block { width: 100%; }

.btn-primary {
    background: linear-gradient(135deg, var(--neon) 0%, var(--neon-dark) 100%);
    color: #04121d;
    box-shadow: 0 6px 20px var(--neon-glow);
}
.btn-primary:hover { box-shadow: 0 10px 28px var(--neon-glow); }

.btn-secondary {
    background: transparent; color: var(--neon);
    border: 2px solid var(--neon);
}
.btn-secondary:hover { background: rgba(56,189,248,0.14); }

.btn-ghost {
    background: rgba(255,255,255,0.06);
    color: var(--text-soft);
    border: 1px solid var(--line);
}
.btn-ghost:hover { background: rgba(255,255,255,0.12); color: var(--text); }

.btn-icon {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    border-radius: 11px;
    width: 40px; height: 40px; font-size: 1.05rem;
    cursor: pointer; transition: var(--t-fast); flex-shrink: 0;
    color: var(--text);
}
.btn-icon:hover { background: rgba(56,189,248,0.16); border-color: var(--neon); }
.btn-icon.muted { opacity: 0.4; }


/* ==========================================================================
   TELA INICIAL
   ========================================================================== */

.hero-card {
    background: linear-gradient(160deg, rgba(22,35,58,0.94) 0%, rgba(13,22,38,0.96) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.3rem, 3.5vw, 2.4rem);
    text-align: center;
}

.hero-logo-wrapper { margin-bottom: 0.8rem; }
.hero-logo-img { width: clamp(72px, 11vw, 100px); height: auto; border-radius: 18px; box-shadow: var(--shadow-md); }

.hero-eyebrow {
    display: inline-block;
    background: rgba(250, 204, 21, 0.12);
    border: 1px solid rgba(250, 204, 21, 0.4);
    color: var(--signal);
    font-size: 0.7rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase;
    padding: 0.3rem 0.8rem; border-radius: 999px; margin-bottom: 0.7rem;
}

.hero-title {
    font-family: var(--font-heading);
    font-size: clamp(1.6rem, 5vw, 2.7rem);
    font-weight: 900; line-height: 1.1; margin-bottom: 0.6rem;
}
.hero-title mark {
    background: none; color: var(--neon);
    text-shadow: 0 0 26px var(--neon-glow);
}

.hero-subtitle {
    font-size: clamp(0.88rem, 2vw, 1rem);
    color: var(--text-soft); line-height: 1.6;
    max-width: 680px; margin: 0 auto 1.4rem;
}

.phases-summary-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
    gap: 0.6rem; margin-bottom: 1.5rem; text-align: left;
}

.phase-mini-card {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    border-top: 3px solid var(--neon);
    border-radius: 13px;
    padding: 0.8rem 0.85rem;
    transition: var(--t-bounce);
}
.phase-mini-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.08); box-shadow: var(--shadow-md); }

.mc-1 { border-top-color: #38bdf8; }
.mc-2 { border-top-color: #a78bfa; }
.mc-3 { border-top-color: #f472b6; }
.mc-4 { border-top-color: #22d3ee; }
.mc-5 { border-top-color: var(--signal); }
.mc-6 { border-top-color: var(--safe); }

.mini-icon { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }

.phase-mini-card strong {
    display: block; font-family: var(--font-heading);
    font-size: 0.88rem; color: var(--text); margin-bottom: 0.15rem;
}
.phase-mini-card p { font-size: 0.75rem; color: var(--text-mut); line-height: 1.4; }

/* --- formulário --- */
.game-setup-box {
    background: rgba(0,0,0,0.28);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1rem, 2.6vw, 1.5rem);
    text-align: left;
    display: flex; flex-direction: column; gap: 0.75rem;
    margin-bottom: 1.2rem;
}

.game-setup-box h3 { font-family: var(--font-heading); font-size: 1.05rem; }
.setup-intro { font-size: 0.82rem; color: var(--text-mut); margin-top: -0.45rem; }

.input-group { display: flex; flex-direction: column; gap: 0.3rem; }
.input-group label { font-size: 0.78rem; font-weight: 700; color: var(--text-soft); }

.input-group input {
    background: rgba(255,255,255,0.06);
    border: 1.5px solid var(--line);
    border-radius: 10px;
    padding: 0.68rem 0.8rem;
    font-family: var(--font-body); font-size: 0.92rem;
    color: var(--text);
    transition: var(--t-fast);
}
.input-group input::placeholder { color: #64748b; }
.input-group input:focus {
    outline: none; border-color: var(--neon);
    box-shadow: 0 0 0 3px var(--neon-glow);
    background: rgba(255,255,255,0.09);
}
.input-group input.input-invalid {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.22);
    animation: shake 0.35s ease;
}

@keyframes shake {
    0%,100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.setup-error {
    background: rgba(239,68,68,0.14);
    border: 1px solid rgba(239,68,68,0.5);
    border-radius: 10px; padding: 0.6rem 0.8rem;
    font-size: 0.84rem; font-weight: 600; color: #fecaca;
    text-align: center; line-height: 1.45;
}

.setup-privacy-note { font-size: 0.7rem; color: var(--text-mut); text-align: center; line-height: 1.45; }

.marketing-footer-banner {
    background: rgba(250, 204, 21, 0.08);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 12px; padding: 0.8rem 1rem;
    font-size: 0.83rem; color: #fde68a;
    display: flex; flex-wrap: wrap; gap: 0.4rem;
    align-items: center; justify-content: center; text-align: center;
}
.marketing-footer-banner a { font-weight: 800; color: var(--signal); text-decoration: underline; }


/* ==========================================================================
   BARRA DE STATUS E TRILHA
   ========================================================================== */

.game-status-bar {
    display: grid;
    grid-template-columns: minmax(0,auto) minmax(0,1fr) auto;
    align-items: center; gap: 0.7rem;
    background: rgba(20, 31, 51, 0.92);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.6rem 0.85rem;
    margin-bottom: 0.7rem;
}

.player-score-card { display: flex; align-items: center; gap: 0.55rem; min-width: 0; }

.avatar-icon {
    width: 42px; height: 42px; display: grid; place-items: center;
    background: rgba(56,189,248,0.14);
    border: 1px solid rgba(56,189,248,0.35);
    border-radius: 12px; font-size: 1.25rem; flex-shrink: 0;
}

.score-info { display: flex; flex-direction: column; min-width: 0; }

.player-name {
    font-weight: 800; font-size: 0.84rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.score-line { font-size: 0.76rem; color: var(--text-mut); }
.score-value { font-family: var(--font-heading); font-size: 1.12rem; font-weight: 900; color: var(--neon); display: inline-block; }

.center-round-info { text-align: center; min-width: 0; }
.phase-title-text { font-family: var(--font-heading); font-size: clamp(0.9rem, 2.1vw, 1.08rem); font-weight: 800; line-height: 1.2; }
.phase-sub-text { font-size: 0.73rem; color: var(--text-mut); line-height: 1.3; }

.status-right-box { display: flex; align-items: center; gap: 0.45rem; }

.lives-box {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.4);
    border-radius: 10px; padding: 0.35rem 0.6rem;
    font-size: 0.9rem; letter-spacing: -2px; white-space: nowrap;
}

/* --- trilha --- */
.phase-steps-bar {
    display: grid; grid-template-columns: repeat(6, 1fr);
    gap: 0.35rem; margin-bottom: 1rem;
}

.step-badge {
    display: flex; flex-direction: column; align-items: center; gap: 0.12rem;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--line);
    border-radius: 11px; padding: 0.45rem 0.2rem;
    font-size: 0.66rem; font-weight: 700; color: var(--text-mut);
    text-align: center; transition: var(--t-fast);
}
.step-emoji { font-size: 1.05rem; opacity: 0.5; transition: var(--t-fast); }
.step-label { line-height: 1.15; }

.step-badge.active {
    background: linear-gradient(135deg, var(--neon) 0%, var(--neon-dark) 100%);
    border-color: var(--neon); color: #04121d;
    box-shadow: 0 5px 16px var(--neon-glow); transform: translateY(-2px);
}
.step-badge.active .step-emoji { opacity: 1; transform: scale(1.12); }

.step-badge.completed {
    background: rgba(34,197,94,0.13);
    border-color: rgba(34,197,94,0.45); color: #86efac;
}
.step-badge.completed .step-emoji { opacity: 1; }
.step-badge.completed .step-label::after { content: ' ✓'; font-weight: 900; }


/* ==========================================================================
   CONTAINERS DE FASE
   ========================================================================== */

.phase-container {
    background: rgba(20, 31, 51, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: clamp(0.9rem, 2.6vw, 1.5rem);
}

.phase-header-box { margin-bottom: 0.8rem; }

.phase-header-flex {
    display: flex; justify-content: space-between; align-items: flex-start;
    gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem;
}

.container-label {
    display: block; font-family: var(--font-heading);
    font-size: 0.74rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--text-mut); margin-bottom: 0.4rem;
}

.phase-instruction-text { font-size: 0.85rem; color: var(--text-soft); line-height: 1.5; }

.wrapper-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.6rem; flex-wrap: wrap;
}

.remaining-pill {
    background: rgba(56,189,248,0.12);
    border: 1px solid rgba(56,189,248,0.35);
    color: var(--neon);
    font-size: 0.73rem; font-weight: 800;
    padding: 0.24rem 0.7rem; border-radius: 999px;
    white-space: nowrap; margin-bottom: 0.5rem;
}

.progress-track {
    height: 8px; background: rgba(255,255,255,0.07);
    border-radius: 999px; overflow: hidden; margin-bottom: 0.9rem;
}
.progress-fill {
    height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, #38bdf8 0%, #22d3ee 55%, #22c55e 100%);
    transition: width 0.5s cubic-bezier(0.34,1.2,0.64,1);
}

.timer-badge {
    background: rgba(250,204,21,0.12);
    border: 1px solid rgba(250,204,21,0.4);
    color: var(--signal);
    border-radius: 10px; padding: 0.4rem 0.8rem;
    font-size: 0.85rem; font-weight: 800; white-space: nowrap;
}
.timer-badge.urgent {
    background: rgba(239,68,68,0.16);
    border-color: rgba(239,68,68,0.5);
    color: #fca5a5;
    animation: pulseUrgent 0.9s ease-in-out infinite;
}
@keyframes pulseUrgent { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }

.story-banner {
    border-radius: var(--radius);
    padding: 0.9rem 1.05rem; margin-bottom: 1rem;
    border-left: 5px solid var(--signal);
    background: rgba(250,204,21,0.09);
}
.story-banner h3 { font-family: var(--font-heading); font-size: 1rem; font-weight: 800; margin-bottom: 0.3rem; color: var(--signal); }
.story-banner p { font-size: 0.85rem; line-height: 1.55; color: var(--text-soft); }


/* ==========================================================================
   FASE 1 — CHECKLIST
   ========================================================================== */

.checklist-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.6rem;
}

.checklist-card {
    position: relative;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--line);
    border-radius: 13px;
    padding: 0.85rem 0.7rem 0.7rem;
    text-align: center; cursor: pointer;
    transition: var(--t-bounce);
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.checklist-card:hover { transform: translateY(-4px); border-color: var(--neon); background: rgba(56,189,248,0.1); }

.cl-icon { font-size: 1.7rem; line-height: 1; }
.cl-cat {
    font-size: 0.6rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
    color: var(--text-mut);
    background: rgba(255,255,255,0.07);
    border-radius: 999px; padding: 0.1rem 0.5rem;
}
.cl-title { font-size: 0.78rem; font-weight: 700; color: var(--text-soft); line-height: 1.3; }
.cl-mark { position: absolute; top: 6px; right: 8px; font-size: 0.95rem; }

.checklist-card.done { cursor: default; pointer-events: none; }
.checklist-card.ok  { border-color: var(--safe); background: rgba(34,197,94,0.14); }
.checklist-card.bad { border-color: var(--danger); background: rgba(239,68,68,0.12); opacity: 0.75; }


/* ==========================================================================
   COCKPIT (FASES 2 e 4)
   ========================================================================== */

.cockpit {
    background: linear-gradient(180deg, #0b1322 0%, #101a2c 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1rem;
}

.cockpit-mirror {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    background: #0a1120;
    border-bottom: 1px solid var(--line);
    padding: 0.35rem 0.7rem;
}
.mirror-label {
    font-family: var(--font-heading); font-size: 0.6rem; font-weight: 800;
    letter-spacing: 0.14em; color: var(--text-mut);
}
.mirror-traffic { font-size: 0.74rem; color: var(--text-soft); }

/* --- viewport da via --- */
.drive-viewport {
    position: relative;
    height: clamp(180px, 30vh, 280px);
    overflow: hidden;
}

.dv-sky {
    position: absolute; inset: 0 0 45% 0;
    background: linear-gradient(180deg, #1a2f4d 0%, #3a6893 60%, #7ba5c8 100%);
}

.dv-city {
    position: absolute; bottom: 45%; left: 0; width: 100%; height: 34%;
    background:
        linear-gradient(90deg, transparent 0 4%, #16233a 4% 9%, transparent 9% 13%, #101b2e 13% 17%, transparent 17% 23%,
                        #16233a 23% 27%, transparent 27% 34%, #0e1828 34% 39%, transparent 39% 46%,
                        #16233a 46% 50%, transparent 50% 58%, #101b2e 58% 63%, transparent 63% 70%,
                        #16233a 70% 75%, transparent 75% 81%, #0e1828 81% 86%, transparent 86% 92%, #16233a 92% 97%, transparent 97%);
    background-size: 100% 100%;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 22%);
}

.dv-road {
    position: absolute; bottom: 0; left: 0; width: 100%; height: 45%;
    background: linear-gradient(180deg, #384358 0%, #232c3c 100%);
    overflow: hidden;
}
.dv-road::before,
.dv-road::after {
    content: '';
    position: absolute; bottom: 0; width: 3px; height: 100%;
    background: rgba(255,255,255,0.5);
}
.dv-road::before { left: 14%; transform: skewX(24deg); transform-origin: bottom; }
.dv-road::after  { right: 14%; transform: skewX(-24deg); transform-origin: bottom; }

.dv-dashes {
    position: absolute; left: 50%; bottom: 0;
    width: 10px; height: 100%; transform: translateX(-50%);
    background: repeating-linear-gradient(180deg, rgba(255,255,255,0.75) 0 26px, transparent 26px 64px);
    animation: dashRun 0.75s linear infinite;
}
@keyframes dashRun {
    from { background-position-y: 0; }
    to   { background-position-y: 90px; }
}

/* --- perigo que surge --- */
.hazard-pop {
    position: absolute; left: 50%; top: 46%;
    transform: translate(-50%, -50%);
    font-size: clamp(2.6rem, 9vw, 4.4rem);
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.55));
    line-height: 1;
}
.hazard-pop.pop-in { animation: hazardIn 0.6s cubic-bezier(0.34,1.56,0.64,1) both; }

@keyframes hazardIn {
    0%   { opacity: 0; transform: translate(-50%, -50%) scale(0.25); }
    60%  { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* --- painel --- */
.cockpit-dash {
    display: flex; align-items: center; gap: 1rem;
    background: linear-gradient(180deg, #0e1626 0%, #080e1a 100%);
    border-top: 2px solid #1e293b;
    padding: 0.8rem 1rem;
}

.gauge { position: relative; width: 108px; flex-shrink: 0; text-align: center; }
.gauge-svg { width: 100%; display: block; }
.gauge-readout { margin-top: -0.5rem; }
.gauge-readout span { font-family: var(--font-heading); font-size: 1.4rem; font-weight: 900; color: var(--neon); }
.gauge-readout small { font-size: 0.62rem; color: var(--text-mut); display: block; letter-spacing: 0.1em; }

.dash-info { min-width: 0; }
.hazard-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 800; margin-bottom: 0.2rem; }
.hazard-desc { font-size: 0.82rem; color: var(--text-soft); line-height: 1.5; }

/* --- clima --- */
.weather-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }

.drop {
    position: absolute; top: -12%;
    width: 2px; height: 22px;
    background: linear-gradient(180deg, rgba(191,219,254,0) 0%, rgba(191,219,254,0.85) 100%);
    animation: rainFall linear infinite;
}
@keyframes rainFall {
    from { transform: translateY(-30px) translateX(0); }
    to   { transform: translateY(320px) translateX(-26px); }
}

.fogbank {
    position: absolute; left: -30%;
    width: 160%; height: 46%;
    background: radial-gradient(ellipse at center, rgba(226,232,240,0.55) 0%, rgba(226,232,240,0) 68%);
    animation: fogDrift 16s linear infinite;
}
.f0 { top: 12%; animation-duration: 19s; }
.f1 { top: 34%; animation-duration: 24s; animation-delay: -6s; opacity: 0.85; }
.f2 { top: 52%; animation-duration: 15s; animation-delay: -11s; }
.f3 { top: 68%; animation-duration: 21s; animation-delay: -3s; opacity: 0.7; }

@keyframes fogDrift {
    from { transform: translateX(-12%); }
    to   { transform: translateX(12%); }
}

.glare {
    position: absolute; inset: 0;
    background:
        radial-gradient(circle at 50% 42%, rgba(255,247,214,0.92) 0%, rgba(255,225,150,0.55) 16%, rgba(255,214,120,0) 46%);
    animation: glarePulse 3.4s ease-in-out infinite;
}
@keyframes glarePulse { 0%,100% { opacity: 0.85; } 50% { opacity: 1; } }

.drive-viewport.w-fog .dv-city,
.drive-viewport.w-fog .dv-road { filter: blur(1.6px) brightness(1.15); }
.drive-viewport.w-rain .dv-road { filter: brightness(0.85) saturate(0.8); }
.drive-viewport.w-sun .dv-city { filter: brightness(1.25) contrast(0.85); }


/* ==========================================================================
   ALTERNATIVAS (embaralhadas)
   ========================================================================== */

.actions-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 0.55rem;
}

.action-btn {
    display: flex; align-items: center; gap: 0.65rem;
    text-align: left;
    background: rgba(255,255,255,0.05);
    border: 1.5px solid var(--line);
    border-radius: 13px;
    padding: 0.75rem 0.85rem;
    color: var(--text);
    font-family: var(--font-body); font-size: 0.86rem; font-weight: 600;
    line-height: 1.4; cursor: pointer;
    transition: var(--t-bounce);
}
.action-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    border-color: var(--neon);
    background: rgba(56,189,248,0.12);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
.action-btn:disabled { opacity: 0.5; cursor: default; }

.ab-letter {
    flex-shrink: 0;
    width: 28px; height: 28px;
    display: grid; place-items: center;
    background: rgba(255,255,255,0.09);
    border-radius: 8px;
    font-family: var(--font-heading); font-weight: 900; font-size: 0.82rem;
    color: var(--text-soft);
}

.action-btn.picked-ok  { opacity: 1; border-color: var(--safe); background: rgba(34,197,94,0.18); }
.action-btn.picked-ok .ab-letter  { background: var(--safe); color: #04210f; }
.action-btn.picked-bad { opacity: 1; border-color: var(--danger); background: rgba(239,68,68,0.16); }
.action-btn.picked-bad .ab-letter { background: var(--danger); color: #fff; }


/* ==========================================================================
   FASE 3 — CAÇA AOS RISCOS
   ========================================================================== */

.risk-scene {
    position: relative;
    width: 100%;
    aspect-ratio: 1000 / 520;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--line);
    background: #0f1826;
}

.scene-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene-hotspots { position: absolute; inset: 0; }

.hotspot {
    position: absolute;
    transform: translate(-50%, -50%);
    width: clamp(38px, 5.4vw, 56px);
    height: clamp(38px, 5.4vw, 56px);
    display: grid; place-items: center;
    background: rgba(15, 24, 38, 0.35);
    border: 2px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    cursor: pointer;
    transition: var(--t-bounce);
    padding: 0;
}
.hotspot .hs-icon { font-size: clamp(1.05rem, 2.6vw, 1.5rem); line-height: 1; pointer-events: none; }

.hotspot:hover { transform: translate(-50%, -50%) scale(1.18); border-color: rgba(255,255,255,0.55); background: rgba(15,24,38,0.6); }

.hotspot.found {
    border-color: var(--safe);
    background: rgba(34,197,94,0.35);
    box-shadow: 0 0 0 4px rgba(34,197,94,0.22);
    cursor: default;
}
.hotspot.wrong {
    border-color: var(--danger);
    background: rgba(239,68,68,0.3);
    opacity: 0.55; cursor: default;
}
.hotspot.done { pointer-events: none; }

.hotspot.hinted {
    animation: hintPulse 0.85s ease-in-out 3;
    border-color: var(--signal);
}
@keyframes hintPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(250,204,21,0.7); }
    50%     { box-shadow: 0 0 0 14px rgba(250,204,21,0); }
}

.found-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.8rem; }
.found-chip {
    background: rgba(34,197,94,0.14);
    border: 1px solid rgba(34,197,94,0.4);
    color: #86efac;
    font-size: 0.72rem; font-weight: 700;
    padding: 0.25rem 0.65rem; border-radius: 999px;
    animation: fadeUp 0.3s ease both;
}


/* ==========================================================================
   FASE 5 — SIMULADOR
   ========================================================================== */

.sim-briefing { text-align: center; max-width: 620px; margin: 0 auto; }
.sim-brief-icon { font-size: 3rem; margin-bottom: 0.4rem; }
.sim-briefing h3 { font-family: var(--font-heading); font-size: 1.35rem; font-weight: 900; margin-bottom: 0.4rem; }
.sim-brief-lead { font-size: 0.9rem; color: var(--text-soft); line-height: 1.6; margin-bottom: 1.1rem; }

.sim-controls-help {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.5rem; margin-bottom: 1.1rem; text-align: left;
}
.sch-item {
    display: flex; align-items: center; gap: 0.4rem;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    border-radius: 10px; padding: 0.5rem 0.7rem;
    font-size: 0.78rem; color: var(--text-soft);
}
.key {
    display: inline-grid; place-items: center;
    min-width: 26px; height: 26px; padding: 0 0.35rem;
    background: #1e293b; border: 1px solid #334155;
    border-bottom-width: 3px;
    border-radius: 6px;
    font-family: var(--font-heading); font-weight: 800; font-size: 0.8rem;
    color: var(--text);
}

.sim-rules {
    list-style: none; text-align: left;
    display: flex; flex-direction: column; gap: 0.35rem;
    background: rgba(0,0,0,0.25);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 0.8rem 1rem;
    margin-bottom: 1.1rem;
    font-size: 0.82rem; color: var(--text-soft);
}

/* --- palco --- */
.sim-stage { display: flex; flex-direction: column; gap: 0.7rem; align-items: center; }

.sim-hud {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem; width: 100%; max-width: 600px;
}
.hud-item {
    background: rgba(0,0,0,0.35);
    border: 1px solid var(--line);
    border-radius: 11px;
    padding: 0.45rem 0.5rem;
    text-align: center;
}
.hud-label {
    display: block; font-size: 0.6rem; font-weight: 800;
    letter-spacing: 0.09em; text-transform: uppercase; color: var(--text-mut);
}
.hud-item strong { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 900; color: var(--text); }
.hud-item small { font-size: 0.6rem; color: var(--text-mut); margin-left: 2px; }
.hud-item.fast strong { color: var(--danger); }

.sim-canvas-wrap { position: relative; width: 100%; max-width: 600px; }

#sim-canvas {
    display: block; width: 100%; height: auto;
    border-radius: 14px;
    border: 2px solid #1e293b;
    box-shadow: var(--shadow-lg);
    touch-action: none;
    background: #42704a;
}

.sim-alert {
    position: absolute; left: 50%; top: 12px;
    transform: translateX(-50%);
    background: rgba(8, 14, 26, 0.92);
    border: 1px solid var(--signal);
    color: var(--signal);
    font-size: 0.8rem; font-weight: 700;
    padding: 0.42rem 0.9rem; border-radius: 999px;
    white-space: nowrap; max-width: 92%;
    overflow: hidden; text-overflow: ellipsis;
    animation: fadeUp 0.25s ease both;
    pointer-events: none;
}

.sim-touch-controls {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem; width: 100%; max-width: 600px;
}
.sim-btn {
    background: rgba(255,255,255,0.07);
    border: 1.5px solid var(--line);
    border-bottom-width: 4px;
    border-radius: 12px;
    color: var(--text);
    font-family: var(--font-heading); font-weight: 900; font-size: 1rem;
    padding: 0.85rem 0.4rem;
    cursor: pointer; user-select: none;
    touch-action: none;
    transition: transform 0.08s ease, background 0.12s ease;
}
.sim-btn:active { transform: translateY(2px); border-bottom-width: 2px; background: rgba(255,255,255,0.14); }
.sim-btn-brake { border-color: rgba(239,68,68,0.5); color: #fca5a5; background: rgba(239,68,68,0.12); }
.sim-btn-gas   { border-color: rgba(34,197,94,0.5); color: #86efac; background: rgba(34,197,94,0.12); }

.sim-summary {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.4rem; margin-bottom: 0.9rem;
}
.sim-summary > div {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    border-radius: 10px; padding: 0.5rem 0.3rem; text-align: center;
}
.sim-summary strong { display: block; font-family: var(--font-heading); font-size: 1.2rem; font-weight: 900; color: var(--neon); }
.sim-summary span { font-size: 0.62rem; color: var(--text-mut); line-height: 1.25; display: block; }


/* ==========================================================================
   FASE 6 — EVENTO
   ========================================================================== */

.event-card-area { margin-bottom: 1rem; }

.event-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
    border: 1.5px solid var(--line);
    border-radius: var(--radius-lg);
    padding: clamp(1.1rem, 3.2vw, 1.9rem);
    text-align: center;
}
.ev-icon { font-size: clamp(2.6rem, 8vw, 3.9rem); line-height: 1; margin-bottom: 0.4rem; }
.ev-title { font-family: var(--font-heading); font-size: clamp(1rem, 2.7vw, 1.35rem); font-weight: 800; margin-bottom: 0.35rem; }
.ev-desc { font-size: 0.85rem; color: var(--text-soft); line-height: 1.55; max-width: 540px; margin: 0 auto; }


/* ==========================================================================
   RELATÓRIO FINAL
   ========================================================================== */

.victory-card {
    background: linear-gradient(160deg, rgba(22,35,58,0.95) 0%, rgba(12,20,34,0.97) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.4rem, 3.5vw, 2.4rem);
    text-align: center;
}

.victory-icon-large { font-size: clamp(2.8rem, 8vw, 4rem); line-height: 1; margin-bottom: 0.3rem; }
.victory-title { font-family: var(--font-heading); font-size: clamp(1.3rem, 4vw, 2rem); font-weight: 900; line-height: 1.15; margin-bottom: 0.3rem; }
.victory-subtitle { font-size: 0.88rem; color: var(--text-mut); margin-bottom: 1.4rem; }

.index-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.2rem; margin-bottom: 1rem;
}
.index-label {
    display: block; font-size: 0.7rem; font-weight: 800;
    letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-mut); margin-bottom: 0.3rem;
}
.index-number {
    font-family: var(--font-heading);
    font-size: clamp(3rem, 12vw, 5rem); font-weight: 900; line-height: 1;
    color: var(--neon);
    text-shadow: 0 0 40px var(--neon-glow);
}
.index-rating-badge {
    display: inline-block; margin-top: 0.5rem;
    font-size: 0.82rem; font-weight: 800;
    padding: 0.35rem 1rem; border-radius: 999px;
}
.rating-excellent { background: rgba(34,197,94,0.16);  border: 1px solid rgba(34,197,94,0.5);  color: #86efac; }
.rating-good      { background: rgba(56,189,248,0.16); border: 1px solid rgba(56,189,248,0.5); color: #7dd3fc; }
.rating-regular   { background: rgba(250,204,21,0.16); border: 1px solid rgba(250,204,21,0.5); color: #fde68a; }
.rating-poor      { background: rgba(239,68,68,0.16);  border: 1px solid rgba(239,68,68,0.5);  color: #fca5a5; }

.metrics-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.5rem; margin-bottom: 1.1rem;
}
.metric-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 0.8rem 0.5rem;
}
.metric-ico { display: block; font-size: 1.2rem; margin-bottom: 0.2rem; }
.metric-value { display: block; font-family: var(--font-heading); font-size: 1.35rem; font-weight: 900; color: var(--text); }
.metric-label { display: block; font-size: 0.66rem; color: var(--text-mut); line-height: 1.3; }

.report-tips {
    background: rgba(250,204,21,0.07);
    border: 1px solid rgba(250,204,21,0.25);
    border-radius: var(--radius);
    padding: 0.9rem 1.1rem; text-align: left; margin-bottom: 1.3rem;
}
.report-tips h4 { font-family: var(--font-heading); font-size: 0.9rem; color: var(--signal); margin-bottom: 0.45rem; }
.report-tips ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.report-tips li {
    font-size: 0.82rem; color: var(--text-soft); line-height: 1.5;
    padding-left: 1.1rem; position: relative;
}
.report-tips li::before { content: '▸'; position: absolute; left: 0; color: var(--signal); font-weight: 900; }

.victory-actions-row { margin-bottom: 1.3rem; }

.marketing-cta-box {
    display: flex; align-items: center; gap: 1rem;
    background: rgba(56,189,248,0.07);
    border: 1px solid rgba(56,189,248,0.25);
    border-radius: var(--radius);
    padding: 1rem; text-align: left;
}
.cta-logo { width: 60px; height: 60px; object-fit: contain; border-radius: 14px; flex-shrink: 0; }
.cta-text h4 { font-family: var(--font-heading); font-size: 0.94rem; margin-bottom: 0.2rem; }
.cta-text p { font-size: 0.79rem; color: var(--text-mut); margin-bottom: 0.6rem; line-height: 1.45; }


/* ==========================================================================
   MODAL
   ========================================================================== */

.modal-backdrop {
    position: fixed; inset: 0; z-index: 900;
    display: flex; align-items: center; justify-content: center;
    padding: calc(1rem + env(safe-area-inset-top)) 1rem calc(1rem + env(safe-area-inset-bottom));
    background: rgba(3, 7, 14, 0.72);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    overflow-y: auto;
    animation: fadeIn 0.2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    background: linear-gradient(160deg, #18253c 0%, #101a2c 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: min(520px, 100%);
    overflow: hidden;
}

.anim-pop { animation: pop 0.3s cubic-bezier(0.34,1.56,0.64,1) both; }
@keyframes pop {
    from { opacity: 0; transform: translateY(16px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header { padding: 1.1rem 1.2rem 0.5rem; text-align: center; }

.feedback-badge {
    display: inline-block;
    font-family: var(--font-heading); font-size: 0.66rem; font-weight: 800;
    letter-spacing: 0.11em; padding: 0.26rem 0.75rem; border-radius: 999px; margin-bottom: 0.5rem;
}
.badge-success { background: rgba(34,197,94,0.16); color: #86efac; border: 1px solid rgba(34,197,94,0.5); }
.badge-danger  { background: rgba(239,68,68,0.16); color: #fca5a5; border: 1px solid rgba(239,68,68,0.5); }

.modal-title { font-family: var(--font-heading); font-size: 1.12rem; font-weight: 800; line-height: 1.25; }
.text-success { color: #86efac; }
.text-danger  { color: #fca5a5; }

.modal-body { padding: 0.5rem 1.2rem 1rem; }
.lead-text { font-size: 0.88rem; line-height: 1.6; color: var(--text-soft); text-align: center; }
.modal-footer { padding: 0 1.2rem 1.2rem; }


/* ==========================================================================
   RESPONSIVO
   ========================================================================== */

@media (max-width: 860px) {
    .actions-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
    .main-content { padding: 0.8rem 0.7rem 2rem; }

    .brand-tagline { display: none; }
    .brand-title { font-size: 0.86rem; }
    .site-link-btn { font-size: 0.66rem; padding: 0.34rem 0.6rem; }
    .header-logo { width: 32px; height: 32px; }

    .game-status-bar {
        grid-template-columns: 1fr auto;
        grid-template-areas: "info right" "phase phase";
        gap: 0.5rem;
    }
    .player-score-card { grid-area: info; }
    .status-right-box  { grid-area: right; }
    .center-round-info { grid-area: phase; text-align: left; }
    .player-name { max-width: 38vw; }

    .phase-steps-bar { grid-template-columns: repeat(6, 1fr); gap: 0.2rem; }
    .step-badge { font-size: 0.54rem; padding: 0.35rem 0.1rem; border-radius: 9px; }
    .step-emoji { font-size: 0.9rem; }

    .phases-summary-grid { grid-template-columns: 1fr 1fr; }
    .checklist-grid { grid-template-columns: 1fr 1fr; }
    .cl-title { font-size: 0.72rem; }

    .cockpit-dash { flex-direction: column; gap: 0.5rem; text-align: center; padding: 0.7rem; }
    .dash-info { text-align: center; }
    .gauge { width: 92px; }

    .sim-hud { grid-template-columns: repeat(2, 1fr); }
    .sim-summary { grid-template-columns: repeat(2, 1fr); }
    .sim-controls-help { grid-template-columns: 1fr; }

    .metrics-grid { grid-template-columns: 1fr 1fr; }
    .marketing-cta-box { flex-direction: column; text-align: center; }

    .input-group input { font-size: 16px; } /* evita zoom no iOS */

    .hotspot { width: 36px; height: 36px; }
}

@media (max-width: 380px) {
    .phases-summary-grid { grid-template-columns: 1fr; }
    .checklist-grid { grid-template-columns: 1fr; }
    .metrics-grid { grid-template-columns: 1fr; }
}

@media (max-height: 520px) and (orientation: landscape) {
    .modal-backdrop { align-items: flex-start; }
    .drive-viewport { height: 150px; }
}
