body {
    margin: 0;
    padding: 0;
    background-color: #000;
    overflow: hidden;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#game-container {
    width: 100vw;
    height: 100vh;
}

#ui-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    /* Let clicks pass through to game when not interacting with UI */
}

#hud {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
}

#xp-bar-container {
    width: 100%;
    height: 20px;
    background-color: #333;
    border: 2px solid #fff;
    border-radius: 10px;
    overflow: hidden;
}

#xp-bar-fill {
    width: 0%;
    height: 100%;
    background-color: #00ff00;
    transition: width 0.2s;
}

#level-display {
    color: white;
    font-weight: bold;
    margin-top: 5px;
    text-shadow: 1px 1px 2px black;
}

.hidden {
    display: none !important;
}

#level-up-screen,
#game-over-screen {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.9);
    padding: 20px;
    border-radius: 10px;
    color: white;
    text-align: center;
    pointer-events: auto;
    /* Enable clicks */
    border: 2px solid #ffd700;
}

.upgrade-card {
    background: linear-gradient(145deg, #3a3a5a, #2a2a4a);
    padding: 20px;
    margin: 10px;
    cursor: pointer;
    border: 2px solid #ffd700;
    border-radius: 12px;
    transition: all 0.2s;
    min-width: 150px;
}

.upgrade-card:hover {
    background: linear-gradient(145deg, #4a4a6a, #3a3a5a);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
}

.upgrade-title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #ffd700;
}

.upgrade-desc {
    font-size: 0.9em;
    color: #ccc;
}

button {
    padding: 10px 20px;
    font-size: 1.2em;
    cursor: pointer;
}

#health-bar-container {
    width: 300px;
    height: 20px;
    background-color: #333;
    border: 2px solid #fff;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

#health-bar-fill {
    width: 100%;
    height: 100%;
    background-color: #ff0000;
    transition: width 0.2s;
}

#equipment-slots {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    pointer-events: none;
}

.slot-row {
    display: flex;
    gap: 5px;
}

.slot {
    width: 40px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.6);
    border: 2px solid #555;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.slot.active {
    border-color: #ffd700;
    background-color: rgba(60, 60, 90, 0.8);
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

.slot.breakthrough {
    border-color: #ff00ff;
    box-shadow: 0 0 15px rgba(255, 0, 255, 0.5);
    animation: glow-pulse 2s infinite linear;
}

.slot-lvl {
    position: absolute;
    bottom: -1px;
    right: 2px;
    font-size: 10px;
    color: #ffd700;
    font-weight: bold;
    text-shadow: 1px 1px 1px black;
}

@keyframes glow-pulse {
    0% { filter: drop-shadow(0 0 2px #ff00ff); }
    50% { filter: drop-shadow(0 0 8px #ff00ff); }
    100% { filter: drop-shadow(0 0 2px #ff00ff); }
}
