/* ===== Hadirçe design tokens: turquoise, tulip red, warm gold ===== */
:root {
  --turq: #14b8b0;
  --turq-deep: #0e8f89;
  --turq-soft: #d9f5f3;
  --tulip: #e8434f;
  --tulip-deep: #b92f3a;
  --gold: #f5b731;
  --gold-deep: #c98f12;
  --gold-soft: #fff3d6;

  --bg: #f4faf9;
  --surface: #ffffff;
  --text: #1f2a2e;
  --muted: #5b6c70;
  --line: #e1ebea;
  --locked: #e3e8e8;
  --locked-deep: #c2caca;
  --shadow: 0 2px 0 rgba(20, 60, 60, 0.06);

  --radius: 20px;
  --nav-h: 68px;
  --font: 'Nunito', 'Baloo Bhaijaan 2', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: light;
}
:root[lang='ar'] {
  --font: 'Baloo Bhaijaan 2', 'Nunito', system-ui, -apple-system, sans-serif;
}
:root[data-theme='dark'] {
  --turq-soft: #123c3c;
  --gold-soft: #3a2f14;
  --bg: #0f1a1c;
  --surface: #172628;
  --text: #eef5f4;
  --muted: #9fb2b4;
  --line: #26393c;
  --locked: #2a3b3e;
  --locked-deep: #1b292b;
  --shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
  color-scheme: dark;
}
:root[data-contrast='high'] {
  --turq: #00807a;
  --turq-deep: #00504c;
  --tulip: #c4142a;
  --text: #000000;
  --muted: #1e1e1e;
  --line: #000000;
  --locked-deep: #6b7474;
}
:root[data-theme='dark'][data-contrast='high'] {
  --turq: #3fe0d6;
  --turq-deep: #13a59d;
  --text: #ffffff;
  --muted: #f0f0f0;
  --line: #ffffff;
  --bg: #000000;
  --surface: #0b0b0b;
}
:root[data-large='on'] {
  font-size: 118%;
}

/* ===== base ===== */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-weight: 700;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 12px; }
[lang='ar'] { line-height: 1.6; }

.app {
  max-width: 520px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

/* ===== top bar ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(env(safe-area-inset-top) + 8px) 16px 8px;
  background: var(--bg);
  border-bottom: 2px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 6px; }
.brand-cat { display: flex; }
.brand-name {
  font-family: 'Nunito', sans-serif;
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--turq);
  letter-spacing: -0.02em;
}
.topbar-right { display: flex; align-items: center; gap: 6px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.95rem;
}
.chip b { font-family: 'Nunito', sans-serif; }
.chip-streak b { color: #f08a24; }
.chip-hearts b { color: var(--tulip); }
.lang-toggle {
  min-height: 40px;
  padding: 4px 12px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 14px;
  background: var(--surface);
  color: var(--turq-deep);
  font-weight: 800;
}
:root[data-theme='dark'] .lang-toggle { color: var(--turq); }
.lang-toggle:active { transform: translateY(2px); border-bottom-width: 2px; }

/* ===== screen area ===== */
.screen {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  outline: none;
}
.screen-inner {
  padding: 16px 16px calc(var(--nav-h) + env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slide-in 0.28s ease-out;
}
@keyframes slide-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-title { margin: 4px 0 0; font-size: 1.6rem; font-weight: 900; }
.card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.card-title { margin: 0 0 12px; font-size: 1.1rem; font-weight: 800; }
.muted { color: var(--muted); margin: 0; }

/* ===== hero + continue ===== */
.hero { display: flex; align-items: center; gap: 12px; }
.hero-cat { flex: none; animation: bob 3s ease-in-out infinite; }
.hero-title { margin: 0; font-family: 'Nunito', sans-serif; font-size: 1.55rem; font-weight: 900; }
.hero-sub { margin: 2px 0 0; color: var(--muted); }
@keyframes bob { 50% { transform: translateY(-5px) rotate(-2deg); } }

.btn {
  border: none;
  border-radius: var(--radius);
  font-weight: 900;
  transition: transform 0.08s, box-shadow 0.08s;
}
.btn-primary {
  background: var(--turq);
  color: #fff;
  box-shadow: 0 6px 0 var(--turq-deep);
}
.btn-primary:active { transform: translateY(5px); box-shadow: 0 1px 0 var(--turq-deep); }
.btn-xl {
  width: 100%;
  min-height: 76px;
  padding: 12px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 1.45rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.btn-xl small { font-size: 0.85rem; font-weight: 700; text-transform: none; letter-spacing: 0; opacity: 0.92; }
:root[lang='ar'] .btn-xl { letter-spacing: 0; }

/* ===== Yasmino's note ===== */
.note {
  background: var(--gold-soft);
  border-color: var(--gold);
  position: relative;
}
.note-title { margin: 0 0 8px; font-size: 1rem; font-weight: 800; color: var(--gold-deep); }
:root[data-theme='dark'] .note-title { color: var(--gold); }
.note-line { margin: 4px 0; font-size: 1.02rem; }
.note-line[lang='ar'] { font-family: 'Baloo Bhaijaan 2', sans-serif; text-align: right; }
.note-line[lang='en'], .note-line[lang='tr'] { font-family: 'Nunito', sans-serif; text-align: left; }
.note-line[lang='tr'] { color: var(--tulip-deep); font-weight: 900; }
:root[data-theme='dark'] .note-line[lang='tr'] { color: #ff8a93; }

/* ===== winding level path ===== */
.path {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 28px;
  align-items: center;
}
.node-row {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translateX(var(--x));
  width: 200px;
}
[dir='rtl'] .node-row { transform: translateX(calc(var(--x) * -1)); }
.node {
  position: relative;
  width: 76px;
  height: 70px;
  border-radius: 50%;
  border: none;
  font-size: 2rem;
  display: grid;
  place-items: center;
  transition: transform 0.08s, box-shadow 0.08s;
}
.node:active { transform: translateY(5px); }
.node-current { background: var(--turq); box-shadow: 0 7px 0 var(--turq-deep), 0 0 0 7px var(--turq-soft); animation: pulse 2s ease-in-out infinite; }
.node-done { background: var(--gold); box-shadow: 0 7px 0 var(--gold-deep); }
.node-locked { background: var(--locked); box-shadow: 0 7px 0 var(--locked-deep); }
.node-locked .node-emoji { filter: grayscale(1); opacity: 0.45; }
.node-lock {
  position: absolute;
  inset-block-end: -4px;
  inset-inline-end: -4px;
  font-size: 1rem;
  background: var(--surface);
  border-radius: 50%;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border: 2px solid var(--line);
}
@keyframes pulse { 50% { box-shadow: 0 7px 0 var(--turq-deep), 0 0 0 12px var(--turq-soft); } }
.node-label { text-align: center; font-size: 0.92rem; display: flex; flex-direction: column; color: var(--text); }
.node-label b { font-size: 0.75rem; text-transform: uppercase; color: var(--muted); letter-spacing: 0.06em; }
:root[lang='ar'] .node-label b { letter-spacing: 0; }
.node-label i { font-style: normal; font-family: 'Nunito', sans-serif; font-size: 0.8rem; color: var(--turq-deep); }
:root[data-theme='dark'] .node-label i { color: var(--turq); }
.start-bubble {
  position: relative;
  background: var(--surface);
  color: var(--turq-deep);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 2px 12px;
  font-weight: 900;
  text-transform: uppercase;
  font-size: 0.85rem;
  animation: bob 1.8s ease-in-out infinite;
}
:root[data-theme='dark'] .start-bubble { color: var(--turq); }
.node-cat {
  position: absolute;
  inset-inline-start: calc(50% + 50px);
  top: 26px;
  animation: bob 2.6s ease-in-out infinite;
}

/* ===== practice / progress ===== */
.empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.empty p { margin: 0; color: var(--muted); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile, .stat {
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: var(--radius);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  font-weight: 800;
  min-height: 112px;
  justify-content: center;
}
.tile { position: relative; }
.tile:active { transform: translateY(3px); border-bottom-width: 2px; }
.tile-ic, .stat-ic { font-size: 1.9rem; }
.badge {
  position: absolute;
  top: 8px;
  inset-inline-end: 8px;
  background: var(--gold);
  color: #3a2a00;
  font-size: 0.7rem;
  padding: 1px 8px;
  border-radius: 999px;
}
.stat b { font-family: 'Nunito', sans-serif; font-size: 1.6rem; font-weight: 900; line-height: 1; }
.stat span:last-child { color: var(--muted); font-size: 0.85rem; }
.week { display: flex; justify-content: space-between; align-items: flex-end; height: 120px; gap: 8px; }
.week-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bar { width: 100%; max-width: 28px; height: var(--h); min-height: 6px; background: var(--locked); border-radius: 8px; }
.week-col span { color: var(--muted); font-size: 0.85rem; }

/* ===== profile ===== */
.profile-head { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.avatar {
  width: 120px; height: 120px;
  border-radius: 50%;
  background: var(--turq-soft);
  border: 4px solid var(--turq);
  display: grid; place-items: center;
}
.field { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.field-label { color: var(--muted); font-size: 0.9rem; }
.seg { display: flex; gap: 8px; }
.seg-btn {
  flex: 1;
  min-height: 48px;
  border-radius: 14px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--surface);
  font-weight: 800;
}
.seg-btn.on { border-color: var(--turq); background: var(--turq-soft); color: var(--turq-deep); }
:root[data-theme='dark'] .seg-btn.on { color: var(--turq); }
.seg-btn[lang='ar'] { font-family: 'Baloo Bhaijaan 2', sans-serif; }
.seg-btn[lang='en'] { font-family: 'Nunito', sans-serif; }
.row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  border-top: 2px solid var(--line);
}
.switch {
  appearance: none;
  -webkit-appearance: none;
  width: 56px; height: 32px;
  border-radius: 999px;
  background: var(--locked-deep);
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  margin: 0;
  flex: none;
}
.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #fff;
  transition: inset-inline-start 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}
:root[data-theme='dark'] .switch { background: #44595c; }
.switch:checked, :root[data-theme='dark'] .switch:checked { background: var(--turq); }
.switch:checked::after { inset-inline-start: 27px; }

/* ===== bottom navigation ===== */
.bottomnav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: flex;
  background: var(--surface);
  border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 10;
}
.nav-item {
  flex: 1;
  min-height: var(--nav-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
  border-radius: 14px;
  margin: 4px;
}
.nav-ic { font-size: 1.55rem; transition: transform 0.2s; filter: grayscale(0.6); opacity: 0.8; }
.nav-item.active { color: var(--turq-deep); background: var(--turq-soft); }
:root[data-theme='dark'] .nav-item.active { color: var(--turq); }
.nav-item.active .nav-ic { transform: scale(1.12); filter: none; opacity: 1; }

/* ===== toast ===== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 20px);
  width: min(440px, calc(100% - 32px));
  background: var(--text);
  color: var(--bg);
  padding: 12px 16px;
  border-radius: 16px;
  text-align: center;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 20;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =====================================================
   Lesson player (Step 3)
   ===================================================== */
:root { --ok-bg: #d7f5f2; --ok-text: #0b6f6a; --bad-bg: #fde4e6; --bad-text: #a8232f; }
:root[data-theme='dark'] { --ok-bg: #12403e; --ok-text: #7fe9e1; --bad-bg: #44191e; --bad-text: #ff9aa2; }
body.in-lesson { overflow: hidden; }

.lesson {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  max-width: 520px;
  margin: 0 auto;
  animation: lesson-in 0.25s ease-out;
}
@keyframes lesson-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }

.lesson-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px;
}
.icon-btn {
  width: 44px; height: 44px;
  flex: none;
  border: none;
  background: none;
  font-size: 1.4rem;
  color: var(--muted);
  border-radius: 12px;
}
.bar { flex: 1; height: 16px; border-radius: 999px; background: var(--locked); overflow: hidden; }
.bar-fill {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(var(--gold), var(--gold-deep));
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.08), inset 0 4px 0 rgba(255, 255, 255, 0.35);
  transition: width 0.45s cubic-bezier(0.3, 1.4, 0.6, 1);
}

.lesson-body { flex: 1; overflow-y: auto; padding: 8px 16px 24px; }
.ex-wrap { display: flex; flex-direction: column; gap: 14px; animation: slide-in 0.25s ease-out; }
.ins { margin: 0; font-size: 1.4rem; font-weight: 900; }
.retry-tag { align-self: flex-start; color: #f08a24; font-size: 0.85rem; font-weight: 900; text-transform: uppercase; }
.ex { display: flex; flex-direction: column; gap: 16px; }
.locked .word { pointer-events: none; }

/* prompts and speaker buttons */
.prompt-row { display: flex; align-items: center; gap: 10px; }
.prompt-tr { font-size: 1.7rem; font-weight: 900; font-family: 'Nunito', sans-serif; }
.spk-group { display: inline-flex; gap: 10px; align-items: center; }
.spk {
  width: 44px; height: 44px;
  flex: none;
  border-radius: 14px;
  border: none;
  background: var(--turq);
  box-shadow: 0 4px 0 var(--turq-deep);
  font-size: 1.2rem;
  display: grid; place-items: center;
}
.spk:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--turq-deep); }
.spk.playing { animation: pop 0.35s ease-out; }
.spk-group.big .spk { width: 96px; height: 96px; border-radius: 28px; font-size: 2.6rem; box-shadow: 0 6px 0 var(--turq-deep); }
.spk-group.big .spk-slow { width: 64px; height: 64px; border-radius: 20px; font-size: 1.7rem; }
@keyframes pop { 50% { transform: scale(1.12); } }
.listen-box { display: flex; justify-content: center; padding: 12px 0 4px; }

/* option buttons */
.opts { display: flex; flex-direction: column; gap: 10px; }
.opts-row { flex-direction: row; }
.opts-row .opt { flex: 1; justify-content: center; font-size: 1.4rem; }
.opts-pics { display: grid; grid-template-columns: 1fr 1fr; }
.opt {
  min-height: 56px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: start;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  border-radius: 16px;
  font-size: 1.1rem;
  font-weight: 800;
  transition: transform 0.06s;
}
.opt:active:not(:disabled) { transform: translateY(2px); }
.opts-pics .opt { flex-direction: column; justify-content: center; min-height: 140px; text-align: center; }
.opt-emoji { font-size: 3.2rem; line-height: 1; }
.opt.sel { border-color: var(--turq); background: var(--turq-soft); color: var(--turq-deep); }
:root[data-theme='dark'] .opt.sel { color: var(--turq); }
.opt.good { border-color: var(--turq); background: var(--ok-bg); color: var(--ok-text); }
.opt.bad { border-color: var(--tulip); background: var(--bad-bg); color: var(--bad-text); }
.opt:disabled { cursor: default; }
.shake { animation: shake 0.4s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* match pairs */
.pairs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair-col { display: flex; flex-direction: column; gap: 10px; }
.pair { justify-content: center; text-align: center; }
.pair.good { opacity: 0.45; }

/* word bank */
.say-row { display: flex; align-items: flex-end; gap: 8px; }
.say-cat { flex: none; }
.bubble {
  position: relative;
  flex: 1;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bubble .spk { width: 36px; height: 36px; font-size: 1rem; border-radius: 10px; box-shadow: 0 3px 0 var(--turq-deep); }
.answer-line {
  min-height: 116px;
  padding: 8px 0;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 8px;
  background-image: linear-gradient(var(--line), var(--line)), linear-gradient(var(--line), var(--line));
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 54px, 0 108px;
}
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.word {
  min-height: 46px;
  padding: 6px 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  border-radius: 14px;
  font-size: 1.1rem;
  font-weight: 800;
  animation: pop-in 0.18s ease-out;
}
@keyframes pop-in { from { transform: scale(0.85); opacity: 0; } }
.bank .word.used { visibility: hidden; }

/* typing */
.type-box {
  width: 100%;
  min-height: 96px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  font-size: 1.2rem;
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  resize: none;
}
.type-box:focus { outline: none; border-color: var(--turq); }
.type-long { min-height: 140px; }
.write-prompt { margin: 0; font-size: 1.1rem; }

/* suffix */
.suffix-word {
  display: flex;
  justify-content: center;
  align-items: baseline;
  font-family: 'Nunito', sans-serif;
  font-size: 2.6rem;
  font-weight: 900;
  padding-top: 12px;
}
.blank {
  min-width: 90px;
  text-align: center;
  border-bottom: 4px dashed var(--turq);
  color: var(--muted);
  margin-inline-start: 2px;
}
.blank.filled { color: var(--turq-deep); animation: pop 0.3s; }
:root[data-theme='dark'] .blank.filled { color: var(--turq); }
.meaning { margin: 0; text-align: center; color: var(--muted); font-size: 1.1rem; }

/* reading */
.passage {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.passage p { margin: 0; font-family: 'Nunito', sans-serif; font-size: 1.15rem; line-height: 1.6; }
.gloss { background: var(--gold-soft); border-radius: 14px; padding: 10px 14px; }
.gloss summary { cursor: pointer; font-weight: 800; min-height: 28px; }
.gloss ul { margin: 8px 0 0; padding-inline-start: 20px; }
.gloss-tr { font-weight: 900; color: var(--tulip-deep); }
:root[data-theme='dark'] .gloss-tr { color: #ff8a93; }
.question { margin: 0; font-size: 1.15rem; font-weight: 900; }

/* speaking */
.speak-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.speak-text { margin: 0; font-family: 'Nunito', sans-serif; font-size: 1.6rem; font-weight: 900; text-align: center; }
.btn-wide { width: 100%; min-height: 56px; font-size: 1.15rem; }
.btn-link {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 800;
  min-height: 44px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.btn-danger { color: var(--tulip); }
.hint { margin: 0; text-align: center; color: var(--muted); font-size: 0.85rem; }

/* footer: Check button and feedback */
.lesson-foot {
  padding: 14px 16px calc(env(safe-area-inset-bottom) + 14px);
  border-top: 2px solid var(--line);
  background: var(--bg);
  transition: background 0.2s;
}
.lesson-foot.is-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok-text); }
.lesson-foot.is-bad { background: var(--bad-bg); border-color: transparent; color: var(--bad-text); }
.feedback:empty { display: none; }
.feedback { margin-bottom: 12px; animation: slide-in 0.2s ease-out; max-height: 38vh; overflow-y: auto; }
.feedback p { margin: 6px 0 0; color: var(--text); }
.fb-head { font-size: 1.35rem; font-weight: 900; }
.fb-explain { font-size: 0.98rem; }
.kw { font-weight: 900; color: var(--turq-deep); }
:root[data-theme='dark'] .kw { color: var(--turq); }
.btn-check { width: 100%; min-height: 56px; font-size: 1.2rem; text-transform: uppercase; letter-spacing: 0.04em; }
:root[lang='ar'] .btn-check { letter-spacing: 0; }
.btn-primary:disabled { background: var(--locked); color: var(--muted); box-shadow: 0 5px 0 var(--locked-deep); cursor: default; transform: none; }
.is-bad .btn-primary { background: var(--tulip); box-shadow: 0 6px 0 var(--tulip-deep); }

/* quit sheet */
.sheet-wrap {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  animation: fade 0.2s;
  z-index: 5;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
  width: 100%;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 20px 16px calc(env(safe-area-inset-bottom) + 16px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  animation: lesson-in 0.25s ease-out;
}
.sheet h2 { margin: 0; font-size: 1.3rem; }
.sheet p { margin: 0 0 8px; color: var(--muted); }

/* finish screen */
.lesson.done { justify-content: center; }
.finish {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 24px 16px calc(env(safe-area-inset-bottom) + 24px);
  text-align: center;
}
.finish-cat { animation: bounce 0.9s ease-in-out infinite alternate; }
@keyframes bounce { from { transform: translateY(0) rotate(-3deg); } to { transform: translateY(-14px) rotate(3deg); } }
.finish-title { margin: 0; font-size: 2rem; font-weight: 900; color: var(--gold-deep); }
:root[data-theme='dark'] .finish-title { color: var(--gold); }
.finish-stats { display: flex; gap: 12px; width: 100%; }
.fstat { flex: 1; border-radius: 18px; border: 3px solid; overflow: hidden; display: flex; flex-direction: column; }
.fstat span { color: #fff; font-size: 0.8rem; font-weight: 900; text-transform: uppercase; padding: 4px; }
.fstat b { background: var(--surface); padding: 14px 8px; font-size: 1.5rem; font-family: 'Nunito', sans-serif; }
.fstat-gold { border-color: var(--gold); }
.fstat-gold span { background: var(--gold); color: #3a2a00; }
.fstat-turq { border-color: var(--turq); }
.fstat-turq span { background: var(--turq); }

/* =====================================================
   Voice, microphone and Turkish letters (Step 4)
   ===================================================== */
.spk.playing { animation: pulse-spk 0.9s ease-in-out infinite; }
@keyframes pulse-spk { 50% { transform: scale(1.08); filter: brightness(1.12); } }

.trkeys { display: flex; gap: 6px; justify-content: space-between; }
.trkey {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--surface);
  font-family: 'Nunito', sans-serif;
  font-size: 1.3rem;
  font-weight: 900;
  color: var(--turq-deep);
  touch-action: manipulation;
}
:root[data-theme='dark'] .trkey { color: var(--turq); }
.trkey:active { transform: translateY(2px); border-bottom-width: 2px; background: var(--turq-soft); }

.speak-area { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.mic {
  width: 104px; height: 104px;
  border-radius: 50%;
  border: none;
  background: var(--tulip);
  box-shadow: 0 7px 0 var(--tulip-deep);
  font-size: 2.8rem;
  display: grid; place-items: center;
  margin-top: 6px;
  transition: transform 0.08s;
}
.mic:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--tulip-deep); }
.mic.listening { animation: mic-pulse 1.2s ease-out infinite; }
@keyframes mic-pulse {
  0% { box-shadow: 0 7px 0 var(--tulip-deep), 0 0 0 0 rgba(232, 67, 79, 0.45); }
  100% { box-shadow: 0 7px 0 var(--tulip-deep), 0 0 0 26px rgba(232, 67, 79, 0); }
}
.mic-label { margin: 4px 0 0; font-weight: 900; color: var(--muted); }
.speak-result { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.speak-result:empty { display: none; }
.meter { position: relative; width: 100%; height: 30px; border-radius: 999px; background: var(--locked); overflow: hidden; }
.meter-fill { position: absolute; inset-block: 0; inset-inline-start: 0; width: var(--p); background: linear-gradient(90deg, var(--gold), var(--turq)); border-radius: 999px; animation: grow 0.6s ease-out; }
@keyframes grow { from { width: 0; } }
.meter b { position: relative; display: block; text-align: center; line-height: 30px; font-family: 'Nunito', sans-serif; }
.said-words { margin: 0; font-family: 'Nunito', sans-serif; font-size: 1.3rem; font-weight: 900; text-align: center; }
.w-ok { color: var(--turq-deep); }
:root[data-theme='dark'] .w-ok { color: var(--turq); }
.w-miss { color: var(--muted); text-decoration: underline wavy var(--tulip); text-underline-offset: 5px; }
.heard { margin: 0; color: var(--muted); text-align: center; }
.speak-msg p { margin: 0; text-align: center; font-weight: 800; color: var(--text); background: var(--gold-soft); border-radius: 14px; padding: 10px 12px; }
.speak-links { display: flex; flex-direction: column; align-items: center; }

.compare { display: flex; gap: 10px; width: 100%; }
.compare[hidden], .rate[hidden] { display: none; }
.chip-btn {
  flex: 1;
  min-height: 52px;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--surface);
  font-weight: 800;
}
.chip-btn:active { transform: translateY(2px); }
.rate { width: 100%; text-align: center; }
.rate-q { margin: 6px 0 8px; font-weight: 900; }
.rate-row { display: flex; gap: 8px; }
.rate-btn {
  flex: 1;
  min-height: 76px;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  background: var(--surface);
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.rate-btn span { font-size: 1.7rem; }
.rate-btn:active { transform: translateY(2px); }

.voice-status { margin: 0 0 12px; }
.field-top { margin-top: 16px; margin-bottom: 0; }
.small { font-size: 0.85rem; }

/* =====================================================
   Units 1-2 content, lesson lists, welcome (Step 5)
   ===================================================== */
/* teaching cards */
.note-card {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.note-body { margin: 0; white-space: pre-line; font-size: 1.05rem; line-height: 1.6; }
.abc { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 8px; }
.abc-key {
  min-height: 64px;
  border-radius: 14px;
  border: 2px solid var(--line);
  border-bottom-width: 4px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  font-family: 'Nunito', sans-serif;
}
.abc-key b { font-size: 1.2rem; font-weight: 900; color: var(--turq-deep); }
:root[data-theme='dark'] .abc-key b { color: var(--turq); }
.abc-key small { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.abc-key:active, .abc-key.playing { transform: translateY(2px); border-bottom-width: 2px; background: var(--turq-soft); animation: none; }
.examples { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.examples li { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-top: 2px solid var(--line); }
.examples li:first-child { border-top: none; }
.spk.spk-sm { width: 38px; height: 38px; font-size: 1rem; border-radius: 12px; box-shadow: 0 3px 0 var(--turq-deep); }
.ex-tr { font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 1.1rem; }
.ex-mean { color: var(--muted); margin-inline-start: auto; text-align: end; font-size: 0.95rem; }

/* situation questions */
.scene {
  background: var(--gold-soft);
  border-radius: 20px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.scene-emoji { font-size: 2.8rem; line-height: 1; flex: none; }
.scene p { margin: 0; font-size: 1.12rem; font-weight: 800; }
.passage p { white-space: pre-line; }

/* path: lessons done per unit */
.node-count {
  align-self: center;
  margin-top: 4px;
  font-size: 0.75rem;
  font-weight: 900;
  padding: 1px 10px;
  border-radius: 999px;
  background: var(--turq-soft);
  color: var(--turq-deep);
}
:root[data-theme='dark'] .node-count { color: var(--turq); }

/* bottom sheet with the unit's lessons */
.page-sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.2s;
}
.page-sheet {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 24px 24px 0 0;
  padding: 18px 16px calc(env(safe-area-inset-bottom) + 18px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: lesson-in 0.25s ease-out;
}
.sheet-close { position: absolute; top: 8px; inset-inline-end: 8px; }
.unit-head { display: flex; align-items: center; gap: 12px; padding-inline-end: 40px; }
.unit-emoji { font-size: 2.4rem; }
.unit-head h2 { margin: 0; font-size: 1.15rem; }
.unit-head p { margin: 0; color: var(--turq-deep); font-family: 'Nunito', sans-serif; }
:root[data-theme='dark'] .unit-head p { color: var(--turq); }
.placed-note { margin: 0; background: var(--gold-soft); border-radius: 14px; padding: 10px 12px; font-size: 0.92rem; }
.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.lesson-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  background: var(--bg);
  text-align: start;
}
.lesson-row:active:not(.locked) { transform: translateY(2px); }
.lr-ic { font-size: 1.5rem; flex: none; }
.lr-text { display: flex; flex-direction: column; }
.lr-text b { font-size: 1.02rem; }
.lr-text small { color: var(--muted); font-size: 0.82rem; font-weight: 700; }
.lesson-row.done { border-color: var(--gold); }
.lesson-row.boss { background: var(--gold-soft); }
.lesson-row.locked { opacity: 0.55; }

/* welcome + placement result */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: var(--bg);
  overflow-y: auto;
  animation: fade 0.25s;
}
.overlay-inner {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100%;
  padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 24px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  text-align: center;
}
.welcome-lang { display: flex; gap: 8px; width: 100%; max-width: 280px; }
.welcome-cat { animation: bob 3s ease-in-out infinite; }
.welcome-title { margin: 0; font-size: 1.8rem; font-weight: 900; color: var(--turq-deep); }
:root[data-theme='dark'] .welcome-title { color: var(--turq); }
.welcome-sub { margin: 0 0 6px; color: var(--muted); font-size: 1.08rem; }
.choice {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 14px 16px;
  border-radius: 20px;
  border: 2px solid var(--line);
  border-bottom-width: 6px;
  background: var(--surface);
  text-align: start;
}
.choice:active { transform: translateY(3px); border-bottom-width: 3px; }
.choice-main { border-color: var(--turq); background: var(--turq-soft); }
.choice-ic { font-size: 2rem; flex: none; }
.choice b { display: block; font-size: 1.08rem; }
.choice small { color: var(--muted); font-weight: 700; }
.skip-list { list-style: none; padding: 0; margin: 0; width: 100%; display: flex; flex-direction: column; gap: 8px; }
.skip-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 800;
  text-align: start;
}
.skip-list li span { font-size: 1.5rem; }

/* =====================================================
   Motivation: hearts, goal, progress, league (Step 6)
   ===================================================== */
.lesson-hearts { flex: none; font-weight: 900; color: var(--tulip); font-family: 'Nunito', sans-serif; }
.lesson-hearts.hurt { animation: hurt 0.5s; }
@keyframes hurt { 30% { transform: scale(1.35); } 60% { transform: scale(0.9); } }
.goal-mini { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; text-decoration: none; color: var(--muted); font-size: 0.82rem; font-weight: 800; }
.goal-mini-bar { display: block; height: 10px; border-radius: 999px; background: var(--locked); overflow: hidden; max-width: 200px; }
.goal-mini-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #f08a24); border-radius: 999px; transition: width 0.5s; }

.practice-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.practice-hero p { margin: 0; }
.due-line { font-weight: 900; color: var(--turq-deep); }
:root[data-theme='dark'] .due-line { color: var(--turq); }
.hearts-line { color: var(--muted); font-size: 0.92rem; }
.tile-off { opacity: 0.5; }
.hearts-out { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; }
.hearts-out h2 { margin: 0; font-size: 1.3rem; }
.hearts-out p { margin: 0; }

.goal-card { display: flex; flex-direction: column; gap: 14px; }
.goal-row { display: flex; align-items: center; gap: 14px; }
.goal-row .card-title { margin-bottom: 2px; }
.ring { width: 84px; height: 84px; flex: none; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 9; }
.ring-bg { stroke: var(--locked); }
.ring-fg { stroke: var(--gold); stroke-linecap: round; transition: stroke-dashoffset 0.8s ease-out; }
.ring text { transform: rotate(90deg); transform-origin: 40px 40px; font-family: 'Nunito', sans-serif; font-weight: 900; font-size: 17px; fill: var(--text); }
.seg-small { font-size: 0.82rem; min-height: 54px; padding: 4px; line-height: 1.25; }
.freeze { color: #3a8fd6; font-size: 0.78rem; font-weight: 800; }

.week-val { font-size: 0.72rem; color: var(--muted); font-weight: 900; min-height: 1em; }
.week-bar.has { background: linear-gradient(var(--gold), var(--gold-deep)); }
.week-col.today span { color: var(--turq-deep); font-weight: 900; }
:root[data-theme='dark'] .week-col.today span { color: var(--turq); }

.level-bar { position: relative; height: 18px; border-radius: 999px; background: var(--locked); overflow: hidden; }
.level-bar i { position: absolute; top: 0; bottom: 0; left: 0; background: linear-gradient(90deg, var(--turq), var(--gold)); border-radius: 999px; }
.lv-mark { position: absolute; top: 0; bottom: 0; left: var(--at); width: 3px; background: var(--surface); }
.level-labels { position: relative; height: 20px; margin: 4px 0 8px; font-size: 0.8rem; font-weight: 900; color: var(--muted); }
.level-labels span { position: absolute; left: var(--at, 0); transform: translateX(var(--shift, 0)); }
.level-labels span:not(:first-child) { --shift: -50%; }

.league { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.league li { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 14px; background: var(--bg); }
.league li.me { background: var(--turq-soft); border: 2px solid var(--turq); }
.league .rank { width: 28px; text-align: center; font-weight: 900; }
.league .who { flex: 1; font-weight: 800; }
.league b { font-family: 'Nunito', sans-serif; }

/* =====================================================
   Cat mascot animations (Step 7)
   ===================================================== */
.cat-anim .cat-tail { animation: tail-wag 2.4s ease-in-out infinite; }
.cat-anim .cat-eyes { transform-origin: 50px 53px; animation: blink 4.5s infinite; }
.cat-anim.cat-cheering .cat-paw-l { animation: paw-up 0.6s ease-in-out infinite alternate; }
.cat-anim.cat-cheering .cat-paw-r { animation: paw-up 0.6s ease-in-out infinite alternate-reverse; }
.cat-anim .cat-paw-wave { animation: paw-wave 1.2s ease-in-out infinite; }
.cat-anim .cat-zzz { animation: zzz 2.5s ease-in-out infinite; }
@keyframes tail-wag { 50% { transform: rotate(-14deg); } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(0.1); } }
@keyframes paw-up { to { transform: translateY(-5px) rotate(-8deg); } }
@keyframes paw-wave { 50% { transform: rotate(18deg); } }
@keyframes zzz { 50% { transform: translateY(-4px); opacity: 0.5; } }

/* ===== celebrations, feedback cat, shop (Step 7) ===== */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 70; }
.toast { z-index: 60; }
.chip.pop { animation: pop 0.45s ease-out; }
.hero-cat { border: none; background: none; padding: 0; cursor: pointer; }
.hero-cat.petted { animation: petted 0.6s ease-out; }
@keyframes petted { 30% { transform: translateY(-14px) scale(1.08) rotate(-6deg); } 60% { transform: translateY(0) scale(0.96); } }
.fb-row { display: flex; align-items: center; gap: 10px; }
.fb-cat { flex: none; animation: pop-in 0.3s ease-out; }
.fstat-red { border-color: var(--tulip); }
.fstat-red span { background: var(--tulip); }
.finish-stats .fstat b { font-size: 1.3rem; }

.ms-kicker { background: var(--gold); color: #3a2a00; font-weight: 900; padding: 6px 16px; border-radius: 999px; animation: pop-in 0.4s ease-out; }
.ms-bonus { font-weight: 900; font-size: 1.2rem; color: var(--gold-deep); background: var(--gold-soft); padding: 8px 18px; border-radius: 16px; }
:root[data-theme='dark'] .ms-bonus { color: var(--gold); }
.ms-letter {
  width: 100%;
  background: var(--surface);
  border: 2px dashed var(--tulip);
  border-radius: 20px;
  padding: 14px 16px;
  animation: slide-in 0.5s 0.3s ease-out both;
}
.ms-letter h2 { margin: 0 0 6px; font-size: 1rem; color: var(--tulip); }
.ms-letter p { margin: 6px 0 0; font-weight: 700; }
.ms-letter p[lang='tr'] { color: var(--turq-deep); font-size: 1.08rem; }
:root[data-theme='dark'] .ms-letter p[lang='tr'] { color: var(--turq); }

.shop-card .shop-card-text { margin-bottom: 12px; }
.shop-balance { margin: 6px 0 0; font-weight: 800; }
.shop-balance b { color: var(--gold-deep); font-size: 1.15rem; }
:root[data-theme='dark'] .shop-balance b { color: var(--gold); }
.shop { display: flex; flex-direction: column; gap: 10px; }
.shop-head { display: flex; align-items: center; gap: 12px; padding-inline-end: 40px; }
.shop-head h2 { margin: 0; font-size: 1.3rem; }
.shop-group { margin: 8px 0 0; font-size: 1rem; color: var(--muted); }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.shop-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 6px 10px;
  border-radius: 16px;
  border: 2px solid var(--line);
  border-bottom-width: 5px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.shop-item:active { transform: translateY(2px); }
.shop-item b { font-size: 0.95rem; font-family: 'Nunito', sans-serif; }
.shop-item small { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.shop-price { margin-top: 4px; font-weight: 900; font-size: 0.85rem; padding: 2px 10px; border-radius: 999px; background: var(--gold-soft); }
.shop-item.owned .shop-price { background: var(--turq-soft); }
.shop-item.wearing { border-color: var(--turq); background: var(--turq-soft); }
.shop-item.wearing .shop-price { background: var(--turq); color: #fff; }
.shop-item.poor { opacity: 0.6; }
/* while a celebration screen is open, messages appear at the top so they don't cover its button */
body:has(.overlay) .toast { bottom: auto; top: calc(env(safe-area-inset-top) + 16px); transform: translate(-50%, -20px); }
body:has(.overlay) .toast.show { transform: translate(-50%, 0); }

/* ===== reminders and install guide (Step 8) ===== */
.remind-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--gold-soft);
  border: 2px solid var(--gold);
  border-radius: var(--radius);
  padding: 12px 14px;
  animation: slide-in 0.4s ease-out;
}
.remind-card p { margin: 0; }
.remind-ic { font-size: 2rem; animation: ring 2.4s ease-in-out infinite; }
@keyframes ring { 0%, 70%, 100% { transform: rotate(0); } 75% { transform: rotate(-15deg); } 85% { transform: rotate(15deg); } 95% { transform: rotate(-8deg); } }
.install-card { display: flex; gap: 12px; align-items: flex-start; border: 2px solid var(--turq); }
.install-ic { font-size: 2.2rem; }
.install-card .card-title { margin-bottom: 4px; }
.install-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.install-actions .btn { min-height: 46px; padding: 0 18px; }
.install-warn { margin: 0; background: var(--gold-soft); border-radius: 14px; padding: 10px 12px; font-weight: 700; font-size: 0.95rem; text-align: start; }
.install-steps { list-style: none; counter-reset: step; margin: 0; padding: 0; width: 100%; display: flex; flex-direction: column; gap: 10px; text-align: start; }
.install-steps li {
  counter-increment: step;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 10px 12px;
  font-weight: 700;
}
.install-steps li::before {
  content: counter(step);
  flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--turq); color: #fff; font-weight: 900;
}
.step-ic { flex: none; font-size: 1.4rem; display: grid; place-items: center; width: 30px; }
.time-input {
  font: inherit; font-weight: 800;
  padding: 8px 10px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--bg);
  color: var(--text);
  min-height: 44px;
}
.remind-help { margin-top: 8px; }
