:root {
    --bg-color: #050505;
    --panel-bg: rgba(10, 15, 12, 0.9);
    --accent-digital: #32ff7e;
    /* Retro Terminal Green */
    --accent-analog: #ff9f1a;
    --accent-embedded: #18dcff;
    --text-primary: #32ff7e;
    --text-secondary: #25a153;
    --border-glow: rgba(50, 255, 126, 0.3);
    --font-mono: 'JetBrains Mono', monospace;
    --font-sans: 'Outfit', sans-serif;
}

body {
    background-color: #000;
    color: var(--text-primary);
    font-family: var(--font-mono);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

/* CRT Effects */
.crt::before {
    content: " ";
    display: block;
    position: absolute;
    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));
    z-index: 201;
    background-size: 100% 2px, 3px 100%;
    pointer-events: none;
}

.crt::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: rgba(18, 16, 16, 0.1);
    opacity: 0;
    z-index: 202;
    pointer-events: none;
    animation: flicker 0.15s infinite, screen-power 0.4s ease-out;
}

@keyframes screen-power {
    0% {
        transform: scaleY(0.001) scaleX(0);
        opacity: 0;
    }

    50% {
        transform: scaleY(0.001) scaleX(1);
        opacity: 1;
    }

    100% {
        transform: scaleY(1) scaleX(1);
        opacity: 1;
    }
}

@keyframes flicker {
    0% {
        opacity: 0.27861;
    }

    5% {
        opacity: 0.34769;
    }

    10% {
        opacity: 0.23604;
    }

    15% {
        opacity: 0.90626;
    }

    20% {
        opacity: 0.18128;
    }

    25% {
        opacity: 0.83891;
    }

    30% {
        opacity: 0.65583;
    }

    35% {
        opacity: 0.57807;
    }

    40% {
        opacity: 0.26559;
    }

    45% {
        opacity: 0.84693;
    }

    50% {
        opacity: 0.96019;
    }

    55% {
        opacity: 0.08594;
    }

    60% {
        opacity: 0.20313;
    }

    65% {
        opacity: 0.71988;
    }

    70% {
        opacity: 0.53455;
    }

    75% {
        opacity: 0.37288;
    }

    80% {
        opacity: 0.71428;
    }

    85% {
        opacity: 0.70419;
    }

    90% {
        opacity: 0.7003;
    }

    95% {
        opacity: 0.36108;
    }

    100% {
        opacity: 0.24387;
    }
}

.screen-container {
    width: 100vw;
    height: 100vh;
    background: radial-gradient(circle, #1a1a1a 0%, #000 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    perspective: 1000px;
}

#app {
    width: 95%;
    height: 95%;
    border-radius: 50px;
    background: #000;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5), 0 0 50px rgba(50, 255, 126, 0.1);
    border: 20px solid #1a1a1a;
}


/* Loader Styles */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease;
    z-index: 100;
}

.hidden {
    display: none !important;
    opacity: 0;
}

.terminal-loader {
    width: 80%;
    max-width: 800px;
    height: auto;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
}

.boot-menu {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.boot-menu.visible {
    opacity: 1;
    transform: translateY(0);
}

.menu-item {
    font-size: 1.5rem;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
    opacity: 0;
    transform: translateX(-10px);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}


.menu-item.slide-in {
    opacity: 1;
    transform: translateX(0);
}

.menu-item:nth-child(1) {
    transition-delay: 0.1s;
}

.menu-item:nth-child(2) {
    transition-delay: 0.2s;
}

.menu-item:nth-child(3) {
    transition-delay: 0.3s;
}

.menu-item:nth-child(4) {
    transition-delay: 0.4s;
}


.menu-item.active {
    background: var(--accent-digital);
    color: #000;
    box-shadow: 0 0 20px var(--accent-digital);
}

.menu-item:hover {
    border-color: var(--accent-digital);
}

.boot-header {
    border-bottom: 2px solid var(--accent-digital);
    padding-bottom: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.glitch {
    position: relative;
    text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
        -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
        0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    animation: glitch 500ms infinite;
}

@keyframes glitch {
    0% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
            -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
            0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }

    14% {
        text-shadow: 0.05em 0 0 rgba(255, 0, 0, 0.75),
            -0.025em -0.05em 0 rgba(0, 255, 0, 0.75),
            0.025em 0.05em 0 rgba(0, 0, 255, 0.75);
    }

    15% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
            0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
            -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }

    49% {
        text-shadow: -0.05em -0.025em 0 rgba(255, 0, 0, 0.75),
            0.025em 0.025em 0 rgba(0, 255, 0, 0.75),
            -0.05em -0.05em 0 rgba(0, 0, 255, 0.75);
    }

    50% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
            0.05em 0 0 rgba(0, 255, 0, 0.75),
            0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }

    99% {
        text-shadow: 0.025em 0.05em 0 rgba(255, 0, 0, 0.75),
            0.05em 0 0 rgba(0, 255, 0, 0.75),
            0 -0.05em 0 rgba(0, 0, 255, 0.75);
    }

    100% {
        text-shadow: -0.025em 0 0 rgba(255, 0, 0, 0.75),
            -0.025em -0.025em 0 rgba(0, 255, 0, 0.75),
            -0.025em -0.05em 0 rgba(0, 0, 255, 0.75);
    }
}

.console-logo {
    font-size: 3rem;
    font-weight: 900;
    letter-spacing: -2px;
    font-family: var(--font-sans);
    color: var(--accent-digital);
}



.terminal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.red {
    background: #ff5f56;
}

.yellow {
    background: #ffbd2e;
}

.green {
    background: #27c93f;
}

.terminal-title {
    margin-left: 10px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.terminal-content {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    line-height: 1.6;
}

.terminal-content p {
    margin-bottom: 8px;
    color: var(--accent-digital);
}

.glitch-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: transparent;
    border: 1px solid var(--accent-digital);
    color: var(--accent-digital);
    font-family: var(--font-mono);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.glitch-btn:hover {
    background: var(--accent-digital);
    color: var(--bg-color);
    box-shadow: 0 0 20px var(--accent-digital);
}

/* Game Styles */
#game-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

#ui-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.hud-top {
    display: flex;
    gap: 20px;
}

.status-panel {
    background: var(--panel-bg);
    padding: 10px 20px;
    border-left: 3px solid var(--accent-digital);
    backdrop-filter: blur(5px);
}

.status-panel .label {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.status-panel .value {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--accent-digital);
    transition: all 0.5s ease;
}

.value.critical {
    color: #ff5f56;
    text-shadow: 0 0 10px #ff5f56;
}


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

@keyframes pulse-glow {
    0% {
        opacity: 0.7;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.7;
    }
}

.instructions {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.key {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid var(--text-secondary);
    border-radius: 4px;
    margin: 0 4px;
}

#interaction-prompt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    padding: 15px 30px;
    border-radius: 5px;
    border: 1px solid var(--accent-digital);
    font-family: var(--font-mono);
    color: var(--accent-digital);
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 210;
}

.modal-content {
    background: var(--bg-color);
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    border: 1px solid var(--accent-digital);
    position: relative;
    padding: 40px;
    overflow-y: auto;
    box-shadow: 0 0 50px rgba(0, 242, 255, 0.15);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 2rem;
    cursor: pointer;
}

.close-modal:hover {
    color: var(--accent-digital);
}

.connect .modal-title {
    color: var(--accent-digital);
}

.ascii-art {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.2;
    color: var(--accent-digital);
    margin: 20px 0;
    white-space: pre;
    text-align: center;
}

.arm {
    display: inline-block;
    transform-origin: bottom left;
    animation: wave 1s infinite alternate ease-in-out;
}

@keyframes wave {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(-30deg);
    }
}

.terminal-text {
    border-left: 3px solid var(--accent-digital);
    padding-left: 20px;
    margin-top: 30px;
    line-height: 1.8;
}
/* Content Styles within Modal */
.modal-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    color: var(--accent-digital);
    font-family: var(--font-sans);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.skill-tag {
    display: inline-block;
    padding: 5px 12px;
    background: rgba(0, 242, 255, 0.1);
    border: 1px solid var(--accent-digital);
    border-radius: 20px;
    margin: 5px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
}

.analog .modal-title {
    color: var(--accent-analog);
}

.analog .skill-tag {
    border-color: var(--accent-analog);
    color: var(--accent-analog);
    background: rgba(255, 204, 0, 0.1);
}

.embedded .modal-title {
    color: var(--accent-embedded);
}

.embedded .skill-tag {
    border-color: var(--accent-embedded);
    color: var(--accent-embedded);
    background: rgba(57, 255, 20, 0.1);
}