:root {
    --bg-color: #050505;
    --text-color: #e0e0e0;
    --accent-color: #00f3ff;
    --secondary-accent: #ff003c;
    --terminal-dim: #444;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Courier Prime', 'Courier New', monospace;
    overflow: hidden;
    /* Prevent scrolling for app-like feel */
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: crosshair;
}

#neural-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.6;
}

.interface-container {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    border: 1px solid rgba(0, 243, 255, 0.1);
    background: rgba(5, 5, 5, 0.7);
    backdrop-filter: blur(5px);
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.05);
}

.terminal-header {
    font-size: 0.8rem;
    color: var(--accent-color);
    margin-bottom: 3rem;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.8;
}

.status-dot {
    width: 8px;
    height: 8px;
    background-color: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
    animation: pulse 2s infinite;
}

h1.glitch-text {
    font-size: 4rem;
    font-weight: 700;
    letter-spacing: -2px;
    text-transform: uppercase;
    position: relative;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 0px var(--secondary-accent), -2px -2px 0px var(--accent-color);
    animation: glitch-skew 3s infinite linear alternate-reverse;
}

h1.glitch-text::before,
h1.glitch-text::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

h1.glitch-text::before {
    color: var(--secondary-accent);
    z-index: -1;
    animation: glitch-anim-1 2.5s infinite linear alternate-reverse;
}

h1.glitch-text::after {
    color: var(--accent-color);
    z-index: -2;
    animation: glitch-anim-2 3s infinite linear alternate-reverse;
}

h2.sub-glitch {
    font-size: 1.5rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
    letter-spacing: 2px;
}

.access-panel {
    margin-top: 3rem;
    border-top: 1px solid var(--terminal-dim);
    padding-top: 1.5rem;
}

.access-message {
    font-size: 0.9rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    animation: blink 1.5s step-end infinite;
}

.loader {
    width: 200px;
    height: 4px;
    background: #222;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.loader .bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 30%;
    background: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-color);
    animation: load 2s infinite ease-in-out;
}

.terminal-footer {
    margin-top: 4rem;
    text-align: left;
    font-size: 0.7rem;
    color: #555;
    line-height: 1.5;
}

/* Animations */

@keyframes pulse {
    0% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.5;
    }
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

@keyframes load {
    0% {
        left: -30%;
    }

    100% {
        left: 100%;
    }
}

@keyframes glitch-skew {
    0% {
        transform: skew(0deg);
    }

    20% {
        transform: skew(0deg);
    }

    21% {
        transform: skew(-2deg);
    }

    22% {
        transform: skew(0deg);
    }

    23% {
        transform: skew(2deg);
    }

    24% {
        transform: skew(0deg);
    }

    100% {
        transform: skew(0deg);
    }
}

@keyframes glitch-anim-1 {
    0% {
        clip-path: inset(20% 0 80% 0);
        transform: translate(-2px, 1px);
    }

    20% {
        clip-path: inset(60% 0 10% 0);
        transform: translate(2px, -1px);
    }

    40% {
        clip-path: inset(40% 0 50% 0);
        transform: translate(-2px, 2px);
    }

    60% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(2px, -2px);
    }

    80% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(-1px, 1px);
    }

    100% {
        clip-path: inset(30% 0 30% 0);
        transform: translate(1px, -1px);
    }
}

@keyframes glitch-anim-2 {
    0% {
        clip-path: inset(10% 0 60% 0);
        transform: translate(2px, -1px);
    }

    20% {
        clip-path: inset(80% 0 5% 0);
        transform: translate(-2px, 2px);
    }

    40% {
        clip-path: inset(30% 0 20% 0);
        transform: translate(1px, -2px);
    }

    60% {
        clip-path: inset(15% 0 80% 0);
        transform: translate(-1px, 1px);
    }

    80% {
        clip-path: inset(55% 0 10% 0);
        transform: translate(2px, -1px);
    }

    100% {
        clip-path: inset(40% 0 30% 0);
        transform: translate(-2px, 2px);
    }
}

/* ... Previous keyframes ... */

/* Access Granted Flash */
#flash-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: white;
    opacity: 0;
    pointer-events: none;
    z-index: 100;
    transition: opacity 0.1s ease-out;
}

.flash-active {
    opacity: 1 !important;
}

/* HUD System */
.hidden {
    display: none !important;
}

.hud-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    padding: 2rem;
    display: grid;
    grid-template-columns: 250px 1fr 250px;
    grid-template-rows: 60px 1fr;
    pointer-events: auto;
    /* Enable scrolling and clicking */
}

.hud-header {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 243, 255, 0.3);
    padding-bottom: 1rem;
    background: linear-gradient(90deg, transparent, rgba(0, 243, 255, 0.05), transparent);
}

.hud-logo {
    font-weight: bold;
    letter-spacing: 2px;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.5);
}

.hud-section {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
}

.hud-label {
    color: #666;
}

.hud-value {
    color: var(--text-color);
    font-weight: bold;
}

.hud-value.active {
    color: #0f0;
    text-shadow: 0 0 5px #0f0;
}

.hud-sidebar {
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    opacity: 0;
    transform: translateX(0);
    transition: all 1s ease-out;
}

.slide-in-left {
    animation: slideLeft 1s forwards;
}

.slide-in-right {
    animation: slideRight 1s forwards;
}

.data-block h3 {
    font-size: 0.7rem;
    color: var(--secondary-accent);
    margin-bottom: 0.5rem;
    border-left: 3px solid var(--secondary-accent);
    padding-left: 0.5rem;
}

.binary-scroll {
    font-size: 0.6rem;
    color: #00f3ff;
    opacity: 0.7;
    height: 100px;
    overflow: hidden;
    word-break: break-all;
    line-height: 1.2;
    mask-image: linear-gradient(to bottom, black 50%, transparent 100%);
}

.metrics-list {
    list-style: none;
    font-size: 0.8rem;
}

.metrics-list li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #222;
    padding-bottom: 0.2rem;
}

.dynamic-val {
    color: var(--accent-color);
}

.center-title-overlay {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    opacity: 0;
    animation: fadeIn 2s 1s forwards;
}

.center-title-overlay h1 {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 5px;
    margin-bottom: 1rem;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.center-title-overlay p {
    font-size: 0.9rem;
    letter-spacing: 3px;
    color: var(--accent-color);
}

@keyframes slideLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* Node Grid */
.node-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.node-cell {
    width: 100%;
    aspect-ratio: 1;
    background: rgba(0, 243, 255, 0.1);
    border: 1px solid rgba(0, 243, 255, 0.2);
}

.node-cell.active {
    background: rgba(0, 243, 255, 0.6);
    box-shadow: 0 0 5px var(--accent-color);
}

/* Responsiveness for HUD */
/* Responsiveness for HUD */
@media (max-width: 900px) {
    .hud-container {
        display: flex;
        flex-direction: column;
        padding: 1rem;
        gap: 1.5rem;
        overflow-y: auto;
        overflow-x: hidden;
        height: 100%;
        width: 100vw;
    }

    .hud-header {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
        text-align: center;
        width: 100%;
        margin-bottom: 1rem;
    }

    .hud-section {
        justify-content: center;
        width: 100%;
    }

    .hud-sidebar {
        display: flex;
        width: 100%;
        opacity: 0;
        gap: 1rem;
    }

    .hud-sidebar.left,
    .hud-sidebar.right {
        width: 100%;
    }

    /* Force Title to be visible and small */
    .center-title-overlay {
        position: relative;
        width: 100%;
        margin: 1rem 0;
        text-align: center;
        opacity: 0;
        animation: fadeIn 2s 1s forwards;
        order: -1;
        display: block;
    }

    .center-title-overlay h1 {
        font-size: 1.4rem !important;
        letter-spacing: 1px;
        line-height: 1.2;
        word-wrap: break-word;
        margin-bottom: 0.5rem;
    }

    .center-title-overlay p {
        font-size: 0.7rem;
    }
}

@media (max-width: 600px) {
    h1.glitch-text {
        font-size: 1.8rem;
        word-break: break-all;
    }

    h2.sub-glitch {
        font-size: 0.8rem;
    }

    .interface-container {
        padding: 0.5rem;
        width: 95%;
    }

    .hud-logo {
        font-size: 0.9rem;
    }
}
