/* ==========================================================================
   BOMBEIRO HERÓI — www.horadaseguranca.com
   ========================================================================== */

:root {
    --bg-0: #070d18;
    --bg-1: #0d1626;
    --bg-2: #142138;
    --line: #22334f;

    --fire:      #f97316;
    --fire-dark: #c2410c;
    --fire-glow: rgba(249, 115, 22, 0.35);

    --steel:  #38bdf8;
    --gold:   #fbbf24;
    --safe:   #22c55e;
    --danger: #ef4444;

    --text:      #eef4ff;
    --text-soft: #b8c6de;
    --text-mut:  #7e8fac;

    --shadow-md: 0 8px 24px rgba(0,0,0,0.4);
    --shadow-lg: 0 18px 44px rgba(0,0,0,0.55);

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

    --fh: 'Outfit', -apple-system, sans-serif;
    --fb: 'Plus Jakarta Sans', -apple-system, sans-serif;
    --t-bounce: 0.26s 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(--fb);
    color: var(--text);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    padding-bottom: env(safe-area-inset-bottom);
    background:
        radial-gradient(ellipse 70% 50% at 50% 0%, rgba(249,115,22,0.16) 0%, transparent 60%),
        linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 100%);
    background-attachment: fixed;
}

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

.screen { display: none; animation: fadeUp 0.35s ease both; }
.screen.active { display: block; }

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


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

.app-header {
    background: rgba(9, 15, 27, 0.9);
    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: 1120px; 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; color: inherit; }
.brand-box:hover .brand-title { color: var(--fire); }

.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(--fh); font-size: 1rem; font-weight: 900;
    letter-spacing: 0.04em; color: var(--gold); line-height: 1.1;
    transition: color 0.18s ease;
}
.brand-tagline {
    font-size: 0.67rem; 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(249,115,22,0.14);
    border: 1px solid rgba(249,115,22,0.45);
    color: #fdba74;
    font-weight: 700; font-size: 0.75rem;
    padding: 0.42rem 0.85rem; border-radius: 999px;
    white-space: nowrap; transition: all 0.18s ease;
}
.site-link-btn:hover { background: var(--fire); color: #1a0d02; transform: translateY(-1px); }


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

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


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

.btn {
    font-family: var(--fh); font-weight: 800; font-size: 0.92rem;
    padding: 0.75rem 1.3rem; 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; text-align: center;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(0.985); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-lg { font-size: 1rem; padding: 0.9rem 1.6rem; }
.btn-block { width: 100%; }

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

.btn-ghost {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
}
.btn-ghost:hover:not(:disabled) { background: rgba(255,255,255,0.18); }

.btn-ad {
    background: #fff; color: #1a1a1a;
    font-weight: 900; width: 100%;
    box-shadow: 0 6px 18px rgba(0,0,0,0.3);
}

.btn-icon {
    background: rgba(255,255,255,0.07);
    border: 1px solid var(--line);
    border-radius: 10px; width: 34px; height: 34px;
    font-size: 0.95rem; cursor: pointer; color: var(--text);
    transition: 0.18s ease;
}
.btn-icon:hover { background: rgba(249,115,22,0.18); border-color: var(--fire); }
.btn-icon.muted { opacity: 0.45; }


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

.hero-card {
    background: linear-gradient(165deg, rgba(20,33,56,0.96) 0%, rgba(11,18,32,0.97) 100%);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.3rem, 3.5vw, 2.3rem);
    text-align: center;
}

.hero-logo-link { display: inline-block; margin-bottom: 0.8rem; transition: var(--t-bounce); }
.hero-logo-link:hover { transform: scale(1.06) rotate(-2deg); }
.hero-logo-img { width: clamp(74px, 11vw, 100px); height: auto; border-radius: 18px; box-shadow: var(--shadow-md); }

.hero-eyebrow {
    display: inline-block;
    background: rgba(251,191,36,0.12);
    border: 1px solid rgba(251,191,36,0.4);
    color: var(--gold);
    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(--fh);
    font-size: clamp(1.8rem, 6vw, 3.1rem);
    font-weight: 900; line-height: 1.05; margin-bottom: 0.6rem;
    letter-spacing: -0.01em;
}
.hero-title mark {
    background: none; color: var(--fire);
    text-shadow: 0 0 34px var(--fire-glow);
}

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

.how-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.6rem; margin-bottom: 1.1rem; text-align: left;
}
.how-card {
    background: rgba(255,255,255,0.045);
    border: 1px solid var(--line);
    border-top: 3px solid var(--fire);
    border-radius: 13px; padding: 0.8rem;
    transition: var(--t-bounce);
}
.how-card:hover { transform: translateY(-4px); background: rgba(255,255,255,0.09); }
.how-card:nth-child(2) { border-top-color: var(--danger); }
.how-card:nth-child(3) { border-top-color: var(--steel); }
.how-card:nth-child(4) { border-top-color: var(--gold); }
.how-ico { font-size: 1.5rem; display: block; margin-bottom: 0.25rem; }
.how-card strong { display: block; font-family: var(--fh); font-size: 0.9rem; margin-bottom: 0.15rem; }
.how-card p { font-size: 0.74rem; color: var(--text-mut); line-height: 1.45; }

.controls-hint {
    display: flex; flex-wrap: wrap; gap: 0.45rem; justify-content: center;
    margin-bottom: 1.2rem;
}
.ch-item {
    display: flex; align-items: center; gap: 0.35rem;
    background: rgba(0,0,0,0.3); border: 1px solid var(--line);
    border-radius: 10px; padding: 0.4rem 0.7rem;
    font-size: 0.75rem; color: var(--text-soft);
}
.key {
    display: inline-grid; place-items: center;
    min-width: 26px; height: 25px; padding: 0 0.4rem;
    background: #1e293b; border: 1px solid #33455f; border-bottom-width: 3px;
    border-radius: 6px; font-family: var(--fh); font-weight: 800; font-size: 0.75rem;
}

.setup-box {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: clamp(1rem, 2.6vw, 1.4rem);
    text-align: left;
    display: flex; flex-direction: column; gap: 0.7rem;
    margin-bottom: 1.1rem;
}
.setup-box h3 { font-family: var(--fh); font-size: 1rem; }

.input-group { display: flex; flex-direction: column; gap: 0.28rem; }
.input-group label { font-size: 0.77rem; 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.66rem 0.8rem;
    font-family: var(--fb); font-size: 0.92rem; color: var(--text);
    transition: 0.18s ease;
}
.input-group input::placeholder { color: #5b6b85; }
.input-group input:focus {
    outline: none; border-color: var(--fire);
    box-shadow: 0 0 0 3px var(--fire-glow);
    background: rgba(255,255,255,0.09);
}
.input-group 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.55rem 0.8rem;
    font-size: 0.83rem; font-weight: 600; color: #fecaca;
    text-align: center; line-height: 1.45;
}

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

.marketing-banner {
    display: flex; flex-direction: column; gap: 0.15rem;
    background: rgba(251,191,36,0.09);
    border: 1px solid rgba(251,191,36,0.32);
    border-radius: 12px; padding: 0.8rem 1rem;
    text-align: center; transition: var(--t-bounce);
}
.marketing-banner:hover { background: rgba(251,191,36,0.16); transform: translateY(-2px); }
.marketing-banner span { font-size: 0.82rem; color: #fde68a; }
.marketing-banner strong { font-size: 0.88rem; color: var(--gold); }


/* ============================ BRIEFING ============================ */

.briefing-card {
    background: linear-gradient(165deg, rgba(20,33,56,0.96), rgba(11,18,32,0.97));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.4rem, 4vw, 2.4rem);
    text-align: center;
    max-width: 560px; margin: 0 auto;
}
.brief-badge {
    display: inline-block; background: rgba(249,115,22,0.16);
    border: 1px solid rgba(249,115,22,0.5); color: #fdba74;
    font-family: var(--fh); font-size: 0.68rem; font-weight: 900;
    letter-spacing: 0.14em; padding: 0.3rem 0.9rem; border-radius: 999px;
    margin-bottom: 0.9rem;
}
.brief-ico { font-size: clamp(3rem, 10vw, 4.4rem); line-height: 1; margin-bottom: 0.3rem; }
.brief-title { font-family: var(--fh); font-size: clamp(1.4rem, 4.5vw, 2rem); font-weight: 900; }
.brief-sub { font-size: 0.88rem; color: var(--gold); margin-bottom: 0.8rem; }
.brief-text { font-size: 0.88rem; color: var(--text-soft); line-height: 1.6; margin-bottom: 1.2rem; }

.brief-stats {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem; margin-bottom: 1.3rem;
}
.brief-stats > div {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    border-radius: 11px; padding: 0.6rem 0.3rem;
}
.brief-stats span { display: block; font-family: var(--fh); font-size: 1.15rem; font-weight: 900; color: var(--fire); }
.brief-stats small { font-size: 0.63rem; color: var(--text-mut); }


/* ============================ JOGO ============================ */

.game-hud {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.6rem; flex-wrap: wrap;
    background: rgba(13, 22, 38, 0.92);
    border: 1px solid var(--line);
    border-radius: 13px; padding: 0.5rem 0.8rem;
    margin-bottom: 0.6rem;
}
.hud-left { display: flex; flex-direction: column; min-width: 0; }
.hud-phase { font-family: var(--fh); font-weight: 900; font-size: 0.86rem; color: var(--fire); }
.hud-scene { font-size: 0.7rem; color: var(--text-mut); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.hud-center { display: flex; align-items: center; gap: 0.5rem; flex: 1 1 160px; min-width: 120px; }
.time-bar { flex: 1; height: 8px; background: rgba(255,255,255,0.09); border-radius: 999px; overflow: hidden; }
.time-fill {
    height: 100%; width: 0%; border-radius: 999px;
    background: linear-gradient(90deg, var(--gold), var(--fire));
    transition: width 0.15s linear;
}
.hud-time { font-size: 0.78rem; color: var(--text-soft); white-space: nowrap; }
.hud-time strong { font-family: var(--fh); font-size: 1rem; color: var(--text); }

.hud-right { display: flex; align-items: center; gap: 0.5rem; }
.hud-lives { font-size: 0.85rem; letter-spacing: -2px; white-space: nowrap; }
.hud-score { font-size: 0.75rem; color: var(--text-mut); white-space: nowrap; }
.hud-score strong { font-family: var(--fh); font-size: 1rem; color: var(--gold); }

.stage-wrap { position: relative; width: 100%; }

#game-canvas {
    display: block; width: 100%; height: auto;
    border-radius: 14px;
    border: 2px solid var(--line);
    box-shadow: var(--shadow-lg);
    touch-action: none;
    background: #0f1a2c;
}

.toast {
    position: absolute; top: 14px; left: 50%;
    transform: translateX(-50%);
    background: rgba(8, 14, 26, 0.92);
    border: 1px solid var(--gold); color: var(--gold);
    font-size: 0.8rem; font-weight: 800;
    padding: 0.38rem 0.9rem; border-radius: 999px;
    white-space: nowrap; pointer-events: none;
    animation: fadeUp 0.2s ease both;
}
.toast.ruim { border-color: var(--danger); color: #fca5a5; }

.countdown {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    background: rgba(6, 11, 20, 0.6);
    border-radius: 14px;
    font-family: var(--fh); font-size: clamp(3rem, 12vw, 6rem); font-weight: 900;
    color: var(--gold); text-shadow: 0 6px 30px rgba(251,191,36,0.5);
    pointer-events: none;
}
.countdown.pulse { animation: cdPop 0.6s ease both; }
@keyframes cdPop {
    0% { transform: scale(0.5); opacity: 0; }
    40% { transform: scale(1.12); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.touch-controls {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 0.5rem; margin-top: 0.6rem;
}
.tbtn {
    border-radius: 13px; border: 1.5px solid var(--line); border-bottom-width: 4px;
    background: rgba(255,255,255,0.06); color: var(--text);
    font-family: var(--fh); font-weight: 900; font-size: 0.92rem;
    padding: 0.9rem 0.4rem; cursor: pointer; user-select: none; touch-action: none;
    transition: transform 0.08s ease, background 0.12s ease;
}
.tbtn:active { transform: translateY(2px); border-bottom-width: 2px; }
.tbtn-jump { border-color: rgba(34,197,94,0.5); color: #86efac; background: rgba(34,197,94,0.12); }
.tbtn-duck { border-color: rgba(56,189,248,0.5); color: #7dd3fc; background: rgba(56,189,248,0.12); }


/* ============================ PUBLICIDADE ============================ */

.ad-card {
    max-width: 500px; margin: 0 auto;
    border-radius: var(--radius-lg);
    padding: clamp(1.3rem, 4vw, 2rem);
    box-shadow: var(--shadow-lg);
    text-align: center; color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
}

.ad-tag {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    border: 1px solid rgba(255,255,255,0.35);
    font-size: 0.62rem; font-weight: 800; letter-spacing: 0.14em; text-transform: uppercase;
    padding: 0.26rem 0.8rem; border-radius: 999px; margin-bottom: 1rem;
}

.ad-brand { display: flex; align-items: center; gap: 0.75rem; justify-content: center; margin-bottom: 0.9rem; }
.ad-logo {
    width: 72px; height: 72px; border-radius: 16px;
    background: #fff; padding: 6px;
    display: grid; place-items: center;
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
    flex-shrink: 0;
}
.ad-logo svg { display: block; width: 100%; height: 100%; }
.ad-brand-text { text-align: left; }
.ad-brand-text strong { display: block; font-family: var(--fh); font-size: 1.15rem; font-weight: 900; line-height: 1.2; }
.ad-brand-text span { font-size: 0.72rem; opacity: 0.9; }

.ad-tagline { font-family: var(--fh); font-size: 1rem; font-weight: 800; margin-bottom: 0.4rem; }
.ad-claim { font-size: 0.84rem; line-height: 1.55; opacity: 0.95; margin-bottom: 0.9rem; }

.ad-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; justify-content: center; margin-bottom: 1.1rem; }
.ad-chip {
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.28);
    font-size: 0.7rem; font-weight: 700;
    padding: 0.25rem 0.7rem; border-radius: 999px;
}

.ad-demo-note {
    font-size: 0.72rem; line-height: 1.55;
    background: rgba(0,0,0,0.3); border-radius: 10px;
    padding: 0.55rem 0.75rem; margin-top: 0.8rem;
}
.ad-demo-note a { color: #fff; font-weight: 800; text-decoration: underline; }

.ad-footer {
    margin: 0.9rem 0 1rem;
    font-size: 0.68rem; opacity: 0.85;
    border-top: 1px solid rgba(255,255,255,0.22);
    padding-top: 0.7rem;
}
.ad-footer a { color: #fff; text-decoration: underline; font-weight: 700; }


/* ============================ QUIZ ============================ */

.quiz-card {
    background: linear-gradient(165deg, rgba(20,33,56,0.96), rgba(11,18,32,0.97));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.1rem, 3vw, 1.9rem);
}

.quiz-badge {
    display: inline-block;
    background: rgba(56,189,248,0.14); border: 1px solid rgba(56,189,248,0.45);
    color: #7dd3fc; font-size: 0.64rem; font-weight: 800;
    letter-spacing: 0.13em; text-transform: uppercase;
    padding: 0.26rem 0.8rem; border-radius: 999px; margin-bottom: 0.6rem;
}
.quiz-title { font-family: var(--fh); font-size: clamp(1.15rem, 3.5vw, 1.6rem); font-weight: 900; margin-bottom: 0.25rem; }
.quiz-text { font-size: 0.85rem; color: var(--text-soft); line-height: 1.55; margin-bottom: 1rem; }

.quiz-pool {
    display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
    background: rgba(0,0,0,0.28);
    border: 1px dashed var(--line);
    border-radius: 14px; padding: 0.8rem; margin-bottom: 1rem;
    min-height: 76px;
}

.q-item {
    display: flex; align-items: center; gap: 0.45rem;
    background: rgba(255,255,255,0.07);
    border: 1.5px solid var(--line);
    border-radius: 11px; padding: 0.5rem 0.75rem;
    cursor: grab; user-select: none;
    transition: var(--t-bounce);
    font-size: 0.8rem; font-weight: 700;
}
.q-item:hover { transform: translateY(-3px); border-color: var(--steel); background: rgba(56,189,248,0.12); }
.q-item.dragging { opacity: 0.45; }
.q-item.selected {
    border-color: var(--gold); background: rgba(251,191,36,0.18);
    box-shadow: 0 0 0 3px rgba(251,191,36,0.25);
    transform: translateY(-3px) scale(1.03);
}
.q-item.ok { border-color: var(--safe); background: rgba(34,197,94,0.18); cursor: default; }
.q-item.ok:hover { transform: none; }
.q-item.shake { animation: shake 0.4s ease; }
.qi-ico { font-size: 1.15rem; }

.quiz-targets {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.6rem;
}

.q-target {
    background: rgba(255,255,255,0.04);
    border: 2px dashed var(--line);
    border-radius: 14px; padding: 0.7rem;
    min-height: 130px; cursor: pointer;
    transition: var(--t-bounce);
}
.q-target:hover, .q-target.over {
    border-color: var(--gold); background: rgba(251,191,36,0.1);
}
.q-target.flash-ok  { border-color: var(--safe); background: rgba(34,197,94,0.16); }
.q-target.flash-bad { border-color: var(--danger); background: rgba(239,68,68,0.16); animation: shake 0.4s ease; }

.qt-head { text-align: center; margin-bottom: 0.5rem; }
.qt-head strong { display: block; font-family: var(--fh); font-size: 0.92rem; font-weight: 900; }
.qt-head span { font-size: 0.68rem; color: var(--text-mut); }
.qt-drop { display: flex; flex-direction: column; gap: 0.35rem; }
.qt-drop .q-item { font-size: 0.74rem; padding: 0.4rem 0.55rem; }

.quiz-feedback {
    background: rgba(34,197,94,0.13);
    border: 1px solid rgba(34,197,94,0.45);
    border-radius: 12px; padding: 0.7rem 0.9rem;
    font-size: 0.85rem; color: #bbf7d0; text-align: center;
    margin: 1rem 0 0.8rem;
}
.quiz-help { font-size: 0.7rem; color: var(--text-mut); text-align: center; margin-top: 0.7rem; }


/* ============================ FIM ============================ */

.end-card {
    background: linear-gradient(165deg, rgba(20,33,56,0.96), rgba(11,18,32,0.97));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: clamp(1.4rem, 4vw, 2.4rem);
    text-align: center;
}
.end-ico { font-size: clamp(3rem, 10vw, 4.6rem); line-height: 1; margin-bottom: 0.2rem; }
.end-title { font-family: var(--fh); font-size: clamp(1.4rem, 4.5vw, 2.2rem); font-weight: 900; color: var(--gold); }
.end-sub { font-size: 0.9rem; color: var(--text-soft); line-height: 1.55; margin-bottom: 1.3rem; max-width: 560px; margin-left: auto; margin-right: auto; }

.end-score {
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.1rem; margin-bottom: 1rem;
}
.es-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; color: var(--text-mut); }
.es-value {
    font-family: var(--fh); font-size: clamp(2.6rem, 11vw, 4.2rem); font-weight: 900; line-height: 1;
    color: var(--fire); text-shadow: 0 0 40px var(--fire-glow);
}
.es-rank {
    display: inline-block; margin-top: 0.5rem;
    background: rgba(251,191,36,0.14); border: 1px solid rgba(251,191,36,0.45);
    color: var(--gold); font-weight: 800; font-size: 0.85rem;
    padding: 0.32rem 1rem; border-radius: 999px;
}

.end-metrics {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 0.45rem; margin-bottom: 1.3rem;
}
.end-metrics > div {
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    border-radius: 12px; padding: 0.7rem 0.3rem;
}
.end-metrics span { display: block; font-family: var(--fh); font-size: 1.25rem; font-weight: 900; }
.end-metrics small { font-size: 0.62rem; color: var(--text-mut); line-height: 1.3; }

.end-actions { margin-bottom: 1.3rem; }

.end-cta {
    display: flex; align-items: center; gap: 0.9rem;
    background: rgba(251,191,36,0.09);
    border: 1px solid rgba(251,191,36,0.32);
    border-radius: var(--radius); padding: 1rem;
    text-align: left; transition: var(--t-bounce);
}
.end-cta:hover { background: rgba(251,191,36,0.16); transform: translateY(-2px); }
.end-cta-logo { width: 56px; height: 56px; object-fit: contain; border-radius: 13px; flex-shrink: 0; }
.end-cta span { display: block; font-size: 0.78rem; color: #fde68a; line-height: 1.45; }
.end-cta strong { display: block; font-family: var(--fh); font-size: 0.92rem; color: var(--gold); margin-bottom: 0.15rem; }


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

@media (max-width: 640px) {
    .main-content { padding: 0.8rem 0.7rem 2rem; }
    .brand-tagline { display: none; }
    .brand-title { font-size: 0.85rem; }
    .site-link-btn { font-size: 0.64rem; padding: 0.34rem 0.6rem; }
    .header-logo { width: 32px; height: 32px; }

    .how-grid { grid-template-columns: 1fr 1fr; }
    .controls-hint { flex-direction: column; }
    .ch-item { justify-content: center; }

    .game-hud { gap: 0.4rem; padding: 0.45rem 0.6rem; }
    .hud-center { order: 3; flex-basis: 100%; }
    .hud-scene { max-width: 34vw; }

    .end-metrics { grid-template-columns: 1fr 1fr; }
    .end-cta { flex-direction: column; text-align: center; }
    .quiz-targets { grid-template-columns: 1fr; }
    .input-group input { font-size: 16px; }   /* evita zoom no iOS */
}

@media (max-width: 380px) {
    .how-grid { grid-template-columns: 1fr; }
    .brief-stats { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
