/* ============================================
   ENGLISH ADVENTURE GAME - CSS COMPLETE
   Version: 3.1.3 - Complete & Fixed Version
   ============================================ */

/* ============= PHẦN 1: RESET & BASE STYLES ============= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:root {
    /* ============= MÀU SẮC CHÍNH ============= */
    --color-primary: #4ECDC4;       /* Màu xanh ngọc sáng */
    --color-secondary: #FF6B6B;     /* Màu đỏ cam tươi sáng */
    --color-accent: #FFD166;        /* Màu vàng cam */
    --color-success: #06D6A0;       /* Màu xanh lá sáng */
    --color-warning: #FF9E6D;       /* Màu cam nhạt */
    --color-danger: #EF476F;        /* Màu hồng đậm */
    --color-info: #118AB2;          /* Màu xanh dương sáng */
    --color-dark: #2D3047;          /* Màu xanh đậm */
    --color-light: #F7FFF7;         /* Màu trắng xanh nhạt */
    
    /* ============= GRADIENTS ============= */
    --gradient-primary: linear-gradient(135deg, #4ECDC4 0%, #44A08D 100%);
    --gradient-secondary: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 100%);
    --gradient-accent: linear-gradient(135deg, #FFD166 0%, #FFB347 100%);
    --gradient-success: linear-gradient(135deg, #06D6A0 0%, #0CB48A 100%);
    --gradient-dark: linear-gradient(135deg, #2D3047 0%, #1A1C2C 100%);
    --gradient-rainbow: linear-gradient(135deg, #FF6B6B, #FFD166, #06D6A0, #118AB2, #9D4EDD);
    
    /* ============= SHADOWS ============= */
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.15);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.2);
    --shadow-xl: 0 16px 48px rgba(0,0,0,0.25);
    --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.1);
    
    /* ============= BORDER RADIUS ============= */
    --radius-sm: 10px;
    --radius-md: 15px;
    --radius-lg: 20px;
    --radius-xl: 25px;
    --radius-circle: 50%;
    
    /* ============= FONTS ============= */
    --font-primary: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
    --font-secondary: 'Nunito', 'Quicksand', 'Fredoka One', sans-serif;
    --font-size-xs: 12px;
    --font-size-sm: 14px;
    --font-size-md: 16px;
    --font-size-lg: 18px;
    --font-size-xl: 24px;
    --font-size-2xl: 32px;
    --font-size-3xl: 48px;
    --font-size-4xl: 64px;
    
    /* ============= TRANSITIONS ============= */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    
    /* ============= Z-INDEX ============= */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-notification: 1080;
    --z-max: 9999;
}

/* ============= PHẦN 2: BASE STYLES & RESET ============= */
html, body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    font-family: var(--font-primary);
    font-size: 16px;
    line-height: 1.5;
    color: var(--color-dark);
    background: var(--gradient-primary);
    touch-action: manipulation;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: none;
}

#english-adventure-game-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: var(--gradient-primary);
    z-index: var(--z-max) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    font-family: var(--font-primary) !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-sizing: border-box !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    -webkit-overflow-scrolling: touch !important;
}

/* ============= PHẦN 3: TYPOGRAPHY & FONTS ============= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-secondary);
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
    letter-spacing: 0.5px;
}

h1 {
    font-size: var(--font-size-3xl);
    background: var(--gradient-rainbow);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rainbow-text 3s ease infinite;
}

h2 {
    font-size: var(--font-size-2xl);
    color: var(--color-dark);
}

h3 {
    font-size: var(--font-size-xl);
    color: var(--color-primary);
}

h4 {
    font-size: var(--font-size-lg);
    color: var(--color-secondary);
}

p {
    margin-bottom: 1rem;
    font-size: var(--font-size-md);
    color: var(--color-dark);
    line-height: 1.6;
}

/* ============= PHẦN 4: BUTTONS & INTERACTIVE ELEMENTS ============= */
button {
    font-family: var(--font-secondary);
    font-weight: 700;
    border: none;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-bounce);
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

button:active {
    transform: scale(0.95);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

.eag-start-button {
    background: var(--gradient-secondary);
    color: white;
    padding: 18px 32px;
    border-radius: var(--radius-lg);
    font-size: var(--font-size-lg);
    font-weight: 800;
    box-shadow: var(--shadow-lg);
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
    border: 3px solid rgba(255,255,255,0.3);
    animation: pulse-button 2s infinite;
}

.eag-start-button:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
    background: var(--gradient-secondary);
}

.eag-start-button:active {
    transform: translateY(-2px);
}

.eag-back-button {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-circle);
    background: rgba(255,255,255,0.2);
    color: white;
    font-size: var(--font-size-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.eag-nav-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    color: #666;
    font-size: var(--font-size-xs);
    gap: 5px;
    cursor: pointer;
    padding: 10px;
    border-radius: var(--radius-md);
    min-width: 70px;
    transition: all var(--transition-normal);
}

.eag-nav-btn.active {
    color: var(--color-primary);
    background: rgba(78, 205, 196, 0.1);
}

.eag-nav-btn:hover {
    transform: translateY(-3px);
    color: var(--color-primary);
}

.eag-pronounce-btn {
    background: var(--gradient-primary);
    color: white;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: var(--font-size-md);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
}

.eag-pronounce-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

/* ============= PHẦN 5: CARDS & CONTAINERS ============= */
.eag-game-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    cursor: pointer;
    transition: all var(--transition-bounce);
    box-shadow: var(--shadow-lg);
    position: relative;
    border: 3px solid transparent;
    background-clip: padding-box;
    overflow: hidden;
}

.eag-game-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-rainbow);
    animation: rainbow-border 3s linear infinite;
}

.eag-game-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: var(--shadow-xl);
}

.eag-game-card .eag-game-icon {
    font-size: var(--font-size-4xl);
    text-align: center;
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.eag-game-card .eag-game-title {
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-dark);
    text-align: center;
    margin-bottom: 10px;
}

.eag-game-card .eag-game-desc {
    color: #666;
    font-size: var(--font-size-sm);
    text-align: center;
    margin-bottom: 15px;
    line-height: 1.4;
}

.eag-vocab-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 15px;
    cursor: pointer;
    transition: all var(--transition-normal);
    box-shadow: var(--shadow-md);
    border-left: 5px solid var(--color-primary);
    animation: slide-in 0.5s ease;
}

.eag-vocab-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-lg);
}

.eag-vocab-card.eag-vocab-learned {
    border-left-color: var(--color-success);
    background: rgba(6, 214, 160, 0.05);
}

.eag-stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    border: 2px solid transparent;
}

.eag-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.eag-stat-card .eag-stat-icon {
    font-size: var(--font-size-3xl);
    margin-bottom: 10px;
}

.eag-stat-card .eag-stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.eag-stat-card .eag-stat-label {
    color: #666;
    font-size: var(--font-size-sm);
}

/* ============= PHẦN 6: HEADERS & NAVIGATION ============= */
.eag-game-header {
    background: var(--gradient-dark);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: var(--z-sticky);
}

.eag-game-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-rainbow);
    animation: rainbow-border 3s linear infinite;
}

.eag-player-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.eag-player-avatar {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    border: 3px solid white;
    box-shadow: var(--shadow-md);
    animation: spin 20s linear infinite;
}

.eag-player-details h3 {
    color: white;
    margin: 0;
    font-size: var(--font-size-lg);
}

.eag-points-display {
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-xl);
    font-weight: 800;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
}

.eag-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: white;
    border-top: 3px solid var(--color-primary);
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.1);
    z-index: var(--z-fixed);
}

/* ============= PHẦN 7: MAIN CONTENT AREA ============= */
.eag-main-content {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding-bottom: 80px; /* Space for bottom nav */
    animation: fade-in 0.5s ease;
}

.eag-welcome-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--gradient-primary);
    color: white;
    text-align: center;
}

.eag-welcome-logo {
    animation: bounce-in 1s ease;
}

.eag-welcome-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: 20px;
    animation: float 3s ease-in-out infinite;
}

.eag-welcome-stats {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.eag-welcome-stat-item {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    animation: scale-in 0.5s ease;
}

.eag-welcome-stat-item .eag-stat-icon {
    font-size: var(--font-size-2xl);
    display: block;
    margin-bottom: 10px;
}

.eag-welcome-stat-item .eag-stat-value {
    font-size: var(--font-size-2xl);
    font-weight: 800;
    display: block;
    margin-bottom: 5px;
}

.eag-welcome-features {
    background: rgba(255,255,255,0.1);
    padding: 25px;
    border-radius: var(--radius-lg);
    margin: 30px 0;
    backdrop-filter: blur(10px);
    text-align: left;
}

.eag-welcome-features ul {
    list-style: none;
    padding: 0;
}

.eag-welcome-features li {
    padding: 10px 0;
    color: white;
    font-size: var(--font-size-md);
}

.eag-welcome-features i {
    color: var(--color-accent);
    margin-right: 10px;
}

/* ============= PHẦN 8: GAME SPECIFIC STYLES ============= */
.eag-game-screen {
    background: white;
    border-radius: var(--radius-lg);
    padding: 25px;
    margin-top: 20px;
    box-shadow: var(--shadow-lg);
    animation: slide-up 0.5s ease;
}

.eag-game-header-section {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-light);
}

.eag-game-icon-large {
    font-size: var(--font-size-4xl);
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: spin 20s linear infinite;
}

.eag-game-progress {
    margin: 25px 0;
}

.eag-game-progress-bar {
    height: 20px;
    background: var(--color-light);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.eag-game-progress-fill {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 10px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.eag-game-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.3) 50%, 
        transparent 100%);
    animation: shimmer 2s infinite;
}

.eag-game-content {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.eag-game-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* ============= PHẦN 9: TEST & QUIZ STYLES ============= */
.eag-test-screen {
    background: white;
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-lg);
}

.eag-test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--color-light);
}

.eag-test-question-content {
    animation: fade-in 0.5s ease;
}

.eag-test-word-display {
    text-align: center;
    margin-bottom: 30px;
}

.eag-test-word-image {
    font-size: var(--font-size-4xl);
    margin-bottom: 15px;
    animation: bounce 2s infinite;
}

.eag-test-choices {
    display: grid;
    gap: 15px;
    margin: 30px 0;
}

.eag-test-choice {
    background: white;
    border: 3px solid var(--color-light);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: left;
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--color-dark);
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 15px;
}

.eag-test-choice:hover {
    transform: translateX(10px);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.eag-test-choice.selected {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.eag-test-choice .eag-choice-letter {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: var(--font-size-lg);
}

/* ============= PHẦN 10: VOCABULARY SCREEN ============= */
.eag-vocab-content {
    display: flex;
    align-items: center;
    gap: 20px;
}

.eag-vocab-image {
    font-size: var(--font-size-3xl);
    min-width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: var(--radius-circle);
    display: flex;
    align-items: center;
    justify-content: center;
}

.eag-learn-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 8px;
}

.eag-learn-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-md);
}

.eag-learn-btn.eag-learned {
    background: var(--gradient-success);
}

/* ============= PHẦN 11: PROGRESS & STATS ============= */
.eag-progress-container {
    height: 10px;
    background: var(--color-light);
    border-radius: 5px;
    overflow: hidden;
    margin: 10px 0;
}

.eag-progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    border-radius: 5px;
    transition: width 0.5s ease;
}

.eag-progress-circle {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    position: relative;
    margin: 0 auto 20px;
}

.eag-progress-inner {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 10px;
    bottom: 10px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-xl);
    font-weight: 800;
    color: var(--color-primary);
}

/* ============= PHẦN 12: NOTIFICATIONS & POPUPS ============= */
.eag-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow-xl);
    z-index: var(--z-notification);
    animation: slide-in-right 0.5s ease;
    max-width: 400px;
    border-left: 5px solid var(--color-primary);
}

.eag-notification-success {
    border-left-color: var(--color-success);
}

.eag-notification-error {
    border-left-color: var(--color-danger);
}

.eag-notification-warning {
    border-left-color: var(--color-warning);
}

.eag-notification-info {
    border-left-color: var(--color-info);
}

.eag-reward-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--radius-xl);
    padding: 40px;
    box-shadow: var(--shadow-xl);
    z-index: var(--z-modal);
    animation: pop-in 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    text-align: center;
    border: 5px solid var(--color-primary);
    max-width: 90%;
    width: 400px;
}

.eag-reward-icon {
    font-size: var(--font-size-4xl);
    margin-bottom: 20px;
    animation: tada 1s ease;
}

/* ============= PHẦN 13: ANIMATIONS ============= */
@keyframes rainbow-text {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes rainbow-border {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@keyframes bounce-in {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); opacity: 1; }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes pulse-button {
    0%, 100% { box-shadow: var(--shadow-lg); }
    50% { box-shadow: 0 0 30px rgba(255, 107, 107, 0.5); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slide-in {
    from { transform: translateX(-100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-in-right {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slide-up {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scale-in {
    from { transform: scale(0.5); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pop-in {
    0% { transform: translate(-50%, -50%) scale(0); }
    50% { transform: translate(-50%, -50%) scale(1.1); }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes tada {
    0% { transform: scale(1); }
    10%, 20% { transform: scale(0.9) rotate(-3deg); }
    30%, 50%, 70%, 90% { transform: scale(1.1) rotate(3deg); }
    40%, 60%, 80% { transform: scale(1.1) rotate(-3deg); }
    100% { transform: scale(1) rotate(0); }
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ============= PHẦN 14: RESPONSIVE DESIGN ============= */
@media (max-width: 768px) {
    :root {
        --font-size-4xl: 48px;
        --font-size-3xl: 36px;
        --font-size-2xl: 28px;
        --font-size-xl: 22px;
        --font-size-lg: 18px;
        --font-size-md: 16px;
    }
    
    #english-adventure-game-container {
        padding: 10px !important;
    }
    
    .eag-main-content {
        padding: 15px;
        padding-bottom: 70px;
    }
    
    .eag-game-header {
        padding: 15px;
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .eag-player-info {
        flex-direction: column;
        text-align: center;
    }
    
    .eag-welcome-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .eag-game-card {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .eag-test-choices {
        grid-template-columns: 1fr;
    }
    
    .eag-bottom-nav {
        padding: 8px 0;
    }
    
    .eag-nav-btn {
        min-width: 60px;
        font-size: 11px;
        padding: 8px;
    }
    
    .eag-start-button {
        padding: 15px 25px;
        font-size: var(--font-size-md);
        min-height: 50px;
    }
    
    .eag-reward-popup {
        width: 95%;
        padding: 30px 20px;
    }
    
    .eag-game-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .eag-game-controls button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    :root {
        --font-size-4xl: 36px;
        --font-size-3xl: 28px;
        --font-size-2xl: 24px;
        --font-size-xl: 20px;
        --font-size-lg: 16px;
        --font-size-md: 14px;
    }
    
    .eag-player-avatar {
        width: 50px;
        height: 50px;
        font-size: var(--font-size-xl);
    }
    
    .eag-points-display {
        padding: 8px 16px;
        font-size: var(--font-size-lg);
    }
    
    .eag-vocab-content {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .eag-learn-btn {
        width: 100%;
        justify-content: center;
    }
    
    .eag-game-icon-large {
        width: 60px;
        height: 60px;
        font-size: var(--font-size-3xl);
    }
    
    .eag-test-choice {
        padding: 15px;
        font-size: var(--font-size-md);
    }
    
    .eag-test-choice .eag-choice-letter {
        width: 35px;
        height: 35px;
        font-size: var(--font-size-md);
    }
}

/* ============= PHẦN 15: SPECIAL EFFECTS ============= */
.eag-particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: var(--gradient-rainbow);
    border-radius: 50%;
    pointer-events: none;
    z-index: var(--z-max);
}

.eag-confetti {
    position: fixed;
    width: 15px;
    height: 15px;
    background: var(--gradient-rainbow);
    animation: fall linear forwards;
    z-index: var(--z-tooltip);
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}

/* ============= PHẦN 16: LOADING STATES ============= */
.eag-loading {
    width: 50px;
    height: 50px;
    border: 5px solid var(--color-light);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.eag-skeleton {
    background: linear-gradient(90deg, 
        var(--color-light) 25%, 
        rgba(255,255,255,0.5) 50%, 
        var(--color-light) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ============= PHẦN 17: SCROLLBAR STYLING ============= */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ============= PHẦN 18: ACCESSIBILITY ============= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============= PHẦN 19: PRINT STYLES ============= */
@media print {
    #english-adventure-game-container {
        position: static !important;
        height: auto !important;
        overflow: visible !important;
    }
    
    .eag-bottom-nav,
    .eag-game-controls,
    button {
        display: none !important;
    }
}

/* ============= PHẦN 20: UTILITY CLASSES ============= */
.eag-text-center { text-align: center; }
.eag-text-left { text-align: left; }
.eag-text-right { text-align: right; }
.eag-text-primary { color: var(--color-primary); }
.eag-text-secondary { color: var(--color-secondary); }
.eag-text-success { color: var(--color-success); }
.eag-text-danger { color: var(--color-danger); }
.eag-text-warning { color: var(--color-warning); }
.eag-text-info { color: var(--color-info); }

.eag-bg-primary { background: var(--gradient-primary); }
.eag-bg-secondary { background: var(--gradient-secondary); }
.eag-bg-success { background: var(--gradient-success); }
.eag-bg-danger { background: linear-gradient(135deg, var(--color-danger), #D43A5E); }
.eag-bg-warning { background: linear-gradient(135deg, var(--color-warning), #FF7A45); }
.eag-bg-info { background: linear-gradient(135deg, var(--color-info), #0D7A9C); }

.eag-mt-1 { margin-top: 0.5rem; }
.eag-mt-2 { margin-top: 1rem; }
.eag-mt-3 { margin-top: 1.5rem; }
.eag-mt-4 { margin-top: 2rem; }
.eag-mt-5 { margin-top: 3rem; }

.eag-mb-1 { margin-bottom: 0.5rem; }
.eag-mb-2 { margin-bottom: 1rem; }
.eag-mb-3 { margin-bottom: 1.5rem; }
.eag-mb-4 { margin-bottom: 2rem; }
.eag-mb-5 { margin-bottom: 3rem; }

.eag-p-1 { padding: 0.5rem; }
.eag-p-2 { padding: 1rem; }
.eag-p-3 { padding: 1.5rem; }
.eag-p-4 { padding: 2rem; }
.eag-p-5 { padding: 3rem; }

.eag-hidden { display: none !important; }
.eag-visible { display: block !important; }
.eag-flex { display: flex; }
.eag-grid { display: grid; }
.eag-block { display: block; }
.eag-inline-block { display: inline-block; }

/* ============= PHẦN 21: GAME-SPECIFIC OVERRIDES ============= */
.eag-correct-answer {
    background: var(--gradient-success) !important;
    color: white !important;
    border-color: var(--color-success) !important;
}

.eag-wrong-answer {
    background: var(--gradient-danger) !important;
    color: white !important;
    border-color: var(--color-danger) !important;
}

.eag-match-word {
    cursor: move;
    user-select: none;
    transition: all var(--transition-normal);
}

.eag-match-target {
    transition: all var(--transition-normal);
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.eag-match-target.eag-correct-match {
    border-color: var(--color-success) !important;
    background: rgba(6, 214, 160, 0.1) !important;
}

.eag-match-target.eag-wrong-match {
    border-color: var(--color-danger) !important;
    background: rgba(239, 71, 111, 0.1) !important;
}

.eag-memory-card {
    width: 100px;
    height: 100px;
    perspective: 1000px;
    cursor: pointer;
}

.eag-memory-card-front,
.eag-memory-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-size-2xl);
    transition: transform 0.6s;
}

.eag-memory-card-front {
    background: var(--gradient-primary);
    color: white;
}

.eag-memory-card-back {
    background: white;
    color: var(--color-dark);
    transform: rotateY(180deg);
}

.eag-memory-card.flipped .eag-memory-card-front {
    transform: rotateY(180deg);
}

.eag-memory-card.flipped .eag-memory-card-back {
    transform: rotateY(0deg);
}

.eag-memory-card.matched {
    opacity: 0.5;
    cursor: default;
}

/* ============= PHẦN 22: FIXED ISSUES ============= */
.eag-fixed-container {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    overflow-y: auto !important;
}

.eag-no-scroll {
    overflow: hidden !important;
}

.eag-force-show {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* ============= PHẦN 23: GAME CATEGORY COLORS ============= */
.eag-category-vocabulary { border-color: #FF6B6B; }
.eag-category-grammar { border-color: #FFD166; }
.eag-category-memory { border-color: #4ECDC4; }
.eag-category-listening { border-color: #06D6A0; }
.eag-category-speaking { border-color: #118AB2; }
.eag-category-reading { border-color: #9D4EDD; }
.eag-category-writing { border-color: #FF9E6D; }
.eag-category-puzzle { border-color: #EF476F; }
.eag-category-speed { border-color: #8338EC; }
.eag-category-spelling { border-color: #3A86FF; }

/* ============= PHẦN 24: FINAL TOUCHES ============= */
.eag-shake {
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.eag-zoom-in {
    animation: zoom-in 0.3s ease;
}

@keyframes zoom-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ============= PHẦN 25: IMPORTANT OVERRIDES ============= */
.eag-fullscreen {
    width: 100vw !important;
    height: 100vh !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    min-width: 100vw !important;
    min-height: 100vh !important;
}

.eag-force-block {
    display: block !important;
}

.eag-force-flex {
    display: flex !important;
}

.eag-force-grid {
    display: grid !important;
}

/* ============= PHẦN 26: MEDIA QUERIES FOR ORIENTATION ============= */
@media (orientation: portrait) {
    .eag-main-content {
        max-width: 100%;
    }
    
    .eag-game-card,
    .eag-vocab-card,
    .eag-stat-card {
        width: 100%;
    }
}

@media (orientation: landscape) and (max-height: 600px) {
    .eag-game-header {
        padding: 10px 20px;
    }
    
    .eag-player-avatar {
        width: 40px;
        height: 40px;
        font-size: var(--font-size-lg);
    }
    
    .eag-main-content {
        padding-bottom: 60px;
    }
    
    .eag-bottom-nav {
        padding: 5px 0;
    }
}

/* ============= PHẦN 27: SAFARI FIXES ============= */
@supports (-webkit-touch-callout: none) {
    #english-adventure-game-container {
        height: -webkit-fill-available;
    }
    
    .eag-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ============= PHẦN 28: HIGH CONTRAST MODE ============= */
@media (prefers-contrast: high) {
    :root {
        --color-primary: #00A896;
        --color-secondary: #FF4D4D;
        --color-success: #00A896;
        --color-danger: #FF4D4D;
        --color-warning: #FFA500;
        --color-info: #0066CC;
    }
}

/* ============= PHẦN 29: DARK MODE SUPPORT ============= */
@media (prefers-color-scheme: dark) {
    :root {
        --color-dark: #F7FFF7;
        --color-light: #2D3047;
    }
    
    body {
        background: var(--gradient-dark);
    }
    
    .eag-game-card,
    .eag-vocab-card,
    .eag-stat-card {
        background: rgba(45, 48, 71, 0.9);
        color: var(--color-dark);
    }
}

/* ============= PHẦN 30: FINAL CLEANUP ============= */
.eag-clearfix::after {
    content: "";
    clear: both;
    display: table;
}

.eag-screen-reader-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   BUTTONS
   ============================================ */
.eag-start-button, .eag-start-game-btn {
  background: var(--gradient-accent);
  color: var(--color-dark);
  border: none;
  padding: 15px 30px;
  font-size: var(--font-size-lg);
  font-weight: bold;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  animation: pulse 2s infinite;
}

.eag-start-button:hover, .eag-start-game-btn:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  animation: none;
  border-radius: var(--border-radius-lg); /* Thêm để đảm bảo kế thừa, nhưng không cần thiết */
}

.eag-start-button:active, .eag-start-game-btn:active {
  transform: translateY(0);
  border-radius: var(--border-radius-lg); /* Thêm để đảm bảo */
}

.eag-back-button {
  background: var(--color-white);
  color: var(--color-primary);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  font-size: var(--font-size-lg);
}

.eag-back-button:hover {
  background: var(--color-primary);
  color: var(--color-white);
  transform: scale(1.1);
  border-radius: var(--border-radius-circle); /* Thêm để đảm bảo */
}

.eag-back-button:active {
  border-radius: var(--border-radius-circle); /* Thêm để đảm bảo */
}

.eag-nav-btn {
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 10px;
  cursor: pointer;
  transition: all var(--transition-normal);
  color: var(--color-dark);
  border-radius: var(--border-radius-sm);
  width: 70px;
}

.eag-nav-btn.active {
  color: var(--color-primary);
  background: rgba(255, 107, 107, 0.1);
  transform: translateY(-5px);
  border-radius: var(--border-radius-sm); /* Thêm để đảm bảo */
}

.eag-nav-btn:hover:not(.active) {
  color: var(--color-secondary);
  transform: translateY(-3px);
  border-radius: var(--border-radius-sm); /* Thêm để đảm bảo */
}

.eag-nav-btn i {
  font-size: var(--font-size-xl);
}

.eag-nav-btn span {
  font-size: var(--font-size-xs);
  font-weight: bold;
}
/*=============== nút trà lời trong game tháp từ vựng =========*/
/* Container for strategy choices */
.eag-strategy-choices {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 20px 0;
}

/* Individual strategy choice button */
.eag-strategy-choice {
  display: flex;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--color-white), #f8f9fa);
  border: 2px solid #e9ecef;
  border-radius: var(--border-radius-lg);
  cursor: pointer;
  transition: all var(--transition-normal);
  text-align: left;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.eag-strategy-choice:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary-light);
  background: linear-gradient(135deg, #ffffff, #f0f7ff);
}

.eag-strategy-choice:active {
  transform: translateY(-1px);
}

/* Choice number circle */
.eag-choice-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  min-width: 36px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--border-radius-circle);
  font-weight: bold;
  font-size: var(--font-size-md);
  transition: all var(--transition-normal);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.eag-strategy-choice:hover .eag-choice-number {
  background: var(--color-primary);
  color: var(--color-white);
  transform: scale(1.1);
}

/* Choice text */
.eag-choice-text {
  flex: 1;
  font-size: var(--font-size-md);
  color: var(--color-dark);
  font-weight: 500;
  line-height: 1.5;
  transition: all var(--transition-normal);
}

.eag-strategy-choice:hover .eag-choice-text {
  color: var(--color-primary-dark);
}

/* Correct/Incorrect states (can be added via JavaScript) */
.eag-strategy-choice.correct {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: #28a745;
  animation: pulseCorrect 0.5s ease;
}

.eag-strategy-choice.correct .eag-choice-number {
  background: #28a745;
  color: white;
}

.eag-strategy-choice.incorrect {
  background: linear-gradient(135deg, #f8d7da, #f5c6cb);
  border-color: #dc3545;
  animation: shake 0.5s ease;
}

.eag-strategy-choice.incorrect .eag-choice-number {
  background: #dc3545;
  color: white;
}

/* Selected state */
.eag-strategy-choice.selected {
  border-color: var(--color-primary);
  background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.eag-strategy-choice.selected .eag-choice-number {
  background: var(--color-primary);
  color: white;
}

/* Disabled state */
.eag-strategy-choice.disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.eag-strategy-choice.disabled:hover {
  transform: none;
  box-shadow: var(--shadow-sm);
  border-color: #e9ecef;
}

/* Animations */
@keyframes pulseCorrect {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Responsive design */
@media (max-width: 768px) {
  .eag-strategy-choices {
    gap: 10px;
    padding: 15px 0;
  }
  
  .eag-strategy-choice {
    padding: 15px;
    gap: 12px;
  }
  
  .eag-choice-number {
    width: 32px;
    height: 32px;
    min-width: 32px;
    font-size: var(--font-size-sm);
  }
  
  .eag-choice-text {
    font-size: var(--font-size-sm);
  }
}

@media (max-width: 480px) {
  .eag-strategy-choices {
    gap: 8px;
  }
  
  .eag-strategy-choice {
    padding: 12px;
    gap: 10px;
  }
  
  .eag-choice-number {
    width: 28px;
    height: 28px;
    min-width: 28px;
    font-size: var(--font-size-xs);
  }
  
  .eag-choice-text {
    font-size: var(--font-size-xs);
    line-height: 1.4;
  }
}
/* Next Level Card - Cute Compact Style */
.eag-next-level {
  background: linear-gradient(135deg, #fff8f0, #fff0f5);
  border: 3px dashed #ffb6c1;
  border-radius: 20px;
  padding: 20px;
  margin: 20px 0;
  text-align: center;
  box-shadow: 0 8px 20px rgba(255, 182, 193, 0.2);
  position: relative;
  overflow: hidden;
}

.eag-next-level:before {
  content: "✨";
  position: absolute;
  top: -15px;
  left: 20px;
  font-size: 24px;
  animation: sparkle 2s infinite;
}

.eag-next-level:after {
  content: "✨";
  position: absolute;
  bottom: -15px;
  right: 20px;
  font-size: 24px;
  animation: sparkle 2s infinite reverse;
}

.eag-next-level h4 {
  color: #ff6b8b;
  font-size: 1.4rem;
  margin: 0 0 10px 0;
  font-weight: 700;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

.eag-next-level p {
  color: #666;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.5;
  font-weight: 500;
}

/* Result Actions - Cute Button Group */
.eag-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 25px;
  max-width: 300px;
  margin-left: auto;
  margin-right: auto;
}

/* Action Button Style */
.eag-action-btn {
  background: linear-gradient(135deg, #a8e6cf, #85e0c1);
  color: #2d6a4f;
  border: 3px solid #7ad6b8;
  border-radius: 50px;
  padding: 14px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 0 #7ad6b8;
  position: relative;
  overflow: hidden;
}

.eag-action-btn:before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: 0.5s;
}

.eag-action-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 0 #7ad6b8;
  background: linear-gradient(135deg, #85e0c1, #6ad4ac);
}

.eag-action-btn:hover:before {
  left: 100%;
}

.eag-action-btn:active {
  transform: translateY(-2px);
  box-shadow: 0 2px 0 #7ad6b8;
}

.eag-action-btn span {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Different color for the second action button */
.eag-result-actions .eag-action-btn:nth-child(2) {
  background: linear-gradient(135deg, #ffd3b6, #ffaaa5);
  border-color: #ff8b94;
  color: #9d4b4b;
  box-shadow: 0 4px 0 #ff8b94;
}

.eag-result-actions .eag-action-btn:nth-child(2):hover {
  background: linear-gradient(135deg, #ffaaa5, #ff8b94);
  box-shadow: 0 8px 0 #ff8b94;
}

.eag-result-actions .eag-action-btn:nth-child(2):active {
  box-shadow: 0 2px 0 #ff8b94;
}

/* Different color for the third action button */
.eag-result-actions .eag-action-btn:nth-child(3) {
  background: linear-gradient(135deg, #d4a5ff, #b38fcc);
  border-color: #9d7bcc;
  color: #4a3b6d;
  box-shadow: 0 4px 0 #9d7bcc;
}

.eag-result-actions .eag-action-btn:nth-child(3):hover {
  background: linear-gradient(135deg, #b38fcc, #9d7bcc);
  box-shadow: 0 8px 0 #9d7bcc;
}

.eag-result-actions .eag-action-btn:nth-child(3):active {
  box-shadow: 0 2px 0 #9d7bcc;
}

/* Adjust the existing start button to match the cute style */
.eag-result-actions .eag-start-button {
  border-radius: 50px;
  padding: 16px 20px;
  font-size: 1rem;
  border: 3px solid #ff6b8b;
  box-shadow: 0 6px 0 #ff6b8b;
  animation: bounce 2s infinite;
}

.eag-result-actions .eag-start-button:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 0 #ff6b8b;
  animation: none;
}

.eag-result-actions .eag-start-button:active {
  transform: translateY(-3px);
  box-shadow: 0 3px 0 #ff6b8b;
}

/* Animations */
@keyframes sparkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.9); }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
/* ============================================
   CSS TỔNG HỢP - ỨNG DỤNG HỌC TỪ VỰNG GAME HÓA
   Thiết kế đáng yêu, responsive, PWA-friendly
   Đã sửa: Hiển thị tối ưu trên máy tính & điện thoại
============================================ */

/* ===== BIẾN & RESET ===== */
:root {
  /* Màu sắc chính - bảng màu vui tươi */
  --color-primary: #FF6B6B;
  --color-secondary: #4ECDC4;
  --color-accent: #FFD166;
  --color-success: #06D6A0;
  --color-info: #118AB2;
  --color-warning: #FF9E00;
  --color-danger: #EF476F;
  --color-dark: #073B4C;
  --color-light: #F8F9FA;
  
  /* Màu gradient */
  --gradient-primary: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  --gradient-secondary: linear-gradient(135deg, #4ECDC4, #44A08D);
  --gradient-accent: linear-gradient(135deg, #FFD166, #FFB347);
  --gradient-success: linear-gradient(135deg, #06D6A0, #0CB48A);
  --gradient-info: linear-gradient(135deg, #118AB2, #0A6A8A);
  --gradient-warning: linear-gradient(135deg, #FF9E00, #FF8C00);
  --gradient-gold: linear-gradient(135deg, #FFD700, #FFA500);
  
  /* Kích thước & khoảng cách */
  --border-radius-sm: 12px;
  --border-radius-md: 20px;
  --border-radius-lg: 30px;
  --border-radius-xl: 40px;
  --shadow-sm: 0 4px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.15);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.2);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.1);
  
  /* Font chữ thân thiện với trẻ em */
  --font-primary: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
  --font-secondary: 'Nunito', 'Quicksand', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-dark);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== CONTAINER CHÍNH - FIX HIỂN THỊ ===== */
#app {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.eag-main-screen {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--color-light);
  position: relative;
  overflow-x: hidden;
}

/* ===== HEADER - RESPONSIVE ===== */
.eag-game-header {
  padding: 12px 16px;
  background: var(--gradient-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
  min-height: 70px;
  width: 100%;
}

.eag-back-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  flex-shrink: 0;
}

.eag-back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.eag-points-display {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--border-radius-lg);
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(5px);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== NỘI DUNG CHÍNH - ĐIỀU CHỈNH LAYOUT ===== */
.eag-main-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  padding-bottom: 80px;
}

/* Container giới hạn chiều rộng cho máy tính */
.eag-content-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== CHIẾN THUẬT GAME - LAYOUT CẢI THIỆN ===== */
.eag-strategy-main {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  width: 100%;
  max-width: 100vw;
}

.eag-strategy-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
}

.eag-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.eag-header-title h3 {
  font-size: 1.3rem;
  margin: 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  line-height: 1.2;
}

.eag-header-title p {
  font-size: 0.8rem;
  margin: 4px 0 0;
  opacity: 0.9;
  color: white;
  line-height: 1.2;
}

.eag-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eag-level-badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--border-radius-md);
  padding: 8px 12px;
  text-align: center;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  min-width: 70px;
}

.eag-level-number {
  display: block;
  font-size: 1.6rem;
  font-weight: bold;
  color: white;
  line-height: 1;
}

.eag-level-text {
  font-size: 0.75rem;
  opacity: 0.9;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.eag-player-stats {
  display: flex;
  gap: 8px;
}

.eag-stat {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(5px);
}

.eag-stat-icon {
  font-size: 1.1rem;
}

.eag-stat-value {
  font-weight: bold;
  font-size: 1rem;
  color: white;
}

/* ===== CARD & SECTION - RESPONSIVE ===== */
.eag-level-overview {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.eag-level-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.eag-level-icon-large {
  font-size: 3rem;
  flex-shrink: 0;
  min-width: 60px;
}

.eag-level-details {
  flex: 1;
  min-width: 0;
}

.eag-level-details h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--color-dark);
  line-height: 1.2;
  word-wrap: break-word;
}

.eag-level-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.eag-tag {
  background: var(--color-accent);
  color: var(--color-dark);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

.eag-level-desc {
  color: #666;
  font-size: 0.9rem;
  margin-top: 8px;
  line-height: 1.4;
}

.eag-level-progress-container {
  margin-top: 16px;
  width: 100%;
}

.eag-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #555;
  flex-wrap: wrap;
  gap: 4px;
}

.eag-progress-bar-container {
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--shadow-inner);
  width: 100%;
}

.eag-progress-bar-fill {
  height: 100%;
  background: var(--gradient-success);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* ===== GRID SYSTEMS - RESPONSIVE ===== */
.eag-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.eag-stat-card {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  min-width: 0;
}

.eag-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.eag-stat-card-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.eag-stat-card-content {
  flex: 1;
  min-width: 0;
}

.eag-stat-card-value {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--color-dark);
  line-height: 1;
}

.eag-stat-card-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

/* ===== GAME PREVIEW - RESPONSIVE ===== */
.eag-game-preview {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--color-dark);
  flex-wrap: wrap;
}

.eag-title-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.eag-title-text {
  font-size: 1.1rem;
  line-height: 1.2;
}

.eag-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.eag-preview-left, .eag-preview-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.eag-preview-tower, .eag-preview-enemy {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--color-accent);
  min-width: 120px;
}

.eag-preview-tower {
  border-color: var(--color-info);
}

.eag-preview-enemy {
  border-color: var(--color-danger);
}

.eag-preview-tower-level, .eag-preview-tower-icon, 
.eag-preview-tower-damage, .eag-preview-enemy-icon,
.eag-preview-enemy-health {
  margin: 4px 0;
  font-size: 0.9rem;
}

.eag-preview-tower-icon, .eag-preview-enemy-icon {
  font-size: 2.2rem;
  margin: 8px 0;
}

.eag-preview-vs {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-primary);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  padding: 0 8px;
}

/* ===== TỪ VỰNG GRID - RESPONSIVE ===== */
.eag-suggested-words-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmin(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
  width: 100%;
}

.eag-word-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  width: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.eag-word-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-secondary);
}

.eag-word-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.eag-word-icon {
  font-size: 1.6rem;
}

.eag-word-level {
  background: var(--color-accent);
  color: var(--color-dark);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

.eag-word-body {
  flex: 1;
  min-height: 0;
}

.eag-word-body h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--color-dark);
  line-height: 1.2;
  word-break: break-word;
}

.eag-word-meaning {
  color: #555;
  font-size: 0.85rem;
  margin-bottom: 4px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.eag-word-example {
  color: #777;
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.eag-section-hint {
  text-align: center;
  color: #666;
  font-size: 0.8rem;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
  line-height: 1.3;
}

/* ===== NÚT BẤM - RESPONSIVE ===== */
.eag-strategy-actions-main {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  width: 100%;
}

.eag-start-button {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: var(--border-radius-lg);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  max-width: 400px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 0 rgba(239, 71, 111, 0.5);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.eag-start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(239, 71, 111, 0.5);
}

.eag-start-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 rgba(239, 71, 111, 0.5);
}

.eag-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.eag-button-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.eag-button-text {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.eag-button-title {
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.2;
}

.eag-button-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.2;
}

.eag-secondary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.eag-action-button {
  background: white;
  border: 2px solid var(--color-secondary);
  color: var(--color-dark);
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.eag-action-button:hover {
  background: var(--color-secondary);
  color: white;
  transform: translateY(-2px);
}

/* ===== TIPS & RESULT - RESPONSIVE ===== */
.eag-game-tips {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.eag-tip-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  text-align: center;
  border-left: 4px solid var(--color-accent);
  height: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.eag-tip-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.eag-tip-card h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--color-dark);
  line-height: 1.2;
}

.eag-tip-card p {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.3;
  flex: 1;
}

.eag-next-level {
  background: linear-gradient(135deg, #FFD166, #FFB347);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--color-dark);
  box-shadow: var(--shadow-md);
  width: 100%;
}

.eag-next-level h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  line-height: 1.2;
}

.eag-next-level p {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.3;
}

.eag-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.eag-action-btn {
  background: white;
  border: 2px solid var(--color-info);
  color: var(--color-dark);
  padding: 12px;
  border-radius: var(--border-radius-md);
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.eag-action-btn:hover {
  background: var(--color-info);
  color: white;
  transform: translateY(-2px);
}

/* ===== SHOP & LEADERBOARD - RESPONSIVE ===== */
.eag-shop-info, .eag-shop-items, .eag-current-upgrades,
.eag-leaderboard-list, .eag-leaderboard-stats {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-shop-balance {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.eag-balance-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
}

.eag-balance-info {
  flex: 1;
  min-width: 200px;
}

.eag-balance-info h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.eag-shop-tips {
  background: linear-gradient(135deg, #e9f7fe, #d1f0ff);
  border-radius: var(--border-radius-md);
  padding: 12px;
  border-left: 4px solid var(--color-info);
}

.eag-shop-tips h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.eag-shop-tips ul {
  padding-left: 18px;
  font-size: 0.85rem;
}

.eag-shop-tips li {
  margin-bottom: 4px;
  color: #555;
  line-height: 1.3;
}

.eag-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 1.2rem;
  color: var(--color-dark);
  flex-wrap: wrap;
}

.eag-upgrade-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.eag-upgrade-stat {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== LEADERBOARD TOP 3 - RESPONSIVE ===== */
.eag-top-three {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 8px;
  flex-wrap: wrap;
}

.eag-top-player {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-md);
  width: 100px;
  max-width: 30%;
  position: relative;
}

.eag-top-player.first {
  width: 120px;
  max-width: 35%;
  padding-top: 24px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  transform: translateY(-12px);
  z-index: 2;
}

.eag-top-player.second {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  z-index: 1;
}

.eag-top-player.third {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  z-index: 1;
}

.eag-top-rank {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.eag-top-avatar {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.eag-top-name {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eag-top-score {
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
}

.eag-current-player {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.eag-player-card.current {
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  padding: 12px;
}

.eag-player-rank {
  background: var(--color-primary);
  color: white;
  width: 45px;
  height: 45px;
  min-width: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.eag-player-avatar {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.eag-player-details {
  flex: 1;
  min-width: 0;
}

.eag-player-name {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eag-player-info {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #666;
  flex-wrap: wrap;
}

.eag-leaderboard-header {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  padding: 12px 8px;
  background: #f8f9fa;
  border-radius: var(--border-radius-md);
  font-weight: bold;
  color: var(--color-dark);
  margin-top: 12px;
  font-size: 0.9rem;
}

.eag-shop-actions, .eag-leaderboard-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  width: 100%;
}

/* ===== TUTORIAL - RESPONSIVE ===== */
.eag-tutorial-content {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-tutorial-section {
  margin-bottom: 24px;
  width: 100%;
}

.eag-tutorial-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: var(--color-dark);
  flex-wrap: wrap;
}

.eag-tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.eag-tutorial-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.eag-step-number {
  background: var(--color-primary);
  color: white;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.eag-step-content {
  flex: 1;
  min-width: 0;
}

.eag-step-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--color-dark);
}

.eag-step-content p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.3;
}

.eag-points-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

.eag-points-table th, .eag-points-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.eag-points-table th {
  background: var(--color-info);
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
}

.eag-points-table tr:nth-child(even) {
  background: #f9f9f9;
}

.eag-tutorial-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

/* ===== HỌC TỪ VỰNG - RESPONSIVE ===== */
.eag-progress-overview {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

.eag-progress-circle {
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.eag-progress-inner {
  width: 75px;
  height: 75px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--color-dark);
}

.eag-progress-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.eag-progress-stat {
  text-align: center;
  min-width: 70px;
}

.eag-stat-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 4px;
  line-height: 1;
}

.eag-stat-label {
  font-size: 0.85rem;
  color: #666;
}

.eag-daily-words, .eag-topics-section, .eag-pronunciation-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.eag-pronunciation-card {
  background: linear-gradient(135deg, #f0f9ff, #e1f5fe);
  border-radius: var(--border-radius-md);
  padding: 16px;
  border-left: 4px solid var(--color-info);
  width: 100%;
}

.eag-pronunciation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.eag-pronounce-btn {
  background: var(--gradient-info);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.eag-pronounce-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.eag-tts-settings label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}

.eag-tts-settings input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ===== BOTTOM NAVIGATION - RESPONSIVE ===== */
.eag-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px 4px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.eag-nav-btn {
  background: transparent;
  border: none;
  padding: 6px 4px;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #888;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  min-width: 55px;
  max-width: 80px;
  flex: 1;
  overflow: hidden;
}

.eag-nav-btn.active {
  color: var(--color-primary);
  background: rgba(255, 107, 107, 0.1);
}

.eag-nav-btn i {
  font-size: 1.1rem;
}

.eag-nav-btn:hover:not(.active) {
  color: var(--color-dark);
  background: rgba(0,0,0,0.05);
}

/* ===== LOADING & HIỆU ỨNG ===== */
.eag-loading {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== MEDIA QUERIES - TỐI ƯU HIỂN THỊ ===== */

/* Tablet & Desktop nhỏ */
@media (min-width: 768px) and (max-width: 1024px) {
  html, body {
    font-size: 17px;
  }
  
  .eag-main-content {
    padding: 20px;
    padding-bottom: 90px;
  }
  
  .eag-content-container {
    max-width: 95%;
    padding: 0 20px;
  }
  
  .eag-game-header {
    padding: 16px 24px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .eag-words-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .eag-tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .eag-preview-container {
    gap: 30px;
  }
  
  .eag-preview-tower, .eag-preview-enemy {
    min-width: 140px;
    padding: 16px;
  }
  
  .eag-bottom-nav {
    padding: 12px 8px;
  }
  
  .eag-nav-btn {
    min-width: 70px;
    font-size: 0.8rem;
    padding: 8px 4px;
  }
  
  .eag-nav-btn i {
    font-size: 1.3rem;
  }
}

/* Desktop vừa */
@media (min-width: 1025px) and (max-width: 1440px) {
  html, body {
    font-size: 18px;
  }
  
  .eag-main-content {
    padding: 24px;
    padding-bottom: 100px;
  }
  
  .eag-content-container {
    max-width: 1200px;
    padding: 0 24px;
  }
  
  .eag-game-header {
    padding: 18px 30px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-words-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-tips-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-level-card-main {
    gap: 24px;
  }
  
  .eag-level-icon-large {
    font-size: 4rem;
  }
  
  .eag-preview-container {
    gap: 40px;
  }
  
  .eag-preview-tower, .eag-preview-enemy {
    min-width: 160px;
    padding: 20px;
  }
  
  .eag-start-button {
    max-width: 500px;
  }
  
  .eag-bottom-nav {
    max-width: 1200px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  }
}

/* Desktop lớn */
@media (min-width: 1441px) {
  html, body {
    font-size: 19px;
  }
  
  .eag-main-content {
    padding: 28px;
    padding-bottom: 110px;
  }
  
  .eag-content-container {
    max-width: 1400px;
    padding: 0 28px;
  }
  
  .eag-game-header {
    padding: 20px 35px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  
  .eag-words-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
  
  .eag-tips-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
  
  .eag-bottom-nav {
    max-width: 1400px;
    width: calc(100% - 56px);
    padding: 14px 8px;
  }
  
  .eag-nav-btn {
    min-width: 80px;
    font-size: 0.85rem;
  }
  
  .eag-nav-btn i {
    font-size: 1.4rem;
  }
}

/* Mobile nhỏ (điện thoại nhỏ) */
@media (max-width: 375px) {
  html, body {
    font-size: 15px;
  }
  
  .eag-main-content {
    padding: 10px;
    padding-bottom: 75px;
  }
  
  .eag-game-header {
    padding: 10px 12px;
    min-height: 60px;
  }
  
  .eag-back-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .eag-words-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .eag-tips-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .eag-strategy-header {
    gap: 8px;
    padding: 10px 12px;
  }
  
  .eag-header-left {
    gap: 8px;
  }
  
  .eag-header-right {
    gap: 8px;
  }
  
  .eag-level-badge {
    min-width: 60px;
    padding: 6px 10px;
  }
  
  .eag-level-number {
    font-size: 1.4rem;
  }
  
  .eag-level-text {
    font-size: 0.7rem;
  }
  
  .eag-stat {
    padding: 5px 8px;
  }
  
  .eag-bottom-nav {
    padding: 8px 2px;
  }
  
  .eag-nav-btn {
    min-width: 50px;
    font-size: 0.7rem;
    padding: 4px 2px;
  }
  
  .eag-nav-btn i {
    font-size: 1rem;
  }
}

/* ===== FIXES ĐẶC BIỆT ===== */

/* Ngăn tràn ngang trên mobile */
@media (max-width: 767px) {
  .eag-main-screen,
  .eag-main-content,
  .eag-strategy-main,
  .eag-level-overview,
  .eag-game-preview,
  .eag-suggested-words-section,
  .eag-strategy-actions-main,
  .eag-game-tips,
  .eag-shop-info,
  .eag-shop-items,
  .eag-current-upgrades,
  .eag-leaderboard-list,
  .eag-leaderboard-stats,
  .eag-tutorial-content,
  .eag-progress-overview,
  .eag-daily-words,
  .eag-topics-section,
  .eag-pronunciation-section {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .eag-word-card,
  .eag-tip-card,
  .eag-stat-card,
  .eag-upgrade-stat {
    max-width: 100%;
  }
}

/* Đảm bảo không có scroll ngang không mong muốn */
body, html {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* Fix cho các phần tử flex trên mobile */
@media (max-width: 767px) {
  .eag-strategy-header,
  .eag-header-left,
  .eag-header-right,
  .eag-level-card-main,
  .eag-preview-container,
  .eag-pronunciation-controls {
    flex-wrap: wrap;
  }
  
  .eag-secondary-actions {
    justify-content: space-between;
  }
  
  .eag-action-button {
    flex: 0 0 calc(33.333% - 8px);
    min-width: 0;
  }
}

/* ===== PWA & FULLSCREEN SUPPORT ===== */
@media (display-mode: standalone) {
  .eag-bottom-nav {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

:fullscreen .eag-main-screen {
  height: 100vh;
  overflow: hidden;
}

:-webkit-full-screen .eag-main-screen {
  height: 100vh;
  overflow: hidden;
}

:-moz-full-screen .eag-main-screen {
  height: 100vh;
  overflow: hidden;
}

/* ===== UTILITY CLASSES ===== */
.eag-text-center { text-align: center; }
.eag-mt-1 { margin-top: 8px; }
.eag-mt-2 { margin-top: 16px; }
.eag-mb-1 { margin-bottom: 8px; }
.eag-mb-2 { margin-bottom: 16px; }
.eag-p-1 { padding: 8px; }
.eag-p-2 { padding: 16px; }
.eag-hidden { display: none !important; }
.eag-full-width { width: 100% !important; }
.eag-no-scroll { overflow: hidden !important; }

/* Đảm bảo hình ảnh và media responsive */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Fix cho input và button trên iOS */
input, button, textarea, select {
  font-family: var(--font-primary);
  font-size: 16px; /* Ngăn zoom trên iOS */
}

@media screen and (max-width: 767px) {
  input, button, textarea, select {
    font-size: 16px;
  }
}
/* Emoji in buttons */
.eag-action-btn span:before,
.eag-start-button span:before {
  font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
  .eag-next-level {
    padding: 15px;
    margin: 15px 0;
  }
  
  .eag-next-level h4 {
    font-size: 1.2rem;
  }
  
  .eag-next-level p {
    font-size: 0.9rem;
  }
  
  .eag-result-actions {
    max-width: 280px;
    gap: 10px;
  }
  
  .eag-action-btn,
  .eag-result-actions .eag-start-button {
    padding: 12px 18px;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .eag-next-level {
    padding: 12px;
    border-width: 2px;
  }
  
  .eag-next-level h4 {
    font-size: 1.1rem;
  }
  
  .eag-result-actions {
    max-width: 100%;
  }
}
/*================== bàng điều khiển game tháp từ vựng =============*/
/* ============================================
   CSS TỔNG HỢP - ỨNG DỤNG HỌC TỪ VỰNG GAME HÓA
   Thiết kế đáng yêu, responsive, PWA-friendly
   Đã sửa: Hiển thị tối ưu trên máy tính & điện thoại
============================================ */

/* ===== BIẾN & RESET ===== */
:root {
  /* Màu sắc chính - bảng màu vui tươi */
  --color-primary: #FF6B6B;
  --color-secondary: #4ECDC4;
  --color-accent: #FFD166;
  --color-success: #06D6A0;
  --color-info: #118AB2;
  --color-warning: #FF9E00;
  --color-danger: #EF476F;
  --color-dark: #073B4C;
  --color-light: #F8F9FA;
  
  /* Màu gradient */
  --gradient-primary: linear-gradient(135deg, #FF6B6B, #FF8E8E);
  --gradient-secondary: linear-gradient(135deg, #4ECDC4, #44A08D);
  --gradient-accent: linear-gradient(135deg, #FFD166, #FFB347);
  --gradient-success: linear-gradient(135deg, #06D6A0, #0CB48A);
  --gradient-info: linear-gradient(135deg, #118AB2, #0A6A8A);
  --gradient-warning: linear-gradient(135deg, #FF9E00, #FF8C00);
  --gradient-gold: linear-gradient(135deg, #FFD700, #FFA500);
  
  /* Kích thước & khoảng cách */
  --border-radius-sm: 12px;
  --border-radius-md: 20px;
  --border-radius-lg: 30px;
  --border-radius-xl: 40px;
  --shadow-sm: 0 4px 8px rgba(0,0,0,0.1);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.15);
  --shadow-lg: 0 12px 24px rgba(0,0,0,0.2);
  --shadow-inner: inset 0 2px 4px rgba(0,0,0,0.1);
  
  /* Font chữ thân thiện với trẻ em */
  --font-primary: 'Comic Sans MS', 'Chalkboard SE', 'Arial Rounded MT Bold', sans-serif;
  --font-secondary: 'Nunito', 'Quicksand', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font-primary);
  font-size: 16px;
  line-height: 1.5;
  color: var(--color-dark);
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* ===== CONTAINER CHÍNH - FIX HIỂN THỊ ===== */
#app {
  width: 100%;
  max-width: 100vw;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

.eag-main-screen {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  display: flex;
  flex-direction: column;
  background: var(--color-light);
  position: relative;
  overflow-x: hidden;
}

/* ===== HEADER - RESPONSIVE ===== */
.eag-game-header {
  padding: 12px 16px;
  background: var(--gradient-primary);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: white;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 10;
  min-height: 70px;
  width: 100%;
}

.eag-back-button {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 44px;
  height: 44px;
  min-width: 44px;
  border-radius: 50%;
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  flex-shrink: 0;
}

.eag-back-button:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.05);
}

.eag-points-display {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 12px;
  border-radius: var(--border-radius-lg);
  font-weight: bold;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(5px);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== NỘI DUNG CHÍNH - ĐIỀU CHỈNH LAYOUT ===== */
.eag-main-content {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  padding-bottom: 80px;
}

/* Container giới hạn chiều rộng cho máy tính */
.eag-content-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 12px;
}

/* ===== CHIẾN THUẬT GAME - LAYOUT CẢI THIỆN ===== */
.eag-strategy-main {
  background: linear-gradient(180deg, #f8f9fa 0%, #e9ecef 100%);
  width: 100%;
  max-width: 100vw;
}

.eag-strategy-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  width: 100%;
}

.eag-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 200px;
}

.eag-header-title h3 {
  font-size: 1.3rem;
  margin: 0;
  color: white;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  line-height: 1.2;
}

.eag-header-title p {
  font-size: 0.8rem;
  margin: 4px 0 0;
  opacity: 0.9;
  color: white;
  line-height: 1.2;
}

.eag-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.eag-level-badge {
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--border-radius-md);
  padding: 8px 12px;
  text-align: center;
  backdrop-filter: blur(5px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  min-width: 70px;
}

.eag-level-number {
  display: block;
  font-size: 1.6rem;
  font-weight: bold;
  color: white;
  line-height: 1;
}

.eag-level-text {
  font-size: 0.75rem;
  opacity: 0.9;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.eag-player-stats {
  display: flex;
  gap: 8px;
}

.eag-stat {
  background: rgba(255, 255, 255, 0.2);
  padding: 6px 10px;
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(5px);
}

.eag-stat-icon {
  font-size: 1.1rem;
}

.eag-stat-value {
  font-weight: bold;
  font-size: 1rem;
  color: white;
}

/* ===== CARD & SECTION - RESPONSIVE ===== */
.eag-level-overview {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.eag-level-card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  width: 100%;
}

.eag-level-icon-large {
  font-size: 3rem;
  flex-shrink: 0;
  min-width: 60px;
}

.eag-level-details {
  flex: 1;
  min-width: 0;
}

.eag-level-details h2 {
  font-size: 1.4rem;
  margin-bottom: 8px;
  color: var(--color-dark);
  line-height: 1.2;
  word-wrap: break-word;
}

.eag-level-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.eag-tag {
  background: var(--color-accent);
  color: var(--color-dark);
  padding: 4px 10px;
  border-radius: 16px;
  font-size: 0.8rem;
  font-weight: bold;
  white-space: nowrap;
}

.eag-level-desc {
  color: #666;
  font-size: 0.9rem;
  margin-top: 8px;
  line-height: 1.4;
}

.eag-level-progress-container {
  margin-top: 16px;
  width: 100%;
}

.eag-progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  font-size: 0.85rem;
  color: #555;
  flex-wrap: wrap;
  gap: 4px;
}

.eag-progress-bar-container {
  height: 10px;
  background: #eee;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: var(--shadow-inner);
  width: 100%;
}

.eag-progress-bar-fill {
  height: 100%;
  background: var(--gradient-success);
  border-radius: 5px;
  transition: width 0.5s ease;
}

/* ===== GRID SYSTEMS - RESPONSIVE ===== */
.eag-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.eag-stat-card {
  background: white;
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  width: 100%;
  min-width: 0;
}

.eag-stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.eag-stat-card-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.eag-stat-card-content {
  flex: 1;
  min-width: 0;
}

.eag-stat-card-value {
  font-size: 1.6rem;
  font-weight: bold;
  color: var(--color-dark);
  line-height: 1;
}

.eag-stat-card-label {
  font-size: 0.8rem;
  color: #666;
  margin-top: 4px;
}

/* ===== GAME PREVIEW - RESPONSIVE ===== */
.eag-game-preview {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: var(--color-dark);
  flex-wrap: wrap;
}

.eag-title-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.eag-title-text {
  font-size: 1.1rem;
  line-height: 1.2;
}

.eag-preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.eag-preview-left, .eag-preview-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.eag-preview-tower, .eag-preview-enemy {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--color-accent);
  min-width: 120px;
}

.eag-preview-tower {
  border-color: var(--color-info);
}

.eag-preview-enemy {
  border-color: var(--color-danger);
}

.eag-preview-tower-level, .eag-preview-tower-icon, 
.eag-preview-tower-damage, .eag-preview-enemy-icon,
.eag-preview-enemy-health {
  margin: 4px 0;
  font-size: 0.9rem;
}

.eag-preview-tower-icon, .eag-preview-enemy-icon {
  font-size: 2.2rem;
  margin: 8px 0;
}

.eag-preview-vs {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-primary);
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
  padding: 0 8px;
}

/* ===== TỪ VỰNG GRID - RESPONSIVE ===== */
.eag-suggested-words-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmin(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
  width: 100%;
}

.eag-word-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  box-shadow: var(--shadow-sm);
  width: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.eag-word-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-secondary);
}

.eag-word-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.eag-word-icon {
  font-size: 1.6rem;
}

.eag-word-level {
  background: var(--color-accent);
  color: var(--color-dark);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: bold;
  white-space: nowrap;
}

.eag-word-body {
  flex: 1;
  min-height: 0;
}

.eag-word-body h4 {
  font-size: 1.1rem;
  margin-bottom: 6px;
  color: var(--color-dark);
  line-height: 1.2;
  word-break: break-word;
}

.eag-word-meaning {
  color: #555;
  font-size: 0.85rem;
  margin-bottom: 4px;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.eag-word-example {
  color: #777;
  font-size: 0.8rem;
  font-style: italic;
  margin-top: 4px;
  line-height: 1.2;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.eag-section-hint {
  text-align: center;
  color: #666;
  font-size: 0.8rem;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #ddd;
  line-height: 1.3;
}

/* ===== NÚT BẤM - RESPONSIVE ===== */
.eag-strategy-actions-main {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  width: 100%;
}

.eag-start-button {
  background: var(--gradient-primary);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: var(--border-radius-lg);
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  display: inline-block;
  width: 100%;
  max-width: 400px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 0 rgba(239, 71, 111, 0.5);
  margin-bottom: 12px;
  position: relative;
  overflow: hidden;
}

.eag-start-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 0 rgba(239, 71, 111, 0.5);
}

.eag-start-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 0 rgba(239, 71, 111, 0.5);
}

.eag-button-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
}

.eag-button-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
}

.eag-button-text {
  text-align: left;
  flex: 1;
  min-width: 0;
}

.eag-button-title {
  font-size: 1.1rem;
  font-weight: bold;
  line-height: 1.2;
}

.eag-button-subtitle {
  font-size: 0.85rem;
  opacity: 0.9;
  line-height: 1.2;
}

.eag-secondary-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
}

.eag-action-button {
  background: white;
  border: 2px solid var(--color-secondary);
  color: var(--color-dark);
  padding: 10px 16px;
  border-radius: var(--border-radius-md);
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.3s ease;
  flex: 1;
  min-width: 120px;
  justify-content: center;
}

.eag-action-button:hover {
  background: var(--color-secondary);
  color: white;
  transform: translateY(-2px);
}

/* ===== TIPS & RESULT - RESPONSIVE ===== */
.eag-game-tips {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-tips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.eag-tip-card {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  text-align: center;
  border-left: 4px solid var(--color-accent);
  height: 100%;
  min-height: 140px;
  display: flex;
  flex-direction: column;
}

.eag-tip-icon {
  font-size: 1.8rem;
  margin-bottom: 8px;
  flex-shrink: 0;
}

.eag-tip-card h4 {
  font-size: 0.95rem;
  margin-bottom: 6px;
  color: var(--color-dark);
  line-height: 1.2;
}

.eag-tip-card p {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.3;
  flex: 1;
}

.eag-next-level {
  background: linear-gradient(135deg, #FFD166, #FFB347);
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
  color: var(--color-dark);
  box-shadow: var(--shadow-md);
  width: 100%;
}

.eag-next-level h4 {
  font-size: 1.2rem;
  margin-bottom: 8px;
  line-height: 1.2;
}

.eag-next-level p {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.3;
}

.eag-result-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

.eag-action-btn {
  background: white;
  border: 2px solid var(--color-info);
  color: var(--color-dark);
  padding: 12px;
  border-radius: var(--border-radius-md);
  font-size: 0.95rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.eag-action-btn:hover {
  background: var(--color-info);
  color: white;
  transform: translateY(-2px);
}

/* ===== SHOP & LEADERBOARD - RESPONSIVE ===== */
.eag-shop-info, .eag-shop-items, .eag-current-upgrades,
.eag-leaderboard-list, .eag-leaderboard-stats {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-shop-balance {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.eag-balance-icon {
  font-size: 2.8rem;
  flex-shrink: 0;
}

.eag-balance-info {
  flex: 1;
  min-width: 200px;
}

.eag-balance-info h3 {
  font-size: 1.3rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.eag-shop-tips {
  background: linear-gradient(135deg, #e9f7fe, #d1f0ff);
  border-radius: var(--border-radius-md);
  padding: 12px;
  border-left: 4px solid var(--color-info);
}

.eag-shop-tips h4 {
  font-size: 1rem;
  margin-bottom: 8px;
  color: var(--color-dark);
}

.eag-shop-tips ul {
  padding-left: 18px;
  font-size: 0.85rem;
}

.eag-shop-tips li {
  margin-bottom: 4px;
  color: #555;
  line-height: 1.3;
}

.eag-category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 1.2rem;
  color: var(--color-dark);
  flex-wrap: wrap;
}

.eag-upgrade-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.eag-upgrade-stat {
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  border-radius: var(--border-radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ===== LEADERBOARD TOP 3 - RESPONSIVE ===== */
.eag-top-three {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0 8px;
  flex-wrap: wrap;
}

.eag-top-player {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px 12px;
  text-align: center;
  box-shadow: var(--shadow-md);
  width: 100px;
  max-width: 30%;
  position: relative;
}

.eag-top-player.first {
  width: 120px;
  max-width: 35%;
  padding-top: 24px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  transform: translateY(-12px);
  z-index: 2;
}

.eag-top-player.second {
  background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
  z-index: 1;
}

.eag-top-player.third {
  background: linear-gradient(135deg, #CD7F32, #A0522D);
  z-index: 1;
}

.eag-top-rank {
  font-size: 1.8rem;
  margin-bottom: 8px;
}

.eag-top-avatar {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.eag-top-name {
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.9rem;
  color: white;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eag-top-score {
  font-size: 1.1rem;
  font-weight: bold;
  color: white;
}

.eag-current-player {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 12px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-player-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.eag-player-card.current {
  border: 2px solid var(--color-primary);
  border-radius: var(--border-radius-md);
  padding: 12px;
}

.eag-player-rank {
  background: var(--color-primary);
  color: white;
  width: 45px;
  height: 45px;
  min-width: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.eag-player-avatar {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.eag-player-details {
  flex: 1;
  min-width: 0;
}

.eag-player-name {
  font-weight: bold;
  font-size: 1.1rem;
  margin-bottom: 4px;
  color: var(--color-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.eag-player-info {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #666;
  flex-wrap: wrap;
}

.eag-leaderboard-header {
  display: grid;
  grid-template-columns: 50px 1fr 80px;
  padding: 12px 8px;
  background: #f8f9fa;
  border-radius: var(--border-radius-md);
  font-weight: bold;
  color: var(--color-dark);
  margin-top: 12px;
  font-size: 0.9rem;
}

.eag-shop-actions, .eag-leaderboard-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
  width: 100%;
}

/* ===== TUTORIAL - RESPONSIVE ===== */
.eag-tutorial-content {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-tutorial-section {
  margin-bottom: 24px;
  width: 100%;
}

.eag-tutorial-section h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 1.2rem;
  color: var(--color-dark);
  flex-wrap: wrap;
}

.eag-tutorial-steps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.eag-tutorial-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
}

.eag-step-number {
  background: var(--color-primary);
  color: white;
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.eag-step-content {
  flex: 1;
  min-width: 0;
}

.eag-step-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--color-dark);
}

.eag-step-content p {
  font-size: 0.85rem;
  color: #666;
  line-height: 1.3;
}

.eag-points-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  font-size: 0.9rem;
}

.eag-points-table th, .eag-points-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #eee;
}

.eag-points-table th {
  background: var(--color-info);
  color: white;
  font-weight: bold;
  font-size: 0.9rem;
}

.eag-points-table tr:nth-child(even) {
  background: #f9f9f9;
}

.eag-tutorial-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
  width: 100%;
}

/* ===== HỌC TỪ VỰNG - RESPONSIVE ===== */
.eag-progress-overview {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 16px;
  width: 100%;
}

.eag-progress-circle {
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.eag-progress-inner {
  width: 75px;
  height: 75px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.3rem;
  color: var(--color-dark);
}

.eag-progress-stats {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}

.eag-progress-stat {
  text-align: center;
  min-width: 70px;
}

.eag-stat-number {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--color-primary);
  margin-bottom: 4px;
  line-height: 1;
}

.eag-stat-label {
  font-size: 0.85rem;
  color: #666;
}

.eag-daily-words, .eag-topics-section, .eag-pronunciation-section {
  background: white;
  border-radius: var(--border-radius-lg);
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  width: 100%;
}

.eag-topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.eag-pronunciation-card {
  background: linear-gradient(135deg, #f0f9ff, #e1f5fe);
  border-radius: var(--border-radius-md);
  padding: 16px;
  border-left: 4px solid var(--color-info);
  width: 100%;
}

.eag-pronunciation-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  width: 100%;
}

.eag-pronounce-btn {
  background: var(--gradient-info);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: var(--border-radius-md);
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}

.eag-pronounce-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.eag-tts-settings label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
}

.eag-tts-settings input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

/* ===== BOTTOM NAVIGATION - RESPONSIVE ===== */
.eag-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  padding: 10px 4px;
  box-shadow: 0 -4px 12px rgba(0,0,0,0.1);
  z-index: 100;
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

.eag-nav-btn {
  background: transparent;
  border: none;
  padding: 6px 4px;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: #888;
  font-size: 0.75rem;
  transition: all 0.3s ease;
  min-width: 55px;
  max-width: 80px;
  flex: 1;
  overflow: hidden;
}

.eag-nav-btn.active {
  color: var(--color-primary);
  background: rgba(255, 107, 107, 0.1);
}

.eag-nav-btn i {
  font-size: 1.1rem;
}

.eag-nav-btn:hover:not(.active) {
  color: var(--color-dark);
  background: rgba(0,0,0,0.05);
}

/* ===== LOADING & HIỆU ỨNG ===== */
.eag-loading {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 12px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===== MEDIA QUERIES - TỐI ƯU HIỂN THỊ ===== */

/* Tablet & Desktop nhỏ */
@media (min-width: 768px) and (max-width: 1024px) {
  html, body {
    font-size: 17px;
  }
  
  .eag-main-content {
    padding: 20px;
    padding-bottom: 90px;
  }
  
  .eag-content-container {
    max-width: 95%;
    padding: 0 20px;
  }
  
  .eag-game-header {
    padding: 16px 24px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .eag-words-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .eag-tips-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .eag-preview-container {
    gap: 30px;
  }
  
  .eag-preview-tower, .eag-preview-enemy {
    min-width: 140px;
    padding: 16px;
  }
  
  .eag-bottom-nav {
    padding: 12px 8px;
  }
  
  .eag-nav-btn {
    min-width: 70px;
    font-size: 0.8rem;
    padding: 8px 4px;
  }
  
  .eag-nav-btn i {
    font-size: 1.3rem;
  }
}

/* Desktop vừa */
@media (min-width: 1025px) and (max-width: 1440px) {
  html, body {
    font-size: 18px;
  }
  
  .eag-main-content {
    padding: 24px;
    padding-bottom: 100px;
  }
  
  .eag-content-container {
    max-width: 1200px;
    padding: 0 24px;
  }
  
  .eag-game-header {
    padding: 18px 30px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-words-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-tips-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  
  .eag-level-card-main {
    gap: 24px;
  }
  
  .eag-level-icon-large {
    font-size: 4rem;
  }
  
  .eag-preview-container {
    gap: 40px;
  }
  
  .eag-preview-tower, .eag-preview-enemy {
    min-width: 160px;
    padding: 20px;
  }
  
  .eag-start-button {
    max-width: 500px;
  }
  
  .eag-bottom-nav {
    max-width: 1200px;
    margin: 0 auto;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 48px);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
  }
}

/* Desktop lớn */
@media (min-width: 1441px) {
  html, body {
    font-size: 19px;
  }
  
  .eag-main-content {
    padding: 28px;
    padding-bottom: 110px;
  }
  
  .eag-content-container {
    max-width: 1400px;
    padding: 0 28px;
  }
  
  .eag-game-header {
    padding: 20px 35px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  
  .eag-words-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
  
  .eag-tips-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
  }
  
  .eag-bottom-nav {
    max-width: 1400px;
    width: calc(100% - 56px);
    padding: 14px 8px;
  }
  
  .eag-nav-btn {
    min-width: 80px;
    font-size: 0.85rem;
  }
  
  .eag-nav-btn i {
    font-size: 1.4rem;
  }
}

/* Mobile nhỏ (điện thoại nhỏ) */
@media (max-width: 375px) {
  html, body {
    font-size: 15px;
  }
  
  .eag-main-content {
    padding: 10px;
    padding-bottom: 75px;
  }
  
  .eag-game-header {
    padding: 10px 12px;
    min-height: 60px;
  }
  
  .eag-back-button {
    width: 40px;
    height: 40px;
    min-width: 40px;
  }
  
  .eag-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .eag-words-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .eag-tips-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .eag-topics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  
  .eag-strategy-header {
    gap: 8px;
    padding: 10px 12px;
  }
  
  .eag-header-left {
    gap: 8px;
  }
  
  .eag-header-right {
    gap: 8px;
  }
  
  .eag-level-badge {
    min-width: 60px;
    padding: 6px 10px;
  }
  
  .eag-level-number {
    font-size: 1.4rem;
  }
  
  .eag-level-text {
    font-size: 0.7rem;
  }
  
  .eag-stat {
    padding: 5px 8px;
  }
  
  .eag-bottom-nav {
    padding: 8px 2px;
  }
  
  .eag-nav-btn {
    min-width: 50px;
    font-size: 0.7rem;
    padding: 4px 2px;
  }
  
  .eag-nav-btn i {
    font-size: 1rem;
  }
}

/* ===== FIXES ĐẶC BIỆT ===== */

/* Ngăn tràn ngang trên mobile */
@media (max-width: 767px) {
  .eag-main-screen,
  .eag-main-content,
  .eag-strategy-main,
  .eag-level-overview,
  .eag-game-preview,
  .eag-suggested-words-section,
  .eag-strategy-actions-main,
  .eag-game-tips,
  .eag-shop-info,
  .eag-shop-items,
  .eag-current-upgrades,
  .eag-leaderboard-list,
  .eag-leaderboard-stats,
  .eag-tutorial-content,
  .eag-progress-overview,
  .eag-daily-words,
  .eag-topics-section,
  .eag-pronunciation-section {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .eag-word-card,
  .eag-tip-card,
  .eag-stat-card,
  .eag-upgrade-stat {
    max-width: 100%;
  }
}

/* Đảm bảo không có scroll ngang không mong muốn */
body, html {
  overflow-x: hidden;
  width: 100%;
  position: relative;
}

/* Fix cho các phần tử flex trên mobile */
@media (max-width: 767px) {
  .eag-strategy-header,
  .eag-header-left,
  .eag-header-right,
  .eag-level-card-main,
  .eag-preview-container,
  .eag-pronunciation-controls {
    flex-wrap: wrap;
  }
  
  .eag-secondary-actions {
    justify-content: space-between;
  }
  
  .eag-action-button {
    flex: 0 0 calc(33.333% - 8px);
    min-width: 0;
  }
}

/* ===== PWA & FULLSCREEN SUPPORT ===== */
@media (display-mode: standalone) {
  .eag-bottom-nav {
    padding-bottom: max(10px, env(safe-area-inset-bottom));
  }
  
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
}

:fullscreen .eag-main-screen {
  height: 100vh;
  overflow: hidden;
}

:-webkit-full-screen .eag-main-screen {
  height: 100vh;
  overflow: hidden;
}

:-moz-full-screen .eag-main-screen {
  height: 100vh;
  overflow: hidden;
}

/* ===== UTILITY CLASSES ===== */
.eag-text-center { text-align: center; }
.eag-mt-1 { margin-top: 8px; }
.eag-mt-2 { margin-top: 16px; }
.eag-mb-1 { margin-bottom: 8px; }
.eag-mb-2 { margin-bottom: 16px; }
.eag-p-1 { padding: 8px; }
.eag-p-2 { padding: 16px; }
.eag-hidden { display: none !important; }
.eag-full-width { width: 100% !important; }
.eag-no-scroll { overflow: hidden !important; }

/* Đảm bảo hình ảnh và media responsive */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Fix cho input và button trên iOS */
input, button, textarea, select {
  font-family: var(--font-primary);
  font-size: 16px; /* Ngăn zoom trên iOS */
}

@media screen and (max-width: 767px) {
  input, button, textarea, select {
    font-size: 16px;
  }
}
/*============================css kiểm tra nhanh =================*/
.eag-test-container {
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.eag-test-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 15px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    border-radius: 15px;
}

.eag-test-timer {
    font-size: 1.5rem;
    font-weight: bold;
    background: rgba(255,255,255,0.2);
    padding: 5px 15px;
    border-radius: 20px;
}

.eag-test-progress {
    margin: 20px 0;
    text-align: center;
}

.eag-test-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.eag-test-question {
    text-align: center;
    margin-bottom: 30px;
}

.eag-test-word {
    font-size: 2rem;
    color: var(--color-primary);
    margin: 20px 0;
}

.eag-test-options {
    display: grid;
    gap: 10px;
    margin-bottom: 20px;
}

.eag-test-option {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: white;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
}

.eag-test-option:hover {
    border-color: var(--color-primary);
    background: #f0f9ff;
}

.eag-option-letter {
    display: inline-block;
    width: 30px;
    height: 30px;
    background: var(--color-primary);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 30px;
    margin-right: 15px;
    font-weight: bold;
}

.eag-test-results {
    padding: 20px;
}

.eag-results-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin: 30px 0;
}

.eag-stat-card {
    padding: 20px;
    border-radius: 15px;
    text-align: center;
    color: white;
}

.eag-stat-card.success { background: var(--color-success); }
.eag-stat-card.primary { background: var(--color-primary); }
.eag-stat-card.accent { background: var(--color-accent); }

.eag-stat-value {
    font-size: 2rem;
    font-weight: bold;
}

.eag-answers-list {
    margin: 20px 0;
}

.eag-answer-item {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
}

.eag-answer-item.correct {
    background: rgba(76, 175, 80, 0.1);
    border-color: var(--color-success);
}

.eag-answer-item.wrong {
    background: rgba(244, 67, 54, 0.1);
    border-color: var(--color-danger);
}

.eag-answer-item.skipped {
    background: rgba(158, 158, 158, 0.1);
    border-color: #9e9e9e;
}

.eag-answer-number {
    width: 30px;
    height: 30px;
    background: #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.eag-answer-word {
    flex-grow: 1;
    font-weight: bold;
}

.eag-results-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}
/*================= Thêm CSS cho hiệu ứng pulse====================*/
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.eag-test-option {
    transition: all 0.3s ease;
}

.eag-test-option.correct {
    background-color: var(--color-success) !important;
    color: white !important;
    border-color: var(--color-success) !important;
    animation: pulse 1s infinite;
}

.eag-test-option.wrong {
    background-color: var(--color-danger) !important;
    color: white !important;
    border-color: var(--color-danger) !important;
}

.eag-test-option.disabled {
    pointer-events: none;
    opacity: 0.7;
}
/* CSS cho phần Quizzes */
.eag-quizzes-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin: 20px 0;
}

.eag-quiz-item {
    padding: 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

/* Bài quiz CHƯA làm */
.eag-quiz-item:not(.eag-quiz-completed) {
    border-color: #e0e0e0;
    background: linear-gradient(135deg, #ffffff 0%, #f9f9f9 100%);
}

.eag-quiz-item:not(.eag-quiz-completed):hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.12);
    border-color: var(--color-primary);
}

/* Bài quiz ĐÃ làm */
.eag-quiz-item.eag-quiz-completed {
    border-color: #4CAF50;
    background: linear-gradient(135deg, #f8fff8 0%, #f0f9f0 100%);
    position: relative;
}

.eag-quiz-item.eag-quiz-completed::before {
    content: "✓ ĐÃ HOÀN THÀNH";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #4CAF50;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* Header của mỗi bài quiz */
.eag-quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.eag-quiz-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
    flex: 1;
}

.eag-quiz-title.eag-quiz-completed {
    color: #2E7D32;
}

/* Thông tin bài quiz */
.eag-quiz-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.eag-quiz-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: #666;
}

.eag-quiz-meta-item i {
    color: var(--color-primary);
}

/* Điểm số (chỉ hiển thị khi đã làm) */
.eag-quiz-score {
    padding: 6px 12px;
    background: #4CAF50;
    color: white;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-left: auto;
}

/* Tiến độ làm bài */
.eag-quiz-progress {
    margin-top: 10px;
}

.eag-quiz-progress-bar {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.eag-quiz-progress-fill {
    height: 100%;
    background: var(--color-primary);
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Nút làm bài */
.eag-quiz-button {
    padding: 12px 24px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

/* Nút cho bài đã làm */
.eag-quiz-item.eag-quiz-completed .eag-quiz-button {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.eag-quiz-button:not(:disabled):hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(78, 205, 196, 0.3);
}

/* Icon trạng thái */
.eag-quiz-status-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.eag-quiz-item:not(.eag-quiz-completed) .eag-quiz-status-icon {
    color: #ff9800; /* Màu cam cho bài chưa làm */
}

.eag-quiz-item.eag-quiz-completed .eag-quiz-status-icon {
    color: #4CAF50; /* Màu xanh cho bài đã làm */
}

/* Thời gian làm bài */
.eag-quiz-time {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #f5f5f5;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
}

.eag-quiz-completed .eag-quiz-time {
    background: #e8f5e9;
    color: #2E7D32;
}

/* Phần thống kê */
.eag-quizzes-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.eag-quiz-stat {
    background: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    border-top: 4px solid var(--color-primary);
}

.eag-quiz-stat:nth-child(2) {
    border-top-color: #4CAF50; /* Màu xanh cho bài đã làm hôm nay */
}

.eag-quiz-stat:nth-child(3) {
    border-top-color: #2196F3; /* Màu xanh dương cho điểm TB */
}

.eag-stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 5px;
}

.eag-stat-label {
    font-size: 0.9rem;
    color: #666;
}

/* Trạng thái empty */
.eag-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: white;
    border-radius: 12px;
    border: 2px dashed #e0e0e0;
}