/* ============================================
   Layout Styles
   Header, Footer, Container
   ============================================ */

/* ============================================
   Header
   ============================================ */

.header {
    position: sticky;
    top: 0;
    z-index: 50;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    background: rgba(10, 12, 26, .55);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.header-content {
    max-width: 1440px;
    width: 100%;
    margin: 0 auto;
    padding: 14px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: rgba(255, 255, 255, .92);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background:
        radial-gradient(14px 14px at 30% 30%, rgba(255, 255, 255, .35), transparent 60%),
        radial-gradient(24px 20px at 80% 20%, rgba(124, 92, 255, .55), transparent 60%),
        radial-gradient(26px 22px at 40% 90%, rgba(255, 77, 141, .40), transparent 60%),
        linear-gradient(180deg, rgba(255, 255, 255, .10), rgba(255, 255, 255, .02));
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45);
}

.brand-logo {
    width: 34px;
    height: 34px;
    object-fit: contain;
    border-radius: 8px;
}

.brand-text {
    font-weight: 950;
    letter-spacing: -.03em;
    font-size: 1.35rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-pill {
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .05);
    color: rgba(255, 255, 255, .70);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Mobile tightening */
@media (max-width: 768px) {
    .header-content {
        padding: 12px 16px;
        flex-wrap: wrap;
    }
    
    .header-actions {
        gap: 8px;
    }
    
    .nav-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
        min-width: 170px;
    }
    
}

/* Hamburger - hidden on desktop */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 10px;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 10px;
    cursor: pointer;
    position: relative;
    z-index: 100;
    transition: all 180ms ease;
    -webkit-tap-highlight-color: transparent;
}

.hamburger:hover {
    background: rgba(124, 92, 255, .15);
    border-color: rgba(124, 92, 255, .4);
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: rgba(255, 255, 255, .85);
    border-radius: 2px;
    transition: all 200ms ease;
}

.hamburger.is-open .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.is-open .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.is-open .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu - fullscreen overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%; /* fallback for older browsers */
    height: 100dvh; /* dynamic viewport height - adjusts when keyboard opens */
    display: flex;
    flex-direction: column;
    padding: 20px 24px;
    background-color: #0a0c1a;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 250ms ease, visibility 250ms ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Nav buttons wrapper - centered vertically, takes remaining space */
.mobile-menu-nav {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 16px;
    min-height: 0;
    padding-top: 50px; /* clear the absolute brand/close buttons */
}

.mobile-menu.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-menu-close {
    position: absolute;
    top: 16px;
    right: 20px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 12px;
    color: rgba(255, 255, 255, .9);
    cursor: pointer;
    transition: all 180ms ease;
}

.mobile-menu-close:active {
    background: rgba(255, 255, 255, .15);
    transform: scale(0.95);
}

.mobile-nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    background: linear-gradient(135deg, rgba(124, 92, 255, .15) 0%, rgba(124, 92, 255, .08) 100%);
    border: 1px solid rgba(124, 92, 255, .3);
    border-radius: 14px;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 150ms ease;
}

.mobile-nav-btn:active {
    background: linear-gradient(135deg, rgba(124, 92, 255, .25) 0%, rgba(124, 92, 255, .15) 100%);
    transform: scale(0.98);
}

.mobile-nav-btn-hot {
    background: linear-gradient(135deg, rgba(255, 176, 60, .18) 0%, rgba(255, 176, 60, .08) 100%);
    border-color: rgba(255, 176, 60, .35);
}

.mobile-nav-btn-hot:active {
    background: linear-gradient(135deg, rgba(255, 176, 60, .28) 0%, rgba(255, 176, 60, .15) 100%);
}

.mobile-nav-btn-compare {
    background: linear-gradient(135deg, rgba(56, 189, 248, .15) 0%, rgba(56, 189, 248, .06) 100%);
    border-color: rgba(56, 189, 248, .3);
}

.mobile-nav-btn-compare:active {
    background: linear-gradient(135deg, rgba(56, 189, 248, .25) 0%, rgba(56, 189, 248, .12) 100%);
}

.mobile-nav-btn-about {
    background: linear-gradient(135deg, rgba(16, 185, 129, .15) 0%, rgba(16, 185, 129, .06) 100%);
    border-color: rgba(16, 185, 129, .35);
}

.mobile-nav-btn-about:active {
    background: linear-gradient(135deg, rgba(16, 185, 129, .25) 0%, rgba(16, 185, 129, .12) 100%);
}

.mobile-menu-brand {
    position: absolute;
    top: 16px;
    left: 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    opacity: 0.8;
}

.mobile-menu-logo {
    width: 32px;
    height: auto;
    object-fit: contain;
}

.mobile-menu-text {
    font-size: 1.2rem;
    font-weight: 700;
    color: #c084fc;
    letter-spacing: -0.02em;
}

/* Mobile Newsletter Button (inside hamburger menu nav) */
.mobile-nav-btn-newsletter {
    background: linear-gradient(135deg, rgba(102, 126, 234, .18) 0%, rgba(118, 75, 162, .10) 100%);
    border-color: rgba(102, 126, 234, .35);
}

.mobile-nav-btn-newsletter:active {
    background: linear-gradient(135deg, rgba(102, 126, 234, .28) 0%, rgba(118, 75, 162, .18) 100%);
}

/* Mobile Newsletter Modal */
.mobile-newsletter-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    background: rgba(0, 0, 0, .65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease;
}

.mobile-newsletter-modal-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-newsletter-modal {
    position: relative;
    width: 100%;
    max-width: 340px;
    background: linear-gradient(180deg, #16213e 0%, #0f0f1a 100%);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 18px;
    padding: 28px 24px 24px;
    transform: scale(0.92) translateY(10px);
    transition: transform 200ms ease;
}

.mobile-newsletter-modal-overlay.is-open .mobile-newsletter-modal {
    transform: scale(1) translateY(0);
}

.mobile-newsletter-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 10px;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    transition: all 150ms ease;
}

.mobile-newsletter-modal-close:active {
    background: rgba(255, 255, 255, .15);
    transform: scale(0.92);
}

.mobile-newsletter-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.mobile-newsletter-modal-desc {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, .50);
    line-height: 1.5;
    margin: 0 0 18px;
}

.mobile-newsletter-modal-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-newsletter-modal-input {
    width: 100%;
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(0, 0, 0, .30);
    color: rgba(255, 255, 255, .90);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 200ms ease, box-shadow 200ms ease;
    box-sizing: border-box;
}

.mobile-newsletter-modal-input:focus {
    border-color: rgba(124, 92, 255, .50);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, .12);
}

.mobile-newsletter-modal-input::placeholder {
    color: rgba(255, 255, 255, .30);
}

.mobile-newsletter-modal-submit {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: none;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 200ms ease;
    letter-spacing: 0.02em;
}

.mobile-newsletter-modal-submit:active {
    transform: scale(0.97);
}

.mobile-newsletter-modal-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

@media (max-width: 620px) {
    .desktop-nav {
        display: none !important;
    }
    
    .hamburger {
        display: flex !important;
    }
    
    .brand-pill {
        display: none;
    }
    
    .brand-text {
        font-size: 1.15rem;
    }
    
    .brand-logo {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 380px) {
    .header-content {
        padding: 10px 12px;
    }
    
    .brand {
        gap: 6px;
    }
    
    .brand-text {
        font-size: 1rem;
    }
    
    .mobile-menu {
        padding: 10px 12px 14px;
    }
    
    .mobile-menu-nav {
        gap: 12px;
        padding-top: 44px;
    }
    
    .mobile-nav-btn {
        padding: 12px 14px;
        font-size: 0.95rem;
    }
    
}

/* ============================================
   Footer
   ============================================ */

.footer {
    text-align: center;
    padding: 40px 20px;
    margin-top: 60px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
}

.footer-disclaimer {
    font-size: 0.8rem;
    margin-top: 10px;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .footer {
        padding: 30px 16px;
        margin-top: 40px;
    }
    
    .footer-disclaimer {
        font-size: 0.75rem;
    }
}

@media (max-width: 520px) {
    .footer {
        padding: 24px 14px;
        margin-top: 30px;
        font-size: 0.85rem;
    }
    
    .footer-disclaimer {
        font-size: 0.72rem;
        line-height: 1.5;
    }
}

/* ============================================
   Back Navigation
   ============================================ */


/* ============================================
   CLS Prevention
   ============================================ */
[data-component="leaderboard"] {
    min-height: 800px;
    display: block;
}

[data-component="points-ranking"] {
    min-height: 600px;
    display: block;
}