        :root {
            --primary: #f97316;
            --primary-dark: #ea580c;
            --secondary: #fbbf24;
            --accent: #22c55e;
            --accent-blue: #3b82f6;
            --accent-purple: #8b5cf6;
            --accent-pink: #ec4899;
            --accent-cyan: #06b6d4;
            --bg-light: #fff7ed;
            --text-dark: #1f2937;
            --text-light: #6b7280;
        }

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

        body {
            font-family: 'Nunito', sans-serif;
            background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
            min-height: 100vh;
            color: var(--text-dark);
        }

        /* Header */
        header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            padding: 1rem 2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
            position: sticky;
            top: 0;
            z-index: 100;
        }

        .header-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .logo {
            display: flex;
            align-items: center;
            gap: 1rem;
            text-decoration: none;
            color: white;
        }

        .logo-icon {
            width: 50px;
            height: 50px;
            background: white;
            border-radius: 15px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .header-logo-img {
            height: 50px;
            width: auto;
            border-radius: 10px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
        }

        .footer-logo-icon {
            width: 50px;
            height: 50px;
            background: white;
            border-radius: 15px;
            overflow: hidden;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .footer-logo-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .logo-text {
            font-size: 1.8rem;
            font-weight: 800;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
        }

        .nav-links {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .nav-links a {
            color: white;
            text-decoration: none;
            font-weight: 600;
            padding: 0.5rem 0.8rem;
            border-radius: 10px;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            font-size: 0.9rem;
        }

        .nav-links a:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .youtube-btn {
            background: #ff0000 !important;
        }

        .games-btn {
            background: var(--accent) !important;
        }

        .music-btn {
            background: var(--accent-purple) !important;
        }

        .tutor-btn {
            background: var(--accent-cyan) !important;
        }

        .lang-btn {
            background: rgba(255, 255, 255, 0.2) !important;
            border: 2px solid white;
            cursor: pointer;
            font-size: 1.1rem;
        }

        .lang-btn:hover {
            background: rgba(255, 255, 255, 0.4) !important;
        }

        /* Hero Section */
        .hero {
            padding: 3rem 2rem;
            text-align: center;
            background:
                linear-gradient(180deg, rgba(254, 252, 232, 0.94) 0%, rgba(239, 246, 255, 0.92) 54%, rgba(255, 255, 255, 0.96) 100%),
                repeating-linear-gradient(90deg, rgba(37, 99, 235, 0.055) 0 1px, transparent 1px 22px),
                repeating-linear-gradient(0deg, rgba(34, 197, 94, 0.045) 0 1px, transparent 1px 22px);
        }

        .hero h1 {
            font-size: 2.5rem;
            font-weight: 800;
            margin-bottom: 1rem;
            background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            background-clip: text;
        }

        .hero p {
            font-size: 1.1rem;
            color: var(--text-light);
            max-width: 700px;
            margin: 0 auto 1rem;
        }

        .hero-learning-badges {
            max-width: 820px;
            margin: 0 auto 1.35rem;
            display: flex;
            justify-content: center;
            gap: 0.65rem;
            flex-wrap: wrap;
        }

        .hero-learning-badge {
            min-height: 42px;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.45rem;
            padding: 0.55rem 0.8rem;
            border-radius: 999px;
            background: white;
            color: #1f2937;
            text-decoration: none;
            border: 2px solid rgba(31, 41, 55, 0.08);
            box-shadow: 0 8px 20px rgba(31, 41, 55, 0.08);
        }

        .hero-learning-badge.english { border-color: rgba(59, 130, 246, 0.3); }
        .hero-learning-badge.math { border-color: rgba(34, 197, 94, 0.32); }
        .hero-learning-badge.reading { border-color: rgba(236, 72, 153, 0.28); }
        .hero-learning-badge.age { border-color: rgba(245, 158, 11, 0.34); }

        .hero-learning-badge strong {
            font-size: 0.92rem;
            line-height: 1;
        }

        .badge-icon {
            font-size: 1.12rem;
            line-height: 1;
        }

        .hero-buttons {
            display: flex;
            justify-content: center;
            gap: 0.8rem;
            flex-wrap: wrap;
        }

        .hero-btn {
            padding: 0.8rem 1.5rem;
            border-radius: 50px;
            font-weight: 700;
            font-size: 1rem;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
        }

        .hero-btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
        }

        .btn-create {
            background: linear-gradient(135deg, #8b5cf6, #ec4899);
            color: white;
        }

        .btn-videos {
            background: var(--primary);
            color: white;
        }

        .btn-games {
            background: var(--accent);
            color: white;
        }

        .btn-music {
            background: var(--accent-purple);
            color: white;
        }

        .btn-tutor {
            background: var(--accent-cyan);
            color: white;
        }

        .btn-learn {
            background: #2563eb;
            color: white;
        }

        /* Learning World */
        .learning-world {
            max-width: none;
            margin: 0;
            padding: 2rem;
            background:
                linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(236, 253, 245, 0.92)),
                repeating-linear-gradient(45deg, rgba(59, 130, 246, 0.06) 0 10px, rgba(251, 191, 36, 0.06) 10px 20px);
            border-top: 1px solid rgba(31, 41, 55, 0.08);
            border-bottom: 1px solid rgba(31, 41, 55, 0.08);
        }

        .learning-world-inner {
            max-width: 1200px;
            margin: 0 auto;
            display: grid;
            grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
            gap: 1.5rem;
            align-items: center;
        }

        .learning-copy {
            min-width: 0;
        }

        .learning-eyebrow {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            background: #dcfce7;
            color: #166534;
            border: 2px solid rgba(34, 197, 94, 0.2);
            border-radius: 999px;
            padding: 0.35rem 0.75rem;
            font-weight: 900;
            font-size: 0.78rem;
            text-transform: uppercase;
            letter-spacing: 0;
        }

        .learning-eyebrow::before {
            content: "✏️";
        }

        .learning-copy h2 {
            font-size: 2.15rem;
            line-height: 1.08;
            margin: 0.75rem 0 0.75rem;
            color: var(--text-dark);
        }

        .learning-copy p {
            color: #4b5563;
            font-size: 1.05rem;
            line-height: 1.55;
            margin: 0 0 1.1rem;
        }

        .learning-actions {
            display: flex;
            gap: 0.75rem;
            flex-wrap: wrap;
        }

        .learning-action {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            min-height: 46px;
            padding: 0.75rem 1rem;
            border-radius: 10px;
            font-weight: 900;
            text-decoration: none;
            line-height: 1.15;
        }

        .learning-action.primary {
            color: white;
            background: #2563eb;
            box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
        }

        .learning-action.secondary {
            color: #7c2d12;
            background: #ffedd5;
            border: 2px solid rgba(249, 115, 22, 0.22);
        }

        .learning-map {
            min-width: 0;
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            gap: 0.75rem;
        }

        .learning-tile {
            min-height: 138px;
            display: grid;
            grid-template-columns: 58px minmax(0, 1fr);
            grid-template-rows: auto 1fr;
            gap: 0.35rem 0.75rem;
            align-items: start;
            padding: 1rem;
            border-radius: 12px;
            text-decoration: none;
            color: var(--text-dark);
            border: 2px solid rgba(31, 41, 55, 0.08);
            background: white;
            box-shadow: 0 10px 24px rgba(31, 41, 55, 0.08);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .learning-tile:hover {
            transform: translateY(-3px);
            box-shadow: 0 14px 30px rgba(31, 41, 55, 0.12);
        }

        .learning-tile.english { border-color: rgba(59, 130, 246, 0.28); }
        .learning-tile.math { border-color: rgba(34, 197, 94, 0.28); }
        .learning-tile.reading { border-color: rgba(236, 72, 153, 0.25); }
        .learning-tile.music { border-color: rgba(245, 158, 11, 0.3); }

        .tile-icon {
            grid-row: 1 / span 2;
            width: 58px;
            aspect-ratio: 1;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            border-radius: 12px;
            background: #f3f4f6;
            font-size: 1.9rem;
        }

        .learning-tile.english .tile-icon { background: #dbeafe; }
        .learning-tile.math .tile-icon { background: #dcfce7; }
        .learning-tile.reading .tile-icon { background: #fce7f3; }
        .learning-tile.music .tile-icon { background: #fef3c7; }

        .tile-title {
            display: block;
            font-weight: 900;
            font-size: 1.08rem;
            line-height: 1.2;
        }

        .tile-desc {
            display: block;
            color: #5b6472;
            font-size: 0.92rem;
            line-height: 1.35;
        }

        .learning-age-strip {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            gap: 0.65rem;
            flex-wrap: wrap;
            padding-top: 0.25rem;
        }

        .learning-age-strip > span {
            color: #374151;
            font-weight: 900;
        }

        .learning-age-strip a {
            display: inline-flex;
            align-items: center;
            gap: 0.35rem;
            min-height: 36px;
            background: white;
            color: #374151;
            border: 1px solid rgba(31, 41, 55, 0.12);
            border-radius: 999px;
            padding: 0.45rem 0.75rem;
            text-decoration: none;
            font-weight: 800;
            box-shadow: 0 4px 12px rgba(31, 41, 55, 0.06);
        }

        /* Section Styles */
        section {
            padding: 2rem;
            max-width: 1200px;
            margin: 0 auto;
        }

        .section-title {
            font-size: 1.8rem;
            font-weight: 800;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.8rem;
        }

        .section-title i {
            color: var(--primary);
        }

        /* Video Grid */
        .video-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
            gap: 1.5rem;
        }

        .video-card {
            background: white;
            border-radius: 20px;
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            transition: all 0.3s;
            cursor: pointer;
        }

        .video-card:hover {
            transform: translateY(-8px);
            box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        }

        .video-thumbnail {
            position: relative;
            aspect-ratio: 16/9;
            background: #1f2937;
        }

        .video-thumbnail img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .play-overlay {
            position: absolute;
            inset: 0;
            background: rgba(0, 0, 0, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.3s;
        }

        .video-card:hover .play-overlay {
            opacity: 1;
        }

        .play-btn {
            width: 60px;
            height: 60px;
            background: var(--primary);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.3rem;
            box-shadow: 0 10px 30px rgba(249, 115, 22, 0.5);
        }

        .video-info {
            padding: 1rem;
        }

        .video-title {
            font-size: 1rem;
            font-weight: 700;
            margin-bottom: 0.5rem;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        .video-category {
            display: inline-block;
            background: var(--bg-light);
            color: var(--primary);
            padding: 0.2rem 0.6rem;
            border-radius: 20px;
            font-size: 0.8rem;
            font-weight: 600;
        }

        /* Video Section with Category */
        .video-section {
            background: white;
            border-radius: 25px;
            padding: 2rem;
            margin: 1.5rem auto;
            max-width: 1200px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
        }

        .video-section.ingles {
            border-left: 5px solid var(--accent-blue);
        }

        .video-section.canciones {
            border-left: 5px solid var(--accent-purple);
        }

        .video-section.educativo {
            border-left: 5px solid var(--accent);
        }

        .video-section.cuentos {
            border-left: 5px solid var(--accent-pink);
        }

        .video-section.unboxing {
            border-left: 5px solid var(--secondary);
        }

        .video-section.plastilina {
            border-left: 5px solid var(--accent-cyan);
        }

        .video-section .section-title.ingles i {
            color: var(--accent-blue);
        }

        .video-section .section-title.canciones i {
            color: var(--accent-purple);
        }

        .video-section .section-title.educativo i {
            color: var(--accent);
        }

        .video-section .section-title.cuentos i {
            color: var(--accent-pink);
        }

        .video-section .section-title.unboxing i {
            color: var(--secondary);
        }

        .video-section .section-title.plastilina i {
            color: var(--accent-cyan);
        }

        /* Games Section */
        .games-section {
            background: linear-gradient(135deg, #dcfce7 0%, #bbf7d0 100%);
            border-radius: 30px;
            padding: 2rem;
            margin: 1.5rem auto;
            max-width: 1200px;
        }

        .games-section .section-title i {
            color: var(--accent);
        }

        .games-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
            gap: 1rem;
        }

        .game-card {
            background: white;
            border-radius: 20px;
            padding: 1.5rem;
            text-align: center;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            transition: all 0.3s;
            cursor: pointer;
            border: 3px solid transparent;
        }

        .game-card:hover {
            transform: scale(1.05);
            border-color: var(--accent);
        }

        .game-icon {
            width: 70px;
            height: 70px;
            margin: 0 auto 1rem;
            border-radius: 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
        }

        .game-icon.suma {
            background: linear-gradient(135deg, #fef3c7, #fcd34d);
        }

        .game-icon.resta {
            background: linear-gradient(135deg, #fce7f3, #f9a8d4);
        }

        .game-icon.multi {
            background: linear-gradient(135deg, #dbeafe, #93c5fd);
        }

        .game-icon.division {
            background: linear-gradient(135deg, #dcfce7, #86efac);
        }

        .game-icon.colores {
            background: linear-gradient(135deg, #fef3c7, #fb923c);
        }

        .game-icon.formas {
            background: linear-gradient(135deg, #e0e7ff, #a5b4fc);
        }

        .game-icon.letras {
            background: linear-gradient(135deg, #fce7f3, #f472b6);
        }

        .game-icon.numeros {
            background: linear-gradient(135deg, #cffafe, #22d3ee);
        }

        .game-icon.memory {
            background: linear-gradient(135deg, #fef3c7, #f59e0b);
        }

        .game-icon.flashcards {
            background: linear-gradient(135deg, #ddd6fe, #a78bfa);
        }

        .game-card h3 {
            font-size: 1.1rem;
            margin-bottom: 0.3rem;
        }

        .game-card p {
            color: var(--text-light);
            font-size: 0.85rem;
        }

        /* User Stats Bar */
        .user-stats-bar {
            background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
            padding: 0.8rem 2rem;
            display: flex;
            justify-content: center;
            gap: 2rem;
            flex-wrap: wrap;
        }

        .stat-item {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            color: white;
            font-weight: 600;
        }

        .stat-icon {
            font-size: 1.3rem;
        }

        .stat-value {
            color: #fbbf24;
            font-size: 1.1rem;
        }

        .level-badge {
            background: linear-gradient(135deg, #f59e0b, #d97706);
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            font-size: 0.85rem;
        }

        /* Login Button & User Avatar */
        .login-btn {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #4285f4, #34a853);
            color: white;
            border: none;
            padding: 0.4rem 1rem;
            border-radius: 20px;
            cursor: pointer;
            font-family: inherit;
            font-weight: 600;
            font-size: 0.9rem;
            transition: all 0.3s;
        }

        .login-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
        }

        .login-btn i {
            font-size: 1rem;
        }

        .user-info {
            display: flex;
            align-items: center;
            gap: 0.6rem;
        }

        .user-avatar {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: 2px solid #fbbf24;
        }

        .user-name {
            color: white;
            font-weight: 600;
            font-size: 0.9rem;
            max-width: 100px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .logout-btn {
            background: rgba(255, 255, 255, 0.2);
            color: white;
            border: none;
            padding: 0.3rem 0.6rem;
            border-radius: 10px;
            cursor: pointer;
            font-size: 0.75rem;
            transition: all 0.3s;
        }

        .logout-btn:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .leaderboard-btn {
            display: flex;
            align-items: center;
            gap: 0.4rem;
            background: linear-gradient(135deg, #8b5cf6, #a855f7);
            color: white;
            border: none;
            padding: 0.4rem 0.8rem;
            border-radius: 15px;
            cursor: pointer;
            font-family: inherit;
            font-weight: 600;
            font-size: 0.85rem;
            transition: all 0.3s;
        }

        .leaderboard-btn:hover {
            transform: scale(1.05);
        }

        /* Leaderboard Modal */
        .leaderboard-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .leaderboard-modal.active {
            display: flex;
        }

        .leaderboard-container {
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
            border-radius: 30px;
            padding: 2rem;
            max-width: 500px;
            width: 100%;
            max-height: 80vh;
            overflow-y: auto;
            color: white;
        }

        .leaderboard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .leaderboard-header h2 {
            font-size: 1.5rem;
        }

        .leaderboard-list {
            display: flex;
            flex-direction: column;
            gap: 0.8rem;
        }

        .leaderboard-item {
            display: flex;
            align-items: center;
            gap: 1rem;
            background: rgba(255, 255, 255, 0.1);
            padding: 0.8rem 1rem;
            border-radius: 15px;
        }

        .leaderboard-rank {
            font-size: 1.2rem;
            font-weight: 800;
            width: 35px;
            text-align: center;
        }

        .leaderboard-rank.gold {
            color: #fbbf24;
        }

        .leaderboard-rank.silver {
            color: #94a3b8;
        }

        .leaderboard-rank.bronze {
            color: #cd7f32;
        }

        .leaderboard-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: linear-gradient(135deg, #f97316, #fbbf24);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.2rem;
        }

        .leaderboard-avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
        }

        .leaderboard-name {
            flex: 1;
            font-weight: 600;
        }

        .leaderboard-points {
            color: #fbbf24;
            font-weight: 700;
        }

        .leaderboard-item.current-user {
            background: rgba(251, 191, 36, 0.2);
            border: 2px solid #fbbf24;
        }

        .your-rank {
            margin-top: 1.5rem;
            padding-top: 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.2);
            text-align: center;
            color: #a5b4fc;
        }

        /* Memory Game Styles */
        .memory-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .memory-modal.active {
            display: flex;
        }

        .memory-container {
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
            border-radius: 30px;
            padding: 2rem;
            max-width: 600px;
            width: 100%;
            text-align: center;
            color: white;
        }

        .memory-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .memory-stats {
            display: flex;
            gap: 1.5rem;
        }

        .memory-stat {
            text-align: center;
        }

        .memory-stat-value {
            font-size: 1.5rem;
            font-weight: 800;
            color: #fbbf24;
        }

        .memory-stat-label {
            font-size: 0.75rem;
            opacity: 0.8;
        }

        .memory-grid {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 0.8rem;
            margin-bottom: 1.5rem;
        }

        .memory-card-item {
            aspect-ratio: 1;
            background: linear-gradient(135deg, #4f46e5, #7c3aed);
            border-radius: 15px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 2rem;
            transition: all 0.3s;
            transform-style: preserve-3d;
            position: relative;
        }

        .memory-card-item:hover {
            transform: scale(1.05);
        }

        .memory-card-item.flipped {
            background: white;
            color: #1e1b4b;
        }

        .memory-card-item.matched {
            background: linear-gradient(135deg, #22c55e, #16a34a);
            color: white;
            animation: matchPulse 0.5s ease;
        }

        @keyframes matchPulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.1);
            }
        }

        .memory-card-back {
            font-size: 1.5rem;
        }

        .memory-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
        }

        .memory-category-select {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        .memory-category-btn {
            padding: 0.5rem 1rem;
            border-radius: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: transparent;
            color: white;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .memory-category-btn.active {
            background: #fbbf24;
            border-color: #fbbf24;
            color: #1e1b4b;
        }

        /* Flashcards Styles */
        .flashcard-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.9);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .flashcard-modal.active {
            display: flex;
        }

        .flashcard-container {
            background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
            border-radius: 30px;
            padding: 2rem;
            max-width: 500px;
            width: 100%;
            text-align: center;
            color: white;
        }

        .flashcard-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .flashcard-progress {
            font-size: 0.9rem;
            opacity: 0.9;
        }

        .flashcard-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 40px;
            height: 40px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
        }

        .flashcard-card {
            background: white;
            border-radius: 25px;
            padding: 3rem 2rem;
            margin-bottom: 1.5rem;
            min-height: 250px;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: transform 0.6s;
            transform-style: preserve-3d;
        }

        .flashcard-card.flipped {
            animation: flipCard 0.6s ease;
        }

        @keyframes flipCard {
            0% {
                transform: rotateY(0);
            }

            50% {
                transform: rotateY(90deg);
            }

            100% {
                transform: rotateY(0);
            }
        }

        .flashcard-emoji {
            font-size: 4rem;
            margin-bottom: 1rem;
        }

        .flashcard-word {
            font-size: 2rem;
            font-weight: 800;
            color: #1e1b4b;
            margin-bottom: 0.5rem;
        }

        .flashcard-translation {
            font-size: 1.2rem;
            color: #6b7280;
        }

        .flashcard-pronunciation {
            font-size: 1rem;
            color: #a855f7;
            font-style: italic;
            margin-top: 0.5rem;
        }

        .flashcard-controls {
            display: flex;
            gap: 1rem;
            justify-content: center;
        }

        .flashcard-btn {
            padding: 1rem 2rem;
            border-radius: 50px;
            border: none;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.5rem;
            transition: all 0.3s;
        }

        .flashcard-btn:hover {
            transform: scale(1.05);
        }

        .flashcard-btn.prev {
            background: rgba(255, 255, 255, 0.2);
            color: white;
        }

        .flashcard-btn.next {
            background: #fbbf24;
            color: #1e1b4b;
        }

        .flashcard-btn.speak {
            background: #22c55e;
            color: white;
            padding: 1rem;
            border-radius: 50%;
        }

        .flashcard-category-select {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 1.5rem;
        }

        .flashcard-category-btn {
            padding: 0.5rem 1rem;
            border-radius: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: transparent;
            color: white;
            cursor: pointer;
            font-weight: 600;
            transition: all 0.3s;
        }

        .flashcard-category-btn.active {
            background: white;
            border-color: white;
            color: #7c3aed;
        }

        /* ============ ROCKSTAR (Times Tables) STYLES ============ */
        .rockstar-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.95);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .rockstar-modal.active {
            display: flex;
        }

        .rockstar-container {
            background: linear-gradient(135deg, #1e1b4b 0%, #4c1d95 50%, #7c3aed 100%);
            border-radius: 20px;
            padding: 2rem;
            width: 95%;
            max-width: 500px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            text-align: center;
            color: white;
        }

        .rockstar-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .rockstar-status {
            background: linear-gradient(135deg, #f59e0b, #ef4444);
            padding: 0.4rem 1rem;
            border-radius: 20px;
            font-weight: 700;
            font-size: 0.85rem;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
        }

        .rockstar-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
        }

        .rockstar-stats {
            display: flex;
            justify-content: space-around;
            margin: 1rem 0;
            gap: 0.5rem;
        }

        .rockstar-stat {
            text-align: center;
        }

        .rockstar-stat-value {
            font-size: 1.5rem;
            font-weight: 700;
        }

        .rockstar-stat-label {
            font-size: 0.7rem;
            opacity: 0.8;
            text-transform: uppercase;
        }

        .rockstar-question {
            font-size: 2.5rem;
            font-weight: 800;
            margin: 1.5rem 0;
            text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
        }

        .rockstar-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.8rem;
            margin: 1rem 0;
        }

        .rockstar-option {
            padding: 1rem;
            border-radius: 12px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            font-size: 1.3rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
        }

        .rockstar-option:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.05);
        }

        .rockstar-option.correct {
            background: #22c55e;
            border-color: #22c55e;
        }

        .rockstar-option.wrong {
            background: #ef4444;
            border-color: #ef4444;
        }

        .rockstar-table-select {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            justify-content: center;
            margin: 1rem 0;
        }

        .rockstar-table-btn {
            padding: 0.6rem 1rem;
            border-radius: 12px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
        }

        .rockstar-table-btn:hover,
        .rockstar-table-btn.active {
            background: #f59e0b;
            border-color: #f59e0b;
            color: #1e1b4b;
        }

        .rockstar-progress {
            width: 100%;
            height: 6px;
            background: rgba(255, 255, 255, 0.2);
            border-radius: 3px;
            margin: 1rem 0;
        }

        .rockstar-progress-bar {
            height: 100%;
            background: linear-gradient(90deg, #f59e0b, #ef4444);
            border-radius: 3px;
            transition: width 0.3s;
        }

        .rockstar-summary {
            text-align: center;
        }

        .rockstar-summary h2 {
            font-size: 1.8rem;
            margin-bottom: 1rem;
        }

        .rockstar-summary-stats {
            display: flex;
            justify-content: space-around;
            margin: 1.5rem 0;
            flex-wrap: wrap;
            gap: 1rem;
        }

        .rockstar-summary-stat {
            text-align: center;
        }

        .rockstar-summary-stat .value {
            font-size: 2rem;
            font-weight: 800;
        }

        .rockstar-summary-stat .label {
            font-size: 0.75rem;
            opacity: 0.8;
        }

        .timer-toggle {
            display: inline-flex;
            align-items: center;
            gap: 0.4rem;
            padding: 0.3rem 0.8rem;
            border-radius: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            cursor: pointer;
            font-size: 0.75rem;
            font-weight: 600;
            transition: all 0.3s;
        }

        .timer-toggle.active {
            background: #ef4444;
            border-color: #ef4444;
        }

        .timer-countdown {
            font-size: 1.2rem;
            font-weight: 700;
            color: #fbbf24;
            margin: 0.5rem 0;
        }

        .timer-countdown.warning {
            color: #ef4444;
            animation: pulse 0.5s infinite;
        }

        @keyframes pulse {

            0%,
            100% {
                opacity: 1;
            }

            50% {
                opacity: 0.5;
            }
        }

        .game-icon.rockstar {
            background: linear-gradient(135deg, #ede9fe, #7c3aed);
        }

        .game-icon.spelling {
            background: linear-gradient(135deg, #d1fae5, #10b981);
        }

        .game-icon.advmath {
            background: linear-gradient(135deg, #dbeafe, #3b82f6);
        }

        /* ============ SPELLING GAME STYLES ============ */
        .spelling-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.95);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .spelling-modal.active {
            display: flex;
        }

        .spelling-container {
            background: linear-gradient(135deg, #064e3b 0%, #065f46 50%, #10b981 100%);
            border-radius: 20px;
            padding: 2rem;
            width: 95%;
            max-width: 550px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            text-align: center;
            color: white;
        }

        .spelling-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .spelling-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
        }

        .spelling-mode-tabs {
            display: flex;
            gap: 0.4rem;
            justify-content: center;
            margin-bottom: 1rem;
            flex-wrap: wrap;
        }

        .spelling-mode-tab {
            padding: 0.5rem 1rem;
            border-radius: 20px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: transparent;
            color: white;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.8rem;
            transition: all 0.3s;
        }

        .spelling-mode-tab.active {
            background: #fbbf24;
            border-color: #fbbf24;
            color: #064e3b;
        }

        .spelling-cat-select {
            display: flex;
            gap: 0.4rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        .spelling-cat-btn {
            padding: 0.4rem 0.8rem;
            border-radius: 16px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: transparent;
            color: white;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.75rem;
            transition: all 0.3s;
        }

        .spelling-cat-btn.active {
            background: white;
            border-color: white;
            color: #064e3b;
        }

        .spelling-question-area {
            margin: 1.5rem 0;
            min-height: 120px;
        }

        .spelling-word-display {
            font-size: 2rem;
            margin: 0.5rem 0;
        }

        .spelling-emoji-hint {
            font-size: 3rem;
            margin: 0.5rem 0;
        }

        .spelling-input {
            width: 80%;
            max-width: 300px;
            padding: 0.8rem 1.2rem;
            border-radius: 12px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.15);
            color: white;
            font-size: 1.3rem;
            font-weight: 600;
            text-align: center;
            outline: none;
        }

        .spelling-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .spelling-input:focus {
            border-color: #fbbf24;
        }

        .spelling-submit {
            margin-top: 0.8rem;
            padding: 0.7rem 2rem;
            border-radius: 12px;
            border: none;
            background: #fbbf24;
            color: #064e3b;
            font-weight: 700;
            font-size: 1rem;
            cursor: pointer;
        }

        .spelling-listen-btn {
            width: 70px;
            height: 70px;
            border-radius: 50%;
            border: none;
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: #064e3b;
            font-size: 2rem;
            cursor: pointer;
            margin: 0.5rem;
            transition: transform 0.2s;
        }

        .spelling-listen-btn:hover {
            transform: scale(1.1);
        }

        .letter-tiles {
            display: flex;
            flex-wrap: wrap;
            gap: 0.5rem;
            justify-content: center;
            margin: 1rem 0;
        }

        .letter-tile {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            border: 2px solid rgba(255, 255, 255, 0.4);
            background: rgba(255, 255, 255, 0.15);
            color: white;
            font-size: 1.3rem;
            font-weight: 700;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
        }

        .letter-tile:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

        .letter-tile.used {
            opacity: 0.3;
            pointer-events: none;
        }

        .letter-answer {
            display: flex;
            gap: 0.3rem;
            justify-content: center;
            margin: 1rem 0;
            min-height: 50px;
            flex-wrap: wrap;
        }

        .letter-answer-slot {
            width: 40px;
            height: 44px;
            border-radius: 8px;
            border: 2px dashed rgba(255, 255, 255, 0.4);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.3rem;
            font-weight: 700;
            color: #fbbf24;
            cursor: pointer;
        }

        .letter-answer-slot.filled {
            border-style: solid;
            background: rgba(255, 255, 255, 0.15);
        }

        .letter-blank {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 36px;
            height: 40px;
            border-bottom: 3px solid #fbbf24;
            margin: 0 2px;
            font-size: 1.3rem;
            font-weight: 700;
            color: #fbbf24;
        }

        .letter-blank.filled {
            color: white;
        }

        .missing-word-display {
            font-size: 1.8rem;
            letter-spacing: 4px;
            margin: 1rem 0;
            display: flex;
            justify-content: center;
            flex-wrap: wrap;
            gap: 2px;
        }

        .missing-choices {
            display: flex;
            gap: 0.5rem;
            justify-content: center;
            flex-wrap: wrap;
            margin: 1rem 0;
        }

        .spelling-feedback {
            font-size: 1.1rem;
            font-weight: 700;
            margin: 0.5rem 0;
            min-height: 30px;
        }

        .spelling-feedback.correct {
            color: #86efac;
        }

        .spelling-feedback.wrong {
            color: #fca5a5;
        }

        .spelling-progress-text {
            font-size: 0.85rem;
            opacity: 0.8;
            margin-bottom: 0.5rem;
        }

        /* ============ ADVANCED MATHS STYLES ============ */
        .advmath-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.95);
            z-index: 1000;
            align-items: center;
            justify-content: center;
        }

        .advmath-modal.active {
            display: flex;
        }

        .advmath-container {
            background: linear-gradient(135deg, #1e3a5f 0%, #2563eb 50%, #3b82f6 100%);
            border-radius: 20px;
            padding: 2rem;
            width: 95%;
            max-width: 520px;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
            text-align: center;
            color: white;
        }

        .advmath-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1rem;
        }

        .advmath-close {
            background: rgba(255, 255, 255, 0.2);
            border: none;
            color: white;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1.2rem;
        }

        .advmath-topic-select {
            display: flex;
            gap: 0.4rem;
            justify-content: center;
            flex-wrap: wrap;
            margin-bottom: 1rem;
        }

        .advmath-topic-btn {
            padding: 0.4rem 0.8rem;
            border-radius: 16px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: transparent;
            color: white;
            cursor: pointer;
            font-weight: 600;
            font-size: 0.75rem;
            transition: all 0.3s;
        }

        .advmath-topic-btn.active {
            background: #fbbf24;
            border-color: #fbbf24;
            color: #1e3a5f;
        }

        .advmath-question {
            font-size: 1.4rem;
            font-weight: 600;
            margin: 1.5rem 0;
            line-height: 1.6;
            min-height: 60px;
        }

        .advmath-visual {
            font-size: 2rem;
            margin: 0.5rem 0;
        }

        .advmath-options {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 0.8rem;
            margin: 1rem 0;
        }

        .advmath-option {
            padding: 1rem;
            border-radius: 12px;
            border: 2px solid rgba(255, 255, 255, 0.3);
            background: rgba(255, 255, 255, 0.1);
            color: white;
            font-size: 1.1rem;
            font-weight: 700;
            cursor: pointer;
            transition: all 0.3s;
        }

        .advmath-option:hover {
            background: rgba(255, 255, 255, 0.25);
            transform: scale(1.03);
        }

        .advmath-option.correct {
            background: #22c55e;
            border-color: #22c55e;
        }

        .advmath-option.wrong {
            background: #ef4444;
            border-color: #ef4444;
        }

        .advmath-feedback {
            font-size: 1rem;
            font-weight: 700;
            margin: 0.5rem 0;
            min-height: 25px;
        }

        .advmath-score {
            font-weight: 700;
            font-size: 0.9rem;
        }

        .fraction-bar {
            display: flex;
            gap: 2px;
            justify-content: center;
            margin: 0.5rem 0;
        }

        .fraction-piece {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            border: 2px solid rgba(255, 255, 255, 0.5);
        }

        .fraction-piece.filled {
            background: #fbbf24;
        }

        .fraction-piece.empty {
            background: rgba(255, 255, 255, 0.15);
        }

        /* ============ RESPONSIVE FOR NEW GAMES ============ */
        @media (max-width: 480px) {
            .rockstar-question {
                font-size: 2rem;
            }

            .rockstar-option {
                padding: 0.7rem;
                font-size: 1.1rem;
            }

            .spelling-input {
                width: 90%;
                font-size: 1.1rem;
            }

            .letter-tile {
                width: 38px;
                height: 38px;
                font-size: 1.1rem;
            }

            .advmath-question {
                font-size: 1.2rem;
            }

            .advmath-option {
                padding: 0.7rem;
                font-size: 1rem;
            }
        }

        /* Badges */
        .badges-container {
            display: flex;
            gap: 0.5rem;
            flex-wrap: wrap;
        }

        .badge {
            width: 35px;
            height: 35px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            box-shadow: 0 2px 8px rgba(251, 191, 36, 0.4);
        }

        .badge.locked {
            background: #374151;
            opacity: 0.5;
        }

        /* Math Game Modal */
        .game-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 1000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .game-modal.active {
            display: flex;
        }

        .game-container {
            background: white;
            border-radius: 30px;
            padding: 2rem;
            max-width: 500px;
            width: 100%;
            text-align: center;
        }

        .game-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
        }

        .game-score {
            background: var(--accent);
            color: white;
            padding: 0.5rem 1rem;
            border-radius: 50px;
            font-weight: 700;
        }

        .game-close {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: #f3f4f6;
            cursor: pointer;
            font-size: 1.2rem;
        }

        .game-question {
            font-size: 3rem;
            font-weight: 800;
            color: var(--text-dark);
            margin: 1.5rem 0;
        }

        .game-options {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
            margin-bottom: 1.5rem;
        }

        .game-option {
            padding: 1.2rem;
            font-size: 1.5rem;
            font-weight: 800;
            border: 3px solid #e5e7eb;
            border-radius: 20px;
            background: white;
            cursor: pointer;
            transition: all 0.3s;
        }

        .game-option:hover {
            border-color: var(--accent);
            background: #f0fdf4;
        }

        .game-option.correct {
            background: #22c55e;
            color: white;
            border-color: #22c55e;
        }

        .game-option.wrong {
            background: #ef4444;
            color: white;
            border-color: #ef4444;
        }

        .game-feedback {
            font-size: 1.3rem;
            font-weight: 700;
            margin: 1rem 0;
            min-height: 2rem;
        }

        .game-streak {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
        }

        .streak-star {
            font-size: 1.3rem;
            opacity: 0.3;
        }

        .streak-star.active {
            opacity: 1;
        }

        /* AI Tutor Section - Full Width Responsive */
        .tutor-section {
            background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
            border-radius: 24px;
            padding: 1.5rem;
            margin: 1.5rem auto;
            max-width: 1200px;
            width: calc(100% - 2rem);
            position: relative;
            overflow: hidden;
            min-height: 500px;
        }

        .tutor-section::before {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 3px;
            background: linear-gradient(90deg, #f97316, #fbbf24, #22c55e, #3b82f6);
        }

        .tutor-section .section-title {
            color: white;
            text-align: center;
            font-size: 1.4rem;
            margin-bottom: 0.5rem;
            display: none;
        }

        .tutor-section .section-title i {
            color: #fbbf24;
            display: none;
        }

        @media (max-width: 768px) {
            .tutor-section {
                padding: 1rem;
                border-radius: 16px;
                min-height: 400px;
            }
        }

        .tutor-container {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 1rem;
            position: relative;
            z-index: 1;
        }

        /* Compact Avatar */
        .cucubot-avatar-container {
            display: flex;
            align-items: center;
            gap: 1rem;
            margin-bottom: 0.5rem;
        }

        .cucubot-avatar {
            width: 56px;
            height: 56px;
            background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.8rem;
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            cursor: pointer;
            transition: transform 0.2s;
        }

        .cucubot-avatar:hover {
            transform: scale(1.05);
        }

        .cucubot-avatar.speaking {
            animation: pulse-speak 0.5s ease-in-out infinite;
        }

        @keyframes pulse-speak {

            0%,
            100% {
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
            }

            50% {
                box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), 0 0 20px rgba(251, 191, 36, 0.5);
            }
        }

        .cucubot-name {
            color: white;
            font-size: 1.2rem;
            font-weight: 700;
        }

        .cucubot-subtitle {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.85rem;
        }

        /* Compact Voice Button */
        .voice-main-btn {
            width: 48px;
            height: 48px;
            background: #22c55e;
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 1.2rem;
            cursor: pointer;
            box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .voice-main-btn:hover {
            transform: scale(1.1);
            background: #16a34a;
        }

        .voice-main-btn.listening {
            background: #ef4444;
            animation: pulse-listening 0.8s ease-in-out infinite;
        }

        .live-main-btn {
            background: #8b5cf6;
            box-shadow: 0 4px 12px rgba(139, 92, 246, 0.32);
        }

        .live-main-btn:hover {
            background: #7c3aed;
        }

        .live-main-btn.live-active {
            background: #ec4899;
            animation: pulse-listening 0.8s ease-in-out infinite;
        }

        .live-main-btn.live-connecting {
            background: #f59e0b;
        }

        @keyframes pulse-listening {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }
        }

        .voice-btn-label {
            color: rgba(255, 255, 255, 0.7);
            font-size: 0.8rem;
            font-weight: 600;
            display: none;
        }

        /* Compact Topic Buttons - Chips Style */
        .topic-buttons {
            display: flex;
            flex-wrap: wrap;
            justify-content: center;
            gap: 0.5rem;
            margin: 0.5rem 0;
        }

        .topic-btn {
            background: rgba(255, 255, 255, 0.1);
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            padding: 0.4rem 0.8rem;
            font-size: 0.85rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 0.4rem;
            transition: all 0.2s;
            color: white;
        }

        .topic-btn:hover {
            background: rgba(255, 255, 255, 0.2);
            transform: translateY(-2px);
        }

        .topic-btn span.emoji {
            font-size: 1rem;
        }

        .topic-btn.english:hover {
            border-color: #3b82f6;
        }

        .topic-btn.math:hover {
            border-color: #22c55e;
        }

        .topic-btn.stories:hover {
            border-color: #f97316;
        }

        .topic-btn.science:hover {
            border-color: #8b5cf6;
        }

        .topic-btn.ideas {
            border-color: #fbbf24;
        }

        .topic-btn.ideas:hover {
            background: rgba(251, 191, 36, 0.2);
        }

        .topic-btn.ai {
            border-color: #06b6d4;
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.15));
        }

        .topic-btn.ai:hover {
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.28), rgba(59, 130, 246, 0.28));
        }

        .topic-btn.create-video {
            border-color: #ec4899;
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(236, 72, 153, 0.15));
        }

        .topic-btn.create-video:hover {
            background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(236, 72, 153, 0.3));
        }

        .topic-btn .price-tag {
            background: #fbbf24;
            color: #1e1b4b;
            font-size: 0.7rem;
            font-weight: 700;
            padding: 0.15rem 0.4rem;
            border-radius: 8px;
            margin-left: 0.3rem;
        }

        /* My Videos Panel inside tutor section */
        .my-videos-panel {
            width: 100%;
            margin-top: 1rem;
            padding: 1rem;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 12px;
        }

        .my-videos-list {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
            max-height: 200px;
            overflow-y: auto;
        }

        .my-video-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 0.6rem 0.8rem;
            background: rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            color: white;
            font-size: 0.85rem;
            transition: background 0.2s;
        }

        .my-video-item[onclick]:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .my-video-item .video-title {
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .my-video-item .video-status {
            padding: 0.2rem 0.5rem;
            border-radius: 12px;
            font-size: 0.75rem;
            font-weight: 600;
        }

        .my-video-item .video-status.paid {
            background: #f59e0b;
            color: #78350f;
        }

        .my-video-item .video-status.processing {
            background: #3b82f6;
            color: white;
        }

        .my-video-item .video-status.complete {
            background: #22c55e;
            color: white;
        }

        .my-video-item .video-status.failed {
            background: #ef4444;
            color: white;
        }

        /* Chat Area - Full Width Responsive */
        .tutor-chat {
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 16px;
            overflow: hidden;
            display: flex;
            flex-direction: column;
            width: 100%;
            max-width: 100%;
            height: 380px;
            flex: 1;
        }

        @media (min-width: 768px) {
            .tutor-chat {
                height: 420px;
            }
        }

        @media (max-width: 480px) {
            .tutor-chat {
                height: 320px;
                border-radius: 12px;
            }
        }

        .chat-header {
            background: transparent;
            color: white;
            padding: 0.75rem 1rem;
            display: flex;
            align-items: center;
            gap: 0.75rem;
            border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        }

        .voice-toggle {
            margin-left: auto;
            background: rgba(255, 255, 255, 0.1);
            border: none;
            color: white;
            width: 32px;
            height: 32px;
            border-radius: 50%;
            cursor: pointer;
            font-size: 0.9rem;
            transition: all 0.2s;
        }

        .voice-toggle:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .voice-toggle.muted {
            opacity: 0.5;
        }

        .chat-avatar {
            width: 32px;
            height: 32px;
            background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
        }

        .chat-messages {
            flex: 1;
            overflow-y: auto;
            padding: 1rem;
            display: flex;
            flex-direction: column;
            gap: 0.75rem;
            background: rgba(0, 0, 0, 0.2);
        }

        .chat-message {
            max-width: 85%;
            padding: 0.75rem 1rem;
            border-radius: 12px;
            font-size: 0.95rem;
            line-height: 1.5;
            position: relative;
        }

        .chat-message.bot {
            background: rgba(255, 255, 255, 0.95);
            color: #1e293b;
            align-self: flex-start;
            border-bottom-left-radius: 4px;
        }

        .chat-message.user {
            background: #3b82f6;
            color: white;
            align-self: flex-end;
            border-bottom-right-radius: 4px;
        }

        .message-speaker {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            background: rgba(59, 130, 246, 0.1);
            border-radius: 50%;
            margin-left: 0.4rem;
            cursor: pointer;
            vertical-align: middle;
            transition: all 0.2s;
            font-size: 0.75rem;
        }

        .message-speaker:hover {
            background: rgba(59, 130, 246, 0.2);
        }

        .chat-input-container {
            padding: 0.75rem 1rem;
            border-top: 1px solid rgba(255, 255, 255, 0.1);
            display: flex;
            gap: 0.5rem;
            background: rgba(0, 0, 0, 0.1);
        }

        .chat-input {
            flex: 1;
            padding: 0.6rem 1rem;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 20px;
            font-size: 0.95rem;
            font-family: inherit;
            outline: none;
            transition: all 0.2s;
            background: rgba(255, 255, 255, 0.1);
            color: white;
        }

        .chat-input::placeholder {
            color: rgba(255, 255, 255, 0.5);
        }

        .chat-input:focus {
            border-color: #3b82f6;
            background: rgba(255, 255, 255, 0.15);
        }

        .chat-send {
            width: 40px;
            height: 40px;
            background: #3b82f6;
            color: white;
            border: none;
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.2s;
        }

        .chat-send:hover {
            background: #2563eb;
            transform: scale(1.05);
        }

        .chat-voice {
            width: 40px;
            height: 40px;
            background: rgba(255, 255, 255, 0.1);
            color: white;
            border: 1px solid rgba(255, 255, 255, 0.2);
            border-radius: 50%;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.2s;
        }

        .chat-voice:hover {
            background: rgba(255, 255, 255, 0.2);
        }

        .chat-voice.listening {
            background: #ef4444;
            border-color: #ef4444;
            animation: pulse 1s infinite;
        }

        @keyframes pulse {

            0%,
            100% {
                transform: scale(1);
            }

            50% {
                transform: scale(1.05);
            }
        }

        .voice-status {
            text-align: center;
            padding: 1rem;
            background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
            border-radius: 15px;
            color: white;
            margin-top: 0.5rem;
        }

        .voice-animation {
            display: flex;
            justify-content: center;
            gap: 4px;
            margin-bottom: 0.5rem;
        }

        .voice-animation span {
            width: 4px;
            height: 20px;
            background: white;
            border-radius: 2px;
            animation: soundwave 0.5s ease-in-out infinite;
        }

        .voice-animation span:nth-child(1) {
            animation-delay: 0s;
        }

        .voice-animation span:nth-child(2) {
            animation-delay: 0.1s;
        }

        .voice-animation span:nth-child(3) {
            animation-delay: 0.2s;
        }

        .voice-animation span:nth-child(4) {
            animation-delay: 0.3s;
        }

        .voice-animation span:nth-child(5) {
            animation-delay: 0.4s;
        }

        @keyframes soundwave {

            0%,
            100% {
                height: 10px;
            }

            50% {
                height: 30px;
            }
        }

        .chat-message.bot .speaker-btn {
            background: none;
            border: none;
            color: var(--accent-cyan);
            cursor: pointer;
            font-size: 1rem;
            margin-left: 8px;
            opacity: 0.7;
            transition: opacity 0.3s;
        }

        .chat-message.bot .speaker-btn:hover {
            opacity: 1;
        }

        .chat-message.bot .speaker-btn.speaking {
            color: var(--accent-pink);
        }

        /* Video Brief Confirmation Card */
        .video-brief-card {
            background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
            border: 3px solid #f59e0b;
            border-radius: 20px;
            padding: 1.5rem;
            margin: 1rem 0;
            box-shadow: 0 8px 25px rgba(245, 158, 11, 0.3);
            animation: slideIn 0.4s ease-out;
        }

        @keyframes slideIn {
            from {
                opacity: 0;
                transform: translateY(20px);
            }

            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .video-brief-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 1.3rem;
            font-weight: 700;
            color: #92400e;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px dashed #f59e0b;
        }

        .video-brief-header i {
            font-size: 1.5rem;
        }

        .video-brief-content {
            display: flex;
            flex-direction: column;
            gap: 0.6rem;
            margin-bottom: 1.25rem;
        }

        .video-brief-item {
            background: white;
            padding: 0.75rem 1rem;
            border-radius: 12px;
            font-size: 1rem;
            color: #78350f;
        }

        .video-brief-item strong {
            color: #92400e;
            margin-right: 0.5rem;
        }

        .video-brief-actions {
            display: flex;
            gap: 1rem;
            flex-wrap: wrap;
        }

        .video-brief-btn {
            flex: 1;
            min-width: 140px;
            padding: 0.9rem 1.5rem;
            border: none;
            border-radius: 30px;
            font-size: 1.05rem;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.5rem;
            transition: all 0.3s ease;
        }

        .video-brief-btn.confirm {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        }

        .video-brief-btn.confirm:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(16, 185, 129, 0.5);
        }

        .video-brief-btn.cancel {
            background: white;
            color: #92400e;
            border: 2px solid #f59e0b;
        }

        .video-brief-btn.cancel:hover {
            background: #fef3c7;
        }

        /* Chat Song Preview with PayPal */
        .chat-song-preview {
            background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
            border: 3px solid #8b5cf6;
            border-radius: 20px;
            padding: 1.5rem;
            margin: 1rem 0;
            box-shadow: 0 8px 25px rgba(139, 92, 246, 0.3);
            animation: slideIn 0.4s ease-out;
        }

        .song-preview-header {
            display: flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 1.2rem;
            font-weight: 700;
            color: #5b21b6;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px dashed #a78bfa;
        }

        .song-preview-header i {
            font-size: 1.3rem;
            color: #8b5cf6;
        }

        .song-preview-lyrics {
            background: white;
            padding: 1rem;
            border-radius: 12px;
            font-size: 0.9rem;
            color: #4c1d95;
            line-height: 1.6;
            margin-bottom: 1rem;
            max-height: 150px;
            overflow-y: auto;
        }

        .song-preview-style {
            background: #f5f3ff;
            padding: 0.5rem 1rem;
            border-radius: 20px;
            font-size: 0.85rem;
            color: #6d28d9;
            display: inline-block;
            margin-bottom: 1rem;
        }

        .song-preview-price {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 1rem;
            background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
            padding: 0.8rem 1.5rem;
            border-radius: 15px;
            margin-bottom: 1rem;
        }

        .song-preview-price .price-amount {
            font-size: 1.5rem;
            font-weight: 800;
            color: #1e1b4b;
        }

        .song-preview-price .price-note {
            font-size: 0.85rem;
            color: #3730a3;
        }

        .song-preview-paypal {
            min-height: 50px;
            display: flex;
            justify-content: center;
        }

        /* Editable song preview styles */
        .song-preview-section {
            margin-bottom: 1rem;
        }

        .song-preview-section label {
            display: block;
            font-weight: 600;
            color: #5b21b6;
            margin-bottom: 0.5rem;
            font-size: 0.9rem;
        }

        .editable-title {
            cursor: text;
            padding: 2px 6px;
            border-radius: 4px;
            transition: background 0.2s;
        }

        .editable-title:hover,
        .editable-title:focus {
            background: rgba(139, 92, 246, 0.2);
            outline: none;
        }

        .edit-hint {
            font-size: 0.7rem;
            color: #a78bfa;
            font-weight: 400;
        }

        .editable-lyrics,
        .editable-directions {
            width: 100%;
            padding: 0.75rem;
            border: 2px solid #ddd6fe;
            border-radius: 10px;
            font-family: inherit;
            font-size: 0.9rem;
            line-height: 1.5;
            resize: vertical;
            background: white;
            color: #4c1d95;
        }

        .editable-lyrics:focus,
        .editable-directions:focus {
            border-color: #8b5cf6;
            outline: none;
            box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.2);
        }

        .editable-style {
            width: 100%;
            padding: 0.5rem 0.75rem;
            border: 2px solid #ddd6fe;
            border-radius: 8px;
            font-size: 0.85rem;
            color: #6d28d9;
            background: #f5f3ff;
        }

        .editable-style:focus {
            border-color: #8b5cf6;
            outline: none;
        }

        .song-preview-actions {
            margin: 1rem 0;
            text-align: center;
        }

        .save-changes-btn {
            background: linear-gradient(135deg, #10b981 0%, #059669 100%);
            color: white;
            border: none;
            padding: 0.6rem 1.5rem;
            border-radius: 25px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
        }

        .save-changes-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
        }

        /* Chat sign-in button */
        .chat-signin-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            background: linear-gradient(135deg, #4285f4 0%, #1a73e8 100%);
            color: white;
            border: none;
            padding: 0.75rem 1.5rem;
            border-radius: 25px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 0.75rem;
            transition: all 0.3s;
        }

        .chat-signin-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 15px rgba(66, 133, 244, 0.4);
        }

        .chat-signin-btn i {
            font-size: 1.1rem;
        }

        .tutor-features {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        .tutor-feature {
            background: white;
            border-radius: 15px;
            padding: 1.2rem;
            display: flex;
            align-items: center;
            gap: 1rem;
            box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
            cursor: pointer;
            transition: all 0.3s;
        }

        .tutor-feature:hover {
            transform: translateX(10px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }

        .feature-icon {
            width: 50px;
            height: 50px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
        }

        .feature-icon.english {
            background: linear-gradient(135deg, #dbeafe, #3b82f6);
        }

        .feature-icon.math {
            background: linear-gradient(135deg, #dcfce7, #22c55e);
        }

        .feature-icon.stories {
            background: linear-gradient(135deg, #fce7f3, #ec4899);
        }

        .feature-icon.science {
            background: linear-gradient(135deg, #fef3c7, #f59e0b);
        }

        /* Music Section */
        .music-section {
            background: linear-gradient(135deg, #f3e8ff 0%, #e9d5ff 100%);
            border-radius: 30px;
            padding: 2rem;
            margin: 1.5rem auto;
            max-width: 1200px;
        }

        .music-section .section-title i {
            color: var(--accent-purple);
        }

        /* Jukebox Language Toggle */
        .jukebox-lang-toggle {
            display: flex;
            justify-content: center;
            gap: 0.5rem;
            margin-bottom: 1rem;
            flex-wrap: wrap;
            max-width: 100%;
        }

        .jukebox-lang-btn {
            padding: 0.5rem 1.2rem;
            border: 2px solid #e5e7eb;
            border-radius: 25px;
            background: white;
            font-family: 'Nunito', sans-serif;
            font-weight: 700;
            font-size: 0.9rem;
            color: var(--text-light);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 0.4rem;
        }

        .jukebox-lang-btn:hover {
            border-color: var(--accent-purple);
            color: var(--accent-purple);
        }

        .jukebox-lang-btn.active {
            background: var(--accent-purple);
            color: white;
            border-color: var(--accent-purple);
        }

        .jukebox-lang-btn .lang-flag {
            font-size: 1.1rem;
        }

        @media (max-width: 768px) {
            .jukebox-lang-toggle {
                justify-content: flex-start;
                padding: 0 0.25rem;
            }

            .jukebox-lang-btn {
                padding: 0.45rem 0.85rem;
                font-size: 0.82rem;
            }
        }

        /* Jukebox Styles */
        .jukebox-container {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1.5rem;
            background: white;
            border-radius: 20px;
            padding: 1.5rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
        }

        @media (max-width: 900px) {
            .jukebox-container {
                grid-template-columns: 1fr;
            }
        }

        .jukebox-player {
            display: flex;
            flex-direction: column;
            gap: 1rem;
        }

        #youtube-player {
            width: 100%;
            aspect-ratio: 16/9;
            background: #1f2937;
            border-radius: 15px;
            overflow: hidden;
        }

        #youtube-player iframe {
            width: 100%;
            height: 100%;
            border: none;
        }

        .jukebox-controls {
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 0.8rem;
            flex-wrap: wrap;
        }

        .jukebox-btn {
            width: 45px;
            height: 45px;
            border-radius: 50%;
            border: none;
            cursor: pointer;
            font-size: 1rem;
            transition: all 0.3s;
            background: #f3f4f6;
            color: var(--text-dark);
        }

        .jukebox-btn:hover {
            background: var(--accent-purple);
            color: white;
            transform: scale(1.1);
        }

        .jukebox-btn.active {
            background: var(--accent-purple);
            color: white;
        }

        .jukebox-btn.play-btn {
            width: 60px;
            height: 60px;
            font-size: 1.3rem;
            background: var(--accent-purple);
            color: white;
        }

        .now-playing-info {
            text-align: center;
            padding: 0.5rem;
            background: #f3e8ff;
            border-radius: 10px;
        }

        .now-playing-label {
            font-size: 0.8rem;
            color: var(--text-light);
            display: block;
        }

        .current-song-name {
            font-weight: 700;
            color: var(--accent-purple);
            display: block;
            font-size: 1rem;
        }

        .song-counter {
            font-size: 0.75rem;
            color: var(--text-light);
        }

        .song-list-container {
            display: flex;
            flex-direction: column;
        }

        .song-list-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 0.8rem;
            font-weight: 700;
            color: var(--text-dark);
        }

        .song-search {
            padding: 0.4rem 0.8rem;
            border: 2px solid #e5e7eb;
            border-radius: 20px;
            font-size: 0.85rem;
            width: 150px;
            transition: all 0.3s;
        }

        .song-search:focus {
            outline: none;
            border-color: var(--accent-purple);
            width: 180px;
        }

        .song-list {
            display: grid;
            gap: 0.3rem;
            max-height: 350px;
            overflow-y: auto;
            padding-right: 0.5rem;
        }

        .song-list::-webkit-scrollbar {
            width: 6px;
        }

        .song-list::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 3px;
        }

        .song-list::-webkit-scrollbar-thumb {
            background: var(--accent-purple);
            border-radius: 3px;
        }

        .song-item {
            display: flex;
            align-items: center;
            gap: 0.8rem;
            padding: 0.6rem 0.8rem;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s;
            background: #fafafa;
        }

        .song-item:hover {
            background: #f3e8ff;
            transform: translateX(5px);
        }

        .song-item.active {
            background: var(--accent-purple);
            color: white;
        }

        .song-item.playing {
            animation: pulse 1.5s infinite;
        }

        .song-number {
            width: 28px;
            height: 28px;
            background: rgba(139, 92, 246, 0.1);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 700;
            font-size: 0.85rem;
        }

        .song-item.active .song-number {
            background: rgba(255, 255, 255, 0.2);
        }

        .song-title {
            flex: 1;
            font-weight: 600;
            font-size: 0.95rem;
        }

        .song-lang-flag {
            font-size: 0.8rem;
            margin-right: 0.3rem;
        }

        .song-duration {
            color: var(--text-light);
            font-size: 0.85rem;
        }

        .song-item.active .song-duration {
            color: rgba(255, 255, 255, 0.8);
        }

        /* Footer */
        footer {
            background: var(--text-dark);
            color: white;
            padding: 2rem;
            margin-top: 2rem;
        }

        .footer-content {
            max-width: 1400px;
            margin: 0 auto;
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 1.5rem;
        }

        .social-links {
            display: flex;
            gap: 0.8rem;
        }

        .social-links a {
            width: 40px;
            height: 40px;
            background: #374151;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 1.1rem;
            transition: all 0.3s;
        }

        .social-links a:hover {
            transform: translateY(-3px);
        }

        .social-links a:hover .fa-youtube {
            color: #ff0000;
        }

        .social-links a:hover .fa-facebook {
            color: #1877f2;
        }

        .social-links a:hover .fa-x-twitter {
            color: #000000;
        }

        .social-links a:hover .fa-instagram {
            color: #e4405f;
        }

        .social-links a:hover {
            background: white;
        }

        /* Create Your Story Section */
        .create-section {
            max-width: 900px;
            margin: 2rem auto;
            padding: 2rem;
        }

        .create-hero {
            text-align: center;
            background: linear-gradient(135deg, #1e1b4b 0%, #312e81 50%, #4c1d95 100%);
            border-radius: 24px;
            padding: 3rem 2rem;
            margin-bottom: 2rem;
            color: white;
            position: relative;
            overflow: hidden;
        }

        .create-hero::before {
            content: '✨🌙⭐';
            position: absolute;
            top: 10px;
            left: 20px;
            font-size: 2rem;
            opacity: 0.3;
        }

        .create-hero::after {
            content: '🌟🎵💫';
            position: absolute;
            bottom: 10px;
            right: 20px;
            font-size: 2rem;
            opacity: 0.3;
        }

        .create-hero h2 {
            font-size: 2rem;
            margin-bottom: 0.5rem;
        }

        .create-hero p {
            font-size: 1.1rem;
            opacity: 0.9;
            max-width: 600px;
            margin: 0 auto;
        }

        .create-price {
            display: inline-block;
            background: var(--secondary);
            color: #1e1b4b;
            font-weight: 800;
            font-size: 1.1rem;
            padding: 0.5rem 1.5rem;
            border-radius: 50px;
            margin-top: 1rem;
        }

        /* Tier Selection Cards */
        .tier-selection {
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 1rem;
            margin-top: 1.5rem;
        }

        @media (max-width: 600px) {
            .tier-selection {
                grid-template-columns: 1fr;
            }
        }

        .tier-card {
            background: white;
            border: 3px solid #e5e7eb;
            border-radius: 20px;
            padding: 1.5rem;
            cursor: pointer;
            transition: all 0.3s;
            position: relative;
            text-align: center;
        }

        .tier-card:hover {
            border-color: var(--accent-purple);
            transform: translateY(-3px);
            box-shadow: 0 8px 25px rgba(139, 92, 246, 0.2);
        }

        .tier-card.selected {
            border-color: var(--accent-purple);
            background: linear-gradient(135deg, #faf5ff, #f3e8ff);
            box-shadow: 0 4px 20px rgba(139, 92, 246, 0.25);
        }

        .tier-card .tier-badge {
            display: inline-block;
            padding: 0.2rem 0.8rem;
            border-radius: 50px;
            font-size: 0.75rem;
            font-weight: 700;
            text-transform: uppercase;
            margin-bottom: 0.5rem;
        }

        .tier-card.tier-personal .tier-badge {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .tier-card.tier-broadcast .tier-badge {
            background: linear-gradient(135deg, #fbbf24, #f59e0b);
            color: #78350f;
        }

        .tier-card .tier-price {
            font-size: 2rem;
            font-weight: 800;
            color: var(--text-dark);
            margin: 0.3rem 0;
        }

        .tier-card .tier-name {
            font-size: 1.1rem;
            font-weight: 700;
            color: var(--text-dark);
            margin-bottom: 0.3rem;
        }

        .tier-card .tier-desc {
            font-size: 0.85rem;
            color: var(--text-light);
            line-height: 1.4;
        }

        .tier-card .tier-features {
            text-align: left;
            margin-top: 0.8rem;
            font-size: 0.85rem;
        }

        .tier-card .tier-features li {
            list-style: none;
            padding: 0.2rem 0;
            color: var(--text-dark);
        }

        .tier-card .tier-features li::before {
            content: '\2713  ';
            color: var(--accent);
            font-weight: 700;
        }

        .tier-card.tier-broadcast .tier-features li.broadcast-only::before {
            content: '\2B50  ';
        }

        .create-form {
            background: white;
            border-radius: 20px;
            padding: 2rem;
            box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
        }

        .create-form .form-group {
            margin-bottom: 1.2rem;
        }

        .create-form label {
            display: block;
            font-weight: 700;
            margin-bottom: 0.4rem;
            color: var(--text-dark);
            font-size: 0.95rem;
        }

        .create-form label .label-hint {
            font-weight: 400;
            color: var(--text-light);
            font-size: 0.85rem;
        }

        .create-form input,
        .create-form textarea,
        .create-form select {
            width: 100%;
            padding: 0.8rem 1rem;
            border: 2px solid #e5e7eb;
            border-radius: 12px;
            font-family: 'Nunito', sans-serif;
            font-size: 1rem;
            transition: border-color 0.3s;
        }

        .create-form input:focus,
        .create-form textarea:focus,
        .create-form select:focus {
            border-color: var(--accent-purple);
            outline: none;
        }

        .create-form textarea {
            resize: vertical;
            min-height: 80px;
        }

        .create-form select {
            cursor: pointer;
            appearance: auto;
        }

        .create-btn-preview {
            background: linear-gradient(135deg, var(--accent-purple), var(--accent-pink));
            color: white;
            border: none;
            padding: 1rem 2rem;
            font-size: 1.1rem;
            font-weight: 700;
            border-radius: 50px;
            cursor: pointer;
            width: 100%;
            font-family: 'Nunito', sans-serif;
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .create-btn-preview:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
        }

        .create-btn-preview:disabled {
            opacity: 0.6;
            cursor: not-allowed;
            transform: none;
        }

        .create-login-prompt {
            text-align: center;
            background: #fef3c7;
            border: 2px dashed var(--secondary);
            border-radius: 16px;
            padding: 2rem;
            margin-bottom: 1.5rem;
        }

        .create-login-prompt button {
            background: var(--primary);
            color: white;
            border: none;
            padding: 0.8rem 2rem;
            border-radius: 50px;
            font-family: 'Nunito', sans-serif;
            font-size: 1rem;
            font-weight: 700;
            cursor: pointer;
            margin-top: 0.5rem;
        }

        /* Preview Card */
        .story-preview-card {
            background: linear-gradient(135deg, #faf5ff 0%, #f3e8ff 100%);
            border: 2px solid #ddd6fe;
            border-radius: 20px;
            padding: 2rem;
            margin-top: 2rem;
            display: none;
        }

        .story-preview-card.visible {
            display: block;
        }

        .story-preview-card h3 {
            color: var(--accent-purple);
            font-size: 1.4rem;
            margin-bottom: 0.5rem;
        }

        .story-preview-card .preview-section {
            margin-bottom: 1rem;
        }

        .story-preview-card .preview-section h4 {
            color: var(--text-dark);
            font-size: 0.95rem;
            margin-bottom: 0.3rem;
        }

        .story-preview-card .preview-section p,
        .story-preview-card .preview-section pre {
            color: var(--text-light);
            font-size: 0.9rem;
            line-height: 1.5;
        }

        .story-preview-card pre {
            white-space: pre-wrap;
            font-family: 'Nunito', sans-serif;
            background: white;
            padding: 1rem;
            border-radius: 12px;
            max-height: 200px;
            overflow-y: auto;
        }

        .story-preview-card .scene-list {
            display: grid;
            gap: 0.5rem;
            max-height: 200px;
            overflow-y: auto;
        }

        .story-preview-card .scene-item {
            background: white;
            padding: 0.8rem;
            border-radius: 10px;
            font-size: 0.85rem;
        }

        .story-preview-card .scene-item strong {
            color: var(--accent-purple);
        }

        #paypal-button-container {
            margin-top: 1.5rem;
        }

        /* Order Status */
        .story-orders-panel {
            margin-top: 2rem;
            display: none;
        }

        .story-orders-panel.visible {
            display: block;
        }

        .story-orders-panel h3 {
            font-size: 1.3rem;
            margin-bottom: 1rem;
        }

        .order-card {
            background: white;
            border-radius: 16px;
            padding: 1.2rem;
            margin-bottom: 1rem;
            box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
            display: flex;
            justify-content: space-between;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
        }

        .order-card .order-info h4 {
            font-size: 1rem;
            color: var(--text-dark);
        }

        .order-card .order-info p {
            font-size: 0.85rem;
            color: var(--text-light);
        }

        .order-status-badge {
            padding: 0.3rem 0.8rem;
            border-radius: 50px;
            font-size: 0.8rem;
            font-weight: 700;
            text-transform: uppercase;
        }

        .order-status-badge.paid {
            background: #dbeafe;
            color: #1d4ed8;
        }

        .order-status-badge.generating_music,
        .order-status-badge.generating_video,
        .order-status-badge.assembling,
        .order-status-badge.uploading {
            background: #fef3c7;
            color: #d97706;
        }

        .order-status-badge.complete {
            background: #d1fae5;
            color: #059669;
        }

        .order-status-badge.failed {
            background: #fee2e2;
            color: #dc2626;
        }

        .order-status-badge.pending_payment {
            background: #f3f4f6;
            color: #6b7280;
        }

        .order-youtube-link {
            background: #dc2626;
            color: white;
            text-decoration: none;
            padding: 0.5rem 1rem;
            border-radius: 50px;
            font-weight: 700;
            font-size: 0.85rem;
            display: inline-flex;
            align-items: center;
            gap: 0.3rem;
        }

        .order-youtube-link:hover {
            background: #b91c1c;
        }

        .create-loading {
            text-align: center;
            padding: 2rem;
            color: var(--accent-purple);
        }

        .create-loading .spinner {
            display: inline-block;
            width: 40px;
            height: 40px;
            border: 4px solid #e5e7eb;
            border-top-color: var(--accent-purple);
            border-radius: 50%;
            animation: spin 0.8s linear infinite;
        }

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

        /* Responsive */
        @media (max-width: 768px) {
            header {
                padding: 0.55rem 0.75rem;
            }

            .header-content {
                gap: 0.65rem;
            }

            .logo {
                flex: 0 0 auto;
            }

            .header-logo-img {
                height: 44px;
            }

            .nav-links {
                flex: 1;
                flex-wrap: nowrap;
                justify-content: flex-start;
                overflow-x: auto;
                gap: 0.45rem;
                padding-bottom: 0.15rem;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }

            .nav-links::-webkit-scrollbar {
                display: none;
            }

            .nav-links a {
                flex: 0 0 auto;
                white-space: nowrap;
                padding: 0.45rem 0.65rem;
                border-radius: 999px;
                font-size: 0.82rem;
            }

            .user-stats-bar {
                justify-content: flex-start;
                flex-wrap: nowrap;
                gap: 0.65rem;
                padding: 0.55rem 0.75rem;
                overflow-x: auto;
                -webkit-overflow-scrolling: touch;
                scrollbar-width: none;
            }

            .user-stats-bar::-webkit-scrollbar {
                display: none;
            }

            .stat-item {
                flex: 0 0 auto;
                font-size: 0.9rem;
            }

            .badges-container {
                display: none;
            }

            .hero {
                padding: 1.75rem 1rem;
            }

            .hero h1 {
                font-size: 1.8rem;
            }

            .hero p {
                font-size: 1rem;
            }

            .hero-learning-badges {
                justify-content: stretch;
                gap: 0.5rem;
            }

            .hero-learning-badge {
                flex: 1 1 135px;
                min-height: 38px;
                padding: 0.45rem 0.6rem;
            }

            .hero-buttons {
                gap: 0.55rem;
            }

            .hero-btn {
                padding: 0.65rem 0.9rem;
                font-size: 0.9rem;
            }

            .learning-world {
                padding: 1.25rem;
            }

            .learning-world-inner {
                grid-template-columns: 1fr;
                gap: 1rem;
            }

            .learning-copy h2 {
                font-size: 1.65rem;
            }

            .learning-copy p {
                font-size: 0.98rem;
            }

            .learning-map {
                grid-template-columns: 1fr;
            }

            .learning-tile {
                min-height: 112px;
            }

            .learning-actions,
            .learning-age-strip {
                align-items: stretch;
            }

            .learning-action,
            .learning-age-strip a {
                width: 100%;
            }

            .game-question {
                font-size: 2.5rem;
            }

            .game-option {
                font-size: 1.2rem;
                padding: 1rem;
            }

            .footer-content {
                flex-direction: column;
                text-align: center;
            }

            .tutor-chat {
                height: 400px;
            }
        }

        /* Loading indicator */
        .typing-indicator {
            display: flex;
            gap: 4px;
            padding: 1rem;
        }

        .typing-indicator span {
            width: 8px;
            height: 8px;
            background: var(--accent-cyan);
            border-radius: 50%;
            animation: typing 1s infinite;
        }

        .typing-indicator span:nth-child(2) {
            animation-delay: 0.2s;
        }

        .typing-indicator span:nth-child(3) {
            animation-delay: 0.4s;
        }

        @keyframes typing {

            0%,
            100% {
                transform: translateY(0);
            }

            50% {
                transform: translateY(-5px);
            }
        }

        @keyframes shake {

            0%,
            100% {
                transform: translateX(0);
            }

            10%,
            30%,
            50%,
            70%,
            90% {
                transform: translateX(-5px);
            }

            20%,
            40%,
            60%,
            80% {
                transform: translateX(5px);
            }
        }

        /* Scroll behavior */
        html {
            scroll-behavior: smooth;
        }

        /* GDPR Cookie Banner */
        .cookie-banner {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
            color: white;
            padding: 1.5rem 2rem;
            z-index: 9999;
            box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
            display: none;
        }

        .cookie-banner.show {
            display: block;
        }

        .cookie-content {
            max-width: 1200px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 1.5rem;
            flex-wrap: wrap;
        }

        .cookie-text {
            flex: 1;
            min-width: 280px;
        }

        .cookie-text h4 {
            font-size: 1.1rem;
            margin-bottom: 0.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .cookie-text p {
            font-size: 0.9rem;
            color: #d1d5db;
            line-height: 1.5;
        }

        .cookie-text a {
            color: var(--secondary);
            text-decoration: underline;
        }

        .cookie-buttons {
            display: flex;
            gap: 0.8rem;
            flex-wrap: wrap;
        }

        .cookie-btn {
            padding: 0.7rem 1.5rem;
            border-radius: 50px;
            font-weight: 600;
            font-size: 0.9rem;
            cursor: pointer;
            border: none;
            transition: all 0.3s;
        }

        .cookie-btn.accept {
            background: var(--accent);
            color: white;
        }

        .cookie-btn.accept:hover {
            background: #16a34a;
        }

        .cookie-btn.reject {
            background: transparent;
            color: white;
            border: 2px solid #6b7280;
        }

        .cookie-btn.reject:hover {
            border-color: white;
        }

        .cookie-btn.settings {
            background: transparent;
            color: #9ca3af;
            text-decoration: underline;
        }

        /* Legal Modal */
        .legal-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.8);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            overflow-y: auto;
        }

        .legal-modal.active {
            display: flex;
        }

        .legal-container {
            background: white;
            border-radius: 20px;
            max-width: 800px;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            position: relative;
        }

        .legal-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            color: white;
            padding: 1.5rem 2rem;
            position: sticky;
            top: 0;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .legal-header h2 {
            font-size: 1.5rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .legal-close {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            border: none;
            background: rgba(255, 255, 255, 0.2);
            color: white;
            cursor: pointer;
            font-size: 1.2rem;
            transition: all 0.3s;
        }

        .legal-close:hover {
            background: rgba(255, 255, 255, 0.3);
        }

        .legal-content {
            padding: 2rem;
            color: var(--text-dark);
            line-height: 1.7;
        }

        .legal-content h3 {
            color: var(--primary);
            margin: 1.5rem 0 0.8rem;
            font-size: 1.2rem;
        }

        .legal-content h3:first-child {
            margin-top: 0;
        }

        .legal-content p {
            margin-bottom: 1rem;
        }

        .legal-content ul {
            margin: 0.5rem 0 1rem 1.5rem;
        }

        .legal-content li {
            margin-bottom: 0.5rem;
        }

        .legal-content .highlight {
            background: #fef3c7;
            padding: 1rem;
            border-radius: 10px;
            border-left: 4px solid var(--secondary);
            margin: 1rem 0;
        }

        .legal-content .contact-info {
            background: #f0fdfa;
            padding: 1rem;
            border-radius: 10px;
            border-left: 4px solid var(--accent-cyan);
        }

        /* Footer legal links */
        .footer-legal {
            display: flex;
            gap: 1.5rem;
            flex-wrap: wrap;
            margin-top: 1rem;
        }

        .footer-legal a {
            color: #9ca3af;
            text-decoration: none;
            font-size: 0.85rem;
            transition: color 0.3s;
        }

        .footer-legal a:hover {
            color: var(--secondary);
        }

        /* Courses */
        .courses-section {
            padding: 3rem 2rem;
            background: linear-gradient(180deg, rgba(16, 185, 129, 0.08) 0%, rgba(59, 130, 246, 0.06) 40%, rgba(255, 255, 255, 0) 100%);
        }

        .courses-plan {
            max-width: 1100px;
            margin: 0 auto 1rem;
            background: rgba(255, 255, 255, 0.88);
            border: 2px solid rgba(0, 0, 0, 0.06);
            border-radius: 18px;
            padding: 0.9rem 1rem;
            box-shadow: 0 10px 26px rgba(0, 0, 0, 0.06);
        }

        .courses-plan-top {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.8rem;
            margin-bottom: 0.55rem;
            flex-wrap: wrap;
        }

        .courses-plan-title {
            font-size: 0.95rem;
            font-weight: 900;
            color: var(--text-dark);
        }

        .courses-plan-title small {
            display: block;
            color: var(--text-light);
            font-weight: 700;
            margin-top: 0.2rem;
        }

        .challenge-btn {
            border: none;
            cursor: pointer;
            border-radius: 12px;
            padding: 0.55rem 0.8rem;
            font-weight: 900;
            font-size: 0.82rem;
            background: linear-gradient(135deg, #f59e0b, #f97316);
            color: #fff;
        }

        .challenge-btn.done {
            background: linear-gradient(135deg, #10b981, #22c55e);
        }

        .courses-progress-wrap {
            width: 100%;
            height: 10px;
            border-radius: 999px;
            background: rgba(15, 23, 42, 0.08);
            overflow: hidden;
            margin: 0.3rem 0 0.65rem;
        }

        .courses-progress-bar {
            height: 100%;
            width: 0%;
            background: linear-gradient(135deg, #10b981, #3b82f6);
            border-radius: 999px;
            transition: width 0.25s ease;
        }

        .courses-plan-meta {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
            gap: 0.4rem 1rem;
            font-size: 0.82rem;
            color: var(--text-light);
            font-weight: 800;
        }

        .age-segment-panel {
            display: grid;
            grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(130px, 0.55fr));
            gap: 0.65rem;
            margin-top: 0.8rem;
        }

        .age-segment-main,
        .age-segment-stat {
            border: 1px solid rgba(15, 23, 42, 0.08);
            border-radius: 14px;
            background: rgba(255, 255, 255, 0.78);
            padding: 0.75rem 0.85rem;
        }

        .age-segment-main strong,
        .age-segment-stat strong {
            display: block;
            color: var(--text-dark);
            font-size: 0.86rem;
            font-weight: 950;
            line-height: 1.2;
        }

        .age-segment-main span,
        .age-segment-stat span {
            display: block;
            margin-top: 0.25rem;
            color: var(--text-light);
            font-size: 0.8rem;
            font-weight: 800;
            line-height: 1.3;
        }

        .courses-plan-actions {
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
            margin-top: 0.65rem;
        }

        .courses-plan-actions button {
            border: none;
            cursor: pointer;
            border-radius: 12px;
            padding: 0.55rem 0.8rem;
            font-weight: 950;
            font-size: 0.82rem;
            color: #fff;
        }

        .courses-plan-actions button:disabled {
            opacity: 0.55;
            cursor: not-allowed;
            filter: grayscale(0.2);
        }

        .btn-placement {
            background: linear-gradient(135deg, #06b6d4, #3b82f6);
        }

        .btn-checkpoint {
            background: linear-gradient(135deg, #8b5cf6, #ec4899);
        }

        /* Lessons modal */
        .lessons-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.82);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .lessons-modal.active {
            display: flex;
        }

        .lessons-container {
            width: 100%;
            max-width: 760px;
            max-height: 92vh;
            background: #fff;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
            display: flex;
            flex-direction: column;
        }

        .lessons-header {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(59, 130, 246, 0.95));
            color: #fff;
            padding: 1rem 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
        }

        .lessons-header h3 {
            font-size: 1.05rem;
            font-weight: 950;
        }

        .lessons-close {
            width: 38px;
            height: 38px;
            border-radius: 999px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #fff;
            cursor: pointer;
        }

        .lessons-body {
            padding: 1.1rem 1.2rem;
            overflow: auto;
        }

        .lessons-sub {
            color: var(--text-light);
            font-weight: 800;
            font-size: 0.9rem;
            margin-bottom: 0.8rem;
        }

        .lessons-list {
            display: grid;
            gap: 0.6rem;
        }

        .lesson-item {
            border: 2px solid rgba(0, 0, 0, 0.08);
            border-radius: 14px;
            padding: 0.75rem 0.85rem;
            background: rgba(255, 255, 255, 0.92);
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .lesson-item.done {
            border-color: rgba(16, 185, 129, 0.22);
            background: rgba(236, 253, 245, 0.82);
        }

        .lesson-left {
            display: flex;
            align-items: center;
            gap: 0.7rem;
            min-width: 0;
            flex: 1;
        }

        .lesson-num {
            width: 34px;
            height: 34px;
            border-radius: 12px;
            background: rgba(59, 130, 246, 0.12);
            color: rgba(30, 58, 138, 0.95);
            display: flex;
            align-items: center;
            justify-content: center;
            font-weight: 950;
        }

        .lesson-title {
            font-weight: 950;
            color: var(--text-dark);
            line-height: 1.2;
        }

        .lesson-title-row {
            display: flex;
            align-items: center;
            gap: 0.45rem;
            flex-wrap: wrap;
        }

        .lesson-desc {
            color: var(--text-light);
            font-size: 0.84rem;
            line-height: 1.35;
            font-weight: 750;
            margin-top: 0.2rem;
        }

        .lesson-chips {
            display: flex;
            gap: 0.35rem;
            flex-wrap: wrap;
            margin-top: 0.45rem;
        }

        .lesson-chip,
        .lesson-level {
            display: inline-flex;
            align-items: center;
            gap: 0.25rem;
            border-radius: 999px;
            padding: 0.22rem 0.45rem;
            background: rgba(59, 130, 246, 0.1);
            color: rgba(30, 58, 138, 0.96);
            font-size: 0.74rem;
            font-weight: 900;
            line-height: 1.1;
        }

        .lesson-level.core {
            background: rgba(16, 185, 129, 0.12);
            color: rgba(6, 95, 70, 0.96);
        }

        .lesson-level.challenge {
            background: rgba(245, 158, 11, 0.15);
            color: rgba(146, 64, 14, 0.98);
        }

        .lesson-level.create {
            background: rgba(236, 72, 153, 0.12);
            color: rgba(157, 23, 77, 0.98);
        }

        .lesson-actions {
            display: flex;
            align-items: center;
            gap: 0.55rem;
            flex: 0 0 auto;
        }

        .lesson-status {
            font-weight: 950;
            color: rgba(16, 185, 129, 0.95);
            font-size: 0.82rem;
        }

        .lesson-btn {
            border: none;
            cursor: pointer;
            border-radius: 12px;
            padding: 0.55rem 0.75rem;
            font-weight: 950;
            background: linear-gradient(135deg, #f59e0b, #f97316);
            color: #fff;
            white-space: nowrap;
        }

        .lesson-btn.done {
            background: linear-gradient(135deg, #10b981, #22c55e);
        }

        /* AI lesson modal */
        .ai-lesson-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.86);
            z-index: 10010;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .ai-lesson-modal.active {
            display: flex;
        }

        .ai-lesson-container {
            width: 100%;
            max-width: 760px;
            max-height: 92vh;
            background: #fff;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
            display: flex;
            flex-direction: column;
        }

        .ai-lesson-header {
            background: linear-gradient(135deg, rgba(6, 182, 212, 0.95), rgba(59, 130, 246, 0.95));
            color: #fff;
            padding: 1rem 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
        }

        .ai-lesson-header h3 {
            font-size: 1.05rem;
            font-weight: 950;
        }

        .ai-lesson-close {
            width: 38px;
            height: 38px;
            border-radius: 999px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #fff;
            cursor: pointer;
        }

        .ai-lesson-body {
            padding: 1.1rem 1.2rem;
            overflow: auto;
        }

        .ai-lesson-instructions {
            color: var(--text-dark);
            font-weight: 850;
            font-size: 0.95rem;
            line-height: 1.35;
        }

        .ai-prompt {
            margin-top: 0.8rem;
            border: 2px solid rgba(0, 0, 0, 0.08);
            border-radius: 14px;
            padding: 0.85rem 0.9rem;
            background: rgba(59, 130, 246, 0.06);
            font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
            font-size: 0.92rem;
            white-space: pre-wrap;
        }

        .ai-lesson-tip {
            margin-top: 0.7rem;
            color: var(--text-light);
            font-weight: 800;
            font-size: 0.85rem;
        }

        .ai-lesson-actions {
            margin-top: 0.95rem;
            display: flex;
            gap: 0.6rem;
            flex-wrap: wrap;
        }

        .ai-lesson-actions button {
            border: none;
            cursor: pointer;
            border-radius: 12px;
            padding: 0.6rem 0.85rem;
            font-weight: 950;
            color: #fff;
        }

        .ai-lesson-send {
            background: linear-gradient(135deg, #10b981, #22c55e);
        }

        .ai-lesson-done {
            background: linear-gradient(135deg, #f59e0b, #f97316);
        }

        .ai-lesson-copy {
            background: linear-gradient(135deg, #8b5cf6, #ec4899);
        }

        .course-track-toggle {
            display: flex;
            gap: 0.55rem;
            justify-content: center;
            flex-wrap: wrap;
            margin: 0.2rem 0 1rem;
        }

        .course-track-btn {
            border: 2px solid rgba(0, 0, 0, 0.08);
            background: rgba(255, 255, 255, 0.8);
            color: var(--text-dark);
            padding: 0.45rem 0.75rem;
            border-radius: 999px;
            cursor: pointer;
            font-weight: 850;
            font-size: 0.82rem;
            transition: all 0.2s;
        }

        .course-track-btn.active {
            background: rgba(59, 130, 246, 0.92);
            color: #fff;
            border-color: rgba(59, 130, 246, 0.92);
        }

        .age-band-toggle {
            display: flex;
            gap: 0.75rem;
            justify-content: center;
            flex-wrap: wrap;
            margin: 1rem 0 1.5rem;
        }

        .age-band-btn {
            border: 2px solid rgba(0, 0, 0, 0.08);
            background: rgba(255, 255, 255, 0.75);
            color: var(--text-dark);
            padding: 0.55rem 0.9rem;
            border-radius: 999px;
            cursor: pointer;
            font-weight: 800;
            transition: all 0.2s;
        }

        .age-band-btn:hover {
            transform: translateY(-1px);
        }

        .age-band-btn.active {
            background: linear-gradient(135deg, rgba(16, 185, 129, 0.95), rgba(59, 130, 246, 0.95));
            color: #fff;
            border-color: rgba(0, 0, 0, 0.0);
            box-shadow: 0 10px 25px rgba(16, 185, 129, 0.18);
        }

        .courses-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
            gap: 1rem;
            max-width: 1100px;
            margin: 0 auto;
        }

        .course-card {
            background: rgba(255, 255, 255, 0.9);
            border: 2px solid rgba(0, 0, 0, 0.06);
            border-radius: 18px;
            padding: 1rem;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
            transition: transform 0.2s, box-shadow 0.2s;
        }

        .course-card:hover {
            transform: translateY(-2px);
            box-shadow: 0 16px 38px rgba(0, 0, 0, 0.10);
        }

        .course-top {
            display: flex;
            gap: 0.75rem;
            align-items: flex-start;
            justify-content: space-between;
        }

        .course-title {
            display: flex;
            gap: 0.6rem;
            align-items: center;
            font-weight: 900;
            font-size: 1.05rem;
            color: var(--text-dark);
        }

        .course-title .emoji {
            font-size: 1.35rem;
        }

        .course-meta {
            display: flex;
            gap: 0.4rem;
            flex-wrap: wrap;
            margin-top: 0.65rem;
        }

        .course-chip {
            font-size: 0.78rem;
            font-weight: 800;
            padding: 0.25rem 0.5rem;
            border-radius: 999px;
            background: rgba(59, 130, 246, 0.10);
            color: rgba(30, 58, 138, 0.95);
            border: 1px solid rgba(59, 130, 246, 0.18);
        }

        .course-chip.price {
            background: rgba(245, 158, 11, 0.14);
            color: rgba(146, 64, 14, 0.95);
            border-color: rgba(245, 158, 11, 0.25);
        }

        .course-chip.badge {
            background: rgba(16, 185, 129, 0.12);
            color: rgba(6, 95, 70, 0.95);
            border-color: rgba(16, 185, 129, 0.24);
        }

        .course-desc {
            margin-top: 0.75rem;
            color: var(--text-light);
            font-weight: 650;
            line-height: 1.45;
            font-size: 0.92rem;
        }

        .course-segment {
            display: grid;
            grid-template-columns: repeat(3, minmax(0, 1fr));
            gap: 0.45rem;
            margin-top: 0.75rem;
        }

        .course-segment span {
            min-height: 42px;
            display: flex;
            align-items: center;
            border-radius: 12px;
            padding: 0.45rem 0.55rem;
            background: rgba(15, 23, 42, 0.04);
            color: var(--text-dark);
            font-size: 0.78rem;
            font-weight: 850;
            line-height: 1.2;
        }

        .course-progress {
            margin-top: 0.8rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
            font-size: 0.86rem;
            color: var(--text-light);
        }

        .course-actions {
            margin-top: 0.9rem;
            display: flex;
            gap: 0.6rem;
        }

        .course-actions button {
            flex: 1;
            border: none;
            cursor: pointer;
            border-radius: 14px;
            padding: 0.7rem 0.8rem;
            font-weight: 900;
            transition: transform 0.15s, filter 0.15s;
        }

        .course-actions button:hover {
            transform: translateY(-1px);
            filter: brightness(1.03);
        }

        .course-actions .btn-lesson {
            background: linear-gradient(135deg, #10b981, #22c55e);
            color: #fff;
        }

        .course-actions .btn-test {
            background: linear-gradient(135deg, #3b82f6, #06b6d4);
            color: #fff;
        }

        @media (max-width: 768px) {
            .age-segment-panel {
                grid-template-columns: 1fr;
            }

            .lessons-container {
                max-height: 92vh;
                overflow: auto;
            }

            .lesson-item {
                align-items: stretch;
                flex-direction: column;
            }

            .lesson-actions {
                justify-content: space-between;
            }

            .lesson-btn {
                flex: 1;
            }

            .course-segment {
                grid-template-columns: 1fr;
            }
        }

        .membership-section {
            padding: 1.2rem 2rem 2.8rem;
            background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(236, 72, 153, 0.06) 100%);
        }

        .membership-grid {
            max-width: 1100px;
            margin: 1rem auto 0;
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
            gap: 1rem;
        }

        .membership-card {
            background: rgba(255, 255, 255, 0.92);
            border: 2px solid rgba(0, 0, 0, 0.08);
            border-radius: 18px;
            padding: 1rem;
            box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
        }

        .membership-card h3 {
            font-size: 1.02rem;
            font-weight: 900;
            color: var(--text-dark);
        }

        .membership-price {
            margin-top: 0.45rem;
            font-weight: 900;
            color: var(--primary-dark);
            font-size: 1rem;
        }

        .membership-desc {
            margin-top: 0.45rem;
            color: var(--text-light);
            font-size: 0.9rem;
            font-weight: 700;
            line-height: 1.4;
        }

        .membership-cta {
            margin-top: 0.7rem;
            border: none;
            border-radius: 12px;
            cursor: pointer;
            padding: 0.62rem 0.75rem;
            width: 100%;
            color: #fff;
            font-weight: 900;
            background: linear-gradient(135deg, #f59e0b, #ec4899);
        }

        /* Membership checkout modal */
        .membership-checkout-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.82);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .membership-checkout-modal.active {
            display: flex;
        }

        .membership-checkout-container {
            width: 100%;
            max-width: 560px;
            background: #fff;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
        }

        .membership-checkout-header {
            background: linear-gradient(135deg, #f59e0b 0%, #ec4899 100%);
            color: #fff;
            padding: 1rem 1.2rem;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 0.75rem;
        }

        .membership-checkout-header h3 {
            margin: 0;
            font-size: 1.05rem;
            font-weight: 900;
            letter-spacing: 0.2px;
        }

        .membership-checkout-close {
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #fff;
            cursor: pointer;
            border-radius: 12px;
            padding: 0.45rem 0.65rem;
            font-weight: 900;
        }

        .membership-checkout-body {
            padding: 1rem 1.2rem 1.2rem;
        }

        .membership-checkout-plan {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 0.75rem;
            padding: 0.9rem;
            border-radius: 16px;
            border: 2px solid rgba(0, 0, 0, 0.08);
            background: linear-gradient(180deg, rgba(245, 158, 11, 0.08) 0%, rgba(236, 72, 153, 0.06) 100%);
            margin-bottom: 0.9rem;
        }

        .membership-checkout-plan-name {
            font-weight: 900;
            color: var(--text-dark);
            font-size: 1rem;
        }

        .membership-checkout-plan-desc {
            margin-top: 0.25rem;
            color: var(--text-light);
            font-weight: 700;
            font-size: 0.9rem;
            line-height: 1.35;
        }

        .membership-checkout-plan-price {
            font-weight: 900;
            color: var(--primary-dark);
            white-space: nowrap;
        }

        .membership-checkout-note {
            font-size: 0.85rem;
            color: var(--text-light);
            font-weight: 700;
            margin: 0.2rem 0 0.85rem;
            text-align: center;
        }

        .membership-checkout-login {
            display: none;
            border: 2px dashed rgba(0, 0, 0, 0.15);
            background: rgba(0, 0, 0, 0.02);
            padding: 0.9rem;
            border-radius: 16px;
            margin-bottom: 0.9rem;
            text-align: center;
        }

        .membership-checkout-login p {
            margin: 0 0 0.75rem;
            color: var(--text-light);
            font-weight: 800;
        }

        .membership-checkout-login button {
            border: none;
            cursor: pointer;
            border-radius: 14px;
            padding: 0.7rem 0.9rem;
            color: #fff;
            font-weight: 900;
            background: linear-gradient(135deg, #3b82f6 0%, #06b6d4 100%);
        }

        .membership-checkout-terms {
            display: flex;
            align-items: flex-start;
            gap: 0.6rem;
            padding: 0.75rem 0.9rem;
            border-radius: 14px;
            background: rgba(0, 0, 0, 0.03);
            margin: 0.75rem 0 0.9rem;
            font-size: 0.84rem;
            color: var(--text-light);
            font-weight: 700;
        }

        .membership-checkout-terms input {
            margin-top: 0.2rem;
        }

        .membership-checkout-status {
            margin-top: 0.65rem;
            font-size: 0.9rem;
            font-weight: 800;
            text-align: center;
            color: var(--text-light);
        }

        /* Quiz modal */
        .quiz-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0, 0, 0, 0.82);
            z-index: 10000;
            align-items: center;
            justify-content: center;
            padding: 1rem;
        }

        .quiz-modal.active {
            display: flex;
        }

        .quiz-container {
            width: 100%;
            max-width: 720px;
            background: #fff;
            border-radius: 18px;
            overflow: hidden;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
        }

        .quiz-header {
            background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
            color: #fff;
            padding: 1rem 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
        }

        .quiz-header h3 {
            font-size: 1.05rem;
            font-weight: 900;
        }

        .quiz-close {
            width: 38px;
            height: 38px;
            border-radius: 999px;
            border: none;
            background: rgba(255, 255, 255, 0.18);
            color: #fff;
            cursor: pointer;
        }

        .quiz-body {
            padding: 1.2rem;
        }

        .quiz-q {
            font-size: 1.05rem;
            font-weight: 900;
            color: var(--text-dark);
            margin-bottom: 0.9rem;
        }

        .quiz-options {
            display: grid;
            gap: 0.6rem;
        }

        .quiz-option {
            border: 2px solid rgba(0, 0, 0, 0.08);
            border-radius: 14px;
            padding: 0.75rem 0.85rem;
            cursor: pointer;
            font-weight: 850;
            background: rgba(255, 255, 255, 0.85);
            transition: transform 0.12s, border-color 0.12s, background 0.12s;
        }

        .quiz-option:hover {
            transform: translateY(-1px);
            border-color: rgba(59, 130, 246, 0.35);
            background: rgba(59, 130, 246, 0.06);
        }

        .quiz-option.selected {
            border-color: rgba(16, 185, 129, 0.55);
            background: rgba(16, 185, 129, 0.08);
        }

        .quiz-option.correct {
            border-color: rgba(16, 185, 129, 0.85);
            background: rgba(16, 185, 129, 0.14);
        }

        .quiz-option.wrong {
            border-color: rgba(239, 68, 68, 0.8);
            background: rgba(239, 68, 68, 0.12);
        }

        .quiz-option.locked {
            cursor: default;
        }

        .quiz-feedback {
            margin-top: 0.75rem;
            min-height: 1.25rem;
            font-size: 0.9rem;
            font-weight: 850;
            color: var(--text-light);
        }

        .quiz-feedback.good {
            color: #059669;
        }

        .quiz-feedback.bad {
            color: #dc2626;
        }

        .quiz-footer {
            padding: 1rem 1.2rem;
            display: flex;
            justify-content: space-between;
            align-items: center;
            gap: 0.75rem;
            border-top: 1px solid rgba(0, 0, 0, 0.08);
            background: rgba(249, 250, 251, 0.9);
        }

        .quiz-progress {
            font-weight: 900;
            color: rgba(31, 41, 55, 0.85);
        }

        .quiz-next {
            border: none;
            cursor: pointer;
            border-radius: 14px;
            padding: 0.75rem 1rem;
            font-weight: 950;
            background: linear-gradient(135deg, #10b981, #3b82f6);
            color: #fff;
        }

        @media (max-width: 768px) {
            .cookie-banner {
                padding: 0.85rem 1rem;
            }

            .cookie-content {
                gap: 0.75rem;
                align-items: flex-start;
                text-align: left;
            }

            .cookie-text {
                min-width: 0;
            }

            .cookie-text h4 {
                font-size: 1rem;
                margin-bottom: 0.25rem;
            }

            .cookie-text p {
                font-size: 0.82rem;
                line-height: 1.35;
            }

            .cookie-buttons {
                justify-content: stretch;
                width: 100%;
                gap: 0.5rem;
                flex-wrap: nowrap;
            }

            .cookie-btn {
                flex: 1 1 0;
                padding: 0.6rem 0.75rem;
            }
        }
