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

@font-face {
    font-family: 'Terminal';
    src: local('Courier New'), local('Consolas'), local('monospace');
}

body {
    background: #0c0c0f;
    color: #909098;
    font-family: 'Courier New', Consolas, monospace;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#game-container {
    width: 800px;
    max-width: 95vw;
    border: 1px solid #404050;
    background: #101015;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#header {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #252525;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#title {
    color: #70a070;
}

#stats {
    display: flex;
    gap: 20px;
}

#stats span {
    color: #8090a0;
}

#stability-display.warning {
    color: #d0a030;
}

#stability-display.critical {
    color: #e04040;
}

#terminal {
    background: #080808;
    border: 1px solid #1a1a1a;
    margin: 8px;
    position: relative;
    width: 768px;
    height: 576px;
    max-width: calc(100% - 16px);
}

#game-canvas {
    display: block;
    image-rendering: pixelated;
}

#footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid #252525;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#controls {
    color: #606878;
}

#message {
    color: #8090a0;
    min-width: 200px;
    text-align: right;
}

#message.success {
    color: #40c060;
}

#message.warning {
    color: #d0a030;
}

#message.error {
    color: #e04040;
}

/* Overlay */
#overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(8, 8, 12, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

#overlay.hidden {
    display: none;
}

#overlay-content {
    text-align: center;
    border: 1px solid #405060;
    padding: 40px 60px;
    background: #101018;
}

#overlay-title {
    font-size: 32px;
    font-weight: normal;
    color: #50c050;
    letter-spacing: 8px;
    margin-bottom: 20px;
}

#overlay-text {
    color: #7080a0;
    font-size: 12px;
    line-height: 2;
    margin-bottom: 30px;
    letter-spacing: 1px;
}

#start-btn {
    background: transparent;
    border: 1px solid #50a050;
    color: #60c060;
    padding: 10px 30px;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.2s;
}

#start-btn:hover {
    border-color: #70d070;
    color: #90ff90;
}

/* Scanline effect */
#terminal::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    opacity: 0.3;
}

/* Screen flicker animation */
@keyframes flicker {
    0%, 100% { opacity: 1; }
    92% { opacity: 1; }
    93% { opacity: 0.8; }
    94% { opacity: 1; }
}

#terminal {
    animation: flicker 8s infinite;
}
