:root {
  --ink: #2b2440; --paper: #fff9f0; --sun: #ffb703; --coral: #ff7f6b;
  --sky: #4dabf7; --grass: #3fae6a; --grape: #8338ec; --pink: #ef6aa5;
  --card: #ffffff; --shadow: 0 6px 0 rgba(43,36,64,.12), 0 14px 28px rgba(43,36,64,.12);
  --radius: 22px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  margin: 0; font-family: "Baloo 2", "Comic Sans MS", "Segoe UI Rounded", system-ui, sans-serif;
  color: var(--ink); background:
    radial-gradient(circle at 12% 8%, #ffe9a8 0 90px, transparent 91px),
    radial-gradient(circle at 88% 4%, #ffd6e8 0 70px, transparent 71px),
    radial-gradient(circle at 95% 60%, #d3f9d8 0 110px, transparent 111px),
    var(--paper);
  min-height: 100vh;
}
/* Slim banner: in normal flow, scrolls away, logo never shrinks. */
.topbar {
  display: flex; align-items: center; gap: 10px; padding: 8px 14px;
  background: linear-gradient(90deg, #fff3bf, #ffe0ef, #d3f9d8);
  border-bottom: 4px solid #fff; box-shadow: 0 3px 10px rgba(43,36,64,.08);
}
.logo { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.18rem; letter-spacing: .2px; }
.logo svg { flex: none; }
.topbar .spacer { flex: 1; }
.pill {
  border: 3px solid var(--ink); background: #fff; color: var(--ink); border-radius: 999px;
  padding: 6px 14px; font: inherit; font-weight: 700; font-size: .92rem; cursor: pointer;
  box-shadow: 0 3px 0 rgba(43,36,64,.25);
}
.pill:active { transform: translateY(2px); box-shadow: none; }
.pill.off { opacity: .55; }
.langsel { border: 3px solid var(--ink); border-radius: 999px; padding: 5px 8px; font: inherit; font-weight: 700; background: #fff; max-width: 150px; }
main { max-width: 1060px; margin: 0 auto; padding: 18px 16px 40px; }
.hero {
  display: flex; gap: 18px; align-items: center; background: var(--card); border-radius: 28px;
  padding: 20px; box-shadow: var(--shadow); border: 4px solid #ffe9a8; position: relative; overflow: hidden;
}
.hero .face { flex: none; animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
.bubble {
  background: #fff8e1; border: 3px solid #ffd43b; border-radius: 18px; padding: 12px 16px;
  font-size: 1.08rem; line-height: 1.45; position: relative; flex: 1;
}
.bubble::before { content: ""; position: absolute; left: -14px; top: 34px; border: 8px solid transparent; border-right: 12px solid #ffd43b; }
.bubble b { color: #e8590c; }
.askrow { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ask {
  border: 3px solid var(--sky); background: #e7f5ff; border-radius: 999px; padding: 6px 13px;
  font: inherit; font-weight: 700; cursor: pointer; font-size: .95rem;
}
.ask:active { transform: scale(.96); }
h2.section { font-size: 1.5rem; margin: 28px 4px 12px; display: flex; align-items: center; gap: 8px; }
.grades { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.grade {
  border: 4px solid #fff; border-radius: var(--radius); padding: 14px 10px; text-align: center; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.02rem; color: var(--ink); box-shadow: var(--shadow);
  transition: transform .12s ease;
}
.grade small { display: block; font-weight: 600; opacity: .75; font-size: .82rem; margin-top: 2px; }
.grade:active { transform: scale(.95); }
.grade.sel { outline: 4px solid var(--ink); transform: scale(1.03); }
.classes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.classcard {
  display: flex; gap: 12px; align-items: center; text-align: left; background: var(--card);
  border: 4px solid #f1f3f5; border-radius: var(--radius); padding: 14px; cursor: pointer; font: inherit;
  box-shadow: var(--shadow); transition: transform .12s ease;
}
.classcard:active { transform: scale(.97); }
.classcard h3 { margin: 0 0 2px; font-size: 1.12rem; }
.classcard p { margin: 0; font-size: .88rem; opacity: .78; line-height: 1.35; }
.classcard .go { margin-left: auto; font-size: 1.5rem; flex: none; }
/* Classroom */
.room { background: var(--card); border-radius: 28px; box-shadow: var(--shadow); padding: 20px; border: 4px solid #e7f5ff; }
.roomhead { display: flex; gap: 14px; align-items: center; margin-bottom: 8px; }
.roomhead .bubble { flex: 1; }
.progress { height: 16px; background: #f1f3f5; border-radius: 999px; overflow: hidden; border: 2px solid #dee2e6; margin: 12px 0 4px; }
.progress > div { height: 100%; background: linear-gradient(90deg, var(--sun), var(--coral)); width: 0; transition: width .4s ease; border-radius: 999px; }
.stars-row { font-size: 1.3rem; min-height: 1.6em; letter-spacing: 3px; }
.passage { background: #f8f9ff; border: 3px dashed #b197fc; border-radius: 16px; padding: 14px 16px; font-size: 1.12rem; line-height: 1.6; margin: 10px 0; }
.prompt { font-size: 1.45rem; font-weight: 800; line-height: 1.35; margin: 12px 0 6px; }
.visual { text-align: center; margin: 8px 0 14px; }
.big-emoji { font-size: 4.2rem; line-height: 1.15; }
.big-num { font-size: 2.6rem; font-weight: 800; letter-spacing: 1px; }
.count-grid { font-size: 2.2rem; line-height: 1.3; letter-spacing: 6px; word-break: break-all; }
.shape-svg { width: 92px; height: 92px; }
.mix-row { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 2rem; font-weight: 800; }
.mix-row span { width: 58px; height: 58px; border-radius: 50%; border: 3px solid rgba(43,36,64,.25); display: inline-block; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.choice {
  border: 4px solid #dee2e6; background: #fff; border-radius: 20px; padding: 16px 10px; cursor: pointer;
  font: inherit; font-weight: 800; font-size: 1.25rem; color: var(--ink); min-height: 76px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: transform .1s ease, border-color .1s ease;
}
.choice:active { transform: scale(.96); }
.choice .sw { width: 52px; height: 52px; border-radius: 50%; border: 3px solid rgba(43,36,64,.25); }
.choice .big { font-size: 2.2rem; }
.choice.right { border-color: var(--grass); background: #d3f9d8; animation: pop .35s ease; }
.choice.wrong { border-color: var(--coral); background: #ffe3e0; animation: shake .35s ease; }
@keyframes pop { 50% { transform: scale(1.07) } }
@keyframes shake { 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
.feedback { min-height: 2em; font-size: 1.2rem; font-weight: 800; text-align: center; margin-top: 12px; }
.feedback.good { color: var(--grass); } .feedback.try { color: #e8590c; }
.roomfoot { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.bigbtn {
  border: 3px solid var(--ink); border-radius: 999px; padding: 10px 22px; font: inherit; font-weight: 800;
  font-size: 1.05rem; cursor: pointer; background: var(--sun); color: var(--ink); box-shadow: 0 4px 0 rgba(43,36,64,.3);
}
.bigbtn:active { transform: translateY(3px); box-shadow: none; }
.bigbtn.ghost { background: #fff; }
.bigbtn:disabled { opacity: .45; cursor: default; }
.finish { text-align: center; padding: 18px 0 6px; }
.finish .stars-big { font-size: 3rem; letter-spacing: 8px; }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 40; }
.confetti i { position: absolute; top: -4vh; font-size: 1.6rem; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(320deg); } }
/* Join / pricing (paid twin only) */
.join { margin-top: 34px; background: linear-gradient(135deg, #fff3bf, #ffe0ef); border: 4px solid #fff; border-radius: 28px; padding: 22px; box-shadow: var(--shadow); }
.join h2 { margin: 0 0 6px; font-size: 1.5rem; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 14px; }
.plan { background: #fff; border-radius: 20px; padding: 16px; border: 3px solid #f1f3f5; text-align: center; }
.plan .price { font-size: 2rem; font-weight: 800; color: var(--grape); }
.plan ul { text-align: left; margin: 10px 0; padding-left: 20px; line-height: 1.5; font-size: .95rem; }
.freebanner { margin-top: 34px; background: linear-gradient(135deg, #d3f9d8, #e7f5ff); border: 4px solid #fff; border-radius: 28px; padding: 20px 22px; box-shadow: var(--shadow); text-align: center; font-size: 1.15rem; font-weight: 700; }
footer.site {
  margin-top: 44px; background: #2b2440; color: #f8f6ff; padding: 22px 16px 30px; text-align: center;
}
footer.site a { color: #ffd43b; font-weight: 700; text-decoration: none; }
footer.site .fb { display: inline-flex; align-items: center; gap: 7px; background: #1877f2; color: #fff; padding: 7px 14px; border-radius: 999px; font-weight: 700; }
footer.site small { display: block; margin-top: 10px; opacity: .75; }
.modal { position: fixed; inset: 0; background: rgba(43,36,64,.55); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal.open { display: flex; }
.modal .box { background: #fff; border-radius: 24px; padding: 24px; max-width: 420px; text-align: center; box-shadow: var(--shadow); }
.hidden { display: none !important; }
/* Four formats */
@media (max-width: 639px) { /* phone */
  .hero { flex-direction: column; text-align: center; }
  .bubble::before { display: none; }
  .roomhead { flex-direction: column; text-align: center; }
  .choices { grid-template-columns: 1fr 1fr; gap: 9px; }
  .prompt { font-size: 1.25rem; }
  .logo span.name { font-size: 1.02rem; }
  .langsel { max-width: 104px; }
}
@media (min-width: 640px) and (max-width: 1023px) { /* tablet */
  main { padding: 22px 24px 44px; }
  .grades { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1024px) and (max-width: 1439px) { /* desktop */
  .grades { grid-template-columns: repeat(4, 1fr); }
  .choices { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1440px) { /* large screen */
  main { max-width: 1280px; }
  .grades { grid-template-columns: repeat(8, 1fr); }
  .choices { grid-template-columns: repeat(4, 1fr); }
  body { font-size: 1.12rem; }
}
