/* ==========================================================================
   555n — Hero mindscape v1 overlay.
   ========================================================================== */

.hero-stage {
    position: relative;
    width: 100vw;
    height: 100vh;
    min-height: 700px;
    background: #000;
    overflow: hidden;
    cursor: crosshair;
}
.hero-stage canvas#hero-canvas {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    display: block; outline: none;
}
.hero-stage .hero-hud {
    position: absolute; inset: 0;
    pointer-events: none;
    color: var(--accent, #00ff00);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    z-index: 3;
}

/* Crosshair */
.hero-crosshair {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 60px; height: 60px;
    pointer-events: none;
    mix-blend-mode: screen;
    opacity: 0.85;
}
.hero-crosshair .ch-dot {
    position: absolute; top: 50%; left: 50%;
    width: 3px; height: 3px;
    background: #00ff00;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 6px #00ff00, 0 0 14px #00ff00;
}
.hero-crosshair .ch-r {
    position: absolute; top: 50%; left: 50%;
    border: 1px solid rgba(0, 255, 0, 0.55);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}
.hero-crosshair .ch-ring { width: 18px; height: 18px; }
.hero-crosshair .ch-ring-outer {
    width: 44px; height: 44px;
    border-style: dashed; opacity: 0.3;
    animation: ch-spin 14s linear infinite;
}
@keyframes ch-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* Coordinate panel */
.hero-coords {
    position: absolute;
    right: 24px;
    bottom: 96px;
    padding: 12px 16px;
    border: 1px solid rgba(0, 255, 0, 0.25);
    background: rgba(0, 15, 0, 0.35);
    backdrop-filter: blur(3px);
    min-width: 220px;
    line-height: 1.5;
}
.hero-coords .hc-label {
    color: #3a5a3a; font-size: 0.58rem;
    margin-top: 6px; letter-spacing: 0.2em;
}
.hero-coords .hc-label:first-child { margin-top: 0; }
.hero-coords .hc-val { color: #c0ffc0; font-size: 0.78rem; }
.hero-coords .hc-bar {
    height: 3px; background: rgba(0, 255, 0, 0.15);
    margin-top: 4px; position: relative;
}
.hero-coords .hc-bar-fill {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 0%;
    background: #00ff00;
    box-shadow: 0 0 8px #00ff00;
    transition: width 120ms ease-out;
}

/* Top-left banner */
.hero-banner {
    position: absolute; top: 20px; left: 24px;
    line-height: 1.6;
}
.hero-banner .hb-line { color: #00ff00; }
.hero-banner .hb-line.dim { color: #3a5a3a; font-size: 0.62rem; }
.hero-banner .hb-line .accent { color: #00ff00; }
.hero-banner .hb-mode {
    margin-top: 10px; padding: 4px 10px;
    border: 1px solid #00ff00; display: inline-block;
    font-size: 0.7rem; letter-spacing: 0.25em;
    animation: hb-blink 1.6s infinite;
}
.hero-banner .hb-mode[data-mode="BOOST"] {
    background: rgba(0, 255, 0, 0.15);
    animation: hb-blink-fast 0.45s infinite;
}
.hero-banner .hb-mode[data-mode="FOCUS"] { letter-spacing: 0.4em; animation: none; }
.hero-banner .hb-mode[data-mode="STAND-BY"] { color: #3a5a3a; border-color: #3a5a3a; }
@keyframes hb-blink { 50% { opacity: 0.55; } }
@keyframes hb-blink-fast { 50% { opacity: 0.25; } }

/* Bottom ticker */
.hero-ticker {
    position: absolute;
    bottom: 24px; left: 24px; right: 24px;
    height: 26px;
    border-top: 1px solid rgba(0, 255, 0, 0.2);
    border-bottom: 1px solid rgba(0, 255, 0, 0.2);
    overflow: hidden;
    font-size: 0.68rem;
    color: #00ff00;
}
.hero-ticker .ht-scroll {
    display: flex; white-space: nowrap;
    animation: ht-scroll 120s linear infinite;
    padding-top: 6px;
}
@keyframes ht-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* Multi-reticle painting — crosshair + square frame replicated across
   hit spots and kill spots on the coalesced head. */
.hero-reticles {
    position: absolute; inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
}
.hero-reticle {
    position: absolute;
    top: 0; left: 0;
    width: 80px; height: 80px;
    transform: translate(-50%, -50%) scale(1.6);
    opacity: 0;
    transition: opacity 140ms linear, transform 220ms cubic-bezier(.2,.9,.2,1),
                width 160ms cubic-bezier(.2,.9,.2,1), height 160ms cubic-bezier(.2,.9,.2,1);
    will-change: transform, opacity, width, height;
    color: #ff2d3a;
}
.hero-reticle.visible {
    opacity: 0.92;
    transform: translate(-50%, -50%) scale(1);
}
.hero-reticle.locking {
    transform: translate(-50%, -50%) scale(1.18);
    opacity: 1;
}
.hero-reticle .hr-frame {
    position: absolute; inset: 0;
    pointer-events: none;
}
.hero-reticle .hr-c {
    position: absolute;
    width: 10px; height: 10px;
    border: 1.5px solid currentColor;
    box-shadow: 0 0 6px currentColor;
}
.hero-reticle .hr-c.tl { top: 0;     left: 0;    border-right: none; border-bottom: none; }
.hero-reticle .hr-c.tr { top: 0;     right: 0;   border-left:  none; border-bottom: none; }
.hero-reticle .hr-c.bl { bottom: 0;  left: 0;    border-right: none; border-top:    none; }
.hero-reticle .hr-c.br { bottom: 0;  right: 0;   border-left:  none; border-top:    none; }
.hero-reticle .hr-dot {
    position: absolute; top: 50%; left: 50%;
    width: 3px; height: 3px;
    background: currentColor;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 5px currentColor, 0 0 12px currentColor;
}

/* Crosshair lines — solid, edge-to-edge. Extent uses viewport units so
   the line always reaches past the screen regardless of reticle position. */
.hero-reticle .hr-line {
    position: absolute;
    background: currentColor;
    box-shadow: 0 0 4px currentColor;
    opacity: 0.75;
}
.hero-reticle .hr-line.h {
    top: 50%; left: -100vw; right: -100vw;
    height: 1px; transform: translateY(-50%);
}
.hero-reticle .hr-line.v {
    left: 50%; top: -100vh; bottom: -100vh;
    width: 1px; transform: translateX(-50%);
}

/* Full perimeter box inside the corner brackets. */
.hero-reticle .hr-box {
    position: absolute;
    inset: 4px;
    border: 1px solid currentColor;
    opacity: 0.55;
    box-shadow: 0 0 6px currentColor;
    pointer-events: none;
}

/* Centre circle — larger than before, inside the square, clearly readable. */
.hero-reticle .hr-ring {
    position: absolute; top: 50%; left: 50%;
    border: 1px solid currentColor;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    width: 22px; height: 22px;
    opacity: 0.85;
}
/* Inner gap breaks the crosshair where it crosses the centre circle so the
   reticle reads cleanly rather than as a crossed dot. */
.hero-reticle .hr-gap {
    position: absolute; top: 50%; left: 50%;
    width: 24px; height: 24px;
    transform: translate(-50%, -50%);
    background: transparent;
    box-shadow: 0 0 0 3px #000 inset;
    border-radius: 50%;
    opacity: 0;
}

.hero-reticle .hr-tag {
    position: absolute;
    left: 100%; top: 50%; transform: translateY(-50%);
    margin-left: 14px;
    padding: 3px 9px; white-space: nowrap;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid currentColor;
    color: currentColor;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 2.2rem; letter-spacing: 0.12em;
    text-shadow: 0 0 4px currentColor;
}

/* Kill-spot variant — heavier strokes, dashed rotating ring. Same red
   colour as hit spots; the difference reads as weight + dwell. */
.hero-reticle.kill .hr-c { width: 14px; height: 14px; border-width: 2px; }
.hero-reticle.kill .hr-box { border-width: 2px; opacity: 0.75; }
.hero-reticle.kill .hr-ring { border-style: dashed; animation: hr-kill-spin 4s linear infinite; }
.hero-reticle.kill .hr-line { opacity: 0.95; }
.hero-reticle.kill.locking { filter: drop-shadow(0 0 10px #ff2d3a); }

@keyframes hr-kill-spin { to { transform: translate(-50%, -50%) rotate(360deg); } }

/* --- Per-state colour classes driven by reticle state ---
   Override the base color so frame, corners, box, dot and tag all retint
   via currentColor. kill = bright red, weak = orange, nohit = blue, and
   seeking is a desaturated white-with-red-hue. */
/* Three-tier red palette — brightness order: KILL > DAMAGE > WEAKEN. */
.hero-reticle.state-kill     { color: #ff1a28; }  /* brightest */
.hero-reticle.state-damage   { color: #c01828; }  /* middle */
.hero-reticle.state-weaken   { color: #7a0820; }  /* darkest */

/* KILL label bloom — 2× the base tag text-shadow. */
.hero-reticle.state-kill .hr-tag {
    text-shadow:
        0 0  8px currentColor,
        0 0 18px currentColor,
        0 0 36px rgba(255, 26, 40, 0.7);
}
.hero-reticle.state-seeking  { color: #3a0a12; }  /* very dim — scanning in-view */
.hero-reticle.state-notarget { color: #2a0008; }  /* near-black red — out of frame */
.hero-reticle.state-nohit    { color: #4a000c; }  /* legacy fallback */

/* Seeking label — half-size, muted red text on the same red hue. */
.hero-reticle.state-seeking .hr-tag {
    font-size: 1.1rem;
    color: #ffd9dc;
    border-color: rgba(170, 40, 60, 0.55);
    text-shadow: 0 0 5px rgba(255, 60, 80, 0.55), 0 0 11px rgba(170, 40, 60, 0.45);
}

/* No-target label — same half-size, very dim. */
.hero-reticle.state-notarget .hr-tag {
    font-size: 1.1rem;
    color: #7a1e28;
    border-color: rgba(80, 0, 12, 0.5);
    text-shadow: 0 0 4px rgba(90, 0, 18, 0.4);
}

/* "no hit" X across the rectangle — transparent red diagonals. */
.hero-reticle .hr-x {
    position: absolute; inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms linear;
}
.hero-reticle.state-nohit .hr-x { opacity: 0.7; }
.hero-reticle .hr-x::before,
.hero-reticle .hr-x::after {
    content: '';
    position: absolute;
    top: 50%; left: -8%;
    right: -8%;
    height: 2px;
    background: rgba(255, 28, 52, 0.6);
    box-shadow: 0 0 6px rgba(255, 28, 52, 0.55);
    transform-origin: 50% 50%;
}
.hero-reticle .hr-x::before { transform: translateY(-50%) rotate(35deg); }
.hero-reticle .hr-x::after  { transform: translateY(-50%) rotate(-35deg); }

/* Seeking banner — single blooming red typewriter hovering above the
   mecha while the swarm is scanning. Horizontal scan lines overlay the
   text. Position is written inline from hud.updateSeeking(). */
.hero-seeking {
    position: absolute;
    top: 44px;
    left: 50%;
    transform: translateX(-50%);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 1.6rem;
    letter-spacing: 0.18em;
    font-weight: 500;
    color: #ff1a28;
    text-transform: lowercase;
    white-space: nowrap;
    pointer-events: none;
    padding: 6px 18px;
    text-shadow:
        0 0 6px  #ff1a28,
        0 0 14px #ff1a28,
        0 0 28px rgba(255, 26, 40, 0.65),
        0 0 52px rgba(255, 26, 40, 0.35);
    opacity: 0;
    transition: opacity 160ms linear;
    z-index: 6;
}
/* CRT scan-line overlay across the banner itself. */
.hero-seeking::after {
    content: '';
    position: absolute;
    inset: -2px;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 2px,
        rgba(0, 0, 0, 0.35) 2px,
        rgba(0, 0, 0, 0.35) 3px
    );
    mix-blend-mode: multiply;
}
/* State tints + animations.
   seeking  → blooming red text on transparent bg, flashing
   acquired → black text on solid green rectangle
   lost     → black text on solid red rectangle */
.hero-seeking.state-seeking {
    color: #ff1a28;
    background: transparent;
    animation: hero-seeking-flash 0.55s steps(2, jump-none) infinite;
}
.hero-seeking.state-acquired {
    color: #000;
    background: #1ae648;
    text-shadow: none;
    animation: none;
    box-shadow: 0 0 18px rgba(26, 230, 72, 0.5);
}
.hero-seeking.state-lost {
    color: #000;
    background: #ff1a28;
    text-shadow: none;
    animation: none;
    box-shadow: 0 0 18px rgba(255, 26, 40, 0.5);
}
@keyframes hero-seeking-flash {
    0%, 45%   { opacity: 1;   }
    55%, 100% { opacity: 0.2; }
}

/* Compass — red triangle that appears when the target is out of view.
   Position is set per frame from hero.js; --ang rotates the triangle
   so its tip points toward the target's world direction. */
.hero-compass {
    position: absolute;
    top: 0; left: 0;
    width: 56px; height: 56px;
    transform: translate(-50%, -50%) rotate(var(--ang, 0deg));
    pointer-events: none;
    opacity: 0;
    transition: opacity 180ms linear;
    z-index: 99;
}
.hero-compass.visible { opacity: 1; }
/* Staircase clip-path: a 4-row pixel triangle. Produces crisp blocky
   edges instead of a smooth hypotenuse, matching the pixelated HUD feel. */
.hero-compass .hc-arrow,
.hero-compass .hc-arrow::before,
.hero-compass .hc-arrow::after {
    position: absolute;
    inset: 0;
    clip-path: polygon(
        37.5% 0%, 62.5% 0%,
        62.5% 25%, 75% 25%,
        75% 50%, 87.5% 50%,
        87.5% 75%, 100% 75%,
        100% 100%,
        0% 100%,
        0% 75%, 12.5% 75%,
        12.5% 50%, 25% 50%,
        25% 25%, 37.5% 25%
    );
    image-rendering: pixelated;
}
.hero-compass .hc-arrow {
    background: #ff1a28;
    filter:
        drop-shadow(0 0  6px #ff1a28)
        drop-shadow(0 0 16px #ff1a28)
        drop-shadow(0 0 34px rgba(255, 26, 40, 0.75));
    animation: hero-compass-glitch 1.05s steps(1, end) infinite;
}
/* Chromatic split layers for the glitch — a cyan ghost to the left and
   a white-hot copy to the right, both below the main red triangle. */
.hero-compass .hc-arrow::before,
.hero-compass .hc-arrow::after {
    content: '';
    mix-blend-mode: screen;
    pointer-events: none;
}
.hero-compass .hc-arrow::before {
    background: #00ffd0;
    transform: translate(-1.5px, 0);
    opacity: 0.55;
}
.hero-compass .hc-arrow::after {
    background: #fff8f6;
    transform: translate(1.5px, 0);
    opacity: 0.5;
}
@keyframes hero-compass-glitch {
    0%, 82%, 100% {
        transform: translate(0, 0);
        filter:
            drop-shadow(0 0  6px #ff1a28)
            drop-shadow(0 0 16px #ff1a28)
            drop-shadow(0 0 34px rgba(255, 26, 40, 0.75));
    }
    85% { transform: translate(2px, -1px); }
    88% {
        transform: translate(-2px, 1px) skewX(-4deg);
        filter:
            drop-shadow(0 0 10px #ff5566)
            drop-shadow(0 0 22px rgba(255, 80, 110, 0.85))
            drop-shadow(0 0 40px rgba(255, 26, 40, 0.8));
    }
    92% { transform: translate(1px, 1px) skewX(3deg); }
    95% { transform: translate(-1px, 0); }
}

/* Idle-mode standby reticle — shown when no region is in frame. Tight
   central crosshair with a small square, red to match the reticle set. */
.hero-reticle.idle {
    color: #ff2d3a;
    width: 56px; height: 56px;
}
.hero-reticle.idle .hr-c { width: 8px; height: 8px; border-width: 1.5px; }
.hero-reticle.idle .hr-box { opacity: 0.65; }
.hero-reticle.idle .hr-tag { opacity: 0.85; }

/* Target frame */
.hero-target {
    position: absolute;
    top: 0; left: 0;
    width: 160px; height: 160px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 120ms linear;
}
.hero-target.visible { opacity: 1; }
.hero-target .ht-corner {
    position: absolute;
    width: 14px; height: 14px;
    border: 2px solid #00ff00;
    box-shadow: 0 0 6px #00ff00;
}
.hero-target .tl { top: 0;  left: 0;  border-right: none; border-bottom: none; }
.hero-target .tr { top: 0;  right: 0; border-left: none;  border-bottom: none; }
.hero-target .bl { bottom: 0; left: 0;  border-right: none; border-top: none; }
.hero-target .br { bottom: 0; right: 0; border-left: none;  border-top: none; }
.hero-target .ht-tag {
    position: absolute; left: 100%; top: 50%;
    transform: translateY(-50%); margin-left: 12px;
    padding: 2px 6px; white-space: nowrap;
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(0, 255, 0, 0.45);
    color: #c0ffc0; font-size: 0.62rem;
}

/* Entry overlay */
.hero-entry {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 20, 0, 0.25) 0%, rgba(0, 0, 0, 0.85) 90%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    pointer-events: auto;
    transition: opacity 600ms ease, transform 600ms ease;
    backdrop-filter: blur(0.5px);
    z-index: 4;
}
.hero-entry.hidden { opacity: 0; transform: scale(1.02); pointer-events: none; }
.hero-entry .he-kicker {
    color: #3a5a3a; font-size: 0.7rem;
    letter-spacing: 0.35em; margin-bottom: 18px;
}
.hero-entry .he-title {
    position: relative;
    font-family: 'IBM Plex Mono', monospace;
    font-weight: 500;
    font-size: clamp(5rem, 14vw, 11rem);
    color: #00ff00;
    letter-spacing: 0.02em; line-height: 1; margin: 0;
    text-shadow: 0 0 12px rgba(0, 255, 0, 0.55), 0 0 28px rgba(0, 255, 0, 0.35);
    display: inline-block;
}
/* Fine CRT scanlines over the 555n logo. Overlay layer with
   mix-blend-mode so the green text still reads through. */
.hero-entry .he-title::after {
    content: '';
    position: absolute;
    inset: -4px -8px;
    pointer-events: none;
    background-image: repeating-linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 1.5px,
        rgba(0, 0, 0, 0.55) 1.5px,
        rgba(0, 0, 0, 0.55) 2.5px
    );
    mix-blend-mode: multiply;
    z-index: 2;
}
.hero-entry .he-glyph {
    position: relative;
    display: inline-block;
    /* Per-glyph glitch vars — driven by JS */
    --gt-clip-top: 0%;
    --gt-clip-bot: 100%;
    --gt-x: 0px; --gt-y: 0px;
    --gb-clip-top: 100%;
    --gb-clip-bot: 0%;
    --gb-x: 0px; --gb-y: 0px;
    --g-opacity: 1;
    --g-skew: 0deg;
    opacity: var(--g-opacity);
    transform: skewX(var(--g-skew));
    transition: opacity 20ms linear;
}
.hero-entry .he-glyph::before,
.hero-entry .he-glyph::after {
    content: attr(data-text);
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    overflow: visible;
    color: #00ff88;
    pointer-events: none;
    white-space: nowrap;
}
.hero-entry .he-glyph::before {
    text-shadow: -2.5px 0 #00aa44, 1px 0 #00ff88;
    clip-path: inset(var(--gt-clip-top) -400% var(--gt-clip-bot) -400%);
    transform: translate(var(--gt-x), var(--gt-y));
}
.hero-entry .he-glyph::after {
    text-shadow: 2.5px 0 #00ff88, -1px 0 #66ddaa;
    clip-path: inset(var(--gb-clip-top) -400% var(--gb-clip-bot) -400%);
    transform: translate(var(--gb-x), var(--gb-y));
}

.hero-entry .he-sub-group {
    margin-top: 22px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}
.hero-entry .he-sub {
    font-family: 'IBM Plex Mono', monospace;
    text-transform: uppercase;
}
.hero-entry .he-sub.primary {
    color: #ddffdd;
    font-size: 1.05rem;
    font-weight: 500;
    letter-spacing: 0.5em;
    padding-left: 0.5em;
    text-shadow: 0 0 10px rgba(0, 255, 120, 0.55);
}
.hero-entry .he-sub.secondary {
    color: #66aa77;
    font-size: 0.7rem;
    letter-spacing: 0.35em;
    padding-left: 0.35em;
}
.hero-entry .he-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px 32px;
    margin-top: 44px;
    color: #3a8a3a;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    max-width: 780px;
}
.hero-entry .he-controls .key {
    color: #00ff00;
    background: rgba(0, 255, 0, 0.1);
    padding: 2px 8px;
    border: 1px solid rgba(0, 255, 0, 0.25);
    margin-right: 8px;
    text-transform: uppercase;
}
.hero-entry .he-enter {
    margin-top: 44px; padding: 14px 32px;
    border: 1px solid #00ff00;
    color: #00ff00;
    font-size: 0.95rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    animation: he-pulse 2s infinite;
    cursor: pointer;
}
@keyframes he-pulse {
    0%, 100% { background: rgba(0, 255, 0, 0.08); box-shadow: 0 0 14px rgba(0, 255, 0, 0.35); }
    50%      { background: rgba(0, 255, 0, 0.2);  box-shadow: 0 0 28px rgba(0, 255, 0, 0.6); }
}

/* --- Boot loader --- */
.hero-loader {
    position: absolute; left: 50%; bottom: 18%; transform: translateX(-50%);
    width: min(520px, 82vw); z-index: 5; pointer-events: none;
    font-family: 'IBM Plex Mono', monospace; color: #00ff00;
    text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.66rem;
    transition: opacity 400ms ease;
}
.hero-loader.hidden { opacity: 0; }
.hero-loader .hl-head { color: #3a5a3a; font-size: 0.58rem; margin-bottom: 6px; }
.hero-loader .hl-head .hl-profile { color: #7fbf7f; }
.hero-loader .hl-label { display: flex; justify-content: space-between; margin-bottom: 6px; }
.hero-loader .hl-pct { color: #c0ffc0; text-transform: none; letter-spacing: 0.08em; }
.hero-loader .hl-bar { height: 3px; background: rgba(0, 255, 0, 0.12); border: 1px solid rgba(0, 255, 0, 0.3); }
.hero-loader .hl-fill { height: 100%; width: 0; background: #00ff00; box-shadow: 0 0 10px rgba(0, 255, 0, 0.6); transition: width 120ms linear; }
.hero-loader.indeterminate .hl-fill { animation: hl-scan 1.1s linear infinite; width: 35% !important; }
@keyframes hl-scan { 0% { margin-left: 0; } 100% { margin-left: 65%; } }
.hero-loader.failed .hl-fill { background: #ff4444; box-shadow: 0 0 10px rgba(255, 68, 68, 0.6); }
.hero-loader.failed .hl-stage { color: #ff4444; }
.hero-loader .hl-log { margin-top: 8px; color: #3a8a3a; font-size: 0.56rem; letter-spacing: 0.08em; text-transform: none; line-height: 1.7; }
.hero-entry .he-boot { margin-top: 18px; color: #2f4a2f; font-size: 0.56rem; letter-spacing: 0.12em; text-transform: none; max-width: 86vw; }

/* --- Touch flight chrome (phones / tablets) --- */
.hero-stage.engaged, .hero-stage.engaged canvas#hero-canvas { touch-action: none; }
.hero-exit {
    position: absolute; right: 16px; bottom: 18px; z-index: 6;
    display: none; pointer-events: auto;
    font-family: 'IBM Plex Mono', monospace; font-size: 0.72rem;
    letter-spacing: 0.25em; text-transform: uppercase;
    color: #00ff00; background: rgba(0, 0, 0, 0.6);
    border: 1px solid #00ff00; padding: 10px 14px;
    -webkit-tap-highlight-color: transparent;
}
.hero-exit.visible { display: block; }
.hero-stick {
    position: absolute; width: 112px; height: 112px; margin: -56px 0 0 -56px;
    border: 1px solid rgba(0, 255, 0, 0.35); border-radius: 50%;
    display: none; pointer-events: none; z-index: 5;
}
.hero-stick.visible { display: block; }
.hero-stick .hs-knob {
    position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px;
    border-radius: 50%; background: rgba(0, 255, 0, 0.25); border: 1px solid #00ff00;
}

/* --- Phones --- */
@media (max-width: 768px) {
    .hero-stage { height: 100svh; min-height: 560px; }
    .hero-coords { display: none; }
    .hero-banner { top: 64px; left: 16px; }
    .hero-banner .hb-line { font-size: 0.62rem; }
    .hero-entry .he-title { font-size: clamp(4rem, 22vw, 7rem); }
    .hero-entry .he-kicker { font-size: 0.62rem; letter-spacing: 0.25em; margin-bottom: 10px; }
    .hero-entry .he-sub { font-size: 0.72rem; letter-spacing: 0.2em; padding: 0 16px; }
    .hero-entry .he-controls { grid-template-columns: 1fr; gap: 6px; margin-top: 22px; font-size: 0.66rem; }
    .hero-entry .he-enter { margin-top: 22px; padding: 12px 20px; font-size: 0.78rem; letter-spacing: 0.2em; }
    .hero-exit { bottom: 62px; right: 12px; }
    .hero-ticker { font-size: 0.6rem; left: 12px; right: 12px; }
    .hero-seeking { top: 118px; font-size: 1rem; letter-spacing: 0.2em; }
    .hero-target .ht-tag { font-size: 0.5rem; letter-spacing: 0.1em; }
    .hero-reticle .hr-tag { font-size: 0.6rem; letter-spacing: 0.15em; padding: 4px 8px; max-width: 42vw; white-space: normal; }
    .hero-loader { bottom: 12%; font-size: 0.6rem; }
    .hero-loader .hl-log { display: none; }   /* phones: bar + stage only; the boot line carries timings */
}

/* Failsafe */
body.lattice-failed .hero-stage::after {
    content: 'lattice offline — check console';
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #ff4444;
    font-family: 'IBM Plex Mono', monospace;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.hero-section.hero-stage .hero { display: none !important; }
body:not(.scrolled-past-hero) .hud-nav { opacity: 0; pointer-events: none; }
.hud-nav { transition: opacity 320ms ease; }

/* Album cover image — fits the existing 120x120 art slot */
.album-art img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    image-rendering: -webkit-optimize-contrast;
}

/* Clickable track rows + playing-state indicator.
   A fixed-width ::before holds the icon slot so title columns stay aligned
   whether the row is playing, paused, or idle. */
.track-list .track-item {
    cursor: pointer;
    transition: background 120ms ease;
    position: relative;
}
.track-list .track-item::before {
    content: '\00A0';           /* NBSP — reserves space */
    display: inline-block;
    width: 1.1em;
    flex-shrink: 0;
    margin-right: 6px;
    text-align: center;
    color: #00ff00;
    opacity: 0;
}
.track-list .track-item:hover { background: rgba(0, 255, 0, 0.06); }
.track-list .track-item.playing,
.track-list .track-item.paused {
    background: rgba(0, 255, 0, 0.12);
    color: #ddffdd;
}
.track-list .track-item.playing::before {
    content: '\25B6'; /* ▶ */
    opacity: 1;
    animation: tr-pulse 1.2s infinite;
}
.track-list .track-item.paused::before {
    content: '\23F8';  /* ⏸ */
    opacity: 0.75;
}
@keyframes tr-pulse {
    0%, 100% { opacity: 1; text-shadow: 0 0 6px #00ff00; }
    50%      { opacity: 0.55; text-shadow: 0 0 12px #00ff00; }
}
