/* ==========================================
   CSS CUSTOM VARIABLES & TOKENS
   ========================================== */
:root {
    --bg-dark: #05070a;
    --bg-panel: rgba(10, 15, 24, 0.85);
    --border-cyan: rgba(0, 243, 255, 0.35);
    --border-cyan-active: rgba(0, 243, 255, 0.8);
    --neon-blue: #00b4ff;
    --neon-cyan: #00f3ff;
    --neon-green: #39ff14;
    --neon-red: #ff3131;
    --amber-gold: #ffb400;
    --text-primary: #e2e8f0;
    --text-muted: #64748b;
    --font-header: 'Orbitron', sans-serif;
    --font-mono: 'Share Tech Mono', monospace;
    --font-body: 'Outfit', sans-serif;
}

/* ==========================================
   GLOBAL STYLES & CRT OVERLAYS
   ========================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%),
        linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 4px, 6px 100%;
    color: var(--text-primary);
    font-family: var(--font-body);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* Grid & Carbon Fiber Overlay */
.hud-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(var(--border-cyan) 1px, transparent 1px),
        linear-gradient(90deg, var(--border-cyan) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

/* CRT Screen Scanlines / Flicker */
.crt::after {
    content: " ";
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
    z-index: 9999;
}

@keyframes crt-flicker {
    0% { opacity: 0.99; }
    50% { opacity: 0.96; }
    100% { opacity: 0.99; }
}

body.crt {
    animation: crt-flicker 0.15s infinite;
}

/* ==========================================
   LAYOUT CONTAINER
   ========================================== */
.console-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
    z-index: 2;
}

/* ==========================================
   HEADER / HUD BAR
   ========================================== */
.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid var(--neon-blue);
    padding-bottom: 15px;
    margin-bottom: 25px;
    box-shadow: 0 10px 20px -10px rgba(0, 180, 255, 0.3);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.blink-dot {
    width: 10px;
    height: 10px;
    background-color: var(--neon-red);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-red);
    animation: pulse 1.5s infinite;
}

.logo-text {
    font-family: var(--font-header);
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.badge {
    font-family: var(--font-mono);
    font-size: 11px;
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid var(--neon-cyan);
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--neon-cyan);
}

.header-center {
    display: flex;
    gap: 25px;
    font-family: var(--font-mono);
    font-size: 14px;
}

.hud-stat {
    color: var(--text-muted);
}

.neon-text {
    color: var(--neon-cyan);
    text-shadow: 0 0 5px var(--neon-cyan);
}

.neon-green {
    color: var(--neon-green);
    text-shadow: 0 0 5px var(--neon-green);
}

.neon-red {
    color: var(--neon-red);
    text-shadow: 0 0 5px var(--neon-red);
}

.lang-selector {
    display: flex;
    gap: 5px;
}

.lang-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 4px 8px;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 12px;
    transition: all 0.3s ease;
}

.lang-btn.active, .lang-btn:hover {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
    background: rgba(0, 243, 255, 0.05);
}

/* ==========================================
   MAIN GRID PANELS
   ========================================== */
.console-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 25px;
}

@media (max-width: 900px) {
    .console-grid {
        grid-template-columns: 1fr;
    }
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-cyan);
    border-radius: 4px;
    box-shadow: inset 0 0 15px rgba(0, 243, 255, 0.05), 0 5px 15px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(8px);
    transition: border-color 0.3s ease;
}

.panel:hover {
    border-color: var(--border-cyan-active);
}

.panel-header {
    background: rgba(0, 180, 255, 0.08);
    border-bottom: 1px solid var(--border-cyan);
    padding: 12px 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.panel-title {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 14px;
    letter-spacing: 1px;
    color: var(--neon-cyan);
}

.panel-sub {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.panel-body {
    padding: 20px;
    flex-grow: 1;
}

/* ==========================================
   RADAR VIEW
   ========================================== */
.radar-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.radar-container {
    position: relative;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    border: 2px solid var(--border-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.15);
    background: radial-gradient(circle, rgba(0, 180, 255, 0.05) 0%, rgba(0, 0, 0, 0.9) 80%);
    overflow: hidden;
}

@media (max-width: 400px) {
    .radar-container {
        width: 280px;
        height: 280px;
    }
    #radar-canvas {
        width: 280px;
        height: 280px;
    }
}

#radar-canvas {
    position: absolute;
    top: 0;
    left: 0;
}

.radar-crosshair {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.radar-crosshair::before, .radar-crosshair::after {
    content: '';
    position: absolute;
    background: rgba(0, 243, 255, 0.2);
}

.radar-crosshair::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
}

.radar-crosshair::after {
    left: 50%;
    top: 0;
    width: 1px;
    height: 100%;
}

.telemetry-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    gap: 12px;
    border-top: 1px solid rgba(0, 243, 255, 0.15);
    padding-top: 15px;
}

.telemetry-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(0, 243, 255, 0.1);
    padding: 8px 12px;
}

.tel-label {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.tel-val {
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 16px;
}

/* ==========================================
   PAYLOAD DEPLOYER / SWAP
   ========================================== */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.system-alert.warning {
    border: 1px solid var(--amber-gold);
    background: rgba(255, 180, 0, 0.06);
    padding: 12px 15px;
    margin-bottom: 20px;
    box-shadow: 0 0 10px rgba(255, 180, 0, 0.05);
}

.alert-title {
    display: block;
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 12px;
    color: var(--amber-gold);
    margin-bottom: 5px;
}

.alert-desc {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    color: var(--text-primary);
}

.input-group {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(0, 243, 255, 0.15);
    padding: 12px 15px;
    border-radius: 4px;
    margin-bottom: 12px;
}

.input-label-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.input-field-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.input-field-wrapper input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-header);
    font-size: 22px;
    font-weight: 700;
    width: 70%;
}

.input-token {
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 18px;
}

.arrow-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: -5px 0 10px 0;
}

.connector-line {
    width: 1px;
    height: 15px;
    background: var(--border-cyan);
}

.arrow-head {
    color: var(--neon-cyan);
    font-size: 12px;
    line-height: 1;
}

.launch-btn {
    display: block;
    text-align: center;
    background: linear-gradient(135deg, var(--neon-blue) 0%, rgba(0, 243, 255, 0.8) 100%);
    border: none;
    border-radius: 4px;
    padding: 16px;
    color: #fff;
    font-family: var(--font-header);
    font-weight: 900;
    font-size: 15px;
    letter-spacing: 1.5px;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 15px rgba(0, 243, 255, 0.3);
    transition: all 0.3s ease;
    margin-top: 15px;
}

.launch-btn:hover {
    box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
    transform: translateY(-1px);
}

/* ==========================================
   LOGS / STRIKES TERMINAL
   ========================================== */
.logs-body {
    padding: 15px;
    background: #010305;
}

.terminal-logs {
    height: 180px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 12px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 5px;
}

/* Custom Scrollbar for Terminal */
.terminal-logs::-webkit-scrollbar {
    width: 4px;
}
.terminal-logs::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.02);
}
.terminal-logs::-webkit-scrollbar-thumb {
    background: var(--border-cyan);
}

.log-entry {
    border-left: 2px solid var(--neon-blue);
    padding-left: 10px;
}

.log-entry.strike {
    border-color: var(--neon-cyan);
}

.log-header {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 11px;
}

.log-memo {
    color: var(--text-primary);
    word-break: break-all;
}

/* ==========================================
   FOOTER
   ========================================== */
.hud-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(0, 243, 255, 0.15);
    margin-top: 30px;
    padding-top: 15px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.footer-link {
    color: var(--neon-cyan);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link:hover {
    color: #fff;
    text-shadow: 0 0 5px var(--neon-cyan);
}

.divider {
    margin: 0 10px;
}

/* ==========================================
   ANIMATIONS
   ========================================== */
@keyframes pulse {
    0% { opacity: 0.4; }
    50% { opacity: 1; }
    100% { opacity: 0.4; }
}

.animate-pulse {
    animation: pulse 2s infinite;
}

/* Glitch Animation */
.glitch {
    position: relative;
}

.glitch::before, .glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark);
}

.glitch::before {
    left: 2px;
    text-shadow: -1px 0 var(--neon-red);
    clip: rect(44px, 450px, 56px, 0);
    animation: glitch-anim 5s infinite linear alternate-reverse;
}

.glitch::after {
    left: -2px;
    text-shadow: -1px 0 var(--neon-blue);
    clip: rect(85px, 450px, 140px, 0);
    animation: glitch-anim2 5s infinite linear alternate-reverse;
}

@keyframes glitch-anim {
    0% { clip: rect(31px, 9999px, 94px, 0); }
    10% { clip: rect(112px, 9999px, 76px, 0); }
    20% { clip: rect(85px, 9999px, 5px, 0); }
    100% { clip: rect(67px, 9999px, 125px, 0); }
}

@keyframes glitch-anim2 {
    0% { clip: rect(76px, 9999px, 116px, 0); }
    11% { clip: rect(2px, 9999px, 115px, 0); }
    22% { clip: rect(57px, 9999px, 86px, 0); }
    100% { clip: rect(33px, 9999px, 145px, 0); }
}

/* ==========================================
   PFP GALLERY
   ========================================== */
.pfp-grid {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    width: 100%;
    padding: 10px 5px 25px 5px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}

.pfp-grid::-webkit-scrollbar {
    height: 6px;
}

.pfp-grid::-webkit-scrollbar-track {
    background: rgba(0, 180, 255, 0.05);
    border-radius: 3px;
}

.pfp-grid::-webkit-scrollbar-thumb {
    background: rgba(0, 243, 255, 0.3);
    border-radius: 3px;
    border: 1px solid var(--neon-cyan);
}

.pfp-grid::-webkit-scrollbar-thumb:hover {
    background: var(--neon-cyan);
}

.pfp-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    background: rgba(255, 255, 255, 0.01);
    border: 1px dashed rgba(0, 243, 255, 0.15);
    padding: 12px;
    border-radius: 4px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.pfp-card:hover {
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 243, 255, 0.1);
}

.pfp-card img {
    width: 100%;
    max-width: 150px;
    aspect-ratio: 1;
    border-radius: 4px;
    border: 1px solid var(--border-cyan);
}

.pfp-name {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--neon-cyan);
}

/* ==========================================
   STEALTH FACADE OVERLAY
   ========================================== */
.facade-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(6, 9, 14, 0.98) 0%, rgba(2, 3, 5, 1) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    transition: opacity 0.5s ease, transform 0.5s ease;
    padding: 20px;
}

.facade-container.dismissed {
    opacity: 0;
    transform: scale(1.05);
    pointer-events: none;
}

.facade-box {
    width: 100%;
    max-width: 600px;
    background: var(--bg-panel);
    border: 2px solid var(--neon-blue);
    box-shadow: 0 0 30px rgba(0, 180, 255, 0.3), inset 0 0 20px rgba(0, 180, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
}

.facade-header {
    background: rgba(0, 180, 255, 0.12);
    border-bottom: 2px solid var(--neon-blue);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 13px;
}

.warning-blink {
    color: var(--amber-gold);
    text-shadow: 0 0 5px var(--amber-gold);
    animation: pulse 1s infinite;
}

.facade-badge {
    background: rgba(0, 243, 255, 0.15);
    border: 1px solid var(--neon-cyan);
    padding: 2px 8px;
    border-radius: 3px;
    color: var(--neon-cyan);
}

.facade-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
}

.facade-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 2px solid var(--neon-cyan);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2);
}

.facade-title {
    font-family: var(--font-header);
    font-size: 22px;
    font-weight: 900;
    color: var(--text-primary);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
    margin-bottom: 10px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.progress-bar-label {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
}

.progress-bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-cyan);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--neon-blue), var(--neon-cyan));
    box-shadow: 0 0 10px var(--neon-cyan);
    transition: width 0.5s ease;
}

/* Facade Terminal */
.facade-terminal {
    width: 100%;
    background: #010305;
    border: 1px solid rgba(0, 243, 255, 0.15);
    padding: 15px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1.6;
    text-align: left;
}

.terminal-line {
    color: var(--text-primary);
    margin-bottom: 4px;
}

.font-amber {
    color: var(--amber-gold);
}

/* Action Button */
.facade-actions {
    width: 100%;
    margin-top: 10px;
}

.facade-btn {
    width: 100%;
    background: transparent;
    border: 1px solid var(--neon-cyan);
    color: var(--neon-cyan);
    font-family: var(--font-header);
    font-weight: 700;
    font-size: 13px;
    padding: 14px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    box-shadow: 0 0 10px rgba(0, 243, 255, 0.1);
}

.facade-btn:hover {
    background: rgba(0, 243, 255, 0.08);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
    text-shadow: 0 0 5px var(--neon-cyan);
}

