:root {
    --bg: #242529; --shadow-light: #2f3136; --shadow-dark: #19191c;
    --text-main: #e0e0e0; --text-muted: #888;
    --accent-red: #D84B4B; --accent-green: #2ed573;
    --accent-blue: #1e90ff;
    --accent-purple: #9b59b6; --accent-yellow: #f1c40f; --border: #2d2d3d;
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent-blue); }

body { font-family: var(--font-family); background: var(--bg); color: var(--text-main); margin: 0; padding: 10px 40px 60px 40px; transition: background 0.5s, color 0.5s; overflow-x: clip; position: relative;}

.neu-flat { background: var(--bg); border-radius: 15px; box-shadow: 8px 8px 16px var(--shadow-dark), -8px -8px 16px var(--shadow-light); transition: all 0.3s; position: relative; z-index: 10;}
.neu-pressed { background: var(--bg); border-radius: 15px; box-shadow: inset 6px 6px 12px var(--shadow-dark), inset -6px -6px 12px var(--shadow-light); transition: all 0.3s; position: relative; z-index: 10;}

/* JUICE: Snappier Buttons */
.neu-btn { background: var(--bg); border-radius: 10px; border: none; box-shadow: 5px 5px 10px var(--shadow-dark), -5px -5px 10px var(--shadow-light); transition: all 0.15s cubic-bezier(0.2, 0.8, 0.2, 1); cursor: pointer; font-weight: 700; color: var(--text-main); font-family: inherit; position: relative; }
.neu-btn:hover { transform: translateY(-2px); box-shadow: 7px 7px 14px var(--shadow-dark), -7px -7px 14px var(--shadow-light); }
.neu-btn:active { transform: translateY(4px) scale(0.97); box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light); }

.neu-btn-ghost { background: transparent; border: 2px solid var(--border); box-shadow: none; color: var(--text-muted); padding: 10px 20px; border-radius: 8px; cursor: pointer; transition: 0.3s; font-weight: bold;}
.neu-btn-ghost:hover { border-color: var(--accent-blue); color: var(--accent-blue); background: rgba(30, 144, 255, 0.1); }

.neu-input { width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); background: rgba(0,0,0,0.1); color: var(--text-main); box-sizing: border-box; font-family: inherit; margin-bottom: 15px; box-shadow: inset 2px 2px 5px var(--shadow-dark); }
select.neu-input option { background: var(--bg); color: var(--text-main); }

header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0px; margin-top: 15px; gap: 20px; position: relative; z-index: 10;}
.logo { display: flex; align-items: center; gap: 15px; cursor: pointer; user-select: none; transition: transform 0.2s ease; }
.logo:active { transform: scale(0.97); }
.chef-icon { width: 70px; height: auto; border-radius: 8px; filter: drop-shadow(3px 3px 5px var(--shadow-dark)); transition: transform 0.3s; }
.logo h1 { color: var(--accent-red); margin: 0; font-size: 2em; text-shadow: 2px 2px 4px var(--shadow-dark); white-space: nowrap; }

.chef-spin-glow { animation: spinGlow 1s cubic-bezier(0.25, 1, 0.5, 1); }
@keyframes spinGlow {
    0% { transform: rotate(0deg) scale(1); filter: drop-shadow(0 0 0px transparent); }
    50% { transform: rotate(180deg) scale(1.2); filter: drop-shadow(0 0 25px var(--accent-green)); }
    100% { transform: rotate(360deg) scale(1); filter: drop-shadow(3px 3px 5px var(--shadow-dark)); }
}

.utility-bar { display: flex; gap: 20px; align-items: center; padding: 10px 25px; flex-wrap: wrap; justify-content: flex-end; }
.clock { font-size: 1.05em; font-weight: 700; color: var(--accent-blue); letter-spacing: 1px; white-space: nowrap; }
.weather { font-size: 1.05em; display: flex; align-items: center; gap: 8px; color: var(--accent-yellow); white-space: nowrap; }
.svg-icon { display: flex; align-items: center; justify-content: center; width: 20px; height: 20px; }
.pulse { animation: weatherPulse 1.5s infinite; }
@keyframes weatherPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

.particle-toggle-wrapper { display: flex; align-items: center; font-size: 0.85em; color: var(--text-muted); font-weight: bold; }
.switch { position: relative; display: inline-block; width: 44px; height: 24px; margin-left: 10px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(0,0,0,0.2); transition: .4s; border-radius: 24px; border: 1px solid var(--border); box-shadow: inset 2px 2px 5px var(--shadow-dark);}
.slider:before { position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px; background-color: var(--text-muted); transition: .4s; border-radius: 50%; }
input:checked + .slider { background-color: var(--accent-blue); border-color: var(--accent-blue);}
input:checked + .slider:before { transform: translateX(20px); background-color: #fff; box-shadow: 0 0 10px #fff;}

/* 🔥 FIX: Lowered opacity and blur for perfect "Frosted Glass" particle visibility */
.tabs-container { 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    background: rgba(36, 37, 41, 0.35); /* highly transparent to let particles shine through */
    backdrop-filter: blur(6px); /* softer blur so particles remain distinct */
    -webkit-backdrop-filter: blur(6px);
    padding: 15px 40px 15px 40px; 
    margin: 0 -40px 30px -40px; 
    box-shadow: 0 15px 30px -5px rgba(0,0,0,0.8); 
    transition: background 0.5s; 
    border-bottom: 1px solid rgba(255,255,255,0.05); 
}
.tabs { display: flex; gap: 15px; justify-content: center; flex-wrap: wrap; position: relative; z-index: 10; margin-bottom: 0;}

.tab-btn { padding: 10px 18px; font-size: .95em; text-transform: uppercase; letter-spacing: 1px; }
.tab-btn.active { color: var(--accent-red); box-shadow: inset 4px 4px 8px var(--shadow-dark), inset -4px -4px 8px var(--shadow-light); }
.tab-content { display: none; animation: fadeIn .35s ease; position: relative; z-index: 10;}
.tab-content.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px) } to { opacity: 1; transform: translateY(0) } }

/* Fix: Studio specific tab content rendering */
.studio-tab-content { display: none; animation: fadeIn .35s ease; position: relative; }
.studio-tab-content.active { display: block; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 25px; max-width: 1200px; margin: 0 auto 40px; }
.card { padding: 25px 20px; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center; border-top: 2px solid transparent; }

.slb-layout { display: grid; grid-template-columns: minmax(0, 1fr) 350px; gap: 20px; max-width: 1450px; margin: 0 auto; align-items: start; }
@media (max-width: 1000px) { .slb-layout { grid-template-columns: 1fr; margin: 0 auto; } }

.slb-sidebar { background: rgba(0,0,0,0.1); border-radius: 12px; border: 1px solid var(--border); padding: 15px; position: sticky; top: 100px; box-sizing: border-box; }

@media (max-width: 1200px) {
    #slb-stats-grid { display: flex !important; overflow-x: auto; padding-bottom: 10px; }
    #slb-stats-grid .card { min-width: 180px; flex: 0 0 auto; }
}

.tiltable { transition: transform 0.1s ease-out, box-shadow 0.1s ease-out; transform-style: preserve-3d; will-change: transform; position: relative; overflow: visible; }

.text-shake { animation: hardShake 0.4s ease-in-out; display: inline-block; }
.text-glow-red { color: var(--accent-red) !important; text-shadow: 0 0 10px rgba(216, 75, 75, 0.8); font-weight: 900; }
@keyframes hardShake {
    0%, 100% { transform: translate(0px, 0px) rotate(0deg); }
    20% { transform: translate(-2px, -1px) rotate(-1deg); }
    40% { transform: translate(1px, -2px) rotate(1deg); }
    60% { transform: translate(-2px, 2px) rotate(0deg); }
    80% { transform: translate(2px, -1px) rotate(-1deg); }
}

.stat { font-size: 2.8em; font-weight: 800; color: var(--text-main); margin: 10px 0; text-shadow: 2px 2px 4px var(--shadow-dark); }
.label { color: var(--text-muted); text-transform: uppercase; font-size: .8em; letter-spacing: 1.5px; margin-bottom: 10px; font-weight: bold;}
.timestamp { color: var(--text-muted); font-size: .75em; margin-top: 5px; }

.pizza-icon { display: inline-block; font-size: 1.2em; margin-right: 5px; }
.pizza-bounce { animation: subtlePizza 0.4s ease-out; }
@keyframes subtlePizza { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.15); } }

.float-up { animation: textFloatUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; }
@keyframes textFloatUp {
    0% { opacity: 1; transform: translateY(0) scale(1); }
    100% { opacity: 0; transform: translateY(-25px) scale(1.6); text-shadow: 0 0 10px var(--accent-green); }
}

.controls { display: flex; justify-content: center; gap: 20px; margin-top: 25px; flex-wrap: wrap; }
.btn-group { display: flex; border-radius: 8px; overflow: hidden; }
.filter-btn { background: transparent; border: none; color: var(--text-muted); padding: 10px 20px; cursor: pointer; font-weight: bold; transition: 0.3s; }
.filter-btn:hover { color: var(--text-main); background: rgba(128,128,128,0.1); }
.filter-btn.active { background: var(--accent-red); color: white; }

.dashboard-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; max-width: 1200px; margin: 0 auto; }
@media (max-width: 900px) { .dashboard-grid { grid-template-columns: 1fr; } }
.chart-container { position: relative; height: 400px; width: 100%; padding: 20px; box-sizing: border-box; }

table { width: 100%; border-collapse: collapse; margin-top: 10px; text-align: left; }
th { padding: 12px; color: var(--text-muted); border-bottom: 2px solid var(--border); }
td { padding: 12px; border-bottom: 1px solid var(--border); }
.rank-1 { color: #ffd700; font-weight: bold; } .rank-2 { color: #c0c0c0; font-weight: bold; } .rank-3 { color: #cd7f32; font-weight: bold; }
.trend-up { color: var(--accent-green); font-size: 0.8em; font-weight: bold; margin-left: 5px; } .trend-down { color: var(--accent-red); font-size: 0.8em; font-weight: bold; margin-left: 5px; }

.highlight-row { background: rgba(155, 89, 182, 0.15) !important; border-left: 4px solid var(--accent-purple); box-shadow: inset 0 0 15px rgba(155, 89, 182, 0.1); }
.highlight-row:hover { background: rgba(155, 89, 182, 0.25) !important; transform: scale(1.01); box-shadow: 0 4px 10px rgba(0,0,0,0.3); }

/* JUICE: Skeleton Loaders Upgraded */
.skeleton-load { 
    animation: skeletonPulse 1.5s infinite alternate ease-in-out; 
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%; border-radius: 4px; color: transparent !important; 
    pointer-events: none; display: inline-block; min-width: 60px; 
}
@keyframes skeletonPulse { 
    0% { background-position: 200% 0; opacity: 0.6; } 
    100% { background-position: -200% 0; opacity: 1; } 
}

.health-bar { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; margin-bottom: 25px; max-width: 1200px; margin-left: auto; margin-right: auto; align-items: center;}
.health-divider { width: 2px; height: 24px; background: var(--border); margin: 0 5px; border-radius: 2px; }
.api-status { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: .85em; color: var(--text-muted); background: rgba(0,0,0,.15); padding: 8px 16px; border-radius: 999px; user-select: none; box-shadow: inset 2px 2px 5px var(--shadow-dark); cursor: pointer; transition: 0.2s;}
.api-status:hover { background: rgba(255,255,255,0.05); }
.dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent-yellow); box-shadow: 0 0 8px var(--accent-yellow); }
.dot.ok { background: var(--accent-green); box-shadow: 0 0 8px var(--accent-green); }
.dot.bad { background: var(--accent-red); box-shadow: 0 0 8px var(--accent-red); }

.soundboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 15px; width: 100%; margin-top: 15px; }
@media (max-width: 600px) { .soundboard-grid { grid-template-columns: repeat(2, 1fr); } }

.sound-card { position: relative; width: 100%; height: 80px; }
.soundboard-btn { background: var(--bg); border-radius: 12px; border: 2px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 100%; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s; box-shadow: 4px 4px 8px var(--shadow-dark), -4px -4px 8px var(--shadow-light); color: var(--text-main); font-weight: bold; font-family: inherit; font-size: 0.85em; padding: 5px; text-align:center; overflow:hidden;}
.soundboard-btn:active { box-shadow: inset 4px 4px 8px rgba(0,0,0,0.5); transform: translateY(2px) scale(0.98); }
.sb-icon { font-size: 1.8em; margin-bottom: 5px; filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.4)); font-family: "Apple Color Emoji", sans-serif;}

.preview-btn, .stop-preview-btn { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.4); border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8em; transition: 0.2s; z-index: 10; color: white;}
.preview-btn:hover { background: var(--accent-blue); transform: scale(1.1); }
.stop-preview-btn:hover { background: var(--accent-red); transform: scale(1.1); }

.admin-sound-edit { position: absolute; top: 6px; left: 6px; background: rgba(0,0,0,0.5); border: none; border-radius: 50%; width: 24px; height: 24px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 0.8em; transition: 0.2s; z-index: 10; color: var(--accent-yellow); }
.admin-sound-edit:hover { background: var(--accent-yellow); color: black; transform: scale(1.1); }

.terminal { background: #0c0c0c; color: #0f0; font-family: 'Courier New', Courier, monospace; padding: 15px; border-radius: 10px; height: 160px; overflow-y: auto; text-align: left; margin-top: 25px; box-shadow: inset 0 0 15px #000; width: 100%; box-sizing: border-box; font-size: 0.85em; border: 1px solid #333; }
.terminal-line { margin: 4px 0; }
.terminal-time { color: #888; margin-right: 8px; }

.volume-slider { width: 100%; margin-top: 10px; accent-color: var(--accent-blue); cursor: pointer; }

/* JUICE: Ticket Toasts Upgraded */
.toast-container { position: fixed; bottom: 90px; right: 30px; display: flex; flex-direction: column; gap: 15px; z-index: 10001; pointer-events: none; }
.toast { 
    background: #fdfbf7; color: #111; font-family: 'Courier New', Courier, monospace;
    padding: 18px 25px; border-radius: 2px; border-top: 4px dashed #ccc; 
    box-shadow: 5px 5px 20px rgba(0,0,0,0.6); font-weight: bold; 
    transform: translateY(-20px) scale(0.9); opacity: 0;
    animation: ticketPrintIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; 
    display: flex; align-items: center; gap: 12px; font-size: 0.95em; pointer-events: auto;
}
.toast.error { border-top-color: var(--accent-red); color: var(--accent-red); }
.toast.success { border-top-color: var(--accent-green); color: #0a5a2a; }
.toast-exit { animation: crumpleSwipe 0.4s ease-in forwards !important; }

@keyframes ticketPrintIn { to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes crumpleSwipe { 
    0% { transform: scale(1) rotate(0deg); opacity: 1; }
    50% { transform: scale(0.8) rotate(-5deg); opacity: 0.8; }
    100% { transform: scale(0.5) translateX(200%) rotate(20deg); opacity: 0; }
}

.floating-credit { position: absolute; color: var(--accent-red); font-weight: bold; font-size: 1.2em; text-shadow: 0 0 10px rgba(216, 75, 75, 0.6); pointer-events: none; animation: floatUpFade 1.5s ease-out forwards; z-index: 10000; }
@keyframes floatUpFade { 0% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-50px) scale(1.2); } }

.visualizer-wrapper { display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(0,0,0,0.15); padding: 10px; border-radius: 12px; margin: 0; box-shadow: inset 3px 3px 8px var(--shadow-dark), inset -3px -3px 8px var(--shadow-light); height: 70px; }
.visualizer { display: flex; gap: 6px; height: 25px; align-items: flex-end; justify-content: center; }
.vis-bar { width: 8px; background: var(--text-muted); border-radius: 4px; transition: height 0.2s, background 0.3s; height: 5px; }
.visualizer.active .vis-bar { animation: bounceBar 0.5s infinite alternate; }
.visualizer.active .vis-bar:nth-child(1) { animation-delay: 0.0s; background: var(--accent-blue); box-shadow: 0 0 10px var(--accent-blue); }
.visualizer.active .vis-bar:nth-child(2) { animation-delay: 0.2s; background: var(--accent-green); box-shadow: 0 0 10px var(--accent-green); }
.visualizer.active .vis-bar:nth-child(3) { animation-delay: 0.4s; background: var(--accent-yellow); box-shadow: 0 0 10px var(--accent-yellow); }
.visualizer.active .vis-bar:nth-child(4) { animation-delay: 0.1s; background: var(--accent-red); box-shadow: 0 0 10px var(--accent-red); }
.visualizer.active .vis-bar:nth-child(5) { animation-delay: 0.3s; background: var(--accent-purple); box-shadow: 0 0 10px var(--accent-purple); }
@keyframes bounceBar { 0% { height: 5px; } 100% { height: 25px; } }

.radio-ticker { margin-top: 10px; font-size: 0.85em; color: var(--accent-green); background: rgba(0,0,0,0.2); padding: 8px 12px; border-radius: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: none;}
.avatar-img { width: 80px; height: 80px; border-radius: 50%; box-shadow: 0 0 15px var(--accent-purple); margin-bottom: 15px; border: 3px solid var(--bg);}

.quick-chat-container { position: fixed; top: 120px; left: 20px; display: flex; flex-direction: column; gap: 5px; z-index: 9999; pointer-events: none; }
.quick-chat-msg { background: rgba(0, 0, 0, 0.6); border-left: 4px solid var(--accent-blue); color: #fff; font-family: 'Segoe UI', sans-serif; font-weight: 600; font-size: 1rem; padding: 8px 15px; border-radius: 4px; text-shadow: 1px 1px 2px #000; opacity: 0; transform: translateX(-20px); animation: slideInChat 0.3s forwards, fadeOutChat 0.5s forwards 4s; }
@keyframes slideInChat { to { opacity: 1; transform: translateX(0); } }
@keyframes fadeOutChat { to { opacity: 0; transform: translateX(-20px); } }
.chat-spam-warning { color: var(--accent-red); font-style: italic; font-size: 0.9em; }

.lt-card { background: rgba(0,0,0,0.2); border-radius: 8px; padding: 10px; text-align: center; border: 1px solid var(--border); }
.lt-card .stat { font-size: 1.5em; margin: 5px 0; }
.lt-card .label { font-size: 0.7em; margin-bottom: 0; color: var(--accent-blue); }

.dossier-badge { background: #0c0c0c; padding: 15px 10px; border-radius: 10px; text-align: center; border: 1px solid rgba(255,255,255,0.1); box-shadow: inset 0 0 10px rgba(0,0,0,0.8); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.dossier-badge::before { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 3px; background: var(--badge-color, var(--accent-blue)); box-shadow: 0 0 10px var(--badge-color, var(--accent-blue)); }
.dossier-badge .mode-label { font-size: 0.7em; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 5px; }
.dossier-badge .mode-mmr { font-size: 1.8em; font-weight: 900; color: white; margin-bottom: 2px; text-shadow: 0 0 10px rgba(255,255,255,0.3); line-height: 1; }
.dossier-badge .mode-rank { font-size: 0.85em; font-weight: bold; color: var(--badge-color, var(--accent-blue)); }

/* =========================================================
   NEW APP MODAL CLASSES (Fixing the window popups)
   ========================================================= */

/* JUICE: Glassmorphism Modals Upgraded & FIXED visibility */
@keyframes modalBounceIn {
    0% { transform: scale(0.8) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.app-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.7); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 10000; justify-content: center; align-items: center;
}

.app-modal-content {
    background: rgba(36, 37, 41, 0.95); border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px; padding: 30px; text-align: center;
    max-width: 500px; width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), inset 0 0 10px rgba(255,255,255,0.05);
    position: relative; max-height: 90vh; overflow-y: auto;
    animation: modalBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.app-close-btn {
    position: absolute; top: 15px; right: 15px;
    background: transparent; border: none;
    color: var(--text-muted); font-size: 1.5em; cursor: pointer;
    transition: color 0.2s; z-index: 100; font-weight: bold;
}

.app-close-btn:hover { color: var(--accent-red); }

/* Older modal styles kept for legacy compatibility, fixed visibility */
.modal-overlay { 
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; 
    background: rgba(0,0,0,0.85); backdrop-filter: blur(5px); 
    z-index: 10000; justify-content: center; align-items: center; 
}

.welcome-modal { background: var(--bg); border: 2px solid var(--accent-purple); border-radius: 15px; padding: 30px; text-align: center; max-width: 450px; width: 90%; box-shadow: 0 0 30px rgba(155, 89, 182, 0.4); position: relative; animation: modalBounceIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards; }
.welcome-modal img { width: 100px; height: 100px; border-radius: 50%; border: 3px solid var(--accent-yellow); margin-bottom: 15px; box-shadow: 0 0 15px var(--accent-yellow); }
.welcome-modal h2 { margin: 0 0 10px 0; color: var(--text-main); font-size: 1.8em; }
.welcome-modal .best-rank { background: rgba(0,0,0,0.2); padding: 15px; border-radius: 8px; border: 1px solid var(--border); margin: 20px 0; }
.welcome-modal .best-rank span { display: block; font-size: 2em; margin-bottom: 5px; }

.close-modal-btn { position: absolute; top: 10px; right: 15px; background: transparent; border: none; color: var(--text-muted); font-size: 1.5em; cursor: pointer; transition: color 0.2s; }
.close-modal-btn:hover { color: var(--accent-red); }

.rank-progress-wrapper { width: 100%; margin-top: 10px; }
.rank-progress-label { font-size: 0.7em; color: var(--text-muted); display: flex; justify-content: space-between; margin-bottom: 5px; }
.progress-bar-bg { width: 100%; height: 8px; background: rgba(0,0,0,0.3); border-radius: 4px; overflow: hidden; box-shadow: inset 0 2px 4px rgba(0,0,0,0.5); }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent-blue), #4bc0c0); transition: width 1s ease-out; box-shadow: 0 0 10px rgba(75, 192, 192, 0.5); }

/* 🔥 FIX: Increased min-height to balance with the Meal Card and give Emoji Padding */
.radar-container { position: relative; width: 100%; height: 100%; min-height: 380px; }

#controller-canvas { width: 100%; height: 350px; background: #0c0c0c; border-radius: 8px; border: 1px solid var(--border); box-shadow: inset 0 0 20px rgba(0,0,0,0.8); }
.face-buttons { display: grid; grid-template-columns: 40px 40px 40px; grid-template-rows: 40px 40px 40px; gap: 5px; justify-content: center; align-items: center; margin-top: 20px; }
.f-btn { width: 40px; height: 40px; border-radius: 50%; background: rgba(0,0,0,0.5); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-weight: bold; color: var(--text-muted); transition: 0.1s; }
.f-btn.active.y { background: var(--accent-yellow); color: #000; box-shadow: 0 0 15px var(--accent-yellow); border-color: var(--accent-yellow); }
.f-btn.active.b { background: var(--accent-red); color: #fff; box-shadow: 0 0 15px var(--accent-red); border-color: var(--accent-red); }
.f-btn.active.a { background: var(--accent-green); color: #000; box-shadow: 0 0 15px var(--accent-green); border-color: var(--accent-green); }
.f-btn.active.x { background: var(--accent-blue); color: #fff; box-shadow: 0 0 15px var(--accent-blue); border-color: var(--accent-blue); }
.c-pos-top { grid-column: 2; grid-row: 1; }
.c-pos-left { grid-column: 1; grid-row: 2; }
.c-pos-right { grid-column: 3; grid-row: 2; }
.c-pos-bottom { grid-column: 2; grid-row: 3; }

.credits-badge { background: rgba(255,215,0,0.2); color: #ffd700; padding: 4px 10px; border-radius: 20px; font-size: 0.8em; font-weight: bold; border: 1px solid #ffd700; box-shadow: 0 0 10px rgba(255,215,0,0.2); }
#sound-preview-container, #tts-preview-container { background: rgba(0,0,0,0.3); padding: 15px; border-radius: 8px; border: 1px dashed var(--accent-green); margin-top: 20px; }

.info-tooltip { position: relative; display: inline-block; cursor: help; }
.info-tooltip .tooltip-text { visibility: hidden; width: 220px; background-color: rgba(0,0,0,0.9); color: #fff; text-align: left; border-radius: 8px; padding: 12px; position: absolute; z-index: 100; bottom: 125%; left: 50%; margin-left: -110px; opacity: 0; transition: opacity 0.3s; font-size: 0.8em; font-weight: normal; line-height: 1.4; border: 1px solid var(--border); box-shadow: 0 5px 15px rgba(0,0,0,0.5); }
.info-tooltip .tooltip-text::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border-width: 5px; border-style: solid; border-color: rgba(0,0,0,0.9) transparent transparent transparent; }
.info-tooltip:hover .tooltip-text { visibility: visible; opacity: 1; }

.disabled-look { opacity: 0.4 !important; filter: grayscale(100%); pointer-events: none; cursor: not-allowed !important; }

/* =========================================================
   COACH PAGE EXPANSIONS (FEATURE 2)
   ========================================================= */

.coach-terminal { background: #050505; border: 1px solid var(--accent-green); box-shadow: 0 0 15px rgba(46, 213, 115, 0.2), inset 0 0 20px rgba(0,0,0,0.8); border-radius: 8px; padding: 15px; position: relative; margin-top: 15px; }
#coach-roast-output { color: #2ed573; text-shadow: none; font-family: 'Courier New', Courier, monospace; font-size: 0.95em; line-height: 1.5; min-height: 60px; white-space: pre-wrap; }

.archetype-badge { background: linear-gradient(135deg, rgba(241, 196, 15, 0.15), rgba(0,0,0,0.5)); border: 1px solid var(--accent-yellow); color: var(--accent-yellow); padding: 12px; border-radius: 8px; text-align: center; font-weight: bold; text-transform: uppercase; letter-spacing: 2px; margin-bottom: 15px; box-shadow: 0 0 15px rgba(241, 196, 15, 0.2); font-size: 0.9em; }

.delta-container { background: rgba(0,0,0,0.2); border-radius: 8px; padding: 10px 15px; border: 1px solid var(--border); margin-top: 15px; }
.delta-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.05); font-size: 0.85em; color: var(--text-main); }
.delta-row:last-child { border-bottom: none; }
.delta-val.good { color: var(--accent-green); font-weight: bold; }
.delta-val.bad { color: var(--accent-red); font-weight: bold; }
.delta-val.neutral { color: var(--text-muted); }

/* =========================================================
   GHOST AUTOMATION CSS 
   ========================================================= */
.ghost-cursor { position: fixed; width: 25px; height: 25px; background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%232ed573"><path d="M7 2l12 11.2-5.8.5 3.3 7.3-2.3.9-3.2-7.4-4.4 5z"/></svg>'); background-size: contain; background-repeat: no-repeat; z-index: 100000; pointer-events: none; transition: left 0.5s ease-in-out, top 0.5s ease-in-out, transform 0.1s; filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.5)); }
.ghost-cursor.clicking { transform: scale(0.8); }
.ghost-highlight { box-shadow: 0 0 15px var(--accent-green), inset 0 0 10px var(--accent-green) !important; border-color: var(--accent-green) !important; transition: all 0.3s ease; }
.ghost-typing::after { content: '|'; animation: blink 1s step-end infinite; color: var(--accent-green); font-weight: bold; }
@keyframes blink { 50% { opacity: 0; } }

/* History list in Audio Studio */
.studio-history-list { margin-top: 15px; display: flex; flex-direction: column; gap: 8px; }
.studio-history-item { background: rgba(0,0,0,0.2); border: 1px solid var(--border); padding: 8px 12px; border-radius: 8px; display: flex; justify-content: space-between; align-items: center; font-size: 0.85em; }

/* =========================================================
   AI QUICK ACTION STYLES
   ========================================================= */
.quick-action-btn {
    display: flex; align-items: center; padding: 10px 15px;
    background: rgba(0,0,0,0.2); border: 1px solid var(--border);
    border-left: 4px solid var(--text-main); border-radius: 8px;
    color: var(--text-main); font-size: 0.9em; font-weight: bold;
    cursor: pointer; transition: all 0.2s; box-shadow: inset 2px 2px 5px var(--shadow-dark);
    position: relative; overflow: hidden;
}
.quick-action-btn:hover {
    background: rgba(255,255,255,0.05); transform: translateY(-2px);
    box-shadow: 4px 4px 8px var(--shadow-dark);
}
.quick-action-btn:active {
    transform: translateY(0); box-shadow: inset 2px 2px 5px var(--shadow-dark);
}
.qa-controls {
    position: absolute; right: 5px; top: 5px; bottom: 5px;
    display: flex; gap: 5px; opacity: 0; transition: opacity 0.2s;
    background: linear-gradient(90deg, transparent, rgba(0,0,0,0.8) 20%); padding-left: 20px; align-items: center;
}
.quick-action-btn:hover .qa-controls { opacity: 1; }
.qa-icon-btn {
    background: transparent; border: none; cursor: pointer; font-size: 1.1em; transition: 0.2s; padding: 2px;
}
.qa-icon-btn:hover { transform: scale(1.2); }

/* =========================================================
   MUSIC STUDIO GENRE CARDS
   ========================================================= */
.vibe-cards-grid { display: grid; gap: 10px; margin-bottom: 15px; }
.vibe-card { background: rgba(0,0,0,0.2); border: 1px solid var(--border); padding: 10px; border-radius: 8px; text-align: center; cursor: pointer; transition: 0.2s; font-size: 0.85em; color: var(--text-muted); font-weight: bold; }
.vibe-card:hover { background: rgba(255,255,255,0.05); color: var(--text-main); }
.vibe-card.active { background: rgba(155, 89, 182, 0.2); border-color: var(--accent-purple); color: var(--accent-purple); box-shadow: inset 0 0 10px rgba(155, 89, 182, 0.2); }

/* =========================================================
   AI FOOTER (STATIC 2-LINE)
   ========================================================= */
.ai-footer-container {
    flex: 1;
    display: flex; align-items: flex-start;
    padding-top: 5px; 
}

.ai-footer-text {
    color: var(--accent-green);
    font-size: 0.85em;
    font-weight: bold;
    line-height: 1.4 !important;
    max-width: 100%; cursor: default;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    white-space: normal !important;
    position: relative !important;
}

/* Helper class to trigger a short fade when text swaps (JS will add/remove this) */
.ai-text-swap {
    animation: textFadeSwap 0.5s ease-in-out;
}

@keyframes textFadeSwap {
    0% { opacity: 0; filter: blur(2px); transform: translateY(2px); }
    100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}

/* =========================================================
   NEW AI FEATURES (YOUTUBE, HIGHLIGHT, TACTICS)
   ========================================================= */
.ai-target-highlight {
    outline: 3px solid var(--accent-yellow) !important; outline-offset: 4px;
    box-shadow: 0 0 20px var(--accent-yellow), inset 0 0 15px var(--accent-yellow) !important;
    animation: aiGlowPulse 1s infinite alternate !important; border-radius: 4px;
    z-index: 9999;
    transition: all 0.3s ease;
}

@keyframes aiGlowPulse {
    from { box-shadow: 0 0 10px var(--accent-yellow), inset 0 0 5px var(--accent-yellow); outline-color: rgba(241, 196, 15, 0.5); }
    to { box-shadow: 0 0 25px var(--accent-yellow), inset 0 0 15px var(--accent-yellow); outline-color: rgba(241, 196, 15, 1); }
}

/* Tactics Board Objects */
#tactics-container img {
    user-select: none;
    -webkit-user-drag: none;
}
.tactic-car, .tactic-ball {
    filter: drop-shadow(3px 3px 8px rgba(0,0,0,0.8));
}

/* =========================================================
   ROCKET LEAGUE RANK COLORS
   ========================================================= */
.rank-bronze { color: #cd7f32 !important; font-weight: bold; }
.rank-silver { color: #a8b0b8 !important; font-weight: bold; }
.rank-gold { color: #f1c40f !important; font-weight: bold; }
.rank-plat { color: #00a8ff !important; font-weight: bold; }
.rank-diamond { color: #00d2d3 !important; font-weight: bold; text-shadow: 0 0 5px rgba(0, 210, 211, 0.4); }
.rank-champ { color: #9b59b6 !important; font-weight: bold; text-shadow: 0 0 5px rgba(155, 89, 182, 0.4); }
.rank-gc { color: #e74c3c !important; font-weight: bold; text-shadow: 0 0 8px rgba(231, 76, 60, 0.5); }
.rank-ssl { color: #ffffff !important; font-weight: bold; text-shadow: 0 0 10px rgba(255, 255, 255, 0.8), 0 0 20px #e74c3c; }

/* =========================================================
   COMPONENT ARTWORK BACKGROUNDS
   ========================================================= */
.component-bg-pong {
    background: linear-gradient(to right, rgba(36, 37, 41, 1) 0%, rgba(36, 37, 41, 0.6) 50%, rgba(36, 37, 41, 0.2) 100%), url('./img/misc/Nissan_Silvia_S13_hero_art.webp') center right / cover no-repeat !important;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8) !important;
}

.component-bg-trainer {
    background: linear-gradient(to right, rgba(36, 37, 41, 1) 0%, rgba(36, 37, 41, 0.8) 40%, rgba(36, 37, 41, 0.3) 100%), url('./img/misc/Patch_v1.74_header.webp') center right / cover no-repeat !important;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8) !important;
}

.component-bg-scraper {
    background: linear-gradient(to right, rgba(36, 37, 41, 1) 0%, rgba(36, 37, 41, 0.8) 40%, rgba(36, 37, 41, 0.3) 100%), url('./img/misc/Match_History_promo2.webp') center right / cover no-repeat !important;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8) !important;
}

.component-bg-tactics {
    background: linear-gradient(to right, rgba(36, 37, 41, 1) 0%, rgba(36, 37, 41, 0.8) 40%, rgba(36, 37, 41, 0.3) 100%), url('./img/misc/Dueling_Dragons_goal_explosion.webp') center right / cover no-repeat !important;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.8) !important;
}

/* =========================================================
   MAINTENANCE OVERLAY
   ========================================================= */
.maintenance-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 25, 15, 0.85); /* Kitchen tinted dark */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999; /* Absolute highest to cover everything */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.maintenance-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.maintenance-content {
    background: var(--bg);
    border: 2px solid var(--accent-green);
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.8), 0 0 20px rgba(46, 213, 115, 0.2);
    transform: translateY(20px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.maintenance-overlay.active .maintenance-content {
    transform: translateY(0);
}

.maintenance-icon {
    font-size: 4.5em;
    margin-bottom: 20px;
    display: inline-block;
    animation: chefBounceSpin 2.5s infinite ease-in-out;
}

@keyframes chefBounceSpin {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-15px) rotate(10deg); filter: drop-shadow(0 15px 10px rgba(46,213,115,0.4)); }
}

.maintenance-content h2 {
    color: var(--accent-green);
    margin: 0 0 10px 0;
    font-size: 2.2em;
    text-shadow: 0 0 10px rgba(46, 213, 115, 0.3);
}

.maintenance-content p {
    color: var(--text-main);
    font-size: 1.1em;
    line-height: 1.5;
    margin: 0;
}

/* =========================================================
   CLIPS MASONRY FEED
   ========================================================= */
.clips-masonry {
    column-count: 3;
    column-gap: 25px;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.clip-card {
    break-inside: avoid;
    margin-bottom: 25px;
    border-top-color: var(--accent-red);
    transition: transform 0.2s, box-shadow 0.2s;
}

.clip-card:hover {
    transform: translateY(-4px);
    box-shadow: 12px 12px 20px var(--shadow-dark), -12px -12px 20px var(--shadow-light);
}

.clip-media-wrapper {
    width: 100%;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.8);
}

@media (max-width: 1100px) {
    .clips-masonry { column-count: 2; }
}
@media (max-width: 700px) {
    .clips-masonry { column-count: 1; }
}