body { 
    margin: 0; overflow: hidden; 
    background: radial-gradient(circle at 50% 40%, #0f172a 0%, #020617 100%); 
    color: #f8fafc; font-family: 'Segoe UI', Tahoma, sans-serif; 
}
body::after { 
    content: ""; position: absolute; top: 0; left: 0; width: 100vw; height: 100vh; 
    box-shadow: inset 0 0 150px rgba(0,0,0,0.8); pointer-events: none; z-index: 1; 
}
canvas { display: block; width: 100vw; height: 100vh; position: relative; z-index: 5; }

.toggle-panel-btn {
    position: absolute; top: 1rem; left: 1rem; z-index: 8;
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.5); border-radius: 8px;
    color: #38bdf8; font-weight: bold; padding: 10px 16px;
    cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,0.5); transition: all 0.2s ease;
}
.toggle-panel-btn:hover { background: rgba(30, 41, 59, 0.95); transform: translateY(-2px); }

.info-panel { 
    position: absolute; top: 1rem; left: 1rem; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); 
    padding: 1rem; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); 
    width: 360px; max-width: calc(100vw - 2rem); box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
    z-index: 10; max-height: 95vh; overflow-y: auto; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    transform-origin: left center;
}
.info-panel.hidden { transform: translateX(-120%); opacity: 0; pointer-events: none; }
.info-panel::-webkit-scrollbar { width: 6px; } 
.info-panel::-webkit-scrollbar-track { background: rgba(0,0,0,0.2); border-radius: 4px; } 
.info-panel::-webkit-scrollbar-thumb { background: #38bdf8; border-radius: 4px; }

.panel-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid rgba(56,189,248,0.3); margin-bottom: 10px; padding-bottom: 4px; }
.close-btn { background: none; border: none; color: #94a3b8; font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1; transition: color 0.2s; }
.close-btn:hover { color: #ef4444; }

h2 { margin: 0 0 10px 0; font-size: 0.9rem; color: #38bdf8; text-transform: uppercase; border-bottom: 1px solid rgba(56,189,248,0.3); padding-bottom: 4px; }

.app-mode-tabs { display: flex; gap: 5px; margin-bottom: 15px; }
.tab-btn { 
    flex: 1; padding: 10px; background: rgba(0,0,0,0.5); color: #94a3b8; 
    border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; 
    cursor: pointer; font-size: 0.75rem; font-weight: bold; transition: all 0.2s; 
}
.tab-btn.active.rgbd { background: linear-gradient(135deg, #10b981, #059669); color: white; border-color: #34d399; }
.tab-btn.active.rgbdvod { background: linear-gradient(135deg, #ec4899, #be185d); color: white; border-color: #f472b6; }
.tab-btn.active.draco { background: linear-gradient(135deg, #10b981, #059669); color: white; border-color: #34d399; }
.tab-btn.active.dracomesh { background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: white; border-color: #a78bfa; }
.tab-btn.active.atlas { background: linear-gradient(135deg, #3b82f6, #2563eb); color: white; border-color: #60a5fa; }

.control-group { margin-bottom: 10px; } 
label { display: flex; justify-content: space-between; font-size: 0.7rem; font-weight: bold; color: #94a3b8; margin-bottom: 4px; }
input[type="range"], input[type="text"], input[type="number"], select { 
    width: 100%; box-sizing: border-box; padding: 6px; border-radius: 4px; 
    background: rgba(0,0,0,0.5); color: white; border: 1px solid rgba(255,255,255,0.2); 
    font-size: 0.75rem; outline: none; font-family: monospace; 
}

.btn-action { 
    width: 100%; padding: 8px; background: linear-gradient(135deg, #2563eb, #1d4ed8); 
    color: white; border: 1px solid rgba(255,255,255,0.1); border-radius: 6px; 
    cursor: pointer; font-weight: 600; transition: all 0.2s; 
    text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.5px; 
}
.btn-action:hover { background: linear-gradient(135deg, #3b82f6, #2563eb); box-shadow: 0 0 12px rgba(37, 99, 235, 0.5); transform: translateY(-1px); }
.btn-green { background: linear-gradient(135deg, #10b981, #059669); }
.btn-green:hover { background: linear-gradient(135deg, #34d399, #10b981); box-shadow: 0 0 12px rgba(16, 185, 129, 0.5); }
.btn-refresh { margin: 0; width: 40px; padding: 0; font-size: 1.1rem; }

.status-container { margin-top: 10px; padding: 12px; border-radius: 6px; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.05); }
.status-info { color: #fbbf24; font-weight: bold; text-align: center; margin: 0 0 5px 0; font-size: 0.85rem;}
hr { border: 0; border-top: 1px solid rgba(255,255,255,0.1); margin: 12px 0; }

.checkbox-container { display: flex; align-items: center; gap: 6px; cursor: pointer; margin-top: 4px;} 
.checkbox-container input { width: auto; margin: 0; }

.toggle-btn-group { display: flex; width: 100%; margin-top: 6px; margin-bottom: 15px; border-radius: 4px; overflow: hidden; border: 1px solid #38bdf8; box-shadow: 0 0 10px rgba(56, 189, 248, 0.2); }
.toggle-btn { flex: 1; padding: 10px 6px; background: rgba(0,0,0,0.7); color: #94a3b8; border: none; border-right: 1px solid rgba(56, 189, 248, 0.3); cursor: pointer; font-size: 0.75rem; font-weight: bold; transition: all 0.2s; }
.toggle-btn:last-child { border-right: none; }
.toggle-btn.active { background: linear-gradient(135deg, #38bdf8, #0ea5e9); color: white; text-shadow: 0 1px 2px rgba(0,0,0,0.5); }

.highlight-group { background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 6px; padding: 10px; margin-bottom: 10px; }
.highlight-green { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.3); }

.stream-card { background: rgba(0,0,0,0.4); border: 1px solid #8b5cf6; border-radius: 6px; padding: 10px; margin-bottom: 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.3); }
.empty-state-text { font-size: 0.75rem; color: #64748b; text-align: center; }

#toast {
    position: absolute; top: 20px; left: 50%; transform: translateX(-50%);
    background: rgba(239, 68, 68, 0.9); color: white; padding: 10px 20px;
    border-radius: 30px; font-weight: bold; font-size: 0.8rem;
    opacity: 0; transition: opacity 0.5s; pointer-events: none; z-index: 999;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

#fpsOverlay {
    position: absolute; top: 1rem; right: 1rem; z-index: 9999; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); 
    border: 1px solid rgba(16, 185, 129, 0.5); border-radius: 8px; 
    padding: 10px 16px; color: #10b981; font-weight: bold; font-family: monospace; 
    font-size: 1.2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.5); pointer-events: none;
    display: flex; flex-direction: column; gap: 4px; min-width: 100px;
}

#debug-streams-panel {
    position: absolute; bottom: 1rem; right: 1rem; 
    background: rgba(15, 23, 42, 0.85); backdrop-filter: blur(12px); 
    padding: 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); 
    z-index: 10; display: flex; gap: 10px; pointer-events: none; 
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    transition: opacity 0.3s ease;
}
.debug-canvas { width: 100px; height: auto; border: 1px solid #334155; border-radius: 4px; background: #000; }
.debug-label { font-size: 0.6rem; text-align: center; color: #94a3b8; margin-top: 4px; font-weight: bold; }

.flex-row-gap { display: flex; gap: 5px; margin-bottom: 5px; }
.stats-row { display: flex; justify-content: space-between; margin-top: 15px; }
.stat-group { margin-bottom: 0; }
.stat-group.left { text-align: left; }
.stat-group.right { text-align: right; }
.stat-label { color: #94a3b8; }
.stat-value { font-size: 1.1rem; font-weight: bold; }
.stat-value.green { color: #10b981; }
.stat-value.purple { color: #a855f7; }

#pointCount {
    font-size: 1.4rem; color: #10b981; font-weight: bold; text-align: center; 
    margin: 0 0 10px 0; text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.quality-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; text-align: center; }
.quality-title { font-weight: bold; color: #94a3b8; font-size: 0.7rem; }
.quality-auto-lbl { margin: 0; font-size: 0.6rem; color: #10b981; display: flex; align-items: center; gap: 4px; }
.quality-auto-lbl input { width: 14px; height: 14px; cursor: pointer; accent-color: #10b981; }

.quality-controls-row { display: flex; align-items: center; justify-content: space-between; background: rgba(0,0,0,0.3); border-radius: 6px; padding: 4px; }
.quality-btn { width: 32px; margin: 0; padding: 4px; background: rgba(255,255,255,0.1); }
#qualityLabel { font-weight: bold; color: #10b981; font-size: 0.85rem; }

.buffer-track { width: 100%; height: 6px; background-color: rgba(255, 255, 255, 0.1); margin-top: 4px; border-radius: 3px; overflow: hidden; }
#bufferFill { height: 100%; background-color: #10b981; width: 0%; transition: width 0.2s; }

.draco-actors-count { font-weight: bold; color: #fff; }
.draco-actors-btns { display: flex; gap: 8px; margin-top: 8px; }
.btn-red { background: linear-gradient(135deg, #ef4444, #b91c1c); }
.btn-purple { background: linear-gradient(135deg, #8b5cf6, #6d28d9); }
.btn-orange { background: linear-gradient(135deg, #f59e0b, #d97706); }

.load-monitor-header { font-size: 0.6rem; color: #94a3b8; margin-top: 6px; display: flex; justify-content: space-between; }
#loadText { color: #10b981; }
.load-bar-track { width: 100%; height: 4px; background: rgba(255,255,255,0.1); border-radius: 2px; margin-top: 3px; overflow: hidden; }
#loadBar { width: 0%; height: 100%; background: #10b981; transition: width 0.2s, background-color 0.3s; }

@media (max-width: 768px) {
    #debug-streams-panel { display: none !important; }
}