/* ============================================================
   Visual Math Kids - Toán vui cùng bé
   Bright, playful style for kindergarten & elementary
   ============================================================ */

:root {
  --mk-pink: #ff6b9d;
  --mk-orange: #ffa45c;
  --mk-yellow: #ffd93d;
  --mk-green: #6bcb77;
  --mk-blue: #4d96ff;
  --mk-purple: #a78bfa;
  --mk-red: #ff5252;
  --mk-bg: #fff8f0;
  --mk-card: #ffffff;
  --mk-text: #2b2b3a;
  --mk-shadow: 0 6px 0 rgba(0,0,0,0.08), 0 12px 24px rgba(0,0,0,0.06);
}

#mk-hero,
#mk-features,
#mk-game,
#mk-how,
#mk-faq,
#mk-cta {
  font-family: 'Baloo 2', 'Montserrat', system-ui, sans-serif;
  color: var(--mk-text);
}

/* ================ Hero ================ */
#mk-hero {
  position: relative;
  background: linear-gradient(135deg, #ffe0ec 0%, #fff0d3 50%, #d6f3ff 100%);
  padding: 80px 0 60px;
  overflow: hidden;
}
.mk-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.mk-float {
  position: absolute;
  font-size: 48px;
  opacity: 0.55;
  animation: mkFloat 7s ease-in-out infinite;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
}
.mk-float-1 { top: 8%;  left: 6%;  animation-delay: 0s; }
.mk-float-2 { top: 15%; right: 8%; animation-delay: 1s; font-size: 56px; }
.mk-float-3 { top: 60%; left: 10%; animation-delay: 2s; }
.mk-float-4 { top: 70%; right: 15%; animation-delay: 0.5s; font-size: 60px; }
.mk-float-5 { top: 30%; left: 45%; animation-delay: 3s; font-size: 40px; }
.mk-float-6 { top: 85%; left: 50%; animation-delay: 1.5s; font-size: 52px; }
.mk-float-7 { top: 12%; left: 30%; animation-delay: 2.5s; font-size: 44px; }
.mk-float-8 { top: 50%; right: 5%;  animation-delay: 1.2s; font-size: 48px; }

@keyframes mkFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-25px) rotate(8deg); }
}

.mk-hero-content { position: relative; text-align: center; max-width: 900px; margin: 0 auto; }
.mk-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--mk-yellow);
  color: #6b4f00;
  padding: 8px 18px; border-radius: 50px;
  font-weight: 700; font-size: 0.95rem;
  box-shadow: 0 4px 0 #d4a800;
  margin-bottom: 20px;
}
#mk-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 16px;
  color: var(--mk-text);
}
.mk-rainbow-text {
  display: block;
  background: linear-gradient(90deg, #ff6b9d, #ffa45c, #ffd93d, #6bcb77, #4d96ff, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-top: 8px;
  font-size: 0.85em;
  animation: mkRainbow 4s linear infinite;
  background-size: 200% 100%;
}
@keyframes mkRainbow {
  to { background-position: 200% center; }
}
.mk-hero-subtitle {
  font-size: 1.15rem;
  max-width: 700px;
  margin: 0 auto 28px;
  color: #555;
  line-height: 1.6;
}
.mk-hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin-bottom: 36px; }
.mk-btn-play, .mk-btn-learn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  font-weight: 800;
  font-size: 1.1rem;
  border-radius: 50px;
  text-decoration: none;
  transition: transform .15s ease;
  border: none; cursor: pointer;
}
.mk-btn-play {
  background: linear-gradient(135deg, #ff6b9d, #ff5252);
  color: white;
  box-shadow: 0 6px 0 #c2185b, 0 10px 18px rgba(255,82,82,0.3);
}
.mk-btn-play:hover { transform: translateY(-3px); }
.mk-btn-play:active { transform: translateY(2px); box-shadow: 0 2px 0 #c2185b; }
.mk-btn-learn {
  background: white;
  color: var(--mk-blue);
  box-shadow: 0 6px 0 #b6dafb;
  border: 2px solid #b6dafb;
}
.mk-btn-learn:hover { transform: translateY(-3px); }

.mk-hero-stats { display: flex; justify-content: center; flex-wrap: wrap; gap: 30px; margin-top: 20px; }
.mk-stat {
  display: flex; flex-direction: column; align-items: center;
  background: white;
  padding: 16px 28px;
  border-radius: 20px;
  box-shadow: var(--mk-shadow);
  min-width: 140px;
}
.mk-stat-emoji { font-size: 2rem; margin-bottom: 4px; }
.mk-stat-number { font-size: 1.6rem; font-weight: 800; color: var(--mk-pink); }
.mk-stat-label { font-size: 0.85rem; color: #666; }

/* ================ Features ================ */
#mk-features { padding: 80px 0; background: white; }
.mk-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 40px;
}
.mk-feature-card {
  background: var(--mk-card);
  border-radius: 24px;
  padding: 28px 22px;
  text-align: center;
  border: 3px solid #f0f0f5;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.mk-feature-card:hover {
  transform: translateY(-6px) rotate(-1deg);
  box-shadow: var(--mk-shadow);
  border-color: var(--mk-yellow);
}
.mk-feature-emoji {
  font-size: 4rem;
  margin-bottom: 12px;
  display: inline-block;
  animation: mkBounce 2.5s ease-in-out infinite;
}
.mk-feature-card h3 { font-size: 1.3rem; font-weight: 800; margin: 8px 0; }
.mk-feature-card p { color: #666; line-height: 1.6; font-size: 0.95rem; }

@keyframes mkBounce {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-8px); }
}
.mk-bounce {
  display: inline-block;
  animation: mkBounce 1.5s ease-in-out infinite;
}

/* ================ Game ================ */
#mk-game {
  padding: 60px 0 80px;
  background: linear-gradient(180deg, #fff0f6 0%, #e0f7ff 100%);
}
.mk-game-wrap {
  max-width: 1000px;
  margin: 30px auto 0;
  background: white;
  border-radius: 32px;
  padding: 24px;
  box-shadow: 0 20px 50px rgba(80, 80, 200, 0.15);
  position: relative;
  overflow: hidden;
}

.mk-status-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.mk-status-item {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #fff8f0, #ffe8d6);
  padding: 12px 16px;
  border-radius: 18px;
  border: 3px solid #ffd6b3;
  font-family: inherit;
  cursor: default;
}
.mk-status-item.mk-streak { background: linear-gradient(135deg, #fff5f5, #ffd6d6); border-color: #ffaaaa; }
.mk-status-item.mk-stars-earned { background: linear-gradient(135deg, #fffbe6, #fff0a8); border-color: #ffd93d; }
.mk-status-item.mk-sound-btn {
  background: linear-gradient(135deg, #f0f4ff, #d8e4ff);
  border-color: #a8baff;
  cursor: pointer;
  justify-content: center;
}
.mk-status-item.mk-sound-btn:hover { transform: scale(1.05); }
.mk-status-emoji { font-size: 1.8rem; }
.mk-status-info { display: flex; flex-direction: column; line-height: 1.1; }
.mk-status-label { font-size: 0.75rem; color: #666; }
.mk-status-value { font-size: 1.4rem; font-weight: 800; color: var(--mk-text); }

.mk-config-bar {
  display: flex; flex-direction: column; gap: 14px;
  background: #fafbff;
  padding: 16px;
  border-radius: 20px;
  border: 2px dashed #d0d4f0;
  margin-bottom: 20px;
}
.mk-config-group { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.mk-config-group > label {
  font-weight: 800;
  color: var(--mk-text);
  min-width: 110px;
}
.mk-modes, .mk-levels { display: flex; flex-wrap: wrap; gap: 8px; }
.mk-mode-btn, .mk-level-btn {
  padding: 8px 14px;
  border: 2px solid transparent;
  border-radius: 50px;
  background: white;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 2px 0 #ddd;
  color: #555;
}
.mk-mode-btn:hover, .mk-level-btn:hover { transform: translateY(-2px); }
.mk-mode-btn.active {
  background: var(--mk-pink); color: white;
  border-color: var(--mk-pink);
  box-shadow: 0 3px 0 #c2185b;
}
.mk-level-btn.active {
  background: var(--mk-blue); color: white;
  border-color: var(--mk-blue);
  box-shadow: 0 3px 0 #1565c0;
}

/* ================ Stage ================ */
.mk-stage {
  background: linear-gradient(180deg, #fff 0%, #f0faff 100%);
  border-radius: 24px;
  padding: 24px 20px;
  border: 3px solid #d8eaff;
  position: relative;
  min-height: 380px;
}

/* Mascot */
.mk-mascot {
  display: flex; align-items: flex-start; gap: 14px;
  margin-bottom: 20px;
}
.mk-mascot-emoji {
  font-size: 4rem;
  background: linear-gradient(135deg, #fff8e0, #ffe8a8);
  width: 80px; height: 80px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 4px solid #ffd93d;
  flex-shrink: 0;
  animation: mkWiggle 4s ease-in-out infinite;
}
@keyframes mkWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-6deg); }
  75% { transform: rotate(6deg); }
}
.mk-bubble {
  position: relative;
  background: white;
  padding: 14px 18px;
  border-radius: 18px;
  border: 3px solid #ffd93d;
  font-weight: 600;
  font-size: 1.05rem;
  flex: 1;
  align-self: center;
  box-shadow: 0 3px 0 #d4a800;
}
.mk-bubble::before {
  content: '';
  position: absolute;
  left: -14px; top: 50%; transform: translateY(-50%);
  border: 12px solid transparent;
  border-right-color: #ffd93d;
}
.mk-bubble::after {
  content: '';
  position: absolute;
  left: -10px; top: 50%; transform: translateY(-50%);
  border: 10px solid transparent;
  border-right-color: white;
}

/* Question area */
.mk-question-area { text-align: center; }
.mk-question {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 800;
  color: var(--mk-text);
  margin: 12px 0;
  min-height: 70px;
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center;
}
.mk-q-prompt { font-size: 1.2rem; color: #666; font-weight: 600; }
.mk-q-num {
  display: inline-block;
  background: linear-gradient(135deg, var(--mk-pink), var(--mk-orange));
  color: white;
  padding: 4px 18px;
  border-radius: 16px;
  min-width: 56px;
  text-align: center;
  box-shadow: 0 4px 0 rgba(0,0,0,0.1);
}
.mk-q-op {
  color: var(--mk-purple);
  font-weight: 800;
}
.mk-q-eq {
  color: #888;
}
.mk-q-blank {
  display: inline-block;
  min-width: 60px;
  padding: 4px 16px;
  background: #fff8e0;
  border: 3px dashed #ffd93d;
  border-radius: 16px;
  color: #d4a800;
}

/* Visual objects (apples, stars) */
.mk-visual {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
  gap: 8px;
  margin: 18px auto;
  max-width: 600px;
  min-height: 60px;
}
.mk-visual-item {
  font-size: 2.5rem;
  display: inline-block;
  animation: mkPop .35s ease;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.1));
}
.mk-visual-group {
  display: inline-flex; flex-wrap: wrap; justify-content: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 18px;
  background: #fff8e0;
  border: 3px solid #ffd93d;
}
.mk-visual-group.mk-group-blue { background: #eaf3ff; border-color: #4d96ff; }
.mk-visual-group.mk-group-pink { background: #ffe6f0; border-color: #ff6b9d; }
.mk-visual-plus, .mk-visual-eq {
  font-size: 2rem;
  font-weight: 800;
  color: var(--mk-purple);
  margin: 0 4px;
}
@keyframes mkPop {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Answer choices */
.mk-answers {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 14px;
  max-width: 600px;
  margin: 20px auto 0;
}
.mk-answer-btn {
  padding: 22px 12px;
  font-size: 2rem;
  font-weight: 800;
  font-family: inherit;
  background: white;
  color: var(--mk-text);
  border: 3px solid #d8eaff;
  border-radius: 22px;
  cursor: pointer;
  transition: all .15s ease;
  box-shadow: 0 6px 0 #c0d8f5;
  user-select: none;
}
.mk-answer-btn:hover:not(:disabled) {
  transform: translateY(-3px);
  border-color: var(--mk-blue);
  box-shadow: 0 8px 0 #c0d8f5;
}
.mk-answer-btn:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 1px 0 #c0d8f5;
}
.mk-answer-btn:disabled { cursor: not-allowed; opacity: 0.7; }
.mk-answer-btn.mk-correct {
  background: linear-gradient(135deg, #6bcb77, #4caf50);
  color: white;
  border-color: #4caf50;
  box-shadow: 0 6px 0 #2e7d32;
  animation: mkCorrectPulse .6s ease;
}
.mk-answer-btn.mk-wrong {
  background: linear-gradient(135deg, #ff8a8a, #ff5252);
  color: white;
  border-color: #ff5252;
  box-shadow: 0 6px 0 #b71c1c;
  animation: mkShake .4s ease;
}
@keyframes mkCorrectPulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.1); }
}
@keyframes mkShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Feedback */
.mk-feedback {
  margin-top: 18px;
  font-size: 1.4rem;
  font-weight: 800;
  min-height: 36px;
  text-align: center;
}
.mk-feedback.mk-fb-correct { color: var(--mk-green); }
.mk-feedback.mk-fb-wrong   { color: var(--mk-red); }

/* Controls */
.mk-controls {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 12px;
  margin-top: 24px;
}
.mk-control-btn {
  padding: 12px 22px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 800;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease;
}
.mk-control-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mk-control-btn:hover:not(:disabled) { transform: translateY(-2px); }
.mk-start-btn {
  background: linear-gradient(135deg, #6bcb77, #4caf50);
  color: white;
  box-shadow: 0 4px 0 #2e7d32;
}
.mk-skip-btn {
  background: linear-gradient(135deg, #ffd93d, #ffa45c);
  color: #6b4f00;
  box-shadow: 0 4px 0 #d4a800;
}
.mk-reset-btn {
  background: white;
  color: #777;
  border: 2px solid #ddd;
  box-shadow: 0 4px 0 #ccc;
}

/* Confetti */
.mk-confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.mk-confetti-piece {
  position: absolute;
  width: 10px; height: 14px;
  border-radius: 2px;
  top: -20px;
  animation: mkConfettiFall linear forwards;
}
@keyframes mkConfettiFall {
  to {
    transform: translateY(120vh) rotate(720deg);
    opacity: 0.4;
  }
}

/* ================ How To Play ================ */
#mk-how {
  padding: 70px 0;
  background: white;
}
.mk-steps {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 20px;
  margin-top: 40px;
}
.mk-step {
  flex: 1 1 220px;
  max-width: 280px;
  background: linear-gradient(180deg, #fff 0%, #fff8f0 100%);
  border-radius: 24px;
  padding: 24px 20px;
  text-align: center;
  border: 3px solid #ffe0c0;
  position: relative;
}
.mk-step-bubble {
  position: absolute;
  top: -18px; left: 50%; transform: translateX(-50%);
  width: 36px; height: 36px;
  background: var(--mk-pink);
  color: white;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800;
  border: 3px solid white;
}
.mk-step-emoji { font-size: 3.5rem; margin: 12px 0 8px; }
.mk-step h3 { font-weight: 800; font-size: 1.2rem; margin-bottom: 6px; }
.mk-step p  { color: #666; font-size: 0.95rem; line-height: 1.5; }
.mk-step-arrow {
  font-size: 2rem;
  color: var(--mk-pink);
  font-weight: 800;
}

/* ================ FAQ ================ */
#mk-faq { padding: 70px 0; background: #f7f9fc; }

/* ================ CTA ================ */
#mk-cta {
  padding: 70px 0;
  background: linear-gradient(135deg, var(--mk-pink), var(--mk-purple));
  text-align: center;
  color: white;
}
.mk-cta-content h2 { font-size: 2.2rem; font-weight: 800; margin-bottom: 14px; color: white; }
.mk-cta-content p  { font-size: 1.1rem; max-width: 700px; margin: 0 auto 28px; opacity: 0.95; }
.mk-cta-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.mk-cta-actions .btn-outline {
  background: transparent; color: white; border: 2px solid white;
}
.mk-cta-actions .btn-outline:hover { background: white; color: var(--mk-purple); }

/* ================ Responsive ================ */
@media (max-width: 768px) {
  .mk-status-bar { grid-template-columns: repeat(2, 1fr); }
  .mk-config-group { flex-direction: column; align-items: stretch; }
  .mk-config-group > label { min-width: auto; text-align: center; }
  .mk-modes, .mk-levels { justify-content: center; }
  .mk-mascot-emoji { width: 64px; height: 64px; font-size: 3rem; }
  .mk-bubble { font-size: 0.95rem; padding: 10px 14px; }
  .mk-question { font-size: 2.2rem; }
  .mk-step-arrow { transform: rotate(90deg); }
  #mk-hero { padding: 60px 0 40px; }
  .mk-float { font-size: 32px !important; }
}
@media (max-width: 480px) {
  .mk-status-bar { grid-template-columns: 1fr 1fr; }
  .mk-answers { grid-template-columns: repeat(2, 1fr); }
  .mk-answer-btn { padding: 18px 10px; font-size: 1.6rem; }
  .mk-visual-item { font-size: 2rem; }
}

/* ================ Nav dropdown helpers (used in header) ================ */
.nav-dropdown-section {
  padding: 8px 16px 4px;
  font-size: 0.78rem;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 700;
  pointer-events: none;
}
.nav-dropdown-divider {
  height: 1px;
  background: #eee;
  margin: 4px 12px;
  pointer-events: none;
}
.nav-dropdown-active {
  background: linear-gradient(135deg, #fff0f6, #ffe8e0) !important;
  color: var(--mk-pink) !important;
  font-weight: 700 !important;
}
