@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 500 800;
  font-display: optional;
  src: url('fonts/nunito-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
:root { font-family: 'Nunito', sans-serif; color: #123c5a; font-synthesis: none; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; scrollbar-width: none; -ms-overflow-style: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }
body { background: #7eb8e8; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
button, a { touch-action: manipulation; }
a { color: inherit; text-decoration: none; }
button:focus-visible, a:focus-visible { outline: 3px solid #087a9d; outline-offset: 3px; }

.app-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #7eb8e8;
  background-image: url('learn-bg.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}

.app-screen {
  position: relative;
  z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(152px + env(safe-area-inset-top)) clamp(18px, 6.4vw, 110px) 40px;
  background: transparent;
}

#nav-mount {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  min-height: 56px;
  overflow: visible;
  isolation: isolate;
  padding: calc(18px + env(safe-area-inset-top)) clamp(18px, 6.4vw, 110px) 8px;
  background: transparent;
}
.nav-sky {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: #7eb8e8;
}
.nav-sky::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;
  background-color: #7eb8e8;
  background-image: url('learn-bg.png');
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
}
.topbar {
  position: relative;
  z-index: 3;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 14px; width: 100%; min-height: 56px;
  max-width: 1440px; margin-inline: auto;
  padding: 4px 8px;
  background: transparent;
}
.topbar, .topbar * { user-select: none; -webkit-user-select: none; caret-color: transparent; }

.brand {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
  width: 186px; height: 84px;
  overflow: visible;
  z-index: 2;
}
.brand-cloud { display: none; }
.brand-logo {
  position: relative;
  display: block;
  height: 76px;
  width: auto;
}

.nav-toggle { display: none; }
.main-nav {
  display: flex; align-items: center; justify-content: center;
  flex: 0 1 auto;
  gap: 2px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 10px 20px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(16 84 115 / 0.12);
}
.main-nav:not(.is-lesson) {
  align-self: center;
}
.main-nav.is-lesson {
  flex: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  width: max-content;
  max-width: min(760px, 100%);
  padding: 10px 22px 12px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.topbar:has(.main-nav.is-lesson) {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
}
.topbar:has(.main-nav.is-lesson) .brand {
  justify-self: start;
}
.topbar:has(.main-nav.is-lesson) .main-nav.is-lesson {
  grid-column: 2;
  justify-self: center;
  margin: 0;
}
.topbar:has(.main-nav.is-lesson) .account-nav {
  grid-column: 3;
  justify-self: end;
}
.main-nav .lesson-hud-title {
  margin: 0;
  font-family: 'Fredoka', 'Baloo 2', sans-serif;
  font-size: clamp(20px, 3.4vh, 32px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: #002f55;
  text-align: center;
}
.main-nav .lesson-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}
.main-nav .lesson-steps[data-count="12"],
.main-nav .lesson-steps[data-count="24"] { gap: 6px; }
.main-nav .lesson-steps[data-count="12"] .lesson-step,
.main-nav .lesson-steps[data-count="24"] .lesson-step {
  width: 26px;
  height: 26px;
  font-size: 13px;
}
.main-nav .lesson-steps[data-count="24"] { gap: 4px; }
.main-nav .lesson-steps[data-count="24"] .lesson-step {
  width: 22px;
  height: 22px;
  font-size: 11px;
}
.main-nav .lesson-step {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #eef6fb;
  color: #7b8fa3;
  font-family: 'Nunito', sans-serif;
  font-size: 16px;
  font-weight: 800;
  box-shadow: 0 2px 0 rgb(16 84 115 / 0.12);
}
.main-nav .lesson-step.is-current {
  background: #ffd35c;
  color: #6b4a00;
  box-shadow: 0 2px 0 #e0b63d;
}
.main-nav .lesson-step.is-done {
  background: #3ecf62;
  color: #fff;
  box-shadow: 0 2px 0 #2ea24d;
}
.main-nav .lesson-step.is-retry {
  background: #ffd35c;
  color: #6b4a00;
  box-shadow: 0 2px 0 #e0b63d;
}
.main-nav a {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 18px; border-radius: 100px;
  font-weight: 800; font-size: 16px; color: #1d4b6e;
  transition: color 160ms ease, background 160ms ease;
}
.main-nav a:hover { color: #0a6f93; }
.main-nav a.active,
#nav-mount[data-active="learn"] .main-nav a[data-nav="learn"],
#nav-mount[data-active="games"] .main-nav a[data-nav="games"],
#nav-mount[data-active="songs"] .main-nav a[data-nav="songs"],
#nav-mount[data-active="store"] .main-nav a[data-nav="store"],
#nav-mount[data-active="home"] .main-nav a[data-nav="home"] {
  background: #c8eef8;
  color: #1d4b6e;
  box-shadow: none;
}
.nav-icon { display: inline-flex; width: 22px; height: 22px; }
.nav-icon svg { width: 100%; height: 100%; }

.account-nav { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; min-height: 84px; }
.coins {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px;
  padding: 6px 20px;
  border-radius: 100px;
  background: #fff;
  box-shadow: 0 8px 22px rgb(16 84 115 / 0.12);
  font-weight: 800; font-size: 18px; color: #e0a21a;
}
.coins-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
}
.coins-icon img { width: 32px; height: 32px; object-fit: contain; }
.settings {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 48px;
  padding: 6px 20px;
  border-radius: 100px;
  background: #fff;
  color: #1d4b6e;
  font-weight: 800;
  font-size: 16px;
  white-space: nowrap;
  box-shadow: 0 8px 22px rgb(16 84 115 / 0.12);
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.settings:hover { transform: translateY(-1px); box-shadow: 0 10px 24px rgb(16 84 115 / 0.16); }
.settings.active,
#nav-mount[data-active="settings"] .settings {
  background: #c8eef8;
  box-shadow: 0 8px 22px rgb(16 84 115 / 0.12);
}
.settings-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; }
.settings-icon img { width: 100%; height: 100%; object-fit: contain; display: block; }

.learn-main { max-width: 1240px; margin: 0 auto; }

.learn-intro {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  margin-top: 0;
}
.page-title-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0;
  transform: rotate(-2deg);
  transform-origin: 50% 55%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 800;
  font-size: clamp(44px, 6.4vw, 72px);
  line-height: 0.95;
}
.page-title-lockup .title-spark {
  display: block;
  height: 0.75em;
  height: 1cap;
  width: auto;
  flex: none;
  pointer-events: none;
}
.page-title-lockup .title-spark-left { margin-right: 0.18em; }
.page-title-lockup .title-spark-right { margin-left: 0.18em; }
.page-title-lockup .page-title {
  margin: 0;
  line-height: inherit;
  font-family: inherit;
  font-weight: inherit;
  font-size: 1em;
  letter-spacing: -0.04em;
  color: #002f55;
}
.learn-heading p { margin: 6px 0 0; font-size: 16px; font-weight: 700; color: #35577a; }

.streak-card {
  min-width: 240px;
  padding: 16px 22px;
  border-radius: 22px;
  background: white;
  box-shadow: 0 4px 14px rgb(16 84 115 / 0.1);
}
.streak-title { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 16px; color: #002b43; }
.streak-card p { margin: 2px 0 10px; font-size: 13px; font-weight: 600; color: #35577a; }
.streak-days { display: flex; gap: 6px; }
.streak-day {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  font-size: 11px; font-weight: 800; color: #9db4c8;
  border: 2px solid #e2ecf3;
}
.streak-day.done { background: #34bdd0; color: white; border-color: #34bdd0; }

.lesson-section {
  margin-top: 24px;
  padding: clamp(18px, 2.6vw, 28px);
  border-radius: 28px;
}
.section-green { background: rgb(200 236 210 / 0.55); }
.section-blue { background: rgb(191 227 245 / 0.55); }
.section-purple { background: rgb(219 210 245 / 0.55); }

.section-header h2 {
  margin: 0; display: flex; align-items: center; gap: 8px;
  font-family: 'Baloo 2', cursive; font-size: clamp(19px, 1.8vw, 23px); color: #002b43;
}
.section-header p { margin: 4px 0 12px; font-size: 14px; font-weight: 700; color: #35577a; }
.section-progress { display: flex; align-items: center; gap: 12px; max-width: 340px; }
.progress-track { flex: 1; height: 10px; border-radius: 100px; background: rgb(23 63 96 / 0.12); overflow: hidden; }
.progress-fill { height: 100%; border-radius: 100px; background: #34c37b; }
.fill-blue { background: #34a9d0; }
.fill-purple { background: #8b6fd4; }
.section-progress span { font-size: 13px; font-weight: 800; color: #35577a; white-space: nowrap; }

.lesson-row {
  display: flex; align-items: flex-start; gap: 18px;
  margin-top: 22px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.lesson-node { position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 92px; flex: 0 0 auto; text-align: center; }
.node-circle {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; border-radius: 50%;
  background: white; font-size: 26px;
  box-shadow: 0 3px 8px rgb(16 84 115 / 0.12);
}
.lesson-node.done .node-circle { box-shadow: 0 0 0 3px #34c37b, 0 3px 8px rgb(16 84 115 / 0.12); }
.lesson-node.current .node-circle { box-shadow: 0 0 0 4px #ffd35c, 0 3px 8px rgb(16 84 115 / 0.12); }
.lesson-node.locked .node-circle { background: #eef3f7; color: #a9bccb; box-shadow: none; }
.badge {
  position: absolute; bottom: -2px; right: -2px;
  display: flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #34c37b; color: white; font-size: 11px; font-weight: 800;
  border: 2px solid white;
}
.node-label { font-size: 12px; font-weight: 800; color: #173f60; line-height: 1.3; }
.current-tag {
  padding: 3px 10px; border-radius: 100px;
  background: #ffd35c; color: #6b4a00;
  font-size: 10px; font-weight: 800;
}

@media (max-width: 1050px) {
  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    align-self: center;
    width: 48px; height: 48px; margin: 0; padding: 0;
    border: 0; border-radius: 100px;
    background: #fff;
    color: #173f60;
    box-shadow: 0 8px 22px rgb(16 84 115 / 0.12);
    flex: 0 0 auto; line-height: 0; overflow: visible;
  }
  .nav-toggle-bars { display: block; width: 18px; height: 14px; flex: 0 0 auto; }
  .nav-toggle-bars svg { display: block; width: 18px; height: 14px; fill: currentColor; overflow: visible; }
  .nav-toggle-bars rect {
    transform-box: fill-box; transform-origin: center;
    transition: transform 160ms ease, opacity 160ms ease;
  }
  .topbar.is-open .nav-toggle-bars rect:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .topbar.is-open .nav-toggle-bars rect:nth-child(2) { opacity: 0; }
  .topbar.is-open .nav-toggle-bars rect:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .main-nav {
    display: none; position: absolute; z-index: 60;
    top: calc(100% + 8px); left: auto; right: 8px;
    flex-direction: column; align-items: stretch; gap: 4px;
    width: max-content; min-width: 200px; max-width: min(280px, calc(100vw - 24px));
    margin: 0; padding: 12px; border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 28px rgb(16 84 115 / 0.16);
  }
  .topbar.is-open .main-nav { display: flex; }
  .main-nav.is-lesson {
    display: flex;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 3;
    flex: none;
    max-width: min(520px, calc(100% - 12px));
    padding: 8px 14px 10px;
    background: transparent;
    box-shadow: none;
  }
  #nav-mount:has(.main-nav.is-lesson) .nav-toggle { display: none; }
  .main-nav a {
    justify-content: flex-start; width: 100%; min-height: 44px;
    padding: 10px 12px; font-size: 15px; border-radius: 12px;
  }
  .account-nav { margin-left: auto; min-height: 62px; }
  .nav-toggle { margin-left: 0; }
  .brand { width: 132px; height: 62px; }
  .brand-logo { height: 56px; }
  .coins { min-height: 40px; padding: 4px 20px; font-size: 15px; }
  .coins-icon, .coins-icon img { width: 26px; height: 26px; }
  .settings { min-height: 40px; padding: 4px 20px; font-size: 15px; }
  .settings-icon, .settings-icon img { width: 26px; height: 26px; }
}
@media (max-width: 1280px) {
  .settings .nav-label { display: none; }
  .settings {
    justify-content: center;
    min-width: 48px;
    min-height: 48px;
    padding: 6px;
    gap: 0;
  }
}
@media (max-width: 700px) {
  .settings { min-width: 40px; min-height: 40px; padding: 4px; }
  .main-nav { right: 12px; }
  .app-screen { padding: calc(118px + env(safe-area-inset-top)) 12px 40px; }
  #nav-mount { padding-inline: 12px; }
  .topbar { padding: 3px 12px; }
  .learn-intro { flex-direction: column; }
  .streak-card { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; } }
