body {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow: hidden;
}

#gameContainer {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    border: 2px solid #333;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

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

/* Enable pointer events for interactive UI elements */
#ui-overlay .weapon-selection-overlay,
#ui-overlay .game-over,
#ui-overlay .weapon-discovery-notification,
#ui-overlay .weapon-unlock-notification,
#ui-overlay .weapon-slot-unlock-notification {
    pointer-events: auto;
}

.hud {
    position: absolute;
    color: white;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    font-size: 18px;
    user-select: none;
}

.hud-top-left {
    top: 20px;
    left: 20px;
}

.hud-top-right {
    top: 20px;
    right: 20px;
    text-align: right;
}

.health-bar {
    width: 200px;
    height: 20px;
    background-color: #333;
    border: 2px solid #555;
    margin-top: 5px;
    position: relative;
}

.health-fill {
    height: 100%;
    background-color: #4f4;
    transition: width 0.3s ease;
    box-shadow: 0 0 8px rgba(68, 255, 68, 0.6);
}

.health-fill.low-health {
    background-color: #f44;
    animation: health-pulse 0.8s infinite;
    box-shadow: 0 0 15px rgba(255, 68, 68, 0.8);
}

@keyframes health-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.xp-bar {
    width: 200px;
    height: 15px;
    background-color: #333;
    border: 2px solid #555;
    margin-top: 10px;
    position: relative;
}

.xp-fill {
    height: 100%;
    background-color: #44f;
    transition: width 0.3s ease;
    box-shadow: 0 0 6px rgba(68, 68, 255, 0.5);
}

.xp-fill.gaining-xp {
    animation: xp-glow 0.5s ease-out;
}

@keyframes xp-glow {
    0% { 
        box-shadow: 0 0 6px rgba(68, 68, 255, 0.5);
        background-color: #44f;
    }
    50% {
        box-shadow: 0 0 20px rgba(68, 68, 255, 1);
        background-color: #66f;
    }
    100% {
        box-shadow: 0 0 6px rgba(68, 68, 255, 0.5);
        background-color: #44f;
    }
}

.game-over {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    padding: 40px;
    border: 2px solid #666;
    text-align: center;
    display: none;
    pointer-events: auto;
}

.game-over h2 {
    color: #f44;
    font-size: 36px;
    margin: 0 0 20px 0;
}

.game-over p {
    color: white;
    font-size: 20px;
    margin: 10px 0;
}

.game-over button {
    margin-top: 20px;
    padding: 10px 30px;
    font-size: 18px;
    background-color: #444;
    color: white;
    border: 2px solid #666;
    cursor: pointer;
    transition: all 0.3s;
}

.game-over button:hover {
    background-color: #555;
    border-color: #888;
}

.damage-number {
    position: absolute;
    color: #ff0;
    font-size: 24px;
    font-weight: bold;
    pointer-events: none;
    animation: float-up 1s ease-out forwards;
}

@keyframes float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    20% {
        transform: translateY(-10px) scale(1.1);
    }
    100% {
        opacity: 0;
        transform: translateY(-50px) scale(0.8);
    }
}

/* Enhanced HUD animations */
.hud {
    transition: all 0.3s ease;
}

.hud.updating {
    transform: scale(1.02);
}

/* Score popup animation */
.score-popup {
    position: absolute;
    color: #ffd700;
    font-size: 20px;
    font-weight: bold;
    pointer-events: none;
    animation: score-popup 1.5s ease-out forwards;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes score-popup {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.8);
    }
    30% {
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
    }
}

/* Critical damage numbers */
.damage-number.critical {
    color: #ff0;
    font-size: 32px;
    animation: critical-float-up 1.2s ease-out forwards;
    text-shadow: 0 0 10px #ff0, 2px 2px 4px rgba(0, 0, 0, 0.8);
}

@keyframes critical-float-up {
    0% {
        opacity: 1;
        transform: translateY(0) scale(0.5) rotate(-5deg);
    }
    20% {
        transform: translateY(-15px) scale(1.3) rotate(5deg);
    }
    100% {
        opacity: 0;
        transform: translateY(-80px) scale(1) rotate(0deg);
    }
}

/* Button hover effects for debug panel */
.debug-button {
    background-color: #444;
    color: white;
    border: 2px solid #666;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.debug-button:hover {
    background-color: #555;
    border-color: #888;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.debug-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Level up announcement */
.level-up-announcement {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #4f4;
    font-size: 48px;
    font-weight: bold;
    animation: level-up-announce 2.5s ease-out forwards;
    text-shadow: 0 0 20px #4f4, 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

@keyframes level-up-announce {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.3) rotate(-10deg);
    }
    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1.2) rotate(5deg);
    }
    80% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1) rotate(0deg);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.8) rotate(0deg);
    }
}

/* Wave announcement */
.wave-announcement {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff8c00;
    font-size: 36px;
    font-weight: bold;
    animation: wave-announce 2s ease-out forwards;
    text-shadow: 0 0 15px #ff8c00, 2px 2px 4px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

@keyframes wave-announce {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) translateX(-100px);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -50%) translateX(0);
    }
    70% {
        opacity: 1;
        transform: translate(-50%, -50%) translateX(0);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -50%) translateX(100px);
    }
}

/* Weapon pickup notification */
.weapon-pickup-notification {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: #ffd700;
    padding: 10px 20px;
    border: 2px solid #ffd700;
    border-radius: 5px;
    font-size: 18px;
    font-weight: bold;
    animation: weapon-pickup-notify 3s ease-out forwards;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    pointer-events: none;
}

@keyframes weapon-pickup-notify {
    0% {
        opacity: 0;
        transform: translateX(-50%) translateY(50px) scale(0.8);
    }
    20% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1.1);
    }
    80% {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
}

/* Debug Panel Styles */
.debug-panel {
    position: fixed;
    top: 120px;
    left: 20px;
    width: 250px;
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: #00ff00;
    z-index: 1000;
    display: none;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.debug-panel.visible {
    display: block;
}

.debug-panel-header {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    font-size: 14px;
}

.debug-panel-section {
    margin-bottom: 15px;
}

.debug-speed-toggle {
    width: 100%;
    padding: 8px;
    background: #003300;
    color: #00ff00;
    border: 1px solid #00ff00;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.debug-speed-toggle:hover {
    background: #006600;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.debug-speed-toggle.active {
    background: #006600;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.8);
}

.debug-stats {
    margin-bottom: 10px;
}

.debug-stats-item {
    margin-bottom: 5px;
}

.debug-speed-display {
    color: #00ff00;
}

.debug-speed-display.active {
    color: #ffff00;
}

.debug-weapons-container {
    margin-bottom: 15px;
    padding: 10px;
    border: 1px solid #00ff00;
    border-radius: 4px;
}

.debug-weapons-header {
    text-align: center;
    margin-bottom: 8px;
    font-weight: bold;
    color: #ffff00;
}

.debug-weapons-list {
    font-size: 11px;
    line-height: 1.4;
}

.debug-weapon-item {
    margin-bottom: 6px;
    padding: 4px;
    background: rgba(0, 255, 0, 0.1);
    border-radius: 3px;
}

.debug-weapon-name {
    font-weight: bold;
    color: #ffff00;
}

.debug-weapon-stats {
    color: #aaffaa;
    font-size: 10px;
}

.debug-controls {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px solid #00ff00;
}

.debug-button {
    width: 100%;
    padding: 6px;
    border: 1px solid;
    border-radius: 4px;
    font-family: inherit;
    font-size: 11px;
    cursor: pointer;
    margin-bottom: 5px;
}

.debug-button-enemies {
    background: #330000;
    color: #ff6666;
    border-color: #ff6666;
}

.debug-button-xp {
    background: #000033;
    color: #6666ff;
    border-color: #6666ff;
}

.debug-button-heal {
    background: #003300;
    color: #66ff66;
    border-color: #66ff66;
}

.debug-button-magnet {
    background: #330033;
    color: #ff66ff;
    border-color: #ff66ff;
}

/* Weapon Slots HUD */
.hud-weapon-slots {
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.7);
    padding: 15px;
    border: 2px solid #444;
    border-radius: 8px;
    backdrop-filter: blur(5px);
}

.weapon-slots-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: bold;
}

.weapon-slots-container {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 320px;
}

.weapon-slot {
    width: 50px;
    height: 50px;
    border: 2px solid #555;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s ease;
}

.weapon-slot.filled {
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    border-color: #666;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.1);
}

.weapon-slot.empty {
    background: rgba(0, 0, 0, 0.3);
    border-color: #333;
    border-style: dashed;
}

.weapon-slot-icon {
    font-size: 20px;
    margin-bottom: 2px;
}

.weapon-slot.filled .weapon-slot-icon {
    filter: drop-shadow(0 0 4px rgba(255, 255, 255, 0.3));
}

.weapon-slot.empty .weapon-slot-icon {
    color: #666;
    font-size: 16px;
}

.weapon-slot-level {
    font-size: 10px;
    font-weight: bold;
    color: #4CAF50;
    background: rgba(76, 175, 80, 0.2);
    border-radius: 8px;
    padding: 1px 4px;
    min-width: 12px;
    text-align: center;
}

.weapon-slot:hover.filled {
    border-color: #888;
    background: linear-gradient(135deg, #3a3a3a 0%, #2a2a2a 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
}

/* Weapon Discovery Notifications */
.weapon-discovery-notification {
    position: absolute;
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
    z-index: 10001;
    animation: discoveryPop 3s ease-out forwards;
    min-width: 200px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.weapon-discovery-notification.chest {
    background: linear-gradient(135deg, #FF9800 0%, #F57C00 100%);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
}

.weapon-discovery-notification.drop {
    background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.4);
}

@keyframes discoveryPop {
    0% {
        opacity: 0;
        transform: scale(0.5) translateY(20px);
    }
    15% {
        opacity: 1;
        transform: scale(1.1) translateY(-10px);
    }
    30% {
        transform: scale(1) translateY(0);
    }
    85% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    100% {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
}

.discovery-icon {
    font-size: 24px;
}

.discovery-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.discovery-type {
    font-size: 12px;
    opacity: 0.9;
    font-weight: normal;
}

.weapon-name {
    font-size: 14px;
    font-weight: bold;
}


/* Feature Flags Styles */
.debug-feature-flags {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
}

.debug-flag-control {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 5px;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 4px;
    transition: all 0.2s;
}

.debug-flag-control:hover {
    background: rgba(0, 255, 0, 0.1);
}

.debug-flag-control input[type="checkbox"] {
    width: 14px;
    height: 14px;
    cursor: pointer;
    accent-color: #00ff00;
}

.debug-flag-control label {
    color: #00ff00;
    cursor: pointer;
    flex: 1;
    font-size: 11px;
    text-transform: capitalize;
    user-select: none;
}

.debug-section-title {
    text-align: center;
    margin-bottom: 10px;
    font-weight: bold;
    color: #ffff00;
    font-size: 12px;
}

.debug-progression {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 5px;
}

.debug-system-info {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(0, 255, 0, 0.05);
    border-radius: 4px;
    font-size: 11px;
}

.debug-system-title {
    color: #ffff00;
    font-weight: bold;
    margin-bottom: 4px;
}

.debug-system-stats {
    color: #aaffaa;
    margin-bottom: 6px;
}

.debug-system-item {
    color: #00ff00;
    margin-left: 8px;
    margin-bottom: 2px;
}

.debug-system-item.active {
    color: #ffff00;
    font-weight: bold;
}