body { font-family: 'Segoe UI', Roboto, sans-serif; background-color: var(--bg-color); color: var(--text-primary); margin: 0; padding: 0; min-height: 100vh; display: flex; flex-direction: column; align-items: center; }
html.no-scroll, body.no-scroll { overflow: hidden !important; height: 100% !important; }

/* Scroll Lock Helper - Updated to use CSS Variable */
body.scroll-locked { position: fixed; width: 100%; top: var(--scroll-offset, 0px); }

header { text-align: center; width: 100%; }
#headerContent { padding-top: 20px; padding-bottom: 10px; } 
h1 { font-size: 2.5rem; margin: 0; font-weight: 900; text-transform: uppercase; letter-spacing: 2px; background: linear-gradient(to right, var(--accent-start), var(--accent-end)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* CREDITS BADGES */
.credits-badges { display: flex; justify-content: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }

.credit-badge { 
    display: inline-flex; 
    align-items: center; 
    background: #0f1014; 
    border: 1px solid #2d2f36; 
    border-radius: 8px; 
    padding: 0;
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    user-select: none; 
    overflow: hidden;
    height: 32px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.credit-badge:hover { 
    background: #1a1b21;
    border-color: #555; 
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.5);
}

.credit-badge:active { transform: translateY(0); }

.badge-role { 
    font-size: 0.65rem; 
    font-weight: 800; 
    text-transform: uppercase; 
    padding: 0 12px; 
    height: 100%;
    display: flex;
    align-items: center;
    letter-spacing: 1px;
    border-right: 1px solid rgba(255,255,255,0.05);
}

/* Updated Colors - "Ugly Yellow" fixed to Premium Gold text on dark bg */
.credit-badge.owner .badge-role { 
    background: rgba(168, 85, 247, 0.1); 
    color: #7b00ff; 
    text-shadow: 0 0 15px #0a0147, 0 0 5px #0a0147;
}

.credit-badge.helper .badge-role { 
    background: rgba(59, 130, 246, 0.1); 
    color: #0073ff; 
    text-shadow: 0 0 10px rgba(59, 130, 246, 0.3);
}

.badge-content {
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 8px;
}

.badge-pfp {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: -4px;
}

.badge-name { 
    font-weight: 600; 
    font-size: 0.85rem; 
    color: #e0e0e0; 
}

.discord-icon {
    color: #5865F2; 
    opacity: 0.8;
    transition: 0.2s;
    margin-top: 1px;
}

.credit-badge:hover .discord-icon { 
    opacity: 1; 
    transform: scale(1.1) rotate(5deg); 
    filter: drop-shadow(0 0 8px rgba(88, 101, 242, 0.8)); 
}

/* Styling for the new Open Link Button */
.discord-link-btn {
    background: transparent;
    border: none;
    color: #a1a1aa;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Adjust these two values to move it closer */
    padding: 3px;
    margin-left: 0px;
    
    border-radius: 4px;
    transition: all 0.2s ease;
}

.discord-link-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: translateY(-1px);
}

.external-link-icon {
    width: 14px;
    height: 14px;
}

/* HEADER COLLAPSE LOGIC */
.header-wrapper { display: grid; grid-template-rows: 1fr; transition: grid-template-rows 0.3s cubic-bezier(0.4, 0, 0.2, 1); width: 100%; }
.header-inner { overflow: hidden; min-height: 0; }
#sticky-sentinel { width: 100%; height: 1px; visibility: hidden; pointer-events: none; margin-bottom: -1px; }

/* HEADER TOGGLE STRIP */
.header-toggle-strip { width: 100%; background: transparent; border-top: 1px solid rgba(255,255,255,0.05); cursor: pointer; text-align: center; z-index: 1100; padding: 2px 0; display: block; }
.header-toggle-strip:hover .header-toggle-btn { color: var(--accent-start); }
body.header-collapsed .header-toggle-btn { transform: rotate(180deg); }

/* STICKY TOOLBAR */
.sticky-toolbar-container { position: sticky; top: 0; z-index: 1000; width: 100%; background: rgba(5, 5, 5, 0.95); border-bottom: 1px solid var(--card-border); box-shadow: 0 4px 30px rgba(0,0,0,0.5); display: flex; flex-direction: column; align-items: center; max-height: 100vh; overflow-y: auto; overflow-x: hidden; }
.sticky-toolbar-container .nav-bar, .sticky-toolbar-container .injector-panel { transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease, padding 0.3s ease, margin 0.3s ease; max-height: 200vh; overflow: visible; opacity: 1; }
body.header-collapsed .sticky-toolbar-container .nav-bar, body.header-collapsed .sticky-toolbar-container .injector-panel { display: flex !important; max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; margin-top: 0; margin-bottom: 0; border: none; }

/* NAV & INJECTOR */
.nav-bar { display: flex; gap: 10px; padding: 15px; justify-content: center; width: 100%; margin-bottom: 5px; flex-wrap: wrap; }
.injector-panel { width: 100%; background: rgba(255,255,255,0.03); border-top: 1px solid rgba(255,255,255,0.05); padding: 10px 15px; display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; white-space: nowrap; transition: 0.3s; }

/* PAGES & LAYOUTS */

/* --- MOBILE NAV SCROLLING & TOGGLES --- */
@media (max-width: 768px) {
    .nav-bar {
        flex-wrap: nowrap; /* Prevent stacking */
        overflow-x: auto;  /* Enable horizontal scroll */
        justify-content: flex-start; /* Align start for scrolling */
        padding: 10px 15px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Hide scrollbar Firefox */
    }
    .nav-bar::-webkit-scrollbar { display: none; /* Hide scrollbar Chrome */ }
    
    .nav-btn {
        flex-shrink: 0; /* Prevent buttons from squishing */
        white-space: nowrap;
    }

    /* Mobile Toolbar Panels: Horizontal Scroll */
    .injector-panel {
        flex-wrap: nowrap; /* Prevent vertical stacking */
        overflow-x: auto;  /* Enable horizontal scroll */
        justify-content: flex-start;
        padding: 8px 10px; /* Reduce padding */
        gap: 8px;          /* Reduce gap */
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .injector-panel::-webkit-scrollbar { display: none; /* Chrome, Safari */ }

    /* Prevent items in the injector from shrinking */
    .injector-panel > * {
        flex-shrink: 0;
    }
}

/* Toggle Switch Visuals (Ensures Miku button appears) */
.mini-switch {
    width: 36px; height: 20px;
    background: #333;
    border-radius: 20px;
    position: relative;
    transition: 0.3s;
    display: inline-block;
    vertical-align: middle;
    flex-shrink: 0;
}
.mini-switch::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 14px; height: 14px;
    background: #fff;
    border-radius: 50%;
    transition: 0.3s;
}
input:checked + .mini-switch { background: var(--accent-start); }
input:checked + .mini-switch::after { transform: translateX(16px); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
    