/* === FLOATING VIEWER CONTROLS === */
#viewerControlsContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking through to the game */
    z-index: 600;
}

.viewer-btn-spot {
    position: absolute;
    pointer-events: auto; /* Lets you click the buttons */
    border-radius: 99px;
    padding: 10px 24px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.viewer-btn-spot:hover {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

/* The 4 Fixed Positions */
.spot-0 { top: 20px; left: 20px; } /* Top Left */
.spot-1 { bottom: 20px; left: 20px; } /* Bottom Left */
.spot-2 { bottom: 20px; left: 50%; transform: translateX(-50%); } /* Bottom Middle */
.spot-3 { bottom: 20px; right: 20px; } /* Bottom Right */

/* Hover & Click Animations (Explicitly keeping spot-2 centered) */
.spot-0:hover, .spot-1:hover, .spot-3:hover { transform: translateY(-2px); }
.spot-2:hover { transform: translateX(-50%) translateY(-2px); }

.spot-0:active, .spot-1:active, .spot-3:active { transform: translateY(1px) scale(0.96); }
.spot-2:active { transform: translateX(-50%) translateY(1px) scale(0.96); }

/* === SETTINGS REORDERING UI (In Hub/Info Panel) === */
.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0,0,0,0.3);
    padding: 12px 15px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1);
    margin-bottom: 10px;
}

.settings-arrows {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-arrow-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: white;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    cursor: pointer;
    opacity: 0.6;
    transition: 0.2s;
}

.settings-arrow-icon:hover {
    opacity: 1;
    stroke: var(--accent-color);
}

.settings-arrow-icon.disabled {
    opacity: 0.1;
    cursor: default;
}

/* === Buttons (Unified Glass Theme) === */
/* Added :not(.viewer-btn-spot) so it doesn't break the floating tools */
button:not(.dock-btn):not(.viewer-btn-spot), .btn:not(.dock-btn) {
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    color: var(--text-primary);
    border-radius: 99px; 
    padding: 10px 20px; 
    font-size: 14px; 
    font-weight: 500;
    cursor: pointer; 
    transition: all 0.25s ease;
    outline: none;
}
button:not(.dock-btn):not(.viewer-btn-spot):hover, .btn:not(.dock-btn):hover {
    background: rgba(255,255,255,0.08);
    transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0,0,0,0.45), 0 0 12px rgba(255,255,255,0.06) inset;
}

/* === Viewer === */
.viewer {
    display: none; flex-direction: column; margin-top: 20px;
    background: #000; border-radius: var(--radius-lg); overflow: hidden;
    height: 80vh; border: 1px solid var(--glass-border); position: relative; z-index: 500;
    box-shadow: 0 50px 100px rgba(0,0,0,0.8);
}
.viewer iframe { border: 0; flex: 1; width: 100%; height: 100%; }

/* =========================================
   LIQUID GLASS THEME (Refined)
   ========================================= */
:root {
    zoom: 0.8;
    --glass-bg: rgba(30, 30, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shine: rgba(255, 255, 255, 0.05);
    --glass-backdrop: blur(40px) saturate(180%);
    --accent-color: rgb(0, 174, 255);
    --ios-green: #34c759;
    --text-primary: #ffffff;
    --text-secondary: #d1d1d6;
    --radius-lg: 28px;
    --radius-md: 18px;
    --shadow-soft: 
        0 20px 40px rgba(0,0,0,0.4),
        0 0 0 1px rgba(255,255,255,0.1) inset;
}

* {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

body {
    margin: 0;
    color: var(--text-primary);
    background-color: #000;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(14, 165, 164, 0.25), transparent 40%), 
        radial-gradient(circle at 85% 30%, rgba(120, 50, 200, 0.15), transparent 40%),
        linear-gradient(180deg, #050505 0%, #111 100%);
    background-attachment: fixed;
    min-height: 100vh;
    padding-bottom: 150px; 
    overflow-x: hidden;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-backdrop);
    -webkit-backdrop-filter: var(--glass-backdrop);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-soft);
    position: relative;
    overflow: hidden;
}

.glass-panel::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 100%);
    pointer-events: none;
    z-index: 0;
}

.icon {
    width: 32px; height: 32px;
    stroke: white; stroke-width: 2;
    fill: none; stroke-linecap: round; stroke-linejoin: round;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    position: relative; z-index: 2;
}

.header {
    background: transparent;
    padding: 60px 20px 40px;
    text-align: center;
}

.version-input-bubble {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 10px;
    background: #1a2a3a; border: 1px solid var(--christmas-green);
    border-radius: var(--radius-md); padding: 10px; width: 250px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7); z-index: 1000;
    display: none; flex-direction: column; gap: 8px;
    -webkit-text-fill-color: white; 
    text-shadow: none;
    font-size: 16px;
    letter-spacing: normal;
    text-align: left;
}

.header h1 {
    margin: 0; font-size: 56px; font-weight: 700; letter-spacing: -1.5px;
    background: linear-gradient(180deg, #fff 20%, rgba(255,255,255,0.6) 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    text-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.header .version {
    font-size: 14px; background: rgba(255,255,255,0.1); padding: 4px 12px;
    border-radius: 99px; color: #fff; -webkit-text-fill-color: initial;
    vertical-align: middle; margin-left: 12px; 
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
}

.header p { color: var(--text-secondary); font-size: 17px; margin-top: 12px; font-weight: 400; }
.header a { color: var(--accent-color); text-decoration: none; transition: 0.2s; font-weight: 500; }
.header a:hover { color: #fff; text-shadow: 0 0 15px var(--accent-color); }

.container { max-width: 1280px; margin: 0 auto; padding: 0 30px; }

#gameGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 30px;
    justify-items: center;
}

.card {
    /* Increase opacity from 0.3 to 0.75 so it still looks solid without the blur */
    background: rgba(40, 40, 40, 0.75); 
    
    /* REMOVED FOR PERFORMANCE: */
    /* backdrop-filter: blur(20px); */
    /* -webkit-backdrop-filter: blur(20px); */
    
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-lg);
    padding: 15px;
    text-align: center;
    width: 100%;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s; /* Simplified transitions */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    position: relative;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-10px) scale(1.03);
    background: rgba(60, 60, 60, 0.4);
    border-color: rgba(255,255,255,0.3);
    box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.2) inset;
}

.card::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%);
    opacity: 0; transform: scale(0.5); transition: 0.5s ease-out;
    pointer-events: none;
}
.card:hover::before { opacity: 1; transform: scale(1); }

.card img { 
    width: 100%; height: 160px; object-fit: cover; 
    border-radius: var(--radius-md); margin-bottom: 15px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.card h3 { 
    font-size: 16px; font-weight: 600; margin: 0 0 10px; color: #fff; 
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; 
}

.card .btn {
    width: 100%; margin-top: 5px; 
    font-weight: 600;
}
.card:hover .btn {
    background: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-color);
    transform: none;
}

#versionInputBubble button, 
#tourWelcomeModal button:first-of-type,
#loginGate button {
    background: var(--accent-color) !important;
    border: 1px solid var(--accent-color) !important;
    color: white !important;
    box-shadow: 0 4px 10px rgba(14, 165, 164, 0.5) !important;
    transform: none; 
}
#versionInputBubble button:hover, 
#tourWelcomeModal button:first-of-type:hover,
#loginGate button:hover {
    background: #007978 !important;
    box-shadow: 0 0 20px var(--accent-color) !important;
    transform: translateY(-2px) scale(1.02) !important;
}

.collapsible-wrapper { position: absolute; top: 30px; right: 30px; z-index: 50; }
.collapsible-header {
    background: rgba(20, 20, 20, 0.6); backdrop-filter: blur(20px); 
    padding: 10px 20px; border-radius: 99px; 
    border: 1px solid rgba(255,255,255,0.1); 
    cursor: pointer; display: flex; align-items: center; gap: 10px; 
    color: white; font-size: 14px; font-weight: 600;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.collapsible-header:hover { 
    background: rgba(50,50,50,0.8); 
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 15px rgba(255,255,255,0.1) inset;
}

.collapsible-content {
    background: rgba(30, 30, 30, 0.85); backdrop-filter: blur(40px); margin-top: 15px;
    padding: 25px; border-radius: var(--radius-lg); 
    border: 1px solid rgba(255,255,255,0.15);
    display: none; position: absolute; right: 0; width: 320px; max-height: 500px; overflow-y: auto;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
}

.dock-container {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
}

.floating-panel {
    width: 380px;
    background: rgba(40, 40, 40, 0.65);
    backdrop-filter: blur(50px) saturate(200%);
    -webkit-backdrop-filter: blur(50px) saturate(200%);
    border: 1px solid rgba(255,255,255,0.18);
    border-top: 1px solid rgba(255,255,255,0.3);
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
    border-radius: 32px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    opacity: 0;
    transform: translateY(40px) scale(0.9);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: absolute;
    bottom: 140px;
}

.floating-panel.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

#searchInput {
    width: 100%; 
    background: rgba(0,0,0,0.3); 
    border: 1px solid rgba(255,255,255,0.1);
    color: white; padding: 16px 20px; border-radius: 18px;
    font-size: 18px; outline: none;
    transition: 0.2s;
}
#searchInput:focus {
    background: rgba(0,0,0,0.5);
    border-color: var(--accent-color);
}
#searchInput::placeholder { color: #888; }
#suggestions { text-align: center; font-size: 14px; color: var(--accent-color); padding-top: 5px; margin:0; }

#canvasPanel {
    flex-direction: row; align-items: center; justify-content: space-between;
    width: 300px;
}
#canvasPanel span { font-weight: 600; font-size: 17px; color: white; }

.ios-switch { position: relative; width: 56px; height: 34px; }
.ios-switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255,255,255,0.15);
    transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 28px; width: 28px;
    left: 3px; bottom: 3px; background-color: white;
    transition: .4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
input:checked + .slider { background-color: var(--ios-green); }
input:checked + .slider:before { transform: translateX(22px); }

.bottom-dock {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(20, 20, 20, 0.5);
    backdrop-filter: blur(60px) saturate(180%);
    -webkit-backdrop-filter: blur(60px) saturate(180%);
    border: 1px solid rgba(255,255,255,0.15);
    border-top: 1px solid rgba(255,255,255,0.25);
    padding: 14px 20px;
    border-radius: 40px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: transform 0.3s ease;
}

.dock-btn {
    width: 68px; height: 68px;
    border-radius: 22px; 
    background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02));
    border: 1px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.dock-btn:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-15px) scale(1.15);
    margin: 0 10px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.4);
    z-index: 10;
}

.dock-btn.active-mode {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 0 25px rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.5);
}

.dock-btn::after {
    content: attr(data-tooltip);
    position: absolute; top: -50px; left: 50%;
    transform: translateX(-50%) scale(0.8);
    background: rgba(0,0,0,0.8); color: white;
    padding: 6px 12px; border-radius: 8px;
    font-size: 14px; font-weight: 600;
    opacity: 0; pointer-events: none; transition: 0.2s;
    backdrop-filter: blur(10px);
}
.dock-btn:hover::after { opacity: 1; transform: translateX(-50%) scale(1); top: -60px; }

.dock-sep { width: 1px; height: 40px; background: rgba(255,255,255,0.15); margin: 0 5px; }

#loginGate, #tourWelcomeModal { 
    background-image: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?q=80&w=2564&auto=format&fit=crop') !important; 
    background-size: cover; background-position: center; 
}
#loginGate::before, #tourWelcomeModal::before { 
    content: ""; position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
    background: rgba(0,0,0,0.5); backdrop-filter: blur(30px); z-index: -1; 
}

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; border: 2px solid #111; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

.tour-highlight {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-md);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    pointer-events: none; 
    z-index: 100000;
}

@media (max-width: 768px) {
    .dock-btn { width: 55px; height: 55px; }
    .icon { width: 26px; height: 26px; }
    .floating-panel { width: 90vw; bottom: 110px; }
    .header h1 { font-size: 36px; }
    #gameGrid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

.header .version-container {
    position: relative;
    display: inline-block;
}

.header .version {
    cursor: pointer;
    user-select: none;
}

.version-input-bubble {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    background: #111;
    border: 1px solid var(--accent-color );
    border-radius: var(--radius-md);
    padding: 10px;
    width: 250px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
    z-index: 1000;
    display: none;
    flex-direction: column;
    gap: 8px;
}



.version-input-bubble::before {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 8px;
    border-style: solid;
    border-color: transparent transparent var(--accent-color) transparent;
}

.version-input-bubble textarea {
    width: 100%;
    height: 80px;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: white;
    resize: none;
    font-size: 14px;
    outline: none;
}
.version-input-bubble textarea:focus {
    border-color: var(--accent-color);
}
/* === Secret App Fullscreen Logic === */
/* This class ensures the apps actually cover the whole screen */
.secret-fullscreen-app {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 9999; /* Sits on top of EVERYTHING */
    background: #000;
}

/* Force the iframe to fill that container completely */
.secret-iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure the dock stays visible on top so you can switch back */
.bottom-dock {
    z-index: 10000 !important;
}
/* This forces the section to ignore the page margins and fill the viewport */
/* This forces the section to ignore the page margins and fill the viewport */
.fullscreen-app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 800; /* Stays above the grid, but BELOW the dock (1000) and countdown (10000) */
    background: #000; 
    display: none; /* Controlled by JS */
}

.fullscreen-app.active-section {
    display: block;
}

/* This forces the embed to fill 100% of that fixed section */
.fullscreen-app .app-frame {
    width: 100%;
    height: 100%; 
    border: none;
    border-radius: 0; 
    display: block;
}

/* Ensure the dock is always on top so you can switch back to Games */
.bottom-dock {
    z-index: 1000 !important;
}

    /* --- Global Top Bar --- */
    .top-bar {
        position: fixed; top: 0; left: 0; width: 100%;
        padding: 15px 24px; display: flex; justify-content: flex-start;
        align-items: center; z-index: 9999; pointer-events: none;
    }
    .top-bar > * { pointer-events: auto; }
    .brand-container {
        display: flex; align-items: center; gap: 12px;
        background: rgba(0, 0, 0, 0.5); padding: 8px 16px;
        border-radius: 12px; backdrop-filter: blur(8px);
        border: 1px solid rgba(255,255,255,0.05);
    }
    .brand-icon { color: var(--accent-color, #00C9FF); }
    .brand-title {
        font-size: 18px; font-weight: 800;
        font-family: 'Trebuchet MS', sans-serif; letter-spacing: 1px;
        background: linear-gradient(90deg, #00C9FF 0%, #92FE9D 100%);
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    }

    /* --- Homepage Layout --- */
    .home-layout {
        padding: 90px 40px 120px 40px; /* Fits between top-bar and dock */
        display: flex; flex-direction: column; gap: 40px;
        max-width: 1200px; margin: 0 auto; height: 100%; overflow-y: auto;
    }
    .home-header-row {
        display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; flex-wrap: wrap;
    }
    .home-widget {
        background: rgba(20, 20, 20, 0.6); border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px; padding: 24px; backdrop-filter: blur(10px);
        flex: 1; min-width: 280px; box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    }
    .home-widget h3 { margin-top: 0; color: white; font-size: 18px; margin-bottom: 15px; }
    
    .home-section-title { color: white; margin-bottom: 20px; font-size: 22px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
    .home-grid {
        display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px;
    }
    
    /* --- Home Cards (Apps & Links) --- */
.home-card {
    background: rgba(40, 40, 40, 0.75); /* Matched opacity */
    
    /* REMOVED FOR PERFORMANCE: */
    /* backdrop-filter: blur(10px); */
    /* -webkit-backdrop-filter: blur(10px); */
    
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px; 
    padding: 24px 20px; 
    text-align: center; 
    cursor: pointer;
    /* ... rest of CSS */
}
    .home-card:hover {
        transform: translateY(-5px); background: rgba(255, 255, 255, 0.08); 
        border-color: var(--accent-color, #00C9FF); box-shadow: 0 8px 25px rgba(0,0,0,0.4);
    }
    .home-card svg { width: 36px; height: 36px; color: var(--accent-color, #00C9FF); }
    .home-card span { font-size: 16px; font-weight: 500; }
     /* Settings Page Layout Fixes */
    .settings-group { margin-bottom: 30px; text-align: left; }
    .settings-group-title { color: #fff; font-size: 18px; margin-bottom: 15px; font-weight: 600; padding-left: 5px; }
    .settings-card { background: rgba(30, 30, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 0 20px; backdrop-filter: blur(10px); }
    .settings-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .settings-row:last-child { border-bottom: none; }
    .settings-info { display: flex; flex-direction: column; gap: 6px; max-width: 70%; }
    .settings-label { color: #fff; font-size: 16px; font-weight: 500; }
    .settings-desc { color: rgba(255, 255, 255, 0.5); font-size: 13px; line-height: 1.4; }
    
    /* Settings Inputs & Buttons */
    .settings-input { background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 10px 15px; border-radius: 10px; outline: none; transition: 0.3s; }
    .settings-input:focus { border-color: var(--accent-color, #00aeff); }
    .settings-btn { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255, 255, 255, 0.2); padding: 10px 18px; border-radius: 10px; cursor: pointer; transition: 0.2s; font-weight: 500; }
    .settings-btn:hover { background: rgba(255, 255, 255, 0.2); }
    .settings-btn.primary { background: var(--accent-color, #00aeff); border: none; color: #fff; }

    /* iOS Style Toggle Switch Fix */
    .ios-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
    .ios-switch input { opacity: 0; width: 0; height: 0; }
    .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.2); transition: .4s; border-radius: 34px; }
    .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
    input:checked + .slider { background-color: var(--accent-color, #00aeff); }
    input:checked + .slider:before { transform: translateX(22px); }
/* === Movable & Collapsible Dock === */
.dock-container.dragged {
    left: auto;
    transform: none; /* Removes the centering when dragged freely */
}

.dock-drag-handle {
    cursor: grab;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    color: rgba(255, 255, 255, 0.4);
    transition: color 0.2s;
}
.dock-drag-handle:hover { color: rgba(255, 255, 255, 0.9); }
.dock-drag-handle:active { cursor: grabbing; }

.dock-toggle-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    outline: none;
}
.dock-toggle-btn:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

#dockToggleIcon {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Collapsed State Layout */
.bottom-dock.collapsed .dock-btn:not(.active-mode) {
    display: none !important; /* Hides all non-active buttons */
}
.bottom-dock.collapsed .dock-sep:not(.collapse-sep) {
    display: none !important; /* Hides internal separators */
}
.bottom-dock.collapsed #dockToggleIcon {
    transform: rotate(180deg); /* Flips the arrow */
}
/* === Authentication Modal === */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-box {
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 30px;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.auth-toggle-text {
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
    text-align: center;
    margin-top: 5px;
}
/* --- CINEMATIC INTRO ANIMATIONS --- */
.zoom-out-of-bounds {
    animation: cinematicZoom 2.5s cubic-bezier(0.55, 0.085, 0.68, 0.53) forwards !important;
}

@keyframes cinematicZoom {
    0% { transform: translateX(-50%) scale(1); opacity: 1; }
    70% { transform: translateX(-50%) scale(15); opacity: 0.9; filter: blur(2px); }
    100% { transform: translateX(-50%) scale(50); opacity: 0; filter: blur(10px); display: none; }
}

/* Pre-reveal state for new UI elements */
.ui-hidden {
    opacity: 0 !important;
    transform: translateY(40px) !important;
    pointer-events: none;
}

/* The sleek slide-up reveal */
.ui-reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
    transition: all 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) !important;
    pointer-events: auto;
}
/* Position for the 5th Viewer Control Button (Favorites) */
.spot-4 { top: 20px; right: 20px; } 

.spot-4:hover { transform: translateY(-2px); }
.spot-4:active { transform: translateY(1px) scale(0.96); }

/* Styling the dropdown options to match the dark theme */
select.settings-input option {
    background: #1a1a1a;
    color: white;
    padding: 10px;

}
/* Inline Glass Dropdowns */
.glass-select {
    background: transparent;
    color: var(--accent-color, #00C9FF);
    border: none;
    outline: none;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    padding: 0 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: 0.2s;
}

.glass-select option {
    background: rgba(20, 20, 20, 0.95);
    color: white;
    font-weight: 500;
    text-transform: none;
}

.glass-select:hover {
    color: white;
    text-shadow: 0 0 10px var(--accent-color);
}
/* Stack the sections properly */
/* === FLOATING VIEWER CONTROLS === */
#viewerControlsContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allows clicking through to the game */
    z-index: 600;
}

.viewer-btn-spot {
    position: absolute;
    pointer-events: auto; /* Lets you click the buttons */
    border-radius: 99px;
    padding: 10px 24px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.viewer-btn-spot:hover {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.4);
}

/* === STREAM CARDS / MIXER INTERFACE === */
.stream-card {
    background: rgba(20, 20, 20, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    display: none; /* Hidden by default until stream detected */
    flex-direction: column;
    gap: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(8px);
}

.stream-card.active {
    display: flex; /* Script will toggle this */
}

/* Music Layout - Cover Art Left, Text Right */
.music-layout .stream-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.music-cover {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #333;
    object-fit: cover;
}

.music-text {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.music-title {
    font-weight: bold;
    font-size: 15px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
    margin-bottom: 4px;
}

.track-artist {
    color: #a0a0a0;
    font-size: 13px;
}

/* Movie Layout - Title centered above controls */
.movie-layout .mp-info {
    text-align: center;
    margin-bottom: 5px;
}

.movie-layout .movie-title {
    font-weight: bold;
    font-size: 16px;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

/* Shared Controls Formatting */
.mp-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.mp-controls button, .ctrl-btn {
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, opacity 0.2s;
    padding: 5px;
    opacity: 0.8;
}

.mp-controls button:hover, .ctrl-btn:hover {
    transform: scale(1.1);
    opacity: 1;
    color: #00C9FF; /* Highlight color */
}

.mp-controls svg, .ctrl-btn svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

/* Shared Volume Sliders */
.volume-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 5px;
}

.volume-container svg {
    opacity: 0.7;
    width: 18px;
    height: 18px;
    fill: white;
}

.volume-slider {
    flex: 1;
    -webkit-appearance: none;
    height: 5px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #00C9FF;
    cursor: pointer;
    transition: transform 0.1s;
}

.volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}
/* === FLOATING VIEWER CONTROLS === */
#viewerControlsContainer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 600;
}

.viewer-btn-spot {
    position: absolute;
    pointer-events: auto;
    border-radius: 99px;
    padding: 10px 24px;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.viewer-btn-spot:hover {
    background: rgba(255,255,255,0.15);
    box-shadow: 0 0 15px rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

.spot-0 { top: 20px; left: 20px; }
.spot-1 { bottom: 20px; left: 20px; }
.spot-2 { bottom: 20px; left: 50%; transform: translateX(-50%); }
.spot-3 { bottom: 20px; right: 20px; }
.spot-4 { top: 20px; right: 20px; }

.spot-0:hover, .spot-1:hover, .spot-3:hover, .spot-4:hover { transform: translateY(-2px); }
.spot-2:hover { transform: translateX(-50%) translateY(-2px); }
.spot-0:active, .spot-1:active, .spot-3:active, .spot-4:active { transform: translateY(1px) scale(0.96); }
.spot-2:active { transform: translateX(-50%) translateY(1px) scale(0.96); }

/* === SETTINGS REORDERING UI === */
.settings-item {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.3); padding: 12px 15px; border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.1); margin-bottom: 10px;
}
.settings-arrows { display: flex; flex-direction: column; gap: 4px; }
.settings-arrow-icon { width: 18px; height: 18px; fill: none; stroke: white; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; cursor: pointer; opacity: 0.6; transition: 0.2s; }
.settings-arrow-icon:hover { opacity: 1; stroke: var(--accent-color); }
.settings-arrow-icon.disabled { opacity: 0.1; cursor: default; }

/* === Buttons === */
button:not(.dock-btn):not(.viewer-btn-spot), .btn:not(.dock-btn) {
    background: linear-gradient(145deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border); box-shadow: 0 4px 10px rgba(0,0,0,0.25);
    color: var(--text-primary); border-radius: 99px; padding: 10px 20px; 
    font-size: 14px; font-weight: 500; cursor: pointer; transition: all 0.25s ease; outline: none;
}
button:not(.dock-btn):not(.viewer-btn-spot):hover, .btn:not(.dock-btn):hover {
    background: rgba(255,255,255,0.08); transform: translateY(-2px) scale(1.01);
    box-shadow: 0 10px 20px rgba(0,0,0,0.45), 0 0 12px rgba(255,255,255,0.06) inset;
}

/* === Viewer === */
.viewer {
    display: none; flex-direction: column; margin-top: 20px;
    background: #000; border-radius: var(--radius-lg); overflow: hidden;
    height: 80vh; border: 1px solid var(--glass-border); position: relative; z-index: 500;
    box-shadow: 0 50px 100px rgba(0,0,0,0.8);
}
.viewer iframe { border: 0; flex: 1; width: 100%; height: 100%; }

/* === THEME === */
:root {
    --glass-bg: rgba(30, 30, 30, 0.4);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shine: rgba(255, 255, 255, 0.05);
    --glass-backdrop: blur(40px) saturate(180%);
    --accent-color: rgb(0, 174, 255);
    --ios-green: #34c759;
    --text-primary: #ffffff;
    --text-secondary: #d1d1d6;
    --radius-lg: 28px;
    --radius-md: 18px;
    --shadow-soft: 0 20px 40px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.1) inset;
}

* { box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif !important; -webkit-font-smoothing: antialiased; }
body { margin: 0; color: var(--text-primary); background-color: #000; background-image: radial-gradient(circle at 15% 50%, rgba(14, 165, 164, 0.25), transparent 40%), radial-gradient(circle at 85% 30%, rgba(120, 50, 200, 0.15), transparent 40%), linear-gradient(180deg, #050505 0%, #111 100%); background-attachment: fixed; min-height: 100vh; padding-bottom: 150px; overflow-x: hidden; }

.glass-panel { background: var(--glass-bg); backdrop-filter: var(--glass-backdrop); -webkit-backdrop-filter: var(--glass-backdrop); border: 1px solid var(--glass-border); box-shadow: var(--shadow-soft); position: relative; overflow: hidden; }
.glass-panel::after { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 50%; background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 100%); pointer-events: none; z-index: 0; }
.icon { width: 32px; height: 32px; stroke: white; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3)); position: relative; z-index: 2; }
.header { background: transparent; padding: 60px 20px 40px; text-align: center; }
.version-input-bubble { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 10px; background: #1a2a3a; border: 1px solid var(--accent-color); border-radius: var(--radius-md); padding: 10px; width: 250px; box-shadow: 0 10px 30px rgba(0,0,0,0.7); z-index: 1000; display: none; flex-direction: column; gap: 8px; -webkit-text-fill-color: white; text-shadow: none; font-size: 16px; letter-spacing: normal; text-align: left; }
.header h1 { margin: 0; font-size: 56px; font-weight: 700; letter-spacing: -1.5px; background: linear-gradient(180deg, #fff 20%, rgba(255,255,255,0.6) 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; text-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.header .version { font-size: 14px; background: rgba(255,255,255,0.1); padding: 4px 12px; border-radius: 99px; color: #fff; -webkit-text-fill-color: initial; vertical-align: middle; margin-left: 12px; border: 1px solid rgba(255,255,255,0.15); backdrop-filter: blur(10px); }
.header p { color: var(--text-secondary); font-size: 17px; margin-top: 12px; font-weight: 400; }
.header a { color: var(--accent-color); text-decoration: none; transition: 0.2s; font-weight: 500; }
.header a:hover { color: #fff; text-shadow: 0 0 15px var(--accent-color); }
.container { max-width: 1280px; margin: 0 auto; padding: 0 30px; }
#gameGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 30px; justify-items: center; }

.card { background: rgba(40, 40, 40, 0.3); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(255,255,255,0.08); border-radius: var(--radius-lg); padding: 15px; text-align: center; width: 100%; cursor: pointer; transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); box-shadow: 0 4px 15px rgba(0,0,0,0.2); position: relative; overflow: hidden; }
.card:hover { transform: translateY(-10px) scale(1.03); background: rgba(60, 60, 60, 0.4); border-color: rgba(255,255,255,0.3); box-shadow: 0 20px 40px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.2) inset; }
.card::before { content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, transparent 60%); opacity: 0; transform: scale(0.5); transition: 0.5s ease-out; pointer-events: none; }
.card:hover::before { opacity: 1; transform: scale(1); }
.card img { width: 100%; height: 160px; object-fit: cover; border-radius: var(--radius-md); margin-bottom: 15px; box-shadow: 0 5px 15px rgba(0,0,0,0.3); }
.card h3 { font-size: 16px; font-weight: 600; margin: 0 0 10px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .btn { width: 100%; margin-top: 5px; font-weight: 600; }
.card:hover .btn { background: var(--accent-color); box-shadow: 0 0 20px var(--accent-color); transform: none; }

#versionInputBubble button, #tourWelcomeModal button:first-of-type, #loginGate button { background: var(--accent-color) !important; border: 1px solid var(--accent-color) !important; color: white !important; box-shadow: 0 4px 10px rgba(14, 165, 164, 0.5) !important; transform: none; }
#versionInputBubble button:hover, #tourWelcomeModal button:first-of-type:hover, #loginGate button:hover { background: #007978 !important; box-shadow: 0 0 20px var(--accent-color) !important; transform: translateY(-2px) scale(1.02) !important; }

.collapsible-wrapper { position: absolute; top: 30px; right: 30px; z-index: 50; }
.collapsible-header { background: rgba(20, 20, 20, 0.6); backdrop-filter: blur(20px); padding: 10px 20px; border-radius: 99px; border: 1px solid rgba(255,255,255,0.1); cursor: pointer; display: flex; align-items: center; gap: 10px; color: white; font-size: 14px; font-weight: 600; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.collapsible-header:hover { background: rgba(50,50,50,0.8); transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 20px rgba(0,0,0,0.5), 0 0 15px rgba(255,255,255,0.1) inset; }
.collapsible-content { background: rgba(30, 30, 30, 0.85); backdrop-filter: blur(40px); margin-top: 15px; padding: 25px; border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,0.15); display: none; position: absolute; right: 0; width: 320px; max-height: 500px; overflow-y: auto; box-shadow: 0 30px 60px rgba(0,0,0,0.5); }

.dock-container { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; align-items: center; width: auto; }
.floating-panel { width: 380px; background: rgba(40, 40, 40, 0.65); backdrop-filter: blur(50px) saturate(200%); -webkit-backdrop-filter: blur(50px) saturate(200%); border: 1px solid rgba(255,255,255,0.18); border-top: 1px solid rgba(255,255,255,0.3); box-shadow: 0 40px 80px rgba(0,0,0,0.6); border-radius: 32px; padding: 20px; display: flex; flex-direction: column; gap: 15px; opacity: 0; transform: translateY(40px) scale(0.9); pointer-events: none; transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1); position: absolute; bottom: 140px; }
.floating-panel.active { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }

#searchInput { width: 100%; background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); color: white; padding: 16px 20px; border-radius: 18px; font-size: 18px; outline: none; transition: 0.2s; }
#searchInput:focus { background: rgba(0,0,0,0.5); border-color: var(--accent-color); }
#searchInput::placeholder { color: #888; }
#suggestions { text-align: center; font-size: 14px; color: var(--accent-color); padding-top: 5px; margin:0; }

.bottom-dock { display: flex; align-items: center; gap: 12px; background: rgba(20, 20, 20, 0.5); backdrop-filter: blur(60px) saturate(180%); -webkit-backdrop-filter: blur(60px) saturate(180%); border: 1px solid rgba(255,255,255,0.15); border-top: 1px solid rgba(255,255,255,0.25); padding: 14px 20px; border-radius: 40px; box-shadow: 0 20px 50px rgba(0,0,0,0.5); transition: transform 0.3s ease; }
.dock-btn { width: 68px; height: 68px; border-radius: 22px; background: linear-gradient(145deg, rgba(255,255,255,0.1), rgba(255,255,255,0.02)); border: 1px solid rgba(255,255,255,0.1); display: flex; align-items: center; justify-content: center; cursor: pointer; position: relative; transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.dock-btn:hover { background: rgba(255,255,255,0.2); transform: translateY(-15px) scale(1.15); margin: 0 10px; box-shadow: 0 15px 30px rgba(0,0,0,0.4); z-index: 10; }
.dock-btn.active-mode { background: rgba(255,255,255,0.3); box-shadow: 0 0 25px rgba(255,255,255,0.2); border-color: rgba(255,255,255,0.5); }
.dock-btn::after { content: attr(data-tooltip); position: absolute; top: -50px; left: 50%; transform: translateX(-50%) scale(0.8); background: rgba(0,0,0,0.8); color: white; padding: 6px 12px; border-radius: 8px; font-size: 14px; font-weight: 600; opacity: 0; pointer-events: none; transition: 0.2s; backdrop-filter: blur(10px); }
.dock-btn:hover::after { opacity: 1; transform: translateX(-50%) scale(1); top: -60px; }
.dock-sep { width: 1px; height: 40px; background: rgba(255,255,255,0.15); margin: 0 5px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.2); border-radius: 10px; border: 2px solid #111; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

.tour-highlight { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75); border: 2px solid var(--accent-color); border-radius: var(--radius-md); transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); pointer-events: none; z-index: 100000; }
.secret-fullscreen-app { display: none; position: fixed; top: 0; left: 0; width: 125vw; height: 125vh; z-index: 9999; background: #000; }
.secret-iframe { width: 100% !important; height: 100% !important; border: none !important; margin: 0 !important; padding: 0 !important; }
.fullscreen-app { position: fixed; top: 0; left: 0; width: 125vw; height: 125vh; z-index: 800; background: #000; display: none; }
.fullscreen-app.active-section { display: block; }
.fullscreen-app .app-frame { width: 100%; height: 100%; border: none; border-radius: 0; display: block; }
.bottom-dock { z-index: 1000 !important; }
.top-bar { position: fixed; top: 0; left: 0; width: 100%; padding: 15px 24px; display: flex; justify-content: flex-start; align-items: center; z-index: 9999; pointer-events: none; }
.top-bar > * { pointer-events: auto; }
.brand-container { display: flex; align-items: center; gap: 12px; background: rgba(0, 0, 0, 0.5); padding: 8px 16px; border-radius: 12px; backdrop-filter: blur(8px); border: 1px solid rgba(255,255,255,0.05); }
.brand-icon { color: var(--accent-color, #00C9FF); }
.brand-title { font-size: 18px; font-weight: 800; font-family: 'Trebuchet MS', sans-serif; letter-spacing: 1px; background: linear-gradient(90deg, #00C9FF 0%, #92FE9D 100%); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

.dock-container.dragged { left: auto; transform: none; }
.dock-drag-handle { cursor: grab; display: flex; align-items: center; justify-content: center; padding: 0 5px; color: rgba(255, 255, 255, 0.4); transition: color 0.2s; }
.dock-drag-handle:hover { color: rgba(255, 255, 255, 0.9); }
.dock-drag-handle:active { cursor: grabbing; }
.dock-toggle-btn { background: transparent; border: none; color: rgba(255, 255, 255, 0.6); cursor: pointer; padding: 10px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: all 0.2s; outline: none; }
.dock-toggle-btn:hover { background: rgba(255,255,255,0.1); color: white; }
#dockToggleIcon { transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
.bottom-dock.collapsed .dock-btn:not(.active-mode) { display: none !important; }
.bottom-dock.collapsed .dock-sep:not(.collapse-sep) { display: none !important; }
.bottom-dock.collapsed #dockToggleIcon { transform: rotate(180deg); }

/* === AUTH MODAL === */
.auth-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); z-index: 9999; display: flex; align-items: center; justify-content: center; }
.auth-box { background: rgba(20, 20, 20, 0.95); border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 16px; padding: 30px; width: 320px; display: flex; flex-direction: column; gap: 15px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5); }
.auth-toggle-text { color: rgba(255, 255, 255, 0.6); font-size: 13px; text-align: center; margin-top: 5px; }

/* === STREAM CARDS / MIXER INTERFACE (REBUILT) === */
.stream-card {
    background: rgba(15, 15, 15, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 12px;
    display: none; /* Hidden by default until active stream detected */
    flex-direction: column;
    gap: 12px;
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    backdrop-filter: blur(10px);
}

.stream-card.active { display: flex; }

/* Music Layout - Spotify Style */
.music-layout .stream-info {
    display: flex; align-items: center; gap: 15px;
}
.music-cover {
    width: 48px; height: 48px; border-radius: 6px;
    background: #2a2a2a; display: flex; align-items: center; justify-content: center;
}
.music-text {
    display: flex; flex-direction: column; overflow: hidden; flex: 1;
}
.music-title {
    font-weight: 600; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.music-artist {
    color: #a0a0a0; font-size: 12px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}

/* Movie Layout - Centered Stack */
.movie-layout .stream-info {
    text-align: center; margin-bottom: 5px;
}
.movie-title {
    font-weight: 600; font-size: 14px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}

/* Media Controls */
.mp-controls {
    display: flex; justify-content: center; align-items: center; gap: 20px;
}
.ctrl-btn {
    background: transparent; border: none; color: white; cursor: pointer;
    display: flex; align-items: center; justify-content: center; padding: 5px; transition: transform 0.2s, color 0.2s;
}
.ctrl-btn:hover { transform: scale(1.1); color: var(--accent-color); }
.ctrl-btn svg { width: 20px; height: 20px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ctrl-btn.play-btn svg { width: 24px; height: 24px; }
.movable-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.menu-drag-handle {
    display: flex;
    gap: 8px;
    background: rgba(20, 20, 25, 0.8);
    backdrop-filter: blur(10px);
    padding: 6px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    cursor: move; /* Shows the user they can drag it */
}

/* Ensure the dropdown doesn't prevent dragging the handle */
.glass-dropdown {
    margin-top: 10px;
    background: rgba(15, 15, 20, 0.9);
    backdrop-filter: blur(15px);
    border-radius: 12px;
    width: 240px;
    padding: 15px;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.hidden { display: none !important; }
/* Container for the entire control area */
.control-panel {
    display: flex;
    flex-direction: column;
    gap: 20px; /* Creates a clean gap between buttons and the mixer */
    padding: 15px;
    background: rgba(30, 30, 30, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

/* Section for the iframe and other buttons */
.button-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Spacing between individual buttons */
}

/* Section for the volume mixer */
.mixer-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
    /* Optional: Adds a visual divider between buttons and mixer */
    border-top: 1px solid rgba(255, 255, 255, 0.2); 
    padding-top: 15px; 
}
/* Forces buttons inside the dropdown to follow the normal layout flow */
.glass-dropdown .viewer-btn-spot {
    position: relative; /* Overrides the 'absolute' positioning causing the overlap */
    width: 100%; /* Makes the buttons span the width of the menu nicely */
    margin: 0; /* Lets your .control-panel's 'gap: 20px' handle the spacing */
}

/* ===================================================================
   FIX: Viewer Controls Container inside the game dock dropdown
   The #viewerControlsContainer has global CSS of position:absolute /
   width:100% / height:100% which makes it float over the mixer when
   rendered inside the dropdown panel. These rules override that.
   =================================================================== */
#game-dock-dropdown #viewerControlsContainer {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    height: auto !important;
    min-height: 36px;
    pointer-events: auto !important;
    z-index: auto !important;
    display: flex !important;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Reset absolute spot-class positions for buttons sitting inside the dropdown */
#game-dock-dropdown .viewer-btn-spot,
#game-dock-dropdown .viewer-btn-spot.spot-0,
#game-dock-dropdown .viewer-btn-spot.spot-1,
#game-dock-dropdown .viewer-btn-spot.spot-2,
#game-dock-dropdown .viewer-btn-spot.spot-3,
#game-dock-dropdown .viewer-btn-spot.spot-4 {
    position: relative !important;
    top: auto !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
}

/* ── Extracted from index.html ── */

    /* --- INJECTED HOME PAGE STYLES --- */
    .home-layout { max-width: 1000px; margin: 0 auto; padding: 40px 20px 150px 20px; color: white; }
    .home-header-row { display: flex; gap: 20px; margin-bottom: 40px; flex-wrap: wrap; }
    .home-widget { background: rgba(30, 30, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 16px; padding: 24px; flex: 1; min-width: 300px; backdrop-filter: blur(10px); box-shadow: 0 8px 32px rgba(0,0,0,0.3); }
    .home-section-title { font-size: 20px; color: rgba(255,255,255,0.9); margin-bottom: 20px; font-weight: 600; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }
    .home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-bottom: 50px; }
    
    .home-card { 
        background: rgba(20, 20, 20, 0.8); border: 1px solid rgba(255, 255, 255, 0.08); 
        border-radius: 16px; padding: 24px; display: flex; flex-direction: column; 
        align-items: center; justify-content: center; gap: 16px; cursor: pointer; 
        transition: all 0.2s ease; text-decoration: none; color: white; aspect-ratio: 4/3; 
        box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    }
    .home-card svg { width: 48px; height: 48px; stroke: var(--accent-color, #00C9FF); transition: transform 0.2s; }
    .home-card:hover { background: rgba(40, 40, 40, 0.9); border-color: var(--accent-color, #00C9FF); transform: translateY(-5px); box-shadow: 0 12px 25px rgba(0,0,0,0.4); }
    .home-card:hover svg { transform: scale(1.1); }
    .home-card span { font-weight: 600; font-size: 16px; letter-spacing: 0.5px; text-transform: uppercase; }
    
    /* Title Gradient matching Calc */
    .gradient-title {
        font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
        background: linear-gradient(90deg, #00C9FF 0%, #92FE9D 100%);
        -webkit-background-clip: text; -webkit-text-fill-color: transparent;
        text-transform: uppercase; letter-spacing: 1.5px; font-weight: 800;
    }

    /* FULLSCREEN VIEWER OVERRIDE CSS */
    /* zoom: 1.25 counteracts the root zoom: 0.8 (0.8 × 1.25 = 1.0), restoring true full-screen size */
    #viewer:fullscreen { background: #000; width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 9999999; zoom: 1.25; }
    #viewer:-webkit-full-screen { background: #000; width: 100%; height: 100%; position: fixed; top: 0; left: 0; z-index: 9999999; zoom: 1.25; }
    #viewer:fullscreen .app-frame { width: 100%; height: 100%; border: none; }
    #viewer:-webkit-full-screen .app-frame { width: 100%; height: 100%; border: none; }

    /* ── Tab Disguise Presets ──────────────────────────────────────────────── */
    .preset-search-wrap {
        position: relative;
        margin-bottom: 12px;
    }
    .preset-search-wrap svg {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        pointer-events: none;
    }
    .preset-search {
        width: 100%;
        box-sizing: border-box;
        background: rgba(0,0,0,0.35);
        border: 1px solid rgba(255,255,255,0.12);
        border-radius: 10px;
        color: white;
        font-size: 14px;
        padding: 10px 14px 10px 38px;
        outline: none;
        transition: border-color 0.2s;
        font-family: inherit;
    }
    .preset-search:focus { border-color: var(--accent-color, #00C9FF); }
    .preset-search::placeholder { color: rgba(255,255,255,0.35); }

    .preset-grid {
        display: flex;
        flex-direction: column;
        gap: 8px;
        padding: 4px 0 8px;
    }
    .preset-card {
        display: flex;
        align-items: center;
        gap: 14px;
        background: rgba(255,255,255,0.04);
        border: 1px solid rgba(255,255,255,0.08);
        border-radius: 12px;
        padding: 13px 18px;
        cursor: pointer;
        transition: background 0.15s, border-color 0.15s;
        user-select: none;
        width: 100%;
        box-sizing: border-box;
    }
    .preset-card:hover {
        background: rgba(0, 201, 255, 0.07);
        border-color: rgba(0, 201, 255, 0.35);
    }
    .preset-card.active-preset {
        background: rgba(0, 201, 255, 0.12);
        border-color: var(--accent-color, #00C9FF);
        box-shadow: 0 0 10px rgba(0, 201, 255, 0.15);
    }
    .preset-icon {
        width: 32px;
        height: 32px;
        border-radius: 7px;
        object-fit: cover;
        flex-shrink: 0;
        background: rgba(255,255,255,0.08);
    }
    .preset-text { flex: 1; min-width: 0; }
    .preset-label {
        font-size: 14px;
        font-weight: 600;
        color: #fff;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .preset-sublabel {
        font-size: 12px;
        color: rgba(255,255,255,0.38);
        margin-top: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .preset-check {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        border: 2px solid rgba(255,255,255,0.2);
        flex-shrink: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: 0.15s;
    }
    .preset-card.active-preset .preset-check {
        background: var(--accent-color, #00C9FF);
        border-color: var(--accent-color, #00C9FF);
    }
    .preset-hidden { display: none !important; }


/* ── Extracted from index.html ── */

    .volume-slider { flex: 1; height: 4px; border-radius: 2px; -webkit-appearance: none; background: rgba(255,255,255,0.1); outline: none; }
    .volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: #00C9FF; cursor: pointer; box-shadow: 0 0 10px rgba(0, 201, 255, 0.5); }
    .m-btn { background: none; border: none; cursor: pointer; opacity: 0.8; transition: 0.2s; padding: 10px; }
    .m-btn:hover { opacity: 1; transform: scale(1.1); }
    .play-main:hover { transform: scale(1.05) !important; background: #00C9FF !important; }


/* ── Extracted from index.html ── */

    /* --- NEW TABBED SETTINGS LAYOUT --- */
    .settings-container-wrapper {
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 100vh;
        padding: 20px;
    }
    
    .settings-box {
        display: flex;
        flex-direction: row;
        width: 1000px;
        max-width: 95vw;
        height: 700px;
        max-height: 85vh;
        background: rgba(20, 20, 20, 0.6);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 20px;
        backdrop-filter: blur(20px);
        box-shadow: 0 10px 40px rgba(0,0,0,0.4);
        overflow: hidden;
    }

    /* Sidebar Styling */
    .settings-sidebar {
        width: 260px;
        background: rgba(15, 15, 15, 0.4);
        border-right: 1px solid rgba(255, 255, 255, 0.05);
        display: flex;
        flex-direction: column;
        padding: 40px 0;
    }
    
    .settings-sidebar-header {
        padding: 0 30px 20px 30px;
        color: white;
        font-size: 24px;
        font-weight: 600;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        margin-bottom: 20px;
        letter-spacing: 0.5px;
    }
    
    .settings-tab-btn {
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.6);
        text-align: left;
        padding: 16px 30px;
        font-size: 15px;
        cursor: pointer;
        transition: all 0.2s ease;
        font-family: inherit;
        font-weight: 500;
        position: relative;
    }
    
    .settings-tab-btn:hover {
        background: rgba(255, 255, 255, 0.05);
        color: white;
    }
    
    .settings-tab-btn.active {
        background: rgba(255, 255, 255, 0.08);
        color: white;
    }
    
    .settings-tab-btn.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 4px;
        background: var(--accent-color, #00C9FF);
        border-radius: 0 4px 4px 0;
    }

    /* Content Area Styling */
    .settings-content-wrapper {
        flex: 1;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .settings-content-area {
        flex: 1;
        padding: 40px 50px;
        overflow-y: auto;
    }
    
    .settings-tab-content {
        display: none;
        animation: fadeIn 0.3s ease;
    }
    
    .settings-tab-content.active {
        display: block;
    }

    .settings-footer {
        padding: 20px 40px;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(10, 10, 10, 0.3);
        display: flex;
        justify-content: flex-end;
        gap: 12px;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; transform: translateY(10px); }
        to { opacity: 1; transform: translateY(0); }
    }

    /* Original Settings Component Styles */
    .settings-group { margin-bottom: 30px; text-align: left; }
    .settings-group-title { color: #fff; font-size: 20px; margin-bottom: 20px; font-weight: 600; padding-left: 5px; }
    .settings-card { background: rgba(30, 30, 30, 0.6); border: 1px solid rgba(255, 255, 255, 0.08); border-radius: 16px; padding: 0 20px; backdrop-filter: blur(10px); }
    .settings-row { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.05); }
    .settings-row:last-child { border-bottom: none; }
    .settings-info { display: flex; flex-direction: column; gap: 6px; max-width: 70%; }
    .settings-label { color: #fff; font-size: 16px; font-weight: 500; }
    .settings-desc { color: rgba(255, 255, 255, 0.5); font-size: 13px; line-height: 1.4; }
    
    .settings-input { background: rgba(0, 0, 0, 0.5); border: 1px solid rgba(255, 255, 255, 0.2); color: white; padding: 10px 15px; border-radius: 10px; outline: none; transition: 0.3s; }
    .settings-input:focus { border-color: var(--accent-color, #00C9FF); }
    .settings-btn { background: rgba(255, 255, 255, 0.1); color: white; border: 1px solid rgba(255, 255, 255, 0.2); padding: 10px 18px; border-radius: 10px; cursor: pointer; transition: 0.2s; font-weight: 500; text-decoration: none; display: inline-block;}
    .settings-btn:hover { background: rgba(255, 255, 255, 0.2); }
    .settings-btn.primary { background: var(--accent-color, #00C9FF); border: none; color: #000; font-weight: 600;}

    /* iOS Style Toggle Switch Fix */
    .ios-switch { position: relative; display: inline-block; width: 50px; height: 28px; }
    .ios-switch input { opacity: 0; width: 0; height: 0; }
    .slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgba(255,255,255,0.2); transition: .4s; border-radius: 34px; }
    .slider:before { position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px; background-color: white; transition: .4s; border-radius: 50%; box-shadow: 0 2px 5px rgba(0,0,0,0.2); }
    input:checked + .slider { background-color: var(--accent-color, #00C9FF); }
    input:checked + .slider:before { transform: translateX(22px); }