:root {
    --cyan: #00f3ff;
    --cyan-dim: rgba(0, 243, 255, 0.3);
    --cyan-glow: 0 0 15px var(--cyan);
    
    --gold: #ffb700;
    --gold-dim: rgba(255, 183, 0, 0.3);
    --gold-glow: 0 0 15px var(--gold);
    
    --red: #ff003c;
    
    --bg-color: #010409;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--cyan);
    font-family: 'Share Tech Mono', monospace;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
    height: 100vh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Backgrounds */
.hud-wrapper {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    perspective: 1000px;
}

.grid-bg {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: 
        linear-gradient(var(--cyan-dim) 1px, transparent 1px),
        linear-gradient(90deg, var(--cyan-dim) 1px, transparent 1px);
    background-size: 50px 50px;
    background-position: center center;
    opacity: 0.15;
    z-index: -2;
    transform: scale(1.2);
    animation: panGrid 20s linear infinite;
}

@keyframes panGrid {
    0% { background-position: 0px 0px; }
    100% { background-position: 50px 50px; }
}

.vignette {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, transparent 30%, var(--bg-color) 90%);
    z-index: -1;
}

.scanner {
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 10px;
    background: linear-gradient(to bottom, transparent, var(--cyan), transparent);
    opacity: 0.2;
    box-shadow: var(--cyan-glow);
    animation: scanLine 6s ease-in-out infinite alternate;
    z-index: 1;
    pointer-events: none;
}

@keyframes scanLine {
    0% { top: 5%; }
    100% { top: 95%; }
}

/* Top & Bottom Bars */
header.top-bar, footer.bottom-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 10;
    width: 100%;
}

.corner {
    position: relative;
    width: 250px;
    height: 40px;
}

.corner svg {
    position: absolute;
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 5px var(--cyan));
}
.top-right svg { filter: drop-shadow(0 0 5px var(--gold)); }

.corner .text {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
}

.top-left .text { left: 20px; color: var(--cyan); text-shadow: var(--cyan-glow); }
.top-right .text { right: 20px; color: var(--gold); text-shadow: var(--gold-glow); }
.bot-left .text { left: 20px; color: var(--cyan); text-shadow: var(--cyan-glow); }
.bot-right .text { right: 20px; color: var(--cyan); text-shadow: var(--cyan-glow); }

.center-top {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: 5px;
    color: var(--cyan);
    text-shadow: var(--cyan-glow);
    border-bottom: 2px solid var(--cyan);
    padding-bottom: 5px;
}

/* Main HUD Layout */
.hud-core {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 5%;
}

.panel {
    width: 320px;
    background: rgba(0, 243, 255, 0.05);
    border: 1px solid var(--cyan-dim);
    backdrop-filter: blur(4px);
    box-shadow: inset 0 0 20px var(--cyan-dim);
    display: flex;
    flex-direction: column;
}

.panel-header {
    background: var(--cyan-dim);
    color: var(--cyan);
    padding: 8px 15px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: bold;
    letter-spacing: 2px;
    border-bottom: 1px solid var(--cyan);
    text-shadow: var(--cyan-glow);
}

.panel-content, .terminal-content {
    padding: 20px;
    flex: 1;
}

/* Left Panel: Diagnostics */
.diag-list {
    list-style: none;
    margin-bottom: 25px;
}

.diag-list li {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.diag-list .label {
    width: 50px;
    font-weight: bold;
    font-size: 1.1rem;
}

.diag-list .bar {
    flex: 1;
    height: 10px;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid var(--cyan-dim);
    position: relative;
}

.diag-list .fill {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    background: var(--cyan);
    box-shadow: var(--cyan-glow);
    transition: width 1s ease-in-out;
}

/* Target Box */
.target-box {
    border: 1px solid var(--cyan);
    height: 180px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    background: repeating-linear-gradient(
        45deg,
        rgba(0, 243, 255, 0.05),
        rgba(0, 243, 255, 0.05) 10px,
        transparent 10px,
        transparent 20px
    );
}

.crosshair {
    width: 60px;
    height: 60px;
    border: 2px solid var(--gold);
    border-radius: 50%;
    position: relative;
    animation: rotate 10s linear infinite;
}
.crosshair::before, .crosshair::after {
    content: '';
    position: absolute;
    background: var(--gold);
}
.crosshair::before { top: -15px; bottom: -15px; left: 27px; width: 2px; }
.crosshair::after { left: -15px; right: -15px; top: 27px; height: 2px; }

.target-box .info {
    position: absolute;
    bottom: 5px;
    font-size: 0.9rem;
    font-family: 'Orbitron', sans-serif;
    color: var(--gold);
    text-shadow: var(--gold-glow);
}

/* Center Reactor (Arc Reactor style) */
.reactor-container {
    position: relative;
    width: 450px;
    height: 450px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.ring {
    position: absolute;
    border-radius: 50%;
    box-shadow: inset 0 0 20px var(--cyan-dim), 0 0 20px var(--cyan-dim);
}

.outer-ring {
    width: 100%;
    height: 100%;
    border: 4px dashed var(--cyan);
    animation: rotate 30s linear infinite;
    opacity: 0.8;
}

.middle-ring {
    width: 75%;
    height: 75%;
    border: 8px solid var(--cyan-dim);
    border-left: 8px solid var(--gold);
    border-right: 8px solid var(--gold);
    animation: rotate-reverse 20s linear infinite;
}

.inner-ring {
    width: 50%;
    height: 50%;
    border: 2px dotted var(--cyan);
    box-shadow: 0 0 30px var(--cyan);
    animation: rotate 15s linear infinite;
}

.core {
    width: 30%;
    height: 30%;
    background: radial-gradient(circle, #fff, var(--cyan) 40%, transparent 80%);
    border-radius: 50%;
    box-shadow: 0 0 60px 20px var(--cyan);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
    animation: pulse 2s infinite alternate;
}

.core-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 2rem;
    color: #fff;
    text-align: center;
    text-shadow: 0 0 15px var(--cyan), 0 0 30px #000;
}

@keyframes rotate { 100% { transform: rotate(360deg); } }
@keyframes rotate-reverse { 100% { transform: rotate(-360deg); } }
@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.8; }
    100% { transform: scale(1.05); opacity: 1; box-shadow: 0 0 80px 30px var(--cyan); }
}

/* Nodes */
.node {
    position: absolute;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    font-weight: bold;
    color: var(--cyan);
    background: rgba(0,243,255,0.1);
    border: 1px solid var(--cyan);
    padding: 4px 10px;
    border-radius: 10px;
    text-shadow: var(--cyan-glow);
}
.node-1 { top: 10%; left: 10%; }
.node-2 { bottom: 15%; left: 5%; }
.node-3 { top: 20%; right: 5%; }


/* Right Panel: Terminal & Actions */
#jarvis-terminal {
    height: 220px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--cyan);
    text-shadow: var(--cyan-glow);
}
#jarvis-terminal::-webkit-scrollbar { width: 4px; }
#jarvis-terminal::-webkit-scrollbar-thumb { background: var(--cyan); }

.blink { animation: blinking 1s infinite; }
@keyframes blinking { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }

.action-buttons {
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.iron-btn {
    background: transparent;
    border: 2px solid var(--cyan);
    color: var(--cyan);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    padding: 12px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 2px;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
}

.iron-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s;
}
.iron-btn:hover::before {
    left: 150%;
}

.cyan-btn:hover {
    background: var(--cyan);
    color: var(--bg-color);
    box-shadow: var(--cyan-glow);
}

.gold-btn {
    border-color: var(--gold);
    color: var(--gold);
}
.gold-btn:hover {
    background: var(--gold);
    color: var(--bg-color);
    box-shadow: var(--gold-glow);
}

/* Sound Wave Bottom Center */
.sound-wave {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 40px;
}
.sound-wave .bar {
    width: 8px;
    background: var(--cyan);
    box-shadow: var(--cyan-glow);
    border-radius: 4px;
    animation: wave 1s infinite alternate ease-in-out;
}
.sound-wave .bar:nth-child(1) { height: 15px; animation-delay: 0.1s; }
.sound-wave .bar:nth-child(2) { height: 30px; animation-delay: 0.2s; }
.sound-wave .bar:nth-child(3) { height: 45px; animation-delay: 0.3s; }
.sound-wave .bar:nth-child(4) { height: 25px; animation-delay: 0.4s; }
.sound-wave .bar:nth-child(5) { height: 35px; animation-delay: 0.5s; }
.sound-wave .bar:nth-child(6) { height: 15px; animation-delay: 0.6s; }
.sound-wave .bar:nth-child(7) { height: 30px; animation-delay: 0.7s; }

@keyframes wave {
    0% { transform: scaleY(0.4); opacity: 0.5; }
    100% { transform: scaleY(1.2); opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .hud-core {
        flex-direction: column;
        justify-content: center;
        gap: 30px;
    }
    .panel {
        width: 90%;
        max-width: 600px;
    }
    .reactor-container {
        width: 300px;
        height: 300px;
    }
}
