/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Arial', sans-serif;
    background: #000;
    overflow: hidden;
    cursor: none; /* Hide cursor in game mode */
}

/* Game container */
#gameContainer {
    position: relative;
    width: 100vw;
    height: 100vh;
}

#gameCanvas {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
}

/* UI Overlay */
#ui {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
}

/* Crosshair */
#crosshair {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    pointer-events: none;
    transition: color 0.2s ease;
}

#crosshair.spraying {
    color: #4CAF50;
    font-size: 28px;
}

/* HUD Elements */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    color: white;
    font-size: 14px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.gauge-bar {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    overflow: hidden;
    margin-top: 5px;
    margin-bottom: 15px;
}

.gauge-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
    border-radius: 8px;
}

.gauge-fill.heat {
    background: linear-gradient(90deg, #FFC107, #FF5722);
}

/* Instructions panel */
#instructions {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    max-width: 500px;
    pointer-events: all;
    border: 2px solid #4CAF50;
}

#instructions.hidden {
    display: none;
}

#instructions h3 {
    color: #4CAF50;
    margin-bottom: 20px;
    font-size: 24px;
}

#instructions p {
    margin-bottom: 10px;
    text-align: left;
}

#instructions small {
    color: #ccc;
    font-style: italic;
}

/* Loading screen */
#loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 1000;
}

#loading.hidden {
    display: none;
}

#loading h2 {
    color: #4CAF50;
    margin-bottom: 30px;
    font-size: 28px;
}

/* Loading spinner */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top: 5px solid #4CAF50;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Tool Inventory Bar */
#inventoryBar {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 15px;
    padding: 10px;
    backdrop-filter: blur(5px);
}

#inventoryContainer {
    display: flex;
    gap: 8px;
    margin-bottom: 5px;
}

.tool-slot {
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tool-slot:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.05);
}

.tool-slot.active {
    background: rgba(76, 175, 80, 0.3);
    border-color: #4CAF50;
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.5);
}

.tool-slot .icon {
    font-size: 24px;
    margin-bottom: 2px;
}

.tool-slot .index {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.6);
    font-weight: bold;
}

.tool-slot .name {
    font-size: 8px;
    color: white;
    text-align: center;
    line-height: 1;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Debug info (can be toggled) */
.debug-info {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 10px;
    font-family: monospace;
    font-size: 12px;
    border-radius: 5px;
}

/* Responsive design for smaller screens */
@media (max-width: 768px) {
    #hud {
        font-size: 12px;
    }
    
    .gauge-bar {
        width: 150px;
        height: 15px;
    }
    
    #instructions {
        max-width: 90%;
        padding: 20px;
    }
    
    #crosshair {
        font-size: 20px;
    }
    
    /* Smaller inventory bar on mobile */
    #inventoryBar {
        bottom: 15px;
        padding: 8px;
    }
    
    .tool-slot {
        width: 50px;
        height: 50px;
    }
    
    .tool-slot .icon {
        font-size: 20px;
    }
    
    .tool-slot .name {
        font-size: 7px;
    }
}

/* Hide default cursor in game mode */
body.game-mode {
    cursor: none;
}

/* Show cursor when paused */
body.paused {
    cursor: default;
}
