/* ===================================================================
   Cambridge Pre A1 Starters - Kids Vocabulary Learning Platform
   Theme: Eco-Adventure & Wonderland (Forest Green, Gold, Sky Blue)
   Typography: Native Vietnamese Kid-Friendly Fonts (Baloo 2, Nunito, Quicksand)
   Sizes: Enlarged, High Legibility, Eye-Comfort Design
   =================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800;900&family=Be+Vietnam+Pro:wght@600;700;800;900&family=Quicksand:wght@600;700;800&display=swap');

:root {
  --primary: #1E6B43;
  --primary-light: #2EC4B6;
  --primary-dark: #14492E;
  --accent-gold: #FFD23F;
  --accent-orange: #FF9F1C;
  --accent-coral: #FF6B6B;
  --accent-pink: #EC4899;
  --accent-blue: #3A86FF;
  --accent-purple: #8338EC;
  --accent-teal: #14B8A6;
  
  --bg-page: #F6F9F6;
  --bg-card: #FFFFFF;
  --bg-soft: #F0FDF4;
  
  --text-primary: #111827;
  --text-secondary: #374151;
  --text-muted: #6B7280;
  
  --shadow-sm: 0 3px 10px rgba(0,0,0,0.06);
  --shadow-md: 0 10px 28px rgba(30,107,67,0.1);
  --shadow-lg: 0 18px 40px rgba(30,107,67,0.14);
  --shadow-hover: 0 14px 32px rgba(0,0,0,0.16);
  
  --radius-sm: 14px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-full: 9999px;
  
  --font-heading: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif;
}

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

button, input, select, textarea, optgroup, option {
  font-family: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif !important;
  color: inherit;
}

body {
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 18px; /* Tăng kích thước chữ tổng thể */
  line-height: 1.7;
  min-height: 100vh;
  overflow-x: hidden;
  background-image: 
    radial-gradient(#2EC4B6 0.9px, transparent 0.9px), 
    radial-gradient(#FFD23F 0.9px, #F6F9F6 0.9px);
  background-size: 34px 34px;
  background-position: 0 0, 17px 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Scrollbar */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #E5E7EB; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* Header & Nav */
.main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(14px);
  border-bottom: 3px solid #E5E7EB;
  padding: 14px 28px;
  box-shadow: var(--shadow-sm);
}

.header-container {
  max-width: 1350px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
}

.logo-badge {
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, #FFD23F 0%, #FF9F1C 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 5px 15px rgba(255, 159, 28, 0.4);
  transform: rotate(-5deg);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.logo-area:hover .logo-badge {
  transform: rotate(10deg) scale(1.1);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 24px; /* to rõ */
  font-weight: 800;
  color: var(--primary);
  line-height: 1.15;
}
.logo-text span {
  font-size: 14px;
  font-weight: 700;
  color: #D97706;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: #F3F4F6;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-full);
  font-weight: 800;
  font-size: 16px; /* to rõ cho các con và phụ huynh */
  transition: all 0.2s ease;
  border: 2px solid transparent;
  cursor: pointer;
}
.nav-btn:hover {
  background: var(--bg-soft);
  color: var(--primary);
  border-color: var(--primary-light);
  transform: translateY(-2px);
}
.nav-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 14px rgba(30, 107, 67, 0.3);
}

.nav-btn.highlight {
  background: linear-gradient(135deg, #FFD23F 0%, #FF9F1C 100%);
  color: #78350F;
  border: none;
  box-shadow: 0 4px 14px rgba(255, 210, 63, 0.45);
}
.nav-btn.highlight:hover {
  transform: translateY(-2px) scale(1.05);
}

.user-score {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FEF3C7;
  border: 2.5px solid #FCD34D;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-weight: 900;
  color: #B45309;
  font-size: 18px; /* to rõ */
}
.user-score .star-icon {
  font-size: 22px;
  animation: pulse-star 1.5s infinite;
}

@keyframes pulse-star {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3) rotate(12deg); }
}

/* Hero Banner */
.hero-banner {
  max-width: 1350px;
  margin: 28px auto 36px;
  padding: 38px 44px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #1E6B43 0%, #0F452A 60%, #165335 100%);
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 28px;
}
.hero-banner::after {
  content: '';
  position: absolute;
  top: -40px;
  right: -40px;
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(255,210,63,0.25) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}
.hero-content {
  max-width: 780px;
  position: relative;
  z-index: 2;
}
.hero-tag {
  display: inline-block;
  background: rgba(255, 210, 63, 0.25);
  border: 1.5px solid #FFD23F;
  color: #FFD23F;
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 14px;
  letter-spacing: 0.6px;
}
.hero-content h2 {
  font-family: var(--font-heading);
  font-size: 38px; /* to rõ, không lóa mắt */
  font-weight: 800;
  line-height: 1.3;
  margin-bottom: 16px;
  text-shadow: 0 2px 8px rgba(0,0,0,0.25);
}
.hero-content p {
  font-size: 19px; /* to dễ đọc */
  color: #F1F5F9;
  margin-bottom: 24px;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.btn-hero-primary {
  background: linear-gradient(135deg, #FFD23F 0%, #FF9F1C 100%);
  color: #78350F;
  font-weight: 800;
  font-size: 18px; /* to rõ */
  padding: 14px 28px;
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  box-shadow: 0 5px 20px rgba(255, 159, 28, 0.45);
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
  border: none;
}
.btn-hero-primary:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 8px 26px rgba(255, 159, 28, 0.55);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.45);
  font-weight: 800;
  font-size: 17px;
  padding: 14px 26px;
  border-radius: var(--radius-full);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(8px);
  transition: all 0.2s;
}
.btn-hero-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: white;
  transform: translateY(-2px);
}

.hero-mascot {
  position: relative;
  z-index: 2;
  font-size: 110px;
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.3));
  animation: float-mascot 3s ease-in-out infinite;
}
@keyframes float-mascot {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(5deg); }
}

/* Search Bar */
.search-container {
  max-width: 1350px;
  margin: 0 auto 36px;
  padding: 0 16px;
}
.search-box {
  background: white;
  border-radius: var(--radius-full);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-md);
  border: 3px solid #E5E7EB;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box:focus-within {
  border-color: var(--primary-light);
  box-shadow: 0 8px 26px rgba(46, 196, 182, 0.25);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 18px; /* chữ to, gõ dễ nhìn */
  font-family: var(--font-body);
  font-weight: 700;
  color: var(--text-primary);
}
.search-box input::placeholder {
  color: var(--text-muted);
  font-weight: 600;
}
.search-icon {
  font-size: 26px;
  color: var(--primary);
}
.voice-search-btn {
  background: #EFF6FF;
  border: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent-blue);
  transition: all 0.2s;
}
.voice-search-btn:hover {
  background: var(--accent-blue);
  color: white;
  transform: scale(1.1);
}

/* Section Title */
.section-title {
  max-width: 1350px;
  margin: 0 auto 24px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.section-title h3 {
  font-family: var(--font-heading);
  font-size: 30px; /* to, rõ ràng */
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title .badge-count {
  background: #E0E7FF;
  color: #3730A3;
  font-size: 16px;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-weight: 800;
}

/* Lessons Grid */
.lessons-grid {
  max-width: 1350px;
  margin: 0 auto 52px;
  padding: 0 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 28px;
}

.lesson-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 3.5px solid #E5E7EB;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
}
.lesson-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.lesson-card-header {
  padding: 24px;
  color: white;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.lesson-number {
  background: rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(6px);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.lesson-icon {
  font-size: 48px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.2));
  transition: transform 0.3s;
}
.lesson-card:hover .lesson-icon {
  transform: scale(1.2) rotate(6deg);
}

.lesson-card-body {
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.lesson-page-tag {
  font-size: 14px;
  font-weight: 800;
  color: #D97706;
  margin-bottom: 8px;
}
.lesson-title-en {
  font-family: var(--font-heading);
  font-size: 24px; /* to rõ */
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.lesson-title-vi {
  font-size: 17px; /* tiếng Việt to rõ */
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 14px;
}
.lesson-desc {
  font-size: 16px; /* dễ đọc */
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 18px;
  flex: 1;
}

.lesson-word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.word-pill {
  background: #F3F4F6;
  color: var(--text-secondary);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.lesson-card-footer {
  padding-top: 16px;
  border-top: 2px dashed #E5E7EB;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.lesson-stat {
  font-size: 15px;
  font-weight: 800;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}
.btn-enter-lesson {
  background: var(--primary);
  color: white;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 800;
  border: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s, transform 0.2s;
  cursor: pointer;
}
.lesson-card:hover .btn-enter-lesson {
  background: var(--primary-light);
  transform: translateX(4px);
}

/* Lesson Header & Let's Talk */
.lesson-page-header {
  max-width: 1350px;
  margin: 24px auto 32px;
  padding: 0 16px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 17px; /* to rõ */
  color: var(--primary);
  background: white;
  padding: 10px 22px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  border: 2.5px solid #E5E7EB;
  transition: all 0.2s;
}
.back-link:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateX(-4px);
}

.unit-banner {
  padding: 36px 40px;
  border-radius: var(--radius-lg);
  color: white;
  box-shadow: var(--shadow-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 24px;
}
.unit-info h2 {
  font-family: var(--font-heading);
  font-size: 38px; /* to rõ nổi bật */
  font-weight: 800;
  margin-bottom: 8px;
}
.unit-info h4 {
  font-size: 20px;
  font-weight: 700;
  opacity: 0.95;
  margin-bottom: 14px;
  line-height: 1.5;
}
.unit-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.meta-chip {
  background: rgba(255,255,255,0.25);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

.lets-talk-box {
  max-width: 1350px;
  margin: 0 auto 40px;
  padding: 0 16px;
}
.talk-card {
  background: #FFFBEB;
  border: 3.5px solid #FCD34D;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}
.talk-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}
.talk-header h3 {
  font-family: var(--font-heading);
  font-size: 26px; /* to rõ */
  font-weight: 800;
  color: #B45309;
}
.talk-badge {
  background: #FDE68A;
  color: #92400E;
  font-size: 14px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}
.talk-questions-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 20px;
}
.talk-item {
  background: white;
  border-radius: var(--radius-md);
  padding: 20px;
  border: 2.5px solid #FDE68A;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.talk-q {
  font-size: 19px; /* câu hỏi to */
  font-weight: 800;
  color: #1F2937;
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.45;
}
.talk-q-vi {
  font-size: 16px; /* tiếng Việt êm mắt, rõ ràng */
  color: #4B5563;
  margin-bottom: 12px;
  padding-left: 30px;
  line-height: 1.5;
}
.talk-hint {
  background: #F0FDF4;
  border-left: 4px solid var(--primary-light);
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 16px;
  color: #065F46;
  margin-bottom: 14px;
  line-height: 1.5;
}
.talk-actions {
  display: flex;
  gap: 10px;
}
.talk-actions .nav-btn {
  font-size: 15px;
  padding: 8px 16px;
}

/* Word Card */
.words-section {
  max-width: 1350px;
  margin: 0 auto 52px;
  padding: 0 16px;
}
.words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.word-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 3.5px solid #E5E7EB;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.word-card:hover {
  transform: translateY(-6px);
  border-color: var(--primary-light);
  box-shadow: var(--shadow-hover);
}

.word-visual {
  height: 200px;
  background: linear-gradient(135deg, #F0FDF4 0%, #E6FFFA 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  border-bottom: 2.5px dashed #E5E7EB;
}
.word-visual .visual-icon {
  font-size: 90px;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.15));
  transition: transform 0.3s;
}
.word-card:hover .visual-icon {
  transform: scale(1.15) rotate(5deg);
}

.word-tag-pos {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(255, 255, 255, 0.95);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-secondary);
  border: 1.5px solid #D1D5DB;
  box-shadow: var(--shadow-sm);
}

.card-star-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  background: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: transform 0.2s;
}
.card-star-btn:hover {
  transform: scale(1.2);
}

.word-details {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.word-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 8px;
}
.word-text {
  font-family: var(--font-heading);
  font-size: 32px; /* Từ tiếng Anh rất to, rõ nét */
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.3px;
}
.word-ipa {
  font-size: 16px; /* Phiên âm to rõ */
  color: var(--text-muted);
  font-family: monospace;
  font-weight: 600;
}

.word-meaning {
  font-size: 22px; /* Nghĩa tiếng Việt to, màu xanh dễ nhìn */
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 16px;
  line-height: 1.4;
}

/* Pronounce Buttons */
.pronounce-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}
.btn-audio {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  border: 2.5px solid transparent;
  font-family: var(--font-heading);
  font-size: 16px; /* to, dễ bấm */
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-audio.uk {
  background: #EFF6FF;
  color: #1E40AF;
  border-color: #BFDBFE;
}
.btn-audio.uk:hover {
  background: #DBEAFE;
  transform: translateY(-2px);
}
.btn-audio.us {
  background: #FEF2F2;
  color: #991B1B;
  border-color: #FECACA;
}
.btn-audio.us:hover {
  background: #FEE2E2;
  transform: translateY(-2px);
}
.btn-audio.playing {
  animation: pulse-audio 0.6s infinite alternate;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.5);
}

@keyframes pulse-audio {
  from { transform: scale(0.98); }
  to { transform: scale(1.04); }
}

/* Example Box */
.word-example-box {
  background: #F8FAFC;
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 18px;
  border-left: 4px solid var(--accent-orange);
  font-size: 16px;
}
.example-en {
  font-weight: 800;
  font-size: 17px; /* to rõ */
  color: var(--text-primary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.5;
}
.btn-listen-sentence {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--accent-orange);
  font-size: 18px;
  padding: 4px;
}
.btn-listen-sentence:hover {
  transform: scale(1.25);
}
.example-vi {
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

/* Speech Practice */
.speak-practice-area {
  margin-top: auto;
}
.btn-speak-practice {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  background: #F3F4F6;
  border: 2.5px dashed #CBD5E1;
  border-radius: var(--radius-md);
  font-weight: 800;
  font-size: 16px; /* to rõ */
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.btn-speak-practice:hover {
  background: #ECFDF5;
  border-color: var(--primary-light);
  color: var(--primary);
}
.btn-speak-practice.listening {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #DC2626;
  animation: pulse-mic 1s infinite;
}

@keyframes pulse-mic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.speech-result {
  margin-top: 10px;
  display: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
  line-height: 1.5;
}
.speech-result.success {
  display: block;
  background: #ECFDF5;
  color: #065F46;
  border: 2px solid #A7F3D0;
}
.speech-result.try-again {
  display: block;
  background: #FFFBEB;
  color: #92400E;
  border: 2px solid #FDE68A;
}

/* Games Hub & Arenas */
.games-hub-section {
  max-width: 1350px;
  margin: 0 auto 52px;
  padding: 0 16px;
}
.game-tabs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 10px;
  margin-bottom: 28px;
}
.game-tab-btn {
  padding: 12px 24px;
  background: white;
  border: 3px solid #E5E7EB;
  border-radius: var(--radius-full);
  font-family: var(--font-heading);
  font-size: 17px; /* to rõ */
  font-weight: 800;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
}
.game-tab-btn:hover {
  border-color: var(--primary-light);
  color: var(--primary);
  transform: translateY(-2px);
}
.game-tab-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(30, 107, 67, 0.35);
}

/* Grand Game Control Panel */
.game-control-panel {
  max-width: 1350px;
  margin: 0 auto 32px;
  padding: 24px 30px;
  background: white;
  border-radius: var(--radius-lg);
  border: 3.5px solid #E5E7EB;
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
}

.control-group {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.control-label {
  font-family: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif !important;
  font-weight: 900;
  color: var(--primary);
  font-size: 24px; /* to rõ nét chuẩn */
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-wrapper {
  position: relative;
  width: 100%;
}

.game-dropdown {
  width: 100%;
  padding: 16px 24px;
  font-family: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif !important;
  font-size: 22px !important; /* chữ to, nét chuẩn đẹp */
  font-weight: 800 !important;
  color: #111827 !important;
  background: #FFFFFF;
  border: 3.5px solid #CBD5E1;
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E6B43' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 22px center;
  background-size: 20px;
  padding-right: 56px;
}

.game-dropdown:hover, .game-dropdown:focus {
  border-color: var(--primary-light);
  background-color: white;
  box-shadow: 0 0 0 4px rgba(46, 196, 182, 0.25);
}

.game-dropdown option {
  font-family: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  padding: 14px 18px;
  color: #111827;
  background: #FFFFFF;
}

.btn-start-arcade {
  padding: 16px 38px;
  font-family: 'Nunito', 'Be Vietnam Pro', 'Segoe UI', Arial, sans-serif !important;
  font-size: 24px; /* nút to, chữ to nổi bật */
  font-weight: 900;
  color: #78350F;
  background: linear-gradient(135deg, #FFD23F 0%, #FF9F1C 100%);
  border: none;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(255, 159, 28, 0.45);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.btn-start-arcade:hover {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 28px rgba(255, 159, 28, 0.55);
}

.game-stage-container {
  background: white;
  border-radius: var(--radius-lg);
  border: 3.5px solid #E5E7EB;
  box-shadow: var(--shadow-md);
  padding: 36px;
  position: relative;
  min-height: 520px;
  display: flex;
  flex-direction: column;
}

.game-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 2.5px dashed #E5E7EB;
  flex-wrap: wrap;
  gap: 14px;
}
.game-title-info h3 {
  font-family: var(--font-heading);
  font-size: 28px; /* to rõ */
  font-weight: 800;
  color: var(--primary);
}
.game-score-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 2.5px solid #FCD34D;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  font-weight: 900;
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Balloon Game */
.balloon-arena {
  flex: 1;
  position: relative;
  min-height: 400px;
  background: linear-gradient(180deg, #BAE6FD 0%, #E0F2FE 100%);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 2.5px solid #7DD3FC;
}
.balloon-target-prompt {
  background: rgba(255, 255, 255, 0.96);
  padding: 14px 28px;
  border-radius: var(--radius-full);
  margin: 18px auto;
  width: fit-content;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-heading);
  font-size: 22px; /* to rõ */
  font-weight: 800;
  color: var(--primary);
}
.balloon-item {
  position: absolute;
  width: 100px; /* bóng to hơn */
  height: 120px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 32px;
  cursor: pointer;
  box-shadow: inset -6px -6px 14px rgba(0,0,0,0.18), 0 8px 18px rgba(0,0,0,0.15);
  transition: transform 0.1s;
  user-select: none;
}
.balloon-item::after {
  content: '';
  position: absolute;
  bottom: -18px;
  width: 2.5px;
  height: 20px;
  background: rgba(0,0,0,0.3);
}
.balloon-item:active { transform: scale(0.9); }
.balloon-item .b-word {
  font-size: 14px; /* chữ trên bóng to rõ */
  background: rgba(0,0,0,0.3);
  padding: 3px 8px;
  border-radius: 6px;
  margin-top: 4px;
}

/* Memory Match */
.memory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  max-width: 760px;
  margin: 24px auto;
}
@media (max-width: 640px) {
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
}
.memory-card {
  aspect-ratio: 1;
  perspective: 1000px;
  cursor: pointer;
}
.memory-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}
.memory-card.flipped .memory-inner,
.memory-card.matched .memory-inner {
  transform: rotateY(180deg);
}
.memory-front, .memory-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  border: 3.5px solid #E5E7EB;
}
.memory-front {
  background: linear-gradient(135deg, #1E6B43 0%, #2EC4B6 100%);
  color: white;
  font-size: 42px;
}
.memory-back {
  background: white;
  color: var(--text-primary);
  transform: rotateY(180deg);
  border-color: var(--primary-light);
  padding: 14px;
  text-align: center;
}
.memory-back .card-emoji { font-size: 50px; margin-bottom: 8px; }
.memory-back .card-text { font-size: 18px; font-family: var(--font-heading); font-weight: 800; }
.memory-card.matched .memory-back { border-color: #10B981; background: #ECFDF5; }

/* Spelling Board */
.spelling-board {
  max-width: 720px;
  margin: 24px auto;
  text-align: center;
}
.spelling-image { font-size: 96px; margin-bottom: 14px; }
.spelling-meaning { font-size: 22px; font-weight: 800; color: var(--primary); margin-bottom: 24px; }
.letter-slots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.letter-slot {
  width: 58px;
  height: 68px;
  border: 3.5px dashed #CBD5E1;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 32px; /* to rõ cho các con */
  font-weight: 800;
  color: var(--primary);
  background: #F8FAFC;
  transition: all 0.2s;
}
.letter-slot.filled {
  border-style: solid;
  border-color: var(--primary-light);
  background: white;
  box-shadow: var(--shadow-sm);
}

.scrambled-letters {
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}
.letter-tile {
  width: 56px;
  height: 64px;
  background: linear-gradient(135deg, #FFD23F 0%, #FF9F1C 100%);
  color: #78350F;
  border: 2.5px solid #F59E0B;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 30px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 10px rgba(245, 158, 11, 0.35);
  transition: transform 0.15s, opacity 0.15s;
}
.letter-tile:hover { transform: translateY(-4px) scale(1.08); }
.letter-tile.used { opacity: 0.3; pointer-events: none; }

/* Quiz Board */
.quiz-board {
  max-width: 860px;
  margin: 20px auto;
  text-align: center;
}
.quiz-image-box {
  background: linear-gradient(135deg, #F0FDF4 0%, #ECFDF5 100%);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  margin-bottom: 26px;
  border: 4px solid #A7F3D0;
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
}
.quiz-image {
  font-size: 150px; /* Hình ảnh to đùng, siêu nét cho các con */
  filter: drop-shadow(0 14px 24px rgba(0,0,0,0.18));
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}
.quiz-image:hover {
  transform: scale(1.12) rotate(4deg);
}
.quiz-question-prompt {
  font-family: var(--font-heading);
  font-size: 32px; /* Chữ câu hỏi to, rõ */
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 28px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.quiz-options-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
@media (max-width: 560px) {
  .quiz-options-grid { grid-template-columns: 1fr; }
  .quiz-image { font-size: 110px; }
  .quiz-question-prompt { font-size: 26px; }
}
.quiz-opt-btn {
  padding: 24px 28px;
  min-height: 100px;
  background: white;
  border: 4px solid #E5E7EB;
  border-radius: 22px;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 5px 15px rgba(0,0,0,0.06);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.quiz-opt-btn:hover {
  border-color: var(--primary-light);
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 10px 24px rgba(46, 196, 182, 0.22);
}
.quiz-word-en {
  font-size: 30px; /* Chữ tiếng Anh cực to, nét, rõ ràng */
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.5px;
}
.quiz-word-vi {
  font-size: 22px; /* Nghĩa tiếng Việt to, rõ khi xuất hiện */
  font-weight: 800;
  margin-top: 8px;
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.quiz-opt-btn.correct {
  background: #10B981;
  border-color: #059669;
  box-shadow: 0 8px 30px rgba(16, 185, 129, 0.5);
  transform: scale(1.03);
}
.quiz-opt-btn.correct .quiz-word-en {
  color: white;
}
.quiz-opt-btn.correct .quiz-word-vi {
  color: #FEF3C7;
}
.quiz-opt-btn.wrong {
  background: #EF4444;
  border-color: #DC2626;
  animation: shake 0.4s;
}
.quiz-opt-btn.wrong .quiz-word-en {
  color: white;
}
.quiz-opt-btn.wrong .quiz-word-vi {
  color: #FEE2E2;
}

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

/* Speaking Arena */
.speaking-arena {
  max-width: 650px;
  margin: 24px auto;
  text-align: center;
}
.target-word-display {
  font-family: var(--font-heading);
  font-size: 46px; /* cực to, nhìn là thấy ngay */
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 8px;
}
.shields-rating {
  display: flex;
  justify-content: center;
  gap: 12px;
  font-size: 38px;
  margin-bottom: 28px;
}
.shield-slot {
  color: #D1D5DB;
  transition: transform 0.3s, color 0.3s;
}
.shield-slot.active {
  color: #F59E0B;
  transform: scale(1.15);
  animation: pop-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes pop-in {
  0% { transform: scale(0.5); }
  80% { transform: scale(1.3); }
  100% { transform: scale(1.15); }
}

.big-mic-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border: 4.5px solid white;
  box-shadow: 0 10px 28px rgba(16, 185, 129, 0.45);
  font-size: 42px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 20px;
}
.big-mic-btn:hover { transform: scale(1.1); }
.big-mic-btn.active {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  animation: pulse-big-mic 1s infinite;
}

@keyframes pulse-big-mic {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.5); }
  70% { transform: scale(1.08); box-shadow: 0 0 0 22px rgba(239, 68, 68, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Dictionary */
.dict-filter-alphabet {
  max-width: 1350px;
  margin: 0 auto 28px;
  padding: 0 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.alpha-btn {
  width: 44px; /* to, dễ bấm */
  height: 44px;
  background: white;
  border: 2.5px solid #E5E7EB;
  border-radius: var(--radius-sm);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.alpha-btn:hover { border-color: var(--primary); color: var(--primary); transform: scale(1.1); }
.alpha-btn.active { background: var(--primary); color: white; border-color: var(--primary); }

.dict-table-wrap {
  max-width: 1350px;
  margin: 0 auto 52px;
  padding: 0 16px;
}
.dict-table {
  width: 100%;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border-collapse: collapse;
}
.dict-table th {
  background: var(--primary);
  color: white;
  padding: 16px 20px;
  font-family: var(--font-heading);
  font-size: 18px; /* to rõ */
  text-align: left;
}
.dict-table td {
  padding: 16px 20px;
  border-bottom: 1.5px solid #F3F4F6;
  font-size: 17px; /* to rõ */
}
.dict-table tr:hover td { background: #F0FDF4; }

/* Footer */
.main-footer {
  background: white;
  border-top: 3.5px solid #E5E7EB;
  padding: 36px 28px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 16px;
  margin-top: 64px;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.footer-links a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 800;
  font-size: 17px;
}
.footer-links a:hover { text-decoration: underline; }

#confettiCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}


/* ==========================================================================
   MOBILE LAYER (<=640px) — chơi được trên điện thoại:
   header gọn1hàng, hero/chữ nhỏ lại, control panel xếp dọc, arena/mini-game
   thu nhỏ, bảng từ điển cuộn ngang, footer gọn.
   ========================================================================== */
@media (max-width: 640px) {
  /* Header */
  .main-header { padding: 10px 12px; }
  .header-container { gap: 8px; }
  .logo-area { gap: 8px; min-width: 0; }
  .logo-badge { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
  .logo-text { min-width: 0; }
  .logo-text h1 { font-size: 15px; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .logo-text span { font-size: 9px; max-width: 52vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
  .nav-links { gap: 6px; }
  .nav-btn { padding: 6px 10px; font-size: 12px; }
  .user-score { padding: 6px 12px; font-size: 12px; gap: 5px; }
  .user-score .star-icon { font-size: 14px; }

  /* Hero */
  .hero-banner { padding: 20px 16px; margin: 14px auto 22px; border-radius: 18px; }
  .hero-banner::after { display: none; }
  .hero-content { max-width: 100%; }
  .hero-content h2 { font-size: 22px; line-height: 1.25; }
  .hero-content p { font-size: 14px; line-height: 1.55; margin-bottom: 16px; }
  .hero-tag { font-size: 11px; padding: 6px 12px; }
  .hero-mascot { display: none; }
  .hero-actions { gap: 10px; }
  .hero-actions a { flex: 1; justify-content: center; text-align: center; padding: 12px 10px; font-size: 14px; }

  /* Search */
  .search-container { margin-bottom: 24px; }
  .search-box { padding: 8px 14px; gap: 8px; }
  .search-box input { font-size: 16px; /* <=16px: iOS không tự zoom */ }

  /* Section + lessons */
  .section-title { flex-wrap: wrap; gap: 8px; }
  .section-title h3 { font-size: 20px; }
  .section-title .badge-count { font-size: 12px; padding: 4px 12px; }
  .lessons-grid { grid-template-columns: 1fr; gap: 16px; }
  .lesson-card-header { padding: 14px; }
  .lesson-icon { font-size: 42px; }
  .lesson-title-en { font-size: 19px; }
  .lesson-title-vi { font-size: 14px; }
  .lesson-desc { font-size: 13px; }
  .word-pill { font-size: 12px; padding: 4px 9px; }

  /* Control panel game */
  .game-control-panel { flex-direction: column; padding: 14px; gap: 12px; border-width: 2.5px; }
  .control-group { min-width: 0; width: 100%; }
  .control-label { font-size: 13px; }
  .game-dropdown { font-size: 16px !important; padding: 12px 14px !important; }
  .game-dropdown option { font-size: 16px !important; }
  .btn-start-arcade { width: 100%; justify-content: center; padding: 13px 16px; font-size: 17px; }

  /* Arena + mini-games */
  .game-stage-container { padding: 12px; min-height: 440px; border-width: 2.5px; }
  .game-header-bar { flex-wrap: wrap; gap: 8px; }
  .game-title-info h3 { font-size: 16px; }
  .balloon-target-prompt { padding: 10px 14px; font-size: 14px; max-width: 96%; flex-wrap: wrap; justify-content: center; text-align: center; }
  .balloon-item { width: 72px; height: 86px; font-size: 24px; }
  .balloon-item .b-word { font-size: 11px; padding: 2px 6px; }
  .memory-grid { gap: 10px; }
  .memory-front { font-size: 24px; }
  .memory-back { padding: 8px; }
  .memory-back .card-emoji { font-size: 30px; margin-bottom: 4px; }
  .memory-back .card-text { font-size: 12px; }
  .spelling-image { font-size: 58px; }
  .spelling-meaning { font-size: 16px; }
  .letter-slot { width: 38px; height: 48px; font-size: 21px; border-width: 2.5px; }
  .letter-tile { width: 36px; height: 44px; font-size: 20px; }
  .quiz-image-box { padding: 20px 12px; }
  .quiz-image { font-size: 78px; }
  .quiz-question-prompt { font-size: 19px; margin-bottom: 16px; }
  .quiz-opt-btn { padding: 14px; min-height: 72px; border-width: 3px; }
  .quiz-word-en { font-size: 20px; }
  .quiz-word-vi { font-size: 15px; }
  .speaking-arena { margin: 12px auto; }
  .big-mic-btn { width: 84px; height: 84px; font-size: 34px; border-width: 3px; }

  /* Bài học: word cards + talk */
  .words-grid { grid-template-columns: 1fr; gap: 14px; }
  .word-card { border-width: 2.5px; }
  .word-visual { padding: 14px; }
  .word-visual .visual-icon { font-size: 54px; }
  .word-body { padding: 14px; }
  .talk-questions-list { grid-template-columns: 1fr; }
  .talk-item { padding: 12px; border-width: 2px; }
  .lesson-back-btn { padding: 10px 16px; font-size: 13px; }

  /* Tabs trò chơi bài học: cuộn ngang, nút gọn */
  .game-tabs { padding-bottom: 8px; margin-bottom: 18px; gap: 8px; }
  .game-tab-btn { padding: 9px 14px; font-size: 13px; white-space: nowrap; flex: 0 0 auto; }

  /* Từ điển: bảng cuộn ngang, chữ vừa */
  .dict-filter-alphabet { gap: 6px; }
  .dict-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .dict-table { min-width: 600px; }
  .dict-table th { padding: 10px 12px; font-size: 14px; }
  .dict-table td { padding: 10px 12px; font-size: 14px; }
  .dict-search { font-size: 16px; padding: 10px 14px; }

  /* Footer */
  .main-footer { padding: 22px 14px; font-size: 12px; margin-top: 36px; }
}
