/* ════════════════════════════════════════════════
   English Learning Styles
   ════════════════════════════════════════════════ */
.eng-page { min-height: 100vh; padding: 24px 16px 80px; position: relative; z-index: 1; max-width: 100vw; overflow-x: hidden; }
.eng-inner { max-width: 700px; margin: 0 auto; }
.eng-header { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.eng-header-center { flex: 1; }
.eng-title { font-size: 22px; font-weight: 800; color: var(--text-primary, #f1f5f9); margin: 0; }

.eng-stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 20px; }
.eng-stat { background: rgba(255,255,255,0.04); border: 1px solid rgba(255,255,255,0.06); border-radius: 12px; padding: 14px 10px; text-align: center; }
.eng-stat-num { display: block; font-size: 22px; font-weight: 800; color: #a78bfa; }
.eng-stat-label { font-size: 11px; color: var(--text-secondary, #94a3b8); }

.eng-tabs { display: flex; gap: 4px; margin-bottom: 16px; background: rgba(15,15,30,0.4); border-radius: 12px; padding: 4px; }
.eng-tab { flex: 1; padding: 10px; background: transparent; border: none; border-radius: 10px; color: var(--text-secondary, #94a3b8); font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.eng-tab:hover { color: var(--text-primary, #f1f5f9); }
.eng-tab.eng-tab-active { background: rgba(139,92,246,0.2); color: #a78bfa; }

.eng-gen-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.eng-gen-bar2 { display: flex; gap: 8px; margin-bottom: 16px; align-items: center; }
.eng-custom-topic { flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(15,15,30,0.5); color: var(--text-primary, #f1f5f9); font-size: 13px; outline: none; }
.eng-custom-topic::placeholder { color: var(--text-secondary, #94a3b8); }
.eng-custom-topic:focus { border-color: rgba(139,92,246,0.4); }
.eng-count-wrap { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary, #94a3b8); }
.eng-count-input { width: 60px; padding: 8px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(15,15,30,0.5); color: var(--text-primary, #f1f5f9); font-size: 14px; text-align: center; outline: none; }
.eng-select { flex: 1; padding: 10px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.1); background: rgba(15,15,30,0.5); color: var(--text-primary, #f1f5f9); font-size: 13px; outline: none; }
.eng-select option { background: #1e1e3a; color: #f1f5f9; }
.eng-select optgroup { background: #1e1e3a; color: #a78bfa; font-weight: 700; }
.eng-btn { padding: 10px 18px; border-radius: 10px; border: none; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; transition: transform 0.2s; white-space: nowrap; }
.eng-btn:hover { transform: translateY(-1px); }
.eng-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.eng-word-list { display: flex; flex-direction: column; gap: 10px; }
.eng-word-card { background: rgba(30,30,58,0.5); border: 1px solid rgba(255,255,255,0.06); border-radius: 14px; padding: 16px; }
.eng-word-header { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.eng-word-header strong { font-size: 18px; color: var(--text-primary, #f1f5f9); }
.eng-phonetic { font-size: 13px; color: #a78bfa; font-style: italic; }
.eng-meaning { font-size: 14px; color: #10b981; font-weight: 600; margin-bottom: 4px; }
.eng-example { font-size: 13px; color: var(--text-secondary, #94a3b8); font-style: italic; }
.eng-tip { font-size: 12px; color: #fbbf24; margin-top: 6px; padding: 6px 10px; background: rgba(251,191,36,0.08); border-radius: 6px; }
.eng-empty { text-align: center; padding: 40px; color: var(--text-secondary, #94a3b8); font-size: 14px; }

/* Review */
.eng-review-card { background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.2); border-radius: 16px; padding: 32px; text-align: center; cursor: pointer; min-height: 200px; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.eng-review-word { font-size: 28px; font-weight: 800; color: var(--text-primary, #f1f5f9); }
.eng-review-phonetic { font-size: 14px; color: #a78bfa; margin-top: 8px; }
.eng-review-hint { font-size: 12px; color: var(--text-secondary, #94a3b8); margin-top: 16px; }
.eng-review-meaning { font-size: 20px; font-weight: 700; color: #10b981; }
.eng-review-example { font-size: 14px; color: var(--text-secondary, #cbd5e1); margin-top: 12px; font-style: italic; }
.eng-hidden { display: none; }
.eng-review-btns { display: flex; gap: 10px; justify-content: center; margin-top: 16px; }
.eng-rate-btn { padding: 10px 20px; border-radius: 10px; border: none; font-size: 14px; font-weight: 600; cursor: pointer; }
.eng-rate-hard { background: rgba(248,113,113,0.15); color: #f87171; }
.eng-rate-ok { background: rgba(251,191,36,0.15); color: #fbbf24; }
.eng-rate-easy { background: rgba(52,211,153,0.15); color: #34d399; }
.eng-review-progress { text-align: center; margin-top: 12px; font-size: 12px; color: var(--text-secondary, #94a3b8); }

/* Quiz */
.eng-quiz-card { text-align: center; }
.eng-quiz-word { font-size: 28px; font-weight: 800; color: var(--text-primary, #f1f5f9); margin-bottom: 8px; }
.eng-quiz-prompt { font-size: 14px; color: var(--text-secondary, #94a3b8); margin-bottom: 20px; }
.eng-quiz-options { display: flex; flex-direction: column; gap: 8px; max-width: 400px; margin: 0 auto; }
.eng-quiz-opt { padding: 14px 20px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.1); background: rgba(255,255,255,0.04); color: var(--text-primary, #f1f5f9); font-size: 14px; cursor: pointer; transition: all 0.2s; text-align: left; }
.eng-quiz-opt:hover { border-color: rgba(139,92,246,0.4); background: rgba(139,92,246,0.08); }
.eng-quiz-opt.eng-correct { border-color: #10b981; background: rgba(16,185,129,0.15); color: #10b981; }
.eng-quiz-opt.eng-wrong { border-color: #f87171; background: rgba(248,113,113,0.15); color: #f87171; }
.eng-quiz-progress { margin-top: 16px; font-size: 12px; color: var(--text-secondary, #94a3b8); }
.eng-quiz-result { text-align: center; padding: 40px; }
.eng-quiz-score { font-size: 48px; font-weight: 900; color: #a78bfa; }

/* Light mode */
.light-mode .eng-word-card, .light-mode .eng-stat { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.08); }
.light-mode .eng-review-card { background: rgba(255,255,255,0.8); border-color: rgba(139,92,246,0.15); }
.light-mode .eng-select { background: #f8fafc; border-color: rgba(0,0,0,0.1); color: #1e293b; }

@media (max-width: 640px) { .eng-stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* Saved words list */
.eng-saved-section { margin-top: 24px; border-top: 1px solid rgba(255,255,255,0.06); padding-top: 16px; }
.eng-saved-title { font-size: 15px; font-weight: 700; color: var(--text-primary, #f1f5f9); margin: 0 0 12px; }
.eng-saved-list { display: flex; flex-direction: column; gap: 6px; }
.eng-saved-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: rgba(255,255,255,0.03); border-radius: 10px; font-size: 13px; }
.eng-saved-item strong { color: var(--text-primary, #f1f5f9); min-width: 120px; }
.eng-saved-meaning { flex: 1; color: #10b981; }
.eng-saved-topic { font-size: 11px; color: var(--text-secondary, #94a3b8); background: rgba(139,92,246,0.1); padding: 2px 8px; border-radius: 4px; }

/* Pagination */
.eng-pagination { display: flex; align-items: center; gap: 8px; margin-top: 12px; justify-content: center; }
.eng-pag-info { font-size: 12px; color: var(--text-secondary, #94a3b8); }
.eng-pag-btn { padding: 6px 14px; border-radius: 8px; border: 1px solid rgba(139,92,246,0.3); background: transparent; color: #a78bfa; font-size: 12px; cursor: pointer; transition: background 0.15s; }
.eng-pag-btn:hover { background: rgba(139,92,246,0.1); }

/* Options panel */
.eng-options-panel { background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.15); border-radius: 14px; padding: 20px; max-width: 400px; margin: 0 auto; }
.eng-opt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.eng-opt-row label { font-size: 13px; color: var(--text-secondary, #94a3b8); min-width: 60px; }

/* Word picker */
.eng-word-picker { margin-top: 10px; }
.eng-picker-actions { display: flex; gap: 8px; margin-bottom: 8px; }
.eng-picker-action { background: none; border: 1px solid rgba(139,92,246,0.3); color: #a78bfa; padding: 4px 10px; border-radius: 6px; font-size: 11px; cursor: pointer; }
.eng-picker-action:hover { background: rgba(139,92,246,0.1); }
.eng-picker-list { max-height: 200px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.eng-picker-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; cursor: pointer; font-size: 13px; color: var(--text-primary, #f1f5f9); }
.eng-picker-item:hover { background: rgba(139,92,246,0.06); }
.eng-picker-item input { accent-color: #8b5cf6; }
.eng-picker-meaning { margin-left: auto; font-size: 11px; color: var(--text-secondary, #94a3b8); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* ════════════════════════════════════════════════
   Games Styles
   ════════════════════════════════════════════════ */
.eng-games-title { font-size: 18px; font-weight: 700; color: var(--text-primary, #f1f5f9); margin: 0 0 16px; text-align: center; }
.eng-games-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.eng-game-card { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px 16px; background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.15); border-radius: 16px; cursor: pointer; transition: all 0.2s; text-align: center; }
.eng-game-card:hover { border-color: rgba(139,92,246,0.4); background: rgba(139,92,246,0.08); transform: translateY(-2px); }
.eng-game-icon { font-size: 36px; }
.eng-game-name { font-size: 14px; font-weight: 700; color: var(--text-primary, #f1f5f9); }
.eng-game-desc { font-size: 11px; color: var(--text-secondary, #94a3b8); }

@media (max-width: 500px) { .eng-games-grid { grid-template-columns: 1fr; } }

/* Game header */
.eng-game-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.eng-game-back-btn { background: none; border: none; color: #a78bfa; font-size: 13px; font-weight: 600; cursor: pointer; padding: 6px 0; }
.eng-game-back-btn:hover { color: #c4b5fd; }
.eng-game-label { font-size: 15px; font-weight: 700; color: var(--text-primary, #f1f5f9); }
.eng-game-progress { font-size: 13px; color: var(--text-secondary, #94a3b8); font-weight: 600; }
.eng-game-timer { font-size: 13px; color: #fbbf24; font-weight: 700; }
.eng-game-instruction { text-align: center; font-size: 13px; color: var(--text-secondary, #94a3b8); margin: 0 0 16px; }
.eng-game-score-bar { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-secondary, #94a3b8); font-weight: 600; }

/* Game result */
.eng-game-result { text-align: center; padding: 40px 20px; }
.eng-game-result-emoji { font-size: 56px; margin-bottom: 12px; }
.eng-game-result-score { font-size: 36px; font-weight: 900; color: #a78bfa; }
.eng-game-result-pct { font-size: 16px; color: var(--text-secondary, #94a3b8); margin: 8px 0 24px; }
.eng-game-result-btns { display: flex; gap: 10px; justify-content: center; }
.eng-btn-outline { background: transparent; border: 1px solid rgba(139,92,246,0.4); color: #a78bfa; }
.eng-btn-outline:hover { background: rgba(139,92,246,0.1); }

/* Word Match */
.eng-match-board { display: flex; gap: 16px; justify-content: center; }
.eng-match-col { display: flex; flex-direction: column; gap: 8px; flex: 1; max-width: 280px; }
.eng-match-item { padding: 12px 14px; border-radius: 10px; border: 1.5px solid rgba(255,255,255,0.1); background: rgba(30,30,58,0.5); color: var(--text-primary, #f1f5f9); font-size: 13px; cursor: pointer; transition: all 0.2s; text-align: left; }
.eng-match-item:hover:not(.eng-match-done) { border-color: rgba(139,92,246,0.4); }
.eng-match-item.eng-match-selected { border-color: #a78bfa; background: rgba(139,92,246,0.15); box-shadow: 0 0 0 2px rgba(139,92,246,0.2); }
.eng-match-item.eng-match-done { opacity: 0.5; cursor: default; pointer-events: none; }
.eng-match-item.eng-match-correct { border-color: #10b981; background: rgba(16,185,129,0.1); }
.eng-match-item.eng-match-wrong { border-color: #f87171; background: rgba(248,113,113,0.1); animation: engShake 0.4s; }
.eng-match-score { text-align: center; margin-top: 16px; font-size: 14px; color: var(--text-secondary, #94a3b8); font-weight: 600; }

@keyframes engShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* Spelling Bee */
.eng-spelling-card { background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.15); border-radius: 16px; padding: 28px 24px; text-align: center; max-width: 450px; margin: 0 auto; }
.eng-spelling-meaning { font-size: 18px; font-weight: 700; color: #10b981; margin-bottom: 12px; }
.eng-spelling-hint { font-size: 13px; color: var(--text-secondary, #94a3b8); margin-bottom: 20px; }
.eng-spelling-hint strong { color: #a78bfa; letter-spacing: 2px; }
.eng-spelling-input { width: 100%; padding: 14px 18px; border-radius: 12px; border: 1.5px solid rgba(255,255,255,0.1); background: rgba(15,15,30,0.5); color: var(--text-primary, #f1f5f9); font-size: 16px; text-align: center; outline: none; margin-bottom: 12px; letter-spacing: 1px; box-sizing: border-box; }
.eng-spelling-input:focus { border-color: rgba(139,92,246,0.5); }
.eng-spelling-feedback { min-height: 28px; margin-bottom: 12px; font-size: 14px; font-weight: 600; }
.eng-spelling-correct { color: #10b981; }
.eng-spelling-wrong { color: #f87171; }
.eng-fb-correct { animation: engPulse 0.3s; }
.eng-fb-wrong { animation: engShake 0.4s; }

@keyframes engPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Word Scramble */
.eng-scramble-card { background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.15); border-radius: 16px; padding: 28px 24px; text-align: center; max-width: 450px; margin: 0 auto; }
.eng-scramble-meaning { font-size: 15px; color: #10b981; font-weight: 600; margin-bottom: 16px; }
.eng-scramble-letters { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 20px; }
.eng-scramble-letter { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 42px; background: rgba(139,92,246,0.12); border: 1.5px solid rgba(139,92,246,0.3); border-radius: 8px; font-size: 18px; font-weight: 800; color: #c4b5fd; }
.eng-scramble-btns { display: flex; gap: 10px; justify-content: center; }

/* Light mode overrides */
.light-mode .eng-game-card { background: rgba(255,255,255,0.8); border-color: rgba(139,92,246,0.12); }
.light-mode .eng-match-item { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.1); }
.light-mode .eng-spelling-card, .light-mode .eng-scramble-card { background: rgba(255,255,255,0.8); border-color: rgba(139,92,246,0.12); }
.light-mode .eng-spelling-input { background: #f8fafc; border-color: rgba(0,0,0,0.1); color: #1e293b; }
.light-mode .eng-scramble-letter { background: rgba(139,92,246,0.08); border-color: rgba(139,92,246,0.2); color: #7c3aed; }


/* ════════════════════════════════════════════════
   XP / Level Bar
   ════════════════════════════════════════════════ */
.eng-xp-container { position: relative; display: flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 12px 16px; background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.15); border-radius: 14px; }
.eng-xp-level-badge { display: flex; align-items: center; justify-content: center; min-width: 48px; height: 32px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); border-radius: 8px; font-size: 13px; font-weight: 800; color: #fff; padding: 0 8px; white-space: nowrap; }
.eng-xp-bar-wrap { flex: 1; height: 14px; background: rgba(255,255,255,0.06); border-radius: 7px; overflow: hidden; position: relative; }
.eng-xp-bar-fill { height: 100%; background: linear-gradient(90deg, #8b5cf6, #a78bfa, #c4b5fd); border-radius: 7px; transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1); position: relative; }
.eng-xp-bar-fill::after { content: ''; position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent); animation: engXPShimmer 2s infinite; }
@keyframes engXPShimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.eng-xp-text { font-size: 12px; font-weight: 700; color: #a78bfa; white-space: nowrap; min-width: 80px; text-align: right; }
.eng-xp-total { font-size: 10px; color: var(--text-secondary, #94a3b8); white-space: nowrap; }

/* XP gain popup */
.eng-xp-popup { position: absolute; top: -8px; right: 16px; background: linear-gradient(135deg, #8b5cf6, #6d28d9); color: #fff; padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 700; animation: engXPFloat 2.5s forwards; pointer-events: none; z-index: 10; white-space: nowrap; box-shadow: 0 4px 12px rgba(139,92,246,0.4); }
.eng-xp-popup-levelup { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 4px 12px rgba(245,158,11,0.4); }
.eng-xp-levelup { margin-left: 4px; }
@keyframes engXPFloat {
    0% { opacity: 0; transform: translateY(10px) scale(0.8); }
    15% { opacity: 1; transform: translateY(0) scale(1); }
    80% { opacity: 1; transform: translateY(-20px); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* Level up modal */
.eng-levelup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 99999; animation: fadeIn 0.3s; backdrop-filter: blur(4px); }
.eng-levelup-modal { background: rgba(30,30,58,0.95); border: 2px solid rgba(139,92,246,0.4); border-radius: 20px; padding: 40px 32px; text-align: center; animation: engLevelBounce 0.5s; max-width: 320px; width: 90%; box-shadow: 0 20px 60px rgba(139,92,246,0.3); }
.eng-levelup-icon { font-size: 56px; margin-bottom: 12px; animation: engTrophy 1s infinite; }
.eng-levelup-title { font-size: 24px; font-weight: 900; color: #fbbf24; margin-bottom: 4px; text-transform: uppercase; letter-spacing: 2px; }
.eng-levelup-level { font-size: 42px; font-weight: 900; color: #a78bfa; margin-bottom: 8px; }
.eng-levelup-msg { font-size: 14px; color: var(--text-secondary, #94a3b8); margin-bottom: 20px; }
@keyframes engLevelBounce {
    0% { transform: scale(0.5); opacity: 0; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}
@keyframes engTrophy {
    0%, 100% { transform: rotate(-5deg); }
    50% { transform: rotate(5deg); }
}

/* Light mode */
.light-mode .eng-xp-container { background: rgba(255,255,255,0.8); border-color: rgba(139,92,246,0.12); }
.light-mode .eng-xp-bar-wrap { background: rgba(0,0,0,0.06); }
.light-mode .eng-levelup-modal { background: rgba(255,255,255,0.95); border-color: rgba(139,92,246,0.3); }

/* Responsive */
@media (max-width: 500px) {
    .eng-xp-container { flex-wrap: wrap; gap: 6px; padding: 10px 12px; }
    .eng-xp-total { display: none; }
}


/* ════════════════════════════════════════════════
   Game Hint Button & Penalty
   ════════════════════════════════════════════════ */
.eng-game-hint-btn { padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(251,191,36,0.3); background: rgba(251,191,36,0.08); color: #fbbf24; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.eng-game-hint-btn:hover { background: rgba(251,191,36,0.15); border-color: rgba(251,191,36,0.5); }

.eng-match-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.eng-match-score { font-size: 14px; color: var(--text-secondary, #94a3b8); font-weight: 600; }

.eng-match-item.eng-match-hint-flash { border-color: #fbbf24 !important; background: rgba(251,191,36,0.15) !important; box-shadow: 0 0 12px rgba(251,191,36,0.3); animation: engHintPulse 0.6s ease 3; }
@keyframes engHintPulse {
    0%, 100% { box-shadow: 0 0 4px rgba(251,191,36,0.2); }
    50% { box-shadow: 0 0 16px rgba(251,191,36,0.5); }
}

.eng-spelling-btns { display: flex; gap: 8px; justify-content: center; align-items: center; }

.eng-xp-popup-penalty { background: linear-gradient(135deg, #ef4444, #dc2626); box-shadow: 0 4px 12px rgba(239,68,68,0.4); }

.eng-game-result-penalty { font-size: 13px; color: #f87171; margin: 8px 0; font-weight: 600; }

.light-mode .eng-game-hint-btn { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.4); }


/* ════════════════════════════════════════════════
   Part of Speech Badge
   ════════════════════════════════════════════════ */
.eng-pos { display: inline-block; font-size: 11px; font-weight: 700; color: #60a5fa; background: rgba(96,165,250,0.1); border: 1px solid rgba(96,165,250,0.2); padding: 2px 8px; border-radius: 4px; text-transform: lowercase; font-style: italic; vertical-align: middle; }
.eng-saved-pos { font-size: 11px; font-weight: 600; color: #60a5fa; background: rgba(96,165,250,0.08); padding: 2px 6px; border-radius: 4px; font-style: italic; white-space: nowrap; }
.eng-review-pos { font-size: 13px; color: #60a5fa; font-style: italic; margin-top: 4px; font-weight: 600; }
.eng-quiz-pos { font-size: 13px; color: #60a5fa; font-style: italic; margin-bottom: 8px; font-weight: 600; }
.light-mode .eng-pos, .light-mode .eng-saved-pos { color: #2563eb; background: rgba(37,99,235,0.08); border-color: rgba(37,99,235,0.15); }


/* Scramble hint display */
.eng-scramble-hint-display { margin: 12px 0; padding: 10px 14px; background: rgba(251,191,36,0.06); border: 1px solid rgba(251,191,36,0.15); border-radius: 8px; font-size: 14px; color: var(--text-secondary, #94a3b8); text-align: center; }


/* ════════════════════════════════════════════════
   Mastery Badge
   ════════════════════════════════════════════════ */
.eng-mastery-badge { display: inline-block; font-size: 10px; font-weight: 700; color: var(--mastery-color, #94a3b8); background: color-mix(in srgb, var(--mastery-color, #94a3b8) 12%, transparent); border: 1px solid color-mix(in srgb, var(--mastery-color, #94a3b8) 25%, transparent); padding: 2px 8px; border-radius: 4px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.3px; }


/* ════════════════════════════════════════════════
   Saved Word Detail (expandable)
   ════════════════════════════════════════════════ */
.eng-saved-clickable { cursor: pointer; transition: all 0.2s; }
.eng-saved-clickable:hover { background: rgba(139,92,246,0.06); border-left: 3px solid rgba(139,92,246,0.4); padding-left: 11px; }
.eng-saved-expanded { background: rgba(139,92,246,0.08); border-left: 3px solid #a78bfa; padding-left: 11px; }

.eng-word-detail { animation: engDetailSlide 0.25s ease; overflow: hidden; }
.eng-word-detail-inner { padding: 14px 16px; margin: 4px 0 8px; background: rgba(30,30,58,0.6); border: 1px solid rgba(139,92,246,0.15); border-radius: 12px; }
.eng-word-detail-inner .eng-word-header { margin-bottom: 8px; }
.eng-word-detail-inner .eng-meaning { margin-bottom: 6px; }
.eng-word-detail-inner .eng-example { margin-bottom: 8px; }

.eng-detail-stats { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.eng-detail-stat { font-size: 12px; color: var(--text-secondary, #94a3b8); font-weight: 600; }

@keyframes engDetailSlide {
    from { opacity: 0; max-height: 0; transform: translateY(-8px); }
    to { opacity: 1; max-height: 300px; transform: translateY(0); }
}

.light-mode .eng-word-detail-inner { background: rgba(255,255,255,0.8); border-color: rgba(139,92,246,0.1); }
.light-mode .eng-saved-clickable:hover { background: rgba(139,92,246,0.04); }
.light-mode .eng-saved-expanded { background: rgba(139,92,246,0.06); }


/* ════════════════════════════════════════════════
   Saved Words Filter Bar
   ════════════════════════════════════════════════ */
.eng-saved-filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.eng-filter-select { padding: 8px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(15,15,30,0.5); color: var(--text-primary, #f1f5f9); font-size: 12px; font-weight: 600; outline: none; cursor: pointer; flex: 1; min-width: 120px; }
.eng-filter-select:focus { border-color: rgba(139,92,246,0.4); }
.eng-filter-select option { background: #1e1e3a; color: #f1f5f9; }
.light-mode .eng-filter-select { background: #f8fafc; border-color: rgba(0,0,0,0.1); color: #1e293b; }
.light-mode .eng-filter-select option { background: #fff; color: #1e293b; }


/* ════════════════════════════════════════════════
   Daily Missions
   ════════════════════════════════════════════════ */
.eng-missions { margin-bottom: 16px; background: rgba(30,30,58,0.4); border: 1px solid rgba(139,92,246,0.1); border-radius: 14px; padding: 14px 16px; }
.eng-missions-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.eng-missions-title { font-size: 14px; font-weight: 700; color: var(--text-primary, #f1f5f9); }
.eng-missions-count { font-size: 12px; font-weight: 700; color: #a78bfa; background: rgba(139,92,246,0.12); padding: 3px 10px; border-radius: 10px; }
.eng-missions-list { display: flex; flex-direction: column; gap: 8px; }

.eng-mission-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,0.02); border: 1px solid rgba(255,255,255,0.04); transition: all 0.2s; }
.eng-mission-item.eng-mission-done { border-color: rgba(16,185,129,0.2); background: rgba(16,185,129,0.04); }
.eng-mission-item.eng-mission-claimed { opacity: 0.5; }
.eng-mission-icon { font-size: 18px; flex-shrink: 0; }
.eng-mission-info { flex: 1; min-width: 0; }
.eng-mission-label { font-size: 12px; color: var(--text-secondary, #94a3b8); margin-bottom: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eng-mission-bar { height: 6px; background: rgba(255,255,255,0.06); border-radius: 3px; overflow: hidden; }
.eng-mission-bar-fill { height: 100%; background: linear-gradient(90deg, #8b5cf6, #a78bfa); border-radius: 3px; transition: width 0.4s ease; }
.eng-mission-done .eng-mission-bar-fill { background: linear-gradient(90deg, #10b981, #34d399); }
.eng-mission-progress-text { font-size: 11px; font-weight: 700; color: var(--text-secondary, #94a3b8); white-space: nowrap; min-width: 30px; text-align: right; }
.eng-mission-claim-btn { padding: 5px 10px; border-radius: 6px; border: none; background: linear-gradient(135deg, #10b981, #059669); color: #fff; font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; animation: engMissionPulse 1.5s infinite; }
.eng-mission-claim-btn:hover { transform: scale(1.05); }
.eng-mission-claimed-label { font-size: 16px; }
@keyframes engMissionPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); } 50% { box-shadow: 0 0 0 4px rgba(16,185,129,0); } }

.light-mode .eng-missions { background: rgba(255,255,255,0.7); border-color: rgba(139,92,246,0.1); }
.light-mode .eng-mission-item { background: rgba(255,255,255,0.5); border-color: rgba(0,0,0,0.05); }

@media (max-width: 500px) {
    .eng-mission-label { font-size: 11px; }
    .eng-mission-item { gap: 6px; padding: 8px 10px; }
}


/* ════════════════════════════════════════════════
   Study Timer
   ════════════════════════════════════════════════ */
.eng-study-timer { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; margin-bottom: 12px; background: rgba(30,30,58,0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 12px; }
.eng-timer-left { display: flex; align-items: center; gap: 8px; }
.eng-timer-icon { font-size: 16px; }
.eng-timer-time { font-size: 20px; font-weight: 800; color: var(--text-primary, #f1f5f9); font-variant-numeric: tabular-nums; }
.eng-timer-label { font-size: 11px; color: var(--text-secondary, #94a3b8); }
.eng-timer-right { display: flex; align-items: center; gap: 6px; }
.eng-timer-goal { font-size: 11px; color: var(--text-secondary, #94a3b8); font-weight: 600; }
.eng-timer-set-btn { background: none; border: none; font-size: 14px; cursor: pointer; padding: 4px; border-radius: 6px; transition: background 0.2s; }
.eng-timer-set-btn:hover { background: rgba(139,92,246,0.1); }
.light-mode .eng-study-timer { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.05); }

/* Goal modal options */
.eng-goal-options { display: flex; gap: 6px; flex-wrap: wrap; }
.eng-goal-opt { padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(139,92,246,0.3); background: rgba(139,92,246,0.06); color: #a78bfa; font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.eng-goal-opt:hover { background: rgba(139,92,246,0.15); border-color: #a78bfa; }

/* Manual Add Word */
.eng-add-word-bar { margin-bottom: 12px; }
.eng-add-word-toggle { background: none; border: 1px dashed rgba(139,92,246,0.3); color: #a78bfa; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; width: 100%; transition: all 0.2s; }
.eng-add-word-toggle:hover { background: rgba(139,92,246,0.06); border-color: #a78bfa; }
.eng-add-word-form { margin-top: 10px; padding: 14px; background: rgba(30,30,58,0.5); border: 1px solid rgba(139,92,246,0.12); border-radius: 12px; }
.eng-add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.eng-add-input { flex: 1; padding: 9px 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.1); background: rgba(15,15,30,0.5); color: var(--text-primary, #f1f5f9); font-size: 13px; outline: none; }
.eng-add-input:focus { border-color: rgba(139,92,246,0.4); }
.eng-add-input::placeholder { color: var(--text-secondary, #94a3b8); }
.eng-add-full { flex: 3; }
.light-mode .eng-add-word-form { background: rgba(255,255,255,0.8); border-color: rgba(139,92,246,0.1); }
.light-mode .eng-add-input { background: #f8fafc; border-color: rgba(0,0,0,0.1); color: #1e293b; }

/* Mission customize */
.eng-missions-header-right { display: flex; align-items: center; gap: 8px; }
.eng-missions-settings { background: none; border: none; font-size: 14px; cursor: pointer; padding: 2px 4px; border-radius: 4px; opacity: 0.6; transition: opacity 0.2s; }
.eng-missions-settings:hover { opacity: 1; }
.eng-custom-missions { display: flex; flex-direction: column; gap: 8px; }
.eng-cm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--text-primary, #f1f5f9); }
.eng-cm-row .eng-count-input { width: 55px; }


/* ════════════════════════════════════════════════
   Word Detail Actions (Edit/Delete)
   ════════════════════════════════════════════════ */
.eng-detail-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.06); }
.eng-detail-btn { padding: 6px 12px; border-radius: 6px; border: none; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.eng-detail-edit { background: rgba(96,165,250,0.1); color: #60a5fa; border: 1px solid rgba(96,165,250,0.2); }
.eng-detail-edit:hover { background: rgba(96,165,250,0.2); }
.eng-detail-delete { background: rgba(248,113,113,0.1); color: #f87171; border: 1px solid rgba(248,113,113,0.2); }
.eng-detail-delete:hover { background: rgba(248,113,113,0.2); }
.eng-edit-form { animation: engDetailSlide 0.2s ease; }
.eng-edit-btns { display: flex; gap: 8px; margin-top: 8px; }
.light-mode .eng-detail-edit { background: rgba(37,99,235,0.06); color: #2563eb; border-color: rgba(37,99,235,0.15); }
.light-mode .eng-detail-delete { background: rgba(220,38,38,0.06); color: #dc2626; border-color: rgba(220,38,38,0.15); }


/* ════════════════════════════════════════════════
   Light Mode - Comprehensive Fixes
   ════════════════════════════════════════════════ */
.light-mode .eng-page { color: #1e293b; }
.light-mode .eng-title { color: #1e293b; }
.light-mode .eng-tabs { background: rgba(241,245,249,0.8); }
.light-mode .eng-tab { color: #64748b; }
.light-mode .eng-tab:hover { color: #1e293b; }
.light-mode .eng-tab.eng-tab-active { background: rgba(139,92,246,0.12); color: #7c3aed; }
.light-mode .eng-custom-topic { background: #fff; border-color: rgba(0,0,0,0.1); color: #1e293b; }
.light-mode .eng-count-input { background: #fff; border-color: rgba(0,0,0,0.1); color: #1e293b; }
.light-mode .eng-options-panel { background: rgba(255,255,255,0.9); border-color: rgba(139,92,246,0.1); }
.light-mode .eng-review-card { background: rgba(255,255,255,0.9); }
.light-mode .eng-review-word { color: #1e293b; }
.light-mode .eng-review-hint { color: #64748b; }
.light-mode .eng-quiz-word { color: #1e293b; }
.light-mode .eng-quiz-opt { background: rgba(255,255,255,0.8); border-color: rgba(0,0,0,0.08); color: #1e293b; }
.light-mode .eng-quiz-opt:hover { border-color: rgba(139,92,246,0.3); background: rgba(139,92,246,0.04); }
.light-mode .eng-game-header .eng-game-label { color: #1e293b; }
.light-mode .eng-game-instruction { color: #64748b; }
.light-mode .eng-spelling-meaning { color: #059669; }
.light-mode .eng-scramble-meaning { color: #059669; }
.light-mode .eng-game-result-score { color: #7c3aed; }
.light-mode .eng-missions { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.06); }
.light-mode .eng-missions-title { color: #1e293b; }
.light-mode .eng-mission-item { background: rgba(255,255,255,0.5); border-color: rgba(0,0,0,0.05); }
.light-mode .eng-mission-label { color: #475569; }
.light-mode .eng-mission-bar { background: rgba(0,0,0,0.06); }
.light-mode .eng-study-timer { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.06); }
.light-mode .eng-timer-time { color: #1e293b; }
.light-mode .eng-games-title { color: #1e293b; }
.light-mode .eng-game-name { color: #1e293b; }
.light-mode .eng-empty { color: #64748b; }


/* ════════════════════════════════════════════════
   Mobile Responsive - English Page
   ════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .eng-page { padding: 16px 10px 60px; }
    .eng-title { font-size: 18px; }
    .eng-tabs { gap: 2px; padding: 3px; }
    .eng-tab { padding: 8px 4px; font-size: 11px; }
    .eng-gen-bar { flex-direction: column; }
    .eng-gen-bar2 { flex-direction: column; align-items: stretch; }
    .eng-count-wrap { justify-content: space-between; }
    .eng-word-card { padding: 12px; }
    .eng-word-header strong { font-size: 16px; }
    .eng-review-card { padding: 24px 16px; min-height: 160px; }
    .eng-review-word { font-size: 22px; }
    .eng-quiz-word { font-size: 22px; }
    .eng-quiz-options { max-width: 100%; }
    .eng-match-board { flex-direction: column; gap: 12px; }
    .eng-match-col { max-width: 100%; }
    .eng-spelling-card, .eng-scramble-card { padding: 20px 14px; }
    .eng-spelling-btns { flex-wrap: wrap; }
    .eng-scramble-btns { flex-wrap: wrap; justify-content: center; }
    .eng-games-grid { grid-template-columns: 1fr; }
    .eng-game-card { padding: 16px; flex-direction: row; gap: 12px; }
    .eng-game-icon { font-size: 28px; }
    .eng-saved-item { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
    .eng-saved-filters { flex-direction: column; gap: 6px; }
    .eng-filter-select { min-width: 100%; }
    .eng-add-row { flex-direction: column; gap: 6px; }
    .eng-xp-container { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
    .eng-xp-total { display: none; }
    .eng-study-timer { flex-direction: column; gap: 6px; align-items: flex-start; }
    .eng-missions-header { flex-wrap: wrap; }
    .eng-mission-item { flex-wrap: wrap; gap: 6px; }
}


/* ════════════════════════════════════════════════
   Charts
   ════════════════════════════════════════════════ */
.eng-charts { margin-bottom: 16px; }
.eng-chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.eng-chart-card { background: rgba(30,30,58,0.4); border: 1px solid rgba(255,255,255,0.05); border-radius: 14px; padding: 14px; }
.eng-chart-title { font-size: 13px; font-weight: 700; color: var(--text-primary, #f1f5f9); margin-bottom: 12px; }

/* Donut */
.eng-donut-wrap { display: flex; align-items: center; gap: 12px; }
.eng-donut { width: 80px; height: 80px; border-radius: 50%; position: relative; flex-shrink: 0; }
.eng-donut::after { content: ''; position: absolute; inset: 18px; background: rgba(15,15,30,0.9); border-radius: 50%; }
.eng-donut-legend { display: flex; flex-direction: column; gap: 4px; }
.eng-legend-item { font-size: 11px; color: var(--text-secondary, #94a3b8); display: flex; align-items: center; gap: 6px; }
.eng-legend-item strong { color: var(--text-primary, #f1f5f9); margin-left: 2px; }
.eng-legend-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Bars */
.eng-bars-wrap { display: flex; flex-direction: column; gap: 8px; }
.eng-bar-item { }
.eng-bar-label { font-size: 11px; color: var(--text-secondary, #94a3b8); margin-bottom: 3px; display: flex; justify-content: space-between; }
.eng-bar-label span { color: #a78bfa; font-weight: 700; }
.eng-bar-track { height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.eng-bar-fill { height: 100%; background: linear-gradient(90deg, #8b5cf6, #a78bfa); border-radius: 4px; transition: width 0.6s ease; }

/* Light mode */
.light-mode .eng-chart-card { background: rgba(255,255,255,0.7); border-color: rgba(0,0,0,0.06); }
.light-mode .eng-donut::after { background: rgba(255,255,255,0.9); }
.light-mode .eng-bar-track { background: rgba(0,0,0,0.06); }

@media (max-width: 500px) {
    .eng-chart-row { grid-template-columns: 1fr; }
    .eng-donut-wrap { flex-direction: column; align-items: flex-start; }
}


/* Quiz Timer */
.eng-quiz-timer { font-size: 16px; font-weight: 700; color: #a78bfa; text-align: center; margin-bottom: 12px; padding: 6px 14px; background: rgba(139,92,246,0.1); border-radius: 8px; display: inline-block; }
.eng-quiz-timer-danger { color: #f87171 !important; background: rgba(248,113,113,0.1) !important; animation: engTimerPulse 0.5s infinite; }
@keyframes engTimerPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }


/* English Leaderboard */
.eng-lb-btn-wrap { text-align: right; margin: -12px 0 8px; }
.eng-lb-btn { background: none; border: 1px solid rgba(139,92,246,0.3); color: #a78bfa; padding: 5px 12px; border-radius: 8px; font-size: 12px; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.eng-lb-btn:hover { background: rgba(139,92,246,0.1); }
.eng-lb-list { display: flex; flex-direction: column; gap: 6px; }
.eng-lb-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: rgba(255,255,255,0.02); }
.eng-lb-row.eng-lb-me { background: rgba(139,92,246,0.1); border: 1px solid rgba(139,92,246,0.2); }
.eng-lb-rank { font-size: 14px; min-width: 28px; text-align: center; font-weight: 700; }
.eng-lb-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; flex-shrink: 0; }
.eng-lb-avatar-img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.eng-lb-info { flex: 1; min-width: 0; }
.eng-lb-name { font-size: 13px; font-weight: 600; color: var(--text-primary, #f1f5f9); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eng-lb-meta { font-size: 11px; color: var(--text-secondary, #94a3b8); }
.eng-lb-xp { font-size: 12px; font-weight: 700; color: #a78bfa; white-space: nowrap; }
.light-mode .eng-lb-row { background: rgba(0,0,0,0.02); }
.light-mode .eng-lb-name { color: #1e293b; }
.light-mode .eng-lb-btn { color: #7c3aed; border-color: rgba(139,92,246,0.2); }

/* ── Generate button loading state ── */
.eng-spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: engSpin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}
@keyframes engSpin {
    to { transform: rotate(360deg); }
}
.eng-btn-loading {
    background: linear-gradient(135deg, #6d28d9, #4c1d95) !important;
    animation: engPulse 1.5s ease-in-out infinite;
}
@keyframes engPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ── Skeleton loading for word cards ── */
.eng-word-skeleton {
    background: rgba(30,30,58,0.5);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 16px;
    margin-bottom: 10px;
}
.eng-skel-word {
    width: 40%;
    height: 20px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: engShimmer 1.5s infinite;
    border-radius: 6px;
    margin-bottom: 10px;
}
.eng-skel-meaning {
    width: 70%;
    height: 14px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: engShimmer 1.5s infinite 0.2s;
    border-radius: 4px;
    margin-bottom: 8px;
}
.eng-skel-example {
    width: 90%;
    height: 12px;
    background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
    background-size: 200% 100%;
    animation: engShimmer 1.5s infinite 0.4s;
    border-radius: 4px;
}
@keyframes engShimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Light mode */
.light-mode .eng-word-skeleton { background: rgba(0,0,0,0.03); border-color: rgba(0,0,0,0.06); }
.light-mode .eng-skel-word,
.light-mode .eng-skel-meaning,
.light-mode .eng-skel-example {
    background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
    background-size: 200% 100%;
}
