/**
 * Questionário — experiência “game” (splash + perguntas em ecrã cheio)
 *
 * Edite apenas este ficheiro para ajustar cores, animações e o aspeto visual.
 * Variáveis CSS (--qg-*) concentram o que costuma mudar.
 */

@import './game-start-button.css';
@import './battery-ranking.css';

:root {
    /* Fundo radial */
    --qg-bg-center: #1e40af;
    --qg-bg-mid: #0f172a;
    --qg-bg-edge: #020617;

    /* Destaques metálicos */
    --qg-gold: #d4a84b;
    --qg-gold-dark: #8b6914;
    --qg-gold-light: #f0d78c;
    --qg-silver: #e2e8f0;
    --qg-gem: #38bdf8;

    /* Texto */
    --qg-text: #f8fafc;
    --qg-text-muted: #94a3b8;
    --qg-crest-inner: #1d4ed8;
    --qg-crest-text: #0c1a3a;

    /* Triângulos wireframe */
    --qg-wire: rgba(56, 189, 248, 0.42);
    --qg-wire-soft: rgba(56, 189, 248, 0.22);
    --qg-wire-glow: rgba(167, 139, 250, 0.35);

    /* Cartas de pergunta */
    --qg-card-bg: rgba(15, 23, 42, 0.72);
    --qg-card-border: rgba(212, 168, 75, 0.45);
    --qg-radio-ring: rgba(56, 189, 248, 0.6);

    /* HUD / cronómetro */
    --qg-hud-bg: rgba(2, 6, 23, 0.75);
    --qg-hud-border: rgba(212, 168, 75, 0.35);

    /* Animações */
    --qg-pulse-speed: 2.2s;
    --qg-fade-in: 0.9s;

    /* Display (estilo romano / Trajan) — Cinzel, SIL OFL via Google Fonts */
    --qg-font-display: 'Cinzel', Georgia, 'Times New Roman', Times, serif;
    --qg-font-body: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Ubuntu, Cantarell, 'Noto Sans', sans-serif;
}

/* -------------------------------------------------------------------------- */
/* Base fullscreen */
/* -------------------------------------------------------------------------- */

.qg-root {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: var(--qg-font-body);
    color: var(--qg-text);
    background: radial-gradient(ellipse 90% 70% at 50% 38%, var(--qg-bg-center) 0%, var(--qg-bg-mid) 42%, var(--qg-bg-edge) 100%);
}

/* -------------------------------------------------------------------------- */
/* Splash */
/* -------------------------------------------------------------------------- */

.qg-splash {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.25rem 3rem;
    box-sizing: border-box;
    animation: qg-fade-in var(--qg-fade-in) ease-out both;
}

.qg-splash__glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse 55% 45% at 50% 32%, rgba(56, 189, 248, 0.18) 0%, transparent 65%);
}

/* Wireframe triangles — cantos (SVG: grandes, espaçados, falhados) */
.qg-splash__wires {
    position: absolute;
    width: min(135vw, 760px);
    height: min(135vw, 760px);
    pointer-events: none;
    z-index: 1;
}

.qg-splash__wires--tl {
    top: -10%;
    left: -12%;
}

.qg-splash__wires--tr {
    top: -10%;
    right: -12%;
    left: auto;
    bottom: auto;
    transform: scaleX(-1);
}

.qg-splash__wires--br {
    right: -12%;
    bottom: -10%;
    transform: rotate(180deg);
}

.qg-splash__wire-svg {
    display: block;
    width: 100%;
    height: 100%;
    overflow: visible;
    color: var(--qg-wire);
    filter: drop-shadow(0 0 15px var(--qg-wire-glow));
}

.qg-splash__wire-triangles polygon {
    fill: none;
    stroke: currentColor;
    stroke-width: 4.75;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.qg-splash__wire-tri--near {
    opacity: 0.95;
}

.qg-splash__wire-tri--near polygon {
    stroke-width: 2;
}

.qg-splash__wire-tri--mid {
    opacity: 0.9;
}

.qg-splash__wire-tri--far {
    opacity: 0.9;
}

@media (min-width: 768px) {
    .qg-splash__wires {
        width: min(92vw, 920px);
        height: min(92vw, 920px);
    }

    .qg-splash__wire-triangles polygon {
        stroke-width: 3;
    }
}

.qg-splash__main {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.75rem, 4vw, 2.75rem);
    max-width: 28rem;
    width: 100%;
    min-width: 0;
}

.qg-splash__btn-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0 0.75rem;
    box-sizing: border-box;
}

.qg-splash__btn-wrap .qg-btn-iniciar {
    width: min(100%, 22rem);
    max-width: 100%;
}

/* Logo da empresa (substitui o escudo dourado quando existe ficheiro em Configurações) */
.qg-splash__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(88vw, 20rem);
    max-height: min(50vh, 17.5rem);
    padding: 0.5rem;
    box-sizing: border-box;
}

.qg-splash__brand-img {
    max-width: 100%;
    max-height: min(50vh, 17.5rem);
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 8px 28px rgba(0, 0, 0, 0.55)) drop-shadow(0 0 24px rgba(56, 189, 248, 0.2));
}

/* Crista / escudo */
.qg-crest {
    position: relative;
    width: min(88vw, 320px);
    aspect-ratio: 1 / 1.12;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1rem 1.75rem;
    box-sizing: border-box;
    background: linear-gradient(145deg, var(--qg-gold-light), var(--qg-gold) 35%, var(--qg-gold-dark));
    border-radius: 12px;
    box-shadow:
        0 0 0 3px rgba(15, 23, 42, 0.9),
        0 0 40px rgba(56, 189, 248, 0.25),
        0 24px 48px rgba(0, 0, 0, 0.55);
    clip-path: polygon(8% 0, 92% 0, 100% 12%, 100% 88%, 92% 100%, 8% 100%, 0 88%, 0 12%);
}

.qg-crest__gem {
    position: absolute;
    top: -0.35rem;
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(160deg, #7dd3fc, var(--qg-gem), #0369a1);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.75);
}

.qg-crest__wing {
    position: absolute;
    top: 18%;
    width: 2.5rem;
    height: 42%;
    background: linear-gradient(180deg, #f8fafc, #94a3b8);
    opacity: 0.92;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
}

.qg-crest__wing--l {
    left: -1.35rem;
    border-radius: 60% 20% 20% 60% / 50% 30% 30% 50%;
    transform: rotate(-8deg);
}

.qg-crest__wing--r {
    right: -1.35rem;
    border-radius: 20% 60% 60% 20% / 30% 50% 50% 30%;
    transform: rotate(8deg);
}

.qg-crest__inner {
    width: 86%;
    height: 78%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.75rem;
    text-align: center;
    background: linear-gradient(180deg, var(--qg-crest-inner), #0f172a 120%);
    border-radius: 8px;
    box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.45);
}

.qg-crest__logo {
    max-height: 3.25rem;
    max-width: 70%;
    object-fit: contain;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

.qg-crest__line1 {
    font-family: var(--qg-font-display);
    font-weight: 800;
    font-size: clamp(1.1rem, 4.2vw, 1.45rem);
    line-height: 1.2;
    color: #e0f2fe;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
}

.qg-crest__line2 {
    font-family: var(--qg-font-display);
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--qg-silver);
    opacity: 0.9;
}

/* Tagline */
.qg-tagline {
    margin: 0;
    font-family: var(--qg-font-display);
    text-align: center;
    font-size: clamp(0.95rem, 3.5vw, 1.1rem);
    line-height: 1.55;
    color: var(--qg-text);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
    max-width: 22rem;
}

.qg-tagline strong {
    font-weight: 800;
    color: #fff;
}

/* -------------------------------------------------------------------------- */
/* Perguntas + HUD */
/* -------------------------------------------------------------------------- */

.qg-play {
    position: relative;
    min-height: 100vh;
    padding: 6.75rem 1rem 2.5rem;
    box-sizing: border-box;
    animation: qg-fade-in 0.6s ease-out both;
}

.qg-play__bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: radial-gradient(ellipse 90% 65% at 50% 20%, var(--qg-bg-center) 0%, var(--qg-bg-mid) 45%, var(--qg-bg-edge) 100%);
    pointer-events: none;
}

.qg-play__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 40% at 50% 15%, rgba(56, 189, 248, 0.12) 0%, transparent 70%);
}

/* Triângulos wireframe — invadem a barra HUD (jogar / resultado) */
.qg-play__wires-layer {
    position: fixed;
    inset: 0;
    z-index: 5;
    pointer-events: none;
    overflow: visible;
}

.qg-play__wires-layer .qg-splash__wires {
    width: min(120vw, 1050px);
    height: min(120vw, 1050px);
}

.qg-play__wires-layer .qg-splash__wires--tl {
    top: -34%;
    left: -14%;
    bottom: auto;
}

.qg-play__wires-layer .qg-splash__wires--tr {
    top: -34%;
    right: -14%;
    left: auto;
    bottom: auto;
    transform: scaleX(-1);
}

.qg-play__wires-layer .qg-splash__wire-tri--near {
    opacity: 1;
}

.qg-hud {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding: 0.65rem 1rem;
    background: rgba(2, 6, 23, 0.42);
    border-bottom: 1px solid var(--qg-hud-border);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    overflow: visible;
}

.qg-hud > * {
    position: relative;
    z-index: 1;
}

.qg-hud__start {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
}

.qg-hud__logo {
    flex-shrink: 0;
    max-height: 2.5rem;
    max-width: 5.5rem;
    width: auto;
    height: auto;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.45));
}

.qg-hud__controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    flex-shrink: 0;
}

.qg-hud__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.35rem;
}

.qg-hud__btn {
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--qg-crest-text);
    border: 1px solid rgba(212, 168, 75, 0.55);
    border-radius: 9999px;
    background: linear-gradient(180deg, var(--qg-gold-light), var(--qg-gold) 55%, var(--qg-gold-dark));
    cursor: pointer;
    transition: filter 0.15s ease, transform 0.15s ease;
}

.qg-hud__btn:hover {
    filter: brightness(1.06);
    transform: translateY(-1px);
}

.qg-hud__btn--ghost {
    color: var(--qg-text);
    background: rgba(15, 23, 42, 0.55);
    border-color: rgba(148, 163, 184, 0.45);
}

.qg-hud__title {
    margin: 0;
    min-width: 0;
    flex: 1 1 auto;
    font-family: var(--qg-font-display);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--qg-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qg-timer-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.45rem;
}

.qg-timer__icon {
    width: 1.2rem;
    height: 1.2rem;
    flex-shrink: 0;
    color: var(--qg-gold-light);
    filter: drop-shadow(0 0 10px rgba(212, 168, 75, 0.45));
}

.qg-timer {
    font-family: var(--qg-font-display);
    font-variant-numeric: tabular-nums;
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--qg-gold-light);
    text-shadow: 0 0 18px rgba(212, 168, 75, 0.45);
    line-height: 1;
}

.qg-play__form {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.qg-qcard {
    margin: 0;
    border-radius: 14px;
    padding: 1.15rem 1.2rem 1.25rem;
    background: var(--qg-card-bg);
    border: 1px solid var(--qg-card-border);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(8px);
}

.qg-qcard--prompt {
    padding: 1.2rem 1.25rem 1.15rem;
}

.qg-qcard--choices {
    position: relative;
    padding: 1rem 1.2rem 1.15rem;
}

.qg-qcard__legend {
    margin: 0 0 0.5rem;
    font-family: var(--qg-font-display);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--qg-text);
}

.qg-qcard--prompt .qg-qcard__legend {
    margin-bottom: 0;
}

.qg-qcard__legend--sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.qg-qcard__tags {
    margin: 0.65rem 0 0;
    font-size: 0.7rem;
    line-height: 1.45;
    color: var(--qg-text-muted);
}

.qg-qcard--choices .qg-qcard__tags {
    display: none;
}

.qg-qcard--choices .qg-alt:first-of-type {
    margin-top: 0;
}

.qg-alt {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.75rem;
    margin-top: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.qg-alt:hover {
    background: rgba(56, 189, 248, 0.08);
    border-color: rgba(56, 189, 248, 0.35);
}

.qg-alt:has(input:checked) {
    border-color: var(--qg-radio-ring);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.12);
}

.qg-alt input {
    margin-top: 0.2rem;
    accent-color: var(--qg-gem);
}

.qg-alt__text {
    font-size: 0.9rem;
    line-height: 1.4;
    color: #e2e8f0;
}

.qg-alt__num {
    font-weight: 800;
    color: var(--qg-gold-light);
    margin-right: 0.25rem;
}

.qg-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.qg-play__form .qg-actions {
    justify-content: center;
    margin-top: 0.75rem;
}

.qg-play__confirm-wrap {
    width: 100%;
    max-width: 22rem;
}

.qg-btn-submit {
    padding: 0.85rem 1.75rem;
    font-family: var(--qg-font-display);
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 0.85rem;
    color: var(--qg-crest-text);
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    background: linear-gradient(180deg, var(--qg-gold-light), var(--qg-gold) 50%, var(--qg-gold-dark));
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    transition: transform 0.12s ease, filter 0.12s ease;
}

.qg-btn-submit:hover {
    transform: translateY(-1px);
    filter: brightness(1.05);
}

.qg-err {
    margin-top: 0.35rem;
    font-size: 0.8rem;
    color: #fca5a5;
}

/* Jogar / resultado — mobile */
@media (max-width: 767px) {
    .qg-play {
        padding: 5.25rem 0.65rem 1.5rem;
        overflow-x: clip;
    }

    .qg-play__wires-layer {
        overflow: hidden;
    }

    .qg-play__wires-layer .qg-splash__wires {
        width: 92vmin;
        height: 92vmin;
    }

    .qg-play__wires-layer .qg-splash__wires--tl {
        top: -6%;
        left: -28%;
    }

    .qg-play__wires-layer .qg-splash__wires--tr {
        top: -6%;
        right: -28%;
    }

    .qg-play__wires-layer .qg-splash__wire-triangles polygon {
        stroke-width: 1.5;
    }

    .qg-play__wires-layer .qg-splash__wire-tri--near {
        opacity: 1;
    }

    .qg-play__wires-layer .qg-splash__wire-tri--mid {
        opacity: 0.72;
    }

    .qg-play__wires-layer .qg-splash__wire-tri--far {
        opacity: 0.42;
    }

    .qg-play__wires-layer .qg-splash__wire-svg {
        filter: drop-shadow(0 0 6px var(--qg-wire-glow));
    }

    .qg-hud {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.45rem 0.5rem;
        padding: 0.45rem 0.65rem;
    }

    .qg-hud__start {
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 7.5rem);
    }

    .qg-hud__logo {
        max-height: 1.85rem;
        max-width: 3.75rem;
    }

    .qg-hud__title {
        font-size: 0.68rem;
        letter-spacing: 0.01em;
    }

    .qg-hud__controls {
        flex-shrink: 0;
        gap: 0.2rem;
    }

    .qg-hud__btn {
        padding: 0.28rem 0.55rem;
        font-size: 0.62rem;
    }

    .qg-timer-wrap {
        gap: 0.35rem;
    }

    .qg-timer__icon {
        width: 1rem;
        height: 1rem;
    }

    .qg-timer {
        font-size: 1.05rem;
        line-height: 1.1;
    }

    .qg-play__progress {
        margin: 0 auto 0.65rem;
        padding: 0 0.5rem;
        font-size: 0.78rem;
        max-width: 100%;
        gap: 0.45rem;
    }

    .qg-play__progress-bar {
        width: min(100%, 18rem);
        height: 0.42rem;
    }

    .qg-play__stage {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .qg-play__form {
        gap: 0.85rem;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .qg-qcard {
        padding: 0.9rem 0.85rem 1rem;
        border-radius: 12px;
        min-width: 0;
    }

    .qg-qcard--prompt {
        padding: 0.95rem 0.9rem;
    }

    .qg-qcard--choices {
        padding: 0.75rem 0.85rem 0.9rem;
    }

    .qg-qcard__legend {
        font-size: 0.88rem;
        line-height: 1.38;
        overflow-wrap: anywhere;
        word-break: break-word;
        hyphens: auto;
    }

    .qg-qcard__tags {
        margin-top: 0.5rem;
        font-size: 0.62rem;
        line-height: 1.4;
    }

    .qg-alt {
        padding: 0.55rem 0.6rem;
        margin-top: 0.3rem;
    }

    .qg-alt__text {
        font-size: 0.82rem;
        line-height: 1.35;
        min-width: 0;
    }

    .qg-play__form .qg-actions {
        justify-content: center;
        margin-top: 0.35rem;
    }

    .qg-play__confirm-wrap {
        max-width: 100%;
        padding: 0 0.25rem;
    }

    .qg-play__confirm-wrap .qg-btn-iniciar {
        width: min(100%, 22rem);
        font-size: clamp(0.82rem, 3.2vw, 0.95rem);
        letter-spacing: 0.1em;
    }

    /* Splash — triângulos proporcionais no celular */
    .qg-splash {
        padding: 1.5rem 0.65rem 2rem;
        overflow-x: clip;
    }

    .qg-splash__wires {
        width: min(118vw, 520px);
        height: min(118vw, 520px);
    }

    .qg-splash__wires--tl {
        top: -8%;
        left: -14%;
    }

    .qg-splash__wires--br {
        right: -14%;
        bottom: -8%;
    }

    .qg-splash__btn-wrap {
        padding: 0 0.35rem;
    }

    .qg-splash__main {
        gap: 1.35rem;
        width: 100%;
        min-width: 0;
    }
}

@media (min-width: 768px) {
    .qg-play__wires-layer .qg-splash__wires {
        width: min(108vw, 1240px);
        height: min(108vw, 1240px);
    }

    .qg-play__wires-layer .qg-splash__wire-triangles polygon {
        stroke-width: 2;
    }
}

/* Resultado (mesmo tema) */
.qg-result {
    position: relative;
    z-index: 1;
    max-width: 42rem;
    margin: 0 auto;
    padding: 0.5rem 0.75rem 2.5rem;
}

@media (min-width: 640px) {
    .qg-result {
        padding: 0.75rem 1rem 3rem;
    }
}

.qg-result__hero {
    margin-bottom: 1.35rem;
    padding: 1.35rem 1.15rem 1.5rem;
    text-align: center;
    border-radius: 1rem;
    border: 1px solid rgba(212, 168, 75, 0.4);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.92) 0%, rgba(2, 6, 23, 0.96) 100%);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.qg-result__eyebrow {
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--qg-gold-light);
}

.qg-result__headline {
    margin: 0;
    font-family: var(--qg-font-display);
    font-size: clamp(1.5rem, 5vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    color: var(--qg-text);
    text-shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
}

.qg-result__battery {
    margin: 0.45rem 0 0;
    font-size: 0.875rem;
    color: var(--qg-text-muted);
}

.qg-result__stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    margin-top: 1.15rem;
}

@media (min-width: 480px) {
    .qg-result__stats {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 0.75rem;
    }
}

.qg-result__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.2rem;
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    background: rgba(0, 0, 0, 0.22);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}

.qg-result__stat-value {
    font-family: var(--qg-font-display);
    font-size: clamp(1.15rem, 4vw, 1.45rem);
    font-weight: 800;
    line-height: 1.15;
    color: var(--qg-text);
}

.qg-result__stat-value--gold {
    color: var(--qg-gold-light);
    text-shadow: 0 0 20px rgba(212, 168, 75, 0.35);
}

.qg-result__stat-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--qg-text-muted);
}

.qg-result__ranking {
    margin-bottom: 1.5rem;
}

.qg-result__actions {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
    padding: 0 0.5rem;
}

.qg-result__back-wrap {
    width: 100%;
    max-width: 22rem;
}

.qg-result__back {
    width: 100%;
}

.qg-result__close {
    display: inline-block;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--qg-text-muted);
    text-decoration: underline;
}

/* Animações */
@keyframes qg-fade-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* :has() fallback — browsers antigos ignoram o estilo de seleção refinado */
@supports not selector(:has(*)) {
    .qg-alt input:focus + .qg-alt__text {
        outline: 2px solid var(--qg-gem);
    }
}

/* Imagem de fundo configurada em Configurações → Questionário (variável --qg-user-bg-image no body) */
.qg-root[data-qg-bg='1'] {
    background-image:
        linear-gradient(to bottom, rgba(15, 23, 42, 0.42), rgba(2, 6, 23, 0.88)),
        var(--qg-user-bg-image);
    background-size: cover, cover;
    background-position: center, center;
    background-repeat: no-repeat, no-repeat;
    background-attachment: fixed, fixed;
}

.qg-root[data-qg-bg='1'] .qg-play__bg {
    opacity: 0.5;
}

.qg-play__progress {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.55rem;
    max-width: 40rem;
    margin: 0 auto 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--qg-text-muted);
}

.qg-play__progress-label {
    margin: 0;
}

.qg-play__progress strong {
    color: var(--qg-gold-light);
}

.qg-play__progress-bar {
    width: min(100%, 22rem);
    height: 0.5rem;
    border-radius: 9999px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(212, 168, 75, 0.4);
    overflow: hidden;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.35);
}

.qg-play__progress-fill {
    display: block;
    height: 100%;
    min-width: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--qg-gold-dark), var(--qg-gold) 45%, var(--qg-gold-light));
    box-shadow: 0 0 14px rgba(212, 168, 75, 0.5);
    transition: width 0.4s ease;
}

.qg-play__stage {
    position: relative;
    z-index: 1;
    max-width: 40rem;
    margin: 0 auto;
}

.qg-play__stage--paused .qg-qcard--prompt,
.qg-play__stage--paused .qg-qcard--choices,
.qg-play__stage--paused .qg-actions {
    filter: blur(10px);
    opacity: 0.25;
    pointer-events: none;
    user-select: none;
}

.qg-qcard {
    border: 1px solid var(--qg-card-border);
}

.qg-alt--pick {
    width: 100%;
    text-align: left;
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: inherit;
    font: inherit;
}

.qg-alt--pick.qg-alt--selected {
    border-color: var(--qg-radio-ring);
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
    background: rgba(56, 189, 248, 0.14);
}

.qg-alt__radio {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    margin-top: 0.15rem;
    border-radius: 50%;
    border: 2px solid rgba(148, 163, 184, 0.65);
    background: transparent;
}

.qg-alt--selected .qg-alt__radio {
    border-color: var(--qg-gem);
    background: radial-gradient(circle at center, var(--qg-gem) 42%, transparent 44%);
}

.qg-pause-overlay {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 1.5rem;
    text-align: center;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(14px);
}

.qg-pause-overlay[hidden] {
    display: none !important;
}

.qg-pause-overlay__title {
    margin: 0;
    font-family: var(--qg-font-display);
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--qg-gold-light);
}

.qg-pause-overlay__hint {
    margin: 0;
    max-width: 18rem;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--qg-text-muted);
}

.qg-pause-overlay__btn {
    margin-top: 0.5rem;
    width: min(100%, 18rem);
    max-width: calc(100vw - 2.5rem);
}

#qg-confirm-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    filter: grayscale(0.35);
    transform: none;
    animation: none;
    pointer-events: none;
}

/* -------------------------------------------------------------------------- */
/* Feedback (acerto e erro) */
/* -------------------------------------------------------------------------- */

.qg-body--celebrate {
    overflow: hidden;
}

.qg-celebrate,
.qg-miss {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.25rem;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.qg-celebrate[hidden],
.qg-miss[hidden] {
    display: flex !important;
}

.qg-celebrate--visible,
.qg-miss--visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.qg-celebrate__backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(56, 189, 248, 0.22), rgba(2, 6, 23, 0.88));
    backdrop-filter: blur(8px);
    animation: qg-celebrate-backdrop 0.45s ease-out both;
}

.qg-celebrate__particles {
    position: absolute;
    left: 50%;
    top: 42%;
    width: 0;
    height: 0;
    pointer-events: none;
}

.qg-celebrate__particle {
    position: absolute;
    left: 0;
    top: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 2px;
    opacity: 0;
    transform: translate(0, 0) rotate(0deg) scale(0.2);
    animation: qg-particle-burst 1.1s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0s) forwards;
}

.qg-success {
    position: relative;
    z-index: 2;
    width: min(100%, 22rem);
    padding: 1.75rem 1.35rem 1.5rem;
    text-align: center;
    border-radius: 1.25rem;
    border: 1px solid rgba(212, 168, 75, 0.55);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(2, 6, 23, 0.98) 100%);
    box-shadow:
        0 0 0 1px rgba(56, 189, 248, 0.15),
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 48px rgba(74, 222, 128, 0.12);
    animation: qg-success-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.qg-success__halo {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 50% 35%, rgba(74, 222, 128, 0.28), transparent 62%);
    pointer-events: none;
    animation: qg-success-halo 2.4s ease-in-out infinite;
}

.qg-success__ring {
    position: absolute;
    left: 50%;
    top: 2.25rem;
    width: 5.5rem;
    height: 5.5rem;
    margin-left: -2.75rem;
    border-radius: 50%;
    border: 2px solid rgba(56, 189, 248, 0.35);
    pointer-events: none;
}

.qg-success__ring--a {
    animation: qg-success-ring 1.8s ease-out infinite;
}

.qg-success__ring--b {
    animation: qg-success-ring 1.8s ease-out 0.45s infinite;
}

.qg-success__icon {
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 0.5rem;
}

.qg-success__icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 18px rgba(74, 222, 128, 0.45));
}

.qg-success__check {
    stroke-dasharray: 80;
    stroke-dashoffset: 80;
    animation: qg-success-check 0.65s ease-out 0.25s forwards;
}

.qg-success__eyebrow {
    position: relative;
    margin: 0 0 0.2rem;
    font-family: var(--qg-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #4ade80;
}

.qg-success__title {
    position: relative;
    margin: 0 0 0.5rem;
    font-family: var(--qg-font-display);
    font-size: clamp(1.65rem, 5vw, 2rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #bbf7d0, #4ade80 55%, #16a34a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: none;
    animation: qg-success-title 0.7s ease-out 0.15s both;
}

.qg-success__desc {
    position: relative;
    margin: 0 auto 1rem;
    max-width: 16rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--qg-text-muted);
}

.qg-success__points {
    position: relative;
    margin: 0 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.qg-success__points-label {
    font-family: var(--qg-font-display);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--qg-text-muted);
}

.qg-success__points strong {
    font-family: var(--qg-font-display);
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--qg-gold-light);
    text-shadow: 0 0 24px rgba(212, 168, 75, 0.45);
    animation: qg-success-points 0.5s ease-out 0.35s both;
}

.qg-success__advance {
    position: relative;
    margin: 0 auto;
}

.qg-miss__backdrop {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 55% at 50% 40%, rgba(248, 113, 113, 0.2), rgba(2, 6, 23, 0.9));
    backdrop-filter: blur(8px);
    animation: qg-celebrate-backdrop 0.45s ease-out both;
}

.qg-error {
    position: relative;
    z-index: 2;
    width: min(100%, 22rem);
    padding: 1.75rem 1.35rem 1.5rem;
    text-align: center;
    border-radius: 1.25rem;
    border: 1px solid rgba(248, 113, 113, 0.45);
    background: linear-gradient(165deg, rgba(15, 23, 42, 0.96) 0%, rgba(2, 6, 23, 0.98) 100%);
    box-shadow:
        0 0 0 1px rgba(248, 113, 113, 0.12),
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 0 48px rgba(248, 113, 113, 0.14);
    animation: qg-success-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.qg-error__halo {
    position: absolute;
    inset: -30%;
    background: radial-gradient(circle at 50% 35%, rgba(248, 113, 113, 0.28), transparent 62%);
    pointer-events: none;
    animation: qg-error-halo 2.4s ease-in-out infinite;
}

.qg-error__ring {
    position: absolute;
    left: 50%;
    top: 2.25rem;
    width: 5.5rem;
    height: 5.5rem;
    margin-left: -2.75rem;
    border-radius: 50%;
    border: 2px solid rgba(248, 113, 113, 0.35);
    pointer-events: none;
}

.qg-error__ring--a {
    animation: qg-success-ring 1.8s ease-out infinite;
}

.qg-error__ring--b {
    animation: qg-success-ring 1.8s ease-out 0.45s infinite;
}

.qg-error__icon {
    position: relative;
    width: 5.5rem;
    height: 5.5rem;
    margin: 0 auto 0.5rem;
}

.qg-error__icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 18px rgba(248, 113, 113, 0.45));
}

.qg-error__cross {
    stroke-dasharray: 96;
    stroke-dashoffset: 96;
    animation: qg-error-cross 0.55s ease-out 0.2s forwards;
}

.qg-error__eyebrow {
    position: relative;
    margin: 0 0 0.2rem;
    font-family: var(--qg-font-display);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #f87171;
}

.qg-error__title {
    position: relative;
    margin: 0 0 0.5rem;
    font-family: var(--qg-font-display);
    font-size: clamp(1.55rem, 5vw, 1.95rem);
    font-weight: 900;
    letter-spacing: 0.04em;
    background: linear-gradient(180deg, #fecaca, #f87171 55%, #dc2626);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: qg-success-title 0.7s ease-out 0.15s both;
}

.qg-error__desc {
    position: relative;
    margin: 0 auto 1.35rem;
    max-width: 16rem;
    font-size: 0.92rem;
    line-height: 1.5;
    color: var(--qg-text-muted);
}

.qg-error__advance {
    position: relative;
    margin: 0 auto;
}

.qg-play__stage--answered .qg-qcard--prompt,
.qg-play__stage--answered .qg-qcard--choices,
.qg-play__stage--answered .qg-actions {
    filter: blur(6px);
    opacity: 0.35;
    pointer-events: none;
}

.qg-alt--pick.qg-alt--correct {
    border-color: rgba(74, 222, 128, 0.75);
    background: rgba(22, 101, 52, 0.35);
    box-shadow: 0 0 24px rgba(74, 222, 128, 0.25);
    animation: qg-alt-correct-glow 0.6s ease-out both;
}

.qg-alt--pick.qg-alt--wrong {
    border-color: rgba(248, 113, 113, 0.65);
    background: rgba(127, 29, 29, 0.28);
}

.qg-qcard--shake {
    animation: qg-qcard-shake 0.55s ease-in-out;
}

@keyframes qg-celebrate-backdrop {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes qg-success-pop {
    from {
        opacity: 0;
        transform: scale(0.82) translateY(24px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes qg-success-halo {
    0%,
    100% {
        opacity: 0.65;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.06);
    }
}

@keyframes qg-success-ring {
    0% {
        opacity: 0.85;
        transform: scale(0.75);
    }
    100% {
        opacity: 0;
        transform: scale(1.65);
    }
}

@keyframes qg-success-check {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes qg-error-cross {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes qg-error-halo {
    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.06);
    }
}

@keyframes qg-success-title {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes qg-success-points {
    from {
        opacity: 0;
        transform: scale(0.6);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes qg-particle-burst {
    0% {
        opacity: 1;
        transform: translate(0, 0) rotate(0deg) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--tx), var(--ty)) rotate(var(--rot)) scale(0.15);
    }
}

@keyframes qg-alt-correct-glow {
    0% {
        box-shadow: 0 0 0 rgba(74, 222, 128, 0);
    }
    50% {
        box-shadow: 0 0 32px rgba(74, 222, 128, 0.55);
    }
    100% {
        box-shadow: 0 0 24px rgba(74, 222, 128, 0.25);
    }
}

@keyframes qg-qcard-shake {
    0%,
    100% {
        transform: translateX(0);
    }
    20%,
    60% {
        transform: translateX(-6px);
    }
    40%,
    80% {
        transform: translateX(6px);
    }
}

/* Botão mudo/ativo — posicionado fixo no canto superior esquerdo */
.qg-audio-toggle {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(240, 215, 140, 0.35);
    background: rgba(2, 6, 23, 0.55);
    color: #f8fafc;
    cursor: pointer;
    backdrop-filter: blur(8px);
    transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
    padding: 0;
}

.qg-audio-toggle:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(240, 215, 140, 0.65);
}

/* Variante inline dentro do HUD — sobrescreve o posicionamento fixo */
.qg-audio-toggle--hud {
    position: relative;
    top: auto;
    left: auto;
    width: 2.1rem;
    height: 2.1rem;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(240, 215, 140, 0.25);
}

/* Grupo mute + slider — não estourar a linha do HUD */
.qg-audio-ctrl {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

/* Controles de áudio na splash — canto superior esquerdo */
.qg-audio-ctrl--splash {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 200;
    gap: 0.55rem;
    padding: 0.4rem 0.55rem 0.4rem 0.45rem;
    border-radius: 9999px;
    border: 1px solid rgba(240, 215, 140, 0.35);
    background: rgba(2, 6, 23, 0.55);
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
}

.qg-audio-ctrl--splash .qg-audio-toggle {
    position: relative;
    top: auto;
    left: auto;
    width: 2.25rem;
    height: 2.25rem;
}

.qg-audio-ctrl--splash.is-muted .qg-volume-slider {
    opacity: 0.45;
}

@media (max-width: 480px) {
    .qg-audio-ctrl--splash {
        top: 0.65rem;
        left: 0.65rem;
        gap: 0.4rem;
        padding: 0.35rem 0.45rem 0.35rem 0.4rem;
    }

    .qg-audio-ctrl--splash .qg-volume-slider {
        width: 4rem;
    }
}

/* Slider de volume */
.qg-volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 5rem;
    height: 0.22rem;
    border-radius: 9999px;
    background: rgba(240, 215, 140, 0.25);
    outline: none;
    cursor: pointer;
    flex-shrink: 0;
}

.qg-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--qg-gold-light, #f0d78c);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(240, 215, 140, 0.5);
    transition: transform 0.15s ease;
}

.qg-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.qg-volume-slider::-moz-range-thumb {
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: var(--qg-gold-light, #f0d78c);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(240, 215, 140, 0.5);
}

@media (max-width: 767px) {
    .qg-volume-slider {
        width: 3.5rem;
    }
}

@media (max-width: 420px) {
    .qg-volume-slider {
        display: none;
    }

    .qg-audio-ctrl--splash .qg-volume-slider {
        display: block;
        width: 3.5rem;
    }
}

.qg-audio-toggle .audio-off-mark {
    display: none;
}

.qg-audio-toggle.is-muted .audio-off-mark {
    display: block;
}

@media (prefers-reduced-motion: reduce) {
    .qg-celebrate__particle,
    .qg-success,
    .qg-success__ring,
    .qg-success__halo,
    .qg-success__title,
    .qg-success__points strong,
    .qg-error,
    .qg-error__ring,
    .qg-error__halo,
    .qg-error__title,
    .qg-alt--correct,
    .qg-qcard--shake {
        animation: none !important;
    }

    .qg-success__check,
    .qg-error__cross {
        stroke-dashoffset: 0;
    }
}
