:root {
    --brand: #6366f1;
    --brand-light: #e0e7ff;
    --brand-dark: #4f46e5;
    --accent: #ec4899;
    --success: #10b981;
    --danger: #ef4444;
    --dark: #0f172a;
    --gray: #64748b;
    --white: #ffffff;
    --shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.15);
    --shadow-sm: 0 4px 15px -3px rgba(0, 0, 0, 0.1);
}

* { box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; margin: 0; }
body { 
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%); 
    color: var(--dark); 
    overflow-x: hidden;
    min-height: 100vh;
}

/* Sidebar */
.sidebar { 
    width: 280px; 
    background: linear-gradient(180deg, var(--white) 0%, #fafbff 100%);
    border-right: 1px solid #e2e8f0; 
    padding: 2.5rem 1.5rem; 
    display: flex; 
    flex-direction: column; 
    position: fixed; 
    height: 100vh; 
    z-index: 1000;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}

.sidebar-logo { 
    font-size: 1.8rem; 
    font-weight: 900; 
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 3rem; 
    display: flex; 
    align-items: center; 
    gap: 12px;
}

.sidebar-logo i { -webkit-text-fill-color: var(--brand); }

.side-nav { display: flex; flex-direction: column; gap: 8px; flex-grow: 1; }

.nav-item { 
    border: none; 
    background: none; 
    padding: 14px 18px; 
    border-radius: 12px; 
    text-align: left; 
    cursor: pointer; 
    color: var(--gray); 
    font-weight: 600; 
    transition: 0.3s ease; 
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-item:hover { 
    background: var(--brand-light); 
    color: var(--brand);
    transform: translateX(5px);
}

.nav-item.active { 
    background: linear-gradient(135deg, var(--brand-light) 0%, #ddd6fe 100%); 
    color: var(--brand);
    font-weight: 700;
}

.sidebar-footer { 
    font-weight: 700; 
    color: var(--brand); 
    text-align: center; 
    padding-top: 1.5rem; 
    border-top: 2px solid #f8fafc;
    font-size: 0.9rem;
}

/* Main Area */
.main-content { 
    flex: 1; 
    margin-left: 280px; 
    padding: 2.5rem 4rem; 
    transition: 0.3s;
}

/* Top Bar */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    gap: 20px;
}

.search-box {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    padding: 12px 18px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    border: 2px solid transparent;
    transition: 0.3s;
}

.search-box:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box input {
    border: none;
    outline: none;
    background: none;
    flex: 1;
    font-size: 1rem;
    color: var(--dark);
}

.search-box input::placeholder {
    color: var(--gray);
}

.search-box i {
    color: var(--brand);
    font-size: 1.2rem;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .main-content { padding: 2rem 2rem; }
    .search-box { width: 100%; max-width: none; }
}

@media (max-width: 768px) {
    /* Hide sidebar on tablet and mobile, show as top nav */
    .sidebar { 
        width: 100%; 
        height: auto; 
        position: static; 
        padding: 1.5rem; 
        flex-direction: row; 
        justify-content: space-between; 
        align-items: center; 
        border-right: none; 
        border-bottom: 1px solid #e2e8f0; 
    }
    
    .sidebar-logo { 
        margin-bottom: 0; 
        font-size: 1.4rem; 
    }
    
    .side-nav { 
        flex-direction: row; 
        gap: 4px; 
        flex-grow: 0; 
        flex-wrap: wrap; 
    }
    
    .nav-item { 
        padding: 10px 12px; 
        font-size: 0.85rem; 
    }
    
    .nav-item i { 
        margin-right: 4px; 
    }
    
    .sidebar-footer { 
        display: none; 
    }
    
    .main-content { 
        margin-left: 0; 
        padding: 1.5rem; 
    }
    
    .top-bar { 
        flex-direction: column; 
        gap: 1rem; 
        margin-bottom: 2rem; 
    }
    
    .search-box { 
        width: 100%; 
        max-width: none; 
    }
    
    .user-profile { 
        width: 100%; 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
    }
}

@media (max-width: 480px) {
    .main-content { 
        padding: 1rem; 
    }
    
    .sidebar { 
        padding: 1rem; 
    }
    
    .sidebar-logo { 
        font-size: 1.2rem; 
    }
    
    .nav-item { 
        padding: 8px 10px; 
        font-size: 0.75rem; 
    }
    
    .hero-card { 
        padding: 2rem 1.5rem; 
        flex-direction: column; 
        text-align: center; 
    }
    
    .hero-text h1 { 
        font-size: 1.8rem; 
    }
    
    .hero-img { 
        font-size: 3rem; 
        margin-top: 1rem; 
    }
    
    .search-box { 
        padding: 10px 16px; 
    }
    
    .top-bar span { 
        display: none; 
    }
}
.top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3rem; }
.search-box { background: white; padding: 12px 24px; border-radius: 16px; border: 1px solid #e2e8f0; width: 350px; display: flex; align-items: center; gap: 12px; box-shadow: var(--shadow); }
.search-box input { border: none; outline: none; width: 100%; font-size: 0.95rem; }

/* Hero Section */
.hero-card { 
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    border-radius: 20px; 
    padding: 4rem; 
    color: white; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    box-shadow: 0 25px 50px rgba(99, 102, 241, 0.25);
    margin-bottom: 3rem;
    position: relative;
    overflow: hidden;
}

.hero-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.hero-text {
    position: relative;
    z-index: 1;
    flex: 1;
}

.hero-text h1 { 
    font-size: 3rem; 
    margin-bottom: 1rem;
    font-weight: 900;
    letter-spacing: -1px;
}

.hero-text p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.hero-img {
    font-size: 8rem;
    position: relative;
    z-index: 1;
}

.primary-btn { 
    background: white; 
    color: var(--brand); 
    border: none; 
    padding: 15px 35px; 
    border-radius: 12px; 
    font-weight: 800; 
    cursor: pointer; 
    transition: 0.3s ease;
    font-size: 1rem;
}

.primary-btn:hover { 
    transform: translateY(-2px); 
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

/* Dashboard Stats Section */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin: 4rem 0 3rem 0;
}

.stat-card {
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    padding: 2rem;
    border-radius: 18px;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: start;
    gap: 18px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.stat-card:hover {
    transform: translateY(-8px);
    border-color: var(--brand);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.15);
}

.stat-icon {
    font-size: 2.5rem;
    min-width: 60px;
    text-align: center;
}

.stat-content h3 {
    color: var(--dark);
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 8px;
}

.stat-content p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Dashboard Section */
.dashboard-section {
    margin: 4rem 0;
}

.dashboard-section h2 {
    font-size: 2rem;
    color: var(--dark);
    font-weight: 900;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Quick Access */
.quick-access {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
}

.quick-btn {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    border: none;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

.quick-icon {
    font-size: 2.5rem;
}

.quick-btn:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.3);
}

/* Games Preview */
.games-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 22px;
}

.game-card-preview {
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    padding: 2.5rem 2rem;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    text-align: center;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.game-card-preview:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 25px 45px rgba(236, 72, 153, 0.15);
}

.game-preview-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.game-card-preview h3 {
    color: var(--dark);
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
}

.game-card-preview p {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.4;
}

.preview-btn {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    width: 100%;
}

.preview-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.25);
}

/* Features Grid */
.dashboard-features {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    padding: 4rem;
    border-radius: 24px;
    color: white;
    margin-top: 4rem;
}

.dashboard-features h2 {
    color: white;
    margin-bottom: 3rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.feature-item {
    text-align: center;
}

.feature-emoji {
    font-size: 3.5rem;
    display: block;
    margin-bottom: 1rem;
}

.feature-item h4 {
    font-size: 1.3rem;
    font-weight: 900;
    margin-bottom: 0.8rem;
}

.feature-item p {
    font-size: 0.95rem;
    opacity: 0.95;
    line-height: 1.5;
}

@media (max-width: 768px) {
    .hero-card { 
        padding: 2.5rem 1.5rem; 
        flex-direction: column; 
        text-align: center; 
    }
    
    .hero-text h1 { 
        font-size: 2rem; 
    }
    
    .hero-text p { 
        font-size: 1rem; 
    }
}

/* Learning Grid & Cards */
.curriculum-header {
    text-align: center;
    margin-bottom: 4rem;
}

.curriculum-header h2 {
    font-size: 2.8rem;
    color: var(--dark);
    font-weight: 900;
    margin-bottom: 1rem;
}

.curriculum-header p {
    font-size: 1.2rem;
    color: var(--gray);
}

/* Category Selector */
.category-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 4rem;
}

.category-card {
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    padding: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
    box-shadow: var(--shadow-sm);
}

.category-card:hover {
    transform: translateY(-10px);
    border-color: var(--brand);
    box-shadow: 0 25px 45px rgba(99, 102, 241, 0.15);
}

.category-icon {
    font-size: 3.5rem;
    min-width: 70px;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-info h3 {
    color: var(--dark);
    font-size: 1.5rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.category-info p {
    color: var(--gray);
    font-size: 0.95rem;
    margin-bottom: 0.8rem;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
}

/* Learning Section */
.learning-section {
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    padding: 3rem;
    box-shadow: var(--shadow);
}

.learning-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid #e2e8f0;
}

.learning-info h3 {
    color: var(--dark);
    font-size: 1.8rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
}

.learning-info p {
    color: var(--gray);
    font-size: 0.95rem;
}

.learning-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    background: linear-gradient(135deg, var(--brand-light), #ddd6fe);
    border: none;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.3rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.learning-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); 
    gap: 20px;
}

.vocab-card { 
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    padding: 3rem 1.8rem; 
    border-radius: 16px; 
    text-align: center; 
    border: 2px solid #e2e8f0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); 
    cursor: pointer; 
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.vocab-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.vocab-card:hover::before {
    opacity: 1;
}

.vocab-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    transition: left 0.6s;
}

.vocab-card:hover::after {
    left: 100%;
}

.vocab-card:hover { 
    transform: translateY(-15px) scale(1.03);
    border-color: var(--brand);
    box-shadow: 0 30px 50px rgba(99, 102, 241, 0.2);
}

.vocab-card h3 { 
    font-size: 2.8rem; 
    color: var(--brand); 
    margin-bottom: 15px; 
    font-weight: 900;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
}

.vocab-card p { 
    color: var(--gray); 
    font-weight: 700; 
    font-size: 0.95rem;
    line-height: 1.6;
    position: relative;
    z-index: 1;
    margin: 0;
}

.vocab-card p:nth-of-type(2) {
    color: var(--brand);
    font-weight: 800;
    font-size: 0.9rem;
}

.vocab-card p:nth-of-type(3) {
    color: #d97706;
    font-weight: 700;
    margin-top: 12px;
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .curriculum-header h2 {
        font-size: 2rem;
    }

    .category-selector {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 15px;
        margin-bottom: 2.5rem;
    }

    .category-card {
        padding: 1.5rem;
        flex-direction: column;
        text-align: center;
    }

    .category-icon {
        font-size: 2.5rem;
    }

    .learning-section {
        padding: 2rem;
    }

    .learning-toolbar {
        flex-direction: column;
        gap: 1.5rem;
    }

    .learning-grid { 
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); 
        gap: 15px;
    }
    
    .vocab-card { 
        padding: 2rem 1.2rem;
        min-height: 180px;
    }

    .vocab-card h3 {
        font-size: 2rem;
    }

    .vocab-card h3 { 
        font-size: 1.8rem; 
    }
}

@media (max-width: 480px) {
    .learning-grid { 
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); 
        gap: 12px; 
    }
    
    .vocab-card { 
        padding: 1rem 0.8rem; 
    }
    
    .vocab-card h3 { 
        font-size: 1.4rem; 
    }
    
    .vocab-card p { 
        font-size: 0.7rem; 
    }
}

/* Contact Section UI */
.contact-card { 
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    max-width: 650px; 
    margin: 3rem auto; 
    border-radius: 24px; 
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 2px solid #e2e8f0;
}

.contact-header { 
    background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
    color: white; 
    padding: 3rem; 
    text-align: center;
    position: relative;
}

.contact-header i { 
    font-size: 3.5rem; 
    margin-bottom: 1rem;
    opacity: 0.9;
}

.contact-header h2 {
    font-size: 2rem;
    font-weight: 900;
}

.contact-body { 
    padding: 3rem;
}

.info-tag { 
    text-align: center; 
    margin-bottom: 2rem; 
    font-weight: 800; 
    color: var(--brand); 
    font-size: 1.1rem;
    background: var(--brand-light);
    padding: 15px;
    border-radius: 12px;
}

.contact-form { 
    display: flex; 
    flex-direction: column; 
    gap: 18px;
}

.contact-form input, 
.contact-form textarea { 
    padding: 16px; 
    border-radius: 12px; 
    border: 2px solid #e2e8f0;
    outline: none; 
    background: var(--white);
    font-size: 1rem; 
    transition: 0.3s ease;
    color: var(--dark);
}

.contact-form textarea { 
    height: 150px; 
    resize: none;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

.contact-form input:focus, 
.contact-form textarea:focus { 
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.send-btn { 
    background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
    color: white; 
    border: none; 
    padding: 18px; 
    border-radius: 12px; 
    font-weight: 800; 
    cursor: pointer; 
    transition: all 0.3s ease;
    font-size: 1rem;
}

.send-btn:hover { 
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(99, 102, 241, 0.3);
}

@media (max-width: 768px) {
    .contact-card { 
        margin: 2rem 1rem; 
        border-radius: 20px; 
    }
    
    .contact-header { 
        padding: 2rem 1.5rem; 
    }
    
    .contact-body { 
        padding: 2rem 1.5rem; 
    }
    
    .contact-header i { 
        font-size: 2.2rem; 
    }
}

/* Quiz Styles */
.quiz-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.quiz-header h2 {
    font-size: 2.8rem;
    color: var(--dark);
    font-weight: 900;
    margin-bottom: 1rem;
}

.quiz-header p {
    font-size: 1.2rem;
    color: var(--gray);
}

.quiz-container { 
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 30px;
    margin-top: 2rem;
}

.quiz-card { 
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    padding: 3.5rem; 
    border-radius: 24px; 
    width: 100%;
    box-shadow: var(--shadow);
    border: 2px solid #e2e8f0;
    position: relative;
}

.quiz-progress {
    margin-bottom: 3rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    width: 10%;
    background: linear-gradient(90deg, var(--brand), var(--accent));
    border-radius: 10px;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 700;
}

.quiz-content {
    margin-bottom: 2.5rem;
    text-align: left;
}

.quiz-question {
    font-size: 1.6rem;
    color: var(--dark);
    font-weight: 900;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.quiz-instruction {
    color: var(--gray);
    font-size: 0.95rem;
    font-weight: 600;
}

.quiz-options { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 18px; 
    margin-bottom: 2rem;
}

.option { 
    padding: 20px 18px; 
    border: 2px solid #e2e8f0; 
    border-radius: 14px; 
    cursor: pointer; 
    font-weight: 700;
    transition: all 0.3s ease;
    background: var(--white);
    color: var(--dark);
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.option::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.5s;
}

.option:hover::before {
    left: 100%;
}

.option:hover { 
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-light);
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(99, 102, 241, 0.15);
}

.option.correct { 
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white; 
    border-color: var(--success);
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.35);
    animation: correctPulse 0.6s ease;
}

.option.wrong { 
    background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
    color: white; 
    border-color: var(--danger);
    box-shadow: 0 15px 35px rgba(239, 68, 68, 0.35);
    animation: wrongShake 0.5s ease;
}

@keyframes correctPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes wrongShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.quiz-feedback {
    min-height: 40px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.quiz-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.quiz-btn {
    background: linear-gradient(135deg, var(--brand), var(--brand-dark));
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

.quiz-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
}

/* Quiz Stats */
.quiz-stats {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.stat {
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    border: 2px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.8rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand);
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Quiz Responsive Design */
@media (max-width: 1024px) {
    .quiz-container {
        grid-template-columns: 1fr;
    }
    
    .quiz-stats {
        flex-direction: row;
        justify-content: space-around;
    }
    
    .stat {
        flex: 1;
        min-width: 120px;
    }
}

@media (max-width: 768px) {
    .quiz-header h2 {
        font-size: 2rem;
    }
    
    .quiz-card {
        padding: 2.5rem 2rem;
    }
    
    .quiz-question {
        font-size: 1.3rem;
    }
    
    .quiz-options {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .option {
        padding: 16px 14px;
        min-height: 50px;
        font-size: 0.95rem;
    }
    
    .quiz-container {
        grid-template-columns: 1fr;
    }
    
    .quiz-stats {
        flex-direction: row;
        gap: 12px;
        justify-content: space-between;
    }
    
    .stat {
        flex: 1;
        padding: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .stat-label {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .quiz-header h2 {
        font-size: 1.6rem;
    }
    
    .quiz-card {
        padding: 1.5rem 1rem;
    }
    
    .quiz-question {
        font-size: 1.1rem;
    }
    
    .quiz-instruction {
        font-size: 0.85rem;
    }
    
    .option {
        padding: 14px 10px;
        min-height: 45px;
        font-size: 0.85rem;
    }
    
    .quiz-stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .stat {
        padding: 1rem;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .quiz-btn {
        padding: 12px 20px;
        font-size: 0.9rem;
        width: 100%;
        justify-content: center;
    }
    
    .progress-text {
        font-size: 0.8rem;
    }
}

@media (max-width: 768px) {
    .quiz-card { 
        padding: 2rem 1.5rem; 
        margin: 1rem; 
    }
    
    .quiz-options { 
        gap: 12px; 
        margin-top: 1.5rem; 
    }
    
    .option { 
        padding: 15px 12px; 
        font-size: 0.95rem; 
    }
}

@media (max-width: 480px) {
    .quiz-card { 
        padding: 1.5rem 1rem; 
        margin: 0.5rem; 
    }
    
    .quiz-card h2 { 
        font-size: 1.3rem; 
    }
    
    .quiz-options { 
        grid-template-columns: 1fr; 
        gap: 10px; 
    }
    
    .option { 
        padding: 12px 10px; 
        font-size: 0.9rem; 
    }
}

/* General Utilities */
.tab-content { display: none; }
.tab-content.active { display: block; animation: slideIn 0.5s ease; }
@keyframes slideIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.chips { display: flex; gap: 12px; margin-top: 1.5rem; flex-wrap: wrap; }
.chip-btn { padding: 12px 24px; border-radius: 14px; border: 2px solid var(--brand-light); background: white; color: var(--brand); cursor: pointer; font-weight: 700; transition: 0.3s; }
.chip-btn:hover { background: var(--brand); color: white; border-color: var(--brand); }

@media (max-width: 768px) {
    .chips { 
        gap: 8px; 
    }
    
    .chip-btn { 
        padding: 10px 16px; 
        font-size: 0.9rem; 
    }
}

@media (max-width: 480px) {
    .chip-btn { 
        padding: 8px 12px; 
        font-size: 0.8rem; 
    }
}
/* --- Game Zone Styles (Updated) --- */
.memory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    max-width: 600px;
    margin: 2rem auto;
}

.memory-card {
    height: 100px;
    background: var(--brand);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    text-align: center;
    padding: 10px;
    transition: transform 0.4s, background-color 0.3s;
    user-select: none;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@media (max-width: 768px) {
    .memory-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 12px;
        max-width: 100%;
    }
    
    .memory-card {
        height: 85px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .memory-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .memory-card {
        height: 70px;
        font-size: 0.7rem;
        padding: 8px;
    }
}

.memory-card.flipped {
    background: white;
    color: var(--brand);
    border: 2px solid var(--brand);
    transform: rotateY(180px);
}

.memory-card.matched {
    background: var(--success);
    color: white;
    border-color: var(--success);
    cursor: default;
    opacity: 0.8;
}

.game-area h2 { 
    text-align: center; 
    color: var(--dark);
    font-size: 2.5rem;
    font-weight: 900;
    margin-bottom: 2rem;
}

.game-area p { 
    text-align: center; 
    color: var(--gray); 
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

/* Game Menu */
.game-menu {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 18px;
    margin-bottom: 35px;
}

.game-btn {
    padding: 18px 24px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
    position: relative;
    overflow: hidden;
}

.game-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.2);
    transition: left 0.3s;
}

.game-btn:hover::before {
    left: 100%;
}

.game-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
}

/* Game Container */
#game-container {
    background: linear-gradient(135deg, var(--white) 0%, #fafbff 100%);
    padding: 35px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    border: 2px solid #e2e8f0;
    min-height: 300px;
}

#game-container h3 {
    color: var(--dark);
    margin-bottom: 15px;
    font-size: 1.8rem;
    font-weight: 900;
}

#game-container p {
    color: var(--gray);
    margin-bottom: 1.5rem;
}

/* Spelling Game */
.spelling-game {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.spelling-question {
    font-size: 1.3rem;
    padding: 20px;
    background: linear-gradient(135deg, var(--brand-light) 0%, #ddd6fe 100%);
    border-radius: 14px;
    text-align: center;
    font-weight: 700;
    color: var(--brand);
}

#spelling-input {
    padding: 16px;
    font-size: 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
    transition: 0.3s ease;
    background: var(--white);
}

#spelling-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

#spelling-feedback {
    text-align: center;
    font-weight: 700;
    min-height: 30px;
    font-size: 1.1rem;
}

/* Flashcard Game */
.flashcard {
    perspective: 1000px;
    margin: 30px 0;
}

.flashcard-front, .flashcard-back {
    padding: 50px 40px;
    text-align: center;
    border-radius: 16px;
    font-size: 2rem;
    background: linear-gradient(135deg, var(--brand-light), #ddd6fe);
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: var(--brand);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.15);
}

.flashcard-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 25px;
    flex-wrap: wrap;
}

.game-action-btn {
    padding: 14px 30px;
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.2);
}

.game-action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.3);
}

/* Color Match */
.color-match-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 25px;
    margin-top: 25px;
}

.color-match-item {
    text-align: center;
}

.color-box-clickable {
    transition: all 0.3s ease !important;
    cursor: pointer !important;
}

.color-box-clickable:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 15px 35px rgba(0,0,0,0.25) !important;
}

.color-name-btn {
    transition: all 0.3s ease !important;
}

.color-name-btn:hover {
    transform: translateX(5px) !important;
}

.color-match-item p {
    font-weight: 700;
    color: var(--brand);
    font-size: 1.1rem;
    margin-top: 12px;
}

/* Number Guess */
.number-guess-game {
    text-align: center;
}

.guess-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
}

.guess-btn {
    padding: 20px 25px;
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--brand-light), #ddd6fe);
    border: 2px solid var(--brand);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--brand);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.1);
}

.guess-btn:hover {
    background: linear-gradient(135deg, var(--brand), var(--accent));
    color: white;
    border-color: var(--accent);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(99, 102, 241, 0.25);
}

#guess-feedback {
    margin-top: 25px;
    min-height: 35px;
    font-size: 1.2rem;
    font-weight: 700;
}

.vocab-card h3 {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand);
    margin-bottom: 12px;
    letter-spacing: -1px;
}

.vocab-card p {
    color: var(--dark);
    font-size: 0.95rem;
    margin: 6px 0;
    line-height: 1.4;
}

.hindi-text {
    color: #d97706;
    font-weight: 600;
    font-size: 1rem;
    margin-top: 8px;
}