@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap');

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

body {
    background: #000;
    color: #00ff00;
    font-family: 'Courier Prime', monospace;
    overflow: hidden;
    user-select: none;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(ellipse at center, #111 0%, #000 100%);
}

#canvas {
    border: 2px solid #00ff00;
    background: #000;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    box-shadow: 
        0 0 20px #00ff00,
        inset 0 0 20px rgba(0, 255, 0, 0.1);
}

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

#mini-map {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 120px;
    height: 120px;
}

#status-panel {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    padding: 10px;
    min-width: 200px;
    font-family: 'Courier Prime', monospace;
}

#health-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

#health-bar span {
    margin-left: 10px;
    font-size: 12px;
    color: #00ff00;
}

#health-fill {
    width: 100px;
    height: 8px;
    background: linear-gradient(to right, #ff0000 0%, #ffff00 50%, #00ff00 100%);
    border: 1px solid #00ff00;
    position: relative;
}

#health-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        90deg,
        transparent 0px,
        transparent 8px,
        rgba(0, 0, 0, 0.3) 8px,
        rgba(0, 0, 0, 0.3) 10px
    );
}

#stats {
    font-size: 12px;
    line-height: 1.4;
}

#stats div {
    margin-bottom: 3px;
    text-shadow: 1px 1px 0px #000;
}

#controls-help {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.8);
    border: 1px solid #00ff00;
    padding: 8px;
    font-size: 10px;
    color: #00ff00;
    font-family: 'Courier Prime', monospace;
}

#message-display {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    text-shadow: 2px 2px 0px #000;
    pointer-events: none;
}

#controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    pointer-events: auto;
}

#controls button {
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid #00ff00;
    color: #00ff00;
    padding: 10px 15px;
    font-family: 'Courier Prime', monospace;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.1s;
    min-width: 50px;
}

#controls button:hover {
    background: rgba(0, 255, 0, 0.1);
    box-shadow: 0 0 10px #00ff00;
    transform: scale(1.05);
}

#controls button:active {
    transform: scale(0.95);
    background: rgba(0, 255, 0, 0.2);
}

/* CRT Monitor Effect */
#canvas::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        transparent 0px,
        transparent 2px,
        rgba(0, 0, 0, 0.1) 2px,
        rgba(0, 0, 0, 0.1) 4px
    );
    pointer-events: none;
    z-index: 1;
}

/* Retro glow effects */
@keyframes glow {
    0%, 100% { 
        filter: brightness(1) saturate(1);
        text-shadow: 0 0 5px currentColor;
    }
    50% { 
        filter: brightness(1.1) saturate(1.2);
        text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
    }
}

#status-panel, #controls-help {
    animation: glow 3s ease-in-out infinite;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #canvas {
        width: 100vw !important;
        height: 100vh !important;
        border: none;
    }
    
    #status-panel {
        font-size: 10px;
        padding: 5px;
        min-width: 150px;
    }
    
    #controls-help {
        font-size: 8px;
        padding: 4px;
    }
    
    #controls {
        bottom: 10px;
        right: 10px;
    }
    
    #controls button {
        padding: 8px 10px;
        font-size: 12px;
        min-width: 40px;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    #canvas {
        border-color: #fff;
        box-shadow: 0 0 20px #fff;
    }
    
    #status-panel, #controls-help {
        border-color: #fff;
        color: #fff;
    }
    
    #controls button {
        border-color: #fff;
        color: #fff;
    }
}