:root {
    --bg-color: #121212;
    --surface-color: #1e1e1e;
    --primary-color: #00e5ff;
    --accent-color: #ff0055;
    --text-color: #ffffff;
    --glass: rgba(30, 30, 30, 0.8);
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    overflow: hidden;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.hidden { display: none !important; }

/* Auth Overlay */
#auth-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

#auth-container {
    width: 90%; max-width: 380px;
    text-align: center;
    background: var(--surface-color);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    border: 1px solid rgba(255,255,255,0.1);
}

#auth-title { margin-bottom: 30px; letter-spacing: 2px; color: var(--primary-color); }

.auth-btn {
    background: linear-gradient(135deg, var(--primary-color), #00b8d4);
    color: #000;
    border: none;
    padding: 15px;
    width: 100%;
    font-weight: bold;
    border-radius: 12px;
    cursor: pointer;
    margin-top: 15px;
    font-size: 1rem;
    transition: transform 0.1s;
}
.auth-btn:active { transform: scale(0.98); }

#auth-container input {
    width: 100%;
    padding: 15px;
    margin-bottom: 12px;
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 10px;
    color: white;
    box-sizing: border-box;
    font-size: 1rem;
}
#auth-container input:focus { border-color: var(--primary-color); outline: none; }

.toggle-text { font-size: 0.85rem; margin-top: 20px; cursor: pointer; color: #aaa; }
#auth-error { color: var(--accent-color); margin-top: 15px; font-weight: bold; }

/* Start Overlay */
#start-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.pulse-icon { animation: pulse-shadow 2s infinite; border-radius: 50%; padding: 20px; background: var(--surface-color); }
@keyframes pulse-shadow { 0% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.4); } 70% { box-shadow: 0 0 0 30px rgba(0, 229, 255, 0); } 100% { box-shadow: 0 0 0 0 rgba(0, 229, 255, 0); } }

/* Main Layout */
.top-bar {
    height: 10vh;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

.channel-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 8px 15px;
    border-radius: 30px;
    font-weight: bold;
    cursor: pointer;
}

#now-playing { font-size: 0.9em; color: #bbb; margin-top: 5px; }

.main-view {
    height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: radial-gradient(circle at center, #1a1a1a 0%, #000 100%);
}

.controls {
    height: 12vh;
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background: var(--surface-color);
    border-top-left-radius: 30px;
    border-top-right-radius: 30px;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
}

.btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    transition: transform 0.2s;
    width: 60px; height: 60px;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 50%;
}
.btn:active { transform: scale(0.9); }

/* Joystick */
#joystick-zone {
    width: 280px; height: 280px;
    border-radius: 50%;
    position: relative;
    background: rgba(255,255,255,0.03);
    border: 2px solid rgba(255,255,255,0.1);
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8);
}
#stick {
    width: 80px; height: 80px;
    background: linear-gradient(135deg, #333, #111);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    position: absolute;
    top: 100px; left: 100px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}
.joy-label {
    position: absolute;
    font-size: 2.5em;
    opacity: 0.3;
    pointer-events: none;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.joy-label.active { transform: scale(1.5); opacity: 1; filter: drop-shadow(0 0 10px var(--primary-color)); }
.joy-label.top { top: 15px; left: 50%; margin-left: -20px; }
.joy-label.bottom { bottom: 15px; left: 50%; margin-left: -20px; }
.joy-label.left { left: 15px; top: 50%; margin-top: -25px; }
.joy-label.right { right: 15px; top: 50%; margin-top: -25px; }

/* Recorder */
#recorder-zone { display: none; width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; }
#rec-btn {
    width: 140px; height: 140px;
    border-radius: 50%;
    background: var(--surface-color);
    border: 4px solid var(--accent-color);
    color: var(--accent-color);
    font-size: 1.2em;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s;
    box-shadow: 0 0 30px rgba(255,0,85,0.2);
    display: flex; align-items: center; justify-content: center; text-align: center;
}
#rec-btn.recording {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 0 60px var(--accent-color);
    transform: scale(1.1);
}
#rec-btn.paused {
    border-style: dashed;
    animation: none;
    opacity: 0.8;
}

#rec-actions {
    margin-top: 30px;
    display: flex;
    gap: 15px;
}
.action-btn {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: bold;
    cursor: pointer;
}
.action-btn.send { background: var(--primary-color); color: black; border: none; }
.action-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Volume Slider Popup */
#vol-popup {
    display: none;
    position: absolute;
    bottom: 100px;
    left: 30px;
    background: var(--surface-color);
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    z-index: 500;
}
#vol-slider {
    width: 150px;
    transform: rotate(-90deg);
}
.visible { display: block !important; }

/* Channel Menu Overlay */
#channel-menu {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.95);
    z-index: 8000;
    display: flex;
    flex-direction: column;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}
.ch-item {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-size: 1.2em;
    color: white;
}