/* Mateus Miguel Learning Garden */
:root {
  --ml-sky-top: #9ad7ff;
  --ml-sky-bottom: #c8f5d1;
  --ml-leaf: #1f7a4c;
  --ml-leaf-deep: #145c38;
  --ml-sun: #ffd166;
  --ml-coral: #ff6b4a;
  --ml-coral-deep: #e84e2c;
  --ml-ink: #1d3557;
  --ml-card: rgba(255, 255, 255, 0.92);
  --ml-shadow: 0 12px 28px rgba(29, 53, 87, 0.18);
  --ml-radius: 1.35rem;
  --ml-font-display: "Fredoka", "Nunito", sans-serif;
  --ml-font-body: "Nunito", "Fredoka", sans-serif;
}

html,
body.ml-fullscreen-body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  height: 100%;
}

body,
body.ml-fullscreen-body {
  background: linear-gradient(165deg, var(--ml-sky-top) 0%, #b8e8ff 42%, var(--ml-sky-bottom) 100%) fixed !important;
  min-height: 100vh;
}

body.ml-fullscreen-body {
  overflow-x: hidden;
}

.intro-header {
  display: none;
}

#mateus-app {
  font-family: var(--ml-font-body);
  color: var(--ml-ink);
  width: 100%;
  max-width: none;
  min-height: 100vh;
  margin: 0;
  padding: clamp(0.75rem, 2vw, 1.5rem);
  position: relative;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.ml-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.ml-floaters {
  pointer-events: none;
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.ml-floater {
  position: absolute;
  font-size: clamp(1.5rem, 4vw, 2.4rem);
  opacity: 0.22;
  animation: ml-drift 9s ease-in-out infinite;
}

.ml-floater:nth-child(1) { top: 8%; left: 6%; animation-delay: 0s; }
.ml-floater:nth-child(2) { top: 18%; right: 8%; animation-delay: 1.2s; }
.ml-floater:nth-child(3) { top: 55%; left: 4%; animation-delay: 2s; }
.ml-floater:nth-child(4) { bottom: 12%; right: 10%; animation-delay: 0.6s; }
.ml-floater:nth-child(5) { top: 70%; left: 40%; animation-delay: 1.8s; }

@keyframes ml-drift {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-14px) rotate(5deg); }
}

.ml-topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.ml-topbar-centered {
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  gap: 0.85rem;
}

.ml-topbar-centered .ml-brand {
  align-items: center;
  width: 100%;
  max-width: 46rem;
}

.ml-topbar-centered .ml-controls {
  position: absolute;
  top: 0;
  right: 0;
}

.ml-home-link {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ml-leaf-deep);
  text-decoration: none;
  background: var(--ml-card);
  border-radius: 999px;
  padding: 0.45rem 0.85rem;
  box-shadow: var(--ml-shadow);
}

.ml-home-link:hover {
  color: var(--ml-coral-deep);
  text-decoration: none;
}

.ml-section-title {
  font-family: var(--ml-font-display);
  font-size: clamp(1.35rem, 4vw, 1.8rem);
  margin: 0.25rem 0 0.35rem;
}

.ml-section-sub {
  margin: 0 0 1rem;
  font-weight: 700;
  opacity: 0.78;
}

.ml-hello-banner {
  display: grid;
  gap: 0.45rem;
  margin-bottom: 1.1rem;
  padding: 0.9rem 1rem;
  border-radius: var(--ml-radius);
  background: linear-gradient(120deg, #fff7d6, #e8fff1 55%, #dff3ff);
}

.ml-hello-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 3.5vw, 1.45rem);
}

.ml-hello-flag {
  font-size: 1.35rem;
}

.ml-lang-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
}

.ml-lang-card {
  border: 0;
  text-align: center;
  background: linear-gradient(180deg, #fff 0%, #f3fff7 100%);
  border-radius: var(--ml-radius);
  padding: 1.2rem 1rem 1.3rem;
  box-shadow: 0 8px 0 rgba(31, 122, 76, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 9rem;
}

.ml-lang-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 rgba(31, 122, 76, 0.18);
}

.ml-lang-card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(31, 122, 76, 0.18);
}

.ml-lang-card-flag {
  display: block;
  font-size: 2.6rem;
  margin-bottom: 0.35rem;
}

.ml-lang-card-name {
  display: block;
  font-family: var(--ml-font-display);
  font-size: 1.4rem;
  font-weight: 700;
}

.ml-lang-card-hello {
  display: block;
  margin-top: 0.35rem;
  font-weight: 700;
  opacity: 0.75;
}

.ml-lang-pill {
  font-family: var(--ml-font-display);
  font-weight: 700;
  background: #e8f7ee;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.ml-scoreboard {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.ml-score-chip {
  font-family: var(--ml-font-display);
  font-weight: 700;
  background: #fff3cd;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.95rem;
}

.ml-score-chip.ml-score-main {
  background: #d8f8e3;
  font-size: 1.05rem;
}

.ml-score-chip strong {
  font-size: 1.1em;
}

.ml-brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.ml-kicker {
  font-family: var(--ml-font-display);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  color: var(--ml-leaf-deep);
}

.ml-title {
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: clamp(1.7rem, 5vw, 2.5rem);
  line-height: 1.1;
  margin: 0;
  color: var(--ml-ink);
  text-align: center;
}

.ml-subtitle {
  margin: 0.2rem 0 0;
  font-weight: 700;
  font-size: 1rem;
  opacity: 0.85;
  text-align: center;
}

.ml-subtitle-hero {
  margin: 0.85rem auto 0;
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: clamp(1.45rem, 4.8vw, 2.15rem);
  line-height: 1.25;
  color: var(--ml-ink);
  opacity: 1;
  max-width: 40rem;
  text-align: center;
  text-wrap: balance;
}

.ml-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.ml-lang {
  display: inline-flex;
  background: var(--ml-card);
  border-radius: 999px;
  padding: 0.25rem;
  box-shadow: var(--ml-shadow);
  gap: 0.2rem;
}

.ml-lang button {
  border: 0;
  background: transparent;
  font-family: var(--ml-font-display);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  color: var(--ml-ink);
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease;
}

.ml-lang button:hover {
  transform: translateY(-1px);
}

.ml-lang button.active {
  background: var(--ml-leaf);
  color: #fff;
}

.ml-icon-btn {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  border-radius: 50%;
  background: var(--ml-card);
  box-shadow: var(--ml-shadow);
  font-size: 1.2rem;
  cursor: pointer;
  transition: transform 0.12s ease;
}

.ml-icon-btn:hover {
  transform: scale(1.06);
}

.ml-icon-btn:active {
  transform: scale(0.96);
}

.ml-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--ml-card);
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font-family: var(--ml-font-display);
  font-weight: 700;
  box-shadow: var(--ml-shadow);
}

.ml-panel {
  background: var(--ml-card);
  border-radius: calc(var(--ml-radius) + 0.35rem);
  box-shadow: var(--ml-shadow);
  padding: clamp(1rem, 3vw, 1.75rem);
  position: relative;
  overflow: hidden;
}

.ml-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 0.45rem;
  background: linear-gradient(90deg, var(--ml-sun), var(--ml-coral), var(--ml-leaf));
}

.ml-modes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 0.9rem;
  margin-top: 0.5rem;
}

.ml-mode-card {
  border: 0;
  text-align: left;
  background: linear-gradient(180deg, #fff 0%, #f3fff7 100%);
  border-radius: var(--ml-radius);
  padding: 1.1rem 1rem 1.2rem;
  box-shadow: 0 8px 0 rgba(31, 122, 76, 0.18);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  min-height: 8.5rem;
}

.ml-mode-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 0 rgba(31, 122, 76, 0.18);
}

.ml-mode-card:active {
  transform: translateY(2px);
  box-shadow: 0 4px 0 rgba(31, 122, 76, 0.18);
}

.ml-mode-emoji {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 0.45rem;
  animation: ml-wiggle 2.8s ease-in-out infinite;
}

.ml-mode-card:nth-child(2) .ml-mode-emoji { animation-delay: 0.2s; }
.ml-mode-card:nth-child(3) .ml-mode-emoji { animation-delay: 0.4s; }
.ml-mode-card:nth-child(4) .ml-mode-emoji { animation-delay: 0.6s; }
.ml-mode-card:nth-child(5) .ml-mode-emoji { animation-delay: 0.8s; }

@keyframes ml-wiggle {
  0%, 100% { transform: rotate(-3deg); }
  50% { transform: rotate(4deg) scale(1.05); }
}

.ml-mode-title {
  font-family: var(--ml-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
}

.ml-mode-desc {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  opacity: 0.78;
  line-height: 1.35;
}

.ml-game-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.ml-back {
  border: 0;
  background: #e8f7ee;
  color: var(--ml-leaf-deep);
  font-family: var(--ml-font-display);
  font-weight: 700;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
}

.ml-progress {
  font-family: var(--ml-font-display);
  font-weight: 700;
  background: #fff3cd;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
}

.ml-prompt {
  text-align: center;
  margin: 0.5rem 0 1.25rem;
}

.ml-prompt h2 {
  font-family: var(--ml-font-display);
  font-size: clamp(1.35rem, 4vw, 1.9rem);
  margin: 0 0 0.35rem;
}

.ml-prompt p {
  margin: 0;
  font-weight: 700;
  opacity: 0.8;
}

.ml-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto 1.25rem;
  min-height: 180px;
}

.ml-hero-emoji {
  font-size: clamp(4.5rem, 16vw, 7rem);
  line-height: 1;
  filter: drop-shadow(0 10px 0 rgba(29, 53, 87, 0.08));
  animation: ml-pop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ml-hero-letter,
.ml-hero-number {
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: clamp(4.5rem, 18vw, 7.5rem);
  line-height: 1;
  color: var(--ml-coral);
  text-shadow: 0 8px 0 rgba(232, 78, 44, 0.18);
  animation: ml-pop-in 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.ml-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  max-width: 520px;
}

.ml-count-row span {
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  animation: ml-pop-in 0.4s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}

@keyframes ml-pop-in {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.ml-speak {
  border: 0;
  background: var(--ml-sun);
  color: var(--ml-ink);
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 999px;
  padding: 0.7rem 1.2rem;
  cursor: pointer;
  box-shadow: 0 6px 0 #e0b03f;
}

.ml-speak:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 #e0b03f;
}

.ml-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.ml-choice {
  border: 0;
  min-height: 5.5rem;
  border-radius: var(--ml-radius);
  background: #fff;
  box-shadow: 0 7px 0 rgba(29, 53, 87, 0.12);
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--ml-ink);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
  padding: 0.8rem;
}

.ml-choice.emoji {
  font-size: clamp(2.4rem, 8vw, 3.2rem);
}

.ml-choice:hover {
  transform: translateY(-3px);
}

.ml-choice:active {
  transform: translateY(3px);
  box-shadow: 0 3px 0 rgba(29, 53, 87, 0.12);
}

.ml-choice.correct {
  background: #b7f7c8;
  animation: ml-bounce 0.45s ease;
}

.ml-choice.wrong {
  background: #ffd0c6;
  animation: ml-shake 0.4s ease;
}

@keyframes ml-bounce {
  0%, 100% { transform: scale(1); }
  40% { transform: scale(1.08); }
  70% { transform: scale(0.96); }
}

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

.ml-feedback {
  text-align: center;
  min-height: 2rem;
  margin-top: 1rem;
  font-family: var(--ml-font-display);
  font-weight: 700;
  font-size: 1.25rem;
}

.ml-feedback.good { color: var(--ml-leaf-deep); }
.ml-feedback.bad { color: var(--ml-coral-deep); }

.ml-celebration {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 50;
  overflow: hidden;
}

.ml-confetti {
  position: absolute;
  top: -10px;
  font-size: 1.5rem;
  animation: ml-fall 1.6s linear forwards;
}

@keyframes ml-fall {
  to {
    transform: translateY(110vh) rotate(420deg);
    opacity: 0.2;
  }
}

.ml-tip {
  margin-top: 1rem;
  text-align: center;
  font-weight: 700;
  opacity: 0.75;
}

@media (max-width: 600px) {
  #mateus-app {
    padding: 0.75rem 0.75rem 2.5rem;
  }

  .ml-lang button {
    padding: 0.5rem 0.65rem;
    font-size: 0.85rem;
  }

  .ml-choice {
    min-height: 4.75rem;
  }
}
