:root {
  --green: #2f6b4f;
  --green-2: #3f8a66;
  --pink: #f8bccb;
  --ink: #23302a;
  --muted: #5d6b64;
  --bg: #fbf7f2;
  --card: #ffffff;
  --line: #e6e0d8;
  --ok: #2e7d32;
  --bad: #c0392b;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

.topbar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--green); color: #fff;
  min-height: 56px;
}
.topbar h1 { font-size: 20px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { background: #fff3; padding: 2px 10px; border-radius: 99px; font-size: 14px; }
.icon-btn {
  min-width: 48px; min-height: 48px; border: 0; border-radius: 12px;
  background: transparent; color: inherit; font-size: 24px; cursor: pointer;
}
#app { max-width: 560px; margin: 0 auto; padding: 16px 16px 40px; }

.hello { display: flex; gap: 12px; align-items: center; margin-bottom: 8px; }
.teacher-small { width: 84px; flex: 0 0 84px; }
.hello-title { font-weight: 700; margin: 0; font-size: 20px; }
.hello-sub { margin: 4px 0 0; color: var(--muted); }
.privacy { font-size: 15px; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }

.card {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 14px; margin: 10px 0; text-align: left; font: inherit; color: inherit;
  min-height: 64px; cursor: pointer;
}
.card .num {
  flex: 0 0 44px; height: 44px; border-radius: 50%; background: #e8f2ec; color: var(--green);
  display: grid; place-items: center; font-weight: 700;
}
.card .txt { flex: 1; }
.card .sub { font-size: 15px; color: var(--muted); }
.card .tick { font-size: 22px; color: var(--ok); }
.card.done .num { background: var(--green); color: #fff; }

.btn {
  display: block; width: 100%; border: 0; border-radius: 14px; font: inherit; font-weight: 600;
  padding: 12px 16px; min-height: 56px; margin: 10px 0; cursor: pointer;
}
.btn-big { font-size: 20px; min-height: 60px; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-2); }
.btn-secondary { background: #fff; color: var(--green); border: 2px solid var(--green); }
.btn-link { background: transparent; color: var(--green); text-decoration: underline; min-height: 48px; font-weight: 500; }
.btn:disabled { opacity: .5; }

.stage { text-align: center; padding-top: 4px; }
.teacher { width: 180px; height: 180px; margin: 0 auto; }
.teacher svg, .teacher-small svg { width: 100%; height: 100%; display: block; }
.screen-text { font-size: 26px; font-weight: 700; margin: 6px 0 0; }
.item-title { color: var(--muted); margin: 2px 0 8px; }
.center { text-align: center; }
.small { font-size: 15px; color: var(--muted); }
.tip { background: #fff8e1; border-radius: 12px; padding: 8px 12px; }

.choices { margin-top: 8px; }

.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-top: 12px; }
.panel-title { font-weight: 700; margin: 4px 0 8px; }
.option, .faq {
  display: block; width: 100%; text-align: left; font: inherit; background: #f6f3ee; color: var(--ink);
  border: 2px solid transparent; border-radius: 12px; padding: 12px; margin: 8px 0; min-height: 52px; cursor: pointer;
}
.option.right { border-color: var(--ok); background: #e8f5e9; }
.option.wrong { border-color: var(--bad); background: #fdecea; }
.feedback { font-weight: 600; min-height: 1em; }
.feedback.ok { color: var(--ok); }
.feedback.bad { color: var(--bad); }

.answer {
  background: #fff; border-left: 6px solid var(--green); border-radius: 12px; padding: 12px 14px; margin-top: 12px;
  white-space: pre-wrap;
}
.ask-row { display: flex; gap: 8px; }
.ask-row input {
  flex: 1; min-height: 52px; font: inherit; padding: 8px 12px; border: 2px solid var(--line); border-radius: 12px;
}
.mic { background: #e8f2ec; color: var(--green); }
.mic.on { background: var(--bad); color: #fff; }
.lang-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.chip { border: 2px solid var(--green); background: #fff; color: var(--green); border-radius: 99px; padding: 6px 14px; font: inherit; font-size: 15px; min-height: 40px; }
.chip.active { background: var(--green); color: #fff; }

/* Teacher moods */
.art .eyes-closed, .art .mouth-half, .art .mouth-open, .art .listening, .art .thinking { display: none; }
.art.blink .eyes-open { display: none; }
.art.blink .eyes-closed { display: inline; }
.art.m1 .mouth-closed, .art.m2 .mouth-closed { display: none; }
.art.m1 .mouth-half { display: inline; }
.art.m2 .mouth-open { display: inline; }
.mood-listening .art .listening { display: inline; }
.mood-thinking .art .thinking { display: inline; }
.mood-thinking .art .thinking circle { animation: dot 1.2s infinite ease-in-out; }
.mood-thinking .art .thinking circle:nth-child(2) { animation-delay: .2s; }
.mood-thinking .art .thinking circle:nth-child(3) { animation-delay: .4s; }
.art .bob { animation: bob 3s infinite ease-in-out; transform-origin: 100px 170px; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes dot { 0%,100% { opacity: .3; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .art .bob, .mood-thinking .art .thinking circle { animation: none; } }
