/* =========================================
   VARIABLES & CORE HEADER
   ========================================= */
:root {
    --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-valheim: 'Caesar Dressing', cursive;
    --header-height: 80px; /* Scaled up ~10% */
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    z-index: 1000;
    pointer-events: none;
}

.header-glass-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 90px; /* Extended further down */
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    /* Stretches the gradient mask to match the new height */
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 80px, transparent 90px);
    mask-image: linear-gradient(to bottom, black 0%, black 80px, transparent 90px);
    z-index: -1;
}

.header-nav {
    display: flex; /* Changed from grid to flex */
    justify-content: space-between;
    align-items: center;
    height: 100%;
    /* Dynamically shrinks edge padding on smaller screens */
    padding: 0 clamp(1rem, 3vw, 4vw); 
    pointer-events: auto;
    position: relative; /* Anchors the absolutely positioned logo */
}

.nav-left, .nav-right {
    display: flex;
    align-items: center;
}

.nav-left { justify-content: flex-start; }

/* Frees the logo from the flow so it never causes collision math */
.nav-center { 
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    display: flex; 
    justify-content: center; 
}

.nav-right { 
    justify-content: flex-end;
    position: relative;
}

.wordmark-img {
    height: 34px; /* Scaled up ~10% */
    width: auto;
    display: block;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.3)); 
}
/* =========================================
   1. FLUID CENTERING & OFFSET
   ========================================= */
.nav-center { 
    position: absolute;
    /* Pushes right by up to 30px, but only when the screen shrinks below 500px */
    left: calc(50% + clamp(0px, 500px - 100vw, 30px)); 
    transform: translateX(-50%);
    display: flex; 
    justify-content: center; 
}

/* =========================================
   2. FLUID SHRINKING
   ========================================= */
.wordmark-img {
    /* Stays at 34px until the screen hits ~485px, then smoothly shrinks down to 24px */
    height: clamp(24px, 7vw, 34px); 
    width: auto;
    display: block;
    filter: drop-shadow(0px 4px 10px rgba(0,0,0,0.3)); 
}

/* =========================================
   1. NAVIGATION LINKS (LEFT SIDE)
   ========================================= */
.desktop-links {
    display: flex;
    gap: 1rem; 
    align-items: center;
}

.nav-link {
    font-family: var(--font-ui) !important;
    font-size: 1.05rem !important;
    font-weight: 500 !important;
    letter-spacing: normal !important; /* Prevents unwanted stretching */
    text-decoration: none;
    color: var(--white);
    
    height: 44px; /* Scaled up ~10% */
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0); /* Replaces 'transparent' to stop the ghosting */
    border-radius: 30px;
    transition: all 0.3s ease; 
    flex-shrink: 0;
}

/* Gives unselected nav links the exact same tactile lift as the glass buttons */
.nav-link:hover {
    transform: scale(1.03);
}

/* Gives them the satisfying physical press when clicked */
.nav-link:active {
    transform: scale(0.97);
}

/* Full 3D Bubble Preview on Hover */
.nav-link:hover:not(.active) {
    background: rgba(255, 255, 255, 0.08); 
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.3), 
        inset 0 -1px 2px rgba(0, 0, 0, 0.2), 
        0 4px 6px rgba(0, 0, 0, 0.15);
}

/* Forcefully suppress rogue inline JS shadows on inactive links */
.nav-link:not(.active):not(:hover) {
    box-shadow: none !important;
    background: transparent !important; 
}

/* =========================================
   2. DESKTOP AUTH & USER STATUS (RIGHT SIDE)
   ========================================= */
.desktop-auth {
    display: flex;
    align-items: center;
    gap: 1rem; 
    position: relative; /* Creates an anchor point for the absolute text below */
}

.auth-container {
    display: flex;
    align-items: center;
    gap: 1rem; 
}

.header-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-family: var(--font-ui);
}

.user-status-group {
    display: flex;
    flex-direction: row; 
    align-items: center;
}

.user-status-text {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    
    display: flex;
    flex-direction: row; 
    align-items: center; 
    justify-content: flex-end;
    gap: 6px;
    line-height: 1;
    font-family: var(--font-ui);
    white-space: nowrap; 
    
    /* The targeted blur & shadow fix */
    padding: 5px 10px; /* Gives the blur some breathing room around the text */
    border-radius: 30px;
    
    /* The 3rd value (4px) controls how blurred the text drop-shadow is */
    text-shadow: 0 2px 4px rgba(3, 3, 3, 0.3); 
}

.status-label {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.6);
}

.status-user {
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    font-family: var(--font-valheim);
    letter-spacing: .06rem;
    gap: 6px;
}

.status-user strong {
    color: white;
    font-weight: 600;
}

.status-user .role {
    background: linear-gradient(135deg, var(--retro-yellow), var(--retro-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 500;
    font-size: 1rem;
}



.auth-container[data-logged-in="false"] .user-status-group { display: none; }
.auth-container[data-logged-in="false"] .login-btn { display: flex; }
.auth-container[data-logged-in="true"] .user-status-group { display: flex; }
.auth-container[data-logged-in="true"] .login-btn { display: none; }



/* =========================================
   3. UNIFIED 3D GLASS STYLE
   ========================================= */
.glass-3d-btn {
    background: rgba(255, 255, 255, 0.08); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: white !important; 
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    height: 44px; /* Scaled up ~10% */
    box-sizing: border-box;
    flex-shrink: 0;
    
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.3), 
        inset 0 -1px 2px rgba(0, 0, 0, 0.2), 
        0 4px 6px rgba(0, 0, 0, 0.15);
        
    /* Comma error fixed below */
    transition: box-shadow 0.15s ease-out, transform 0.2s ease, background 0.3s ease;
}

/* Turn buttons a bit whiter on hover */
.glass-3d-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.02);
}

.glass-3d-btn:active {
    transform: scale(0.97);
}

/* =========================================
   UNIVERSAL CIRCULAR BUTTON MODIFIER
   ========================================= */
/* Add this class to any glass button to automatically fix its shape and physics */
.glass-3d-btn.circle-btn {
    border-radius: 50% !important; 
    padding: 0; 
    aspect-ratio: 1 / 1; /* Guarantees it stays perfectly round regardless of width */
}

/* Overrides the base physics for small circular elements */
.glass-3d-btn.circle-btn:hover {
    transform: scale(1.08); 
}

.glass-3d-btn.circle-btn:active {
    transform: scale(0.90);
}

.login-btn, .logout-btn {
    padding: 0 22px;
    gap: 8px;
    font-size: 1.05rem; /* Scaled up */
    font-weight: 500;
}

.share-icon {
    width: 20px; /* Scaled up */
    height: 20px;
    object-fit: contain;
    display: block; 
}



/* =========================================
   3D GLASS MENUS (Synchronized with Social Buttons)
   ========================================= */
.login-menu, 
.share-menu {
    position: fixed; 
    top: calc(var(--header-height) + 15px); 
    right: clamp(1rem, 3vw, 4vw); 
    z-index: 9999;
    width: 280px; 
    padding: 20px;
    border-radius: 22px; 
    
    /* Transparent container to hold the bulletproof ::before layer */
    background: transparent; 
    
    /* EXACT border and resting insets from social buttons */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        inset 0 1px 2px rgba(255, 255, 255, 0.3), 
        inset 0 -1px 2px rgba(0, 0, 0, 0.2), 
        0 8px 24px rgba(0, 0, 0, 0.3); /* Wider drop shadow for floating panel */
    
    /* Animation / State */
    opacity: 0;
    pointer-events: none;
    transform: scale(0.8); 
    transform-origin: center;
    
    /* Exact transition timing from social buttons + opacity/transform for the dropdown bounce */
    transition: opacity 0.2s ease, transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.27), box-shadow 0.15s ease-out, background 0.3s ease !important;
}

/* 3D Glass Hover: Exact background brightening from social buttons */
.login-menu:hover,
.share-menu:hover {
    background: rgba(255, 255, 255, 0.05) !important; 
}

/* Bulletproof Blur Layer */
.login-menu::before,
.share-menu::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit; 
    
    /* EXACT background and blur from social buttons */
    background: rgba(255, 255, 255, 0.06); 
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
    
    z-index: -1; 
}

/* The Active Open State */
.login-menu.is-open,
.share-menu.is-open {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1) !important;
}
/* Make the opened menu scale up slightly when hovered */
.login-menu.is-open:hover,
.share-menu.is-open:hover {
    transform: scale(1.01) !important;
}


/* =========================================
   LIGHT PRISM INPUT (for login menu password entry)
   ========================================= */
.light-prism-input {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 12px;
    box-sizing: border-box;
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    
    background: rgba(245, 245, 245, 0.6); 
    border-top: 1px solid rgba(255, 255, 255, 0.6);
    border-left: 1px solid rgba(255, 255, 255, 0.4);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4), 0 4px 12px rgba(0, 0, 0, 0.1);
    color: #1F1F1F;
    
    transition: all 0.2s ease; /* Ensures the hover is smooth */
}

/* Light Prism Hover: Sharpens the white glare and lifts slightly */
.light-prism-input:hover {
    background: rgba(255, 255, 255, 0.7);
    border-top: 1px solid rgba(255, 255, 255, 0.8);
    border-left: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 6px 16px rgba(0, 0, 0, 0.15);
}

/* Light Prism Focus (Clicking inside): Maximum illumination */
.light-prism-input:focus {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.9), 0 8px 24px rgba(0, 0, 0, 0.2);
}

.light-prism-input::placeholder {
    color: rgba(31, 31, 31, 0.5);
}

.light-prism-input:focus {
    box-shadow: inset 0 1px 2px rgba(255, 255, 255, 0.6), 0 8px 16px rgba(0, 0, 0, 0.2);
}














/* =========================================
   MOBILE MENU (Base & Layering)
   ========================================= */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%; 
    height: calc(100vh - var(--header-height));
    transform: scale(1.15);
    
    /* Your new 3px blur with transparent background */
    background: transparent; 
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px; /* More breathing room between buttons */
    z-index: 998; /* Base layer */
    
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu.is-open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}


/* =========================================
   MOBILE MENU INTERNAL STYLING
   ========================================= */

/* Force the desktop buttons to scale up to massive mobile sizes */
.mobile-menu .glass-3d-btn,
.mobile-menu .nav-link {
    width: 80vw !important;
    max-width: 320px !important;
    height: 60px !important; /* Taller for easy tapping */
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Fix the divider line */
.mobile-divider {
    width: 80vw;
    max-width: 320px;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    margin: 10px 0;
}

/* Stack the auth and user containers neatly */
.mobile-auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 24px;
}

.mobile-user-status-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    gap: 16px;
}

/* Float the bottom sheets ON TOP of the mobile menu blur */
@media (max-width: 825px) {
    .login-menu, 
    .share-menu {
        z-index: 9999 !important; /* Forces it over the 998 mobile menu */
    }
}

/* =========================================
   HIDE MAIN CONTENT WHEN OPEN
   ========================================= */
main {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

body.mobile-menu-open main {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
}

/* =========================================
   HAMBURGER BUTTON (Base & Lines)
   ========================================= */
.hamburger {
    display: none; /* Hidden by default on desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px; /* Makes the click area larger than the visual lines */
    z-index: 1000; /* Ensures it always floats above the mobile menu blur */
}

.hamburger span {
    display: block;
    width: 30px; 
    height: 3px !important; 
    background-color: var(--white);
    margin: 6px auto;
    border-radius: 3px;
    transition: 0.3s ease;
}



/* =========================================
   MOBILE RESPONSIVENESS (Bottom Sheets)
   ========================================= */
@media (max-width: 825px) {
    .desktop-links, .desktop-auth { display: none !important; }
    .hamburger { display: block; }
    
    /* Intercept the Login & Share menus and turn them into bottom sheets */
    .login-menu, 
    .share-menu {
        top: auto !important; 
        bottom: 0 !important; 
        right: 0 !important;
        left: 0 !important;
        width: 100% !important;
        
        /* Flatten bottom corners, round top corners */
        border-radius: 24px 24px 0 0 !important; 
        
        /* THE FIX: Apply your dark prism glass so it covers the menu behind it */
        background: var(--bg-dark-prism) !important;
        backdrop-filter: blur(16px) !important;
        -webkit-backdrop-filter: blur(16px) !important;
        border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
        
        /* Animation overrides to slide UP instead of scaling down */
        transform: translateY(100%) !important; 
        transform-origin: bottom center !important;
        transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1) !important;
        z-index: 9999;
    }
    
    /* Slide up when opened */
    .login-menu.is-open, 
    .share-menu.is-open {
        transform: translateY(0) !important;
    }
}

@media (min-width: 826px) {
    .mobile-menu { display: none !important; }
}

















/* Styling for your custom SVG Share Icon */
.share-icon {
    width: 18px; /* Perfect size inside a 40px button */
    height: 18px;
    object-fit: contain;
    display: block; /* Prevents weird baseline spacing */
    
    filter: brightness(0) invert(1);
    transform: translateX(-1px);
}

