/* ============================================================
   NURSERY 2 PHONICS FUN - Main Stylesheet
   Colorful, child-friendly, mobile-responsive design
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
  --primary: #FF6B6B;
  --secondary: #FFD93D;
  --accent-green: #6BCB77;
  --accent-blue: #4D96FF;
  --accent-purple: #B97CF3;
  --accent-pink: #FF6BCC;
  --bg-light: #FFF9F0;
  --bg-card: #FFFFFF;
  --text-dark: #2D2D2D;
  --text-muted: #666;
  --shadow: 0 4px 20px rgba(0,0,0,0.12);
  --radius: 20px;
  --radius-sm: 12px;
  --nav-height: 70px;
  --header-height: 70px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Nunito', sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
}

button { cursor: pointer; border: none; font-family: 'Nunito', sans-serif; }
img { max-width: 100%; border-radius: var(--radius-sm); }

/* ---------- HEADER ---------- */
#main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, #FF6B6B 0%, #FF8E53 50%, #FFD93D 100%);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  height: var(--header-height);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
}

.logo-emoji {
  font-size: 2.2rem;
  animation: spin-glow 3s ease-in-out infinite;
}

@keyframes spin-glow {
  0%, 100% { transform: rotate(-10deg) scale(1); }
  50% { transform: rotate(10deg) scale(1.1); }
}

.header-logo h1 {
  font-size: 1.6rem;
  font-weight: 900;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  line-height: 1;
}

.header-logo p {
  font-size: 0.78rem;
  opacity: 0.9;
  font-weight: 600;
}

.menu-toggle {
  display: none;
  background: rgba(255,255,255,0.3);
  color: white;
  font-size: 1.3rem;
  padding: 8px 12px;
  border-radius: 10px;
  transition: background 0.2s;
}

.menu-toggle:hover { background: rgba(255,255,255,0.5); }

/* ---------- NAVIGATION ---------- */
#main-nav {
  background: white;
  box-shadow: 0 3px 15px rgba(0,0,0,0.1);
  position: sticky;
  top: var(--header-height);
  z-index: 99;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#main-nav::-webkit-scrollbar { height: 3px; }
#main-nav::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

.nav-list {
  display: flex;
  list-style: none;
  padding: 0 10px;
  gap: 5px;
  min-width: max-content;
}

.nav-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 18px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-btn span { font-size: 1.2rem; }

.nav-btn:hover {
  background: var(--bg-light);
  color: var(--primary);
  transform: translateY(-2px);
}

.nav-btn.active {
  background: linear-gradient(135deg, var(--primary), #FF8E53);
  color: white;
  box-shadow: 0 4px 12px rgba(255,107,107,0.4);
}

/* ---------- MAIN CONTENT ---------- */
#main-content { max-width: 1200px; margin: 0 auto; padding: 20px 16px 40px; }

.page-section { display: none; animation: fadeIn 0.4s ease; }
.page-section.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- SECTION HEADER ---------- */
.section-header {
  text-align: center;
  margin-bottom: 28px;
  padding: 24px;
  background: white;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-header h2 {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--primary), var(--accent-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.section-header p {
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* ---------- HOME PAGE ---------- */
.hero-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f97316 100%);
  border-radius: var(--radius);
  padding: 40px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow);
}

.hero-text {
  color: white;
  z-index: 1;
}

.hero-text h2 {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 2px 2px 6px rgba(0,0,0,0.2);
}

.highlight {
  background: var(--secondary);
  color: var(--text-dark);
  padding: 2px 10px;
  border-radius: 10px;
}

.hero-text p {
  font-size: 1.05rem;
  opacity: 0.95;
}

.hero-letters {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.floating-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background: var(--color, #FF6B6B);
  color: white;
  font-size: 1.8rem;
  font-weight: 900;
  border-radius: 50%;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  animation: floatUp 2s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

@keyframes floatUp {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

/* Home Cards */
.home-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.home-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  transition: all 0.3s ease;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
}

.home-card:hover, .home-card:focus {
  transform: translateY(-6px) scale(1.03);
  box-shadow: 0 10px 30px rgba(0,0,0,0.18);
}

.home-card .card-icon { font-size: 3rem; margin-bottom: 10px; }
.home-card h3 { font-size: 1.1rem; font-weight: 800; margin-bottom: 4px; }
.home-card p { font-size: 0.85rem; color: var(--text-muted); }

.card-vowels { border-color: var(--primary); }
.card-vowels:hover { background: #FFF5F5; }
.card-consonants { border-color: var(--accent-blue); }
.card-consonants:hover { background: #F0F7FF; }
.card-songs { border-color: var(--accent-green); }
.card-songs:hover { background: #F0FFF4; }
.card-videos { border-color: var(--accent-purple); }
.card-videos:hover { background: #FAF5FF; }
.card-practice { border-color: var(--secondary); }
.card-practice:hover { background: #FFFBF0; }

.tip-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, #e8f5e9, #f3e5f5);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
}

.tip-icon { font-size: 2.5rem; flex-shrink: 0; }
.tip-box strong { font-size: 1rem; color: var(--text-dark); }
.tip-box p { font-size: 0.95rem; color: var(--text-muted); margin-top: 4px; }

/* ---------- VOWEL SECTION ---------- */
.vowel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.vowel-card {
  background: white;
  border-radius: var(--radius);
  padding: 24px 16px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 6px solid var(--vcolor, var(--primary));
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

.vowel-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--vcolor, var(--primary));
  opacity: 0.04;
  transition: opacity 0.3s;
}

.vowel-card:hover::before { opacity: 0.1; }
.vowel-card:hover { transform: translateY(-6px); box-shadow: 0 12px 35px rgba(0,0,0,0.15); }

.vowel-letter {
  font-size: 4rem;
  font-weight: 900;
  color: var(--vcolor, var(--primary));
  line-height: 1;
  margin-bottom: 8px;
  text-shadow: 3px 3px 0 rgba(0,0,0,0.08);
}

.vowel-word-img { font-size: 2.5rem; margin-bottom: 8px; }

.vowel-info { margin-bottom: 14px; }
.vowel-word { display: block; font-size: 1.1rem; font-weight: 700; }
.vowel-sound-label { display: block; font-size: 0.85rem; color: var(--text-muted); font-weight: 600; }

.sound-btn {
  background: var(--vcolor, var(--primary));
  color: white;
  padding: 10px 18px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: all 0.2s;
  margin-bottom: 14px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.sound-btn:hover { transform: scale(1.05); box-shadow: 0 6px 18px rgba(0,0,0,0.2); }

.vowel-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.vowel-examples span {
  background: var(--bg-light);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* Chart Section */
.chart-section {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.chart-section h3 {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.chart-container {
  max-height: 400px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.chart-container img {
  object-fit: contain;
  max-height: 400px;
  width: auto;
}

.chart-caption { font-size: 0.95rem; color: var(--text-muted); font-weight: 600; }

/* Compare Grid */
.info-box {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.info-box h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 16px;
  color: var(--text-dark);
}

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.compare-card {
  border-radius: var(--radius-sm);
  padding: 18px;
}

.compare-card.short { background: linear-gradient(135deg, #fff5f5, #ffe8e8); border: 2px solid #FFB3B3; }
.compare-card.long { background: linear-gradient(135deg, #f0fdf4, #e8f5e9); border: 2px solid #86EFAC; }

.compare-card h4 { font-size: 1rem; font-weight: 800; margin-bottom: 12px; }
.compare-card ul { list-style: none; }
.compare-card li { font-size: 0.9rem; padding: 5px 0; border-bottom: 1px dashed rgba(0,0,0,0.1); }
.compare-card li:last-child { border: none; }

/* ---------- CONSONANT SECTION ---------- */
.consonant-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.consonant-card {
  background: white;
  border-radius: var(--radius-sm);
  padding: 16px 10px;
  text-align: center;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  cursor: pointer;
  transition: all 0.25s;
  border-bottom: 4px solid var(--ccolor, var(--accent-blue));
}

.consonant-card:hover {
  transform: translateY(-5px) scale(1.05);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.consonant-card.playing { animation: bounceIn 0.4s ease; }

@keyframes bounceIn {
  0% { transform: scale(1); }
  40% { transform: scale(1.15); }
  70% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

.cons-letter {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--ccolor, var(--accent-blue));
  display: block;
  margin-bottom: 6px;
}

.cons-emoji { font-size: 1.6rem; display: block; margin-bottom: 4px; }
.cons-word { font-size: 0.78rem; font-weight: 700; color: var(--text-dark); display: block; }
.cons-sound { font-size: 0.7rem; color: var(--text-muted); display: block; margin-top: 2px; }

/* Digraph Grid */
.digraph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}

.digraph-card {
  background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  border: 2px solid #C7D2FE;
}

.digraph-card:hover {
  transform: translateY(-5px);
  background: linear-gradient(135deg, #E0E7FF, #C7D2FE);
  box-shadow: var(--shadow);
}

.digraph-letters {
  display: block;
  font-size: 2rem;
  font-weight: 900;
  color: #4338CA;
  margin-bottom: 6px;
}

.digraph-emoji { font-size: 1.8rem; display: block; margin-bottom: 6px; }
.digraph-word { font-size: 0.82rem; color: #4338CA; font-weight: 600; }

/* ---------- SONGS SECTION ---------- */
.songs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.song-category {}

.cat-title {
  font-size: 1.2rem;
  font-weight: 800;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.vowel-cat { background: linear-gradient(135deg, #fff5f5, #ffe8e8); color: var(--primary); }
.consonant-cat { background: linear-gradient(135deg, #eff6ff, #dbeafe); color: var(--accent-blue); }

.song-card {
  background: white;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 3px 12px rgba(0,0,0,0.1);
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  gap: 0;
  position: relative;
}

.song-card:hover {
  transform: translateX(5px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.song-card img {
  width: 100px;
  height: 75px;
  object-fit: cover;
  border-radius: 0;
  flex-shrink: 0;
}

.song-info {
  flex: 1;
  padding: 10px 12px;
}

.song-info h4 { font-size: 0.9rem; font-weight: 800; margin-bottom: 3px; }
.song-info p { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 5px; }

.song-channel {
  display: inline-block;
  background: #EEF2FF;
  color: #4338CA;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-right: 6px;
}

.song-duration { font-size: 0.72rem; color: var(--text-muted); }

.play-song-btn {
  background: var(--primary);
  color: white;
  padding: 8px 14px;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  flex-shrink: 0;
  height: 100%;
  align-self: stretch;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: background 0.2s;
}

.play-song-btn:hover { background: #e05555; }

/* Lyrics Box */
.lyrics-box {
  background: linear-gradient(135deg, #FFF9C4, #FFFDE7);
  border-radius: var(--radius);
  padding: 24px;
  border: 2px solid #FFD93D;
  box-shadow: var(--shadow);
}

.lyrics-box h3 { font-size: 1.2rem; font-weight: 800; margin-bottom: 14px; }
.lyrics-text p { font-size: 1rem; line-height: 1.8; padding: 4px 0; }
.lyrics-big { font-size: 1.05rem !important; margin-top: 10px !important; }

/* ---------- VIDEOS SECTION ---------- */
.video-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.vtab {
  background: white;
  color: var(--text-muted);
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 0.95rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.vtab.active, .vtab:hover {
  background: linear-gradient(135deg, var(--primary), #FF8E53);
  color: white;
  transform: translateY(-2px);
}

.videos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.video-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.video-card:hover { transform: translateY(-5px); box-shadow: 0 12px 35px rgba(0,0,0,0.15); }
.video-card.hidden { display: none; }

.video-thumb-wrap {
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  background: #000;
}

.video-thumb-wrap img {
  width: 100%;
  height: 175px;
  object-fit: cover;
  border-radius: 0;
  transition: opacity 0.3s, transform 0.3s;
  display: block;
}

.video-thumb-wrap:hover img { opacity: 0.85; transform: scale(1.05); }

.play-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 3rem;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: transform 0.2s;
}

.video-thumb-wrap:hover .play-overlay { transform: translate(-50%, -50%) scale(1.1); }

.video-embed-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}

.video-embed-container iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}

.video-meta { padding: 14px 16px; }
.video-meta h4 { font-size: 0.95rem; font-weight: 800; margin-bottom: 5px; }
.video-meta p { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 8px; }

.channel-badge {
  display: inline-block;
  background: #EEF2FF;
  color: #4338CA;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 10px;
  margin-right: 8px;
}

.view-count { font-size: 0.75rem; color: var(--text-muted); }

/* ---------- PRACTICE SECTION ---------- */
.activity-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.atab {
  background: white;
  color: var(--text-muted);
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: all 0.2s;
}

.atab.active, .atab:hover {
  background: linear-gradient(135deg, var(--accent-green), #38d68d);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(107, 203, 119, 0.4);
}

.activity-panel { display: none; animation: fadeIn 0.3s; }
.activity-panel.active { display: block; }

/* Quiz */
.quiz-container {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}

.quiz-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

#quiz-progress-text { font-size: 0.88rem; color: var(--text-muted); font-weight: 700; white-space: nowrap; }

.progress-bar {
  flex: 1;
  height: 10px;
  background: #eee;
  border-radius: 10px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), #38d68d);
  border-radius: 10px;
  width: 10%;
  transition: width 0.4s ease;
}

.score-badge {
  background: linear-gradient(135deg, var(--secondary), #fbbf24);
  color: var(--text-dark);
  font-size: 1rem;
  font-weight: 800;
  padding: 8px 20px;
  border-radius: 30px;
  display: inline-block;
  margin-bottom: 20px;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.quiz-question {
  margin-bottom: 24px;
}

.question-emoji {
  font-size: 5rem;
  display: block;
  margin-bottom: 10px;
  animation: popIn 0.3s ease;
}

@keyframes popIn {
  0% { transform: scale(0.5); opacity: 0; }
  80% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

#question-text { font-size: 1.15rem; font-weight: 700; color: var(--text-dark); }

.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.quiz-option {
  background: white;
  border: 3px solid #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 16px 12px;
  font-size: 1.4rem;
  font-weight: 900;
  transition: all 0.2s;
  cursor: pointer;
}

.quiz-option:hover { border-color: var(--accent-blue); background: #EFF6FF; transform: scale(1.03); }
.quiz-option.correct { border-color: var(--accent-green); background: #F0FDF4; color: #16a34a; animation: correctPulse 0.5s; }
.quiz-option.wrong { border-color: var(--primary); background: #FFF5F5; color: var(--primary); animation: shake 0.4s; }

@keyframes correctPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

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

.quiz-feedback {
  font-size: 1.2rem;
  font-weight: 800;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.next-btn, .reset-btn {
  background: linear-gradient(135deg, var(--accent-blue), #3b82f6);
  color: white;
  padding: 14px 30px;
  border-radius: 30px;
  font-size: 1.05rem;
  font-weight: 800;
  box-shadow: 0 5px 15px rgba(77, 150, 255, 0.4);
  transition: all 0.2s;
}

.next-btn:hover, .reset-btn:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(77, 150, 255, 0.5); }

/* Match Activity */
.match-container {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.match-container h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.match-container > p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; }

.match-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.match-item {
  background: var(--bg-light);
  border: 3px solid #E5E7EB;
  border-radius: var(--radius-sm);
  padding: 18px 12px;
  font-size: 1.6rem;
  font-weight: 900;
  cursor: pointer;
  transition: all 0.25s;
  user-select: none;
}

.match-item:hover { border-color: var(--accent-blue); background: #EFF6FF; transform: scale(1.05); }
.match-item.selected { border-color: var(--secondary); background: #FFFBF0; transform: scale(1.08); }
.match-item.matched { border-color: var(--accent-green); background: #F0FDF4; cursor: default; opacity: 0.7; }
.match-item.wrong-flash { border-color: var(--primary); animation: shake 0.4s; }

.match-feedback {
  font-size: 1.1rem;
  font-weight: 800;
  min-height: 36px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Trace Activity */
.trace-container {
  background: white;
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  text-align: center;
}

.trace-container h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 6px; }
.trace-container > p { font-size: 0.95rem; color: var(--text-muted); margin-bottom: 20px; }

.trace-vowels h4 { font-size: 1.1rem; font-weight: 800; margin-bottom: 14px; text-align: left; }

.trace-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.trace-card {
  background: var(--bg-light);
  border: 3px solid var(--tc, #ddd);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.trace-canvas {
  border: 2px dashed var(--tc, #ddd);
  border-radius: 10px;
  background: white;
  cursor: crosshair;
  touch-action: none;
}

.trace-card p {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-dark);
}

.trace-card button {
  background: #EEE;
  color: var(--text-muted);
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 700;
  transition: background 0.2s;
}

.trace-card button:hover { background: #DDD; }

/* Achievements */
.achievements-section {
  background: linear-gradient(135deg, #FFF9C4, #FFFDE7);
  border: 2px solid var(--secondary);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.achievements-section h3 { font-size: 1.3rem; font-weight: 800; margin-bottom: 12px; }

.stars-display { font-size: 2rem; margin-bottom: 10px; }
.star-earned { animation: twinkle 2s ease-in-out infinite; }

@keyframes twinkle {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.1); }
}

#achievement-msg { font-size: 1rem; font-weight: 600; color: var(--text-muted); }

/* ---------- MODAL ---------- */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; animation: fadeIn 0.3s; }

.modal-content {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 750px;
  width: 100%;
  position: relative;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #F3F4F6;
  color: var(--text-dark);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close:hover { background: #E5E7EB; }

#modal-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 16px;
  padding-right: 40px;
}

.modal-video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.modal-video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
}

/* ---------- FOOTER ---------- */
#main-footer {
  background: linear-gradient(135deg, #2D2D2D, #3D3D3D);
  color: rgba(255,255,255,0.8);
  text-align: center;
  padding: 20px;
  font-size: 0.88rem;
  line-height: 2;
  margin-top: 30px;
}

/* ============================================================
   RESPONSIVE STYLES
   ============================================================ */

@media (max-width: 768px) {
  .hero-banner {
    flex-direction: column;
    text-align: center;
    padding: 28px 20px;
  }

  .hero-text h2 { font-size: 1.6rem; }
  .hero-letters { justify-content: center; }
  .floating-letter { width: 44px; height: 44px; font-size: 1.5rem; }

  .home-cards { grid-template-columns: repeat(2, 1fr); }

  .vowel-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .songs-grid { grid-template-columns: 1fr; }

  .compare-grid { grid-template-columns: 1fr; }

  .videos-grid { grid-template-columns: 1fr; }

  .section-header h2 { font-size: 1.6rem; }

  .consonant-grid { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); }
}

@media (max-width: 480px) {
  .home-cards { grid-template-columns: 1fr 1fr; gap: 10px; }

  .vowel-grid { grid-template-columns: 1fr 1fr; }

  .match-board { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .match-item { padding: 14px 8px; font-size: 1.3rem; }

  .quiz-options { grid-template-columns: 1fr 1fr; }
  .quiz-option { font-size: 1.2rem; padding: 12px 8px; }

  .floating-letter { width: 38px; height: 38px; font-size: 1.3rem; }
  .hero-text h2 { font-size: 1.4rem; }

  .song-card img { width: 80px; height: 60px; }
}

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }

/* Bounce animation for nav items */
.nav-btn:active { transform: scale(0.95); }

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