:root {
  --bg: #f4f1ea;
  --card: #ffffff;
  --ink: #1f2421;
  --muted: #5c6660;
  --brand: #2e6b5e;
  --brand-dark: #23534a;
  --accent: #e07a3f;
  --good: #2e8b57;
  --good-bg: #e3f3e8;
  --bad: #c0492f;
  --bad-bg: #f7e3de;
  --line: #e3ddd0;
  --shadow: 0 4px 16px rgba(0,0,0,.08);
  --radius: 20px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 22px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

/* ---------- Top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,.12);
}
.topbar-title { font-size: 24px; font-weight: 700; flex: 1; text-align: center; }
.topbar-btn {
  font-size: 26px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  cursor: pointer;
}
.topbar-btn:active { background: rgba(255,255,255,.3); }
.topbar-streak {
  font-size: 22px;
  font-weight: 700;
  background: rgba(255,255,255,.15);
  padding: 8px 14px;
  border-radius: 14px;
  white-space: nowrap;
}

/* ---------- Layout ---------- */
#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 60px;
}

.screen { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

h1.screen-title { font-size: 30px; margin: 8px 0 4px; text-align: center; }
p.screen-sub { font-size: 21px; color: var(--muted); text-align: center; margin: 0 0 24px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 72px;
  font-size: 24px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 18px;
  padding: 14px 20px;
  cursor: pointer;
  transition: transform .08s, background .15s;
}
.btn:active { transform: scale(.97); }
.btn.secondary { background: #fff; color: var(--brand); border: 3px solid var(--brand); }
.btn.accent { background: var(--accent); }
.btn.big { min-height: 84px; font-size: 27px; }
.btn:disabled { opacity: .5; cursor: default; }

.btn-row { display: flex; gap: 14px; margin-top: 8px; }
.btn-row .btn { flex: 1; }

/* ---------- Home: daily plan ---------- */
.hero {
  text-align: center;
  background: linear-gradient(160deg, var(--brand), var(--brand-dark));
  color: #fff;
  border-radius: var(--radius);
  padding: 26px 22px;
  margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.hero .date { font-size: 20px; opacity: .9; }
.hero .big { font-size: 32px; font-weight: 800; margin: 6px 0 2px; }
.hero .streak-line { font-size: 22px; margin-top: 10px; }

.plan-progress {
  height: 16px;
  background: rgba(255,255,255,.25);
  border-radius: 10px;
  overflow: hidden;
  margin-top: 16px;
}
.plan-progress > div { height: 100%; background: #fff; border-radius: 10px; transition: width .4s; }

.task {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 20px;
  margin-bottom: 14px;
  cursor: pointer;
  border: 3px solid transparent;
  transition: transform .08s;
}
.task:active { transform: scale(.99); }
.task.done { border-color: var(--good); background: var(--good-bg); }
.task-emoji { font-size: 40px; width: 52px; text-align: center; flex-shrink: 0; }
.task-body { flex: 1; min-width: 0; }
.task-title { font-size: 23px; font-weight: 700; }
.task-cat { font-size: 18px; color: var(--muted); }
.task-check {
  font-size: 30px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #eee;
  color: #bbb;
}
.task.done .task-check { background: var(--good); color: #fff; }

.celebrate {
  text-align: center;
  background: var(--good-bg);
  border: 3px solid var(--good);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 22px;
}
.celebrate .emoji { font-size: 56px; }
.celebrate .t { font-size: 26px; font-weight: 800; color: var(--good); margin-top: 6px; }

/* ---------- Exercise screen ---------- */
.ex-head { text-align: center; margin-bottom: 18px; }
.ex-emoji { font-size: 48px; }
.ex-title { font-size: 28px; font-weight: 800; margin: 4px 0; }
.ex-instr { font-size: 21px; color: var(--muted); }

.stage { min-height: 120px; }

.big-word {
  text-align: center;
  font-size: 40px;
  font-weight: 800;
  padding: 30px 16px;
  line-height: 1.3;
}
.countdown {
  text-align: center;
  font-size: 24px;
  color: var(--accent);
  font-weight: 700;
  margin-bottom: 10px;
}

/* choices grid */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 18px; }
.choices.single { grid-template-columns: 1fr; }
.choice {
  min-height: 76px;
  font-size: 24px;
  font-weight: 700;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  border: 3px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: transform .08s;
}
.choice:active { transform: scale(.97); }
.choice.selected { border-color: var(--brand); background: #eef6f3; }
.choice.correct { border-color: var(--good); background: var(--good-bg); color: var(--good); }
.choice.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); }
.choice:disabled { cursor: default; }

/* word recognition grid */
.word-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.word-grid.show { margin-bottom: 8px; }

/* memory pairs grid */
.pairs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 420px;
  margin: 10px auto;
}
.pcard {
  aspect-ratio: 1;
  font-size: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  color: transparent;
  transition: transform .12s, background .2s;
}
.pcard.up { background: #fff; border: 3px solid var(--line); color: var(--ink); }
.pcard.matched { background: var(--good-bg); border: 3px solid var(--good); color: var(--good); }
.pcard:active { transform: scale(.96); }

/* sequence / simon */
.simon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  max-width: 360px;
  margin: 16px auto;
}
.spad {
  aspect-ratio: 1;
  border-radius: 18px;
  border: none;
  cursor: pointer;
  opacity: .55;
  transition: opacity .15s, transform .08s;
}
.spad.lit { opacity: 1; transform: scale(1.04); }
.spad:active { transform: scale(.97); }
.spad.s0 { background: #d94f4f; }
.spad.s1 { background: #4f86d9; }
.spad.s2 { background: #e0b13f; }
.spad.s3 { background: #4fb06b; }

/* find symbol grid */
.symbols { display: grid; gap: 8px; justify-content: center; margin: 14px 0; }
.symbols button {
  font-size: 30px;
  width: 54px;
  height: 54px;
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
}
.symbols button.correct { background: var(--good-bg); border-color: var(--good); }
.symbols button.wrong { background: var(--bad-bg); border-color: var(--bad); }

/* reaction */
.reaction-pad {
  height: 220px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  cursor: pointer;
  text-align: center;
  padding: 20px;
  user-select: none;
}
.reaction-pad.wait { background: #b23b3b; }
.reaction-pad.ready { background: #b23b3b; }
.reaction-pad.go { background: var(--good); }

/* hand gymnastics demonstrator */
.hand-demo {
  text-align: center;
  background: #eef6f3;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 16px;
  margin-bottom: 6px;
}
.hand-pose {
  display: inline-block;
  font-size: 120px;
  line-height: 1.1;
  transition: transform .15s ease;
}
.hand-pose svg { width: 190px; height: 200px; display: block; margin: 0 auto; }
.hand-pose.beat { transform: scale(1.1); }
.hand-caption {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  white-space: pre-line;
  margin: 14px 0 4px;
  min-height: 70px;
}
.hand-sub { text-align: center; font-size: 19px; color: var(--muted); margin-bottom: 16px; }

/* feedback banner */
.feedback {
  text-align: center;
  font-size: 26px;
  font-weight: 800;
  padding: 16px;
  border-radius: 16px;
  margin-top: 18px;
}
.feedback.good { background: var(--good-bg); color: var(--good); }
.feedback.bad { background: var(--bad-bg); color: var(--bad); }

/* stats */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.stat-box { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; text-align: center; }
.stat-num { font-size: 40px; font-weight: 800; color: var(--brand); }
.stat-lbl { font-size: 19px; color: var(--muted); }

.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-day {
  aspect-ratio: 1;
  border-radius: 8px;
  background: #e8e2d6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--muted);
}
.cal-day.done { background: var(--good); color: #fff; font-weight: 700; }

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: 14px 24px;
  border-radius: 14px;
  font-size: 20px;
  z-index: 50;
  box-shadow: var(--shadow);
  animation: fade .2s;
}

.hint { text-align: center; color: var(--muted); font-size: 19px; margin-top: 10px; }

@media (max-width: 380px) {
  body { font-size: 20px; }
  .choices { gap: 10px; }
  .choice { font-size: 21px; min-height: 68px; }
}
