/* ============================================================
   SPANISH LEARNING APP - STATIC CSS
   Mobile-first, large buttons, minimal text, child-friendly.
   ============================================================ */

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

:root {
  --bg: #F4EBDD;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F9F3E8;

  --text: #2E2A26;
  --text-muted: #8A8178;

  --primary: #F28C28;
  --primary-glow: #E57C1F;

  --success: #2FAF66;
  --warning: #F4B740;
  --danger: #E35D5D;

  --accent: #4A90E2;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 6px 24px rgba(0,0,0,0.08);
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* ---------- SCREENS ---------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--bg);
  min-height: 100dvh;
  overflow-y: auto;
  animation: fadeIn 0.3s ease;
  z-index: 1;
}

.screen.active {
  display: flex;
  z-index: 10;
}

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

/* ---------- TYPOGRAPHY ---------- */
.title { font-size: 1.8rem; font-weight: 800; margin: 24px 0 20px; text-align: center; }
.section-title { font-size: 1.3rem; font-weight: 700; margin: 12px 0 8px; }

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: var(--radius); cursor: pointer;
  font-size: 1.1rem; font-weight: 700; padding: 14px 28px;
  transition: transform 0.15s, box-shadow 0.15s, background 0.2s;
  font-family: var(--font);
}
.btn:active { transform: scale(0.95); }

.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 4px 16px rgba(242,140,40,0.35); }
.btn-primary:hover { background: var(--primary-glow); }

.btn-secondary { background: var(--bg-card); color: var(--text); border: 2px solid var(--primary); }

.btn-success { background: var(--success); color: #0c1929; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-large { font-size: 1.3rem; padding: 18px 36px; min-width: 200px; }

.btn-back {
  position: absolute; top: 12px; left: 12px;
  background: var(--bg-card); color: var(--text); font-size: 1.2rem;
  padding: 8px 14px; border-radius: var(--radius-sm); border: none; cursor: pointer; z-index: 10;
}


.btn-audio:active { transform: scale(0.9); background: var(--primary); color: var(--bg); }

/* ---------- CHARACTER SELECT ---------- */
.char-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
  max-width: 420px;
}

@media (max-width: 380px) {
  .char-grid { grid-template-columns: repeat(4, 1fr); }
}
.char-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card); border: 2.5px solid transparent; border-radius: 12px;
  padding: 8px 4px; cursor: pointer; transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: var(--font);
  min-width: 0; width: 100%; box-sizing: border-box; overflow: hidden;
}
.char-btn:hover { border-color: var(--primary); transform: scale(1.05); }
.char-btn.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(242,140,40,0.25); background: #fff8f0; }
.char-emoji { font-size: 1.8rem !important; line-height: 1; display: block; }
.char-img { width: 44px; height: 44px; object-fit: cover; border-radius: 50%; display: block; }
.char-label { font-size: 0.65rem; font-weight: 700; color: var(--text); text-align: center; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* ---------- RESOURCES BAR ---------- */
.top-bar { width: 100%; max-width: 500px; padding: 8px 0; }
.resources { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; font-size: 0.95rem; }
.resources span { background: var(--bg-card); padding: 5px 10px; border-radius: 20px; display: flex; align-items: center; gap: 4px; }
.res-img { width: 20px; height: 20px; object-fit: contain; display: inline-block; vertical-align: middle; }
.game-res { margin-bottom: 8px; }

/* ---------- LESSON LIST – 3 column grid ---------- */
.lesson-list {
  width: 100%; max-width: 680px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  padding: 4px 0;
}
.lesson-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 5px; text-align: center;
  background: var(--bg-card); border-radius: var(--radius); padding: 12px 6px 10px;
  cursor: pointer; transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  border: 2px solid transparent; min-height: 100px; position: relative;
  box-shadow: var(--shadow);
}
.lesson-card:hover { background: var(--bg-card-hover); transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.lesson-card.locked { opacity: 0.4; pointer-events: none; }
.lesson-card.completed { border-color: var(--success); background: #f6fef9; }
.lesson-icon-wrap { width: 52px; height: 52px; display: flex; align-items: center; justify-content: center; }
.lesson-img { width: 52px; height: 52px; object-fit: contain; border-radius: 8px; display: block; }
.lesson-card .lesson-emoji { font-size: 2.2rem; line-height: 1; }
.lesson-card .lesson-title { font-weight: 700; font-size: 0.78rem; line-height: 1.2; color: var(--text); }
.lesson-card .lesson-sub { display: none; }
.lesson-card .lesson-status {
  position: absolute; top: 6px; right: 8px;
}
.status-img { width: 22px; height: 22px; object-fit: contain; display: block; }

/* ---------- MINI MAP (leckék oldal) ---------- */
.world-map {
  width: 100%; max-width: 500px; height: 60px; background: var(--bg-card);
  border-radius: var(--radius); position: relative; overflow: hidden; margin-bottom: 8px;
}
.map-path {
  position: absolute; top: 50%; left: 8px; right: 8px; height: 4px;
  background: var(--text-muted); border-radius: 2px; transform: translateY(-50%);
}
/* ---------- WORLD MAP – utazós útvonal térkép ---------- */
.worldmap-full { width: 100%; padding: 8px 0 24px; }

.map-journey {
  display: flex; flex-direction: column; align-items: center;
  width: 100%; gap: 0;
}

/* Stop kártya */
.map-stop { width: 100%; display: flex; position: relative; padding: 0 16px; }
.map-stop--left  { justify-content: flex-start; }
.map-stop--right { justify-content: flex-end; }

.map-stop-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: var(--bg-card); border: 3px solid #e5e7eb;
  border-radius: 18px; padding: 10px 14px; min-width: 120px; max-width: 150px;
  box-shadow: var(--shadow); text-align: center;
  transition: transform 0.15s, box-shadow 0.2s;
}
.map-stop.done  .map-stop-card { border-color: var(--success); background: #f6fef9; }
.map-stop.current .map-stop-card { border-color: var(--primary); background: #fff8f0; box-shadow: 0 4px 16px rgba(242,140,40,0.3); }
.map-stop.locked .map-stop-card { opacity: 0.4; }
.map-stop.review-stop .map-stop-card { border-color: #f59e0b; background: #fffbeb; }

.map-stop-icon { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; }
.map-stop-name { font-size: 0.7rem; font-weight: 700; color: var(--text); line-height: 1.2; }

/* Karakter pin az aktuális városon */
.map-char-pin {
  position: absolute; top: -20px; left: 50%; transform: translateX(-50%);
}

/* Zöld/piros badge */
.map-done-badge, .map-lock-badge {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px; display: flex; align-items: center; justify-content: center;
}

/* Összekötő vonal */
.map-connector {
  width: 3px; height: 32px; background: #d1d5db;
  border-radius: 2px; margin: 2px 0;
}
.map-connector.conn--right { margin-left: calc(50% + 48px); }
.map-connector.conn--left  { margin-right: calc(50% + 48px); }

/* Régi hardcode – ne legyen látható */
.map-city {
  position: absolute; font-size: 1rem; font-weight: 700;
  background: var(--bg-card-hover); padding: 8px 14px; border-radius: var(--radius-sm);
  border: 2px solid var(--accent);
}
.map-hint { text-align: center; color: var(--text-muted); font-size: 0.85rem; margin-top: 12px; }

/* ---------- PROGRESS TRACK (in-game) ---------- */
.progress-track {
  width: 100%; max-width: 500px;
  margin-bottom: 10px;
  display: flex; flex-direction: row; align-items: center; gap: 8px;
  padding-left: 80px;
  padding-right: 8px;
  box-sizing: border-box;
}
.progress-header { display: none; }
.level-badge {
  background: var(--accent); color: #fff; font-weight: 800;
  width: 32px; height: 32px; border-radius: 50%; font-size: 0.95rem;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.progress-label {
  font-size: 0.85rem; font-weight: 700; color: var(--text-muted);
  flex-shrink: 0; white-space: nowrap;
}
.track-bar {
  flex: 1; height: 38px; background: var(--bg-card); border-radius: 20px;
  position: relative; overflow: visible; box-shadow: var(--shadow);
}
.track-fill {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--success));
  border-radius: 20px; transition: width 0.5s ease; width: 0%;
}
.track-character {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  font-size: 1.8rem; transition: left 0.5s ease; left: 5%;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2));
}

/* ---------- GAME CONTENT ---------- */
.game-content {
  width: 100%; max-width: 500px; flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px;
  padding-top: 8px;
}

/* Level 1: Learn card */
.learn-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  width: 100%;
  box-shadow: var(--shadow);
  border: 4px solid #F38B2A;
}
.learn-emoji { font-size: 4rem; margin-bottom: 12px; }
.learn-word { font-size: 2rem; font-weight: 800; color: var(--primary); margin-bottom: 8px; }
.learn-helper { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; }

/* Level 2 & 3: Options */
.options-row {
  display: flex;
  gap: 12px;
  width: 100%;
  justify-content: center;
  flex-wrap: nowrap;
}
.option-btn {
  flex: 1;
  min-width: 0;
  max-width: 48%;
  background: var(--bg-card); border: 3px solid var(--bg-card-hover); border-radius: var(--radius);
  padding: 12px 8px; text-align: center; cursor: pointer;
  font-size: 1.2rem; font-weight: 700; color: var(--text);
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
  font-family: var(--font);
  overflow: hidden;
}
.option-btn:hover { border-color: var(--primary); }
.option-btn:active { transform: scale(0.95); }
.option-btn.correct { border-color: var(--success); background: rgba(52,211,153,0.15); animation: popCorrect 0.4s ease; }
.option-btn.wrong { border-color: var(--danger); background: rgba(248,113,113,0.15); animation: shake 0.4s ease; }
.option-emoji { font-size: 2.5rem; margin-bottom: 6px; display: block; }

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

/* Level 4: Speech */
.mic-area { text-align: center; }
.mic-btn {
  width: 100px; height: 100px; border-radius: 50%; font-size: 2.5rem;
  border: 4px solid var(--primary); background: var(--bg-card); color: var(--primary);
  cursor: pointer; transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
  display: flex; align-items: center; justify-content: center;
}
.mic-btn:hover { box-shadow: 0 0 30px rgba(242,140,40,0.4); }
.mic-btn.listening {
  background: var(--primary); color: var(--bg);
  animation: micPulse 1s infinite;
}
.mic-btn.success {
  background: var(--success); border-color: var(--success); color: #fff;
  animation: popCorrect 0.5s ease;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(242,140,40,0.5); }
  50% { box-shadow: 0 0 0 20px rgba(242,140,40,0); }
}

.speech-word { font-size: 1.5rem; font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.speech-hint { font-size: 0.9rem; color: var(--text-muted); margin-top: 12px; }
.speech-result { font-size: 1.1rem; font-weight: 700; margin-top: 10px; min-height: 1.5em; }
.interim-text { opacity: 0.55; font-style: italic; }
.equalizer-canvas { display: block; margin: 8px auto; border-radius: 6px; }

/* Next button */
.btn-next {
  background: var(--success); color: #0c1929; font-size: 1.2rem;
  padding: 14px 32px; border-radius: var(--radius); border: none;
  cursor: pointer; font-weight: 800; font-family: var(--font);
  transition: transform 0.15s;
}
.btn-next:active { transform: scale(0.95); }

/* ---------- CELEBRATION ---------- */
.celebrate-content { text-align: center; padding: 40px 20px; }
.celebrate-emoji { font-size: 4rem; margin-bottom: 16px; animation: bounceIn 0.6s ease; }
.celebrate-content h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: 12px; }
.celebrate-rewards { display: flex; gap: 16px; justify-content: center; margin: 20px 0; font-size: 1.3rem; }
@keyframes bounceIn { 0% { transform: scale(0); } 60% { transform: scale(1.2); } 100% { transform: scale(1); } }

/* ---------- CONFETTI ---------- */
#confetti-canvas {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  pointer-events: none; z-index: 1000;
}

/* ---------- GAME BACK ---------- */
.game-back { position: fixed; top: 12px; left: 12px; }

/* ---------- PROMPT TEXT ---------- */
.prompt-text { font-size: 1.1rem; font-weight: 700; text-align: center; color: var(--warning); margin-bottom: 8px; }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 600px) {
  .title { font-size: 2.2rem; }
  .char-emoji { font-size: 4.5rem; }
  .learn-emoji { font-size: 5rem; }
  .learn-word { font-size: 2.5rem; }
}


/* === Exact Lovable Button Match === */

/* ES blue button */
#btn-es-audio {
  background: #2D9CDB;
  color: #FFFFFF;
  border: none;
  border-radius: 18px;
  padding: 12px 22px;
  font-weight: 700;
}

/* HU orange button */
#btn-hu-audio {
  background: #F38B2A;
  color: #FFFFFF;
  border: none;
  border-radius: 18px;
  padding: 12px 22px;
  font-weight: 700;
}

/* Big green Next button */
.btn-next {
  background: #32B768;
  color: #FFFFFF;
  border: none;
  border-radius: 28px;
  padding: 16px 42px;
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(50,183,104,0.35);
}


/* ==================== KIDS EXPERIENCE UPGRADE ==================== */

/* Bigger and more playful option buttons */
.option-btn {
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.option-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

/* Stronger correct feedback */
.option-btn.correct {
  border-color: var(--success);
  background: rgba(52,211,153,0.2);
  box-shadow: 0 0 25px rgba(52,211,153,0.6);
  animation: successPulse 0.6s ease;
}

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

/* Stronger wrong feedback */
.option-btn.wrong {
  border-color: var(--danger);
  background: rgba(248,113,113,0.2);
  animation: shakeStrong 0.4s ease;
}

@keyframes shakeStrong {
  0%,100% { transform: translateX(0); }
  20% { transform: translateX(-10px); }
  40% { transform: translateX(10px); }
  60% { transform: translateX(-8px); }
  80% { transform: translateX(8px); }
}

/* Make speaker buttons more visible */
#btn-replay,
#btn-l3-replay,
#btn-l4-replay {
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
  
}

@keyframes gentlePulse {
  0% { box-shadow: 0 0 0 0 rgba(242,140,40,0.4); }
  70% { box-shadow: 0 0 0 12px rgba(242,140,40,0); }
  100% { box-shadow: 0 0 0 0 rgba(242,140,40,0); }
}

/* Microphone success celebration */
.mic-btn.success {
  animation: micCelebrate 0.6s ease;
}

@keyframes micCelebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}



/* ================= LEVEL 4 MOBILE FIX ================= */

.level4-controls-vertical {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  margin: 24px 0;
}

.replay-circle {
  width: 85px;
  height: 85px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(74,144,226,0.35);
  transition: transform 0.15s ease;
}

.replay-circle:active {
  transform: scale(0.92);
}

.mic-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 14px 35px rgba(242,140,40,0.45);
  transition: transform 0.2s ease;
}

.mic-circle:active {
  transform: scale(0.92);
}

.mic-circle.listening {
  background: var(--primary-glow);
  animation: micPulse 1s infinite;
}

.mic-circle.success {
  background: var(--success);
}



/* ================= LEVEL 2 CLEAN MINIMAL ================= */

.listen-card {
  text-align: center;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 20px;
  width: 100%;
  box-shadow: var(--shadow);
  border: 4px solid var(--primary);
  margin-top: 20px;
  margin-bottom: 24px;
}

.listen-icon {
  font-size: 3.2rem;
}

.listen-title {
  font-size: 1.5rem;
  font-weight: 800;
  margin-top: 6px;
}

.replay-big {
  margin: 18px auto 0;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  border: none;
  font-size: 2.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(74,144,226,0.35);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}

.replay-big:active {
  transform: scale(0.92);
}

.options-vertical {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  width: 100%;
}

.option-word {
  font-size: 0.95rem;
  font-weight: 700;
}



/* ================= LEVEL 2 LAYOUT STRUCTURE FIX ================= */

/* Ensure game content keeps proper centered column layout */
.game-content {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 12px;
}

/* Make options clearly separated and not full-bleed on large screens */
.options-vertical {
  max-width: 480px;
  margin: 0 auto 40px auto;
}

/* ================= IMAGE SYSTEM FIX ================= */

.word-image {
  width: 100%;
  max-width: 140px;
  height: auto;
  aspect-ratio: 1;
  object-fit: contain;
  display: block;
  margin: 0 auto 8px auto;
  pointer-events: none;
}

/* Prevent image overflow in option buttons */
.option-btn img {
  max-width: 100%;
  height: auto;
}




/* ================= LANGUAGE PAIR PICKER ================= */

.lang-pair-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  padding: 10px 16px 14px;
  width: 100%;
  max-width: 500px;
}

.lang-pair-btn {
  padding: 9px 16px;
  border-radius: 20px;
  border: 2px solid #e8dfd3;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.1s;
}

.lang-pair-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.lang-pair-btn:active {
  transform: scale(0.95);
}

.lang-pair-btn.active {
  border-color: var(--primary);
  background: #fff7ed;
  color: var(--primary);
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(242,140,40,0.25);
}

/* ================= LANG PICKER OVERRIDE ================= */
.lang-pair-btn {
  background: var(--bg-card) !important;
  border: 2px solid #e8dfd3 !important;
  color: var(--text-muted) !important;
  border-radius: 20px !important;
  padding: 7px 11px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  font-family: var(--font) !important;
}
.lang-pair-btn.active {
  border-color: var(--primary) !important;
  background: #fff7ed !important;
  color: var(--primary) !important;
  font-weight: 800 !important;
  box-shadow: 0 4px 12px rgba(242,140,40,0.25) !important;
}

/* ================= PROFILE BUTTON ================= */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 500px;
}

.btn-profile-icon {
  font-size: 1.8rem;
  background: var(--bg-card);
  border: 2px solid #e8dfd3;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
  flex-shrink: 0;
}

.btn-profile-icon:hover {
  border-color: var(--primary);
  transform: scale(1.08);
}

/* ================= ENCOURAGEMENT BOX (4. szint) ================= */
@keyframes enc-pop {
  0%   { opacity: 0; transform: scale(0.8) translateY(8px); }
  70%  { transform: scale(1.04) translateY(-2px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

#encouragement-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.enc-icon {
  font-size: 2rem;
  animation: enc-pop 0.4s ease;
}

.enc-msg {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0;
  line-height: 1.4;
}

.enc-replay-btn {
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 10px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, opacity 0.15s;
  box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.enc-replay-btn:hover {
  transform: scale(1.05);
  opacity: 0.92;
}

.enc-replay-btn:active {
  transform: scale(0.97);
}

/* ================= ÉLETKOR VÁLASZTÓ ================= */
.age-group-picker {
  display: flex;
  gap: 10px;
  width: 100%;
  max-width: 500px;
  justify-content: center;
}

.age-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 8px;
  border-radius: 16px;
  border: 2.5px solid #e8dfd3;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.18s;
  font-family: var(--font);
}

.age-btn:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.age-btn.active {
  border-color: var(--primary);
  background: #fff8f0;
  box-shadow: 0 0 0 3px var(--primary-light, #ffe0b2);
}

.age-emoji {
  font-size: 1.8rem;
}

.age-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.age-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.3;
}

/* ================= ONBOARDING SCREEN ================= */
#screen-onboarding {
  padding: 24px 16px 88px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  overflow-y: auto;
}

.onboarding-title {
  font-size: 1.8rem;
  margin: 0;
}
.onboarding-logo-img {
  width: 180px;
  height: auto;
  mix-blend-mode: multiply;
}
.btn-back-map {
  font-size: 0.9rem;
  padding: 6px 10px;
}

.onboarding-section {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border-radius: 20px;
  padding: 16px;
  border: 2px solid #e8dfd3;
}

.onboarding-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 12px 2px;
}

/* Karakter sor – a .char-grid alap stílusát örökli */

/* Nyelvpár sor */
.lang-pair-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lang-pick-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lang-pick-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 4px 2px;
  text-align: center;
}

.lang-arrow {
  font-size: 1.8rem;
  color: var(--primary);
  font-weight: 900;
  flex-shrink: 0;
  padding-top: 18px;
}

.lang-pick-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lang-flag-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 2px solid #e8dfd3;
  background: var(--bg-card);
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.95rem;
  transition: all 0.15s;
  width: 100%;
}

.lang-flag-btn:hover:not([disabled]) {
  border-color: var(--primary);
  transform: translateX(2px);
}

.lang-flag-btn.active {
  border-color: var(--primary);
  background: #fff8f0;
  box-shadow: 0 0 0 2px var(--primary-light, #ffe0b2);
  font-weight: 700;
}

.lang-flag-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
}

.lang-flag-btn span:first-child {
  font-size: 1.4rem;
}

.lang-flag-name {
  font-size: 0.88rem;
}

/* Kor – kisebb verzió az onboardinghoz */
#onboarding-age .age-btn {
  padding: 10px 6px;
}

#onboarding-age .age-desc {
  display: none;
}

/* Start gomb */
.onboarding-start {
  width: 100%;
  max-width: 480px;
  margin-top: 4px;
  font-size: 1.1rem;
}

.onboarding-start:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none !important;
}

/* ================= LANG CHECKBOX PICKER ================= */
.lang-check-table {
  display: grid;
  grid-template-columns: 1fr 52px 52px;
  gap: 6px 10px;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  align-items: center;
}

/* Header sor: üres cella + két fejléc felirat */
.lang-check-header {
  display: contents; /* beolvad a szülő gridbe */
}

.lang-col-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
}

/* Minden sor szintén beolvad a gridbe */
.lang-check-row {
  display: contents;
}

.lang-check-flag {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding: 6px 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.flag-img {
  width: 32px;
  height: 21px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  flex-shrink: 0;
}

.lang-check-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 2.5px solid #e0d6cc;
  background: #f9f6f2;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.15s;
  color: transparent;
  font-family: var(--font);
  justify-self: center;
}

.lang-check-btn:hover {
  border-color: var(--primary);
  background: #fff8f0;
}

.lang-check-btn.checked {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 900;
}

/* ================= BOTTOM NAV BAR ================= */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: #fff;
  border-top: 1.5px solid #e8dfd3;
  display: flex;
  align-items: stretch;
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.07);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 0;
  transition: all 0.15s;
  font-family: var(--font);
  color: #9ca3af;
}

.nav-btn.active {
  color: var(--primary);
}

.nav-img { width: 28px; height: 28px; object-fit: contain; display: block; }
.nav-btn.active .nav-img { filter: saturate(1.5) brightness(0.85); }

.nav-icon {
  font-size: 1.35rem;
  line-height: 1;
}

.nav-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* Minden fő képernyőn padding-bottom hogy ne takarja a nav */
#screen-lessons,
#screen-worldmap,
#screen-profile,
#screen-auth,
#screen-onboarding {
  padding-bottom: 88px;
}

/* ================= AUTH SCREEN ================= */
#screen-auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  padding: 48px 20px 80px;
}

.auth-content {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.auth-logo {
  display: flex;
  justify-content: center;
}

.auth-logo-img {
  width: 220px;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.auth-sub {
  color: var(--text-muted);
  margin: 0;
  font-size: 1rem;
}

.auth-social {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}

.btn-social {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: 16px;
  border: 2px solid #e8dfd3;
  background: #fff;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.15s;
  color: var(--text);
}

.btn-social:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.social-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.btn-google .social-icon  { background: #ea4335; color: #fff; }
.btn-facebook .social-icon { background: #1877f2; color: #fff; }
.btn-apple .social-icon   { background: #000; color: #fff; }

.auth-divider {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 12px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #e8dfd3;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.auth-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 2px solid #e8dfd3;
  font-family: var(--font);
  font-size: 1rem;
  background: #faf8f5;
  box-sizing: border-box;
  transition: border-color 0.15s;
  outline: none;
}

.auth-input:focus {
  border-color: var(--primary);
}

.btn-auth-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.88rem;
  cursor: pointer;
  font-family: var(--font);
  padding: 8px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-auth-skip:hover {
  color: var(--text);
}


#screen-game {
  overflow-y: auto;
  justify-content: flex-start;
}


/* ================= LEVEL 2 DESKTOP HORIZONTAL FIX ================= */
@media (min-width: 768px) {
  /* options-vertical: 2 kártyás választó tableten vízszintes */
  .options-vertical {
    flex-direction: row;
    justify-content: center;
    align-items: stretch;
    gap: 24px;
  }
  /* game-content MINDIG oszlop – a Következő gomb mindig a kártya ALATT van */
  .game-content {
    flex-direction: column !important;
    align-items: center;
  }
}


/* ================= DESKTOP HEIGHT OPTIMIZATION ================= */

@media (min-width: 1024px) {

  .game-content {
    gap: 12px;
  }

  .listen-card {
    padding: 20px 18px;
  }

  .learn-card {
    padding: 20px;
  }

  .word-image {
    width: 130px;
    height: 130px;
  }

  .progress-track {
    margin-bottom: 6px;
  }

  /* level-badge progress-header-ben van */

}


/* ================= LEVEL 5: FORMULA CARD BIG ================= */
.formula-card {
  width: 100%;
  background: #fff8f0;
  border: 2.5px solid var(--primary);
  border-radius: var(--radius);
  padding: 18px 20px;
  text-align: center;
  box-shadow: 0 4px 16px rgba(242,140,40,0.12);
  animation: fadeIn 0.4s ease;
}

.formula-card-big {
  padding: 24px 20px;
  gap: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.formula-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.formula-image-wrap {
  margin: 4px 0;
}

.formula-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 12px;
}

.formula-sentence-big {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.4;
  margin: 4px 0;
}

.formula-translation {
  display: none;
}

.btn-formula-audio {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  transition: transform 0.15s, background 0.2s;
}

.btn-formula-audio:active {
  transform: scale(0.95);
  background: var(--primary-glow);
}

.formula-mic-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.formula-mic-hint {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
}

/* ================= UI INSTRUKCIÓS KÉPEK ================= */
.ui-icon-img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border-radius: 16px;
}

.ui-speak-img {
  width: 120px;
  height: 120px;
  margin-bottom: 8px;
}

.ui-formula-img {
  width: 32px;
  height: 32px;
  vertical-align: middle;
  margin-right: 6px;
  border-radius: 8px;
}


/* Level 5 audio buttons – same style as Level 1 */
#btn-l5-audio-src {
  background: #2D9CDB;
  color: #FFFFFF;
  border: none;
  border-radius: 18px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  transition: transform 0.15s;
}
#btn-l5-audio-src:active { transform: scale(0.95); }

#btn-l5-audio-tgt {
  background: #F38B2A;
  color: #FFFFFF;
  border: none;
  border-radius: 18px;
  padding: 12px 22px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font);
  font-size: 1rem;
  transition: transform 0.15s;
}
#btn-l5-audio-tgt:active { transform: scale(0.95); }

/* Review / Szintzáró lecke kártya */
.lesson-card.review-card {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 2px dashed #F38B2A;
}
.lesson-card.review-card:hover {
  background: linear-gradient(135deg, #fff3cd, #ffe0a0);
  transform: translateY(-2px);
}
.lesson-card.review-card.completed {
  border: 2px dashed var(--success);
  background: linear-gradient(135deg, #f0fff4, #e6ffed);
}


/* ===== GYEREK PROFIL VÁLASZTÓ ===== */
.child-select-list {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  width: 100%;
  padding: 8px 0;
}

.child-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px 24px;
  min-width: 110px;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
  font-family: var(--font);
}

.child-card:hover {
  border-color: #f59e0b;
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(245,158,11,0.2);
}

.child-card-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
}

.child-card-emoji {
  font-size: 3rem;
  line-height: 1;
}

.child-card-name {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
}


/* ================= PAYWALL ================= */
.paywall-icon {
  font-size: 3.5rem;
  text-align: center;
  margin: 4px 0;
}

.paywall-plans {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  margin: 8px 0;
}

.paywall-plan {
  background: var(--bg-card);
  border: 2px solid #e8dfd3;
  border-radius: var(--radius);
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  position: relative;
  transition: box-shadow 0.2s, border-color 0.2s;
}

.paywall-plan--featured {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(242,140,40,0.2);
}

.plan-badge {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--primary);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 4px 14px;
  border-radius: 20px;
  white-space: nowrap;
  font-family: var(--font);
  letter-spacing: 0.03em;
}

.plan-name {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}

.plan-price {
  font-size: 1.9rem;
  font-weight: 900;
  color: var(--primary);
  line-height: 1.1;
}

.plan-price small {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.plan-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 4px;
}

/* ==================== SÚGÓ KÉPERNYŐ ==================== */

#screen-help {
  padding-bottom: 80px;
}

.help-section {
  margin-bottom: 20px;
}

.help-section-title {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
  padding-left: 2px;
}

.help-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.6;
}

.help-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
}
.help-step:last-child { margin-bottom: 0; }

.help-step-num {
  min-width: 26px;
  height: 26px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 0.82rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.help-list {
  padding-left: 18px;
  margin-top: 8px;
}
.help-list li {
  margin-bottom: 6px;
}

.faq-item {
  border-bottom: 1px solid #f0ebe4;
  padding-bottom: 12px;
  margin-bottom: 12px;
}
.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.faq-q {
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 4px;
}
.faq-a {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.help-textarea {
  width: 100%;
  border: 1.5px solid #e2d9ce;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 0.9rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  background: var(--bg);
  color: var(--text);
}
.help-textarea:focus {
  border-color: var(--primary);
}

.help-msg-status {
  font-size: 0.85rem;
  min-height: 18px;
  margin-top: 4px;
}
