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

body {
    background: #0a0a0a;
    overflow: hidden;
    font-family: 'Press Start 2P', monospace;
}

#game-container {
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, #1a0000 0%, #0d0d0d 50%, #0a0505 100%);
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
}

/* Hide cursor only during active gameplay */
body.game-active {
    cursor: none;
}

/* HUD Styling */
#hud {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    padding: 15px 30px;
    background: linear-gradient(180deg, rgba(50, 20, 20, 0.9) 0%, rgba(30, 10, 10, 0.95) 100%);
    border: 3px solid #8b0000;
    border-radius: 5px;
    box-shadow: 
        0 0 20px rgba(139, 0, 0, 0.5),
        inset 0 0 30px rgba(0, 0, 0, 0.5);
    z-index: 100;
}

#health-container, #ammo-container, #kills-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

#health-icon {
    font-size: 24px;
    color: #ff0000;
    text-shadow: 0 0 10px #ff0000;
    animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

#health-bar {
    width: 150px;
    height: 20px;
    background: #1a0000;
    border: 2px solid #8b0000;
    border-radius: 3px;
    overflow: hidden;
}

#health-fill {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #8b0000, #ff0000, #ff4444);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px #ff0000 inset;
}

#health-text, #ammo-text, #kills-text {
    color: #ff6666;
    font-size: 16px;
    text-shadow: 2px 2px 0 #000;
    min-width: 40px;
}

#ammo-icon {
    font-size: 20px;
    color: #ffcc00;
    text-shadow: 0 0 10px #ffcc00;
}

#ammo-text {
    color: #ffcc00;
}

#kills-icon {
    font-size: 22px;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

#kills-text {
    color: #00ff00;
}

/* Weapon */
#weapon {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 200px;
    z-index: 50;
    pointer-events: none;
}

#weapon-sprite {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%,
        #2a2a2a 30%,
        #1a1a1a 40%,
        #333333 50%,
        #1a1a1a 60%,
        #2a2a2a 70%,
        transparent 100%
    );
    clip-path: polygon(
        35% 100%,
        35% 70%,
        40% 60%,
        40% 40%,
        45% 30%,
        45% 20%,
        48% 15%,
        52% 15%,
        55% 20%,
        55% 30%,
        60% 40%,
        60% 60%,
        65% 70%,
        65% 100%
    );
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.8));
    transition: transform 0.05s ease;
}

#weapon.shooting #weapon-sprite {
    transform: translateY(-10px);
}

#muzzle-flash {
    position: absolute;
    top: 10%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle, #ffff00 0%, #ff8800 40%, transparent 70%);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
}

#weapon.shooting #muzzle-flash {
    animation: flash 0.1s ease-out;
}

@keyframes flash {
    0% { opacity: 1; transform: translateX(-50%) scale(1.5); }
    100% { opacity: 0; transform: translateX(-50%) scale(0.5); }
}

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #00ff00;
    font-size: 30px;
    text-shadow: 0 0 5px #00ff00;
    z-index: 100;
    pointer-events: none;
    opacity: 0.8;
}

/* Damage Overlay */
#damage-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at center, transparent 0%, rgba(255, 0, 0, 0.5) 100%);
    opacity: 0;
    pointer-events: none;
    z-index: 90;
    transition: opacity 0.1s ease;
}

#damage-overlay.active {
    animation: damage 0.3s ease-out;
}

@keyframes damage {
    0% { opacity: 0.7; }
    100% { opacity: 0; }
}

/* Start Screen */
#start-screen, #game-over-screen, #win-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(180deg, 
        rgba(20, 0, 0, 0.95) 0%, 
        rgba(10, 0, 0, 0.98) 50%,
        rgba(30, 0, 0, 0.95) 100%
    );
    z-index: 200;
}

#start-screen h1, #game-over-screen h1, #win-screen h1 {
    font-size: 64px;
    color: #ff0000;
    text-shadow: 
        0 0 20px #ff0000,
        0 0 40px #880000,
        4px 4px 0 #000;
    margin-bottom: 10px;
    animation: titleGlow 2s ease-in-out infinite;
}

@keyframes titleGlow {
    0%, 100% { text-shadow: 0 0 20px #ff0000, 0 0 40px #880000, 4px 4px 0 #000; }
    50% { text-shadow: 0 0 40px #ff0000, 0 0 80px #880000, 4px 4px 0 #000; }
}

.subtitle {
    font-size: 14px;
    color: #888;
    margin-bottom: 40px;
}

/* Language selection */
#lang-container {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 200;
}

#lang-toggle {
    width: 50px;
    height: 50px;
    font-size: 24px;
    background: rgba(30, 10, 10, 0.9);
    border: 2px solid #8b0000;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
}

#lang-toggle:hover {
    background: rgba(60, 20, 20, 0.9);
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

#language-select {
    position: absolute;
    bottom: 60px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    background: rgba(20, 5, 5, 0.95);
    border: 2px solid #8b0000;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

#language-select.hidden {
    display: none;
}

.lang-btn {
    padding: 10px 15px;
    font-family: 'Press Start 2P', monospace;
    font-size: 10px;
    color: #888;
    background: rgba(30, 10, 10, 0.8);
    border: 2px solid #555;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.lang-btn:hover {
    color: #fff;
    border-color: #888;
    background: rgba(50, 20, 20, 0.9);
}

.lang-btn.active {
    color: #fff;
    border-color: #ff0000;
    background: rgba(80, 20, 20, 0.9);
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.instructions {
    margin-bottom: 40px;
    text-align: center;
}

.instructions p {
    color: #aaa;
    font-size: 12px;
    margin: 10px 0;
    text-shadow: 1px 1px 0 #000;
}

#start-btn, #restart-btn, #win-restart-btn, #gameover-menu-btn {
    padding: 20px 40px;
    font-family: 'Press Start 2P', monospace;
    font-size: 18px;
    color: #fff;
    background: linear-gradient(180deg, #8b0000 0%, #5c0000 100%);
    border: 3px solid #ff0000;
    border-radius: 5px;
    cursor: pointer;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.3),
        0 5px 0 #3c0000;
    transition: all 0.1s ease;
}

#start-btn:hover, #restart-btn:hover, #win-restart-btn:hover, #gameover-menu-btn:hover {
    background: linear-gradient(180deg, #aa0000 0%, #770000 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 0 30px rgba(255, 0, 0, 0.5),
        0 7px 0 #3c0000;
}

#start-btn:active, #restart-btn:active, #win-restart-btn:active, #gameover-menu-btn:active {
    transform: translateY(3px);
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.3),
        0 2px 0 #3c0000;
}

#support-link {
    margin-top: 20px;
    padding: 10px 12px;
    border: 1px solid #633333;
    border-radius: 5px;
    background: #210d0d;
    color: #d3aaaa;
    font-size: 10px;
    line-height: 1.5;
    text-decoration: none;
}

#support-link:hover,
#support-link:focus-visible {
    border-color: #b65b5b;
    background: #381515;
    color: #fff;
}

.hidden {
    display: none !important;
}

/* Minimap */
#minimap {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #8b0000;
    border-radius: 5px;
    z-index: 100;
}

/* Win Screen */
#win-screen h1 {
    color: #00ff00 !important;
    text-shadow: 
        0 0 20px #00ff00,
        0 0 40px #008800,
        4px 4px 0 #000 !important;
}

#win-screen p {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 30px;
}

#game-over-screen p {
    color: #aaa;
    font-size: 14px;
    margin-bottom: 30px;
}

#game-over-screen button {
    margin: 10px;
    min-width: 350px;
}

.menu-btn {
    background: linear-gradient(180deg, #555 0%, #333 100%) !important;
    border-color: #888 !important;
    box-shadow: 
        0 0 10px rgba(100, 100, 100, 0.3),
        0 5px 0 #222 !important;
}

.menu-btn:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%) !important;
}

/* Pause screen */
#pause-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.85);
    z-index: 200;
}

#pause-screen h1 {
    font-size: 48px;
    color: #ffcc00;
    text-shadow: 
        0 0 20px #ffcc00,
        0 0 40px #ff8800,
        4px 4px 0 #000;
    margin-bottom: 20px;
}

#pause-screen p {
    color: #888;
    font-size: 12px;
    margin-bottom: 30px;
}

#pause-screen button {
    padding: 15px 30px;
    margin: 10px;
    font-family: 'Press Start 2P', monospace;
    font-size: 14px;
    color: #fff;
    background: linear-gradient(180deg, #8b0000 0%, #5c0000 100%);
    border: 3px solid #ff0000;
    border-radius: 5px;
    cursor: pointer;
    text-shadow: 2px 2px 0 #000;
    box-shadow: 
        0 0 20px rgba(255, 0, 0, 0.3),
        0 5px 0 #3c0000;
    transition: all 0.1s ease;
}

#pause-screen button:hover {
    background: linear-gradient(180deg, #aa0000 0%, #770000 100%);
    transform: translateY(-2px);
}

#quit-btn {
    background: linear-gradient(180deg, #555 0%, #333 100%) !important;
    border-color: #888 !important;
    box-shadow: 
        0 0 10px rgba(100, 100, 100, 0.3),
        0 5px 0 #222 !important;
}

#quit-btn:hover {
    background: linear-gradient(180deg, #666 0%, #444 100%) !important;
}

/* Mute button */
#mute-btn {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 50px;
    height: 50px;
    font-size: 24px;
    background: rgba(30, 10, 10, 0.9);
    border: 2px solid #8b0000;
    border-radius: 5px;
    cursor: pointer;
    z-index: 100;
    transition: all 0.2s ease;
}

#mute-btn:hover {
    background: rgba(60, 20, 20, 0.9);
    border-color: #ff0000;
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* Scanlines effect */
#game-container::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 3px
    );
    pointer-events: none;
    z-index: 150;
}

