:root {
  --ink: #20251f;
  --muted: #747a70;
  --cream: #f5f3ee;
  --card: #fffdf8;
  --green: #1c5a45;
  --green-soft: #d9eadf;
  --lime: #dff56a;
  --orange: #f19a5b;
  --red: #d96557;
  --line: #e4e1d9;
  --shadow: 0 16px 40px rgba(42, 54, 43, 0.1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background: #dfddd6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
}

button { font: inherit; }

.app-shell {
  position: relative;
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% -5%, rgba(223, 245, 106, .42), transparent 32%),
    var(--cream);
}

main { padding: 22px 20px 104px; }

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 7px; font-size: 29px; line-height: 1.18; letter-spacing: -.03em; }
h2 { margin-bottom: 6px; font-size: 21px; letter-spacing: -.02em; }
h3 { margin-bottom: 5px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.topbar, .section-head, .row, .score-head, .report-title, .game-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar { margin-bottom: 25px; }
.avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: var(--lime);
  color: var(--green);
  font-weight: 900;
}

.streak {
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 4px 16px rgba(42,54,43,.08);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.hero-card {
  position: relative;
  margin: 22px 0 24px;
  padding: 22px;
  overflow: hidden;
  border-radius: 27px;
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: -36px;
  bottom: -64px;
  width: 160px;
  height: 160px;
  border: 28px solid rgba(223,245,106,.9);
  border-radius: 50%;
  content: "";
}

.topic-tag {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  font-size: 11px;
  font-weight: 800;
}

.hero-card h2 { max-width: 280px; margin-bottom: 10px; font-size: 24px; line-height: 1.28; }
.hero-card p { max-width: 280px; color: rgba(255,255,255,.72); font-size: 13px; line-height: 1.65; }

.primary-btn, .secondary-btn, .choice-btn, .text-btn {
  border: 0;
  cursor: pointer;
  font-weight: 800;
}

.primary-btn {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 15px 18px;
  border-radius: 16px;
  background: var(--lime);
  color: var(--green);
}

.primary-btn.dark { background: var(--green); color: #fff; }
.primary-btn:active, .secondary-btn:active, .choice-btn:active { transform: scale(.98); }

.section-head { margin: 22px 0 12px; }
.section-head h2 { margin: 0; font-size: 18px; }
.text-btn { padding: 4px; background: transparent; color: var(--green); font-size: 12px; }

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick-card, .panel, .report-card, .stat-card {
  border: 1px solid rgba(228,225,217,.8);
  background: var(--card);
  box-shadow: 0 8px 25px rgba(42,54,43,.06);
}

.quick-card {
  min-height: 142px;
  padding: 17px;
  border-radius: 21px;
  cursor: pointer;
}
.quick-card .tile-icon {
  display: grid;
  width: 37px;
  height: 37px;
  margin-bottom: 18px;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}
.quick-card:nth-child(2) .tile-icon { background: #fee7d5; color: #9b4c21; }
.quick-card p { margin: 0; font-size: 12px; line-height: 1.45; }

.mini-progress { height: 7px; margin-top: 17px; overflow: hidden; border-radius: 10px; background: var(--line); }
.mini-progress span { display: block; width: 70%; height: 100%; border-radius: inherit; background: var(--orange); }

.bottom-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 50%;
  display: grid;
  width: min(100%, 430px);
  grid-template-columns: repeat(4, 1fr);
  padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid var(--line);
  background: rgba(255,253,248,.94);
  backdrop-filter: blur(16px);
}
.nav-item {
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 4px;
  border: 0;
  background: transparent;
  color: #969b92;
  cursor: pointer;
  font-size: 10px;
  font-weight: 800;
}
.nav-icon {
  display: grid;
  width: 31px;
  height: 27px;
  place-items: center;
  border-radius: 10px;
  font-size: 12px;
}
.nav-item.active { color: var(--green); }
.nav-item.active .nav-icon { background: var(--green-soft); }

.page-head { margin: 4px 0 22px; }
.back-btn {
  display: grid;
  width: 38px;
  height: 38px;
  margin-bottom: 18px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  font-size: 19px;
}

.topic-list { display: grid; gap: 11px; }
.level-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0 0 20px;
}
.level-card {
  min-height: 118px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 25px rgba(42,54,43,.04);
}
.level-card strong {
  display: grid;
  width: 38px;
  height: 32px;
  margin-bottom: 12px;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 12px;
}
.level-card span {
  display: block;
  margin-bottom: 5px;
  font-weight: 900;
}
.level-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}
.level-card.active {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.level-card.active strong {
  background: var(--lime);
}
.level-card.active small {
  color: rgba(255,255,255,.72);
}
.topic-option {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 13px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  cursor: pointer;
}
.topic-number {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green);
  font-weight: 900;
}
.topic-option p { margin: 0; font-size: 12px; }
.topic-option .arrow { color: var(--muted); }

.session-screen { min-height: calc(100vh - 140px); text-align: center; }
.timer-ring {
  display: grid;
  width: 174px;
  height: 174px;
  margin: 35px auto 22px;
  place-items: center;
  border: 13px solid var(--green-soft);
  border-top-color: var(--green);
  border-radius: 50%;
}
.timer { margin: 0; font-size: 38px; font-weight: 900; letter-spacing: -.04em; }
.timer-label { margin: 4px 0 0; color: var(--muted); font-size: 11px; font-weight: 700; }
.prompt-box {
  margin: 25px 0 17px;
  padding: 17px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}
.prompt-box p { margin: 0; font-size: 13px; line-height: 1.65; }
.transcript-box label { display: block; margin-bottom: 9px; font-size: 13px; text-align: left; }
.transcript-box textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: var(--cream);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
  padding: 12px;
}
.transcript-box textarea:focus { border-color: var(--green); }
.primary-btn:disabled { cursor: wait; opacity: .65; }
.wave {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 15px 0;
}
.wave span { width: 4px; border-radius: 4px; background: var(--green); animation: wave .8s ease-in-out infinite alternate; }
.wave span:nth-child(2n) { animation-delay: .2s; }
.wave span:nth-child(3n) { animation-delay: .35s; }
@keyframes wave { from { height: 8px; } to { height: 35px; } }

.secondary-btn {
  width: 100%;
  margin-top: 10px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
}

.report-score {
  display: grid;
  width: 88px;
  height: 88px;
  margin: 7px auto 25px;
  place-items: center;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}
.report-score strong { display: block; font-size: 31px; line-height: 1; }
.report-score span { font-size: 10px; opacity: .7; }
.report-card { margin-bottom: 12px; padding: 17px; border-radius: 18px; }
.report-card p { margin: 8px 0 0; font-size: 13px; line-height: 1.55; }
.report-card .original { color: var(--red); text-decoration: line-through; }
.report-card .better { color: var(--green); font-weight: 700; }
.report-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--orange); }

.chat { display: grid; gap: 13px; margin: 20px 0; }
.bubble { max-width: 85%; padding: 13px 15px; border-radius: 18px; font-size: 13px; line-height: 1.55; }
.bubble.ai { border-bottom-left-radius: 5px; background: var(--card); box-shadow: 0 6px 20px rgba(42,54,43,.08); }
.bubble.user { justify-self: end; border-bottom-right-radius: 5px; background: var(--green); color: white; }
.talk-controls {
  position: sticky;
  bottom: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}
.mic-btn {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green);
  cursor: pointer;
  font-weight: 900;
}
.mic-btn.recording { background: var(--red); color: #fff; }
.voice-stage {
  display: grid;
  min-height: 330px;
  margin: 20px 0;
  place-items: center;
  align-content: center;
  padding: 28px;
  border-radius: 28px;
  background: var(--green);
  color: #fff;
  text-align: center;
  box-shadow: var(--shadow);
}
.voice-orb {
  display: grid;
  width: 138px;
  height: 138px;
  margin-bottom: 26px;
  place-items: center;
  border: 18px solid rgba(223,245,106,.18);
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 16px rgba(223,245,106,.08);
  color: var(--green);
  font-size: 26px;
  font-weight: 900;
}
.learner-transcript {
  width: 100%;
  margin-top: 24px;
  padding: 14px;
  border-radius: 16px;
  background: rgba(255,255,255,.1);
  text-align: left;
}
.learner-transcript span { color: var(--lime); font-size: 11px; font-weight: 800; }
.learner-transcript p { margin: 6px 0 0; color: rgba(255,255,255,.82); font-size: 13px; line-height: 1.55; }

.game-card {
  margin: 23px 0;
  padding: 24px 20px;
  border-radius: 28px;
  background: var(--green);
  color: #fff;
  box-shadow: var(--shadow);
}
.game-word { margin: 28px 0 5px; font-size: 36px; letter-spacing: -.03em; }
.phonetic { color: rgba(255,255,255,.6); font-size: 13px; }
.example { margin: 25px 0 5px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.17); font-size: 13px; line-height: 1.6; }
.choices { display: grid; gap: 10px; }
.choice-btn {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--card);
  color: var(--ink);
  text-align: left;
}
.choice-btn.correct { border-color: var(--green); background: var(--green-soft); color: var(--green); }
.choice-btn.wrong { border-color: var(--red); background: #fbe5e1; color: var(--red); }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; margin: 20px 0; }
.stat-card { padding: 16px; border-radius: 18px; }
.stat-card strong { display: block; margin-bottom: 4px; font-size: 27px; }
.stat-card span { color: var(--muted); font-size: 11px; }
.chart-card { padding: 18px; border-radius: 22px; background: var(--green); color: #fff; }
.chart {
  display: flex;
  height: 145px;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 22px;
}
.bar { display: flex; flex: 1; align-items: center; flex-direction: column; justify-content: flex-end; gap: 7px; color: rgba(255,255,255,.65); font-size: 9px; }
.bar span { width: 100%; min-height: 12px; border-radius: 7px 7px 3px 3px; background: var(--lime); }
.skill-row { margin: 15px 0; }
.skill-row .row { margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.skill-track { height: 8px; overflow: hidden; border-radius: 8px; background: var(--line); }
.skill-track span { display: block; height: 100%; border-radius: inherit; background: var(--green); }

.toast {
  position: fixed;
  z-index: 30;
  right: 20px;
  bottom: 95px;
  left: 20px;
  max-width: 390px;
  margin: auto;
  padding: 13px 16px;
  transform: translateY(20px);
  border-radius: 14px;
  background: var(--ink);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .25s ease;
}
.toast.show { transform: translateY(0); opacity: 1; }

@media (min-width: 600px) {
  body { padding: 20px 0; }
  .app-shell { min-height: calc(100vh - 40px); border-radius: 30px; box-shadow: 0 24px 70px rgba(0,0,0,.14); }
  .bottom-nav { bottom: 20px; border-radius: 0 0 30px 30px; }
}
