/* 291 Academy learner app
   body.adult = navy, calm, elegant (10+)
   body.kids  = light sky blue + soft green (under 10) */

body.adult {
  --bg: #0B1F3A; --card: #12305A; --line: #1E3D66; --text: #FFF8E7; --muted: #A9B6C8;
  --primary: #C49A6C; --primary-text: #0B1F3A; --accent: #7EC8E3; --good: #4CAF7A; --bad: #E26A5A;
  --font: "Nunito", system-ui, sans-serif; --radius: 16px;
}
body.kids {
  --bg: #DFF3FB; --card: #FFFFFF; --line: #BFE6F5; --text: #12305A; --muted: #4F6B85;
  --primary: #3FAE5A; --primary-text: #FFFFFF; --accent: #2F9BD0; --good: #3FAE5A; --bad: #E26A5A;
  --font: "Baloo 2", "Nunito", system-ui, sans-serif; --radius: 22px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--bg); color: var(--text); font-family: var(--font); transition: background .4s; }
body.kids { background: linear-gradient(180deg, #DFF3FB 0%, #E6F6E4 100%) fixed; }
.geez { font-family: "Noto Sans Ethiopic", "Nyala", sans-serif; }
.hidden { display: none !important; }

/* one column, centered; big screens keep empty space at the sides for the Jebena */
#app { max-width: 480px; margin: 0 auto; min-height: 100vh; position: relative; }
.screen { display: none; min-height: 100vh; padding: 24px 20px 120px; flex-direction: column; gap: 14px; }
.screen.on { display: flex; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

h1, h2, h3 { margin: 0; line-height: 1.2; }
h2 { font-size: 26px; font-weight: 800; }
.center { text-align: center; }
.hint { color: var(--muted); margin: 0; }
.lbl { font-weight: 700; font-size: 14px; color: var(--muted); margin-top: 6px; }
.pill { align-self: center; background: var(--accent); color: #0B1F3A; padding: 4px 14px; border-radius: 20px; font-weight: 800; font-size: 13px; }
.big { font-size: 1.4em; }

/* buttons */
.btn { font: inherit; font-weight: 800; font-size: 17px; border-radius: var(--radius); padding: 15px 20px; border: 1px solid transparent; cursor: pointer; }
.btn.primary { background: var(--primary); color: var(--primary-text); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; }
.back { align-self: flex-start; background: none; border: 0; color: var(--text); font-size: 24px; cursor: pointer; padding: 4px; }
.link { background: none; border: 0; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; }
.bottom { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }

/* forms */
.form { display: flex; flex-direction: column; gap: 12px; }
input, select { font: inherit; font-size: 16px; padding: 14px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); width: 100%; }
input.code { text-align: center; letter-spacing: 8px; font-size: 26px; font-weight: 800; }
.two-in { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.msg { color: var(--bad); min-height: 1.2em; margin: 0; }

/* choice cards */
.cards { display: grid; gap: 12px; }
.cards.two { grid-template-columns: 1fr 1fr; }
.cards.four { grid-template-columns: repeat(4, 1fr); gap: 8px; }
.card { font: inherit; font-weight: 800; font-size: 17px; background: var(--card); color: var(--text); border: 1.5px solid var(--line);
        border-radius: var(--radius); padding: 18px 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.card .ico { font-size: 30px; }
.card b { font-size: 28px; }
.cards.small .card { padding: 12px 8px; font-size: 15px; }
.cards.tall .card { padding: 30px 10px; }
.wide-card { grid-column: span 2; }
.card.on { border-color: var(--primary); box-shadow: inset 0 0 0 1.5px var(--primary); }
body.kids .card { box-shadow: 0 4px 0 #BFE6F5; }
body.kids .card.on { background: #E9F8E7; border-color: var(--good); box-shadow: 0 4px 0 #9FD9A8; }

/* welcome */
.hero { text-align: center; padding-top: 40px; }
.hero-art { position: absolute; inset: 0 0 auto 0; height: 62vh; z-index: -1;
  background: radial-gradient(ellipse at 50% 70%, rgba(196,154,108,.35), transparent 60%), linear-gradient(180deg, #0B1F3A 0%, #2A2A44 55%, #7A4B2E 100%);
  -webkit-mask: linear-gradient(#000 70%, transparent); mask: linear-gradient(#000 70%, transparent); }
body.kids .hero-art { background: linear-gradient(180deg, #BFE6F5 0%, #DFF3FB 60%, #C8EBC9 100%); }
.logo-text { font-family: "Baloo 2", sans-serif; font-size: 38px; font-weight: 800; }
.logo-text b { color: var(--primary); }
.logo-text.small { font-size: 22px; }
.brand h1 { font-size: 34px; margin-top: 8px; }
.brand .sub { color: var(--muted); margin: 4px 0 0; font-size: 18px; }
.hero-jebena { width: 190px; align-self: center; margin: 16px 0; }
body.adult .hero-jebena { width: 150px; }

/* placement quiz */
.quiz-top { display: flex; align-items: center; gap: 12px; }
.bar { flex: 1; height: 12px; background: var(--line); border-radius: 8px; overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; background: var(--good); border-radius: 8px; transition: width .3s; }
.speaker { align-self: center; width: 96px; height: 96px; border-radius: 50%; border: 0; background: var(--accent); font-size: 40px; cursor: pointer; margin-top: 10px; }
.sound { text-align: center; color: var(--muted); font-size: 22px; font-weight: 800; margin: 0; min-height: 1.4em; }
.letters .card { font-family: "Noto Sans Ethiopic", sans-serif; font-size: 56px; padding: 18px 0; }
.letters .card.right { border-color: var(--good); background: rgba(76,175,122,.18); }
.letters .card.wrong { border-color: var(--bad); background: rgba(226,106,90,.15); }
.res-jebena { width: 200px; align-self: center; margin-top: 30px; }

/* home */
.home-top { display: flex; justify-content: space-between; align-items: center; }
.stats { display: flex; gap: 10px; }
.stats span { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 6px 12px; font-size: 14px; }
.hello { margin: 0; font-size: 20px; font-weight: 800; }
.goal-ring { display: flex; align-items: center; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; }
.ring { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; font-size: 22px;
        background: conic-gradient(var(--good) var(--p, 0%), var(--line) 0); position: relative; }
.ring span { width: 46px; height: 46px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.path { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 10px 0 30px; }
.node { width: 92px; height: 92px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); color: var(--text);
        display: grid; place-items: center; text-align: center; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; position: relative; }
.node .geez { font-size: 26px; display: block; }
.node.open { border-color: var(--primary); }
.node.done::after { content: "✓"; position: absolute; top: -4px; right: -4px; background: var(--good); color: #fff; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; }
.node.locked { opacity: .45; }
body.kids .node { box-shadow: 0 5px 0 #BFE6F5; }
body.kids .node.open { background: #FFF3C4; border-color: #F2B705; }
.section-title { font-weight: 800; color: var(--muted); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; margin-top: 8px; }
.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; display: grid; grid-template-columns: repeat(4, 1fr);
        background: var(--card); border-top: 1px solid var(--line); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); z-index: 5; }
.tabs button { background: none; border: 0; color: var(--muted); font: inherit; font-size: 20px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; border-radius: 12px; padding: 6px 0; }
.tabs button span { font-size: 12px; font-weight: 700; }
.tabs button.on { background: var(--primary); color: var(--primary-text); }

/* ---------- the Jebena ---------- */
/* never covers buttons: she ignores clicks except on herself, and sits outside the content */
.jebena { position: fixed; z-index: 20; pointer-events: none; opacity: 0; transition: transform .35s ease, opacity .35s; }
.jebena img { display: block; }
.jebena .bubble { position: absolute; background: #FFF8E7; color: #12305A; font-weight: 800; border-radius: 16px; padding: 8px 12px;
                  font-size: 15px; line-height: 1.25; box-shadow: 0 4px 14px rgba(0,0,0,.25); white-space: nowrap; }
.jebena .bubble .geez { font-size: 18px; display: block; }
.jebena.show { opacity: 1; pointer-events: auto; cursor: pointer; }

/* phones & tablets: half her body peeks in from the side, above the bottom buttons */
@media (max-width: 899px) {
  .jebena { top: 16vh; }   /* beside the title / speaker: away from answers and bottom buttons */
  .jebena img { height: 150px; }
  .jebena.left  { left: 0;  transform: translateX(-100%); }
  .jebena.right { right: 0; transform: translateX(100%); }
  .jebena.right img { transform: scaleX(-1); }
  .jebena.show { transform: translateX(0); }
  .jebena.left .bubble  { left: 100%; top: 0; margin-left: 2px; }
  .jebena.right .bubble { right: 100%; top: 0; margin-right: 2px; }
  .jebena .bubble { font-size: 13px; padding: 6px 10px; }
  body.kids .jebena img { height: 175px; }
}
/* laptops: full body in the empty space at the side of the column */
@media (min-width: 900px) {
  .jebena { bottom: 40px; transform: translateY(30px); }
  .jebena.left  { left: calc(50% - 240px - 210px); }
  .jebena.right { right: calc(50% - 240px - 210px); }
  .jebena img { height: 230px; }
  .jebena.show { transform: translateY(0); }
  .jebena .bubble { bottom: 100%; left: 50%; transform: translateX(-50%); margin-bottom: 6px; }
}

.toast { position: fixed; left: 50%; bottom: 100px; transform: translate(-50%, 20px); background: #12305A; color: #FFF8E7; padding: 10px 18px; border-radius: 20px; opacity: 0; transition: .3s; z-index: 30; font-weight: 700; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
