@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;800&display=swap');

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body, html {
    width: 100%;
    height: 100%;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background-color: #f0f0f0;
}

/* Three.js Canvas */
canvas {
    display: block;
    width: 100vw;
    height: 100vh;
}

/* UI Overlays */
#start-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
}

.start-modal {
    background: #ffffff;
    padding: 40px 50px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.5s ease;
}

.start-modal h1 {
    font-weight: 800;
    font-size: 28px;
    color: #111;
    margin-bottom: 10px;
}

.start-modal p {
    color: #555;
    margin-bottom: 30px;
    font-size: 14px;
}

#start-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

#display-name {
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    outline: none;
    transition: border-color 0.2s;
    font-family: 'Inter', sans-serif;
}

#display-name:focus {
    border-color: #ff3b30;
}

button {
    background: #ff3b30;
    color: white;
    font-weight: 600;
    font-size: 16px;
    padding: 15px 20px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.1s, background 0.2s;
    font-family: 'Inter', sans-serif;
}

button:hover {
    background: #e0352b;
}

button:active {
    transform: scale(0.97);
}

/* Player Tag Wrapper — holds music icon + nametag */
#player-tag-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#player-tag-wrapper.visible {
    opacity: 1;
}

/* Floating Name Tag */
.floating-tag {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    pointer-events: none;
    white-space: nowrap;
}

/* ──────────────────────────────
   Music Indicator (above nametag)
   ────────────────────────────── */
.music-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-bottom: 4px;
    position: relative;
}

.music-icon {
    font-size: 18px;
    color: #fff;
    filter: drop-shadow(0 0 4px rgba(255, 59, 48, 0.8));
    animation: iconPulse 1.6s ease-in-out infinite;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 4px rgba(255, 59, 48, 0.8)); }
    50%      { transform: scale(1.15); filter: drop-shadow(0 0 8px rgba(255, 59, 48, 1)); }
}

/* Animated sound wave bars */
.sound-waves {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
}

.wave {
    display: block;
    width: 3px;
    border-radius: 2px;
    background: #fff;
    animation: waveBar 0.8s ease-in-out infinite alternate;
}

.wave.w1 { height: 5px;  animation-delay: 0s; }
.wave.w2 { height: 10px; animation-delay: 0.15s; }
.wave.w3 { height: 7px;  animation-delay: 0.3s; }

@keyframes waveBar {
    0%   { height: 3px;  opacity: 0.5; }
    100% { height: 14px; opacity: 1; }
}

/* Muted state — pauses all animations */
.music-indicator.muted .music-icon {
    animation: none;
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.3));
    opacity: 0.4;
}

.music-indicator.muted .wave {
    animation: none;
    height: 3px;
    opacity: 0.3;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Sound Toggle */
.sound-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    padding: 0;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.1s ease;
    opacity: 0.8;
    pointer-events: auto;
    transform: none;
}

.sound-toggle:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

/* End of style.css */
