/* WSpeedRead - Enhanced Styles */
:root {
    --primary: #6366f1;
    --primary-light: #818cf8;
    --primary-dark: #4f46e5;
    --secondary: #10b981;
    --secondary-light: #34d399;
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --danger: #ef4444;
    --bg-dark: #0f0f23;
    --bg-darker: #080815;
    --bg-card: #1a1a2e;
    --bg-card-hover: #252542;
    --bg-input: #16162a;
    --text-primary: #ffffff;
    --text-secondary: #a1a1aa;
    --text-muted: #71717a;
    --border: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(255, 255, 255, 0.15);
    --gradient-1: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    --gradient-2: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    --gradient-3: linear-gradient(135deg, #f59e0b 0%, #ef4444 100%);
    --gradient-4: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);
    --gradient-hero: linear-gradient(180deg, rgba(99, 102, 241, 0.1) 0%, transparent 50%);
    --shadow-sm: 0 4px 20px rgba(0, 0, 0, 0.2);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.4);
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.3);
    --radius: 20px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Tajawal', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    overflow-x: hidden;
    background-image:
        radial-gradient(ellipse at 20% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(168, 85, 247, 0.08) 0%, transparent 50%);
}

/* Selection */
::selection {
    background: var(--primary);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--bg-card-hover);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Loader */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-spinner {
    width: 70px;
    height: 70px;
    margin: 0 auto 25px;
    border: 4px solid var(--bg-card);
    border-top-color: var(--primary);
    border-right-color: var(--secondary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loader h2 {
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 1.1rem;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15, 15, 35, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    transition: var(--transition);
}

.navbar.scrolled {
    background: rgba(15, 15, 35, 0.95);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.4rem;
    font-weight: 700;
    transition: var(--transition);
}

.nav-logo:hover {
    transform: scale(1.02);
}

.logo-icon {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 8px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.15);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-xp {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.95rem;
    animation: pulse-subtle 3s ease-in-out infinite;
}

@keyframes pulse-subtle {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(99, 102, 241, 0.2);
    }
}

.level-badge {
    background: var(--gradient-1);
    padding: 10px 18px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 26px;
    height: 3px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    padding: 140px 30px 80px;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
}

.floating-shapes {
    position: absolute;
    inset: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.4;
}

.shape-1 {
    width: 500px;
    height: 500px;
    background: var(--primary);
    top: 5%;
    right: 5%;
    animation: float1 25s ease-in-out infinite;
}

.shape-2 {
    width: 400px;
    height: 400px;
    background: var(--secondary);
    bottom: 10%;
    left: 5%;
    animation: float2 20s ease-in-out infinite;
}

@keyframes float1 {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(50px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-30px, 30px) scale(0.95);
    }
}

@keyframes float2 {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    50% {
        transform: translate(40px, -40px) rotate(10deg);
    }
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    z-index: 1;
}

.hero-content {
    max-width: 750px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 12px 24px;
    border-radius: 50px;
    font-weight: 500;
    margin-bottom: 35px;
    animation: fadeInUp 0.8s ease;
}

.hero-badge span:first-child {
    font-size: 1.3rem;
}

.hero-title {
    font-size: clamp(2.8rem, 7vw, 4.5rem);
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 30px;
    animation: fadeInUp 0.8s ease 0.1s both;
}

.gradient-text {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.35rem;
    color: var(--text-secondary);
    margin-bottom: 45px;
    max-width: 550px;
    line-height: 1.8;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.hero-stats {
    display: flex;
    gap: 50px;
    margin-bottom: 50px;
    animation: fadeInUp 0.8s ease 0.3s both;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.hero-cta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    animation: fadeInUp 0.8s ease 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: var(--transition);
}

.btn:hover::before {
    opacity: 1;
}

.btn-primary {
    background: var(--gradient-1);
    color: white;
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--border-hover);
}

/* Sections */
.section-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 30px;
}

.section-header {
    text-align: center;
    margin-bottom: 70px;
}

.section-badge {
    display: inline-block;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--primary-light);
    padding: 10px 24px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.section-header h2 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 18px;
    background: linear-gradient(135deg, var(--text-primary), var(--text-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Features */
.features-section {
    padding: 120px 0;
    background: linear-gradient(180deg, var(--bg-dark) 0%, rgba(26, 26, 46, 0.5) 100%);
    position: relative;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 28px;
}

.feature-card {
    background: linear-gradient(180deg, var(--bg-card), rgba(26, 26, 46, 0.5));
    padding: 40px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-1);
    transform: scaleX(0);
    transform-origin: left;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    border-color: rgba(99, 102, 241, 0.4);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.feature-card:hover::before {
    transform: scaleX(1);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 25px;
    display: block;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.feature-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
}

/* Exercises */
.exercises-section {
    padding: 120px 0;
    position: relative;
}

/* Search and Filter Controls */
.exercises-controls {
    margin-bottom: 30px;
}

.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto 20px;
}

.search-box .search-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    opacity: 0.6;
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 16px 50px 16px 45px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.search-box input::placeholder {
    color: var(--text-muted);
}

.clear-search {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-card-hover);
    border: none;
    color: var(--text-secondary);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.clear-search:hover {
    background: var(--danger);
    color: white;
}

.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    border-color: var(--primary-light);
    color: var(--text-primary);
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
}

.filter-btn span:first-child {
    font-size: 1.1rem;
}

.exercises-count {
    text-align: center;
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-size: 1rem;
}

.exercises-count strong {
    color: var(--primary-light);
}

.no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 2px dashed var(--border);
}

.no-results-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-results p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    margin-bottom: 20px;
}

/* Responsive filters */
@media (max-width: 768px) {
    .category-filters {
        gap: 8px;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 10px;
        -webkit-overflow-scrolling: touch;
    }
    
    .filter-btn {
        padding: 8px 12px;
        font-size: 0.85rem;
        white-space: nowrap;
        flex-shrink: 0;
    }
    
    .filter-btn span:first-child {
        font-size: 1rem;
    }
    
    .search-box input {
        padding: 14px 45px 14px 40px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .exercises-controls {
        gap: 10px;
    }
    
    .category-filters {
        gap: 6px;
    }
    
    .filter-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
    
    .search-box input {
        padding: 12px 40px 12px 35px;
        font-size: 0.95rem;
    }
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
    gap: 28px;
}

.exercise-card {
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.exercise-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-1);
    opacity: 0;
    transition: var(--transition);
    z-index: 0;
}

.exercise-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.exercise-card:hover::after {
    opacity: 0.05;
}

.exercise-card>* {
    position: relative;
    z-index: 1;
}

.exercise-card.featured {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), var(--bg-card));
}

.exercise-card.featured::before {
    content: '⭐';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
    opacity: 0.7;
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
}

.exercise-icon {
    font-size: 3rem;
    filter: drop-shadow(0 5px 15px rgba(0, 0, 0, 0.3));
}

.exercise-badge {
    background: var(--gradient-2);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.exercise-badge.intermediate {
    background: var(--gradient-1);
}

.exercise-badge.advanced {
    background: var(--gradient-3);
}

.exercise-badge.game {
    background: var(--gradient-4);
}

.exercise-card.game-card {
    border-color: rgba(236, 72, 153, 0.4);
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.08), var(--bg-card));
}

.exercise-card.game-card::before {
    content: '🎮';
    position: absolute;
    top: 15px;
    left: 15px;
    font-size: 1.2rem;
    opacity: 0.7;
}

.exercise-card h3 {
    font-size: 1.4rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.exercise-card p {
    color: var(--text-secondary);
    margin-bottom: 25px;
    line-height: 1.6;
}

.exercise-meta {
    display: flex;
    gap: 25px;
    margin-bottom: 25px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.exercise-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-exercise {
    width: 100%;
    background: var(--gradient-1);
    color: white;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.btn-exercise:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.4);
}

/* Stats Dashboard */
.stats-section {
    padding: 120px 0;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.5) 0%, var(--bg-dark) 100%);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 25px;
}

.dashboard-card {
    background: var(--bg-card);
    padding: 35px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.dashboard-card:hover {
    border-color: var(--border-hover);
}

.dashboard-card h3 {
    font-size: 1.15rem;
    margin-bottom: 25px;
    color: var(--text-secondary);
    font-weight: 500;
}

.stats-overview {
    grid-column: span 12;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}

.stat-box {
    text-align: center;
    padding: 30px 20px;
    background: linear-gradient(180deg, var(--bg-dark), rgba(8, 8, 21, 0.5));
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.stat-box:hover {
    border-color: var(--primary);
    transform: translateY(-3px);
}

.stat-box span:first-child {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 15px;
}

.stat-num {
    font-size: 2.2rem;
    font-weight: 800;
    display: block;
    margin-bottom: 8px;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-box span:last-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.chart-card {
    grid-column: span 8;
    min-height: 350px;
}

.chart-card canvas {
    width: 100% !important;
    height: 280px !important;
}

.level-card {
    grid-column: span 4;
}

.level-display {
    text-align: center;
    padding: 20px 0;
}

.level-num {
    font-size: 5rem;
    font-weight: 800;
    display: block;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 10px;
    text-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
}

.level-progress-bar {
    height: 14px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
    margin: 25px 0;
    position: relative;
}

.level-fill {
    height: 100%;
    background: var(--gradient-1);
    border-radius: 10px;
    transition: width 0.6s ease;
    width: 0%;
    position: relative;
}

.level-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 0;
    }

    50% {
        opacity: 1;
    }
}

.xp-info {
    color: var(--text-muted);
    font-size: 1rem;
}

.badges-card {
    grid-column: span 12;
}

.badges-grid {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px 28px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    opacity: 0.4;
    transition: var(--transition);
    min-width: 100px;
}

.badge-item.unlocked {
    opacity: 1;
    border-color: var(--accent);
    background: linear-gradient(180deg, rgba(245, 158, 11, 0.1), var(--bg-dark));
    animation: badge-glow 3s ease-in-out infinite;
}

@keyframes badge-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
    }

    50% {
        box-shadow: 0 0 20px 5px rgba(245, 158, 11, 0.2);
    }
}

.badge-emoji {
    font-size: 2.5rem;
}

.badge-name {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 45px;
    max-width: 850px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    animation: modalSlide 0.4s ease;
}

@keyframes modalSlide {
    from {
        transform: translateY(30px) scale(0.95);
        opacity: 0;
    }

    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    left: 20px;
    right: auto;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text-primary);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Exercise Modal Content */
.exercise-intro {
    text-align: center;
    margin-bottom: 40px;
}

.exercise-intro h2 {
    font-size: 2.2rem;
    margin-bottom: 15px;
}

.exercise-intro p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.reading-area {
    background: var(--bg-dark);
    padding: 45px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    font-size: 1.35rem;
    line-height: 2.2;
    margin-bottom: 35px;
    min-height: 200px;
}

.reading-area .highlight {
    background: rgba(99, 102, 241, 0.3);
    padding: 3px 8px;
    border-radius: 4px;
}

.word-chunks {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
}

.chunk {
    background: var(--bg-card-hover);
    padding: 18px 28px;
    border-radius: var(--radius-sm);
    font-size: 1.25rem;
    transition: var(--transition);
    opacity: 0;
    transform: scale(0.8);
}

.chunk.visible {
    opacity: 1;
    transform: scale(1);
}

.chunk.highlight {
    background: var(--gradient-1);
    color: white;
}

.timer-display {
    text-align: center;
    margin-bottom: 35px;
}

.timer-value {
    font-size: 4rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.exercise-controls {
    display: flex;
    gap: 18px;
    justify-content: center;
    flex-wrap: wrap;
}

.quiz-section {
    margin-top: 40px;
}

.quiz-question {
    margin-bottom: 30px;
}

.quiz-question h4 {
    margin-bottom: 18px;
    font-size: 1.15rem;
    font-weight: 500;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.quiz-option {
    background: var(--bg-dark);
    padding: 18px 24px;
    border-radius: var(--radius-sm);
    border: 2px solid var(--border);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
}

.quiz-option:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.quiz-option.selected {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.15);
}

.quiz-option.correct {
    border-color: var(--secondary);
    background: rgba(16, 185, 129, 0.15);
}

.quiz-option.wrong {
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.15);
}

/* Results Modal */
.results-modal {
    text-align: center;
    padding: 20px;
}

.duel-modal {
    max-width: 520px;
    width: 92%;
    padding: 28px;
    display: grid;
    gap: 16px;
    color: var(--text-primary);
    min-height: 260px;
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.duel-modal .duel-modal-body {
    display: grid;
    gap: 12px;
}

.duel-modal h3,
.duel-modal p,
.duel-modal label span {
    color: var(--text-primary);
}

.duel-modal input {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
}

.duel-modal label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
}

.duel-modal input {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
}

.duel-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.results-icon {
    font-size: 6rem;
    margin-bottom: 25px;
    animation: bounce 0.6s ease;
}

@keyframes bounce {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

.results-title {
    font-size: 2.5rem;
    margin-bottom: 20px;
    font-weight: 700;
}

.results-stats {
    display: flex;
    justify-content: center;
    gap: 35px;
    margin: 40px 0;
    flex-wrap: wrap;
}

.result-item {
    background: var(--bg-dark);
    padding: 28px 40px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    min-width: 150px;
}

.result-value {
    font-size: 2.5rem;
    font-weight: 800;
    display: block;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.result-label {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.xp-earned {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: var(--gradient-3);
    padding: 18px 40px;
    border-radius: 50px;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 25px 0;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.03);
        box-shadow: 0 10px 40px rgba(245, 158, 11, 0.4);
    }
}

/* Toast */
.toast-container {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.toast {
    background: var(--bg-card);
    padding: 18px 28px;
    border-radius: var(--radius-sm);
    border-right: 4px solid var(--primary);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: toastIn 0.4s ease, toastOut 0.4s ease 2.6s forwards;
    font-weight: 500;
}

.toast.success {
    border-right-color: var(--secondary);
}

.toast.warning {
    border-right-color: var(--accent);
}

.toast.error {
    border-right-color: var(--danger);
}

@keyframes toastIn {
    from {
        transform: translateX(-120%);
        opacity: 0;
    }
}

@keyframes toastOut {
    to {
        transform: translateX(-120%);
        opacity: 0;
    }
}

/* Footer */
.footer {
    padding: 50px 30px;
    text-align: center;
    border-top: 1px solid var(--border);
    background: linear-gradient(180deg, transparent, rgba(8, 8, 21, 0.5));
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
}

.footer p {
    color: var(--text-muted);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 1200px) {
    .chart-card {
        grid-column: span 7;
    }

    .level-card {
        grid-column: span 5;
    }
}

@media (max-width: 1024px) {

    .chart-card,
    .level-card {
        grid-column: span 6;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        right: 0;
        left: 0;
        background: var(--bg-card);
        flex-direction: column;
        padding: 20px;
        gap: 5px;
        border-bottom: 1px solid var(--border);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-toggle {
        display: flex;
    }

    .nav-user {
        display: none;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 30px;
    }

    .hero-cta {
        flex-direction: column;
        width: 100%;
    }

    .hero-cta .btn {
        width: 100%;
        justify-content: center;
    }

    .chart-card,
    .level-card,
    .badges-card {
        grid-column: span 12;
    }

    .section-header h2 {
        font-size: 2.2rem;
    }

    .features-grid,
    .exercises-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 120px 20px 60px;
    }

    .section-container {
        padding: 0 15px;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .modal-content {
        padding: 20px 15px;
        width: 98%;
        max-height: 95vh;
        border-radius: 12px;
    }

    .exercises-grid {
        gap: 15px;
    }

    .exercise-card {
        padding: 20px 15px;
    }

    .exercise-icon {
        font-size: 2.5rem;
    }

    .exercise-name {
        font-size: 1.1rem;
    }

    .exercise-actions {
        flex-direction: column;
        gap: 8px;
    }

    .exercise-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .reading-area {
        padding: 25px;
        font-size: 1.15rem;
    }
}

/* How It Works Section */
.howto-section {
    padding: 120px 0;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0.3) 0%, var(--bg-dark) 100%);
}

.steps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.step-card {
    background: var(--bg-card);
    padding: 40px 35px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: center;
    position: relative;
    transition: var(--transition);
}

.step-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.step-number {
    position: absolute;
    top: -20px;
    right: 50%;
    transform: translateX(50%);
    width: 45px;
    height: 45px;
    background: var(--gradient-1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 800;
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.4);
}

.step-icon {
    font-size: 3.5rem;
    margin: 20px 0 25px;
    display: block;
}

.step-card h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.step-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Challenge Card */
.challenge-card {
    grid-column: span 12;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), var(--bg-card));
    border-color: var(--accent) !important;
}

.challenge-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.challenge-header h3 {
    margin-bottom: 0;
    font-size: 1.3rem;
    color: var(--text-primary);
}

.challenge-timer {
    background: var(--gradient-3);
    padding: 8px 18px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1rem;
    font-family: monospace;
}

.challenge-content {
    padding: 15px 0;
}

.challenge-desc {
    font-size: 1.15rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.challenge-progress {
    margin-bottom: 20px;
}

.challenge-bar {
    height: 14px;
    background: var(--bg-dark);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.challenge-fill {
    height: 100%;
    background: var(--gradient-3);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
}

.challenge-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

.challenge-progress span {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.challenge-reward {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
}

.reward-xp {
    background: var(--gradient-3);
    padding: 6px 14px;
    border-radius: 15px;
    font-weight: 700;
    font-size: 0.95rem;
}

/* Quote Card */
.quote-card {
    grid-column: span 12;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), var(--bg-card));
    text-align: center;
}

.quote-card blockquote {
    padding: 20px 40px;
}

.quote-card blockquote p {
    font-size: 1.4rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 15px;
    line-height: 1.8;
}

.quote-card blockquote cite {
    color: var(--text-muted);
    font-size: 1rem;
    font-style: normal;
}

/* Level Title */
.level-title {
    display: block;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 10px;
}

/* Footer Enhanced */
.footer-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary-light);
}

.copyright {
    font-size: 0.85rem;
    margin-top: 15px;
}

/* Chart Container */
.chart-container {
    position: relative;
    height: 280px;
}

/* Responsive additions */
@media (max-width: 768px) {

    .challenge-card,
    .quote-card {
        grid-column: span 12;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .challenge-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }

    .footer-links {
        flex-wrap: wrap;
        gap: 15px;
    }
}

/* ========================================
   LETTER HUNTER GAME STYLES
======================================== */

.letter-hunter-game {
    text-align: center;
}

.game-header {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.game-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: var(--bg-dark);
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    min-width: 100px;
}

.game-stat .stat-icon {
    font-size: 1.8rem;
}

.game-stat .stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.game-stat .stat-value.danger {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    background-clip: text;
    animation: pulse 0.5s ease infinite;
}

.game-stat .stat-value.hot {
    background: var(--gradient-3);
    -webkit-background-clip: text;
    background-clip: text;
    animation: shake 0.3s ease infinite;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

.game-stat .stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.game-canvas-container {
    position: relative;
    background: var(--bg-darker);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    overflow: hidden;
    margin-bottom: 20px;
}

.game-canvas-container.flash-red {
    animation: flashRed 0.2s ease;
}

@keyframes flashRed {

    0%,
    100% {
        border-color: var(--border);
    }

    50% {
        border-color: var(--danger);
        box-shadow: inset 0 0 50px rgba(239, 68, 68, 0.3);
    }
}

#letterHunterCanvas {
    display: block;
    width: 100%;
}

#explosions {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.letter-explosion {
    position: absolute;
    transform: translate(-50%, -50%);
    animation: explode 0.6s ease forwards;
}

@keyframes explode {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

.explosion-char {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent);
    animation: charBurst 0.3s ease;
}

@keyframes charBurst {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.5);
    }

    100% {
        transform: scale(0);
    }
}

.explosion-particles {
    position: absolute;
    inset: -30px;
}

.particle {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    animation: particle 0.5s ease forwards;
}

.particle:nth-child(1) {
    top: 50%;
    left: 50%;
    animation-delay: 0ms;
    transform: translate(-50%, -50%);
}

.particle:nth-child(2) {
    animation-delay: 20ms;
}

.particle:nth-child(3) {
    animation-delay: 40ms;
}

.particle:nth-child(4) {
    animation-delay: 60ms;
}

.particle:nth-child(5) {
    animation-delay: 80ms;
}

.particle:nth-child(6) {
    animation-delay: 100ms;
}

.particle:nth-child(7) {
    animation-delay: 120ms;
}

.particle:nth-child(8) {
    animation-delay: 140ms;
}

@keyframes particle {
    0% {
        top: 50%;
        left: 50%;
        opacity: 1;
    }

    100% {
        top: calc(50% + var(--y, 0) * 60px);
        left: calc(50% + var(--x, 0) * 60px);
        opacity: 0;
    }
}

.particle:nth-child(1) {
    --x: 0;
    --y: -1;
}

.particle:nth-child(2) {
    --x: 0.7;
    --y: -0.7;
}

.particle:nth-child(3) {
    --x: 1;
    --y: 0;
}

.particle:nth-child(4) {
    --x: 0.7;
    --y: 0.7;
}

.particle:nth-child(5) {
    --x: 0;
    --y: 1;
}

.particle:nth-child(6) {
    --x: -0.7;
    --y: 0.7;
}

.particle:nth-child(7) {
    --x: -1;
    --y: 0;
}

.particle:nth-child(8) {
    --x: -0.7;
    --y: -0.7;
}

.game-instructions {
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.game-instructions p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1.05rem;
}

.game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Level Selection */
.language-select,
.level-select {
    margin: 30px 0;
}

.language-select h3,
.level-select h3 {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.lang-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.btn-lang {
    padding: 15px 35px;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-lang:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.btn-lang.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

.levels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    max-width: 700px;
    margin: 0 auto;
}

.level-option {
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 15px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.level-option:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.level-option .level-num {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
}

.level-option .level-name {
    font-size: 0.95rem;
    color: var(--text-primary);
    margin: 10px 0 5px;
    font-weight: 600;
}

.level-option .level-xp {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

/* Game Results Grid */
.game-results-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 400px;
    margin: 30px auto;
}

.game-results-grid .result-item {
    background: var(--bg-dark);
    padding: 20px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

@media (max-width: 768px) {
    .game-header {
        gap: 15px;
    }

    .game-stat {
        padding: 12px 18px;
        min-width: 80px;
    }

    .game-stat .stat-value {
        font-size: 1.4rem;
    }

    .levels-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .game-results-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
}

/* ========================================
   WORD BUILDER GAME STYLES
======================================== */

.word-builder-game {
    text-align: center;
}

.word-hint-container {
    margin: 25px 0;
    padding: 20px;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.word-hint {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.target-word {
    display: flex;
    justify-content: center;
    gap: 10px;
    direction: rtl;
}

.letter-slot {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.current-word-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 25px 0;
    padding: 25px;
    background: var(--bg-dark);
    border-radius: var(--radius-md);
    border: 2px solid var(--border);
    min-height: 80px;
}

.current-word-container.success-flash {
    animation: successFlash 0.5s ease;
    border-color: var(--secondary);
}

.current-word-container.shake-error {
    animation: shakeError 0.5s ease;
    border-color: var(--danger);
}

@keyframes successFlash {

    0%,
    100% {
        background: var(--bg-dark);
    }

    50% {
        background: rgba(16, 185, 129, 0.2);
    }
}

@keyframes shakeError {

    0%,
    100% {
        transform: translateX(0);
    }

    20%,
    60% {
        transform: translateX(-10px);
    }

    40%,
    80% {
        transform: translateX(10px);
    }
}

.current-word {
    display: flex;
    gap: 8px;
    direction: rtl;
}

.built-letter {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-light);
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.placeholder-text {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.letters-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 25px 0;
}

.letter-btn {
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    font-weight: 700;
    background: var(--gradient-1);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

.letter-btn:hover:not(:disabled) {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.5);
}

.letter-btn.used {
    background: var(--bg-card);
    color: var(--text-muted);
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-small {
    padding: 10px 20px;
    font-size: 0.9rem;
}

/* ========================================
   SENTENCE RACE GAME STYLES
======================================== */

.sentence-race-game {
    text-align: center;
}

.sentence-container {
    margin: 25px 0;
    padding: 30px;
    background: var(--bg-dark);
    border-radius: var(--radius);
    border: 2px solid var(--border);
}

.sentence-display {
    font-size: 1.6rem;
    line-height: 2.2;
    margin-bottom: 25px;
    direction: rtl;
    text-align: right;
    min-height: 60px;
}

.sentence-display .char {
    display: inline;
    transition: all 0.1s ease;
}

.sentence-display .char.correct {
    color: var(--secondary);
}

.sentence-display .char.current {
    background: var(--primary);
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    animation: blink 0.8s ease infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

.typing-area {
    margin-top: 20px;
}

.typing-input {
    width: 100%;
    padding: 18px 25px;
    font-size: 1.3rem;
    font-family: inherit;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: right;
    direction: rtl;
    transition: var(--transition);
}

.typing-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

.typing-progress {
    margin: 20px 0;
}

.typing-progress .progress-bar {
    height: 8px;
    background: var(--bg-darker);
    border-radius: 4px;
    overflow: hidden;
}

.typing-progress .progress-fill {
    height: 100%;
    background: var(--gradient-2);
    transition: width 0.2s ease;
}

/* ========================================
   LEADERBOARD STYLES
======================================== */

.leaderboard-container {
    max-width: 800px;
    margin: 0 auto;
}

.leaderboard-header {
    text-align: center;
    margin-bottom: 30px;
}

.leaderboard-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.leaderboard-header p {
    color: var(--text-secondary);
}

.leaderboard-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-bottom: 25px;
}

.tab-btn {
    padding: 12px 20px;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
}

.tab-btn:hover {
    border-color: var(--primary);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--gradient-1);
    border-color: transparent;
    color: white;
}

.leaderboard-content {
    margin-bottom: 30px;
}

.all-games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.game-summary-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
}

.game-summary-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.game-summary-card .game-icon {
    font-size: 2.5rem;
}

.game-summary-card .game-info {
    flex: 1;
}

.game-summary-card .game-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.game-summary-card .top-score {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.game-summary-card .score-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--accent);
}

.game-summary-card .score-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.game-summary-card .score-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.game-summary-card .game-count {
    background: var(--bg-dark);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.no-scores {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.no-scores-message {
    text-align: center;
    padding: 50px 20px;
}

.no-scores-message .big-emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 20px;
}

.no-scores-message h3 {
    margin-bottom: 10px;
}

.no-scores-message p {
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.scores-table {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid var(--border);
}

.table-header {
    display: grid;
    grid-template-columns: 80px 100px 1fr 120px;
    padding: 15px 20px;
    background: var(--bg-dark);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.table-body {
    max-height: 400px;
    overflow-y: auto;
}

.score-row {
    display: grid;
    grid-template-columns: 80px 100px 1fr 120px;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border);
    align-items: center;
    transition: var(--transition);
}

.score-row:last-child {
    border-bottom: none;
}

.score-row:hover {
    background: rgba(99, 102, 241, 0.05);
}

.score-row.top-three {
    background: rgba(245, 158, 11, 0.05);
}

.score-row .col-rank {
    font-size: 1.3rem;
}

.score-row .col-score strong {
    font-size: 1.2rem;
    color: var(--primary-light);
}

.score-row .col-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.score-row .col-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.leaderboard-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* ========================================
   AUDIO CONTROLS STYLES
======================================== */

.audio-toggle-btn {
    position: fixed;
    bottom: 25px;
    left: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-1);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 100;
    transition: var(--transition);
}

.audio-toggle-btn:hover {
    transform: scale(1.1);
}

.audio-toggle-btn.muted {
    background: var(--bg-card);
    opacity: 0.7;
}

.audio-controls-panel {
    background: var(--bg-card);
    padding: 25px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.audio-controls-panel h3 {
    margin-bottom: 20px;
    text-align: center;
}

.audio-control {
    margin-bottom: 20px;
}

.audio-control label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    cursor: pointer;
}

.audio-control input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

.audio-control input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--bg-dark);
    accent-color: var(--primary);
}

/* ========================================
   ENHANCED VISUAL EFFECTS
======================================== */

/* Particle burst effect */
.particle-burst {
    position: absolute;
    pointer-events: none;
}

.particle-burst .particle {
    position: absolute;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    animation: particleBurst 0.6s ease-out forwards;
}

@keyframes particleBurst {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }

    100% {
        transform: translate(var(--tx), var(--ty)) scale(0);
        opacity: 0;
    }
}

/* Screen shake */
.screen-shake {
    animation: screenShake 0.3s ease;
}

@keyframes screenShake {

    0%,
    100% {
        transform: translate(0, 0);
    }

    20% {
        transform: translate(-5px, 3px);
    }

    40% {
        transform: translate(5px, -3px);
    }

    60% {
        transform: translate(-3px, 5px);
    }

    80% {
        transform: translate(3px, -5px);
    }
}

/* Glow pulse */
.glow-pulse {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 40px rgba(99, 102, 241, 0.6);
    }
}

/* Rainbow text */
.rainbow-text {
    background: linear-gradient(90deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3, #ff6b6b);
    background-size: 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: rainbowShift 3s linear infinite;
}

@keyframes rainbowShift {
    0% {
        background-position: 0%;
    }

    100% {
        background-position: 200%;
    }
}

/* Floating animation */
.float-animate {
    animation: floatAnimate 3s ease-in-out infinite;
}

@keyframes floatAnimate {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Sparkle effect */
.sparkle {
    position: relative;
}

.sparkle::before,
.sparkle::after {
    content: '✨';
    position: absolute;
    animation: sparkle 1.5s ease infinite;
}

.sparkle::before {
    top: -10px;
    left: -10px;
    animation-delay: 0s;
}

.sparkle::after {
    bottom: -10px;
    right: -10px;
    animation-delay: 0.75s;
}

@keyframes sparkle {

    0%,
    100% {
        opacity: 0;
        transform: scale(0.5);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Combo fire effect */
.combo-fire {
    position: relative;
}

.combo-fire::after {
    content: '🔥';
    position: absolute;
    top: -20px;
    right: -10px;
    font-size: 1.5rem;
    animation: fireFlicker 0.3s ease infinite;
}

@keyframes fireFlicker {

    0%,
    100% {
        transform: scale(1) rotate(-5deg);
    }

    50% {
        transform: scale(1.1) rotate(5deg);
    }
}

/* New Personal Best */
.personal-best-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    color: #1a1a2e;
    animation: pbPulse 1s ease infinite;
}

@keyframes pbPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Responsive additions for new components */
@media (max-width: 768px) {
    .leaderboard-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 10px;
    }

    .tab-btn {
        flex-shrink: 0;
        padding: 10px 15px;
        font-size: 0.85rem;
    }

    .table-header,
    .score-row {
        grid-template-columns: 60px 80px 1fr 100px;
        padding: 12px 15px;
        font-size: 0.85rem;
    }

    .letters-grid {
        gap: 8px;
    }

    .letter-btn {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }

    .sentence-display {
        font-size: 1.3rem;
    }

    .audio-toggle-btn,
    .leaderboard-btn {
        bottom: 15px;
        width: 45px;
        height: 45px;
    }

    .floating-buttons {
        flex-direction: column;
        left: 15px;
        bottom: 15px;
    }
}

/* Floating Buttons Container */
.floating-buttons {
    position: fixed;
    bottom: 25px;
    left: 25px;
    display: flex;
    gap: 15px;
    z-index: 100;
}

.leaderboard-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-3);
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.leaderboard-btn:hover {
    transform: scale(1.1);
}

/* ========================================
   FLASH MEMORY GAME STYLES
======================================== */

.flash-memory-game {
    text-align: center;
}

.flash-display-area {
    margin: 25px 0;
    padding: 40px;
    background: var(--bg-dark);
    border-radius: var(--radius);
    border: 2px solid var(--border);
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.flash-title {
    font-size: 1.3rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

.flash-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100px;
}

.flash-content.flash-active {
    animation: flashPulse 0.3s ease;
}

@keyframes flashPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.ready-message,
.hidden-message {
    text-align: center;
}

.ready-message .big-emoji,
.hidden-message .big-emoji {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
}

.ready-message p,
.hidden-message p {
    color: var(--text-secondary);
    font-size: 1.2rem;
}

.countdown-display {
    text-align: center;
}

.countdown-number {
    font-size: 5rem;
    font-weight: 800;
    background: var(--gradient-1);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: countdownPop 0.5s ease;
}

@keyframes countdownPop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.flash-item {
    padding: 30px 50px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius);
    animation: flashShow 0.3s ease;
}

@keyframes flashShow {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.flash-item.sentences .flash-text {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.6;
}

.flash-item.numbers .flash-text {
    font-size: 3rem;
    font-weight: 800;
    font-family: monospace;
    letter-spacing: 8px;
    color: var(--accent);
}

.input-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin: 25px 0;
    padding: 25px;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.input-prompt {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin: 0;
}

.memory-input {
    width: 100%;
    max-width: 500px;
    padding: 18px 25px;
    font-size: 1.4rem;
    font-family: inherit;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    text-align: center;
    direction: rtl;
    transition: var(--transition);
}

.memory-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.feedback-area {
    justify-content: center;
    margin: 25px 0;
}

.feedback {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px 35px;
    border-radius: var(--radius-md);
    animation: feedbackSlide 0.3s ease;
}

@keyframes feedbackSlide {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback.success {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 1px solid rgba(16, 185, 129, 0.4);
}

.feedback.error {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
    border: 1px solid rgba(239, 68, 68, 0.4);
}

.feedback-icon {
    font-size: 2rem;
}

.feedback-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.feedback-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
    text-align: right;
}

.correct-answer,
.user-answer {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.correct-answer strong {
    color: var(--secondary);
}

.user-answer strong {
    color: var(--danger);
}

.streak-bonus {
    background: var(--gradient-3);
    padding: 5px 15px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 700;
    animation: streakPop 0.3s ease;
}

@keyframes streakPop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* Mode Selection */
.mode-select {
    margin: 30px 0;
}

.mode-select h3 {
    margin-bottom: 25px;
    color: var(--text-secondary);
}

.mode-buttons {
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
}

.mode-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 35px 40px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-width: 200px;
}

.mode-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.mode-card .mode-icon {
    font-size: 3.5rem;
    margin-bottom: 15px;
}

.mode-card .mode-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.mode-card .mode-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.level-details {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 5px;
}

.results-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* Responsive */
@media (max-width: 768px) {
    .flash-display-area {
        padding: 25px;
        min-height: 150px;
    }

    .flash-item.sentences .flash-text {
        font-size: 1.4rem;
    }

    .flash-item.numbers .flash-text {
        font-size: 2.2rem;
        letter-spacing: 5px;
    }

    .memory-input {
        font-size: 1.2rem;
        padding: 15px 20px;
    }

    .mode-buttons {
        flex-direction: column;
        align-items: center;
    }

    .mode-card {
        width: 100%;
        max-width: 300px;
    }
}

/* ========================================
   IMAGE MEMORY GAME STYLES
======================================== */

.image-memory-game {
    text-align: center;
}

.images-display {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 30px;
}

.memory-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 2px solid rgba(99, 102, 241, 0.4);
    border-radius: var(--radius-md);
    animation: imageAppear 0.4s ease forwards;
    opacity: 0;
}

@keyframes imageAppear {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }

    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.memory-image .image-emoji {
    font-size: 3.5rem;
}

.memory-image .image-number {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-light);
    background: var(--bg-dark);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.selection-area {
    margin: 25px 0;
    padding: 25px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.selection-prompt {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.selected-images {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.selected-slot {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    font-size: 2.5rem;
    transition: var(--transition);
}

.selected-slot.empty {
    background: var(--bg-dark);
    border: 2px dashed var(--border);
    color: var(--text-muted);
    font-size: 1.2rem;
    font-weight: 600;
}

.selected-slot.filled {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(6, 182, 212, 0.2));
    border: 2px solid rgba(16, 185, 129, 0.4);
    animation: slotFill 0.3s ease;
}

@keyframes slotFill {
    0% {
        transform: scale(0.8);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.image-options {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.image-option {
    width: 70px;
    height: 70px;
    font-size: 2.5rem;
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.image-option:hover:not(:disabled) {
    transform: scale(1.1);
    border-color: var(--primary);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.3);
}

.image-option.selected {
    background: var(--bg-card);
    border-color: var(--secondary);
    opacity: 0.5;
    cursor: not-allowed;
}

.selection-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* More Words for Word Builder */
.word-builder-game .letters-grid {
    justify-content: center;
}

/* Responsive */
@media (max-width: 768px) {
    .images-display {
        gap: 15px;
        padding: 20px;
    }

    .memory-image {
        padding: 15px;
    }

    .memory-image .image-emoji {
        font-size: 2.5rem;
    }

    .selected-slot,
    .image-option {
        width: 55px;
        height: 55px;
        font-size: 2rem;
    }

    .selected-images,
    .image-options {
        gap: 10px;
    }
}

/* ========================================
   TYPING TRAINER STYLES
======================================== */

.typing-trainer {
    text-align: center;
}

.typing-modes {
    margin: 30px 0;
}

.typing-modes h3 {
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.typing-modes .mode-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.typing-modes .mode-card {
    padding: 25px 20px;
}

.typing-modes .mode-levels {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
}

.typing-info {
    margin-top: 30px;
    padding: 20px;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    text-align: right;
}

.typing-info h4 {
    margin-bottom: 15px;
    color: var(--accent);
}

.typing-info ul {
    margin: 0;
    padding-right: 25px;
}

.typing-info li {
    margin: 8px 0;
    color: var(--text-secondary);
}

/* Lessons Grid */
.lessons-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.lesson-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.lesson-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: var(--shadow-lg);
}

.lesson-number {
    font-size: 0.9rem;
    color: var(--primary-light);
    font-weight: 700;
    margin-bottom: 8px;
}

.lesson-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.lesson-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Typing Header */
.typing-header {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
    padding: 15px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.typing-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.typing-stat .stat-icon {
    font-size: 1.2rem;
}

.typing-stat .stat-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.typing-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Lesson Info */
.lesson-info {
    margin-bottom: 20px;
}

.lesson-info .lesson-title {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.4);
    border-radius: 20px;
    font-size: 0.95rem;
}

/* Typing Area */
.typing-area {
    background: var(--bg-dark);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 20px;
    min-height: 100px;
}

.target-text {
    font-size: 1.6rem;
    line-height: 2;
    direction: rtl;
    word-wrap: break-word;
    font-family: 'Noto Sans Arabic', 'Tajawal', sans-serif;
}

.target-text .char {
    display: inline-block;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.1s ease;
}

/* Natural text display for words/sentences/paragraphs */
/* Natural text display for words/sentences/paragraphs */
.target-text .char.natural {
    display: inline;
    /* Critical for Arabic ligatures */
    padding: 0;
    margin: 0;
    letter-spacing: normal;
    background: transparent;
    /* Avoid breaks in cursor highlight */
}

.target-text .char.natural.current {
    padding: 2px 4px;
    margin: 0 -2px;
}

.target-text .char.current {
    background: var(--primary);
    color: white;
    animation: pulse-current 1s infinite;
}

@keyframes pulse-current {

    0%,
    100% {
        box-shadow: 0 0 5px var(--primary);
    }

    50% {
        box-shadow: 0 0 15px var(--primary);
    }
}

.target-text .char.correct {
    color: var(--secondary);
}

.target-text .char.error {
    color: var(--danger);
    text-decoration: underline wavy var(--danger);
    animation: shake-char 0.3s ease;
}

@keyframes shake-char {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-3px);
    }

    75% {
        transform: translateX(3px);
    }
}

/* Finger Hint */
.finger-hint {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
}

.hint-finger {
    font-size: 2rem;
    transition: color 0.2s ease;
}

.hint-text {
    font-size: 1.1rem;
    color: var(--text-secondary);
}

/* Keyboard Container */
.keyboard-container {
    padding: 20px;
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow-x: auto;
}

.keyboard-container.shake {
    animation: shake-keyboard 0.3s ease;
}

@keyframes shake-keyboard {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.keyboard {
    display: flex;
    flex-direction: column;
    gap: 8px;
    direction: ltr;
    min-width: 650px;
}

.keyboard-row {
    display: flex;
    justify-content: center;
    gap: 6px;
}

.keyboard-row.top-row {
    margin-right: 20px;
}

.keyboard-row.home-row {
    margin-right: 10px;
}

.keyboard-row.bottom-row {
    margin-right: 30px;
}

.key {
    min-width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #3a3a4a, #2a2a3a);
    border: 2px solid #4a4a5a;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 3px 0 #1a1a2a, 0 5px 10px rgba(0, 0, 0, 0.3);
    position: relative;
}

.key::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 3px;
    background: var(--finger-color);
    border-radius: 2px 2px 0 0;
    opacity: 0.6;
}

.key:hover {
    transform: translateY(-2px);
    border-color: var(--finger-color);
}

.key.highlight {
    background: var(--finger-color);
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), 0 0 20px var(--finger-color);
    animation: key-pulse 0.5s infinite;
}

@keyframes key-pulse {

    0%,
    100% {
        box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), 0 0 20px var(--finger-color);
    }

    50% {
        box-shadow: 0 5px 0 rgba(0, 0, 0, 0.3), 0 0 30px var(--finger-color);
    }
}

.key.space-key {
    min-width: 300px;
    font-size: 0.9rem;
}

/* Home row markers */
.home-row .key:nth-child(4)::after,
.home-row .key:nth-child(7)::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 6px;
    height: 2px;
    background: #888;
    border-radius: 1px;
}

/* Hands Guide */
.hands-guide {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.hand {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.hand.left-hand {
    direction: rtl;
}

.hand .finger {
    width: 30px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px 15px 5px 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: white;
    transition: all 0.2s ease;
}

.hand .finger.thumb {
    height: 30px;
    width: 35px;
    border-radius: 10px;
}

.hand .finger.active {
    transform: scale(1.2);
    box-shadow: 0 0 15px currentColor;
}

/* Typing Controls */
.typing-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Responsive */
@media (max-width: 768px) {
    .keyboard-container {
        padding: 10px;
    }

    .keyboard {
        min-width: 500px;
        transform: scale(0.85);
        transform-origin: center;
    }

    .key {
        min-width: 35px;
        height: 38px;
        font-size: 0.95rem;
    }

    .key.space-key {
        min-width: 200px;
    }

    .target-text {
        font-size: 1.3rem;
    }

    .typing-header {
        gap: 15px;
    }

    .hands-guide {
        transform: scale(0.8);
    }
}

@media (max-width: 480px) {
    .keyboard {
        transform: scale(0.7);
    }

    .typing-modes .mode-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ========================================
   FALLING WORDS GAME STYLES
======================================== */

.falling-words-intro {
    text-align: center;
    padding: 24px;
    background: radial-gradient(circle at 25% 20%, rgba(99, 102, 241, 0.15), transparent 35%), radial-gradient(circle at 80% 10%, rgba(45, 212, 191, 0.12), transparent 30%), linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.9));
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.35);
    position: relative;
    overflow: hidden;
}

.falling-words-intro .game-header-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    filter: drop-shadow(0 10px 25px rgba(99, 102, 241, 0.35));
    animation: floatGlow 4s ease-in-out infinite;
}

.level-select-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 20px;
}

.level-btn {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(45, 212, 191, 0.12));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px 12px;
    color: #e2e8f0;
    text-align: center;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    display: grid;
    gap: 6px;
    min-height: 90px;
}

.level-btn .lvl-num {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.level-btn .lvl-desc {
    font-size: 0.95rem;
    color: rgba(226, 232, 240, 0.8);
}

.level-btn:hover {
    transform: translateY(-4px);
    border-color: rgba(99, 102, 241, 0.7);
    box-shadow: 0 12px 40px rgba(99, 102, 241, 0.35);
}

.level-btn:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.falling-game-container {
    position: relative;
    width: 100%;
    height: 600px;
    background:
        radial-gradient(circle at 20% 25%, rgba(99, 102, 241, 0.15), transparent 35%),
        radial-gradient(circle at 80% 15%, rgba(14, 165, 233, 0.12), transparent 30%),
        linear-gradient(180deg, #0b1224 0%, #0f172a 40%, #111827 100%);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 80px rgba(15, 23, 42, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.45);
}

.falling-game-container canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.fw-hidden-input {
    position: absolute;
    bottom: 12px;
    inset-inline-end: 12px;
    width: 40%;
    max-width: 280px;
    height: 44px;
    opacity: 0;
    border: none;
    background: transparent;
    color: transparent;
    z-index: 12;
}

.game-hud {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    z-index: 10;
    pointer-events: none;
}

.hud-item {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    padding: 10px 16px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hud-item .icon {
    font-size: 1.2rem;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.hud-item span:last-child {
    font-size: 1.2rem;
    font-weight: 700;
    color: white;
}

.input-display {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(14px);
    padding: 16px 44px;
    border-radius: 14px;
    border: 2px solid rgba(255, 255, 255, 0.16);
    color: white;
    font-size: 1.8rem;
    font-weight: 700;
    min-width: 300px;
    text-align: center;
    z-index: 10;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.35);
    transition: all 0.2s ease;
}

.input-display.has-text {
    background: rgba(34, 197, 94, 0.2);
    border-color: rgba(34, 197, 94, 0.55);
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.35);
}

.input-display .placeholder {
    color: rgba(255, 255, 255, 0.3);
    font-size: 1.2rem;
    font-weight: 400;
}

.game-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    transition: background 0.15s ease;
}

.falling-result {
    text-align: center;
    padding: 30px;
}

.falling-result .result-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    animation: bounce 1s infinite;
}

.falling-result .final-score {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
    margin: 20px 0;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

@keyframes floatGlow {
    0% { transform: translateY(0); filter: drop-shadow(0 10px 25px rgba(99, 102, 241, 0.3)); }
    50% { transform: translateY(-6px); filter: drop-shadow(0 12px 30px rgba(99, 102, 241, 0.45)); }
    100% { transform: translateY(0); filter: drop-shadow(0 10px 25px rgba(99, 102, 241, 0.3)); }
}

@media (max-width: 768px) {
    .falling-game-container {
        height: 480px;
    }

    .input-display {
        min-width: 240px;
        font-size: 1.4rem;
        padding: 12px 30px;
    }
}

/* Duel Section */
.duel-section {
    padding: 80px 0;
    background: radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.08), transparent 35%), radial-gradient(circle at 80% 0%, rgba(16, 185, 129, 0.08), transparent 30%);
}

.duel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    border-radius: var(--radius-md);
    padding: 24px;
    display: grid;
    gap: 18px;
}

.duel-inputs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
}

.duel-inputs label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--text-muted);
}

.duel-inputs input {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg-input);
    color: var(--text-primary);
}

.duel-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.duel-countdown {
    font-weight: 700;
    color: var(--accent);
    min-width: 80px;
}

.duel-finish {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.duel-result {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--text-primary);
    font-weight: 700;
}

.duel-result.win {
    background: rgba(99, 102, 241, 0.08);
    border-color: rgba(99, 102, 241, 0.4);
}

/* Duel Results Styles */
.duel-current-player-banner {
    background: linear-gradient(135deg, var(--accent), var(--secondary));
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 1.1rem;
    animation: slide-down 0.3s ease-out;
}

.duel-current-player-banner .duel-icon {
    font-size: 1.5rem;
}

.duel-current-player-banner strong {
    font-size: 1.3rem;
}

@keyframes slide-down {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.duel-result-container {
    text-align: center;
}

.duel-player-result {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(16, 185, 129, 0.1));
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 15px;
}

.duel-player-result h3 {
    color: var(--accent);
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.duel-score-details {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.duel-score-details span {
    background: var(--bg-card);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-weight: 600;
}

.duel-next-player {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-md);
    padding: 15px;
    animation: pulse-border 1.5s ease-in-out infinite;
}

.duel-next-player p {
    margin: 0;
    font-size: 1.2rem;
}

.duel-next-player strong {
    color: var(--accent);
    font-size: 1.4rem;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(245, 158, 11, 0.3); }
    50% { border-color: rgba(245, 158, 11, 0.8); }
}

.duel-final-results {
    padding: 20px;
}

.duel-winner {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 25px;
    text-shadow: 0 0 20px rgba(99, 102, 241, 0.5);
}

.duel-winner.tie {
    color: #f59e0b;
    text-shadow: 0 0 20px rgba(245, 158, 11, 0.5);
}

.duel-comparison {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.duel-player-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 25px;
    min-width: 140px;
    transition: all 0.3s ease;
}

.duel-player-card.winner {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(99, 102, 241, 0.05));
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.3);
}

.duel-player-card.loser {
    opacity: 0.7;
    transform: scale(0.95);
}

.duel-player-card h4 {
    color: var(--text-primary);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.duel-player-card .score {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}

.duel-player-card .details {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.duel-comparison .vs {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-muted);
    padding: 10px;
}

.btn-large {
    padding: 15px 30px !important;
    font-size: 1.2rem !important;
}

.pulse-animation {
    animation: pulse-btn 1.5s ease-in-out infinite;
}

@keyframes pulse-btn {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.4);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 0 20px 5px rgba(99, 102, 241, 0.3);
    }
}

.confetti {
    position: fixed;
    top: -10px;
    width: 8px;
    height: 14px;
    opacity: 0.9;
    animation: fall 2s linear forwards;
    z-index: 9999;
    border-radius: 2px;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* Duel Timer Styles */
.duel-timer-stat {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    border-color: #f87171 !important;
    animation: timer-pulse 1s ease-in-out infinite;
}

.duel-timer-stat .stat-value,
.duel-timer-stat #duelTimer {
    color: white !important;
    font-weight: 700;
    font-size: 1.5rem;
}

.duel-timer-stat.warning {
    animation: timer-warning 0.5s ease-in-out infinite;
}

.duel-timer-stat.warning .stat-value,
.duel-timer-stat.warning #duelTimer {
    color: #fef08a !important;
}

@keyframes timer-pulse {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }
    50% { 
        box-shadow: 0 0 15px 3px rgba(239, 68, 68, 0.3);
    }
}

@keyframes timer-warning {
    0%, 100% { 
        background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
        transform: scale(1);
    }
    50% { 
        background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
        transform: scale(1.05);
    }
}

/* HUD item for duel timer in falling words */
.game-hud .hud-item.duel-timer-stat {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-radius: 8px;
    padding: 5px 12px;
}

/* Epic Celebration Styles */

/* Emoji Confetti */
.emoji-confetti {
    position: fixed;
    top: -50px;
    font-size: 2rem;
    animation: emoji-fall 3s ease-out forwards;
    z-index: 10001;
    pointer-events: none;
}

@keyframes emoji-fall {
    0% {
        transform: translateY(0) rotate(0deg) scale(1);
        opacity: 1;
    }
    50% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

/* Victory Flash */
.victory-flash {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255,215,0,0.4) 0%, rgba(255,215,0,0) 70%);
    animation: flash-pulse 0.5s ease-out forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes flash-pulse {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    30% {
        opacity: 1;
        transform: scale(1.2);
    }
    100% {
        opacity: 0;
        transform: scale(1.5);
    }
}

/* Enhanced Confetti */
.confetti {
    position: fixed;
    top: -20px;
    width: 10px;
    height: 16px;
    opacity: 0.9;
    animation: confetti-fall 2.5s linear forwards;
    z-index: 10001;
    border-radius: 3px;
    pointer-events: none;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(0) rotateX(0) rotateY(0) rotateZ(0);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotateX(720deg) rotateY(360deg) rotateZ(180deg);
        opacity: 0;
    }
}

/* Winner Announcement Enhancement */
.duel-winner {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    padding: 20px;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffd700 0%, #ffb700 50%, #ffd700 100%);
    background-size: 200% 200%;
    animation: winner-shine 2s ease-in-out infinite;
    border-radius: 16px;
    color: #1a1a2e;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 0 0 60px rgba(255, 215, 0, 0.3);
}

.duel-winner.tie {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #6366f1 100%);
    background-size: 200% 200%;
    color: white;
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.5), 0 0 60px rgba(99, 102, 241, 0.3);
}

@keyframes winner-shine {
    0%, 100% {
        background-position: 0% 50%;
        transform: scale(1);
    }
    50% {
        background-position: 100% 50%;
        transform: scale(1.02);
    }
}

/* Winner Card Glow */
.duel-player-card.winner {
    animation: winner-glow 1.5s ease-in-out infinite;
    border: 3px solid #ffd700 !important;
}

@keyframes winner-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 215, 0, 0.4), 0 0 40px rgba(255, 215, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 30px rgba(255, 215, 0, 0.6), 0 0 60px rgba(255, 215, 0, 0.4);
    }
}

/* Trophy Animation */
.duel-winner::before {
    content: '🏆';
    display: inline-block;
    margin-left: 10px;
    animation: trophy-bounce 0.5s ease-in-out infinite alternate;
}

.duel-winner::after {
    content: '🏆';
    display: inline-block;
    margin-right: 10px;
    animation: trophy-bounce 0.5s ease-in-out infinite alternate-reverse;
}

@keyframes trophy-bounce {
    0% {
        transform: translateY(0) rotate(-10deg);
    }
    100% {
        transform: translateY(-10px) rotate(10deg);
    }
}

/* Stars around winner */
.duel-final-results {
    position: relative;
}

.duel-final-results::before,
.duel-final-results::after {
    content: '✨';
    position: absolute;
    font-size: 1.5rem;
    animation: star-twinkle 1s ease-in-out infinite;
}

.duel-final-results::before {
    top: 10px;
    left: 10px;
}

.duel-final-results::after {
    top: 10px;
    right: 10px;
    animation-delay: 0.5s;
}

@keyframes star-twinkle {
    0%, 100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.2) rotate(180deg);
    }
}

/* Progressive Reader Styles */
.progressive-reader-intro {
    text-align: center;
    padding: 20px;
}

.progressive-reader-intro .game-header-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.level-categories {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-top: 25px;
}

.level-category {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 20px;
    border: 1px solid var(--border);
}

.level-category h3 {
    color: var(--text-primary);
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.level-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.level-btn-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 80px;
}

.level-btn-small:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-3px);
}

.level-btn-small .lvl-icon {
    font-size: 1.5rem;
}

.level-btn-small .lvl-speed {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* Articles Grid */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.article-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 25px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.article-btn:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.article-btn .article-icon {
    font-size: 2.5rem;
}

.article-btn .article-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Progressive Reader UI */
.progressive-reader {
    padding: 20px;
}

.reader-header {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.reader-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--bg-secondary);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.reader-stat .stat-icon {
    font-size: 1.2rem;
}

.reader-stat .stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Reader Display */
.reader-display-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
    margin: 30px 0;
}

.reader-display {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border);
    border-radius: 20px;
    padding: 40px 60px;
    min-width: 300px;
    max-width: 80%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.reader-display .ready-text {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.reader-display .chunk-text {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.6;
}

.reader-display.chunk-animate .chunk-text {
    animation: chunk-appear 0.15s ease-out;
}

@keyframes chunk-appear {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Reader Progress */
.reader-progress {
    margin: 20px 0;
}

.reader-progress .progress-bar {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.reader-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 4px;
    transition: width 0.3s ease;
}

/* Reader Controls */
.reader-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

/* Speed Control */
.speed-control {
    text-align: center;
    margin-top: 20px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
}

.speed-control label {
    display: block;
    margin-bottom: 10px;
    color: var(--text-muted);
}

.speed-control input[type="range"] {
    width: 100%;
    max-width: 300px;
    height: 8px;
    border-radius: 4px;
    background: var(--border);
    outline: none;
    -webkit-appearance: none;
}

.speed-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
}

/* Comprehension Test */
.comprehension-test {
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.test-header {
    text-align: center;
    margin-bottom: 30px;
}

.test-header h2 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.test-header p {
    color: var(--text-muted);
}

.reading-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.reading-stats span {
    padding: 8px 15px;
    background: var(--bg-secondary);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.test-questions {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
}

.question-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.question-number {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 10px;
}

.question-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    font-weight: 500;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.option-btn {
    padding: 12px 15px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 10px;
    text-align: right;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.option-btn:hover {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
}

.option-btn.selected {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.2);
    color: var(--accent);
}

/* Progressive Results */
.progressive-results {
    padding: 20px;
    text-align: center;
}

.results-header {
    margin-bottom: 30px;
}

.results-header .performance-badge {
    font-size: 4rem;
    margin-bottom: 10px;
}

.results-header h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.results-header p {
    color: var(--text-muted);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.result-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.result-card.highlight {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border-color: var(--accent);
}

.result-card .result-icon {
    font-size: 1.5rem;
}

.result-card .result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.result-card .result-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.results-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* ========================================
   Word Hunter Game Styles
   ======================================== */

.word-hunter-game,
.odd-word-game,
.fill-blanks-game {
    padding: 20px;
}

.target-word-container {
    text-align: center;
    margin: 20px 0;
    padding: 25px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    border-radius: 16px;
    border: 2px solid var(--accent);
}

.target-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.target-word {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.category-hint {
    margin-top: 10px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Words Grid */
.words-grid {
    display: grid;
    gap: 10px;
    margin: 20px 0;
}

.word-cell {
    padding: 15px 10px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.word-cell:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.word-cell.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
    animation: pulse-correct 0.5s ease;
}

.word-cell.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
    animation: shake 0.5s ease;
}

@keyframes pulse-correct {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Game Feedback */
.game-feedback {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 12px;
    margin-top: 15px;
    animation: slide-up 0.3s ease;
}

.game-feedback.correct {
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid #10b981;
    color: #10b981;
}

.game-feedback.wrong {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    color: #ef4444;
}

.feedback-icon {
    font-size: 1.5rem;
}

.feedback-text {
    font-weight: 600;
}

.feedback-points {
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: 700;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Timer Warning */
.timer-stat.warning {
    animation: timer-warning 0.5s ease infinite;
}

.timer-stat.warning .stat-value {
    color: #ef4444;
}

@keyframes timer-warning {
    0%, 100% { background: rgba(239, 68, 68, 0.2); }
    50% { background: rgba(239, 68, 68, 0.4); }
}

/* ========================================
   Odd Word Out Game Styles
   ======================================== */

.category-hint-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border);
    margin: 20px 0;
}

.hint-icon {
    font-size: 2rem;
}

.hint-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hint-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.hint-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
}

.instruction-text {
    text-align: center;
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.instruction-text strong {
    color: var(--accent);
}

.odd-words-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.odd-word-btn {
    padding: 15px 25px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.odd-word-btn:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.2);
}

.odd-word-btn.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.odd-word-btn.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
}

/* ========================================
   Fill Blanks Game Styles
   ======================================== */

.category-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-secondary);
    border-radius: 20px;
    margin-bottom: 20px;
}

.badge-icon {
    font-size: 1rem;
}

.badge-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.sentence-container {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
    text-align: center;
}

.sentence-text {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.8;
}

.blank-space {
    display: inline-block;
    min-width: 80px;
    padding: 5px 15px;
    background: rgba(99, 102, 241, 0.2);
    border-bottom: 3px solid var(--accent);
    color: var(--accent);
    font-weight: 700;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.blank-space.filled {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
    color: #10b981;
}

.options-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.fill-option {
    padding: 12px 25px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.fill-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.fill-option.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.fill-option.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
}

/* Game Header Stats */
.game-header {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.game-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: var(--bg-card);
    border-radius: 10px;
    border: 1px solid var(--border);
}

.game-stat .stat-icon {
    font-size: 1.2rem;
}

.game-stat .stat-value {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 1.1rem;
}

@media (max-width: 480px) {
    .game-header {
        gap: 8px;
    }
    
    .game-stat {
        padding: 8px 12px;
        gap: 5px;
    }
    
    .game-stat .stat-icon {
        font-size: 1rem;
    }
    
    .game-stat .stat-value {
        font-size: 0.95rem;
    }
}

/* Game Progress Bar */
.game-progress {
    margin-top: 20px;
}

.game-progress .progress-bar {
    height: 6px;
    background: var(--bg-secondary);
    border-radius: 3px;
    overflow: hidden;
}

.game-progress .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), #8b5cf6);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Level Grid */
.level-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin: 30px 0;
    perspective: 1000px;
}

.level-btn {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 24px 18px;
    background: linear-gradient(145deg, rgba(30, 30, 50, 0.9), rgba(20, 20, 40, 0.95));
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    overflow: hidden;
}

.level-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(99, 102, 241, 0.1) 0%, 
        rgba(139, 92, 246, 0.05) 50%,
        rgba(99, 102, 241, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 18px;
}

.level-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.05) 50%,
        transparent 70%
    );
    transform: rotate(45deg) translateY(-100%);
    transition: transform 0.6s ease;
}

.level-btn:hover::before {
    opacity: 1;
}

.level-btn:hover::after {
    transform: rotate(45deg) translateY(100%);
}

.level-btn:hover {
    border-color: var(--level-color, var(--accent));
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.3);
    background: linear-gradient(145deg, rgba(40, 40, 70, 0.95), rgba(30, 30, 55, 0.98));
}

.level-btn:active {
    transform: translateY(-4px) scale(0.98);
}

/* Level Colors */
.level-btn:nth-child(1) { --level-color: #10b981; }
.level-btn:nth-child(2) { --level-color: #3b82f6; }
.level-btn:nth-child(3) { --level-color: #8b5cf6; }
.level-btn:nth-child(4) { --level-color: #f59e0b; }
.level-btn:nth-child(5) { --level-color: #ef4444; }
.level-btn:nth-child(6) { --level-color: #ec4899; }

.level-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--level-color, var(--accent)), color-mix(in srgb, var(--level-color, var(--accent)) 70%, #000));
    border-radius: 50%;
    font-size: 0.9rem;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--level-color, var(--accent)) 40%, transparent);
    transition: all 0.3s ease;
}

.level-btn:hover .level-number {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px color-mix(in srgb, var(--level-color, var(--accent)) 50%, transparent);
}

.level-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    transition: all 0.3s ease;
}

.level-btn:hover .level-name {
    color: var(--level-color, var(--accent));
    text-shadow: 0 0 20px color-mix(in srgb, var(--level-color, var(--accent)) 30%, transparent);
}

.level-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    transition: all 0.3s ease;
}

.level-btn:hover .level-desc {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text);
}

/* Level Stars/Difficulty Indicator */
.level-stars {
    display: flex;
    gap: 3px;
    margin-top: 4px;
}

.level-stars .star {
    font-size: 0.75rem;
    color: var(--level-color, var(--accent));
    opacity: 0.3;
    transition: all 0.3s ease;
}

.level-stars .star.filled {
    opacity: 1;
    text-shadow: 0 0 8px var(--level-color, var(--accent));
}

.level-btn:hover .level-stars .star.filled {
    animation: star-pulse 0.6s ease infinite;
}

@keyframes star-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Game Intro */
.game-intro {
    text-align: center;
    padding: 30px 20px;
    animation: intro-fade-in 0.4s ease;
}

@keyframes intro-fade-in {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.game-intro .game-header-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    animation: icon-bounce 2s ease-in-out infinite;
    filter: drop-shadow(0 10px 20px rgba(99, 102, 241, 0.3));
}

@keyframes icon-bounce {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-10px) scale(1.05); }
}

.game-intro h2 {
    color: var(--text);
    margin-bottom: 12px;
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--text), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.game-intro p {
    color: var(--text-muted);
    margin-bottom: 25px;
    font-size: 1.05rem;
    line-height: 1.6;
}

/* Game Results */
.game-results {
    padding: 20px;
    text-align: center;
}

.game-results .results-header {
    margin-bottom: 30px;
}

.game-results .result-icon {
    font-size: 4rem;
    margin-bottom: 10px;
}

.game-results h2 {
    color: var(--text-primary);
    font-size: 1.8rem;
    margin-bottom: 5px;
}

.game-results p {
    color: var(--text-muted);
}

/* Success Button */
.btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(16, 185, 129, 0.3);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========================================
   Sentence Order Game Styles
   ======================================== */

.sentence-order-game {
    padding: 20px;
}

.instruction-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--bg-secondary);
    border-radius: 12px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

.instruction-icon {
    font-size: 1.5rem;
}

.sentence-build-area {
    min-height: 80px;
    padding: 20px;
    background: var(--card-bg);
    border: 2px dashed var(--border);
    border-radius: 16px;
    margin-bottom: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
}

.sentence-build-area.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.sentence-build-area.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.build-placeholder {
    color: var(--text-muted);
    font-style: italic;
}

.built-word {
    display: inline-block;
    padding: 8px 15px;
    background: linear-gradient(135deg, var(--accent) 0%, #8b5cf6 100%);
    color: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.built-word:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.scrambled-words {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.scrambled-word {
    padding: 12px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.scrambled-word:hover:not(:disabled):not(.selected) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-2px);
}

.scrambled-word.selected {
    opacity: 0.4;
    cursor: not-allowed;
    transform: scale(0.95);
}

.order-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 20px;
}

/* ========================================
   Spot Difference Game Styles
   ======================================== */

.spot-diff-game {
    padding: 20px;
}

.texts-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0;
}

@media (max-width: 768px) {
    .texts-comparison {
        grid-template-columns: 1fr;
    }
}

.text-panel {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 20px;
}

.text-panel.original {
    border-color: #10b981;
}

.text-panel.modified {
    border-color: var(--accent);
}

.panel-label {
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.text-content {
    font-size: 1.1rem;
    line-height: 2;
    text-align: right;
}

.compare-word {
    display: inline;
    padding: 2px 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.compare-word.clickable {
    cursor: pointer;
}

.compare-word.clickable:hover {
    background: rgba(99, 102, 241, 0.2);
}

.compare-word.found {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    animation: pulse-correct 0.5s ease;
}

.compare-word.highlighted {
    background: rgba(16, 185, 129, 0.3);
    text-decoration: line-through;
}

.compare-word.missed {
    background: rgba(239, 68, 68, 0.3);
    border: 1px dashed #ef4444;
}

.compare-word.wrong-click {
    animation: shake 0.3s ease;
    background: rgba(239, 68, 68, 0.2);
}

/* ========================================
   Synonym Match Game Styles
   ======================================== */

.synonym-game {
    padding: 20px;
}

.main-word-container {
    text-align: center;
    margin: 25px 0;
    padding: 30px;
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--bg-secondary) 100%);
    border-radius: 20px;
    border: 2px solid var(--accent);
}

.main-word-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.main-word {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
}

.synonym-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 20px 0;
}

.synonym-option {
    padding: 15px 30px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.synonym-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.2);
}

.synonym-option.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.synonym-option.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
}

/* ========================================
   Quick Summary Game Styles
   ======================================== */

.summary-game {
    padding: 20px;
}

.phase-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-weight: 600;
}

.phase-indicator.reading {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
    border: 1px solid var(--accent);
    color: var(--accent);
}

.phase-indicator.answering {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2) 0%, rgba(5, 150, 105, 0.2) 100%);
    border: 1px solid #10b981;
    color: #10b981;
}

.phase-icon {
    font-size: 1.5rem;
}

.reading-container {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    margin: 20px 0;
}

.paragraph-text {
    font-size: 1.3rem;
    line-height: 2;
    color: var(--text-primary);
    text-align: right;
}

.reading-hint {
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 15px;
}

.summary-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 20px 0;
}

.summary-option {
    padding: 18px 20px;
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: right;
    line-height: 1.6;
}

.summary-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.1);
    transform: translateX(-5px);
}

.summary-option.correct {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border-color: #10b981;
    color: white;
}

.summary-option.wrong {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #ef4444;
    color: white;
}

/* Timer stat colors */
.timer-stat.reading {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

.timer-stat.answering {
    background: rgba(16, 185, 129, 0.2);
    border-color: #10b981;
}

/* ========================================
   Game Effects Animations
   ======================================== */

/* Particle animation base */
.game-particle {
    animation: particle-fade 0.6s ease-out forwards;
}

@keyframes particle-fade {
    0% {
        opacity: 1;
        transform: scale(1);
    }
    100% {
        opacity: 0;
        transform: scale(0);
    }
}

/* Button hover effects with sound feedback visual */
.word-cell:hover:not(:disabled),
.odd-word-btn:hover:not(:disabled),
.fill-option:hover:not(:disabled),
.synonym-option:hover:not(:disabled),
.summary-option:hover:not(:disabled),
.scrambled-word:hover:not(:disabled):not(.selected),
.level-btn:hover {
    animation: button-hover 0.2s ease;
}

@keyframes button-hover {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Correct answer glow animation */
.word-cell.correct,
.odd-word-btn.correct,
.fill-option.correct,
.synonym-option.correct,
.summary-option.correct {
    animation: correct-glow 0.5s ease;
}

@keyframes correct-glow {
    0% {
        box-shadow: 0 0 0 rgba(16, 185, 129, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(16, 185, 129, 0.6), 0 0 60px rgba(16, 185, 129, 0.3);
    }
    100% {
        box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
    }
}

/* Wrong answer shake animation */
.word-cell.wrong,
.odd-word-btn.wrong,
.fill-option.wrong,
.synonym-option.wrong,
.summary-option.wrong {
    animation: wrong-shake 0.5s ease;
}

@keyframes wrong-shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

/* Score popup animation */
.score-popup {
    animation: score-float 1s ease-out forwards;
}

@keyframes score-float {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translateY(-60px) scale(1);
    }
}

/* Timer warning pulse */
.timer-stat.warning {
    animation: timer-pulse 0.5s ease infinite;
}

@keyframes timer-pulse {
    0%, 100% {
        background: rgba(239, 68, 68, 0.2);
        transform: scale(1);
    }
    50% {
        background: rgba(239, 68, 68, 0.4);
        transform: scale(1.05);
    }
}

/* Results icon bounce */
.game-results .result-icon {
    animation: result-bounce 1s ease;
}

@keyframes result-bounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.3);
    }
    70% {
        transform: scale(0.9);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Result cards stagger animation */
.results-grid .result-card {
    animation: card-slide-in 0.5s ease forwards;
    opacity: 0;
}

.results-grid .result-card:nth-child(1) { animation-delay: 0.1s; }
.results-grid .result-card:nth-child(2) { animation-delay: 0.2s; }
.results-grid .result-card:nth-child(3) { animation-delay: 0.3s; }
.results-grid .result-card:nth-child(4) { animation-delay: 0.4s; }
.results-grid .result-card:nth-child(5) { animation-delay: 0.5s; }

@keyframes card-slide-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Highlight card special effect */
.result-card.highlight {
    animation: highlight-pulse 2s ease infinite;
}

@keyframes highlight-pulse {
    0%, 100% {
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
}

/* Game feedback slide in */
.game-feedback {
    animation: feedback-slide 0.3s ease;
}

@keyframes feedback-slide {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Level button entrance - removed animation to prevent disappearing */

/* Target word pulse */
.target-word {
    animation: target-pulse 2s ease infinite;
}

@keyframes target-pulse {
    0%, 100% {
        text-shadow: 0 2px 10px rgba(99, 102, 241, 0.3);
    }
    50% {
        text-shadow: 0 2px 20px rgba(99, 102, 241, 0.6), 0 0 40px rgba(99, 102, 241, 0.3);
    }
}

/* Main word container glow */
.main-word-container {
    animation: container-glow 3s ease infinite;
}

@keyframes container-glow {
    0%, 100% {
        box-shadow: 0 0 0 rgba(99, 102, 241, 0);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.2);
    }
}

/* Phase indicator transition */
.phase-indicator {
    animation: phase-slide 0.5s ease;
}

@keyframes phase-slide {
    0% {
        opacity: 0;
        transform: translateX(-20px);
    }
    100% {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Reading container focus effect */
.reading-container {
    animation: reading-focus 0.5s ease;
}

@keyframes reading-focus {
    0% {
        opacity: 0;
        transform: scale(0.95);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Built word bounce */
.built-word {
    animation: word-pop 0.3s ease;
}

@keyframes word-pop {
    0% {
        transform: scale(0);
    }
    70% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Found difference celebration */
.compare-word.found {
    animation: found-celebrate 0.5s ease;
}

@keyframes found-celebrate {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* ========================================
   New Games Styles
   ======================================== */

/* Error Hunt Game */
.error-hunt-game .sentence-container {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 2rem;
    margin: 1.5rem 0;
}

.error-hunt-game .sentence-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    font-size: 1.4rem;
    line-height: 2;
}

.error-word {
    padding: 0.3rem 0.8rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
}

.error-word:hover {
    background: rgba(99, 102, 241, 0.3);
    transform: scale(1.05);
}

.error-word.found {
    background: rgba(16, 185, 129, 0.3);
    border: 2px solid #10b981;
}

.error-word.found .corrected {
    color: #10b981;
    font-weight: bold;
    text-decoration: line-through;
}

.error-word.missed {
    background: rgba(239, 68, 68, 0.3);
    border: 2px solid #ef4444;
}

.error-word.wrong-click {
    animation: wrong-shake 0.5s ease;
}

/* True/False Game */
.true-false-game .statement-container {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(139, 92, 246, 0.2));
    border-radius: 20px;
    padding: 2rem;
    margin: 1.5rem 0;
    text-align: center;
}

.statement-text {
    font-size: 1.5rem;
    line-height: 1.8;
    color: var(--text);
}

.category-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.3);
    padding: 0.3rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.tf-buttons {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.tf-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem 3rem;
    border-radius: 16px;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.tf-btn.true-btn {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 2px solid #10b981;
}

.tf-btn.false-btn {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 2px solid #ef4444;
}

.tf-btn:hover:not(:disabled) {
    transform: scale(1.05);
}

.tf-btn.correct {
    background: #10b981 !important;
    color: white !important;
}

.tf-btn.wrong {
    background: #ef4444 !important;
    color: white !important;
}

.tf-icon {
    font-size: 2rem;
}

/* Word Memory Game */
.word-memory-game .words-display {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin: 1.5rem 0;
}

.memory-word {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    padding: 1rem 1.5rem;
    border-radius: 12px;
    animation: word-pop 0.3s ease forwards;
    opacity: 0;
}

.memory-word .word-number {
    background: rgba(255, 255, 255, 0.2);
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.memory-word .word-text {
    font-size: 1.3rem;
    font-weight: bold;
}

.recall-inputs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    margin: 1.5rem auto;
}

.recall-input-group {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.input-number {
    background: var(--accent);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.recall-input {
    flex: 1;
    padding: 0.8rem 1rem;
    border-radius: 10px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.1rem;
    text-align: center;
}

.recall-input:focus {
    border-color: var(--accent);
    outline: none;
}

.recall-input.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.recall-input.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.correction {
    color: #10b981;
    font-size: 0.9rem;
    margin-right: 0.5rem;
}

/* Word Chain Game */
.chain-display {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.chain-word {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: bold;
}

.chain-arrow {
    color: var(--accent);
    font-size: 1.2rem;
}

.current-word-container {
    text-align: center;
    margin: 1.5rem 0;
}

.target-letter {
    font-size: 4rem;
    font-weight: bold;
    color: var(--accent);
    text-shadow: 0 0 30px rgba(99, 102, 241, 0.5);
}

.chain-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 1rem auto;
}

.chain-option {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.chain-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.2);
}

.chain-option.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.chain-option.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* Quick Sort Game */
.sort-word-container {
    text-align: center;
    margin: 2rem 0;
}

.sort-word {
    font-size: 3rem;
    font-weight: bold;
    color: var(--text);
    animation: word-pop 0.3s ease;
}

.category-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 600px;
    margin: 1.5rem auto;
}

.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border-radius: 16px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover:not(:disabled) {
    border-color: var(--accent);
    transform: scale(1.02);
}

.category-btn .cat-icon {
    font-size: 2rem;
}

.category-btn .cat-name {
    font-size: 1.1rem;
    font-weight: bold;
}

.category-btn.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.category-btn.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* Reverse Word Game */
.reversed-word-container {
    text-align: center;
    margin: 2rem 0;
}

.reversed-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.reversed-word {
    font-size: 3rem;
    font-weight: bold;
    color: var(--accent);
    letter-spacing: 0.1em;
    direction: ltr;
}

.answer-container {
    display: flex;
    gap: 1rem;
    max-width: 500px;
    margin: 1.5rem auto;
}

.answer-input {
    flex: 1;
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.2rem;
    text-align: center;
}

.answer-input:focus {
    border-color: var(--accent);
    outline: none;
}

.answer-input.correct {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.answer-input.wrong {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

/* Flash Read Game */
.flash-container {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}

.flash-word {
    font-size: 4rem;
    font-weight: bold;
    color: var(--accent);
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.1s ease;
}

.flash-word.visible {
    opacity: 1;
    transform: scale(1);
}

.ready-text {
    text-align: center;
    font-size: 1.2rem;
    color: var(--text-muted);
    animation: pulse 1s ease infinite;
}

.question-container {
    text-align: center;
    margin: 1.5rem 0;
}

.question-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.question-text {
    font-size: 1.3rem;
}

/* Opposites Game */
.word-display-container {
    text-align: center;
    margin: 2rem 0;
    padding: 0 10px;
}

.word-label {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.main-word {
    font-size: 3.5rem;
    font-weight: bold;
    color: var(--accent);
    word-break: break-word;
}

@media (max-width: 480px) {
    .word-display-container {
        margin: 1rem 0;
    }
    
    .main-word {
        font-size: 2rem;
    }
    
    .word-label {
        font-size: 0.9rem;
    }
}

.opposite-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 1.5rem auto;
    width: 100%;
}

@media (max-width: 480px) {
    .opposite-options {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 0 10px;
    }
}

.opposite-option {
    padding: 1.2rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 50px;
}

@media (max-width: 480px) {
    .opposite-option {
        padding: 1rem;
        font-size: 1.1rem;
    }
}

.opposite-option:hover:not(:disabled) {
    border-color: var(--accent);
    background: rgba(99, 102, 241, 0.2);
}

.opposite-option.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.opposite-option.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* Analogies Game */
.analogy-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 2rem 0;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
}

.analogy-pair {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.analogy-word {
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    padding: 0.8rem 1.2rem;
    border-radius: 10px;
    font-size: 1.2rem;
    font-weight: bold;
}

.analogy-word.mystery {
    background: rgba(239, 68, 68, 0.3);
    border: 2px dashed #ef4444;
    font-size: 1.5rem;
}

.analogy-separator {
    font-size: 1.5rem;
    color: var(--text-muted);
}

.analogy-equals {
    font-size: 2rem;
    color: var(--accent);
    font-weight: bold;
}

.analogy-type-badge {
    text-align: center;
    margin-bottom: 1rem;
}

.analogy-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 1rem auto;
}

.analogy-option {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.analogy-option:hover:not(:disabled) {
    border-color: var(--accent);
}

.analogy-option.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.analogy-option.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* Time Bomb Game */
.bomb-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
}

.bomb-visual {
    position: relative;
    text-align: center;
    transition: all 0.3s ease;
}

.bomb-body {
    font-size: 5rem;
    animation: bomb-shake 0.5s ease infinite;
}

.bomb-timer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: bold;
    color: white;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.bomb-visual.warning .bomb-body {
    animation: bomb-shake 0.3s ease infinite;
}

.bomb-visual.critical .bomb-body {
    animation: bomb-shake 0.1s ease infinite;
    filter: hue-rotate(30deg);
}

.bomb-visual.defused .bomb-body {
    animation: none;
    filter: grayscale(1);
}

.bomb-visual.exploded .explosion {
    font-size: 8rem;
    animation: explosion 0.5s ease;
}

@keyframes bomb-shake {
    0%, 100% { transform: rotate(-2deg); }
    50% { transform: rotate(2deg); }
}

@keyframes explosion {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.5); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.question-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    margin: 1rem 0;
}

.question-box .question-text {
    font-size: 1.4rem;
}

.bomb-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 1rem auto;
}

.bomb-option {
    padding: 1rem;
    border-radius: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bomb-option:hover:not(:disabled) {
    border-color: #f97316;
    background: rgba(249, 115, 22, 0.2);
}

.bomb-option.correct {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
}

.bomb-option.wrong {
    background: rgba(239, 68, 68, 0.3);
    border-color: #ef4444;
}

/* Hidden Word Game */
.puzzle-container {
    background: rgba(255, 255, 255, 0.05);
    padding: 2rem;
    border-radius: 16px;
    margin: 1.5rem 0;
    text-align: center;
}

.puzzle-text {
    font-size: 2rem;
    letter-spacing: 0.05em;
    direction: rtl;
}

.puzzle-char {
    cursor: pointer;
    padding: 0.2rem;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.puzzle-char:hover {
    background: rgba(99, 102, 241, 0.3);
}

.puzzle-char.selected {
    background: var(--accent);
    color: white;
}

.puzzle-char.revealed {
    background: rgba(16, 185, 129, 0.3);
    color: #10b981;
}

.noise-char {
    color: var(--text-muted);
}

.hidden-char {
    color: var(--text);
}

.selection-display {
    text-align: center;
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
}

.selection-label {
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.selection-text {
    font-size: 1.3rem;
    font-weight: bold;
    color: var(--accent);
}

/* What Changed Game */
.sentences-comparison {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1.5rem 0;
}

.sentence-box {
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
    border-radius: 12px;
}

.sentence-box.original {
    border-right: 4px solid var(--accent);
}

.sentence-box.changed {
    border-right: 4px solid #f97316;
}

.sentence-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sentence-box .sentence-text {
    font-size: 1.3rem;
    line-height: 1.8;
}

.vs-divider {
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent);
}

.clickable-words {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.clickable-word {
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clickable-word:hover {
    background: rgba(99, 102, 241, 0.3);
}

.clickable-word.correct {
    background: rgba(16, 185, 129, 0.3);
    border: 2px solid #10b981;
}

.clickable-word.wrong {
    background: rgba(239, 68, 68, 0.3);
}

.clickable-word.revealed {
    background: rgba(249, 115, 22, 0.3);
    border: 2px solid #f97316;
}

/* Color Word (Stroop) Game */
.stroop-example {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.stroop-example .example-word {
    font-size: 2rem;
    font-weight: bold;
}

.stroop-example .example-hint {
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.stroop-instruction {
    text-align: center;
    font-size: 1.1rem;
    margin: 1rem 0;
}

.stroop-word-container {
    text-align: center;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 16px;
}

.stroop-word {
    font-size: 4rem;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.color-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    max-width: 500px;
    margin: 1.5rem auto;
}

.color-option {
    padding: 1.2rem;
    border-radius: 12px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

.color-option:hover:not(:disabled) {
    transform: scale(1.05);
    border-color: white;
}

.color-option.correct {
    border-color: white;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
}

.color-option.wrong {
    opacity: 0.5;
    border-color: rgba(255, 255, 255, 0.1);
}

/* Timer stat variations */
.timer-stat.memorize {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--accent);
}

.timer-stat.recall {
    background: rgba(249, 115, 22, 0.2);
    border-color: #f97316;
}

/* Game examples */
.game-example {
    text-align: center;
    margin: 1.5rem 0;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.example-label {
    color: var(--text-muted);
    margin-left: 0.5rem;
}

.example-reversed, .example-correct, .example-chain, .example-word, .example-opposite {
    font-weight: bold;
    color: var(--accent);
}

.example-arrow {
    margin: 0 0.5rem;
    color: var(--text-muted);
}

.analogy-example {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Bomb warning */
.bomb-warning {
    text-align: center;
    padding: 1rem;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
}

.warning-icon {
    margin-left: 0.5rem;
}

/* Game tip */
.game-tip {
    text-align: center;
    padding: 0.8rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: 10px;
    margin: 1rem 0;
}

.tip-icon {
    margin-left: 0.5rem;
}

/* ========================================
   تحسينات الأداء للموبايل
   ======================================== */

/* تقليل الرسوميات الثقيلة على الموبايل */
@media (max-width: 768px) {
    /* تعطيل الخلفيات المتدرجة الثقيلة */
    body {
        background-image: none;
        background: var(--bg-dark);
    }
    
    /* تبسيط الظلال */
    .exercise-card,
    .stat-card,
    .feature-card {
        box-shadow: var(--shadow-sm);
    }
    
    /* تعطيل الأشكال العائمة */
    .floating-shapes,
    .shape {
        display: none !important;
    }
    
    /* تقليل الحركات */
    .hero-bg {
        background: transparent;
    }
    
    /* تحسين أداء التمرير */
    .main-content {
        -webkit-overflow-scrolling: touch;
    }
    
    /* تقليل حجم الخطوط الكبيرة */
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    /* تبسيط الأزرار */
    .btn {
        transition: none;
    }
    
    /* تحسين المودال */
    .modal-content {
        max-height: 90vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* تقليل padding */
    .section-container {
        padding: 1rem;
    }
    
    /* تحسين الشبكة */
    .exercises-grid,
    .features-grid {
        gap: 1rem;
    }
}

/* تحسينات إضافية للشاشات الصغيرة جداً */
@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
    
    .hero-title {
        font-size: 1.75rem;
    }
    
    .exercise-card {
        padding: 1rem;
    }
    
    .game-results {
        padding: 1rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .result-card {
        padding: 0.75rem;
    }
    
    /* تصغير الأيقونات */
    .exercise-icon {
        font-size: 2rem;
    }
    
    /* تحسين الأزرار */
    .results-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .results-actions .btn {
        width: 100%;
    }
}

/* تعطيل الحركات للمستخدمين الذين يفضلون تقليلها */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* تحسين touch targets للموبايل */
@media (pointer: coarse) {
    .btn,
    .nav-link,
    .exercise-card,
    .level-btn,
    .option-btn {
        min-height: 44px;
        min-width: 44px;
    }
    
    .nav-toggle span {
        height: 3px;
    }
}
