/* zHornet.css — loaded via zMeta.zBrush: [zHornet] -> /styles/zHornet.css
   Military HUD aesthetic: phosphor green on near-black, monospace readouts,
   a full-bleed WebGL canvas with the flight instruments floating over it. */

:root {
    --hud-green:  #6bffa8;
    --hud-amber:  #f2c14e;
    --hud-red:    #f2544e;
    --hud-dim:    rgba(107, 255, 168, 0.5);
    --hud-bg:     rgba(6, 14, 8, 0.82);
    --canopy:     #14181b;
    --console:    #1b2320;
    --mono:       'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

body {
    background: #04070a;
    color: var(--hud-green);
    font-family: var(--mono);
    margin: 0;
}

body:has(.hornet-slot) #zVaF-content {
    max-width: none;
    margin: 0;
    padding: 0;
}

/* ── the WebGL canvas ────────────────────────────────────────────────── */

.hornet-slot {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: #04070a;
}
.hornet-slot canvas { display: block; }

.hornet-err {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--mono);
    font-size: 0.9rem;
    color: var(--hud-red);
    text-align: center;
    padding: 0 24px;
}

/* zCLI-only fallback text — never shown in the browser render */
body:has(.hornet-slot) .hornet-cli { display: none; }

/* ── canopy bow: the diagonal windscreen support bars of a 90s HUD-era
   cockpit — body::before/::after (NOT separate zUI blocks: the WS render
   pipeline strains under many small decorative elements; see zUI.Hornet
   header), scoped to body:has(.hornet-slot) so it never touches other
   pages. A baked-in amber/dark band stands in for the bow's warning
   stripe (single gradient, no nested pseudo needed). ─────────────────── */

.hornet-slot::before,
.hornet-slot::after {
    content: '';
    position: fixed;
    z-index: 25;
    top: -6vh;
    width: 30vw;
    height: 46vh;
    pointer-events: none;
    background: linear-gradient(180deg,
        var(--canopy) 0%, var(--canopy) 79%,
        #e0b23a 79%, #1a1a1a 82%,
        var(--canopy) 82%, #05070a 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6);
}
.hornet-slot::before {
    left: -6vw;
    clip-path: polygon(0 0, 38% 0, 8% 100%, 0 100%);
}
.hornet-slot::after {
    right: -6vw;
    clip-path: polygon(62% 0, 100% 0, 100% 100%, 92% 100%);
}
@media (max-width: 720px) {
    .hornet-slot::before,
    .hornet-slot::after { width: 40vw; height: 30vh; }
}

/* ── pitch ladder: the classic green vector HUD horizon — widget-painted
   rungs, the whole container rotated (bank) + translated (pitch) each
   frame to track the jet's attitude ─────────────────────────────────── */

.pitch-slot {
    position: fixed;
    z-index: 12;
    left: 50%;
    top: 50%;
    width: 1px;
    height: 1px;
    pointer-events: none;
}
.pitch-ladder {
    position: absolute;
    left: 0;
    top: 0;
}
.pl-rung {
    position: absolute;
    left: 50%;
    display: flex;
    align-items: center;
    gap: 8px;
    transform: translate(-50%, -50%);
    white-space: nowrap;
}
.pl-rung-line {
    width: 74px;
    height: 2px;
    background: var(--hud-green);
    box-shadow: 0 0 6px rgba(107, 255, 168, 0.6);
}
.pl-rung.pl-neg .pl-rung-line { background: repeating-linear-gradient(90deg, var(--hud-green) 0 8px, transparent 8px 14px); }
.pl-rung-num {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--hud-green);
    text-shadow: 0 0 6px rgba(107, 255, 168, 0.6);
}
.pl-horizon .pl-rung-line { width: 220px; height: 2px; }

/* ── HUD digital readouts: airspeed (left) / altitude (right) tapes —
   vector-outline boxes floating IN the glass, not solid instrument panels <#> */

.hud-flight,
.hud-status {
    position: fixed;
    z-index: 20;
    top: 46%;
    width: auto;
    padding: 6px 12px;
    background: rgba(4, 10, 6, 0.35);
    border: 1px solid var(--hud-dim);
    border-radius: 2px;
    pointer-events: none;
}
.hud-flight { left: 8vw; }
.hud-status { right: 8vw; }

.hud-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 3px 0;
}

.hud-k {
    font-size: 0.62rem;
    letter-spacing: 0.12em;
    color: var(--hud-dim);
    min-width: 40px;
    margin: 0;
}

.hud-v {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--hud-green);
    margin: 0;
    text-shadow: 0 0 8px rgba(107, 255, 168, 0.65);
    font-variant-numeric: tabular-nums;
}

.hud-u {
    font-size: 0.6rem;
    color: var(--hud-dim);
    margin: 0;
}

.hud-hp-track {
    flex: 1;
    height: 6px;
    background: rgba(107, 255, 168, 0.1);
    box-shadow: inset 0 0 0 1px var(--hud-dim);
    overflow: hidden;
}
.hud-hp-fill {
    width: 100%;
    height: 100%;
    background: var(--hud-green);
    transition: width 160ms ease, background 160ms ease;
}
.hud-hp-fill.hud-hp-low { background: var(--hud-red); }

@media (max-width: 720px) {
    .hud-flight { left: 4vw; }
    .hud-status { right: 4vw; }
    .hud-v { font-size: 0.95rem; }
}

/* ── radar mini-map — restyled as the left MFD scope (green CRT) ─────── */

.radar-slot {
    position: fixed;
    z-index: 20;
    right: 18px;
    bottom: 128px;
    width: 130px;
    height: 130px;
    border-radius: 6px;
    background:
        repeating-linear-gradient(180deg, rgba(107, 255, 168, 0.05) 0 2px, transparent 2px 4px),
        radial-gradient(circle, rgba(4, 14, 8, 0.95) 0%, rgba(2, 8, 5, 0.98) 100%);
    border: 2px solid #2a3530;
    box-shadow: 0 0 18px rgba(107, 255, 168, 0.12), inset 0 0 12px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

/* ── flight-path marker (center, static; widget toggles lock class) ─── */

.reticle {
    position: fixed;
    z-index: 15;
    left: 50%;
    top: 50%;
    width: 34px;
    height: 34px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    border: 2px solid var(--hud-dim);
    border-radius: 50%;
}
.reticle::before,
.reticle::after {
    content: '';
    position: absolute;
    background: var(--hud-dim);
}
/* wing ticks + a short vertical stub, like a real flight-path marker */
.reticle::before { left: -22px; top: 50%; width: 14px; height: 2px; transform: translateY(-50%); box-shadow: 40px 0 0 var(--hud-dim); }
.reticle::after { left: 50%; top: -14px; width: 2px; height: 10px; transform: translateX(-50%); }
.reticle.reticle-lock {
    border-color: var(--hud-red);
    box-shadow: 0 0 14px rgba(242, 84, 78, 0.7);
}
.reticle.reticle-lock::before,
.reticle.reticle-lock::after { background: var(--hud-red); box-shadow: 40px 0 0 var(--hud-red); }

/* ── glareshield: a console bar across the bottom the stick/throttle and
   fire buttons sit on — pure CSS, no DOM change (pseudo-element) ────── */
body:has(.control-pad)::after {
    content: '';
    position: fixed;
    z-index: 15;
    left: 0; right: 0; bottom: 0;
    height: 15vh;
    min-height: 96px;
    background: linear-gradient(180deg, var(--console) 0%, #0c100e 100%);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

/* ── control pad (bottom-center, widget-painted buttons) ─────────────── */

.control-pad {
    position: fixed;
    z-index: 20;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 22px;
    align-items: flex-end;
    padding: 14px 20px;
    background: rgba(6, 14, 8, 0.55);
    border: 1px solid #33403a;
    border-radius: 6px;
    box-shadow: 0 0 24px rgba(107, 255, 168, 0.08);
}

.cp-group {
    display: grid;
    grid-template-columns: repeat(3, 34px);
    grid-template-rows: repeat(3, 34px);
    gap: 4px;
}

button.cp-btn {
    font-family: var(--mono);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--hud-green);
    background: rgba(92, 242, 122, 0.08);
    border: 1px solid var(--hud-dim);
    border-radius: 5px;
    cursor: pointer;
    transition: background 100ms ease, transform 100ms ease;
}
button.cp-btn:hover { background: rgba(92, 242, 122, 0.22); }
button.cp-btn:active { transform: scale(0.94); }
button.cp-btn:disabled { opacity: 0.3; cursor: default; }

.cp-throttle {
    grid-template-columns: 34px;
    grid-template-rows: repeat(2, 34px);
}

.cp-fire {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
button.cp-fire-btn {
    font-family: var(--mono);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #05100a;
    background: linear-gradient(180deg, var(--hud-amber) 0%, #c78f2e 100%);
    border: 0;
    border-radius: 5px;
    padding: 8px 14px;
    cursor: pointer;
    transition: filter 100ms ease, transform 100ms ease;
}
button.cp-fire-btn:hover { filter: brightness(1.12); }
button.cp-fire-btn:active { transform: scale(0.96); }
button.cp-fire-btn:disabled { opacity: 0.35; cursor: default; filter: none; }
button.cp-msl-btn {
    background: linear-gradient(180deg, var(--hud-red) 0%, #8c2a26 100%);
    color: #180605;
}

.cp-label {
    font-size: 0.56rem;
    letter-spacing: 0.12em;
    color: var(--hud-dim);
    text-align: center;
    margin: 4px 0 0;
}

@media (max-width: 720px) {
    .hud-flight, .hud-status { width: 44vw; padding: 8px 10px; }
    .hud-v { font-size: 0.9rem; }
    .control-pad { gap: 12px; padding: 10px 12px; }
    .cp-group { grid-template-columns: repeat(3, 28px); grid-template-rows: repeat(3, 28px); }
    .cp-throttle { grid-template-columns: 28px; grid-template-rows: repeat(2, 28px); }
    .radar-slot { width: 96px; height: 96px; right: 10px; bottom: 10px; }
}

/* ── start overlay: callsign + LAUNCH (widget-painted) ──────────────── */

.start-slot:empty { display: none; }

.so-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse 70% 50% at 50% 30%, rgba(92, 242, 122, 0.08) 0%, transparent 60%),
        #04070a;
}

.so-card {
    width: min(92vw, 420px);
    padding: 40px 44px;
    text-align: center;
    background: var(--hud-bg);
    border: 1px solid var(--hud-dim);
    border-radius: 10px;
    box-shadow: 0 0 60px rgba(92, 242, 122, 0.12);
}

.so-kicker {
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-indent: 0.4em;
    color: var(--hud-dim);
    margin: 0 0 10px;
}

.so-title {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--hud-green);
    text-shadow: 0 0 18px rgba(92, 242, 122, 0.4);
    margin: 0 0 6px;
}

.so-sub {
    font-size: 0.82rem;
    color: var(--hud-dim);
    margin: 0 0 28px;
}

.so-label {
    display: block;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--hud-dim);
    text-align: left;
    margin: 0 0 6px;
}

input.so-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(92, 242, 122, 0.06);
    border: 1px solid var(--hud-dim);
    border-radius: 4px;
    padding: 12px 14px;
    font-family: var(--mono);
    font-size: 0.95rem;
    color: var(--hud-green);
    margin-bottom: 20px;
}
input.so-input:focus {
    outline: none;
    border-color: var(--hud-green);
    box-shadow: 0 0 0 3px rgba(92, 242, 122, 0.14);
}

button.so-go {
    width: 100%;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.92rem;
    letter-spacing: 0.22em;
    border: 0;
    cursor: pointer;
    padding: 14px 0;
    border-radius: 4px;
    background: linear-gradient(180deg, #7dfb98 0%, #3fc75f 100%);
    color: #04250f;
    transition: filter 140ms ease;
}
button.so-go:hover { filter: brightness(1.08); }

.so-hint {
    margin-top: 18px;
    font-size: 0.7rem;
    line-height: 1.6;
    color: var(--hud-dim);
}

/* ── game-over debrief overlay (widget-painted) ─────────────────────── */

.gameover-slot:empty { display: none; }

.go-overlay {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 3, 2, 0.82);
    backdrop-filter: blur(3px);
}

.go-card {
    width: min(92vw, 440px);
    padding: 40px 44px;
    text-align: center;
    background: var(--hud-bg);
    border: 1px solid var(--hud-red);
    border-radius: 10px;
    box-shadow: 0 0 70px rgba(242, 84, 78, 0.18);
}

.go-title {
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--hud-red);
    text-shadow: 0 0 18px rgba(242, 84, 78, 0.5);
    margin: 0 0 18px;
}

.go-stats {
    display: flex;
    justify-content: center;
    gap: 28px;
    margin: 0 0 28px;
}
.go-stat-k {
    font-size: 0.62rem;
    letter-spacing: 0.14em;
    color: var(--hud-dim);
    margin: 0 0 4px;
}
.go-stat-v {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--hud-green);
    margin: 0;
}

button.go-again {
    width: 100%;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.88rem;
    letter-spacing: 0.2em;
    border: 0;
    cursor: pointer;
    padding: 14px 0;
    border-radius: 4px;
    background: linear-gradient(180deg, #7dfb98 0%, #3fc75f 100%);
    color: #04250f;
}
button.go-again:hover { filter: brightness(1.08); }

/* ── help: "?" button + the controls overlay it opens ───────────────── */

.help-btn {
    position: fixed;
    z-index: 30;
    /* top-center collides with the pitch ladder's 45° mark — top-right
       corner, clear of both the ladder and the status readout beneath it */
    top: 16px;
    right: 18px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 14, 8, 0.6);
    border: 1px solid var(--hud-dim);
    border-radius: 50%;
    cursor: pointer;
}
.help-btn:hover { background: rgba(107, 255, 168, 0.16); }
.help-btn-label {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--hud-green);
    margin: 0;
    pointer-events: none;
}

.help-slot:empty { display: none; }

.help-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(2, 5, 3, 0.86);
    backdrop-filter: blur(3px);
}

.help-card {
    width: min(92vw, 560px);
    max-height: 82vh;
    overflow-y: auto;
    padding: 30px 34px;
    background: var(--hud-bg);
    border: 1px solid var(--hud-dim);
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(107, 255, 168, 0.12);
}

.help-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--hud-green);
    text-shadow: 0 0 12px rgba(107, 255, 168, 0.5);
    margin: 0 0 4px;
}

.help-sub {
    font-size: 0.74rem;
    color: var(--hud-dim);
    margin: 0 0 20px;
}

.help-group-title {
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--hud-dim);
    margin: 18px 0 8px;
}
.help-group-title:first-of-type { margin-top: 0; }

.help-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(107, 255, 168, 0.14);
}
.help-row:last-child { border-bottom: 0; }

.help-keys {
    display: flex;
    gap: 4px;
    flex: 0 0 auto;
    min-width: 96px;
}
.help-key {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--hud-green);
    background: rgba(107, 255, 168, 0.1);
    border: 1px solid var(--hud-dim);
    border-radius: 4px;
    padding: 2px 7px;
}
.help-btn-chip {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: #05100a;
    background: var(--hud-amber);
    border-radius: 3px;
    padding: 2px 8px;
}
.help-desc {
    font-size: 0.84rem;
    color: #cfe8db;
}

button.help-close {
    /* sticky footer: .help-card itself scrolls (overflow-y: auto) and this
       list can run taller than the viewport — a non-sticky close button
       would sit below the fold, unreachable without an extra scroll */
    position: sticky;
    bottom: 0;
    width: 100%;
    margin-top: 22px;
    font-family: var(--mono);
    font-weight: 700;
    font-size: 0.82rem;
    letter-spacing: 0.18em;
    border: 0;
    cursor: pointer;
    padding: 12px 0;
    border-radius: 4px;
    background: linear-gradient(180deg, #7dfb98 0%, #3fc75f 100%);
    color: #04250f;
    box-shadow: 0 -8px 16px rgba(4, 10, 6, 0.9);
}
button.help-close:hover { filter: brightness(1.08); }

@media (max-width: 720px) {
    .help-card { padding: 22px 20px; }
    .help-keys { min-width: 76px; }
}
