:root {
    --bg: #040a17;
    --panel: rgba(9, 20, 40, 0.72);
    --line: rgba(56, 189, 248, 0.14);
    --cyan: #22d3ee;
    --thrust: #fb923c;
}

/* El fondo va en html para que la grilla fija (-z-10) quede por encima del lienzo. */
html {
    background:
        radial-gradient(1100px 600px at 80% -10%, rgba(34, 211, 238, 0.09), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(251, 146, 60, 0.07), transparent 60%),
        var(--bg);
    color-scheme: dark;
}

body {
    font-family: 'JetBrains Mono', monospace;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

.hud-grid {
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 56px 56px;
    opacity: 0.35;
    mask-image: radial-gradient(ellipse at 60% 20%, #000 20%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at 60% 20%, #000 20%, transparent 75%);
}

.panel {
    position: relative;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 0.875rem;
    backdrop-filter: blur(6px);
}

.hud-corners::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
    --c: rgba(34, 211, 238, 0.7);
    background:
        linear-gradient(var(--c), var(--c)) top left / 16px 1px no-repeat,
        linear-gradient(var(--c), var(--c)) top left / 1px 16px no-repeat,
        linear-gradient(var(--c), var(--c)) top right / 16px 1px no-repeat,
        linear-gradient(var(--c), var(--c)) top right / 1px 16px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / 16px 1px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom left / 1px 16px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / 16px 1px no-repeat,
        linear-gradient(var(--c), var(--c)) bottom right / 1px 16px no-repeat;
}

.hud-kicker {
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: rgba(34, 211, 238, 0.8);
}

.hud-bar {
    position: relative;
    width: 100%;
    border-radius: 9999px;
    overflow: hidden;
    background:
        repeating-linear-gradient(90deg, transparent 0 calc(10% - 1px), rgba(148, 163, 184, 0.18) calc(10% - 1px) 10%),
        rgba(15, 30, 55, 0.9);
}

.hud-bar > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #0891b2, var(--cyan));
    box-shadow: 0 0 12px rgba(34, 211, 238, 0.6);
}

.hud-input {
    background: rgba(4, 10, 23, 0.8);
    border: 1px solid var(--line);
    color: #cbd5e1;
    font-size: 0.75rem;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.hud-input:focus {
    outline: none;
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.nav-btn.is-active {
    background: linear-gradient(90deg, rgba(34, 211, 238, 0.14), transparent);
    color: #a5f3fc;
    box-shadow: inset 2px 0 0 var(--cyan);
}

.glow-text {
    text-shadow: 0 0 18px rgba(34, 211, 238, 0.45);
}

.view-in > * {
    animation: view-in 0.35s ease-out both;
}

@keyframes view-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.suit-float {
    animation: suit-float 4.5s ease-in-out infinite;
}

@keyframes suit-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-9px);
    }
}

/* Sombra en contrafase con la flotación: más chica cuando el traje sube. */
.suit-shadow {
    transform-box: fill-box;
    transform-origin: center;
    animation: suit-shadow 4.5s ease-in-out infinite;
}

@keyframes suit-shadow {
    0%, 100% {
        transform: scaleX(1);
        opacity: 0.55;
    }
    50% {
        transform: scaleX(0.82);
        opacity: 0.3;
    }
}

.flame {
    transform-box: fill-box;
    transform-origin: top center;
    animation: flame 0.18s ease-in-out infinite alternate;
}

@keyframes flame {
    from {
        transform: scaleY(1);
        opacity: 0.95;
    }
    to {
        transform: scaleY(0.78);
        opacity: 0.7;
    }
}

.exhaust {
    animation: exhaust 1.6s linear infinite;
}

@keyframes exhaust {
    from {
        transform: translateY(0);
        opacity: 0.8;
    }
    to {
        transform: translateY(34px);
        opacity: 0;
    }
}

.core-pulse {
    animation: core-pulse 2.4s ease-in-out infinite;
}

@keyframes core-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.55;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
}
