:root {
  --green: #14924a;
  --green-deep: #0b6b34;
  --yellow: #ffd23f;
  --blue: #2e86de;
  --pink: #ff6b9d;
  --orange: #ff8a3d;
  --purple: #7b61ff;
  --cream: #fff8e8;
  --ink: #163024;
  --muted: #4d6a58;
  --card: #ffffff;
  --shadow: 0 12px 30px rgba(20, 80, 40, 0.14);
  --radius: 22px;
  --kid: #1b9a4a;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #b7f0c8 0%, transparent 50%),
    radial-gradient(900px 500px at 110% 0%, #ffe08a 0%, transparent 46%),
    linear-gradient(180deg, #e8fff2 0%, #fff6d8 48%, #d9f3ff 100%);
  background-attachment: fixed;
}

img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, .brand { font-family: "Fredoka", "Nunito", sans-serif; }

.app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 16px 96px;
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.logo-mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: linear-gradient(135deg, var(--green), #20c997);
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 18px;
  box-shadow: var(--shadow);
}
.brand-wrap { flex: 1; min-width: 0; }
.brand { font-size: 22px; line-height: 1; color: var(--green-deep); }
.brand span { color: var(--blue); }
.tag { font-size: 12px; color: var(--muted); font-weight: 700; }
.stars-pill {
  background: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 6px;
}

.hero-banner {
  background: linear-gradient(135deg, #0f8a45, #2e86de 70%);
  color: #fff;
  border-radius: 28px;
  padding: 22px 20px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.hero-banner:after {
  content: "";
  position: absolute; right: -30px; top: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: rgba(255,210,63,.25);
}
.hero-banner h2 { font-size: 26px; margin: 6px 0 4px; }
.hero-banner p { opacity: .92; font-weight: 700; max-width: 36ch; }
.mascot-row {
  display: flex; gap: 10px; margin-top: 14px; align-items: flex-end;
}
.mascot-row img {
  width: 86px; height: 86px; object-fit: cover;
  border-radius: 22px; border: 3px solid #fff;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
}

.section-title {
  display: flex; align-items: baseline; justify-content: space-between;
  margin: 8px 2px 12px;
}
.section-title h3 { font-size: 20px; }
.section-title small { color: var(--muted); font-weight: 800; }

.grid { display: grid; gap: 12px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-worlds {
  grid-template-columns: repeat(2, 1fr);
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.kid-card {
  text-align: left;
  padding: 0;
  color: inherit;
  border: 3px solid transparent;
  transition: transform .15s ease, border-color .15s ease;
}
.kid-card:active { transform: scale(.98); }
.kid-card img.hero {
  width: 100%; height: 210px; object-fit: cover; object-position: center 18%;
}
.kid-card .meta { padding: 12px 12px 14px; }
.kid-card .name { font-family: Fredoka, Nunito, sans-serif; font-size: 20px; }
.kid-card .role { font-size: 13px; font-weight: 800; opacity: .8; }
.kid-card.selected { border-color: var(--kid); }

.level-btn, .world-btn, .primary, .ghost, .listen, .nav-btn {
  border-radius: 16px;
}
.level-btn {
  background: #fff;
  padding: 14px;
  text-align: left;
  box-shadow: var(--shadow);
}
.level-btn b { display: block; font-size: 16px; }
.level-btn span { color: var(--muted); font-size: 13px; font-weight: 700; }
.level-btn.active { outline: 3px solid var(--green); }

.world-btn {
  background: #fff;
  padding: 14px 12px 12px;
  text-align: left;
  box-shadow: var(--shadow);
  min-height: 112px;
  display: flex; flex-direction: column; gap: 4px;
  position: relative;
}
.world-btn .ico { font-size: 28px; }
.world-btn b { font-size: 16px; }
.world-btn em { font-style: normal; color: var(--muted); font-size: 12px; font-weight: 800; }
.world-btn.locked { opacity: .55; }
.lock { position: absolute; top: 10px; right: 10px; font-size: 14px; }

.who {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 999px; padding: 6px 12px 6px 6px;
  box-shadow: var(--shadow);
}
.who img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.who b { font-size: 14px; display: block; line-height: 1.1; }
.who small { color: var(--muted); font-weight: 800; }

.item-card {
  padding: 18px 16px 16px;
  text-align: center;
}
.item-emoji { font-size: 64px; line-height: 1; margin: 6px 0 8px; }
.item-pt {
  font-family: Fredoka, Nunito, sans-serif;
  font-size: 34px;
  color: var(--green-deep);
  line-height: 1.1;
}
.item-en { color: var(--muted); font-weight: 800; margin-top: 4px; }
.item-extra {
  margin-top: 10px;
  background: #f3fff6;
  border-radius: 14px;
  padding: 8px;
  font-weight: 800;
}

.listen {
  margin-top: 14px;
  width: 100%;
  background: linear-gradient(135deg, var(--green), #20c997);
  color: #fff;
  font-weight: 800;
  padding: 14px;
  font-size: 18px;
  box-shadow: 0 8px 0 var(--green-deep);
}
.listen:active { transform: translateY(2px); box-shadow: 0 6px 0 var(--green-deep); }

.row-actions { display: flex; gap: 10px; margin-top: 12px; }
.nav-btn {
  flex: 1;
  background: #fff;
  padding: 12px;
  font-weight: 800;
  box-shadow: var(--shadow);
}
.primary {
  background: var(--yellow);
  color: #163024;
  font-weight: 800;
  padding: 14px 16px;
  box-shadow: 0 8px 0 #e0b000;
}
.ghost {
  background: #fff;
  font-weight: 800;
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.quiz-options { display: grid; gap: 10px; margin-top: 14px; }
.opt {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  font-weight: 800;
  font-size: 20px;
  box-shadow: var(--shadow);
  border: 3px solid transparent;
}
.opt.good { border-color: var(--green); background: #e9ffef; }
.opt.bad { border-color: #e85d4c; background: #ffece9; }

.progress-bar {
  height: 10px; background: #e6efe8; border-radius: 99px; overflow: hidden; margin: 10px 0 14px;
}
.progress-bar > i {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--yellow), var(--green));
}

.tip {
  background: #fff7d6;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 700;
  color: #5a4a12;
  margin-bottom: 12px;
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 24px rgba(0,0,0,.08);
  max-width: 980px;
  margin: 0 auto;
}
.bottom-nav button {
  padding: 6px 4px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}
.bottom-nav button.on { color: var(--green-deep); }
.bottom-nav .ico { display: block; font-size: 20px; }

.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--muted); font-weight: 700; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }

.confetti {
  position: fixed; inset: 0; pointer-events: none; z-index: 40;
}

.splash {
  min-height: 78vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; padding: 20px;
}
.splash img.logo-pair { width: min(100%, 420px); height: 180px; object-fit: cover; border-radius: 28px; }
.flag { font-size: 28px; }

@media (min-width: 720px) {
  .grid-worlds { grid-template-columns: repeat(3, 1fr); }
  .kid-card img.hero { height: 260px; }
  .item-pt { font-size: 42px; }
}
