@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&family=VT323&display=swap');

:root {
    --primary: #7C3AED;
    --secondary: #A78BFA;
    --action: #F43F5E;
    --bg: #0F0F23;
    --text: #E2E8F0;
    --glass: rgba(15, 15, 35, 0.8);
    --neon-shadow: 0 0 10px var(--primary), 0 0 20px rgba(124, 58, 237, 0.5);
    --crt-line: rgba(18, 16, 16, 0.1);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: 'VT323', monospace;
    overflow: hidden;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    max-width: 1280px;
    max-height: 720px;
    background: #000;
    border: 4px solid var(--primary);
    box-shadow: var(--neon-shadow);
    overflow: hidden;
}

canvas {
    image-rendering: pixelated;
    width: 100%;
    height: 100%;
}

/* UI Components */
.hud {
    position: absolute;
    pointer-events: none;
    width: 100%;
    height: 100%;
    z-index: 10;
}

.stat-bar-container {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--glass);
    padding: 10px;
    border: 2px solid var(--secondary);
    backdrop-filter: blur(5px);
}

.stat-bar {
    width: 200px;
    height: 15px;
    background: #333;
    border: 1px solid #555;
    margin-bottom: 8px;
    position: relative;
}

.stat-fill {
    height: 100%;
    transition: width 0.3s ease-out;
}

.hp-fill { background: var(--action); box-shadow: 0 0 10px var(--action); }
.energy-fill { background: var(--secondary); box-shadow: 0 0 10px var(--secondary); }

.label {
    font-family: 'Press Start 2P', cursive;
    font-size: 8px;
    margin-bottom: 4px;
    display: block;
}

.dialog-box {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 120px;
    background: var(--glass);
    border: 2px solid var(--primary);
    padding: 20px;
    display: none;
}

.dialog-text {
    font-size: 24px;
    line-height: 1.4;
    color: var(--text);
}

/* CRT EFFECTS */
#game-container::before {
    content: " ";
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(var(--crt-line) 50%, rgba(255, 255, 255, 0.02) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 100;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

#game-container::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: 101;
    pointer-events: none;
    animation: flicker 0.15s infinite;
}

@keyframes flicker {
    0% { opacity: 0.1; }
    50% { opacity: 0.2; }
    100% { opacity: 0.1; }
}

.cursor-pointer { cursor: pointer !important; }

/* Menus */
.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--glass);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.btn {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 15px 40px;
    font-family: 'Press Start 2P', cursive;
    font-size: 16px;
    margin: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn:hover {
    background: var(--primary);
    color: var(--text);
    box-shadow: var(--neon-shadow);
}
