:root {
  --paper:    #eef1f6;
  --paper-2:  #e2e7f0;
  --surface:  #ffffff;
  --ink:      #1b2a4a;
  --ink-soft: #5d6a85;
  --line:     #d3dae6;
  --line-deep:#b3bdcf;

  --red:      #e03131;   /* ಕೆಂಪು — brand, headers, the poem itself */
  --red-d:    #b02525;
  --gold:     #f4b400;   /* ಹಳದಿ — reward, XP, unlocks */
  --gold-d:   #c98f00;
  --indigo:   #1c5fd6;   /* interactive: selected, speakers, links */
  --indigo-d: #1548a8;

  --ok:       #2f9e44;
  --ok-d:     #22803a;
  --ok-bg:    #d7f5dd;
  --ok-ink:   #1d7a33;
  --no-bg:    #ffe3e3;
  --no-ink:   #c92a2a;

  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;

  --kn: "Baloo Tamma 2", "Noto Sans Kannada", "Kannada Sangam MN", system-ui, sans-serif;
  --ui: "Nunito", "Baloo Tamma 2", system-ui, -apple-system, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #151a24; --paper-2: #1c2430; --surface: #212b39;
    --ink: #eef2f8; --ink-soft: #9aa6bd; --line: #33404f; --line-deep: #47576b;
    --ok-bg: #1a3d22; --ok-ink: #a9e8b6; --no-bg: #45191c; --no-ink: #ff9a9a;
    --gold: #ffc736; --red: #ff5a5a; --indigo: #5b9bff;
  }
}
:root[data-theme="dark"] {
  --paper: #151a24; --paper-2: #1c2430; --surface: #212b39;
  --ink: #eef2f8; --ink-soft: #9aa6bd; --line: #33404f; --line-deep: #47576b;
  --ok-bg: #1a3d22; --ok-ink: #a9e8b6; --no-bg: #45191c; --no-ink: #ff9a9a;
  --gold: #ffc736; --red: #ff5a5a; --indigo: #5b9bff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ui);
  font-weight: 700;
}
#app { max-width: 720px; margin: 0 auto; min-height: 100dvh; display: flex; flex-direction: column; overflow-x: hidden; }
.kn { font-family: var(--kn); font-weight: 600; line-height: 1.5; }
:focus-visible { outline: 3px solid var(--indigo); outline-offset: 2px; }
#topbar {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 18px calc(10px + env(safe-area-inset-top));
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter: blur(8px);
}
#topbar.hidden { display: none; }
.stat { display: flex; align-items: center; gap: 5px; font-size: 16px; font-variant-numeric: tabular-nums; }
.stat-ico { font-size: 17px; }
.stat-num { color: var(--ink-soft); }
.icon-btn { margin-left: auto; border: 0; background: transparent; cursor: pointer;
  font-size: 21px; padding: 6px; border-radius: 9px; color: var(--ink); }
.icon-btn.muted { opacity: .35; }
.icon-btn.quit { margin-left: 0; color: var(--ink-soft); font-weight: 900; font-size: 19px; }
.screen { display: none; flex: 1; flex-direction: column; }
.screen.active { display: flex; }
.hero { display: flex; gap: 14px; align-items: center; padding: 2px 20px 10px; }
.hero-mascot { width: 84px; flex: none; }
.hero-eyebrow { font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--red); font-weight: 900; }
.hero h1 { font-size: 33px; margin: 2px 0 0; line-height: 1.25; text-wrap: balance; }
.hero-sub { margin: 2px 0 0; font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.lede { margin: 4px 20px 16px; font-size: 14px; color: var(--ink-soft); font-family: var(--kn); line-height: 1.6; }
.lede-en { display: block; font-family: var(--ui); font-size: 12.5px; opacity: .8; margin-top: 2px; }
#scroll { padding: 0 16px; display: flex; flex-direction: column; gap: 10px; }
.stanza {
  display: grid; grid-template-columns: 34px 1fr; gap: 10px;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 14px 16px; position: relative;
}
.stanza.next { border-color: var(--red); box-shadow: 0 0 0 3px color-mix(in srgb, var(--red) 18%, transparent); }
.st-num {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center;
  background: var(--line); color: var(--ink-soft); font-size: 14px; font-weight: 900;
  font-variant-numeric: tabular-nums;
}
.stanza.open .st-num { font-size: 15px; background: var(--gold); color: #5a4200; }
.stanza.next .st-num { background: var(--red); color: #fff; }
.st-body { display: flex; flex-direction: column; gap: 1px; }
.st-line { font-size: 19px; line-height: 1.55; }
.stanza.shut .st-line {
  filter: blur(5.5px);
  opacity: .5;
  user-select: none;
  pointer-events: none;
}
@supports not (filter: blur(1px)) {          /* ancient fallback: solid bars */
  .stanza.shut .st-line { color: transparent; background: var(--line); border-radius: 5px; margin: 3px 0; }
}
.st-foot { grid-column: 2; display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.st-lock { font-family: var(--kn); font-size: 13px; color: var(--ink-soft); }
.st-go {
  border: 0; border-radius: var(--r-md); background: var(--red); color: #fff;
  font-family: var(--kn); font-size: 15px; font-weight: 600; padding: 8px 20px 10px;
  cursor: pointer; box-shadow: 0 4px 0 var(--red-d);
}
.st-go:active { transform: translateY(4px); box-shadow: 0 0 0 var(--red-d); }
.mini {
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-md); font-family: var(--kn); font-size: 14px; font-weight: 600;
  padding: 5px 14px 7px; cursor: pointer;
}
.mini.wide { width: 100%; margin-top: 10px; padding: 10px; }
.mini:active { transform: translateY(2px); }
.finale-card {
  display: flex; align-items: center; gap: 14px; width: calc(100% - 32px);
  margin: 16px; padding: 16px; border-radius: var(--r-lg); cursor: pointer;
  border: 2px dashed var(--line-deep); background: transparent; color: var(--ink);
  font-family: inherit; text-align: left;
}
.finale-card.ready { border-style: solid; border-color: var(--gold);
  background: color-mix(in srgb, var(--gold) 16%, var(--surface)); box-shadow: 0 4px 0 var(--gold-d); }
.finale-card:not(.ready) { opacity: .55; cursor: not-allowed; }
.fin-ico { font-size: 30px; }
.fin-title { font-size: 21px; }
.fin-state { font-size: 12.5px; color: var(--ink-soft); font-family: var(--kn); }
.foot { text-align: center; font-size: 11.5px; color: var(--ink-soft); padding: 6px 0 30px; }
.cycle-top { display: flex; align-items: center; gap: 12px; padding: 10px 18px 6px; }
.bar { flex: 1; height: 14px; background: var(--line); border-radius: 99px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; border-radius: 99px; background: var(--red);
  transition: width .35s cubic-bezier(.2,.8,.3,1); }
.hearts { display: flex; gap: 1px; font-size: 13px; }
.hearts .h.gone { filter: grayscale(1); opacity: .3; }
.cycle-name { padding: 0 18px; font-size: 13px; color: var(--red); font-weight: 700; }
.cycle-body { flex: 1; padding: 8px 18px 20px; }
.ex-title { display: flex; flex-direction: column; gap: 1px; }
.hint { font-family: var(--kn); font-size: 14.5px; color: var(--ink-soft);
  background: var(--paper-2); border-radius: var(--r-md); padding: 10px 13px; margin-bottom: 14px; line-height: 1.6; }
.hint-en { font-family: var(--ui); font-size: 12.5px; }
.prompt { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.p-kn { font-size: 34px; line-height: 1.35; }
.p-kn.huge { font-size: 78px; }
.p-tr, .p-en { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.p-ka { font-size: 21px; }
.p-emoji { font-size: 50px; }
.p-ante { font-size: 18px; color: var(--ink-soft); }
.speaker {
  flex: none; width: 56px; height: 56px; border-radius: var(--r-md); border: 0;
  background: var(--indigo); color: #fff; font-size: 24px; cursor: pointer;
  box-shadow: 0 4px 0 var(--indigo-d); display: grid; place-items: center;
}
.speaker:active { transform: translateY(4px); box-shadow: 0 0 0 var(--indigo-d); }
.speaker.big { width: 86px; height: 86px; font-size: 36px; margin: 6px auto 22px; }
.speaker.playing { animation: wiggle .4s ease-in-out; }
@keyframes wiggle { 25% { transform: rotate(-7deg); } 75% { transform: rotate(7deg); } }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-1 { display: grid; gap: 10px; }
.choice {
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: var(--r-md); padding: 14px 12px; cursor: pointer; text-align: center;
  font-family: inherit; color: inherit;
}
.choice:active { transform: translateY(2px); border-bottom-width: 2px; }
.choice.sel { border-color: var(--indigo); background: color-mix(in srgb, var(--indigo) 12%, var(--surface)); }
.choice.ok { border-color: var(--ok); background: var(--ok-bg); }
.choice.no { border-color: var(--no-ink); background: var(--no-bg); animation: shake .4s; }
.c-kn { font-size: 24px; line-height: 1.4; }
.c-kn.big { font-size: 32px; }
.c-ka { font-size: 19px; }
.c-tr, .c-en { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
@keyframes shake { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-7px)} 40%{transform:translateX(7px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
.card { text-align: center; background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 18px 24px; }
.pill { display: inline-block; background: var(--gold); color: #5a4200; font-size: 11px;
  letter-spacing: 1px; padding: 3px 12px; border-radius: 99px; font-weight: 900; }
.card-emoji { font-size: 62px; line-height: 1.2; margin-top: 6px; animation: pop .4s cubic-bezier(.2,1.4,.4,1); }
@keyframes pop { from { transform: scale(.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.card-kn { font-size: 46px; line-height: 1.3; }
.card-tr { font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.card-ka { font-size: 22px; color: var(--red); margin-top: 12px; }
.card-en { font-size: 15px; color: var(--ink-soft); font-weight: 700; }
.card .speaker { margin: 18px auto 0; }
.tiles { display: flex; flex-wrap: wrap; gap: 9px; justify-content: center; margin-bottom: 18px; }
.otile {
  min-width: 62px; background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: var(--r-md); font-size: 30px; padding: 8px 14px 12px; cursor: pointer; color: inherit;
}
.otile.sel { border-color: var(--indigo); background: color-mix(in srgb, var(--indigo) 14%, var(--surface)); }
.otile.gone { opacity: 0; pointer-events: none; }
.buckets { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bucket {
  border: 3px dashed var(--line-deep); border-radius: var(--r-lg); background: var(--surface);
  padding: 12px 10px; min-height: 132px; cursor: pointer; color: inherit; font-family: inherit;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.bucket.no { border-color: var(--no-ink); background: var(--no-bg); animation: shake .4s; }
.b-kn { font-family: var(--kn); font-size: 21px; }
.b-en { font-size: 11px; color: var(--ink-soft); }
.b-drop { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin-top: 8px; }
.chip { background: var(--ok-bg); color: var(--ok-ink); border-radius: var(--r-sm);
  padding: 3px 9px; font-size: 20px; }
.unlock { text-align: center; padding: 6px 0; }
.unlock-badge {
  display: inline-block; background: var(--gold); color: #5a4200; font-family: var(--kn);
  font-size: 16px; padding: 6px 18px 8px; border-radius: 99px; font-weight: 700;
  animation: pop .45s cubic-bezier(.2,1.4,.4,1);
}
.unlock-badge.big { font-size: 19px; }
.unlock-sub { font-family: var(--kn); font-size: 14px; color: var(--ink-soft); margin: 10px 0 18px; }
.unlock-lines { display: flex; flex-direction: column; gap: 4px; }
.ul-line { font-size: 27px; color: var(--line-deep); transition: color .35s, transform .35s; }
.ul-line.read { color: var(--ink); }
.ul-line.lit { color: var(--red); transform: scale(1.04); }
.reader { display: flex; flex-direction: column; gap: 8px; }
.rline { position: relative; }
.rline:active { transform: translateY(2px); }
.rl-kn { font-family: var(--kn); font-size: 25px; line-height: 1.4; }
.rl-tr { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.rl-en { font-size: 13.5px; color: var(--indigo); font-weight: 700; margin-top: 3px; }
.blank-line { font-size: 26px; line-height: 1.7; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--r-md); padding: 16px; margin-bottom: 16px; }
.gap { color: var(--red); letter-spacing: 2px; }
.slots { min-height: 132px; border-top: 2px solid var(--line); border-bottom: 2px solid var(--line);
  padding: 8px 0; display: flex; flex-direction: column; gap: 5px; margin-bottom: 18px; }
.bank { display: flex; flex-direction: column; gap: 8px; }
.ltile {
  background: var(--surface); border: 2px solid var(--line); border-bottom-width: 4px;
  border-radius: var(--r-md); padding: 9px 14px; cursor: pointer; color: inherit;
  font-size: 22px; text-align: left;
}
.ltile:active { transform: translateY(2px); border-bottom-width: 2px; }
.ltile.spent { opacity: 0; pointer-events: none; }
.twist { border-color: var(--gold); }
.twist-kn { font-family: var(--kn); font-size: 29px; line-height: 1.55; color: var(--red); }
.twist-en { font-size: 13px; color: var(--ink-soft); font-weight: 700; margin-top: 6px; }
.twist-hint { font-family: var(--kn); font-size: 15px; color: var(--ink-soft); margin-top: 16px; }
.feedback {
  position: sticky; bottom: 0; transform: translateY(110%); visibility: hidden;
  transition: transform .25s cubic-bezier(.2,.9,.3,1), visibility .25s;
  padding: 13px 18px 4px; background: var(--ok-bg); border-radius: var(--r-lg) var(--r-lg) 0 0;
}
.feedback.show { transform: translateY(0); visibility: visible; }
.feedback.bad { background: var(--no-bg); }
.fb-inner { display: flex; align-items: center; gap: 12px; }
.fb-mascot { width: 50px; flex: none; }
.fb-head { font-size: 20px; color: var(--ok-ink); }
.feedback.bad .fb-head { color: var(--no-ink); }
.fb-sub { font-size: 14px; font-weight: 700; color: var(--ok-ink); opacity: .95; line-height: 1.5; }
.feedback.bad .fb-sub { color: var(--no-ink); }
.fb-sub .kn { font-family: var(--kn); font-size: 18px; }
.cycle-foot { padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); }
.feedback.show ~ .cycle-foot { background: var(--ok-bg); }
.feedback.show.bad ~ .cycle-foot { background: var(--no-bg); }
.big-btn {
  width: 100%; border: 0; border-radius: var(--r-md); padding: 14px 20px;
  font-family: var(--kn); font-weight: 600; font-size: 18px; color: #fff;
  cursor: pointer; background: var(--ok); box-shadow: 0 5px 0 var(--ok-d);
}
.big-btn:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 var(--ok-d); }
.big-btn:disabled { background: var(--line); box-shadow: 0 5px 0 var(--line-deep); color: var(--ink-soft); cursor: default; }
.big-btn.red { background: var(--red); box-shadow: 0 5px 0 var(--red-d); }
.big-btn.ghost { background: transparent; box-shadow: none; color: var(--ink-soft); margin-top: 8px; }
#screen-done, #screen-finale { position: relative; }
#confetti, #finale-confetti { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 5; }
.mid { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 22px calc(30px + env(safe-area-inset-bottom)); gap: 10px; position: relative; z-index: 10; }
.mid-mascot { width: 120px; }
.big-kn { font-family: var(--kn); font-size: 40px; margin: 4px 0 0; color: var(--red); }
.done-stanza { font-size: 24px; line-height: 1.6; color: var(--red); margin: 6px 0 4px; }
.stats-row { display: flex; gap: 10px; margin: 12px 0 4px; }
.stat-box { border: 3px solid var(--gold); border-radius: var(--r-md); width: 120px; overflow: hidden; }
.stat-box.acc { border-color: var(--indigo); }
.sb-label { display: block; background: var(--gold); color: #5a4200; font-size: 11px;
  letter-spacing: 1px; padding: 3px; font-family: var(--kn); font-weight: 700; }
.stat-box.acc .sb-label { background: var(--indigo); color: #fff; }
.sb-val { display: block; font-size: 24px; padding: 6px 0; color: var(--gold-d); font-variant-numeric: tabular-nums; }
.stat-box.acc .sb-val { color: var(--indigo); }
.done-note { font-family: var(--kn); font-size: 15px; color: var(--ink-soft); margin: 6px 0 14px; line-height: 1.6; }
.en-note { font-family: var(--ui); font-size: 13px; }
.mid .big-btn { max-width: 340px; }
.finale-wrap { padding: 16px 18px calc(30px + env(safe-area-inset-bottom)); position: relative; z-index: 10;
  display: flex; flex-direction: column; gap: 14px; }
.finale-head { display: flex; gap: 12px; align-items: center; }
.finale-mascot { width: 74px; flex: none; }
.finale-head h2 { font-size: 28px; margin: 0; }
.finale-sub { font-family: var(--kn); font-size: 14px; color: var(--ink-soft); margin: 2px 0 0; }
.finale-poem { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 18px; display: flex; flex-direction: column; gap: 16px; }
.fin-stanza { display: flex; flex-direction: column; gap: 2px; }
.fin-line { font-size: 23px; line-height: 1.55; cursor: pointer; border-radius: var(--r-sm);
  padding: 2px 6px; transition: background .25s, color .25s; text-align: left;
  background: none; border: 0; color: inherit; font-family: var(--kn); }
.fin-line:hover { background: var(--paper-2); }
.fin-line.lit { background: var(--gold); color: #5a4200; }
.tagline { text-align: center; font-family: var(--kn); font-size: 19px; color: var(--red); line-height: 1.6; }
.tag-en { font-family: var(--ui); font-size: 12.5px; color: var(--ink-soft); font-weight: 700; }
.quiz-head { font-size: 21px; margin: 8px 0 0; }
.quiz-card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 14px; margin-bottom: 12px; }
.quiz-card.answered { border-color: var(--ok); }
.q-kn { font-size: 19px; line-height: 1.5; }
.q-en { font-size: 12.5px; color: var(--ink-soft); font-weight: 700; margin: 2px 0 10px; }
@media (prefers-reduced-motion: reduce) { *, *::after { animation: none !important; transition: none !important; } }
.rline.lit { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 15%, var(--surface)); }
.p-eg { font-size: 15px; color: var(--ink-soft); margin-top: 6px; }
.t-kn { font-size: 21px; line-height: 1.35; }
.t-en { font-family: var(--ui); font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.card-br, .c-br, .p-br {
  font-family: var(--ui); font-weight: 700; color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.card-br { font-size: 14px; margin-top: 2px; }
.c-br { font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.p-br { font-size: 12.5px; margin-top: 1px; }
.card-meaning {
  margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--line);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.card-meaning .card-ka { margin-top: 0; }
.speaker.small { width: 40px; height: 40px; font-size: 17px; box-shadow: 0 3px 0 var(--indigo-d); }
.speaker.small:active { transform: translateY(3px); box-shadow: 0 0 0 var(--indigo-d); }
.card-note { font-size: 14px; color: var(--ink-soft); background: var(--paper-2);
  border-radius: var(--r-md); padding: 9px 12px; margin-top: 14px; line-height: 1.6; }
.note-en { font-family: var(--ui); font-size: 12.5px; font-weight: 700; margin-top: 4px; opacity: .9; }
.card > .speaker.small, .card-meaning .speaker.small { margin: 12px auto 0; }
.stage-strip { display: flex; align-items: center; justify-content: center;
  gap: 4px; flex-wrap: wrap; padding: 4px 16px 18px; }
.stage-pip { text-align: center; opacity: .32; filter: grayscale(1);
  transition: opacity .4s, filter .4s; min-width: 54px; }
.stage-pip.lit { opacity: 1; filter: none; }
.pip-emoji { font-size: 25px; line-height: 1.2; }
.pip-kn { font-size: 12px; color: var(--ink-soft); }
.stage-pip.lit .pip-kn { color: var(--indigo); font-weight: 700; }
.pip-arrow { color: var(--line-deep); font-size: 15px; margin-bottom: 14px; }
.found { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; min-height: 30px; }
.ltile.stage { display: flex; align-items: center; gap: 10px; font-size: 17px; line-height: 1.4; }
.ltile.stage .st-emoji { font-size: 22px; flex: none; }
.faded { visibility: hidden; }
#ex-body.show-tr .faded { visibility: visible; }
.tr-reveal {
  display: block; margin: 18px auto 0; padding: 9px 18px;
  border: 2px dashed var(--line-deep); border-radius: var(--r-md);
  background: transparent; color: var(--ink-soft); cursor: pointer;
  font-family: var(--kn); font-size: 15px; font-weight: 600;
}
.tr-reveal:active { transform: translateY(2px); }
.tr-reveal .tr-en { font-family: var(--ui); font-size: 11.5px; font-weight: 700; opacity: .75; }
#ex-body.hide-stage-emoji .ltile.stage .st-emoji { visibility: hidden; }
.st-hook { background: color-mix(in srgb, var(--red) 9%, var(--surface));
  border-left: 4px solid var(--red); border-radius: 0 8px 8px 0;
  padding: 8px 12px; margin-bottom: 10px; }
.st-hook .kn { font-size: 17px; display: block; color: var(--red); }
.hook-en { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.rl-kn .w { background: none; border: 0; padding: 1px 2px; margin: 0; cursor: pointer;
  font-family: var(--kn); font-size: inherit; color: inherit; border-radius: 4px;
  border-bottom: 2px dotted transparent; }
.rl-kn .w:hover { border-bottom-color: var(--line-deep); }
.rl-kn .w.on { background: var(--gold); color: #5a4200; }
.line-say { position: absolute; top: 8px; right: 8px; padding: 3px 9px; font-size: 13px; }
.gloss-slot { min-height: 46px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px;
  background: var(--paper-2); border-radius: var(--r-md); padding: 10px 13px; margin-top: 4px; }
.gloss-kn { font-size: 21px; }
.gloss-tr { font-size: 13px; color: var(--ink-soft); font-weight: 700; }
.gloss-en { font-size: 13.5px; font-weight: 700; flex-basis: 100%; }
.gloss-none { color: var(--ink-soft); font-size: 14px; }
.quote { font-size: 22px; line-height: 1.55; background: var(--surface);
  border: 2px solid var(--line); border-left: 5px solid var(--gold);
  border-radius: 0 var(--r-md) var(--r-md) 0; padding: 14px 16px; margin-bottom: 16px; }
.wrong-line { font-size: 20px; line-height: 1.5; background: var(--no-bg);
  border-radius: var(--r-md); padding: 12px 14px; margin-bottom: 16px; color: var(--no-ink); }
.c-kn.small { font-size: 18px; line-height: 1.5; }
.gloss-en.soft { color: var(--ink-soft); font-weight: 700; }
.gloss-root { font-size: 15px; color: var(--red); font-weight: 600; }
.rl-kn .punct { opacity: .5; }
.wordslots, .wordbank { display: flex; flex-wrap: wrap; gap: 8px; align-content: flex-start; }
.wordslots { min-height: 76px; }
.ltile.word { font-size: 20px; padding: 7px 13px; }
.stem-line { font-size: 30px; text-align: center; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--r-md); padding: 18px 14px;
  margin-bottom: 16px; line-height: 1.5; }
.stem-plus { color: var(--ink-soft); font-family: var(--ui); font-size: 22px; margin: 0 6px; }
.stem-gap { color: var(--red); border-bottom: 3px dashed var(--red); padding: 0 18px; }
.riddle { font-size: 21px; line-height: 1.6; background: var(--surface);
  border: 2px solid var(--gold); border-radius: var(--r-md); padding: 16px; margin-bottom: 16px; }
.riddle-en { font-family: var(--ui); font-size: 13px; font-weight: 700;
  color: var(--ink-soft); margin-top: 8px; }
.riddle-open { background: var(--paper-2); border-radius: var(--r-md); padding: 14px 16px; }
.riddle-open .kn { font-size: 17px; }
.ro-en { font-size: 13px; color: var(--ink-soft); font-weight: 700; margin-top: 6px; line-height: 1.6; }
.c-word { font-family: var(--ui); font-size: 20px; font-weight: 800; letter-spacing: .2px; }
.p-kn.big { font-size: 34px; }
.quote-en { font-family: var(--ui); font-size: 13px; font-weight: 700;
  color: var(--ink-soft); margin-top: 8px; line-height: 1.55; }
.quote mark { background: var(--gold); color: #5a4200; padding: 0 4px; border-radius: 4px; }
.verb-line { font-size: 25px; line-height: 2; background: var(--surface);
  border: 2px solid var(--line); border-radius: var(--r-md); padding: 16px; text-align: center; }
.verb-line .w.big { font-size: 25px; padding: 3px 6px; border-radius: 6px;
  border-bottom: 2px dotted var(--line-deep); }
.verb-line .w.sel { background: var(--indigo); color: #fff; border-bottom-color: transparent; }
.verb-line .w.ok { background: var(--ok); color: #fff; }
.verb-line .w.no { background: var(--no-ink); color: #fff; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.stem-en { text-align: center; font-size: 13.5px; color: var(--ink-soft);
  font-weight: 700; margin: 8px 0 16px; }
.c-kn.huge { font-size: 44px; }
.clue-card { background: var(--surface); border: 2px solid var(--gold);
  border-radius: var(--r-md); padding: 15px 17px; margin-bottom: 16px; }
.clue-kn { font-size: 19px; line-height: 1.55; }
.clue-en { font-family: var(--ui); font-size: 13px; font-weight: 700;
  color: var(--ink-soft); margin-top: 7px; }

/* ===========================================================================
 * Added by the merge. Everything above came from the seventeen chapter apps.
 * ======================================================================== */

/* ---- the line reader (ಪಾಠ 1 and ಪಾಠ 4) --------------------------------
 * Both readers now live in one app, so the poem reader's line — which IS a
 * button — needs its own look rather than overwriting the prose reader's
 * `position: relative` container. */
.rline-btn {
  text-align: left;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 14px;
  cursor: pointer;
  color: inherit;
  font-family: inherit;
  width: 100%;
}
.rline-btn:hover { border-color: var(--gold); }

/* ---- the book: contents page ---------------------------------------- */
.book-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.chapter {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-md); padding: 12px 14px; cursor: pointer;
  color: inherit; font-family: inherit; width: 100%;
}
.chapter:hover { border-color: var(--gold); }
.chapter.full { border-color: var(--ok); }
.chapter.passed { border-color: var(--ok); background: var(--ok-bg); }
.ch-num {
  flex: 0 0 34px; height: 34px; border-radius: 50%;
  background: var(--gold); color: #5a4200;
  display: grid; place-items: center; font-weight: 800; font-size: 15px;
}
.chapter.passed .ch-num { background: var(--ok); color: #fff; }
.ch-body { flex: 1 1 auto; min-width: 0; }
.ch-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.ch-title { font-size: 20px; line-height: 1.35; }
.ch-en { font-size: 12px; color: var(--ink-soft); margin-bottom: 6px; }
.ch-bar { height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.ch-bar i { display: block; height: 100%; background: var(--ok); border-radius: 99px; }
.ch-meta { font-size: 12px; color: var(--ink-soft); margin-top: 5px; }
.bs-en { display: block; font-size: 12px; color: var(--ink-soft); }

/* ---- the exam card on a chapter's home ------------------------------- */
.exam-card {
  display: flex; gap: 12px; align-items: center; text-align: left; width: 100%;
  background: var(--surface); border: 2px dashed var(--line);
  border-radius: var(--r-md); padding: 14px; margin-top: 12px;
  color: inherit; font-family: inherit; cursor: default; opacity: .65;
}
.exam-card.ready { border-style: solid; border-color: var(--red); opacity: 1; cursor: pointer; }
.ex-ico { font-size: 30px; flex: 0 0 auto; }
.ex-kind { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-soft); }
.ex-title { font-size: 20px; }
.ex-state { font-size: 13px; color: var(--ink-soft); }

/* ---- the exam itself -------------------------------------------------
 * Deliberately plainer than the rest of the app: no mascot, no colour on the
 * options, nothing that says right or wrong until the paper is handed in. */
body.exam-mode { background: var(--paper-2); }
.exam-clock {
  font-weight: 800; font-size: 15px; flex: 0 0 auto;
  font-variant-numeric: tabular-nums; color: var(--ink-soft);
}
.exam-clock.low { color: var(--red); }
.exam-head {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 10px; padding: 8px 16px 0;
}
.exam-name { font-size: 17px; font-weight: 700; }
.exam-count { font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.exam-sec {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  font-size: 14px; font-weight: 700; color: var(--ink-soft);
  border-bottom: 2px solid var(--line); padding-bottom: 6px; margin-bottom: 12px;
}
.exam-sec .marks { font-size: 12px; font-weight: 700; color: var(--red); white-space: nowrap; }
.exam-q { font-size: 21px; line-height: 1.55; margin-bottom: 14px; }
.exam-hint { font-size: 13px; color: var(--ink-soft); margin: 8px 0; }
.exam-write {
  width: 100%; font-family: inherit; font-size: 18px; line-height: 1.6;
  border: 2px solid var(--line); border-radius: var(--r-md); padding: 12px;
  background: var(--surface); color: inherit; resize: vertical;
}
.exam-write:focus { outline: none; border-color: var(--gold); }
.exam-foot { display: flex; gap: 10px; }
.exam-foot .big-btn { flex: 1 1 auto; }
.exam-foot .big-btn.ghost { flex: 0 0 34%; }
/* An exam option is selected, never graded on screen. */
body.exam-mode .choice.sel { border-color: var(--gold); box-shadow: inset 0 0 0 2px var(--gold); }

/* ---- the result sheet ------------------------------------------------ */
.res-marks { font-size: 14px; color: var(--ink-soft); }
.res-marks .big { font-size: 34px; font-weight: 800; color: var(--ink); }
.sheet {
  background: var(--surface); border: 2px solid var(--line);
  border-radius: var(--r-md); padding: 14px; margin: 16px 0;
}
.sheet h3 { font-size: 16px; margin-bottom: 10px; }
.sheet .row { padding: 10px 0; border-bottom: 1px solid var(--line); }
.sheet .row:last-child { border-bottom: none; }
.sheet .rq { font-size: 17px; line-height: 1.5; margin-bottom: 4px; }
.sheet .ra { font-size: 14px; color: var(--ink-soft); }
.sheet .bad { color: var(--red); }
.sheet .good { color: var(--ok); }
.sheet .warn { font-size: 13px; color: var(--gold-d); background: var(--paper-2); border-radius: 8px; padding: 6px 9px; margin-top: 6px; }
.sheet .written-note { font-size: 14px; color: var(--ink-soft); }
