/* ============================================
   OPUSFRENCH - MOBILE STYLES
   ============================================
   Ce fichier contient UNIQUEMENT les styles pour mobile.
   Il n'affecte JAMAIS la version PC.
   Tout est encapsulé dans @media (max-width: 768px)
   ============================================ */

@media (max-width: 768px) {
    
    /* ===== HIDE ALL SCROLLBARS ON MOBILE ===== */
    * {
        scrollbar-width: none !important;
        -ms-overflow-style: none !important;
    }
    
    *::-webkit-scrollbar {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
    }
    
    /* ===== HIDE QUICK TRAINING FROM PLAYGROUND (accessible via bottom bar) ===== */
    .mobile-hide-training {
        display: none !important;
    }
    
    /* ===== DISABLE UGLY TAP HIGHLIGHT - CRITICAL ===== */
    *, *::before, *::after {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
        -webkit-touch-callout: none !important;
        -webkit-user-select: none;
        user-select: none;
        outline: none !important;
    }

    /* Allow text selection only in text areas */
    input, textarea {
        -webkit-user-select: text;
        user-select: text;
    }

    /* Pro tap feedback for interactive elements */
    button, a, .clickable, [onclick], .btn, .card, .chapter-card, .mini-game-card, .bottom-bar-item, .mobile-level-btn, .mobile-level-option, .playground-tab, .level-filter-btn {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-tap-highlight-color: rgba(0,0,0,0) !important;
        outline: none !important;
        transition: transform 0.15s ease, opacity 0.15s ease;
    }

    button:active, a:active, .clickable:active, [onclick]:active, .btn:active, .card:active, .chapter-card:active, .mini-game-card:active, .bottom-bar-item:active, .mobile-level-btn:active, .mobile-level-option:active, .playground-tab:active, .level-filter-btn:active {
        transform: scale(0.96);
        opacity: 0.8;
    }

    /* Specific fix for bottom bar items */
    .bottom-bar-item {
        -webkit-tap-highlight-color: transparent !important;
        background: transparent !important;
    }

    .bottom-bar-item:active {
        background: transparent !important;
    }

    /* ===== MOBILE ELEMENTS - Show on mobile only ===== */
    .mobile-menu-btn {
        display: flex !important;
        pointer-events: auto !important;
    }
    
    .mobile-menu-overlay {
        display: block;
        pointer-events: auto !important;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease, visibility 0.3s ease;
    }
    
    .mobile-menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }
    
    .mobile-nav {
        display: flex !important;
        pointer-events: auto !important;
    }
    
    .mobile-menu-close {
        display: flex !important;
        pointer-events: auto !important;
    }

    /* ===== HIDE DESKTOP ELEMENTS ON MOBILE ===== */
    .main-nav {
        display: none !important;
    }
    
    .discord-btn {
        display: none !important;
    }
    
    .admin-notification-btn {
        display: none !important;
    }

    /* Hide upgrade button on mobile header - it's in hamburger menu */
    .upgrade-btn {
        display: none !important;
    }

    /* ===== HEADER MOBILE ===== */
    .header {
        padding: 15px 15px;
        padding-top: max(15px, env(safe-area-inset-top));
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1001;
        margin-bottom: 0;
        background: linear-gradient(180deg, rgba(15, 20, 40, 0.98) 0%, rgba(15, 20, 40, 0.95) 100%);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    /* Add padding to body when header is visible on home */
    body:not(.mobile-not-home) .main-app {
        padding-top: 60px;
    }
    
    /* Hide header on all pages except home on mobile */
    body.mobile-not-home .header {
        display: none !important;
    }
    
    /* Remove padding when header is hidden */
    body.mobile-not-home .main-app {
        padding-top: 0 !important;
    }

    /* ===== FIX GAP BETWEEN HEADER AND CONTENT ===== */
    /* When homePageContent is hidden, ensure no residual space */
    #homePageContent[style*="display: none"],
    #homePageContent.force-hidden {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }

    /* Ensure main-app has no gap */
    .main-app > .header + * {
        margin-top: 0 !important;
    }

    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: relative;
    }

    /* Logo centered */
    .header-left {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        flex: none;
        z-index: 1;
    }

    .logo-small {
        font-size: 1.1rem !important;
        white-space: nowrap;
    }

    /* Header right - keep buttons but smaller */
    .header-right {
        display: flex;
        align-items: center;
        gap: 6px;
        margin-left: auto;
        z-index: 2;
    }

    .upgrade-btn {
        padding: 6px 10px !important;
        font-size: 0.65rem !important;
        white-space: nowrap;
    }

    .login-header-btn {
        padding: 6px 10px !important;
        font-size: 0.7rem !important;
    }

    .profile-pic {
        width: 28px !important;
        height: 28px !important;
    }

    /* ===== HAMBURGER BUTTON ===== */
    .mobile-menu-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 44px;
        height: 44px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 10px;
        z-index: 1002;
        gap: 5px;
        pointer-events: auto !important;
    }

    .hamburger-line {
        display: block;
        width: 24px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active .hamburger-line:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* ===== MOBILE OVERLAY ===== */
    .mobile-menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.6);
        z-index: 9998;
    }

    /* ===== MOBILE NAVIGATION MENU ===== */
    .mobile-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        height: 100dvh;
        background: linear-gradient(180deg, #1a1f38 0%, #0d1020 100%);
        flex-direction: column;
        padding: 80px 30px 30px 30px;
        gap: 0;
        z-index: 9999;
        box-shadow: 5px 0 30px rgba(0, 0, 0, 0.8);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        visibility: hidden;
    }

    .mobile-nav.active {
        transform: translateX(0);
        visibility: visible;
    }

    /* Close button */
    .mobile-menu-close {
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        color: #fff;
        cursor: pointer;
        padding: 8px;
        border-radius: 8px;
        transition: background 0.2s ease;
    }

    .mobile-menu-close:hover {
        background: rgba(255, 255, 255, 0.1);
    }

    /* Mobile nav links */
    .mobile-nav .nav-link {
        padding: 18px 0;
        font-size: 1.3rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        text-align: left;
        width: 100%;
        display: block;
        color: #fff;
        text-decoration: none;
        font-weight: 600;
        pointer-events: auto !important;
        cursor: pointer;
    }

    .mobile-nav .nav-link.active {
        color: #F59E0B;
    }

    .mobile-nav .nav-link:hover {
        color: #F59E0B;
    }

    /* Divider in mobile nav */
    .mobile-nav-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.2);
        margin: 20px 0;
        width: 100%;
    }

    /* Upgrade link in mobile nav - animated gradient */
    @keyframes gradientShift {
        0% {
            background-position: 0% 50%;
        }
        50% {
            background-position: 100% 50%;
        }
        100% {
            background-position: 0% 50%;
        }
    }

    .mobile-nav .mobile-upgrade-link {
        background: linear-gradient(90deg, #F59E0B, #FBBF24, #F59E0B, #D97706, #F59E0B);
        background-size: 300% 100%;
        animation: gradientShift 4s ease infinite;
        color: #fff !important;
        border-radius: 12px;
        padding: 16px 20px !important;
        text-align: center;
        font-weight: 700;
        font-size: 1.1rem;
        border: none !important;
        margin-top: 10px;
        box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
        text-decoration: none;
        display: block;
        transition: transform 0.2s ease, box-shadow 0.2s ease;
        pointer-events: auto !important;
        cursor: pointer;
    }

    .mobile-nav .mobile-upgrade-link:hover,
    .mobile-nav .mobile-upgrade-link:active {
        transform: scale(1.02);
        box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
    }

    /* ===== HEADER RIGHT ADJUSTMENTS ===== */
    .header-right {
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .login-header-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }

    .upgrade-btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .profile-pic {
        width: 32px;
        height: 32px;
    }

    /* ===== HERO SECTION MOBILE ===== */
    .hero-content {
        padding: 0 15px;
        text-align: center;
        margin-top: -20px;
    }

    .hero-title {
        font-size: 13rem !important;
        line-height: 1.05;
        margin-top: 0;
        margin-bottom: 20px !important;
    }
    
    .hero-subtitle {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 25px !important;
    }

    .hero-cta-group {
        flex-direction: row;
        gap: 12px;
        width: 100%;
        padding: 0 15px;
        justify-content: center;
    }

    .hero-cta-btn,
    .hero-secondary-btn {
        flex: 1;
        max-width: 175px;
        padding: 16px 18px;
        font-size: 1rem;
        white-space: nowrap;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        text-align: center !important;
    }

    /* ===== HIDE MASCOT ON MOBILE ===== */
    .mascotte-corner {
        display: none !important;
    }

    .mascot-hero {
        display: none !important;
    }

    .mascot-speech {
        display: none !important;
    }

    /* ===== LEGAL PAGES MOBILE - Simple X button ===== */
    .legal-page .back-btn {
        position: fixed !important;
        top: 15px !important;
        right: 15px !important;
        left: auto !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        background: rgba(255, 255, 255, 0.15) !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        border-radius: 50% !important;
        color: white !important;
        font-size: 20px !important;
        line-height: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        cursor: pointer !important;
        z-index: 999999 !important;
        box-sizing: border-box !important;
    }
    
    /* Fix legal page scroll */
    .legal-page {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: 100% !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch !important;
        z-index: 200000 !important;
    }
    
    .legal-container {
        padding-top: 70px !important;
        padding-bottom: 50px !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    .legal-content {
        position: relative !important;
        z-index: 1 !important;
    }

    /* ===== SLIDESHOW MOBILE ===== */
    .about-slideshow {
        width: 100%;
        padding: 0 15px;
    }
    
    .slideshow-container {
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }

    /* Hide arrows on mobile - use swipe instead */
    .slideshow-arrows {
        display: none !important;
    }

    .slide-arrow {
        display: none !important;
    }

    .slide-content {
        padding: 15px 20px 25px !important;
        min-height: 280px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow: hidden !important;
    }

    /* Slide title - bigger and closer to top */
    .slide-title {
        font-size: 1.4rem !important;
        margin-bottom: 20px !important;
        margin-top: 0 !important;
        padding-top: 0 !important;
        display: block !important;
    }
    
    .slide-intro {
        display: none !important; /* Hide "Everything happens in the Playground" on mobile */
    }
    
    /* How It Works cards - 2 cards stacked vertically, hide 3rd on mobile */
    .how-cards {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
    }
    
    .how-cards .how-card {
        padding: 16px 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    
    .how-cards .how-card:nth-child(3) {
        display: none !important; /* Hide 3rd card on mobile */
    }
    
    .how-card-icon {
        font-size: 1.8rem !important;
        margin-bottom: 6px !important;
    }
    
    .how-card-title {
        font-size: 1rem !important;
        margin-bottom: 4px !important;
    }
    
    .how-card-desc {
        font-size: 0.8rem !important;
    }
    
    /* Stats - 2 on top aligned, 1 bottom - centré verticalement */
    .stats-grid-slide {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        width: 100% !important;
        padding: 0 10px !important;
        box-sizing: border-box !important;
        margin: auto 0 !important;
        flex-grow: 1 !important;
        align-content: center !important;
    }
    
    .stats-grid-slide .stat-item {
        padding: 8px !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        background: none !important;
        border: none !important;
    }
    
    .stats-grid-slide .stat-item:nth-child(3) {
        grid-column: 1 / -1 !important;
        width: 60% !important;
        margin: 0 auto !important;
    }
    
    /* Nombre + symbole sur la même ligne */
    .stat-num-row {
        display: flex !important;
        align-items: baseline !important;
        justify-content: center !important;
    }
    
    .stat-num {
        font-size: 2.2rem !important;
        line-height: 1.1 !important;
    }
    
    .stat-sym {
        font-size: 1.3rem !important;
        margin-left: 2px !important;
    }
    
    .stat-lbl {
        font-size: 0.75rem !important;
        text-align: center !important;
        margin-top: 3px !important;
    }
    
    /* Testimonials - 2 cards stacked vertically, hide 3rd on mobile */
    .testimonials-slide {
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        width: 100% !important;
        padding: 0 20px !important;
        box-sizing: border-box !important;
    }
    
    .testimonials-slide .testimonial-mini {
        padding: 8px 10px !important;
        box-sizing: border-box !important;
        width: 100% !important;
    }
    
    .testimonials-slide .testimonial-mini:nth-child(3) {
        display: none !important; /* Hide 3rd testimonial on mobile */
    }
    
    .testimonial-mini p {
        font-size: 0.65rem !important;
        margin: 4px 0 !important;
        line-height: 1.3 !important;
    }
    
    .testimonial-avatar-letter {
        width: 22px !important;
        height: 22px !important;
        font-size: 0.7rem !important;
    }
    
    .testimonial-stars {
        font-size: 0.55rem !important;
    }
    
    .testimonial-author-mini {
        font-size: 0.6rem !important;
        margin-top: 2px !important;
    }
    
    /* Slideshow navigation dots */
    .slideshow-nav {
        margin-top: 8px !important;
    }
    
    .slide-dot {
        width: 10px !important;
        height: 10px !important;
    }

    /* ===== TESTIMONIALS MOBILE - 2+1 Layout ===== */
    .testimonials-grid {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 15px !important;
        padding: 0 15px;
    }

    .testimonial-card {
        flex: 0 0 calc(50% - 10px) !important;
        min-width: unset !important;
        max-width: unset !important;
        padding: 20px !important;
    }

    .testimonial-card:nth-child(3) {
        flex: 0 0 80% !important;
    }

    .testimonial-card.featured {
        transform: none !important;
    }

    .testimonial-stars {
        font-size: 1rem;
    }

    .testimonial-text {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }

    .testimonial-avatar {
        width: 35px !important;
        height: 35px !important;
        font-size: 0.9rem !important;
    }

    .testimonial-name {
        font-size: 0.85rem;
    }

    /* ===== PLAYGROUND CARDS MOBILE ===== */
    .playground-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
        padding: 0 15px;
    }

    .playground-card {
        min-height: 150px;
    }

    /* ===== CHAPTER CARDS MOBILE ===== */
    .chapter-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
        padding: 0 15px;
    }

    /* ===== MINI GAMES GRID MOBILE ===== */
    .mini-games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px;
    }

    .mini-game-card {
        padding: 15px 10px;
    }

    .mini-game-icon {
        font-size: 1.8rem;
    }

    .mini-game-title {
        font-size: 0.75rem;
    }

    /* ===== POPUPS MOBILE ===== */
    .popup-content {
        width: 95% !important;
        max-width: none !important;
        margin: 10px;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Timer popup positioned higher on mobile */
    #timerPopup .popup-content,
    #conjugationTimerPopup .popup-content {
        margin-top: 60px;
        margin-bottom: auto;
    }
    
    #timerPopup,
    #conjugationTimerPopup {
        align-items: flex-start;
        padding-top: 20px;
    }

    .popup-header h3 {
        font-size: 1.1rem;
    }

    /* ===== GENERAL MOBILE ADJUSTMENTS ===== */
    .section-title {
        font-size: 1.5rem;
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    /* Prevent horizontal scroll and remove gray space */
    html, body {
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }

    body {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .main-app {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* ===== LESSON SCREEN MOBILE ===== */
    .lesson-header {
        padding: 15px;
        flex-direction: column;
        gap: 10px;
    }

    .lesson-progress-bar {
        position: sticky;
        top: 60px;
        z-index: 100;
        background: #1a1f38;
        padding: 10px 15px;
        margin: 0 -15px;
    }

    .lesson-content {
        padding: 15px;
        padding-bottom: 100px; /* Space for fixed footer */
    }

    .lesson-footer {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 15px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
        background: linear-gradient(180deg, rgba(26, 31, 56, 0) 0%, #1a1f38 20%);
        z-index: 100;
    }

    .lesson-footer .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 1rem;
    }

    .lesson-text {
        font-size: 1rem;
        line-height: 1.7;
    }

    /* ===== QUICK TRAINING MOBILE ===== */
    .training-container {
        padding: 15px;
    }

    .training-header {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }

    .timer-display {
        font-size: 1.5rem;
    }

    .category-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }

    .category-card {
        padding: 15px 10px;
        min-height: 80px;
    }

    .category-icon {
        font-size: 1.5rem;
    }

    .category-name {
        font-size: 0.8rem;
    }

    /* Flashcard Mobile */
    .flashcard-container {
        padding: 20px 15px;
        touch-action: pan-x;
    }

    .flashcard {
        min-height: 250px;
        width: 100%;
        cursor: grab;
    }

    .flashcard-front,
    .flashcard-back {
        padding: 30px 20px;
    }

    .flashcard-word {
        font-size: 1.8rem;
    }

    .flashcard-translation {
        font-size: 1.3rem;
    }

    .flashcard-actions {
        flex-direction: row;
        gap: 15px;
        padding: 15px;
    }

    .flashcard-btn {
        flex: 1;
        padding: 14px 20px;
        min-height: 50px;
    }

    /* ===== SETTINGS PAGE MOBILE ===== */
    .settings-container {
        padding: 15px;
    }

    .settings-section {
        padding: 20px 15px;
        margin-bottom: 15px;
    }

    .settings-title {
        font-size: 1.1rem;
    }

    .setting-item {
        padding: 15px 0;
        flex-wrap: wrap;
    }

    .setting-label {
        width: 100%;
        margin-bottom: 10px;
    }

    .setting-control {
        width: 100%;
    }

    .setting-toggle {
        width: 50px;
        height: 28px;
    }

    /* ===== PRICING PAGE MOBILE ===== */
    .pricing-container {
        padding: 15px;
    }

    .pricing-grid {
        grid-template-columns: 1fr !important;
        gap: 20px;
    }

    .pricing-card {
        padding: 25px 20px;
    }

    .pricing-card.popular {
        transform: none !important;
        order: -1;
    }

    .pricing-badge {
        font-size: 0.7rem;
    }

    .pricing-price {
        font-size: 2.5rem;
    }

    .pricing-features li {
        font-size: 0.9rem;
        padding: 8px 0;
    }

    .pricing-btn {
        width: 100%;
        padding: 14px 24px;
    }

    /* ===== TROPHIES PAGE MOBILE ===== */
    .trophies-container {
        padding: 15px;
    }

    .trophies-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
    }

    .trophy-card {
        padding: 15px 10px;
    }

    .trophy-icon {
        font-size: 2rem;
    }

    .trophy-name {
        font-size: 0.7rem;
    }

    .trophy-progress {
        font-size: 0.65rem;
    }

    /* ===== FAQ PAGE MOBILE ===== */
    .faq-container {
        padding: 15px;
    }

    .faq-item {
        margin-bottom: 10px;
    }

    .faq-question {
        padding: 15px;
        font-size: 0.95rem;
    }

    .faq-answer {
        padding: 0 15px 15px 15px;
        font-size: 0.9rem;
    }

    /* ===== CONTACT PAGE MOBILE ===== */
    .contact-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .contact-card {
        padding: 20px 15px;
    }

    .contact-icon {
        font-size: 2rem;
    }

    /* ===== AUTHENTICATION SCREENS MOBILE ===== */
    .auth-popup .popup-content {
        width: 100% !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: none !important;
        border-radius: 0 !important;
        margin: 0;
        display: flex;
        flex-direction: column;
    }

    .auth-container {
        padding: 30px 20px;
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* ===== MOBILE LOGIN SCREEN FIX ===== */
    .login-screen,
    #signupScreen,
    #forgotPasswordScreen,
    #verifyCodeScreen,
    #newPasswordScreen,
    #setPasswordAfterGoogleScreen {
        z-index: 100000 !important;
        padding: 15px !important;
        overflow-y: auto !important;
    }
    
    .login-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px !important;
        margin: 0 !important;
    }
    
    .login-container .logo {
        font-size: 1.8rem !important;
        margin-bottom: 10px !important;
    }
    
    .login-container .welcome-text {
        font-size: 1.3rem !important;
        margin-bottom: 20px !important;
    }
    
    .login-container .form-group {
        margin-bottom: 12px !important;
    }
    
    .login-container .login-input {
        padding: 12px !important;
        font-size: 0.95rem !important;
    }
    
    .login-container .login-button {
        padding: 12px !important;
        font-size: 1rem !important;
        margin-top: 5px !important;
    }
    
    .login-container .divider {
        margin: 15px 0 !important;
    }
    
    .login-container .google-signin-btn {
        padding: 12px !important;
    }
    
    .login-container .auth-links {
        margin-top: 15px !important;
        gap: 8px !important;
    }
    
    /* Signup page specific - more compact */
    #signupScreen .login-container {
        padding: 15px !important;
    }
    
    #signupScreen .login-container .logo {
        font-size: 1.5rem !important;
        margin-bottom: 5px !important;
    }
    
    #signupScreen .login-container .welcome-text {
        font-size: 1.2rem !important;
        margin-bottom: 5px !important;
    }
    
    #signupScreen .signup-subtitle {
        font-size: 0.85rem !important;
        margin-bottom: 15px !important;
    }
    
    #signupScreen .login-container .form-group {
        margin-bottom: 8px !important;
    }
    
    #signupScreen .login-container .input-label {
        font-size: 0.85rem !important;
        margin-bottom: 4px !important;
    }
    
    #signupScreen .login-container .login-input {
        padding: 10px !important;
        font-size: 0.9rem !important;
    }
    
    #signupScreen .checkbox-group {
        margin-bottom: 10px !important;
    }
    
    #signupScreen .checkbox-label {
        font-size: 0.85rem !important;
        gap: 10px !important;
    }
    
    #signupScreen .checkbox-label input[type="checkbox"] {
        width: 22px !important;
        height: 22px !important;
        min-width: 22px !important;
    }
    
    #signupScreen .checkbox-label a {
        color: #F59E0B !important;
    }
    
    #signupScreen .login-container .login-button {
        padding: 10px !important;
        margin-top: 10px !important;
    }
    
    #signupScreen .login-container .divider {
        margin: 10px 0 !important;
    }
    
    /* Hide ambient orbs on mobile for performance */
    .ambient-bg {
        display: none !important;
    }

    .auth-title {
        font-size: 1.5rem;
        margin-bottom: 25px;
    }

    .auth-form {
        width: 100%;
    }

    .auth-input {
        width: 100%;
        padding: 16px;
        font-size: 1rem;
        min-height: 52px;
    }

    .auth-btn {
        width: 100%;
        padding: 16px;
        font-size: 1rem;
        min-height: 52px;
    }

    .auth-divider {
        margin: 25px 0;
    }

    .social-login-btn {
        width: 100%;
        padding: 14px;
        min-height: 50px;
    }

    .auth-mascot {
        display: none !important;
    }

    .auth-decoration {
        display: none !important;
    }

    /* ===== HIDE BACK BUTTON ON MOBILE ===== */
    .back-button {
        display: none !important;
    }

    /* ===== LEVEL FILTER MOBILE - Single Dropdown Button ===== */
    .level-filter {
        display: none !important; /* Hide original filter */
    }

    /* Mobile Level Dropdown System */
    .mobile-level-dropdown {
        display: flex !important;
        justify-content: center;
        padding: 5px 15px 15px 15px;
    }

    .mobile-level-wrapper {
        position: relative;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .mobile-level-btn {
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-width: 160px;
        padding: 12px 20px;
        background: linear-gradient(135deg, rgba(100, 116, 139, 0.2) 0%, rgba(71, 85, 105, 0.15) 100%);
        border: 1px solid rgba(100, 116, 139, 0.4);
        border-radius: 25px;
        color: #fff;
        font-size: 0.95rem;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .mobile-level-btn:active {
        transform: scale(0.96);
    }

    .mobile-level-btn.open {
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }

    /* Dynamic level colors for mobile button */
    .mobile-level-btn.level-all {
        background: linear-gradient(135deg, rgba(100, 116, 139, 0.25) 0%, rgba(71, 85, 105, 0.2) 100%);
        border-color: rgba(100, 116, 139, 0.5);
    }

    .mobile-level-btn.level-a1 {
        background: linear-gradient(135deg, rgba(6, 182, 212, 0.25) 0%, rgba(34, 211, 238, 0.15) 100%);
        border-color: rgba(6, 182, 212, 0.5);
    }
    .mobile-level-btn.level-a1.open {
        box-shadow: 0 4px 20px rgba(6, 182, 212, 0.3);
    }

    .mobile-level-btn.level-a2 {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.25) 0%, rgba(96, 165, 250, 0.15) 100%);
        border-color: rgba(59, 130, 246, 0.5);
    }
    .mobile-level-btn.level-a2.open {
        box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
    }

    .mobile-level-btn.level-b1 {
        background: linear-gradient(135deg, rgba(245, 158, 11, 0.25) 0%, rgba(251, 191, 36, 0.15) 100%);
        border-color: rgba(245, 158, 11, 0.5);
    }
    .mobile-level-btn.level-b1.open {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    }

    .mobile-level-btn.level-b2 {
        background: linear-gradient(135deg, rgba(239, 68, 68, 0.25) 0%, rgba(248, 113, 113, 0.15) 100%);
        border-color: rgba(239, 68, 68, 0.5);
    }
    .mobile-level-btn.level-b2.open {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    }

    .mobile-level-btn .level-icon {
        margin-right: 8px;
    }

    .mobile-level-btn .dropdown-arrow {
        font-size: 0.7rem;
        margin-left: 10px;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0.7;
    }

    .mobile-level-btn.open .dropdown-arrow {
        transform: rotate(180deg);
    }

    /* Dropdown Options - Animated */
    .mobile-level-options {
        position: absolute;
        top: calc(100% + 8px);
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        min-width: 220px;
        background: linear-gradient(180deg, #252a45 0%, #1a1f38 100%);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        overflow: hidden;
        z-index: 100;
        box-shadow: 
            0 10px 40px rgba(0, 0, 0, 0.5),
            0 0 0 1px rgba(255, 255, 255, 0.05) inset;
        opacity: 0;
        visibility: hidden;
        transition: 
            opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1),
            transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0.25s;
    }

    .mobile-level-options.open {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

    .mobile-level-option {
        display: flex;
        align-items: center;
        width: 100%;
        padding: 14px 20px;
        background: transparent;
        border: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.8);
        font-size: 0.9rem;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.2s ease;
        text-align: left;
    }

    .mobile-level-option:last-child {
        border-bottom: none;
    }

    .mobile-level-option:active {
        background: rgba(245, 158, 11, 0.15);
    }

    .mobile-level-option.active {
        background: linear-gradient(90deg, rgba(245, 158, 11, 0.2) 0%, transparent 100%);
        color: #F59E0B;
    }

    .mobile-level-option.active::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: #F59E0B;
    }

    .mobile-level-option {
        position: relative;
    }

    .mobile-level-option .level-icon {
        margin-right: 12px;
        font-size: 1.1rem;
    }

    /* Backdrop blur effect behind dropdown */
    .mobile-level-options::before {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(26, 31, 56, 0.8);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        z-index: -1;
        border-radius: 16px;
    }

    .level-btn {
        flex-shrink: 0;
        padding: 10px 16px;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* ===== FIX PADDING ON MOBILE PAGES ===== */
    #lua-campaign-content,
    #mini-games-content,
    #quick-training-content {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #lua-campaign-content .page-header,
    #lua-campaign-content .chapters-grid {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    .chapters-grid {
        padding: 0 15px !important;
    }

    /* ===== BOTTOM SHEET COMPONENT ===== */
    .bottom-sheet {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(180deg, #2a2f4a 0%, #1a1f38 100%);
        border-radius: 20px 20px 0 0;
        padding: 20px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
        transform: translateY(100%);
        transition: transform 0.3s ease;
        z-index: 10000;
        max-height: 60vh;
        overflow-y: auto;
    }

    .bottom-sheet.active {
        transform: translateY(0);
    }

    .bottom-sheet-handle {
        width: 40px;
        height: 4px;
        background: rgba(255, 255, 255, 0.3);
        border-radius: 2px;
        margin: 0 auto 20px auto;
    }

    .bottom-sheet-title {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 20px;
        text-align: center;
    }

    .bottom-sheet-options {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .bottom-sheet-option {
        padding: 15px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 12px;
        text-align: center;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .bottom-sheet-option:hover,
    .bottom-sheet-option.selected {
        background: rgba(245, 158, 11, 0.2);
        border-color: #F59E0B;
    }

    /* ===== GAME COMMON STYLES MOBILE ===== */
    .game-container {
        padding: 15px;
        padding-bottom: max(15px, env(safe-area-inset-bottom));
    }

    .game-header {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 20px;
    }

    .game-title {
        font-size: 1.2rem;
    }

    .game-score {
        font-size: 1rem;
    }

    .game-timer {
        font-size: 1.3rem;
    }

    .game-back-btn {
        min-width: 44px;
        min-height: 44px;
    }

    .game-instructions {
        font-size: 0.9rem;
        padding: 15px;
    }

    /* ===== MEMORY GAME MOBILE ===== */
    .memory-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
        max-width: 320px;
        margin: 0 auto;
    }

    .memory-card {
        aspect-ratio: 1;
        min-width: 70px;
        min-height: 70px;
        font-size: 0.9rem;
    }

    /* ===== HANGMAN GAME MOBILE ===== */
    .hangman-container {
        padding: 15px;
    }

    .hangman-drawing {
        width: 150px;
        height: 150px;
        margin: 0 auto 20px auto;
    }

    .hangman-word {
        font-size: 1.5rem;
        letter-spacing: 8px;
        margin-bottom: 25px;
    }

    .hangman-keyboard {
        display: grid;
        gap: 5px;
        max-width: 100%;
    }

    .keyboard-row {
        display: flex;
        justify-content: center;
        gap: 4px;
    }

    .keyboard-key {
        min-width: 28px;
        min-height: 44px;
        padding: 8px 4px;
        font-size: 0.85rem;
        border-radius: 6px;
        flex-shrink: 0;
    }

    /* ===== WORD RACE GAME MOBILE ===== */
    .word-race-container {
        padding: 15px;
    }

    .word-race-display {
        font-size: 1.8rem;
        padding: 25px 15px;
        margin-bottom: 20px;
    }

    .word-race-input {
        font-size: 1.1rem;
        padding: 16px;
        width: 100%;
    }

    .word-race-options {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    .word-race-option {
        padding: 16px;
        font-size: 1rem;
        min-height: 50px;
    }

    /* ===== WORD BOMB GAME MOBILE ===== */
    .word-bomb-container {
        padding: 15px;
        text-align: center;
    }

    .bomb-display {
        width: 120px;
        height: 120px;
        margin: 0 auto 20px auto;
    }

    .bomb-timer {
        font-size: 2rem;
    }

    .word-bomb-fragment {
        font-size: 1.5rem;
        padding: 15px 25px;
        margin-bottom: 20px;
    }

    .word-bomb-input {
        font-size: 1.1rem;
        padding: 16px;
        width: 100%;
    }

    /* ===== WORDLE GAME MOBILE ===== */
    .wordle-container {
        padding: 15px;
    }

    .wordle-grid {
        gap: 6px;
        margin-bottom: 25px;
    }

    .wordle-row {
        gap: 6px;
    }

    .wordle-cell {
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }

    .wordle-keyboard {
        gap: 6px;
    }

    .wordle-key {
        min-width: 26px;
        min-height: 44px;
        padding: 8px 4px;
        font-size: 0.8rem;
    }

    .wordle-key.wide {
        min-width: 44px;
        font-size: 0.7rem;
    }

    .wordle-accents {
        display: flex;
        justify-content: center;
        gap: 6px;
        margin-bottom: 10px;
    }

    .wordle-accent-key {
        padding: 10px 12px;
        font-size: 0.9rem;
        min-height: 44px;
    }

    /* ===== GENDER SWIPE GAME MOBILE ===== */
    .gender-swipe-container {
        padding: 15px;
        touch-action: pan-x;
        overflow: hidden;
    }

    .swipe-card {
        width: calc(100% - 30px);
        max-width: 300px;
        min-height: 200px;
        margin: 0 auto;
        cursor: grab;
        transition: transform 0.1s ease;
    }

    .swipe-card.swiping {
        transition: none;
    }

    .swipe-word {
        font-size: 2rem;
    }

    .swipe-hint {
        display: flex;
        justify-content: space-between;
        padding: 10px 20px;
        color: rgba(255, 255, 255, 0.5);
        font-size: 0.8rem;
    }

    .gender-buttons {
        display: flex;
        gap: 15px;
        margin-top: 20px;
    }

    .gender-btn {
        flex: 1;
        padding: 16px;
        min-height: 56px;
        font-size: 1.1rem;
    }

    .gender-btn.le {
        background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
    }

    .gender-btn.la {
        background: linear-gradient(135deg, #EC4899 0%, #BE185D 100%);
    }

    /* ===== CONJUGAISON NINJA GAME MOBILE ===== */
    .ninja-container {
        padding: 15px;
    }

    .ninja-verb-display {
        font-size: 1.3rem;
        padding: 20px;
        margin-bottom: 20px;
    }

    .ninja-verb {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .ninja-tense {
        font-size: 0.9rem;
        color: #F59E0B;
    }

    .ninja-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .ninja-option {
        padding: 18px 15px;
        font-size: 1rem;
        min-height: 60px;
        border-radius: 12px;
    }

    /* ===== OPPOSITES GAME MOBILE ===== */
    .opposites-container {
        padding: 15px;
    }

    .opposites-word {
        font-size: 1.8rem;
        padding: 25px;
        margin-bottom: 25px;
    }

    .opposites-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .opposites-option {
        padding: 18px 15px;
        font-size: 1rem;
        min-height: 60px;
    }

    /* ===== SLAM GAME MOBILE ===== */
    .slam-container {
        padding: 15px;
    }

    .slam-grid {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px;
    }

    .slam-cell {
        min-width: 40px;
        min-height: 40px;
        font-size: 1rem;
    }

    .slam-clue {
        font-size: 0.95rem;
        padding: 15px;
        margin-bottom: 15px;
    }

    .slam-input {
        font-size: 1.1rem;
        padding: 16px;
    }

    /* ===== STATS & RESULTS MOBILE ===== */
    .game-results {
        padding: 25px 20px;
    }

    .results-title {
        font-size: 1.5rem;
    }

    .results-score {
        font-size: 2.5rem;
    }

    .results-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .stat-item {
        padding: 15px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .results-actions {
        flex-direction: column;
        gap: 10px;
    }

    .results-btn {
        width: 100%;
        padding: 14px 24px;
    }

    /* ===== LOADING STATES MOBILE ===== */
    .loading-spinner {
        width: 40px;
        height: 40px;
    }

    .skeleton-loader {
        border-radius: 8px;
    }

    /* ===== TOAST NOTIFICATIONS MOBILE ===== */
    .toast {
        left: 15px !important;
        right: 15px !important;
        bottom: max(20px, env(safe-area-inset-bottom)) !important;
        max-width: none !important;
    }

    /* ===== PERFORMANCE - HIDE DECORATIONS ===== */
    .ambient-orb,
    .ambient-bg,
    .background-decoration,
    .floating-element {
        display: none !important;
    }
}

/* ===== VERY SMALL SCREENS (< 480px) ===== */
@media (max-width: 480px) {
    .testimonial-card {
        flex: 0 0 100% !important;
    }

    .testimonial-card:nth-child(3) {
        flex: 0 0 100% !important;
    }

    .mini-games-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .hero-title {
        font-size: 1.7rem !important;
    }

    .mobile-nav {
        width: 85%;
    }

    .memory-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 6px;
    }

    .memory-card {
        min-width: 60px;
        min-height: 60px;
        font-size: 0.8rem;
    }

    .wordle-cell {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .keyboard-key {
        min-width: 24px;
        font-size: 0.75rem;
    }

    .trophies-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .bottom-sheet-options {
        grid-template-columns: 1fr;
    }
}

/* ===== EXTRA SMALL SCREENS (< 360px) ===== */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.5rem !important;
    }

    .mobile-nav {
        width: 100%;
    }

    .wordle-cell {
        width: 36px;
        height: 36px;
        font-size: 1rem;
    }

    .memory-card {
        min-width: 55px;
        min-height: 55px;
    }

    .keyboard-key,
    .wordle-key {
        min-width: 22px;
        font-size: 0.7rem;
    }

    .ninja-options,
    .opposites-options {
        grid-template-columns: 1fr;
    }
}
/* ============================================
   BOTTOM BAR NAVIGATION - Duolingo Style
   ============================================ */
@media (max-width: 768px) {
    
    /* ===== HIDE HAMBURGER MENU ON MOBILE ===== */
    .mobile-menu-btn {
        display: none !important;
    }
    
    .mobile-nav {
        display: none !important;
    }
    
    .mobile-menu-overlay {
        display: none !important;
    }

    /* ===== BOTTOM BAR ===== */
    .mobile-bottom-bar {
        display: flex !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 60px;
        padding-bottom: env(safe-area-inset-bottom, 0);
        background: rgba(26, 31, 56, 0.95);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        justify-content: space-around;
        align-items: center;
        z-index: 9999;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    }

    .bottom-bar-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        flex: 1;
        height: 100%;
        background: transparent;
        border: none;
        color: rgba(255, 255, 255, 0.5);
        cursor: pointer;
        transition: color 0.2s ease, transform 0.15s ease;
        padding: 8px 0;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    .bottom-bar-item:active {
        transform: scale(0.92);
    }

    .bottom-bar-item.active {
        color: #F59E0B !important;
    }

    .bottom-bar-item.active .bottom-bar-icon {
        transform: scale(1.1);
    }

    /* Active Profile styling - orange border and label */
    .bottom-bar-item[data-page="profile"].active .bottom-bar-profile-emoji {
        border-color: #F59E0B !important;
    }
    
    .bottom-bar-item[data-page="profile"].active .bottom-bar-profile-img {
        border: 2px solid #F59E0B !important;
    }

    /* Ensure active state persists even during touch */
    .bottom-bar-item.active:active {
        color: #F59E0B !important;
    }

    .bottom-bar-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 4px;
        transition: transform 0.2s ease;
    }

    .bottom-bar-label {
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.3px;
    }

    /* ===== ADJUST MAIN CONTENT FOR BOTTOM BAR ===== */
    .main-app {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0)) !important;
    }

    /* Adjust for pages that need more space */
    .page-container,
    .homePage,
    #homePage {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important;
    }

    /* Fix gap between header and content */
    .main-container {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* When homePage (playground) is visible, it should appear right after header */
    #homePage {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    /* CRITICAL: When homePageContent is hidden, main-app should only show header */
    .main-app:has(#homePageContent[style*="display: none"]),
    .main-app:has(#homePageContent.force-hidden) {
        display: contents !important; /* Makes main-app transparent in layout */
    }
    
    /* Keep header visible and styled when main-app uses display:contents */
    .main-app:has(#homePageContent[style*="display: none"]) > .header,
    .main-app:has(#homePageContent.force-hidden) > .header {
        display: block !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 1001 !important;
        background: #0A0E27 !important;
    }

    /* The lua-campaign-content needs adjustment too */
    #lua-campaign-content {
        padding-top: 10px !important;
    }

    #mini-games-content {
        padding-top: 10px !important;
    }

    /* When playground is visible, collapse main-app content area */
    #homePage[style*="display: block"] ~ .main-app #homePageContent,
    #homePage:not([style*="display: none"]) ~ .main-app #homePageContent {
        display: none !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    /* Make main-app shrink when content is hidden */
    .main-app:has(#homePageContent[style*="display: none"]),
    .main-app:has(#homePageContent.force-hidden) {
        min-height: auto !important;
    }

    /* Ensure homePageContent takes no space when hidden */
    #homePageContent {
        min-height: 0;
    }

    #homePageContent[style*="display: none"],
    #homePageContent.force-hidden {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }

    .page-header {
        margin-top: 0 !important;
        padding-top: 20px !important;
    }
    
    /* Playground title padding */
    #playgroundMainTitle {
        padding-top: 20px !important;
    }
    
    /* French Lessons page header */
    #lua-campaign-content .page-header,
    #lua-campaign-content > .page-header {
        padding-top: 20px !important;
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        margin-bottom: 10px !important;
    }
    
    #lua-campaign-content .page-header .page-title,
    #lua-campaign-content .page-title,
    #lua-campaign-content .career-title {
        text-align: center !important;
        width: 100%;
        margin-bottom: 10px !important;
    }
    
    /* Mini Games page header */
    #miniGamesSelection .page-header {
        padding-top: 20px !important;
        text-align: center !important;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    #miniGamesSelection .page-header .career-title {
        text-align: center !important;
        width: 100%;
    }
    
    #miniGamesSelection .page-header .career-subtitle {
        display: none !important;
    }

    /* ===== HEADER SIMPLIFICATION ===== */
    .header-content {
        justify-content: center;
    }

    .header-left {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        width: auto;
    }
    
    .logo-small {
        text-align: center;
    }
    
    /* Hide nav on mobile (use bottom bar instead) */
    .main-nav {
        display: none !important;
    }

    /* ===== PRICING CARDS - Hide on mobile home, show simple CTA ===== */
    .cta-plans.desktop-only {
        display: none !important;
    }
    
    .cta-title.desktop-only {
        display: none !important;
    }
    
    .cta-subtitle.desktop-only {
        display: none !important;
    }
    
    .cta-title-mobile.mobile-only {
        display: block !important;
        font-size: 1.8rem !important;
        font-weight: 700;
        color: white;
        text-align: center;
        margin-bottom: 25px;
    }

    .mobile-cta-simple {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        padding: 20px 20px;
    }

    .mobile-cta-text {
        display: none;
    }

    /* Animated gradient button */
    .upgrade-now-btn {
        display: block !important;
        padding: 18px 50px;
        font-size: 1.1rem;
        font-weight: 700;
        color: white;
        border: none;
        border-radius: 50px;
        cursor: pointer;
        background: linear-gradient(90deg, #FF6B35, #FFB347, #FF6B35, #FFB347);
        background-size: 300% 100%;
        animation: gradientMove 3s ease infinite;
        box-shadow: 0 8px 25px rgba(255, 107, 53, 0.4);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    
    .upgrade-now-btn:hover,
    .upgrade-now-btn:active {
        transform: scale(1.05);
        box-shadow: 0 12px 35px rgba(255, 107, 53, 0.5);
    }
    
    @keyframes gradientMove {
        0% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
        100% { background-position: 0% 50%; }
    }

    .mobile-cta-btn {
        display: none;
    }

    @keyframes ctaBtnGlow {
        0%, 100% { background-position: 0% 50%; }
        50% { background-position: 100% 50%; }
    }

    .mobile-cta-btn:active {
        transform: scale(0.96);
        box-shadow: 
            0 5px 20px rgba(138, 43, 226, 0.5),
            0 0 30px rgba(197, 48, 128, 0.3);
    }

    .mobile-cta-btn-icon {
        font-size: 20px;
    }

    /* ===== SHOP DASHBOARD PAGE ===== */
    .shop-dashboard-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #0a0a12;
        z-index: 9998;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 100px;
        animation: premiumPageSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        /* Hide scrollbar */
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .shop-dashboard-page::-webkit-scrollbar {
        display: none;
    }
    
    .shop-dashboard-content {
        position: relative;
        z-index: 1;
        padding: 40px 20px 100px;
    }
    
    .shop-dashboard-title {
        font-size: 1.8em;
        font-weight: 700;
        color: #FFFFFF;
        text-align: center;
        margin-bottom: 30px;
    }
    
    /* Status Card (non-clickable) */
    .shop-status-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 24px;
    }
    
    .shop-status-header {
        display: flex;
        align-items: center;
        gap: 10px;
        margin-bottom: 12px;
    }
    
    .shop-status-icon {
        font-size: 1.3em;
    }
    
    .shop-status-label {
        font-size: 0.85em;
        font-weight: 600;
        color: rgba(255, 255, 255, 0.6);
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .shop-status-info {
        display: flex;
        flex-direction: column;
        gap: 4px;
        padding-left: 32px;
    }
    
    .shop-status-plan {
        font-size: 1.2em;
        font-weight: 700;
        color: #FFFFFF;
    }
    
    .shop-status-plan.premium {
        color: #22C55E;
    }
    
    .shop-status-billing {
        font-size: 0.85em;
        color: rgba(255, 255, 255, 0.5);
    }
    
    /* Action Cards Grid */
    .shop-action-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .shop-action-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 20px 16px;
        text-align: center;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .shop-action-card:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }
    
    .shop-action-premium {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(217, 70, 239, 0.2));
        border-color: rgba(139, 92, 246, 0.3);
    }
    
    .shop-action-icon {
        font-size: 2.2em;
        margin-bottom: 12px;
    }
    
    .shop-action-title {
        font-size: 1em;
        font-weight: 700;
        color: #FFFFFF;
        margin: 0 0 6px;
    }
    
    .shop-action-desc {
        font-size: 0.8em;
        color: rgba(255, 255, 255, 0.5);
        margin: 0;
    }

    /* Legacy styles kept for compatibility */
    .shop-dashboard-card {
        display: flex;
        align-items: center;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        border-radius: 16px;
        padding: 20px;
        margin-bottom: 15px;
        cursor: pointer;
        transition: all 0.3s ease;
    }
    
    .shop-dashboard-card:hover,
    .shop-dashboard-card:active {
        background: rgba(255, 255, 255, 0.1);
        transform: translateY(-2px);
    }
    
    .shop-card-premium {
        background: linear-gradient(135deg, rgba(139, 92, 246, 0.2), rgba(217, 70, 239, 0.2));
        border-color: rgba(139, 92, 246, 0.3);
    }
    
    .shop-card-icon {
        font-size: 2em;
        margin-right: 15px;
        flex-shrink: 0;
    }
    
    .shop-card-info {
        flex: 1;
    }
    
    .shop-card-title {
        font-size: 1.1em;
        font-weight: 600;
        color: #FFFFFF;
        margin-bottom: 4px;
    }
    
    .shop-card-desc {
        font-size: 0.9em;
        color: #9CA3AF;
        margin: 0;
    }
    
    .shop-card-arrow {
        font-size: 1.5em;
        color: #6B7280;
        flex-shrink: 0;
    }
    
    /* Premium close button */
    .premium-close-btn {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 40px;
        height: 40px;
        background: rgba(255, 255, 255, 0.1);
        border: none;
        border-radius: 50%;
        color: #FFFFFF;
        font-size: 1.5em;
        cursor: pointer;
        z-index: 10;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.2s;
    }
    
    .premium-close-btn:hover,
    .premium-close-btn:active {
        background: rgba(255, 255, 255, 0.2);
    }
    
    /* ===== MOBILE CONTACT PAGE ===== */
    .mobile-contact-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
        z-index: 10000;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 100px;
        animation: premiumPageSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }
    
    .mobile-contact-content {
        position: relative;
        z-index: 1;
        padding: 60px 20px 100px;
    }
    
    .mobile-contact-header {
        text-align: center;
        margin-bottom: 30px;
    }
    
    .mobile-contact-badge {
        display: inline-block;
        background: rgba(168, 85, 247, 0.2);
        color: #A855F7;
        padding: 6px 14px;
        border-radius: 20px;
        font-size: 12px;
        font-weight: 600;
        margin-bottom: 12px;
    }
    
    .mobile-contact-title {
        font-size: 28px;
        font-weight: 800;
        color: #fff;
        margin-bottom: 8px;
    }
    
    .mobile-contact-gradient {
        background: linear-gradient(135deg, #A855F7, #EC4899);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-clip: text;
    }
    
    .mobile-contact-subtitle {
        font-size: 14px;
        color: rgba(255,255,255,0.7);
    }
    
    .mobile-contact-buttons {
        display: flex;
        flex-direction: column;
        gap: 12px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .mobile-contact-btn {
        display: flex;
        align-items: center;
        gap: 14px;
        background: rgba(255,255,255,0.05);
        border: 1px solid rgba(255,255,255,0.1);
        border-radius: 16px;
        padding: 16px;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-contact-btn:active {
        transform: scale(0.98);
    }
    
    .mobile-contact-btn.discord {
        border-color: rgba(88, 101, 242, 0.4);
    }
    
    .mobile-contact-btn.discord .mobile-contact-btn-icon {
        background: linear-gradient(135deg, #5865F2, #7289DA);
    }
    
    .mobile-contact-btn.instagram {
        border-color: rgba(225, 48, 108, 0.4);
    }
    
    .mobile-contact-btn.instagram .mobile-contact-btn-icon {
        background: linear-gradient(135deg, #E1306C, #F77737);
    }
    
    .mobile-contact-btn.email {
        border-color: rgba(16, 185, 129, 0.4);
    }
    
    .mobile-contact-btn.email .mobile-contact-btn-icon {
        background: linear-gradient(135deg, #10B981, #34D399);
    }
    
    .mobile-contact-btn-icon {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        color: #fff;
        flex-shrink: 0;
    }
    
    .mobile-contact-btn-text {
        flex: 1;
        text-align: left;
    }
    
    .mobile-contact-btn-title {
        display: block;
        font-size: 16px;
        font-weight: 600;
        color: #fff;
        margin-bottom: 2px;
    }
    
    .mobile-contact-btn-desc {
        display: block;
        font-size: 13px;
        color: rgba(255,255,255,0.6);
    }
    
    .mobile-contact-btn-arrow {
        font-size: 24px;
        color: rgba(255,255,255,0.4);
    }
    
    /* Feature Card */
    .mobile-feature-card {
        background: rgba(168, 85, 247, 0.1);
        border: 1px solid rgba(168, 85, 247, 0.3);
        border-radius: 20px;
        padding: 24px;
        text-align: center;
        margin-top: 30px;
        max-width: 400px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .mobile-feature-icon {
        font-size: 40px;
        margin-bottom: 12px;
    }
    
    .mobile-feature-card h3 {
        font-size: 18px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 6px;
    }
    
    .mobile-feature-card p {
        font-size: 14px;
        color: rgba(255,255,255,0.7);
        margin-bottom: 16px;
    }
    
    .mobile-feature-btn {
        display: inline-block;
        background: linear-gradient(135deg, #A855F7 0%, #7C3AED 100%);
        color: #fff;
        padding: 12px 24px;
        border-radius: 25px;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
    }
    
    /* ===== PRIVATE LESSONS PAGE (Mobile) ===== */
    .private-lessons-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(180deg, #1a1a2e 0%, #0f0f1a 100%);
        z-index: 10000;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 20px;
        animation: premiumPageSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
        /* Hide scrollbar */
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE/Edge */
    }
    
    .private-lessons-page::-webkit-scrollbar {
        display: none; /* Chrome/Safari */
    }
    
    .private-lessons-page-content {
        position: relative;
        z-index: 1;
        padding: 50px 20px 10px;
        overflow: visible;
    }
    
    .private-lessons-page .private-lessons-grid {
        overflow: visible;
        gap: 25px;
    }
    
    .private-lessons-page .career-header {
        text-align: center;
        margin-bottom: 20px !important;
        padding-bottom: 0 !important;
    }
    
    .private-lessons-page .career-subtitle {
        display: none;
    }
    
    /* How to claim button positioned above packs on mobile */
    .private-lessons-page .mobile-claim-top {
        margin-top: 0 !important;
        margin-bottom: 0 !important;
        padding: 0 !important;
    }
    
    .private-lessons-page .how-to-claim-btn {
        margin-bottom: 0 !important;
    }
    
    .private-lessons-page .private-lessons-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
        max-width: 400px;
        margin: 0 auto;
        margin-top: 4px !important;
    }
    
    .private-lessons-page .private-lesson-card {
        width: 100%;
        opacity: 0;
        animation: privatePackFadeIn 0.5s ease-out forwards;
    }
    
    .private-lessons-page .private-lesson-card:nth-child(1) {
        animation-delay: 0.1s;
    }
    
    .private-lessons-page .private-lesson-card:nth-child(2) {
        animation-delay: 0.25s;
    }
    
    .private-lessons-page .private-lesson-card:nth-child(3) {
        animation-delay: 0.4s;
    }
    
    @keyframes privatePackFadeIn {
        from {
            opacity: 0;
            transform: translateY(20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .private-lessons-page .how-to-claim-section {
        margin-top: 30px;
        opacity: 0;
        animation: privatePackFadeIn 0.5s ease-out 0.55s forwards;
    }
    
    /* Popup overlay z-index fix for mobile */
    .popup-overlay {
        z-index: 99999 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(10, 14, 39, 0.95) !important;
        overflow: hidden !important;
    }
    
    /* Private lesson popup mobile styles */
    .private-lesson-popup-content {
        width: 88% !important;
        max-width: 360px !important;
        max-height: none !important;
        height: auto !important;
        overflow: hidden !important;
        overflow-y: hidden !important;
        flex-direction: column !important;
        padding: 16px 20px !important;
    }
    
    .private-lesson-popup-layout {
        flex-direction: column !important;
        gap: 12px !important;
    }
    
    .private-lesson-popup-left {
        width: 100% !important;
        padding: 10px 0 !important;
        text-align: center !important;
    }
    
    .private-lesson-popup-icon {
        font-size: 48px !important;
        margin-bottom: 8px !important;
    }
    
    .private-lesson-popup-title {
        font-size: 22px !important;
        margin-bottom: 4px !important;
    }
    
    .private-lesson-popup-price {
        font-size: 36px !important;
    }
    
    .private-lesson-popup-divider {
        display: none !important;
    }
    
    .private-lesson-popup-right {
        width: 100% !important;
        padding: 0 !important;
    }
    
    .private-lesson-popup-right h4 {
        font-size: 14px !important;
        margin-bottom: 8px !important;
    }
    
    .popup-features-list {
        margin-bottom: 12px !important;
    }
    
    .popup-features-list li {
        font-size: 13px !important;
        padding: 4px 0 !important;
    }
    
    .private-lesson-popup-btn {
        padding: 12px 24px !important;
        font-size: 15px !important;
        margin-top: 8px !important;
    }
    
    .popup-close-btn {
        top: 8px !important;
        right: 8px !important;
        width: 32px !important;
        height: 32px !important;
        font-size: 20px !important;
    }
    
    /* How to Claim popup mobile styles */
    .how-to-claim-popup-content {
        width: 90% !important;
        max-width: 360px !important;
        max-height: 85vh !important;
        overflow-y: auto !important;
        padding: 20px !important;
    }
    
    /* Disable all tap/active effects on claim popup */
    #howToClaimPopup,
    #howToClaimPopup *,
    .how-to-claim-popup-content,
    .claim-mobile-slideshow,
    .claim-slideshow,
    .claim-slide,
    .claim-nav,
    .claim-nav-btn {
        -webkit-tap-highlight-color: transparent !important;
        -webkit-touch-callout: none !important;
        outline: none !important;
    }
    
    #howToClaimPopup:active,
    .how-to-claim-popup-content:active,
    .claim-mobile-slideshow:active,
    .claim-slideshow:active,
    .claim-slide:active {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .claim-nav-btn {
        opacity: 1 !important;
        transition: none !important;
    }
    
    .claim-nav-btn:hover,
    .claim-nav-btn:active,
    .claim-nav-btn:focus {
        opacity: 1 !important;
        transform: none !important;
    }
    
    .how-to-claim-title {
        font-size: 20px !important;
        margin-bottom: 8px !important;
    }
    
    .how-to-claim-subtitle {
        font-size: 14px !important;
        margin-bottom: 16px !important;
    }
    
    .claim-steps {
        gap: 12px !important;
    }
    
    .claim-step {
        padding: 12px !important;
        gap: 12px !important;
    }
    
    .claim-step-number {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
        flex-shrink: 0 !important;
    }
    
    .claim-step-content h4 {
        font-size: 14px !important;
        margin-bottom: 4px !important;
    }
    
    .claim-step-content p {
        font-size: 12px !important;
        line-height: 1.4 !important;
    }
    
    .claim-info-box {
        padding: 12px !important;
        margin: 16px 0 !important;
        font-size: 12px !important;
    }
    
    .how-to-claim-close-btn {
        padding: 12px 24px !important;
        font-size: 14px !important;
    }
    
    /* Hide desktop content, show mobile slideshow */
    .claim-desktop-content {
        display: none !important;
    }
    
    .claim-mobile-slideshow {
        display: block !important;
    }
    
    /* Claim slideshow mobile styles */
    .how-to-claim-popup-content {
        width: 90% !important;
        max-width: 360px !important;
        padding: 24px 20px !important;
        overflow: hidden !important;
    }
    
    .claim-slideshow {
        position: relative;
        min-height: 220px;
    }
    
    .claim-slide {
        display: none;
        text-align: center;
    }
    
    .claim-slide.active {
        display: block;
    }
    
    .claim-slide-icon {
        font-size: 56px;
        margin-bottom: 16px;
    }
    
    .claim-slide-title {
        font-size: 20px;
        font-weight: 700;
        color: #fff;
        margin-bottom: 12px;
    }
    
    .claim-slide-text {
        font-size: 15px;
        color: rgba(255,255,255,0.8);
        line-height: 1.5;
        padding: 0 10px;
    }
    
    .claim-contact-link {
        color: #A855F7 !important;
        font-weight: 700;
        text-decoration: none;
    }
    
    .claim-dots {
        display: flex;
        justify-content: center;
        gap: 8px;
        margin: 20px 0 16px;
    }
    
    .claim-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
        background: rgba(255,255,255,0.3);
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .claim-dot.active {
        background: #A855F7;
        transform: scale(1.2);
    }
    
    .claim-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-top: 8px;
    }
    
    .claim-nav-btn {
        background: transparent;
        border: none;
        color: #A855F7;
        font-size: 15px;
        font-weight: 600;
        padding: 10px 16px;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
        user-select: none;
    }
    
    .claim-nav-btn:hover,
    .claim-nav-btn:active,
    .claim-nav-btn:focus {
        opacity: 1;
        outline: none;
    }
    
    .claim-nav-btn.claim-next {
        background: linear-gradient(135deg, #A855F7 0%, #7C3AED 100%);
        color: #fff;
        border-radius: 25px;
        padding: 12px 24px;
    }
    
    /* Prevent any visual changes on tap for the popup */
    .how-to-claim-popup-content,
    .claim-mobile-slideshow,
    .claim-slideshow,
    .claim-slide {
        -webkit-tap-highlight-color: transparent;
        -webkit-touch-callout: none;
    }

    /* ===== PREMIUM PAGE (Full Screen - Identical to PC Pricing) ===== */
    .premium-page {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: #0a0a12;
        z-index: 9999;
        overflow-y: auto;
        overflow-x: hidden;
        padding-bottom: 100px;
        animation: premiumPageSlideIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    }

    @keyframes premiumPageSlideIn {
        from { 
            opacity: 0;
            transform: translateY(-30px);
        }
        to { 
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* Animated Background Orbs (Mauve/Rose like Q&A) */
    .premium-page-bg {
        position: fixed;
        inset: 0;
        pointer-events: none;
        z-index: 0;
        overflow: hidden;
    }

    .premium-gradient-orb {
        position: absolute;
        border-radius: 50%;
        filter: blur(120px);
        opacity: 0.35;
    }

    .premium-orb-1 {
        width: 500px;
        height: 500px;
        background: linear-gradient(135deg, #6B21A8, #581C87);
        top: -200px;
        left: -150px;
        animation: premiumFloatOrb1 10s ease-in-out infinite;
    }

    .premium-orb-2 {
        width: 400px;
        height: 400px;
        background: linear-gradient(135deg, #9D174D, #831843);
        top: -50px;
        right: -100px;
        animation: premiumFloatOrb2 12s ease-in-out infinite;
    }

    .premium-orb-3 {
        width: 350px;
        height: 350px;
        background: linear-gradient(135deg, #7C3AED, #6D28D9);
        bottom: 20%;
        left: 20%;
        animation: premiumFloatOrb3 14s ease-in-out infinite;
    }

    @keyframes premiumFloatOrb1 {
        0%, 100% { transform: translate(0, 0) scale(1); }
        50% { transform: translate(40px, 30px) scale(1.08); }
    }

    @keyframes premiumFloatOrb2 {
        0%, 100% { transform: translate(0, 0) scale(1); }
        50% { transform: translate(-30px, 40px) scale(1.05); }
    }

    @keyframes premiumFloatOrb3 {
        0%, 100% { transform: translate(0, 0) scale(1); }
        50% { transform: translate(30px, -30px) scale(1.03); }
    }

    .premium-page-content {
        position: relative;
        z-index: 1;
        min-height: 100%;
        padding: 30px 0 20px;
    }

    /* Premium Page uses PC Pricing styles - override for mobile layout */
    .premium-page .pricing-header {
        padding: 10px 20px 0;
        text-align: center;
        animation: premiumFadeInUp 0.6s ease-out 0.1s backwards;
    }

    .premium-page .pricing-header .page-title {
        font-size: 26px;
        margin-bottom: 0;
    }

    .premium-page .pricing-subtitle {
        font-size: 13px;
        opacity: 0.7;
        margin-bottom: 0;
    }

    /* Toggle - Mobile optimized with badge above */
    .premium-page .mobile-pricing-toggle {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 12px;
        margin-bottom: 15px;
        margin-top: 10px;
        padding: 0 20px;
        animation: premiumFadeInUp 0.6s ease-out 0.2s backwards;
    }

    .mobile-toggle-wrapper {
        display: flex;
        gap: 10px;
    }

    /* Premium title row with badge */
    .premium-title-row {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        margin-bottom: 8px;
    }

    .premium-title-row .pricing-plan-name {
        margin-bottom: 0 !important;
    }

    .mobile-save-badge {
        background: linear-gradient(135deg, #8A2BE2 0%, #7C3AED 100%);
        color: white;
        padding: 5px 10px;
        border-radius: 15px;
        font-size: 10px;
        font-weight: 700;
        white-space: nowrap;
        box-shadow: 0 2px 10px rgba(138, 43, 226, 0.4);
        position: relative;
        overflow: hidden;
    }

    .mobile-save-badge::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        animation: badgeShine 2.5s ease-in-out infinite;
    }

    @keyframes badgeShine {
        0% { left: -100%; }
        50%, 100% { left: 100%; }
    }

    .premium-page .pricing-toggle-btn {
        padding: 12px 32px;
        font-size: 14px;
        border-radius: 25px;
        transition: all 0.3s ease;
    }

    .premium-page .pricing-toggle-btn.active {
        box-shadow: 0 0 20px rgba(138, 43, 226, 0.6), 0 0 40px rgba(138, 43, 226, 0.3);
    }

    /* Cards - Stack vertically */
    .premium-page .pricing-cards-container {
        flex-direction: column;
        gap: 15px;
        padding: 0 20px;
        margin-bottom: 20px;
    }

    .premium-page .pricing-card,
    .premium-page .pricing-card.pricing-card-featured {
        max-width: 100% !important;
        padding: 25px 22px !important;
        border-radius: 18px !important;
        opacity: 1 !important;
        transform: none !important;
        animation: premiumFadeInUp 0.6s ease-out 0.25s backwards !important;
    }

    .premium-page .pricing-plan-name {
        font-size: 1.5em;
        margin-bottom: 8px;
    }

    .premium-page .pricing-plan-desc {
        font-size: 0.85em;
        margin-bottom: 15px;
    }

    .premium-page .pricing-amount {
        font-size: 2.8em;
        margin-bottom: 0;
    }

    /* Price change animation - same as PC */
    .premium-page .pricing-amount.price-change-animate {
        animation: priceFlip 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    @keyframes priceFlip {
        0% { opacity: 1; transform: translateY(0) scale(1); }
        40% { opacity: 0; transform: translateY(-15px) scale(0.9); }
        60% { opacity: 0; transform: translateY(15px) scale(0.9); }
        100% { opacity: 1; transform: translateY(0) scale(1); }
    }

    .premium-page .pricing-period {
        font-size: 0.85em;
        margin-bottom: 15px;
    }

    .premium-page .pricing-btn {
        padding: 14px 20px;
        font-size: 1em;
        border-radius: 12px;
        margin-bottom: 12px;
    }

    .premium-page .pricing-btn:active {
        transform: scale(0.98);
    }

    .premium-page .pricing-features li {
        padding: 8px 0;
        font-size: 0.9em;
    }

    .premium-page .pricing-info {
        padding: 0 20px 10px;
        animation: premiumFadeInUp 0.6s ease-out 0.4s backwards;
    }

    .premium-page .pricing-info p {
        font-size: 0.85em;
    }

    @keyframes premiumFadeInUp {
        from {
            opacity: 0;
            transform: translateY(25px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }

    /* === Subscribed View === */
    .premium-subscribed-view .pricing-header {
        padding-top: 30px;
    }

    .premium-subscription-card {
        margin: 0 20px 24px;
        background: linear-gradient(145deg, rgba(26, 31, 56, 0.95) 0%, rgba(19, 24, 47, 0.98) 100%);
        border: 2px solid rgba(138, 43, 226, 0.3);
        border-radius: 20px;
        overflow: hidden;
        animation: premiumFadeInUp 0.6s ease-out 0.2s backwards;
    }

    .subscription-card-header {
        padding: 16px 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .subscription-card-header h2 {
        font-size: 16px;
        font-weight: 700;
        color: white;
        margin: 0;
    }

    .subscription-card-body {
        padding: 8px 20px;
    }

    .subscription-info-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    }

    .subscription-info-row:last-child {
        border-bottom: none;
    }

    .info-label {
        font-size: 14px;
        color: rgba(180, 180, 200, 0.8);
    }

    .info-value {
        font-size: 14px;
        font-weight: 600;
        color: white;
    }

    .info-value.status-badge {
        display: flex;
        align-items: center;
        gap: 8px;
        color: #22C55E;
    }

    .info-value.status-badge .status-dot {
        width: 8px;
        height: 8px;
        background: #22C55E;
        border-radius: 50%;
        animation: statusPulse 2s ease-in-out infinite;
    }

    @keyframes statusPulse {
        0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
        50% { opacity: 0.8; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
    }

    .info-value.warning {
        color: #FBBF24;
    }

    /* Active Benefits */
    .premium-active-benefits {
        padding: 0 20px 24px;
        animation: premiumFadeInUp 0.6s ease-out 0.3s backwards;
    }

    .premium-active-benefits h3 {
        font-size: 14px;
        font-weight: 600;
        color: rgba(180, 180, 200, 0.7);
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 0 0 16px;
    }

    .benefits-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .benefit-item {
        padding: 14px 16px;
        background: rgba(34, 197, 94, 0.1);
        border: 1px solid rgba(34, 197, 94, 0.2);
        border-radius: 12px;
        font-size: 13px;
        color: rgba(220, 220, 240, 0.95);
    }

    /* Manage Section */
    .premium-manage {
        padding: 0 20px 40px;
        text-align: center;
        animation: premiumFadeInUp 0.6s ease-out 0.4s backwards;
    }

    .premium-manage-btn {
        width: 100%;
        padding: 16px;
        background: rgba(255, 255, 255, 0.03);
        border: 2px solid rgba(255, 255, 255, 0.15);
        border-radius: 14px;
        color: white;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        margin-bottom: 10px;
        transition: all 0.3s ease;
    }

    .premium-manage-btn:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.98);
    }

    .premium-manage p {
        font-size: 12px;
        color: rgba(160, 160, 180, 0.6);
        margin: 0;
    }

    /* ===== MOBILE PROFILE POPUP (Above Bottom Bar) ===== */
    .mobile-profile-popup-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 10000;
        animation: fadeIn 0.2s ease;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }

    .mobile-profile-popup {
        position: fixed;
        bottom: 75px;
        right: 12px;
        background: #1A1F38;
        border: 1px solid #2A2F45;
        border-radius: 10px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        min-width: 160px;
        z-index: 10001;
        padding: 5px 0;
        animation: popupSlideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
        overflow: hidden;
    }

    .mobile-profile-popup .dropdown-item {
        display: block;
        padding: 12px 15px;
        color: #FFFFFF;
        text-decoration: none;
        font-weight: 500;
        font-size: 14px;
        transition: background 0.2s;
    }

    .mobile-profile-popup .dropdown-item:active {
        background: #2A2F45;
    }

    .mobile-profile-popup .dropdown-divider {
        height: 1px;
        background: #2A2F45;
        margin: 5px 0;
    }

    .mobile-profile-popup .dropdown-logout {
        color: #ff6b6b;
    }

    /* Legacy styles kept for compatibility */
    .mobile-profile-popup-item {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 14px 16px;
        background: transparent;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .mobile-profile-popup-item .popup-item-icon {
        font-size: 20px;
    }

    .mobile-profile-popup-item .popup-item-text {
        font-size: 15px;
        font-weight: 600;
        color: white;
    }
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 14px 16px;
        background: transparent;
        border: none;
        border-radius: 12px;
        cursor: pointer;
        transition: background 0.2s ease;
    }

    .mobile-profile-popup-item:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .popup-item-icon {
        font-size: 20px;
    }

    .popup-item-text {
        font-size: 15px;
        font-weight: 600;
        color: white;
    }

    .mobile-profile-popup-divider {
        height: 1px;
        background: rgba(255, 255, 255, 0.1);
        margin: 4px 8px;
    }

    .mobile-profile-popup-item.logout-item .popup-item-text {
        color: #EF4444;
    }

    /* Bottom Bar Profile Avatar (Image or Emoji) */
    .bottom-bar-profile-avatar {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        overflow: visible;
        display: none;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        margin-top: 2px;
    }

    .bottom-bar-profile-img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 50%;
        display: none;
    }

    .bottom-bar-profile-emoji {
        width: 26px;
        height: 26px;
        background: linear-gradient(135deg, #2a2a4a 0%, #1a1a2e 100%);
        border: 2px solid rgba(255, 255, 255, 0.5);
        border-radius: 50%;
        display: none;
        align-items: center;
        justify-content: center;
        font-size: 12px;
        line-height: 1;
        box-sizing: border-box;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }

    /* Lower Profile label to align with others */
    .bottom-bar-item[data-page="profile"].has-profile .bottom-bar-label {
        margin-top: 5px;
    }

    .bottom-bar-item[data-page="profile"].has-profile .bottom-bar-profile-default {
        display: none !important;
    }

    .bottom-bar-item[data-page="profile"].has-profile .bottom-bar-profile-avatar {
        display: flex !important;
    }

    .bottom-bar-profile-avatar.is-image .bottom-bar-profile-img {
        display: block !important;
    }

    .bottom-bar-profile-avatar.is-emoji .bottom-bar-profile-emoji {
        display: flex !important;
    }

    /* Hide profile pic on mobile header */
    .profile-menu {
        display: none !important;
    }

    /* ===== MOBILE TROPHY POPUP FIXES ===== */
    .trophy-popup-overlay {
        padding: 20px 10px;
    }

    .trophy-popup {
        min-width: auto !important;
        width: 85vw !important;
        max-width: 350px !important;
        padding: 25px 20px !important;
        border-radius: 20px !important;
    }

    .trophy-popup-content {
        flex-direction: column !important;
        text-align: center !important;
    }

    .trophy-popup-icon {
        width: 80px !important;
        height: 80px !important;
        border-radius: 50% !important;
        font-size: 2.5em !important;
    }

    .trophy-nav-arrow {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 44px !important;
        height: 44px !important;
        border-radius: 50% !important;
        font-size: 1.5em !important;
        z-index: 10;
    }

    .trophy-nav-left {
        left: 8px;
    }

    .trophy-nav-right {
        right: 8px;
    }
    
    /* ===== CHAPTER DETAIL PAGE MOBILE ===== */
    .chapter-header-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
    }
    
    .chapter-header-bar .chapter-back-btn {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        left: auto !important;
        z-index: 10;
    }
    
    .chapter-header-bar .chapter-detail-title {
        flex: 1;
        text-align: center;
        margin: 0;
    }
    
    /* Section label - Chapter reference (e.g., "Chapter 1 - A1") */
    .section-label {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        font-size: 1em !important;
        color: #B24BF3 !important;
        margin-bottom: 5px !important;
        height: auto !important;
        min-height: 20px !important;
        overflow: visible !important;
    }
    
    .section-info .section-label {
        display: block !important;
        visibility: visible !important;
    }
    
    /* Chapter detail content - reduce spacing */
    #chapterDetailPage .chapter-detail-content {
        padding-top: 15px !important;
    }
    
    /* Hide entire section-info on mobile (title already in header) */
    #chapterDetailPage .section-info {
        display: none !important;
    }
    
    #chapterDetailPage .lessons-list {
        margin-top: 0 !important;
        padding-bottom: 30px !important;
    }
    
    /* Hide circular progress on mobile */
    .section-progress {
        display: none !important;
    }
    
    /* ===== LESSON SCREEN MOBILE ===== */
    .lesson-screen {
        top: 0 !important;
        height: 100vh !important;
        height: 100dvh !important;
        z-index: 9999 !important;
    }
    
    /* Hide bottom bar when lesson is open */
    body.lesson-open .mobile-bottom-bar {
        display: none !important;
    }
    
    .lesson-header {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 10px 15px !important;
        gap: 10px !important;
    }
    
    .lesson-back-btn {
        display: flex !important;
        position: static !important;
        transform: none !important;
        flex-shrink: 0 !important;
        width: 40px !important;
        height: 40px !important;
        order: 1 !important;
    }
    
    .progress-bar-container {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        width: auto !important;
        max-width: none !important;
        flex: 1 !important;
        margin: 0 !important;
        gap: 8px !important;
        order: 2 !important;
    }
    
    .progress-bars {
        display: flex !important;
        flex-direction: row !important;
        flex: 1 !important;
        gap: 3px !important;
    }
    
    .progress-bar {
        height: 4px !important;
    }
    
    .nav-arrow {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        font-size: 1em !important;
        flex-shrink: 0 !important;
    }
    
    .step-counter {
        position: static !important;
        transform: none !important;
        flex-shrink: 0 !important;
        padding: 5px 10px !important;
        font-size: 0.8em !important;
        order: 3 !important;
    }
    
    /* Hide close button on mobile (back button is enough) */
    .lesson-screen .close-btn {
        display: none !important;
    }
    
    .lesson-content {
        padding: 20px 15px 120px 15px !important;
        max-height: calc(100vh - 130px) !important;
        max-height: calc(100dvh - 130px) !important;
    }
    
    .theory-content h2 {
        font-size: 1.4em !important;
    }
    
    .theory-content h3 {
        font-size: 1.1em !important;
    }
    
    .theory-content p {
        font-size: 1em !important;
        line-height: 1.6 !important;
    }
    
    /* Lesson footer */
    .lesson-footer {
        padding: 15px !important;
        padding-bottom: calc(15px + env(safe-area-inset-bottom)) !important;
    }
    
    .continue-btn {
        width: 100% !important;
        padding: 15px 20px !important;
        font-size: 1em !important;
    }
    
    .continue-btn .shortcut {
        display: none !important;
    }
    
    /* Vocabulary cards in lessons */
    .vocab-card {
        padding: 15px !important;
    }
    
    .vocab-french {
        font-size: 1.3em !important;
    }
    
    /* Info boxes */
    .info-box, .tip-box, .warning-box {
        padding: 15px !important;
        margin: 15px 0 !important;
    }
    
    /* Example blocks */
    .example-block {
        padding: 15px !important;
        margin: 15px 0 !important;
    }
}

/* ===== HIDE MOBILE-ONLY ELEMENTS ON DESKTOP ===== */
@media (min-width: 769px) {
    .mobile-bottom-bar {
        display: none;
    }

    .mobile-level-dropdown {
        display: none;
    }

    .mobile-cta-simple {
        display: none;
    }

    .mobile-profile-popup-overlay {
        display: none;
    }

    .mobile-profile-popup {
        display: none;
    }

    .mobile-profile-page {
        display: none;
    }
}

/* ===== FORCE PC PROFILE MENU ON DESKTOP ===== */
@media (min-width: 769px) {
    .profile-menu {
        display: flex !important;
    }
}