/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    overflow: hidden;
    background: #000;
    font-family: Arial, sans-serif;
    color: #fff;
}
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.loader {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

#loading-screen span {
    color: white;
    font-family: Arial, sans-serif;
    font-size: 18px;
}
/* Game Container */
#game-container {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Canvas */
#gameCanvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* UI Overlay */
#ui-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks to pass through to canvas */
}

/* HUD Elements */
#hud {
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: auto;
}

#health-bar {
    width: 200px;
    height: 20px;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    border-radius: 10px;
    overflow: hidden;
}

#health-fill {
    width: 100%;
    height: 100%;
    background: #ff3333;
    transition: width 0.3s ease;
}

#player-stats {
    margin-top: 10px;
    font-size: 18px;
    text-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
}

#player-stats span {
    margin-right: 20px;
}

/* Menu Styles */
#menu {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.menu-content {
    background: rgba(40, 40, 40, 0.9);
    padding: 30px;
    border-radius: 10px;
    text-align: center;
}

.menu-content button {
    display: block;
    width: 200px;
    margin: 10px auto;
    padding: 10px;
    background: #444;
    border: none;
    border-radius: 5px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.2s;
}

.menu-content button:hover {
    background: #666;
}

/* Inventory System */
#inventory {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    pointer-events: auto;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(5, 60px);
    gap: 10px;
    padding: 10px;
}

.inventory-slot {
    width: 60px;
    height: 60px;
    background: rgba(80, 80, 80, 0.5);
    border: 2px solid #666;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.inventory-slot:hover {
    border-color: #fff;
}

.inventory-slot.equipped {
    border-color: #4f4;
}

/* Loading Screen */
#loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    pointer-events: auto;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid #333;
    border-top: 5px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Debug Panel */
#debug-panel {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px;
    border-radius: 5px;
    max-width: 300px;
    pointer-events: auto;
}

.debug-content pre {
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    #health-bar {
        width: 150px;
    }

    #player-stats {
        font-size: 16px;
    }

    .menu-content button {
        width: 150px;
    }

    .inventory-grid {
        grid-template-columns: repeat(4, 50px);
    }

    .inventory-slot {
        width: 50px;
        height: 50px;
    }
}
