:root { --pilot-ink: #e9f7fa; --pilot-muted: #a1b1c6; --pilot-line: #263848; --pilot-accent: #83fbe1; --sat-bottom: env(safe-area-inset-bottom, 0px); }
.pilot-powerups { position: fixed; z-index: 19; top: calc(140px * var(--hud-scale, 1)); right: 18px; width: 172px; display: grid; gap: 5px; pointer-events: none; font: 600 12px/1.3 Rajdhani, 'Segoe UI', sans-serif; }
.pilot-powerup { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; padding: 6px 8px; background: #08121ddd; color: #e7f1ff; border-left: 2px solid var(--power-color); }
.pilot-powerup strong { color: var(--power-color); font-variant-numeric: tabular-nums; }
.pilot-power-track { grid-column: 1 / -1; height: 2px; background: #ffffff18; }
.pilot-power-track span { display: block; height: 100%; background: var(--power-color); }
@media (max-width: 619px) {
    .pilot-powerups { top: auto; bottom: max(var(--power-bottom, 88px), calc(env(safe-area-inset-bottom) + var(--power-bottom, 88px))); left: 14px; right: 14px; width: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px 6px; font-size: 10px; }
    .pilot-powerup { padding: 4px 6px; }
}
[hidden] { display: none !important; }
.pilot-shell { position: fixed; inset: 0; z-index: 20; padding: clamp(22px, 4vw, 52px) max(22px, calc((100vw - 1000px) / 2)); overflow-y: auto; color: var(--pilot-ink); background: radial-gradient(ellipse at 12% 5%, #113536b8, transparent 55%), radial-gradient(ellipse at 95% 80%, #28204580, transparent 50%), #070c16; font: 600 16px/1.5 Rajdhani, 'Segoe UI', sans-serif; touch-action: pan-y; user-select: text; }
.pilot-shell *, .pilot-dialog * { box-sizing: border-box; }
.pilot-heading { margin: 0 0 26px; }
.pilot-heading h1 { margin: 8px 0 12px; font: 900 clamp(25px, 4vw, 46px)/1.16 Orbitron, sans-serif; letter-spacing: -.035em; }
.pilot-eyebrow { color: var(--pilot-accent); font-size: 12px; letter-spacing: .2em; font-weight: 700; }
.pilot-description { color: var(--pilot-muted); max-width: 76ch; margin: 12px 0 22px; }
.pilot-metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-block: 1px solid var(--pilot-line); padding: 18px 0; gap: 15px; margin-bottom: 18px; }
.pilot-metrics strong { display: block; font: 700 clamp(20px, 3vw, 30px) Rajdhani, sans-serif; }
.pilot-metrics span { color: var(--pilot-muted); font-size: 11px; letter-spacing: .13em; }
.pilot-selected { display: flex; align-items: center; gap: 20px; min-height: 128px; }
.pilot-selected canvas { width: 100px; height: 84px; flex-shrink: 0; }
.pilot-selected h2 { font: 700 25px Orbitron, sans-serif; margin: 4px 0 8px; }
.pilot-selected p:last-child { color: var(--pilot-muted); }
.pilot-hulls { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; margin: 16px 0 24px; }
.pilot-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.pilot-button { min-height: 44px; border: 1px solid #405867; padding: 11px 18px; border-radius: 6px; color: #dfeef4; background: #111d2b; font: 700 15px/1.3 Rajdhani, 'Segoe UI', sans-serif; cursor: pointer; touch-action: manipulation; }
.pilot-button:hover:not(:disabled) { border-color: var(--pilot-accent); background: #1a323c; }
.pilot-button.primary { background: #a4f4ce; border-color: #a4f4ce; color: #08221d; font-weight: 800; }
.pilot-button.primary:hover:not(:disabled) { background: #c4ffe4; }
.pilot-button.selected { border-color: var(--pilot-accent); color: var(--pilot-accent); background: #12302f; }
.pilot-button.quiet { background: transparent; color: #bfd3dc; }

.pilot-button.danger { min-height: 48px; background: #4a1520; border-color: #e85a6a; color: #ffc8ce; }
.pilot-button.danger:hover:not(:disabled) { background: #6a1e2c; border-color: #ff7a88; color: #ffe0e4; }
.pilot-wipe-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; width: 100%; }
.pilot-wipe-actions .pilot-button { min-height: 48px; width: 100%; }
@media (min-width: 620px) {
    .pilot-wipe-actions { flex-direction: row; }
    .pilot-wipe-actions .pilot-button { flex: 1 1 0; width: auto; }
}
.pilot-button:disabled { opacity: .45; cursor: default; }
.pilot-hulls .pilot-button { padding: 10px 5px; font-size: 13px; }
.pilot-button:focus-visible, .pilot-shell input:focus-visible, .pilot-paste:focus-visible, .pilot-select:focus-visible { outline: 3px solid #f5d987; outline-offset: 4px; }
.pilot-grid, .pilot-item-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0 24px; }
.pilot-card { padding: 22px; border: 1px solid var(--pilot-line); border-radius: 8px; background: #0c1626d9; }
.pilot-card h2 { font: 700 17px/1.4 Rajdhani, sans-serif; margin: 0 0 8px; color: #edf7ff; }
.pilot-card p { color: var(--pilot-muted); margin: 8px 0; }
.pilot-card small { display: block; margin-top: 12px; color: #a4c1cb; }
.pilot-card .pilot-button { margin-top: 10px; }
.pilot-item-grid .pilot-card { border-left: 3px solid var(--item-color, var(--pilot-line)); }
.pilot-card.undiscovered { opacity: .6; }
.pilot-loadout, .pilot-synergy { padding: 16px 20px; background: #102b2b; border: 1px solid #245553; border-radius: 6px; color: #b0f4df; margin: 16px 0; }
.pilot-cap { color: #e2ca87 !important; font-size: 12px; }
.pilot-footnote { color: #94a7ba; font-size: 13px; margin: 22px 0 12px; }
.pilot-setting { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px; background: #111b29; border: 1px solid var(--pilot-line); border-radius: 6px; }
.pilot-setting input { accent-color: #91f4d3; }
.pilot-setting input[type=checkbox] { width: 22px; height: 22px; }
.pilot-setting input[type=range] { width: 48%; min-width: 100px; }
.pilot-setting output { min-width: 42px; color: #b4f6e0; }
.pilot-paste, .pilot-select { width: 100%; border: 1px solid #405867; background: #081321; color: #e2f4fb; padding: 14px; border-radius: 6px; font: 15px/1.5 Rajdhani, sans-serif; user-select: text; touch-action: auto; }
.pilot-save-label { display: block; margin: 20px 0 12px; }
.pilot-paste { display: block; margin-top: 8px; resize: vertical; }
.pilot-dialog { position: fixed; inset: 0; margin: auto; width: min(760px, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; padding: clamp(20px, 4vw, 36px); border: 1px solid #3a655e; border-radius: 12px; background: #0b1423; color: var(--pilot-ink); font: 600 16px/1.55 Rajdhani, sans-serif; touch-action: pan-y; }
.pilot-dialog::backdrop { background: #02060dcf; }
.pilot-dialog h2 { font: 700 24px/1.3 Orbitron, sans-serif; margin-bottom: 20px; }
.pilot-dialog .pilot-card h2 { font: 700 17px Rajdhani, sans-serif; margin-bottom: 8px; }
.pilot-dialog > p { margin: 14px 0; color: #b4c5d4; }
.pilot-reward { border-color: #7b6a3c; background: linear-gradient(120deg, #392c18b0, #0f1a2d); }
.pilot-reward > p:first-of-type { color: #ffe4a0; font-size: 24px; font-weight: 700; }
.pilot-utility { position: fixed; bottom: max(14px, env(safe-area-inset-bottom)); left: 18px; z-index: 25; }
.pilot-status { position: fixed; bottom: max(18px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 26; color: #b2ffe9; background: #071620ed; border-radius: 5px; padding: 5px 12px; max-width: 70vw; text-align: center; font: 700 12px Rajdhani, sans-serif; pointer-events: none; }
.pilot-status:empty { display: none; }
.pilot-touch { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: max(14px, env(safe-area-inset-bottom)); display: flex; gap: 10px; z-index: 25; }
.pilot-touch .pilot-button { min-width: 86px; min-height: 56px; background: #0f1e30df; touch-action: none; }
.pilot-screen .hub-link, .pilot-combat .hub-link { display: none !important; }
@media (max-width: 600px) {
    .pilot-shell { padding: 24px 18px max(48px, env(safe-area-inset-bottom)); }
    .pilot-hulls { grid-template-columns: repeat(3, 1fr); }
    .pilot-grid, .pilot-item-grid { grid-template-columns: 1fr; }
    .pilot-heading { margin-bottom: 20px; }
    .pilot-selected { gap: 8px; min-height: 122px; }
    .pilot-selected canvas { width: 80px; height: 70px; }
    .pilot-metrics { gap: 8px; }
    .pilot-metrics span { font-size: 9px; letter-spacing: .04em; }
    .pilot-row .pilot-button { flex: 1 1 auto; }
    .pilot-status { bottom: 84px; max-width: 92vw; white-space: nowrap; }
    .pilot-card { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { .pilot-button { transition: none; } }

.pilot-heading h1:focus { outline: none; }
.pilot-shell:not(.hangar-cinema) { background: linear-gradient(115deg, #061019ec, #0c1929f5), radial-gradient(ellipse at 80% 10%, #426474, #060a11); }
.pilot-shell:not(.hangar-cinema) > .pilot-button.quiet:first-child { border-radius: 0; border-color: transparent; padding-left: 0; color: #d9b882; }
.pilot-card { border-radius: 2px; background: linear-gradient(125deg, #192a3b82, #0b1522d9); }
.pilot-talents .pilot-card { border-top: 2px solid #7c6b4c; display: flex; flex-direction: column; }
.pilot-talents .pilot-card h2 { font: 700 23px Orbitron, sans-serif; }
.pilot-talents .pilot-eyebrow { color: #d7b780; font-size: 10px; margin: 0 0 12px; }
.pilot-talents .talent-signature { color: #e1c694; font-size: 11px; letter-spacing: .08em; margin-top: auto; padding-top: 12px; }
.pilot-talents .pilot-row { margin-bottom: 0; }
.pilot-talents .talent-owned { border-color: #659b94; background: linear-gradient(125deg, #183b3988, #0b1522d9); }
.pilot-button, .pilot-setting, .pilot-loadout, .pilot-synergy { border-radius: 2px; }
.pilot-button.primary { color: #171b1e; background: #e9bf80; border-color: #f5d7a6; }
.pilot-button.primary:hover:not(:disabled) { background: #ffdda5; }
.pilot-dialog { border-radius: 3px; border-color: #756b54; background: linear-gradient(125deg, #182636, #09121e); }

/* Drift title: transparent shell over living canvas. DOM only for a11y ghost hits on dock. */
.pilot-shell.hangar-cinema,
.pilot-shell.drift-title {
    padding: 0;
    overflow: hidden;
    background: transparent;
    pointer-events: none;
    font-weight: 500;
}
.drift-launch-hit,
.drift-sim-hit,
.drift-dock-hit {
    position: absolute;
    z-index: 2;
    pointer-events: auto;
    margin: 0;
    border-radius: 0;
    text-indent: -9999px;
    overflow: hidden;
    white-space: nowrap;
    background: transparent !important;
    border: 2px solid transparent;
    color: transparent;
    box-shadow: none;
    min-height: 48px;
    min-width: 44px;
    touch-action: manipulation;
}
.drift-launch-hit:focus-visible,
.drift-sim-hit:focus-visible,
.drift-dock-hit:focus-visible {
    outline: 3px solid #f5d987;
    outline-offset: 3px;
    text-indent: 0;
    color: #ffe14a;
    background: rgba(5, 7, 14, 0.55) !important;
    border-color: #ffe14a;
}
.drift-sim-hit:focus-visible { color: #7dfff4; border-color: #7dfff4; }
.drift-dock-hit:focus-visible { color: #9ec4d4; border-color: #9ec4d4; }

body.pilot-screen.coarse-pointer .hub-link { display: none; }

@media (prefers-reduced-motion: reduce) {
    .drift-title .pilot-button { transition: none; }
}
