* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    min-height: 100vh;
    color: white;
    overflow-x: hidden;
    position: relative;
    /* Allow vertical scrolling for browser detection */
    overflow-y: auto;
    /* Remove scroll bar */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Ensure content can still scroll if needed */
.page-container,
.leaderboard-container,
.container {
    overflow-x: hidden;
    /* Remove fixed height to allow natural document flow */
    min-height: 100vh;
    padding-top: 6rem; /* Restore padding-top for tab bar spacing */
    /* Ensure no white edges */
    background: transparent;
}

/* Home page doesn't need extra padding since it's non-scrollable */
#home-page::after {
    display: none;
}

/* Remove scroll bar for webkit browsers */
body::-webkit-scrollbar {
    display: none;
}

/* Remove scrollbar for content containers */
.page-container::-webkit-scrollbar,
.leaderboard-container::-webkit-scrollbar,
.container::-webkit-scrollbar {
    display: none;
}

.background-layers {
    position: fixed;
    top: -100px;
    left: -100px;
    width: calc(100vw + 200px);
    height: calc(100vh + 200px);
    z-index: -1;
    /* Ensure background stays fixed during scroll */
    will-change: transform;
}

/* Ensure the body background also extends beyond bounds */
body::before {
    content: '';
    position: fixed;
    top: -50px;
    left: -50px;
    width: calc(100vw + 100px);
    height: calc(100vh + 100px);
    background: #0a0a0a;
    z-index: -2;
    pointer-events: none;
}

.bg-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, #DB5461 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, #2a2a2a 0%, transparent 50%),
                radial-gradient(circle at 40% 40%, #1a1a1a 0%, transparent 50%),
                radial-gradient(circle at 90% 90%, #DB5461 0%, transparent 40%),
                radial-gradient(circle at 10% 10%, #2a2a2a 0%, transparent 40%);
    animation: gradientPulse 8s ease-in-out infinite;
}

@keyframes gradientPulse {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.6; }
}

/* Additional background elements that extend beyond viewport */
.background-layers::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: calc(100% + 100px);
    height: calc(100% + 100px);
    background: radial-gradient(circle at 0% 0%, rgba(219, 84, 97, 0.1) 0%, transparent 30%),
                radial-gradient(circle at 100% 100%, rgba(42, 42, 42, 0.1) 0%, transparent 30%);
    pointer-events: none;
}

.floating-orbs {
    position: absolute;
    width: 100%;
    height: 100%;
}

.orb {
    position: absolute;
    border-radius: 50%;
    background: rgba(219, 84, 97, 0.1);
    backdrop-filter: blur(20px);
    animation: float 15s ease-in-out infinite;
}

.orb:nth-child(1) {
    width: 300px;
    height: 300px;
    top: -250px;
    left: -250px;
    animation-delay: 0s;
}

.orb:nth-child(2) {
    width: 200px;
    height: 200px;
    top: 50%;
    right: -200px;
    animation-delay: -5s;
}

.orb:nth-child(3) {
    width: 150px;
    height: 150px;
    bottom: -150px;
    left: 10%;
    animation-delay: -10s;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-30px) rotate(120deg); }
    66% { transform: translateY(15px) rotate(240deg); }
}

/* iPad-style Floating Tab Bar */
.floating-tab-bar {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 25px;
    padding: 6px;
    gap: 4px;
    z-index: 1000;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.3),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: tabBarFloat 3s ease-in-out infinite;
}

@keyframes tabBarFloat {
    0%, 100% { transform: translateX(-50%) translateY(0px); }
    50% { transform: translateX(-50%) translateY(-2px); }
}

.tab-button {
    position: relative;
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 100px;
    justify-content: center;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab-button:hover::before {
    opacity: 1;
}

.tab-button.active {
    color: white;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(219, 84, 97, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(219, 84, 97, 0.1), rgba(255, 255, 255, 0.05));
    border-radius: 20px;
    pointer-events: none;
}

.tab-icon {
    width: 16px;
    height: 16px;
    transition: all 0.3s ease;
}

.tab-button.active .tab-icon {
    filter: drop-shadow(0 2px 4px rgba(219, 84, 97, 0.3));
}

/* Home page specific styles */

/* Page Content Containers */
.page-container {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.page-container.active {
    display: block;
}

/* Home page specific - non-scrollable */
#home-page {
    height: 100vh;
    overflow: hidden;
    /* Ensure no scrollbar appears */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

/* Hide scrollbar for home page specifically */
#home-page::-webkit-scrollbar {
    display: none;
}

/* Ensure html element also has no scrollbar for home page */
html {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* Internet Explorer 10+ */
}

html::-webkit-scrollbar {
    display: none;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Home Page Styles */
.home-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    max-width: 500px;
    width: 100%;
    margin: 0 auto;
    padding: 1rem;
    position: relative;
    z-index: 10;
    height: calc(100vh - 6rem); /* Account for tab bar padding */
    padding-top: 2rem;
    overflow: hidden;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 1rem 0;
    max-height: 100%;
    overflow: hidden;
}

.logo-container {
    margin-bottom: 1.5rem;
    position: relative;
}

.logo {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 30px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: logoFloat 6s ease-in-out infinite;
    position: relative;
    overflow: hidden;
}

.logo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-15px) scale(1.05); }
}

.logo-icon {
    width: 60px;
    height: 60px;
    color: #DB5461;
    filter: drop-shadow(0 4px 8px rgba(219, 84, 97, 0.3));
}

.title {
    font-size: clamp(2.5rem, 8vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff, #DB5461, #ffffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    animation: titleGlow 4s ease-in-out infinite;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

@keyframes titleGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    font-size: clamp(1.1rem, 4vw, 1.3rem);
    font-weight: 400;
    margin-bottom: 0.5rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
}

.description {
    font-size: clamp(0.9rem, 3.5vw, 1rem);
    font-weight: 300;
    margin-bottom: 2rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    max-width: 400px;
    text-align: center;
}

.download-section {
    margin-bottom: 1.5rem;
    width: 100%;
}

.download-title {
    font-size: clamp(1rem, 3.5vw, 1.1rem);
    font-weight: 500;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
}

.download-buttons {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
    width: 100%;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 15px;
    padding: 18px 35px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: clamp(1rem, 3.5vw, 1.1rem);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(40px);
    min-width: min(280px, 90vw);
    max-width: 320px;
    width: 100%;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.download-btn.hidden {
    display: none;
}

.download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(219, 84, 97, 0.2), rgba(255, 255, 255, 0.1));
    opacity: 0;
    transition: opacity 0.4s ease;
    border-radius: 20px;
}

.download-btn:hover::before {
    opacity: 1;
}

.download-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 20px 40px rgba(219, 84, 97, 0.3);
    background: rgba(219, 84, 97, 0.15);
}

.download-btn:active {
    transform: translateY(-1px) scale(1.01);
}

.platform-icon {
    width: 28px;
    height: 28px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
    flex-shrink: 0;
}

.btn-text {
    position: relative;
    z-index: 2;
    white-space: nowrap;
}

.footer {
    margin-top: auto;
    padding: 1rem 1rem 0.5rem;
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    line-height: 1.4;
}

/* Loading state */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #DB5461;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .floating-tab-bar {
        top: 25px;
        padding: 8px;
        border-radius: 25px;
        gap: 6px;
    }

    .tab-button {
        padding: 14px 24px;
        font-size: 0.9rem;
        min-width: 100px;
        gap: 8px;
    }

    .tab-icon {
        width: 18px;
        height: 18px;
    }

    .home-container {
        padding: 0.5rem;
        height: calc(100vh - 5rem - 4rem); /* Adjusted for mobile tab bar position and footer space */
        min-height: 500px; /* Ensure minimum height for content */
    }

    .main-content {
        padding: 0.5rem 0;
        flex: 1;
        justify-content: center;
    }

    .logo {
        width: 100px;
        height: 100px;
    }

    .logo-icon {
        width: 50px;
        height: 50px;
    }

    .download-btn {
        padding: 16px 25px;
        min-width: min(250px, 85vw);
        gap: 12px;
    }

    .platform-icon {
        width: 24px;
        height: 24px;
    }

    .description {
        margin-bottom: 2rem;
    }

    .footer {
        padding: 0.75rem 1rem 1rem;
        font-size: clamp(0.75rem, 2.2vw, 0.85rem);
    }
}

@media (max-width: 480px) {
    .floating-tab-bar {
        top: 20px;
        padding: 6px;
        gap: 4px;
    }

    .tab-button {
        padding: 12px 20px;
        font-size: 0.85rem;
        min-width: 90px;
        gap: 6px;
    }

    .tab-icon {
        width: 16px;
        height: 16px;
    }

    .home-container {
        padding: 0.25rem;
        height: calc(100vh - 4.5rem - 3.5rem); /* Adjusted for mobile tab bar position and footer space */
        min-height: 450px; /* Ensure minimum height for content */
    }

    .download-btn {
        min-width: min(220px, 80vw);
        padding: 14px 20px;
        gap: 10px;
    }

    .footer {
        padding: 0.5rem 1rem 1rem;
        font-size: clamp(0.7rem, 2vw, 0.8rem);
    }
}

/* Very small screens */
@media (max-width: 320px) {
    .floating-tab-bar {
        top: 15px;
        padding: 5px;
        gap: 3px;
    }

    .tab-button {
        padding: 10px 16px;
        font-size: 0.8rem;
        min-width: 80px;
        gap: 5px;
    }

    .tab-icon {
        width: 14px;
        height: 14px;
    }

    .home-container {
        height: calc(100vh - 4rem - 3rem); /* Adjusted for mobile tab bar position and footer space */
        min-height: 400px; /* Ensure minimum height for content */
    }

    .download-btn {
        min-width: 90vw;
        padding: 12px 15px;
    }

    .footer {
        padding: 0.5rem 0.75rem 1rem;
        font-size: clamp(0.65rem, 1.8vw, 0.75rem);
    }
}