/* Specific Terminal Mini-Game Styles */
.game-body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    background-color: #05080f;
    /* Deep radar black */
    color: #39ff80;
    /* Terminal green override */
    font-family: 'Space Mono', 'Courier New', monospace;
}

/* CRT Arcade Monitor Curvature */
.arcade-screen {
    position: relative;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background-color: #05080f;
    /* Bulge illusion */
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.9);
}

.arcade-screen::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: 2;
    background-size: 100% 4px, 6px 100%;
    pointer-events: none;
}

.arcade-screen::after {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: radial-gradient(circle, rgba(0, 0, 0, 0) 60%, rgba(0, 0, 0, 0.6) 100%);
    z-index: 3;
    pointer-events: none;
}

/* CRT Scanline Effect & Barrel Distortion */
.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 100;
    pointer-events: none;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%,
            rgba(0, 0, 0, 0.25) 50%);
    background-size: 100% 4px;
    opacity: 0.6;
    animation: flicker 0.15s infinite;
}

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

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.95;
    }
}

#gameCanvas {
    display: block;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    transform: scale(1.02);
    /* Slight scale to hide edges during bulge */
}

#game-ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
}

/* HUD Styling */
.hud-top {
    display: flex;
    justify-content: space-between;
    padding: 20px 40px;
    font-size: 1.2rem;
    font-weight: bold;
    text-shadow: 0 0 5px rgba(57, 255, 128, 0.7);
    border-bottom: 1px solid rgba(57, 255, 128, 0.3);
    background: linear-gradient(to bottom, rgba(5, 8, 15, 0.9), transparent);
}

.phantom-label {
    color: #ffb000;
    text-shadow: 0 0 5px rgba(255, 176, 0, 0.7);
    letter-spacing: 2px;
}

.hud-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.text-blink {
    animation: blink 2s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.3;
    }
}

/* HUD Bottom */
.hud-bottom {
    position: absolute;
    bottom: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 20px 40px;
    background: linear-gradient(to top, rgba(5, 8, 15, 0.9), transparent);
}

.radar-scan {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Overlay Menus */
.overlay-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    background: rgba(5, 8, 15, 0.85);
    border: 1px solid #39ff80;
    padding: 40px 60px;
    box-shadow: 0 0 20px rgba(57, 255, 128, 0.15);
    backdrop-filter: blur(5px);
    display: none;
    pointer-events: auto;
}

.overlay-panel.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.glitch {
    font-size: 3rem;
    font-weight: bold;
    letter-spacing: 5px;
    margin: 0;
    color: #39ff80;
    text-shadow: 2px 2px rgba(0, 212, 232, 0.5), -2px -2px rgba(255, 53, 53, 0.5);
}

.critical {
    font-size: 3rem;
    color: #ff3535;
    text-shadow: 0 0 10px rgba(255, 53, 53, 0.5);
    margin: 0;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.8;
}

.controls-info {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 20px 0;
    text-align: left;
    border-left: 2px solid #39ff80;
    padding-left: 15px;
    line-height: 1.6;
}

.terminal-btn {
    background: rgba(5, 8, 15, 0.9);
    color: #39ff80;
    border: 1px solid #39ff80;
    padding: 12px 24px;
    font-family: inherit;
    font-size: 1.1rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.2s;
    letter-spacing: 2px;
    pointer-events: auto;
    text-decoration: none;
    display: inline-block;
}

.terminal-btn:hover {
    background: rgba(57, 255, 128, 0.15);
    box-shadow: 0 0 15px rgba(57, 255, 128, 0.4);
}

.back-btn {
    font-size: 0.9rem;
    padding: 8px 16px;
}