/* Lingo Games - Coloring Book & Language Games */
:root {
  --primary: #FF6B6B;
  --secondary: #4ECDC4;
  --accent: #FFE66D;
  --purple: #A78BFA;
  --bg: #FFF9F0;
  --text: #2D3748;
  --shadow: 0 4px 20px rgba(0,0,0,0.08);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Nunito', sans-serif; color: var(--text); background: var(--bg); }

/* ============ NAV ============ */
.main-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(0,0,0,0.05);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; font-family: 'Fredoka One', cursive; font-size: 1.4rem; color: var(--primary); }
.logo-icon { font-size: 1.6rem; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { text-decoration: none; color: var(--text); font-weight: 700; font-size: 0.95rem; }
.nav-links a.nav-save { color: #667eea; font-size: 0.9rem; }
.coming-soon-note {
  text-align: center; font-weight: 800; color: var(--text);
  background: var(--accent); border-radius: 12px; padding: 0.7rem 1rem; margin: 0 auto 1rem; max-width: 640px;
}
.nav-links a.active { color: var(--primary); }
.btn-print {
  padding: 0.5rem 1.2rem; background: var(--primary); color: #fff; border: none; border-radius: 50px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  transition: all 0.2s;
}
.btn-print:hover { transform: translateY(-2px); box-shadow: 0 4px 15px rgba(255,107,107,0.4); }
.lang-switcher select {
  padding: 0.4rem 0.8rem; border: 2px solid var(--secondary); border-radius: 8px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.85rem; cursor: pointer;
}

/* ============ HERO ============ */
.hero {
  position: relative;
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 6rem 2rem 4rem;
  overflow: hidden;
}
.hero-bg-image {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: url('/img/hero-time-capsule.jpg') center center / cover no-repeat;
  z-index: 0; opacity: 0.15;
  filter: brightness(0.8) saturate(1.1);
}
.hero-bg-overlay {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(to bottom, rgba(255,249,240,0.85), rgba(255,249,240,0.7));
  z-index: 0;
}
.hero-content { position: relative; z-index: 1; text-align: center; max-width: 800px; width: 100%; }
.hero-characters {
  /* 150px is 1.5× the original 100px-wide hero frame. */
  --hero-card: 150px;
  --hero-gap: 0.4rem;
  --plus-slot: 1.25rem;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex-wrap: nowrap;
  gap: var(--hero-gap);
  margin: 0 auto 1rem;
  width: 100%;
  max-width: 100%;
}
.hero .character {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  flex: 0 0 auto;
  /* About 30vw on a phone, capped at the 1.5× desktop frame, and never wider than the row after the + gaps. */
  width: min(var(--hero-card), 30vw, calc((100% - 2 * var(--plus-slot) - 4 * var(--hero-gap)) / 3));
  min-width: 0;
  container-type: inline-size;
}
.character { animation: charFloat 3s ease-in-out infinite; }
.char-weebster { animation-delay: 0.5s; }
.char-mocha { animation-delay: 1s; }
@keyframes charFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
/* rotate/scale properties compose with the wrapper float (transform) */
@keyframes wave { 0%, 100% { rotate: 0deg; } 25% { rotate: 10deg; } 75% { rotate: -7deg; } }
@keyframes wag { 0%, 100% { rotate: 0deg; } 25% { rotate: 10deg; } 75% { rotate: -10deg; } }
@keyframes charPop { 0%, 100% { scale: 1; } 40% { scale: 1.1; } 70% { scale: 0.96; } }
.hero-char-img, .char-portrait {
  width: 100px; height: auto; border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  border: 3px solid rgba(255,255,255,0.7);
  transform-origin: 50% 90%;
}
.hero .hero-char-img {
  display: block;
  box-sizing: border-box;
  width: 100%;
  /* Same frame as Deb's original 100×142 card, scaled with the width (1.5× is 150×213). */
  height: calc(100cqi * 142 / 100);
  object-fit: cover;
  object-position: center 20%;
  border-radius: 16px;
  border: 3px solid rgba(255,255,255,0.7);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform-origin: 50% 90%;
}
.char-deb.is-waving .hero-char-img,
.char-deb.is-waving .char-portrait,
.char-deb.is-waving .mascot-portrait { animation: wave 0.55s ease-in-out; }
.char-weebster.is-popping .hero-char-img,
.char-weebster.is-popping .char-portrait,
.char-weebster.is-popping .mascot-portrait { animation: charPop 0.5s ease-in-out; }
.char-mocha.is-wagging .hero-char-img,
.char-mocha.is-wagging .char-portrait,
.char-mocha.is-wagging .mascot-portrait { animation: wag 0.32s ease-in-out 3; }
.char-name { display: block; font-family: 'Fredoka One', cursive; font-size: 0.85rem; margin-top: 0.25rem; }
.hero .char-name {
  white-space: nowrap;
  line-height: 1.15;
  margin-top: 0.35rem;
  font-size: clamp(0.78rem, 2.6vw, 1rem);
}
.char-vs { font-size: 1.5rem; font-weight: 800; color: var(--purple); align-self: flex-end; margin-bottom: 1.2rem; }
.hero .char-vs {
  flex: 0 0 var(--plus-slot);
  width: var(--plus-slot);
  align-self: center;
  margin: 0 0 1.45rem;
  line-height: 1;
  text-align: center;
  font-size: clamp(1.15rem, 4vw, 1.7rem);
}
.char-deb .char-name { color: #FF6B6B; }
.char-weebster .char-name { color: #4ECDC4; }
.char-mocha .char-name { color: #C4883C; }
.hero-title {
  font-family: 'Fredoka One', cursive; font-size: 3.5rem;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  margin-bottom: 0.5rem;
}
.hero-tagline { font-size: 1.3rem; color: #718096; margin-bottom: 2.5rem; font-weight: 600; }

/* ============ LANGUAGE SELECTOR ============ */
.language-selector { background: #fff; border-radius: var(--radius); padding: 2rem 2.5rem; box-shadow: 0 10px 40px rgba(0,0,0,0.12); }
.language-selector h2 { font-family: 'Fredoka One', cursive; font-size: 1.3rem; margin-bottom: 1.5rem; }
.lang-pairs { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.lang-pair { display: flex; flex-direction: column; gap: 0.4rem; }
.lang-pair label { font-size: 0.8rem; font-weight: 700; color: #718096; text-transform: uppercase; }
.lang-pair select { padding: 0.7rem 1.2rem; border: 3px solid var(--secondary); border-radius: 10px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 1rem; min-width: 160px; cursor: pointer; }
.lang-arrow { font-size: 2rem; color: var(--purple); font-weight: 800; margin-top: 1.2rem; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.8rem 1.8rem; border-radius: 50px; font-family: 'Nunito', sans-serif; font-weight: 800; font-size: 1rem; text-decoration: none; border: none; cursor: pointer; transition: all 0.2s; }
.btn-big { padding: 1rem 3rem; font-size: 1.2rem; }
.btn-start { background: linear-gradient(135deg, var(--primary), #EE5A5A); color: #fff; box-shadow: 0 4px 15px rgba(255,107,107,0.4); }
.btn-start:hover { transform: translateY(-2px) scale(1.02); }

/* ============ SECTIONS ============ */
.themes-section, .games-section, .coloring-section, .section { padding: 4rem 2rem; }
.section-inner { max-width: 1000px; margin: 0 auto; }
.section-title { font-family: 'Fredoka One', cursive; font-size: 2rem; text-align: center; margin-bottom: 0.5rem; }
.section-subtitle { text-align: center; font-size: 1.1rem; color: #718096; margin-bottom: 2rem; max-width: 600px; margin-left: auto; margin-right: auto; }

/* ============ THEMES ============ */
.themes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1.2rem; }
.theme-card { background: #fff; border-radius: var(--radius); padding: 1.5rem 1rem; text-align: center; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; border: 3px solid transparent; animation: cardEnter 0.5s ease backwards; animation-delay: calc(var(--enter-i, 0) * 70ms); }
.theme-card:hover { transform: translateY(-4px); box-shadow: 0 10px 40px rgba(0,0,0,0.12); border-color: var(--secondary); }
.theme-icon { font-size: 2.5rem; display: block; margin-bottom: 0.5rem; }
.theme-label { font-weight: 700; font-size: 1rem; }

/* ============ GAMES GRID ============ */
.games-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-top: 1.5rem; }
.game-card {
  background: #fff; border-radius: var(--radius); padding: 2rem 1.5rem; text-align: center;
  text-decoration: none; color: var(--text); box-shadow: var(--shadow);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s; border: 3px solid transparent;
  display: flex; flex-direction: column; align-items: center; gap: 0.8rem;
  animation: cardEnter 0.5s ease backwards;
  animation-delay: calc(var(--enter-i, 0) * 70ms);
}
.game-card:hover { transform: translateY(-6px) scale(1.03); box-shadow: 0 12px 40px rgba(0,0,0,0.15); border-color: var(--primary); }
.game-card--soon,
.game-card--coming {
  cursor: default;
  opacity: 0.78;
  border-style: dashed;
  border-color: #E2E8F0;
  background: #F7FAFC;
}
.game-card--soon:hover,
.game-card--coming:hover {
  transform: none;
  box-shadow: var(--shadow);
  border-color: #E2E8F0;
}
.game-soon {
  display: inline-block;
  background: var(--accent);
  color: var(--text);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border-radius: 50px;
  padding: 0.25rem 0.75rem;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.coloring-print-src { display: none; }
.page-download-link {
  display: inline-block; margin-top: 0.4rem; font-weight: 800; color: var(--text); font-size: 0.85rem;
}
@keyframes cardEnter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.theme-card:nth-child(1), .game-card:nth-child(1) { --enter-i: 0; }
.theme-card:nth-child(2), .game-card:nth-child(2) { --enter-i: 1; }
.theme-card:nth-child(3), .game-card:nth-child(3) { --enter-i: 2; }
.theme-card:nth-child(4), .game-card:nth-child(4) { --enter-i: 3; }
.theme-card:nth-child(5), .game-card:nth-child(5) { --enter-i: 4; }
.theme-card:nth-child(6), .game-card:nth-child(6) { --enter-i: 5; }
.theme-card:nth-child(7), .game-card:nth-child(7) { --enter-i: 6; }
.theme-card:nth-child(8), .game-card:nth-child(8) { --enter-i: 7; }
.theme-card:nth-child(9), .game-card:nth-child(9) { --enter-i: 8; }
.theme-card:nth-child(10), .game-card:nth-child(10) { --enter-i: 9; }
.theme-card:nth-child(11), .game-card:nth-child(11) { --enter-i: 10; }
.theme-card:nth-child(12), .game-card:nth-child(12) { --enter-i: 11; }
.theme-card:nth-child(n+13), .game-card:nth-child(n+13) { --enter-i: 12; }
.game-icon { font-size: 3.5rem; display: block; }
.game-name { font-family: 'Fredoka One', cursive; font-size: 1.3rem; }
.game-desc { font-size: 0.9rem; color: #718096; font-weight: 600; }

/* ============ GENERATOR ============ */
.coloring-generator-page { padding-top: 4.5rem; }
.coloring-generator-page .generator-container { padding-top: 1.5rem; }
.coloring-generator-page .coloring-pages { max-width: 760px; }
.coloring-generator-page .coloring-phrase { display: none; }
.coloring-pdf-card { padding: 3rem 1rem; text-align: center; background: #fff8e8; border: 3px dashed #E0DDD3; border-radius: 12px; }
.coloring-missing { min-height: 280px; display: flex; align-items: center; justify-content: center; background: #faf6ee; color: #888; font-family: 'Fredoka One', cursive; }
[dir="rtl"] .word-native, [lang="ar"], .word-native[dir="rtl"], .word-target[dir="rtl"] { font-family: 'Noto Naskh Arabic', 'Nunito', sans-serif; }
[lang="ja"] { font-family: 'Noto Sans JP', 'Nunito', sans-serif; }
[lang="zh"] { font-family: 'Noto Sans SC', 'Nunito', sans-serif; }
.loading { text-align: center; padding: 80px 20px; color: #999; font-size: 18px; }
.loading-spinner { display: inline-block; width: 40px; height: 40px; border: 4px solid #eee; border-top-color: var(--secondary); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.no-pages { text-align: center; padding: 80px 20px; color: #999; }
.generator-container { max-width: 1200px; margin: 0 auto; padding: 6rem 2rem 4rem; }
.generator-controls { background: #fff; border-radius: var(--radius); padding: 1.5rem 2rem; box-shadow: var(--shadow); margin-bottom: 2rem; position: sticky; top: 70px; z-index: 50; }
.generator-title { font-family: 'Fredoka One', cursive; font-size: 1.8rem; margin-bottom: 1rem; text-align: center; }
.controls-row { display: flex; gap: 1rem; flex-wrap: wrap; justify-content: center; align-items: flex-end; margin-bottom: 1rem; }
.control-group { display: flex; flex-direction: column; gap: 0.3rem; }
.control-group label { font-size: 0.75rem; font-weight: 700; color: #718096; text-transform: uppercase; }
.control-group select, .control-group input[type="color"] {
  padding: 0.5rem 0.8rem; border: 2px solid var(--secondary); border-radius: 8px;
  font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 0.9rem; cursor: pointer;
}
.control-group input[type="color"] { width: 50px; height: 38px; padding: 2px; }
.color-palette { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.color-swatch { width: 32px; height: 32px; border-radius: 50%; cursor: pointer; border: 3px solid #fff; box-shadow: 0 2px 8px rgba(0,0,0,0.15); transition: transform 0.2s; }
.color-swatch:hover { transform: scale(1.2); }

/* ============ COLORING PAGES - ONE LARGE PER PAGE ============ */
.coloring-pages { display: grid; grid-template-columns: 1fr; gap: 2rem; max-width: 700px; margin: 0 auto; }
.coloring-page { background: #fff; border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); transition: all 0.3s; border: 3px dashed #E0DDD3; page-break-after: always; margin-bottom: 2rem; }
.coloring-page:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,0,0,0.12); border-color: var(--secondary); }
.page-inner { display: flex; flex-direction: column; align-items: center; }
.coloring-scene-img { width: 100%; max-width: 600px; height: auto; cursor: pointer; border-radius: 8px; border: 2px solid #ddd; }
.coloring-svg { width: 100%; max-width: 400px; height: auto; cursor: pointer; }
.coloring-svg path, .coloring-svg circle, .coloring-svg ellipse, .coloring-svg rect { transition: fill 0.2s; }
.word-labels { margin-top: 0.8rem; text-align: center; }
.word-translit { display: block; font-family: 'Nunito', sans-serif; font-size: 0.75rem; color: #999; font-style: normal; font-weight: 600; letter-spacing: 0.02em; line-height: 1.3; }
.word-native { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: var(--primary); }
.word-divider { margin: 0 0.3rem; color: #ccc; font-weight: 700; }
.word-target { font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: var(--secondary); }
.coloring-phrase { font-size: 0.95rem; color: #888; font-style: italic; text-align: center; margin-top: 0.5rem; padding: 0.3rem 0.8rem; line-height: 1.4; min-height: 1.4em; max-width: 95%; word-wrap: break-word; }
.coloring-phrase.coloring-phrase-native { color: #555; font-style: normal; font-weight: 700; margin-top: 1rem; }
.print-footer { text-align: center; margin-top: 3rem; padding-bottom: 2rem; }

/* ============ PER-PAGE PRINT BUTTONS ============ */
.page-print-btn {
  display: inline-block;
  padding: 0.5rem 1.3rem;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  margin-top: 0.8rem;
  transition: all 0.2s;
}
.page-print-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(78,205,196,0.4);
}

/* ============ GAME PAGES ============ */
.game-page {
  background:
    radial-gradient(circle at 12% 18%, rgba(255,230,109,0.55), transparent 28%),
    radial-gradient(circle at 88% 12%, rgba(167,139,250,0.35), transparent 26%),
    radial-gradient(circle at 80% 80%, rgba(78,205,196,0.28), transparent 30%),
    linear-gradient(180deg, #FFF6D8 0%, #FFE8F3 48%, #E7F8FF 100%);
  min-height: 100vh;
}
.game-mascots { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.8rem; }
.mascot { background: #fff; border-radius: 999px; padding: 0.3rem 0.75rem 0.3rem 0.3rem; font-weight: 800; font-size: 0.85rem; box-shadow: var(--shadow); border: 3px solid transparent; display: inline-flex; align-items: center; gap: 0.4rem; }
.mascot-deb { border-color: #FFD3A3; color: #FF6B6B; }
.mascot-weebster { border-color: #B8F3EE; color: #2A9D8F; }
.mascot-mocha { border-color: #E8C39E; color: #C4883C; }
.mascot-portrait {
  width: 36px; height: 36px; border-radius: 10px; object-fit: cover;
  border: 2px solid rgba(255,255,255,0.85); box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  transform-origin: 50% 90%;
}
.explain-modal {
  position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center;
  background: rgba(45, 55, 72, 0.45); padding: 1rem;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}
.explain-modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }
.explain-modal[hidden] { display: none !important; }
.explain-card {
  background: #fff; border-radius: 24px; padding: 1.8rem 1.5rem 1.5rem; max-width: 460px; width: 100%;
  text-align: center; box-shadow: 0 16px 50px rgba(0,0,0,0.18); border: 4px solid #FFE66D;
  transform: scale(0.92); transition: transform 0.28s ease;
}
.explain-modal.is-open .explain-card { transform: scale(1); }
.explain-stars { font-size: 1.4rem; margin-bottom: 0.3rem; }
.explain-kicker { font-weight: 800; color: #2A9D8F; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.4rem; }
.explain-title { font-family: 'Fredoka One', cursive; font-size: 2rem; color: var(--primary); margin-bottom: 0.8rem; }
.explain-phrase { font-size: 1.05rem; line-height: 1.5; font-weight: 700; color: #2D3748; margin: 0.35rem 0; }
.explain-phrase-target { color: #2A9D8F; }
.explain-friends { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; font-weight: 800; color: #718096; }
.explain-continue { min-width: 160px; }
body.explain-open { overflow: hidden; }
.game-container { max-width: 800px; margin: 0 auto; padding: 5rem 1rem 3rem; position: relative; isolation: isolate; }
.game-board { position: relative; }
body:has(.ad-banner-top) .game-container { padding-top: 1.25rem; }
.game-header { text-align: center; margin-bottom: 1.5rem; }
.game-header h1 { font-family: 'Fredoka One', cursive; font-size: 2rem; }
.game-back { display: inline-flex; align-items: center; gap: 0.3rem; color: #718096; font-size: 0.85rem; font-weight: 600; text-decoration: none; margin-bottom: 0.5rem; }
.game-back:hover { color: var(--primary); }
.game-stats { display: flex; justify-content: center; gap: 1.5rem; margin-bottom: 2rem; }
.stat-box { background: #fff; border-radius: 12px; padding: 1rem 1.5rem; text-align: center; box-shadow: var(--shadow); min-width: 80px; }
.stat-value { font-family: 'Fredoka One', cursive; font-size: 1.8rem; color: var(--primary); }
.stat-label { font-size: 0.8rem; font-weight: 700; color: #718096; text-transform: uppercase; }

/* Flashcard */
.flashcard-area { display: flex; flex-direction: column; align-items: center; margin-bottom: 2rem; position: relative; }
.flashcard { width: 100%; max-width: 420px; height: 260px; perspective: 1000px; cursor: pointer; position: relative; }
.flashcard-face { position: absolute; width: 100%; height: 100%; backface-visibility: hidden; border-radius: var(--radius); display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: var(--shadow); transition: transform 0.6s; }
.flashcard-front { background: linear-gradient(135deg, var(--primary), var(--purple)); color: #fff; }
.flashcard-back { background: linear-gradient(135deg, var(--secondary), #3BA99C); color: #fff; transform: rotateY(180deg); }
.flashcard.flipped .flashcard-front { transform: rotateY(180deg); }
.flashcard.flipped .flashcard-back { transform: rotateY(0deg); }
.flashcard-word { font-family: 'Fredoka One', cursive; font-size: 2.2rem; }
.flashcard-lang { font-size: 0.9rem; opacity: 0.8; margin-top: 0.3rem; font-weight: 600; }
.flashcard-hint { margin-top: 1rem; font-size: 0.85rem; color: #718096; font-weight: 600; }

/* Phrase display on flashcard back */
.flashcard-phrase {
  font-size: 0.8rem;
  color: #5a6778;
  margin-top: 0.4rem;
  padding: 0.3rem 0.6rem;
  background: rgba(90, 114, 50, 0.08);
  border-radius: 6px;
  line-height: 1.4;
  display: none;
  max-width: 90%;
}
.flashcard-phrase-target {
  background: rgba(201, 168, 76, 0.1);
  color: #7a6020;
  font-style: italic;
}
.flashcard-controls { display: flex; justify-content: center; gap: 1rem; }

/* Match game */
.match-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; max-width: 600px; margin: 0 auto; position: relative; }
.match-card { background: #fff; border-radius: 12px; padding: 1rem 0.5rem; text-align: center; font-weight: 700; font-size: 0.9rem; cursor: pointer; box-shadow: var(--shadow); border: 3px solid transparent; transition: all 0.2s; word-break: break-word; }
.match-card:hover { border-color: var(--secondary); transform: translateY(-2px); }
.match-card.selected { border-color: var(--primary); background: rgba(255,107,107,0.1); }
.match-card.matched { border-color: #34D399; background: rgba(52,211,153,0.15); opacity: 0.6; }
.match-card.wrong { border-color: var(--primary); background: rgba(255,107,107,0.15); }

/* Memory game */
.memory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.8rem; max-width: 500px; margin: 0 auto; position: relative; }
.memory-card { aspect-ratio: 1; background: linear-gradient(135deg, var(--primary), var(--purple)); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 1.1rem; color: #fff; cursor: pointer; box-shadow: var(--shadow); transition: all 0.2s; border: 3px solid transparent; }
.memory-card:hover { transform: translateY(-2px); }
.memory-card.flipped { background: #fff; color: var(--text); border-color: var(--secondary); flex-direction: column; gap: 0.1rem; padding: 0.25rem; }
.memory-card.matched { background: rgba(52,211,153,0.2); border-color: #34D399; opacity: 0.7; }

/* Quiz */
.quiz-question { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; text-align: center; position: relative; }
.quiz-prompt { font-size: 1.1rem; font-weight: 700; color: #718096; margin-bottom: 0.5rem; }
.quiz-word { font-family: 'Fredoka One', cursive; font-size: 2.5rem; color: var(--primary); }
.quiz-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 500px; margin: 0 auto; }
.quiz-option { background: #fff; border-radius: 12px; padding: 1.2rem; text-align: center; font-weight: 700; cursor: pointer; box-shadow: var(--shadow); border: 3px solid transparent; transition: all 0.2s; }
.quiz-option:hover { border-color: var(--secondary); transform: translateY(-2px); }
.quiz-option.correct { border-color: #34D399; background: rgba(52,211,153,0.15); }
.quiz-option.incorrect { border-color: var(--primary); background: rgba(255,107,107,0.15); }

/* Scramble */
.scramble-area { text-align: center; margin-bottom: 2rem; position: relative; }
.scramble-word { font-family: 'Fredoka One', cursive; font-size: 3rem; letter-spacing: 0.3rem; color: var(--primary); margin-bottom: 0.5rem; }
.scramble-hint { font-size: 1rem; color: #718096; font-weight: 600; margin-bottom: 1.5rem; }
.scramble-input { width: 100%; max-width: 400px; padding: 1rem 1.5rem; border: 3px solid var(--secondary); border-radius: 12px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 1.2rem; text-align: center; outline: none; transition: border-color 0.2s; }
.scramble-input:focus { border-color: var(--primary); }

/* Results */
.results-area { text-align: center; padding: 2rem; }
.results-emoji { font-size: 4rem; margin-bottom: 0.5rem; }
.results-title { font-family: 'Fredoka One', cursive; font-size: 2rem; color: var(--primary); margin-bottom: 0.5rem; }
.results-score { font-size: 1.5rem; font-weight: 700; color: var(--secondary); margin-bottom: 1.5rem; }

/* Confetti — contained to the game board, never the viewport or ads */
.confetti-layer {
  position: absolute; inset: 0; overflow: hidden;
  pointer-events: none; z-index: 4;
}
.confetti-piece { position: absolute; top: -12px; z-index: 1; pointer-events: none; animation: confettiFall 2.6s ease-in forwards; }
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0deg); opacity: 1; } 100% { transform: translateY(var(--fall, 640px)) rotate(360deg); opacity: 0; } }

/* Reserved ad slot — same 90×728 as layout.ejs, prevents CLS when ads load */
.ad-banner-top {
  text-align: center;
  margin: 0 auto 1rem;
  min-height: 90px;
  max-width: 728px;
  position: relative;
  z-index: 80;
}
body:has(.game-container) > .ad-banner-top { margin-top: 4.5rem; }

/* ============ FOOTER ============ */
.main-footer { background: var(--text); color: rgba(255,255,255,0.7); padding: 2rem 1rem; text-align: center; font-size: 0.9rem; }
.footer-inner p { margin: 0.2rem 0; }
.footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1rem;
  margin-top: 0.85rem;
}
.footer-links a { color: #fff; font-weight: 800; text-decoration: none; }
.footer-links a:hover { color: var(--accent); }
.youtube-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.95rem;
  padding: 0.55rem 1.15rem;
  border-radius: 50px;
  background: #fff;
  color: var(--text);
  border: 3px solid var(--accent);
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  transition: transform 0.2s, box-shadow 0.2s;
  max-width: 100%;
}
.youtube-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(255, 230, 109, 0.45);
  color: var(--text);
}
.youtube-link:focus-visible {
  outline: 3px solid var(--secondary);
  outline-offset: 3px;
}
.youtube-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex: 0 0 auto;
  color: #FF0000;
}
.youtube-link--hero {
  margin: 0.15rem auto 1.15rem;
  padding: 0.7rem 1.15rem;
  font-size: 1.05rem;
  background: linear-gradient(135deg, #fff, var(--accent));
  border-color: #fff;
  box-shadow: var(--shadow);
  max-width: min(100%, 36rem);
}
.youtube-link--hero:hover {
  color: var(--text);
  box-shadow: 0 8px 24px rgba(255, 107, 107, 0.28);
}

/* ============ VERSEVILLE STORY READER ============ */
.story-page { display: flex; gap: 1.5rem; margin: 2rem 0; align-items: stretch; }
.story-col { flex: 1; background: #fff; border-radius: 16px; padding: 1.25rem; box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
.story-col h3 { font-family: 'Fredoka One', cursive; color: var(--primary); margin: 0 0 0.75rem; }
.story-illustration { background: #fdf6ec; border: 2px dashed #d9c3a3; border-radius: 12px; padding: 0.75rem; text-align: center; margin-bottom: 1rem; min-height: 120px; overflow: hidden; }
.story-img { max-width: 100%; max-height: 280px; border-radius: 8px; object-fit: contain; display: inline-block; }
.story-text { font-size: 1.05rem; line-height: 1.7; color: #374151; }
.story-actions { text-align: center; margin: 2rem 0; }
.btn-primary { display: inline-block; padding: 0.85rem 1.8rem; background: var(--primary); color: #fff; border-radius: 50px; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgba(102,126,234,0.35); }
.btn-primary:hover { transform: translateY(-2px); }
.cast-note { font-size: 0.75rem; color: #9ca3af; line-height: 1.5; margin-top: 1.5rem; border-top: 1px solid #eee; padding-top: 1rem; }
@media (max-width: 768px) { .story-page { flex-direction: column; } }


/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .hero-title { font-size: 2.2rem; }
  .nav-inner {
    height: auto;
    min-height: 56px;
    padding: 0.4rem 0.75rem 0.5rem;
    flex-wrap: wrap;
    row-gap: 0.1rem;
  }
  .nav-links {
    flex-wrap: wrap;
    width: 100%;
    gap: 0.1rem 0.85rem;
    justify-content: flex-start;
  }
  .nav-links a,
  .nav-save {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  .lang-switcher select { min-height: 44px; }
  .hero {
    align-items: flex-start;
    padding-top: 9.5rem;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    padding-bottom: 1.25rem;
  }
  .hero-characters {
    --hero-gap: 0.15rem;
    --plus-slot: 0.85rem;
  }
  .hero-characters { margin-bottom: 0.45rem; }
  .hero-tagline { margin-bottom: 0.85rem; font-size: 1.05rem; }
  .youtube-link--hero { margin-bottom: 0.45rem; }
  .language-selector { padding: 1.05rem 0.85rem 0.85rem; }
  .language-selector h2 { margin-bottom: 0.85rem; font-size: 1.15rem; }
  .lang-pairs { gap: 0.65rem; margin-bottom: 0.85rem; }
  .info-page, .auth-wrap, .dash-wrap { padding-top: 9.5rem; }
  .youtube-link { font-size: 0.9rem; padding: 0.5rem 0.9rem; }
  .youtube-link--hero { font-size: 0.95rem; max-width: min(100%, 18.5rem); }
  .char-svg { width: 60px; }
  .controls-row { flex-direction: column; align-items: stretch; }
  .coloring-pages { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .games-grid { grid-template-columns: 1fr; }
  .match-grid { grid-template-columns: repeat(2, 1fr); }
  .memory-grid { grid-template-columns: repeat(3, 1fr); }
  .quiz-options { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  body:has(> .game-container) {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }
  body:has(> .game-container) > .game-container {
    order: 1;
    padding-top: 8.5rem;
    width: 100%;
  }
  body:has(> .game-container) > .ad-banner-top {
    order: 2;
    margin-top: 0.75rem;
    width: 100%;
  }
  body:has(> .game-container) > .main-footer { order: 3; }
  .logo { font-size: 1.15rem; }
}

/* ============ WORD SEARCH ============ */
.wordsearch-words { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.ws-word { background: #fff; border-radius: 8px; padding: 0.4rem 0.8rem; font-weight: 700; font-size: 0.9rem; box-shadow: var(--shadow); border: 2px solid #e2e8f0; transition: all 0.3s; }
.ws-word.ws-found { background: rgba(52,211,153,0.2); border-color: #34D399; text-decoration: line-through; opacity: 0.6; }
.wordsearch-grid { display: grid; gap: 2px; max-width: 450px; margin: 0 auto; background: #e2e8f0; padding: 2px; border-radius: 8px; }
.ws-cell { width: 100%; aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 1.1rem; cursor: pointer; border-radius: 4px; transition: all 0.15s; user-select: none; }
.ws-cell:hover { background: rgba(78,205,196,0.2); }
.ws-cell.ws-selected { background: rgba(255,107,107,0.3); }
.ws-cell.ws-found-cell { background: rgba(52,211,153,0.3); }

/* ============ SPELLING BEE ============ */
.spelling-area { text-align: center; }
.spelling-prompt { font-size: 1.2rem; font-weight: 700; color: #718096; margin-bottom: 1rem; }
.spelling-hint { font-size: 1rem; color: var(--secondary); font-weight: 600; margin-bottom: 1rem; min-height: 1.5em; }
.spelling-answer { font-family: 'Fredoka One', cursive; font-size: 1.5rem; color: var(--primary); margin-bottom: 1rem; min-height: 1.5em; }
.spelling-letters { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.sb-letter { width: 48px; height: 48px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), #FFD93D); border: none; font-family: 'Fredoka One', cursive; font-size: 1.2rem; cursor: pointer; transition: all 0.2s; box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.sb-letter:hover { transform: translateY(-2px) scale(1.05); }
.sb-letter.used { opacity: 0.3; transform: scale(0.9); cursor: not-allowed; }
.spelling-input { min-height: 60px; background: #fff; border: 3px dashed var(--secondary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 1.8rem; letter-spacing: 0.2rem; margin-bottom: 1rem; padding: 1rem; }
.spelling-result { font-size: 1.2rem; font-weight: 700; margin-top: 1rem; min-height: 1.5em; }
.spelling-controls { display: flex; gap: 0.8rem; justify-content: center; flex-wrap: wrap; }

/* ============ SENTENCE BUILDER ============ */
.sentence-area { text-align: center; }
.sentence-prompt { font-size: 1.2rem; font-weight: 700; color: #718096; margin-bottom: 0.5rem; }
.sentence-hint { font-size: 1rem; color: var(--secondary); font-weight: 600; margin-bottom: 1.5rem; font-style: italic; }
.sentence-build { min-height: 60px; background: #fff; border: 3px dashed var(--secondary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; font-weight: 700; margin-bottom: 1.5rem; padding: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.sentence-words { display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center; margin-bottom: 1.5rem; }
.snt-word { background: linear-gradient(135deg, var(--purple), #8B5CF6); color: #fff; border: none; border-radius: 8px; padding: 0.6rem 1rem; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s; box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.snt-word:hover { transform: translateY(-2px); }
.sentence-result { font-size: 1.2rem; font-weight: 700; margin: 1rem 0; min-height: 1.5em; }
.sentence-controls { display: flex; gap: 1rem; justify-content: center; margin-top: 1rem; }

/* ============ STORY TIME ============ */
.story-area { max-width: 700px; margin: 0 auto; }
.story-loading { text-align: center; font-size: 1.2rem; color: #718096; padding: 3rem; }
.story-content { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.story-title { font-family: 'Fredoka One', cursive; font-size: 1.8rem; color: var(--primary); text-align: center; margin-bottom: 1rem; }
.story-text { font-size: 1.1rem; line-height: 1.8; margin-bottom: 2rem; color: var(--text); }
.story-text p { margin-bottom: 0.8rem; }
.story-question-area { border-top: 2px solid #f0f0f0; padding-top: 1.5rem; }
.story-question { font-size: 1.2rem; font-weight: 700; color: var(--text); margin-bottom: 1rem; text-align: center; }
.story-options { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; max-width: 500px; margin: 0 auto 1rem; }
.story-result { text-align: center; font-size: 1.2rem; font-weight: 700; margin: 1rem 0; min-height: 1.5em; }
.story-next-btn { margin: 1rem auto 0; display: block; }

/* ============ PRONUNCIATION PRACTICE ============ */
.pron-container { max-width: 700px; margin: 0 auto; }
.pron-loading { text-align: center; font-size: 1.2rem; color: #718096; padding: 3rem; }
.pron-content { background: #fff; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.pron-target-word { font-family: 'Fredoka One', cursive; font-size: 3rem; color: var(--primary); text-align: center; margin-bottom: 0.5rem; }
.pron-native-hint { font-size: 1.2rem; color: #718096; text-align: center; font-weight: 700; margin-bottom: 1rem; }
.pron-phonetic { font-size: 1.5rem; color: var(--purple); text-align: center; font-weight: 700; margin-bottom: 0.5rem; }
.pron-syllables { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.pron-syllable { background: linear-gradient(135deg, var(--accent), #FFD93D); border-radius: 8px; padding: 0.4rem 0.8rem; font-weight: 700; font-size: 1rem; }
.pron-actions { display: flex; justify-content: center; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.btn-pron { padding: 0.8rem 1.5rem; border-radius: 50px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 1rem; cursor: pointer; border: 3px solid var(--secondary); background: #fff; color: var(--text); transition: all 0.2s; }
.btn-pron:hover { background: var(--secondary); color: #fff; transform: translateY(-2px); }
.btn-pron.recording { background: var(--primary); color: #fff; border-color: var(--primary); animation: pulse 1s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.05); } }
.btn-check { background: linear-gradient(135deg, var(--secondary), #3BA99C); color: #fff; border: none; padding: 0.8rem 2rem; border-radius: 50px; font-family: 'Nunito', sans-serif; font-weight: 700; font-size: 1rem; cursor: pointer; transition: all 0.2s; }
.btn-check:hover { transform: translateY(-2px); }
.pron-feedback { text-align: center; font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; min-height: 1.5em; color: var(--secondary); }
.pron-spelling-section { border-top: 2px solid #f0f0f0; padding-top: 1.5rem; margin-top: 1rem; }
.pron-spelling-label { text-align: center; font-weight: 700; color: #718096; margin-bottom: 1rem; }
.pron-letters { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-bottom: 1rem; }
.pron-letter-btn { width: 44px; height: 44px; border-radius: 10px; background: linear-gradient(135deg, var(--purple), #8B5CF6); color: #fff; border: none; font-family: 'Fredoka One', cursive; font-size: 1.1rem; cursor: pointer; transition: all 0.2s; box-shadow: 0 3px 10px rgba(0,0,0,0.1); }
.pron-letter-btn:hover { transform: translateY(-2px) scale(1.05); }
.pron-letter-btn:disabled { opacity: 0.4; transform: none; }
.pron-answer { min-height: 50px; background: #f8f8f8; border: 3px dashed #ddd; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-family: 'Fredoka One', cursive; font-size: 1.5rem; letter-spacing: 0.15rem; margin-bottom: 1rem; }
.pron-result { text-align: center; font-size: 1.2rem; font-weight: 700; margin: 1rem 0; min-height: 1.5em; }
.pron-next-btn { margin: 1rem auto 0; display: block; }

/* ============ REDUCED MOTION ============ */
@media (prefers-reduced-motion: reduce) {
  .confetti-layer,
  .confetti-piece {
    display: none !important;
  }
  .character,
  .hero-char-img,
  .char-portrait,
  .mascot-portrait,
  .theme-card,
  .game-card,
  .char-deb.is-waving .hero-char-img,
  .char-deb.is-waving .char-portrait,
  .char-deb.is-waving .mascot-portrait,
  .char-weebster.is-popping .hero-char-img,
  .char-weebster.is-popping .char-portrait,
  .char-weebster.is-popping .mascot-portrait,
  .char-mocha.is-wagging .hero-char-img,
  .char-mocha.is-wagging .char-portrait,
  .char-mocha.is-wagging .mascot-portrait {
    animation: none !important;
  }
  .explain-modal,
  .explain-card {
    transition: none !important;
  }
  .explain-card,
  .explain-modal.is-open .explain-card {
    transform: none;
  }
  .theme-card,
  .game-card {
    opacity: 1;
    transform: none;
  }
  .youtube-link,
  .youtube-link:hover {
    transition: none;
    transform: none;
  }
}

/* ============ LESSONS AND VOCAB PICTURES ============ */
.lesson-wrap { max-width: 880px; margin: 0 auto; padding: 7.5rem 1.25rem 3rem; }
.lesson-wrap h1 { font-family: 'Fredoka One', cursive; color: var(--primary); font-size: 2rem; margin-bottom: 0.6rem; }
.lesson-wrap h2 { font-family: 'Fredoka One', cursive; color: var(--text); font-size: 1.35rem; margin: 1.6rem 0 0.7rem; }
.lesson-kicker { margin-bottom: 0.4rem; }
.lesson-kicker a, .lesson-actions a { color: var(--primary); font-weight: 800; }
.lesson-actions a.btn-start,
.lesson-actions a.btn-start:visited,
.lesson-actions a.btn-start:hover,
.lesson-actions a.btn-start:focus {
  background: #c0392b;
  color: #fff;
  box-shadow: 0 4px 15px rgba(192, 57, 43, 0.35);
}
.lesson-actions a.btn-start:hover,
.lesson-actions a.btn-start:focus { background: #a93226; color: #fff; }
.lesson-intro, .lesson-note, .lesson-aside, .word-ex, .word-gloss { line-height: 1.7; }
.lesson-intro { font-size: 1.05rem; margin-bottom: 0.9rem; }
.lesson-note, .verse-box { background: #fff; border-radius: 14px; padding: 1rem 1.1rem; box-shadow: var(--shadow); margin: 0.8rem 0 1rem; }
.lesson-aside { color: #4a5568; font-weight: 700; margin: 0.4rem 0 1rem; }
.lesson-actions { margin: 0.8rem 0; }
.verse-box { border-inline-start: 4px solid var(--secondary); }
.verse-box blockquote { margin: 0.6rem 0; font-size: 1.05rem; }
.verse-cite { color: #718096; font-weight: 800; font-size: 0.92rem; }
.word-list { list-style: none; display: grid; gap: 0.75rem; }
.word-card { background: #fff; border-radius: 14px; padding: 0.85rem 1rem; box-shadow: var(--shadow); display: grid; grid-template-columns: 72px 1fr; gap: 0.85rem; align-items: center; }
.vocab-slot { width: 72px; height: 72px; display: flex; align-items: center; justify-content: center; }
.vocab-fallback { font-size: 2rem; line-height: 1; }
.vocab-pic img, .vocab-art img { width: 72px; height: 72px; object-fit: contain; display: block; }
.word-card .vocab-pic img,
.vocab-art img {
  border-radius: 12px;
  background: #FBF5E6;
  box-shadow: 0 0 0 1px rgba(176, 132, 78, 0.32);
}
.word-target { font-family: 'Fredoka One', cursive; font-size: 1.45rem; }
.word-en, .word-say { font-weight: 800; }
.word-en { color: #718096; }
.word-say { color: var(--purple); }
.word-ex, .word-gloss { margin-top: 0.2rem; }
.theme-blurb { display: block; margin-top: 0.45rem; font-size: 0.82rem; font-weight: 700; color: #4a5568; line-height: 1.4; }
.theme-card { text-decoration: none; color: inherit; }
.lesson-color a { display: inline-block; text-decoration: none; color: var(--text); font-weight: 800; }
.lesson-color img { width: min(280px, 100%); height: auto; border-radius: 12px; background: #fff; box-shadow: var(--shadow); }
.game-lesson-link { text-align: center; margin: 0.4rem 0 1rem; }
.game-lesson-link a { color: var(--primary); font-weight: 800; }
.vocab-art[hidden] { display: none !important; }
.flashcard.has-art { height: 360px; }
.flashcard .vocab-art img {
  width: 156px;
  height: 156px;
  border-radius: 20px;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.92), 0 8px 18px rgba(45, 23, 40, 0.22);
}
.flashcard-art, .match-card .vocab-art, .memory-card .vocab-art { display: flex; justify-content: center; }
.match-card .vocab-art img, .memory-card .vocab-art img { width: 64px; height: 64px; margin: 0 auto 0.25rem; border-radius: 10px; }
.story-cast { display: flex; justify-content: center; gap: 0.5rem; align-items: flex-end; }
.story-cast img { width: 72px; height: 96px; object-fit: cover; object-position: center 20%; border-radius: 10px; }
html[lang="ar"] .lesson-wrap,
html[lang="ar"] .lesson-wrap h1,
html[lang="ar"] .lesson-wrap h2,
html[lang="ar"] .word-target { font-family: 'Noto Naskh Arabic', 'Nunito', sans-serif; }
html[lang="ja"] .lesson-wrap,
html[lang="ja"] .lesson-wrap h1,
html[lang="ja"] .lesson-wrap h2,
html[lang="ja"] .word-target { font-family: 'Noto Sans JP', 'Nunito', sans-serif; }
html[lang="zh"] .lesson-wrap,
html[lang="zh"] .lesson-wrap h1,
html[lang="zh"] .lesson-wrap h2,
html[lang="zh"] .word-target { font-family: 'Noto Sans SC', 'Nunito', sans-serif; }
html[dir="rtl"] .lesson-wrap { text-align: start; }
.info-page { max-width: 760px; margin: 0 auto; padding: 7.5rem 1.25rem 3rem; }
.info-page h1 { font-family: 'Fredoka One', cursive; color: var(--primary); margin-bottom: 0.6rem; }
.info-page h2 { font-size: 1.15rem; margin: 1.6rem 0 0.4rem; }
.info-page p, .info-page li { line-height: 1.65; margin-bottom: 0.75rem; }
.info-page a { color: var(--primary); font-weight: 700; }
@media (max-width: 520px) {
  .word-card { grid-template-columns: 56px 1fr; }
  .vocab-slot, .vocab-pic img { width: 56px; height: 56px; }
  .lesson-wrap h1 { font-size: 1.6rem; }
}
