:root {
  color-scheme: light;
  --bg: #e9f0df;
  --bg-deep: #d8e8cf;
  --surface: #fffaf2;
  --surface-2: #f2eadc;
  --ink: #22301d;
  --muted: #64725d;
  --line: rgba(34, 48, 29, 0.12);
  --accent: #b95c3c;
  --accent-2: #2f7d55;
  --gold: #d69d3e;
  --blue: #377f94;
  --white: #fffdf8;
  --shadow: 0 16px 32px rgba(39, 56, 31, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  font-family: "Hanken Grotesk", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100dvh;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.app {
  width: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% -10%, rgba(255, 255, 255, 0.76), transparent 28%),
    linear-gradient(180deg, var(--bg), #f4ecdf 100%);
}

.scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.scroll::-webkit-scrollbar {
  display: none;
}

.screen {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
  animation: rise 180ms ease-out;
}

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

.hero {
  position: relative;
  min-height: 270px;
  margin: 0 -16px;
  padding: 54px 20px 22px;
  overflow: hidden;
  background: linear-gradient(180deg, #55b7bf, #a9ded4 58%, #82b875 59%, #5d9d66 100%);
  border-bottom-left-radius: 26px;
  border-bottom-right-radius: 26px;
  color: #18321e;
}

.hero-small {
  min-height: 204px;
}

.hero-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(30px, 7vw, 54px);
  line-height: 0.98;
  letter-spacing: 0;
  font-weight: 900;
}

h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 19px;
  line-height: 1.15;
  letter-spacing: 0;
}

.sub {
  max-width: 620px;
  margin: 10px 0 0;
  color: rgba(24, 50, 30, 0.76);
  font-size: 15px;
  line-height: 1.42;
  font-weight: 700;
  overflow-wrap: break-word;
}

.top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.identity-pill,
.tiny-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  box-shadow: 0 8px 18px rgba(38, 68, 35, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.92);
  font-weight: 900;
  cursor: pointer;
}

.identity-pill {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 9px 13px;
  font-size: 13px;
}

.tiny-pill {
  min-height: 34px;
  padding: 7px 11px;
  font-size: 12px;
}

.section {
  margin-top: 18px;
}

.section-label {
  margin: 0 2px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.lesson-card {
  padding: 15px;
}

.lesson-title {
  display: flex;
  gap: 13px;
  align-items: center;
}

.lesson-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-size: 23px;
  font-weight: 900;
}

.muted {
  color: var(--muted);
}

.primary,
.secondary,
.nav-btn,
.name-card,
.step-chip,
.dot-btn {
  border: 0;
  cursor: pointer;
}

.primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, #d86943, #b84e31);
  color: white;
  box-shadow: 0 8px 16px rgba(184, 78, 49, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.36);
  font-size: 15px;
  font-weight: 900;
}

.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(34, 48, 29, 0.08);
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.grid {
  display: grid;
  gap: 12px;
}

.kid-grid {
  grid-template-columns: 1fr;
}

.kid-card {
  padding: 15px;
}

.kid-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: white;
  font-weight: 900;
}

.shaafi {
  background: var(--blue);
}

.bina {
  background: var(--gold);
}

.name-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 18px;
  padding: calc(38px + env(safe-area-inset-top)) 18px 38px;
}

.name-panel {
  width: calc(100vw - 36px);
  min-width: 0;
  max-width: 720px;
  margin: 0 auto;
}

.name-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.name-card {
  min-width: 0;
  min-height: 92px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: left;
}

.name-initial {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  border-radius: 8px;
  background: var(--accent-2);
  color: white;
  font-weight: 900;
}

.name-card:nth-child(2n) .name-initial {
  background: var(--accent);
}

.name-card:nth-child(3n) .name-initial {
  background: var(--blue);
}

.name-card span:last-child {
  display: block;
  font-size: 21px;
  font-weight: 900;
}

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 4px;
  padding: 8px 10px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  box-shadow: 0 -12px 24px rgba(40, 70, 30, 0.08);
}

.nav-btn {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 3px;
  min-height: 54px;
  padding: 5px 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 900;
}

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

.nav-icon {
  width: 24px;
  height: 24px;
}

.lesson-list {
  display: grid;
  gap: 10px;
}

.lesson-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 6px 16px rgba(39, 56, 31, 0.08);
}

.lesson-row[disabled] {
  opacity: 0.56;
  cursor: default;
}

.lesson-badge {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  font-weight: 900;
}

.lesson-row.available .lesson-badge {
  background: var(--accent);
  color: white;
}

.lesson-flow {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.flow-top {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: calc(12px + env(safe-area-inset-top)) 14px 10px;
  background: linear-gradient(var(--bg), var(--bg) 72%, rgba(233, 240, 223, 0));
}

.flow-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
}

.steps {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 0;
  scrollbar-width: none;
}

.steps::-webkit-scrollbar {
  display: none;
}

.step-chip {
  flex: 0 0 auto;
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: 13px;
  font-weight: 900;
}

.step-chip.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 8px 16px rgba(184, 78, 49, 0.24);
}

.flow-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 6px 14px 114px;
}

.flow-card {
  max-width: 860px;
  margin: 0 auto;
  overflow: hidden;
}

.flow-head {
  padding: 17px 17px 13px;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.flow-content {
  padding: 18px;
}

.quote {
  margin: 0;
  font-family: "Spectral", Georgia, serif;
  font-size: 22px;
  line-height: 1.45;
  font-weight: 600;
}

.body-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
  font-weight: 700;
}

.serif-text {
  font-family: "Spectral", Georgia, serif;
  font-size: 18px;
  line-height: 1.58;
  font-weight: 500;
}

.stack {
  display: grid;
  gap: 14px;
}

.soft-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 14px;
}

.choice-grid {
  display: grid;
  gap: 9px;
}

.choice {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px 12px;
  font-weight: 900;
}

.choice-symbol {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(47, 125, 85, 0.14);
  color: var(--accent-2);
  font-size: 20px;
}

.picture-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}

.picture-tile {
  min-height: 104px;
  display: grid;
  place-items: center;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  padding: 9px;
  text-align: center;
  font-weight: 900;
}

.big-symbol {
  font-size: 38px;
  line-height: 1;
}

.lyrics {
  white-space: pre-line;
}

.coloring {
  width: 100%;
  max-width: 520px;
  display: block;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 14px 30px rgba(30, 45, 24, 0.12);
}

.flow-actions {
  position: fixed;
  z-index: 12;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 10px 14px calc(12px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.flow-actions .primary {
  flex: 1;
}

@media (min-width: 520px) {
  .name-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 680px) {
  .screen {
    padding: 0 22px;
  }

  .hero {
    margin: 0 -22px;
    padding-left: 34px;
    padding-right: 34px;
  }

  .kid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flow-content {
    padding: 24px;
  }
}
