/* Mobile Navigation Styles */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    margin: 5px auto;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(3, 0, 20, 0.98);
    backdrop-filter: blur(20px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-menu-overlay.active {
    display: block;
    opacity: 1;
}

.mobile-menu-content {
    padding: 100px 30px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mobile-menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-menu-links li {
    margin-bottom: 30px;
    opacity: 0;
    transform: translateX(-20px);
    animation: slideInMobile 0.4s ease forwards;
}

.mobile-menu-links li:nth-child(1) { animation-delay: 0.1s; }
.mobile-menu-links li:nth-child(2) { animation-delay: 0.15s; }
.mobile-menu-links li:nth-child(3) { animation-delay: 0.2s; }
.mobile-menu-links li:nth-child(4) { animation-delay: 0.25s; }
.mobile-menu-links li:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInMobile {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.mobile-menu-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.5rem;
    font-weight: 600;
    display: block;
    padding: 10px 0;
    transition: all 0.3s ease;
    position: relative;
}

.mobile-menu-links a::before {
    content: '';
    position: absolute;
    left: -30px;
    top: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    transition: width 0.3s ease;
    transform: translateY(-50%);
}

.mobile-menu-links a:hover::before,
.mobile-menu-links a.active::before {
    width: 20px;
}

.mobile-menu-links a:hover {
    color: var(--primary);
    transform: translateX(10px);
}

.mobile-download-btn {
    margin-top: auto;
    margin-bottom: 30px;
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    /* Show mobile menu toggle */
    .mobile-menu-toggle {
        display: block;
    }
    
    /* Hide desktop nav links */
    .nav-links {
        display: none !important;
    }
    
    /* Adjust container padding */
    .container {
        padding: 0 15px;
    }
    
    /* Hero Section Mobile */
    .hero {
        padding: 80px 0 40px;
        min-height: auto;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
        line-height: 1.2;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 2rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        width: 100%;
        gap: 0.75rem;
    }
    
    .hero-buttons .btn-magic,
    .hero-buttons .btn-glass {
        width: 100%;
        justify-content: center;
    }
    
    .hero-stats {
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: space-between;
    }
    
    .stat-item {
        flex: 0 0 calc(50% - 0.75rem);
    }
    
    .hero-image {
        order: -1;
    }
    
    .game-card {
        padding: 1.5rem;
    }
    
    /* Bento Grid Mobile */
    .bento-section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }
    
    .section-subtitle {
        font-size: 1rem;
    }
    
    .bento-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .bento-item {
        padding: 1.5rem;
    }
    
    .bento-item.large {
        grid-column: span 1;
    }
    
    .bento-title {
        font-size: 1.25rem;
    }
    
    .bento-description {
        font-size: 0.9rem;
    }
    
    /* Download Section Mobile */
    .download-section {
        padding: 60px 0;
    }
    
    .download-card {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .download-title {
        font-size: 1.8rem;
    }
    
    .download-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1.5rem;
        justify-content: space-around;
    }
    
    .download-stat {
        flex: 0 0 auto;
    }
    
    .download-stat-value {
        font-size: 1.2rem;
    }
    
    /* Gallery Section Mobile */
    .gallery-section {
        padding: 60px 0;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .gallery-card {
        border-radius: 16px;
    }
    
    .gallery-content {
        padding: 1.2rem;
    }
    
    .gallery-title {
        font-size: 1.1rem;
    }
    
    /* Content Section Mobile */
    .content-section {
        padding: 40px 0;
    }
    
    .content-text {
        font-size: 0.95rem;
    }
    
    /* Footer Mobile */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-section {
        margin-bottom: 1.5rem;
    }
    
    .footer-title {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .footer-links {
        gap: 0.75rem;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
        padding-top: 1.5rem;
    }
    
    /* Page Headers Mobile */
    .page-header {
        margin-top: 70px;
        padding: 40px 0;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    /* Cards and Items Mobile */
    .news-grid,
    .blog-posts {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .news-card,
    .blog-card {
        padding: 1.2rem;
    }
    
    /* Buttons Mobile */
    .btn-download {
        width: 100%;
        padding: 1rem;
        font-size: 1rem;
    }
    
    /* Tables Mobile - Make them scrollable */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    /* Images Mobile */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Fix overflow issues */
    body {
        overflow-x: hidden;
    }
    
    /* Adjust floating elements */
    .floating-orb {
        display: none;
    }
}

/* Small Mobile Devices */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .download-title {
        font-size: 1.5rem;
    }
    
    .stat-item {
        flex: 0 0 100%;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .download-stats {
        flex-direction: column;
        gap: 1rem;
    }
    
    .mobile-menu-links a {
        font-size: 1.25rem;
    }
    
    .nav-logo {
        font-size: 1.25rem;
    }
}

/* Landscape Mode Adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: auto;
        padding: 60px 0 30px;
    }
    
    .mobile-menu-content {
        padding: 60px 30px;
    }
    
    .mobile-menu-links li {
        margin-bottom: 20px;
    }
    
    .mobile-menu-links a {
        font-size: 1.2rem;
        padding: 5px 0;
    }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    .nav-link,
    .btn-magic,
    .btn-glass,
    .gallery-link,
    .footer-link,
    .social-icon {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    
    /* Remove hover effects that don't work on touch */
    .bento-item:hover,
    .gallery-card:hover {
        transform: none;
    }
    
    /* Adjust hover states to active states */
    .btn-magic:active,
    .btn-glass:active {
        transform: scale(0.98);
    }
}

/* iOS specific fixes */
@supports (-webkit-touch-callout: none) {
    /* Fix iOS rubber band scrolling */
    body {
        position: fixed;
        width: 100%;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Fix iOS button appearance */
    button,
    .btn-magic,
    .btn-glass {
        -webkit-appearance: none;
        appearance: none;
    }
}

/* Android specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm) {
    /* Fix Android font rendering */
    body {
        text-rendering: optimizeLegibility;
    }
}