/* ==========================================
   Melle Well VR - Bootstrap Responsive Layout
========================================== */

/* 1. Master Wrapper */
#melle-vr-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    background-color: #050505;
    overflow: hidden;
}

/* 2. The 3D Canvas */
#three-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* NOTE: The main #ui-overlay layout is now handled entirely 
  by Bootstrap 5 utility classes in shortcode.php 
  (w-100, max-width, d-flex, p-3, etc). 
*/


/* ==========================================
   HUD ELEMENTS (Hidden on Login Screen)
========================================== */
#txtStatus, 
#livePlayersUI, 
#songUI, 
#liveLeaderboardUI, 
#leaderboardUI {
    display: none; 
}

/* Top Left: Song Info */
#songUI {
    position: absolute;
    top: 60px; 
    left: 15px;
    z-index: 50;
    color: #00f2ff;
    font-weight: bold;
    font-family: monospace;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #00f2ff;
}

/* Top Right: Voltage Tracker */
#txtStatus {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 50;
    color: #fff;
    font-family: monospace;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #ffaa00; 
}

/* Top Right: Active Particles */
#livePlayersUI {
    position: absolute;
    top: 55px;
    right: 15px;
    z-index: 50;
    color: #aaa;
    font-family: monospace;
    font-size: 0.9rem;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

/* Right Side: Leaderboard */
#liveLeaderboardUI {
    position: absolute;
    top: 85px;
    right: 15px;
    z-index: 50;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00f2ff;
    border-radius: 8px;
    padding: 15px;
    min-width: 220px;
    color: #fff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.15);
}

/* End of Match Popup */
#leaderboardUI {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%); 
    z-index: 200; 
    background: rgba(0, 0, 0, 0.95);
    border: 2px solid #00f2ff;
    border-radius: 12px;
    padding: 2rem;
    min-width: 300px;
    text-align: center;
    color: #fff;
    box-shadow: 0 10px 50px rgba(0, 242, 255, 0.3);
}

#liveLeaderboardUI h3, 
#leaderboardUI h2 {
    color: #00f2ff;
    font-size: 1.1rem;
    margin-top: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid #444;
    padding-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#leaderboardUI h2 { font-size: 1.5rem; }

.live-player, .player-score {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-family: monospace;
    font-size: 0.95rem;
}

/* Fix Offcanvas Backgrounds for Dark Mode */
.offcanvas {
    background-color: var(--bs-body-bg);
    color: var(--bs-body-color);
}

/* ==========================================
   HUD TOGGLE & MOBILE RESPONSIVENESS
========================================== */
body.hud-hidden #txtStatus,
body.hud-hidden #livePlayersUI,
body.hud-hidden #songUI,
body.hud-hidden #liveLeaderboardUI {
    display: none !important;
}

@media (max-width: 768px) {
    #txtStatus { top: 65px; right: 10px; font-size: 0.75rem; padding: 4px 8px; z-index: 50; }
    #livePlayersUI { top: 100px; right: 10px; font-size: 0.75rem; }
    #liveLeaderboardUI { top: 125px; right: 10px; min-width: 160px; padding: 10px; font-size: 0.75rem; }
    
    /* Constrain song UI so it doesn't overlap leaderboard on small screens */
    #songUI { 
        top: 65px; left: 10px; font-size: 0.75rem; padding: 4px 8px; 
        max-width: 50vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
    }
    
    /* Adjust control bar spacing */
    #ingame-overlay-controls { 
        top: 10px !important; left: 10px !important; 
        justify-content: flex-start;
    }
}
