/* app.css — the signed-in product. Four kinds of screen, chosen by js/app.js on <body data-mode>:
   parent   the calm area a parent lands in: My resources, the Phenom University card, account pages
   kid      Phenom University: the child's home, a stage, practice. Its own small top bar, no site navigation
   player   a lesson or a boss: full screen, an X, a progress bar, one thing to do, one button
   reader   a book: full screen, pages you turn
   public   the front page and the other public pages, drawn as before (css/style.css)
   The look: quiet paper, one accent (the brand blue), soft edges, no decoration that is not doing a job. */
@import url('https://fonts.googleapis.com/css2?family=Literata:ital,opsz,wght@0,7..72,400;0,7..72,600;0,7..72,700;1,7..72,400&display=swap');

:root { --calm: #faf9f6; --calm-line: #e9e6df; --kid-bg: #f3f6ff; --kid-blue-deep: #1a43c4; --soft-shadow: 0 1px 2px rgba(18,24,38,.05), 0 10px 30px -18px rgba(18,24,38,.25); }

/* ───────── the site top bar: two places for a parent, the way in for a visitor ───────── */
.nav a.nav-uni { background: var(--blue); color: #fff; font-weight: 600; padding: 8px 14px; margin-left: 4px; }
.nav a.nav-uni:hover { background: var(--blue-ink); color: #fff; }
.nav a.nav-uni.active { background: var(--blue-ink); color: #fff; }
.topbar .acct { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 500; color: var(--ink-2); padding: 7px 14px; border-radius: var(--r-pill); border: 1px solid var(--hair-2); background: #fff; text-decoration: none; }
.topbar .acct:hover { color: var(--ink); border-color: var(--ink-3); text-decoration: none; }
@media (max-width: 720px) { .nav { mask-image: none; -webkit-mask-image: none; padding-right: 0; } .nav a { padding: 8px 10px; font-size: 14px; } }
@media (max-width: 520px) { .topbar .wide { display: none; } .topbar .acct { padding: 7px 10px; } .topbar-in { gap: 10px; } }

/* ───────── which chrome shows ───────── */
body[data-mode="parent"], body[data-mode="kid"], body[data-mode="player"], body[data-mode="reader"] { background-image: none; }
body[data-mode="parent"]::before, body[data-mode="kid"]::before, body[data-mode="player"]::before, body[data-mode="reader"]::before { display: none; }
body[data-mode="kid"] .topbar, body[data-mode="player"] .topbar, body[data-mode="reader"] .topbar,
body[data-mode="kid"] .footer, body[data-mode="player"] .footer, body[data-mode="reader"] .footer { display: none; }
body[data-mode="kid"] .wrap, body[data-mode="player"] .wrap, body[data-mode="reader"] .wrap { max-width: none; padding: 0; }
body[data-mode="player"], body[data-mode="reader"] { overflow: hidden; }

/* ═════════ PARENT ═════════ */
body[data-mode="parent"] { background-color: var(--calm); }
body[data-mode="parent"] .topbar { background: rgba(250,249,246,.9); border-bottom-color: var(--calm-line); }
body[data-mode="parent"] .nav a.active:not(.nav-uni) { background: #efece5; }
body[data-mode="parent"] .footer { border-top-color: var(--calm-line); margin-top: 72px; }
.pa { max-width: 920px; margin: 0 auto; padding-top: 28px; display: grid; gap: 28px; }
.pa h1, .pa h2, .pa-form h1 { font-family: var(--font-body); letter-spacing: -.02em; }
.pa-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 15px/1 var(--font-body); padding: 12px 18px; border-radius: 12px; border: 1px solid var(--ink); background: var(--ink); color: #fff; cursor: pointer; text-decoration: none !important; white-space: nowrap; transition: background 120ms, transform 120ms; }
.pa-btn:hover { background: #2a3142; }
.pa-btn:active { transform: translateY(1px); }
.pa-btn.big { font-size: 16px; padding: 15px 24px; }
.pa-btn.quiet { background: #fff; color: var(--ink); border-color: var(--hair-2); }
.pa-btn.quiet:hover { border-color: var(--ink-3); background: #fff; }
.pa-btn[disabled] { opacity: .5; cursor: default; }
.pa-eyebrow { display: block; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--blue); margin-bottom: 6px; }

/* 1. the welcome note */
.pa-welcome { background: #fff; border: 1px solid var(--calm-line); border-radius: 20px; padding: 28px 32px; box-shadow: var(--soft-shadow); }
.pa-welcome h1 { font-size: 26px; font-weight: 700; margin-bottom: 12px; }
.pa-welcome p { font-size: 17px; color: var(--ink-2); max-width: 62ch; margin: 0 0 8px; }
.pa-welcome .pa-sig { font-family: var(--font-hand); font-size: 30px; font-weight: 600; color: var(--ink); line-height: 1; margin: 14px 0 0; }
.pa-next-time { margin: 20px 0 18px; padding-top: 18px; border-top: 1px solid var(--calm-line); }
.pa-next-time h2 { font-size: 15px; font-weight: 600; letter-spacing: 0; margin-bottom: 8px; }
.pa-steps { margin: 0; padding-left: 1.25em; font-size: 15.5px; color: var(--ink-2); }
.pa-steps li { margin: .2em 0; }
.pa-signin { font-size: 14.5px; color: var(--ink-2); }
.pa-signin summary { cursor: pointer; color: var(--ink-3); font-weight: 500; }
.pa-signin summary:hover { color: var(--ink); }
.pa-signin .pa-steps { margin-top: 10px; }

/* 2. Phenom University */
.pa-uni { background: #fff; border: 1px solid var(--calm-line); border-radius: 24px; overflow: hidden; box-shadow: var(--soft-shadow); }
.pa-uni-head { display: grid; grid-template-columns: 56px 1fr; gap: 20px; align-items: start; padding: 28px 32px 24px; background: linear-gradient(135deg, #eef2ff 0%, #f8f9ff 50%, #fff 85%); }
.pa-uni-mark { display: block; width: 56px; height: 56px; filter: drop-shadow(0 6px 10px rgba(36,87,245,.22)); } .pa-uni-mark svg { display: block; width: 56px; height: 56px; }
.pa-uni-head h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pa-uni-head p { margin: 0; color: var(--ink-2); font-size: 16.5px; max-width: 58ch; }
.pa-chip { font: 600 12px/1 var(--font-body); letter-spacing: 0; padding: 6px 10px; border-radius: var(--r-pill); background: var(--blue-soft); color: var(--blue-ink); white-space: nowrap; }
.pa-chip.green { background: var(--green-soft); color: var(--green-ink); } .pa-chip.red { background: var(--red-soft); color: #c22; } .pa-chip.yellow { background: var(--yellow-soft); color: #8a6a00; } .pa-chip.purple { background: var(--purple-soft); color: #5a3fe0; }
.pa-children { list-style: none; margin: 0; padding: 0 32px; }
.pa-child { display: grid; grid-template-columns: 56px 1fr auto auto; gap: 18px; align-items: center; padding: 18px 0; border-top: 1px solid var(--calm-line); margin: 0; }
.pa-child-art svg { width: 56px; height: 56px; display: block; }
.pa-child-main { display: grid; gap: 4px; min-width: 0; }
.pa-child-main > b { font-size: 18px; font-weight: 700; letter-spacing: -.01em; }
.pa-child-main > span { font-size: 14.5px; color: var(--ink-2); }
.pa-bar { height: 8px; background: #eceef4; border-radius: 8px; overflow: hidden; max-width: 320px; margin: 4px 0 2px; }
.pa-bar i { display: block; height: 100%; background: var(--blue); border-radius: 8px; min-width: 8px; }
.pa-login { font-size: 14px !important; color: var(--ink-3) !important; }
.pa-login code { font: 600 13.5px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: #f3f1ec; padding: 2px 7px; border-radius: 6px; }
.pa-child-score { text-align: center; padding: 0 6px; }
.pa-child-score b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.03em; line-height: 1; color: var(--blue); }
.pa-child-score span { font-size: 11.5px; font-weight: 600; color: var(--ink-3); letter-spacing: .04em; text-transform: uppercase; }
.pa-uni-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 32px 20px; font-size: 14.5px; color: var(--ink-3); border-top: 1px solid var(--calm-line); }
.pa-uni-foot a { font-weight: 600; }
.pa-uni-start { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 4px 32px 28px; }
.pa-uni-start span { color: var(--ink-3); font-size: 14.5px; max-width: 40ch; }
.pa-unlock { display: grid; grid-template-columns: 28px 1fr auto; gap: 14px; align-items: center; margin: 0 32px 24px; padding: 14px 16px; background: #fff9e3; border: 1px solid #f3e3a6; border-radius: 14px; }
.pa-unlock svg { width: 28px; height: 28px; }
.pa-unlock p { margin: 0; font-size: 15px; color: var(--ink-2); }
@media (max-width: 720px) {
  .pa { padding-top: 16px; gap: 20px; }
  .pa-welcome { padding: 22px 20px; } .pa-welcome h1 { font-size: 22px; }
  .pa-uni-head { grid-template-columns: 44px 1fr; gap: 14px; padding: 20px 20px 18px; } .pa-uni-mark, .pa-uni-mark svg { width: 44px; height: 44px; } .pa-uni-head h2 { font-size: 22px; } .pa-uni-head p { font-size: 15px; }

  .pa-children { padding: 0 20px; }
  .pa-child { grid-template-columns: 44px 1fr auto; gap: 12px; } .pa-child-art svg { width: 44px; height: 44px; }
  .pa-child .pa-btn { grid-column: 1 / -1; width: 100%; }
  .pa-uni-foot, .pa-uni-start { padding-left: 20px; padding-right: 20px; }
  .pa-unlock { grid-template-columns: 28px 1fr; margin: 0 20px 20px; } .pa-unlock .pa-btn { grid-column: 1 / -1; }
}

/* 3. the package: one card per thing the family owns, the picture on a tinted backdrop */
.pa-shelf-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 0 2px; }
.pa-shelf-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.pa-count { font-size: 13px; font-weight: 600; color: var(--ink-3); white-space: nowrap; padding-bottom: 4px; }
.pa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }
.pa-card { position: relative; display: grid; grid-template-rows: auto 1fr; background: #fff; border: 1px solid var(--calm-line); border-radius: 22px; overflow: hidden; color: var(--ink); text-decoration: none !important; box-shadow: var(--soft-shadow); transition: transform 180ms, box-shadow 180ms; --tint: #f1eee7; }
.pa-card:hover { transform: translateY(-4px); box-shadow: 0 1px 2px rgba(18,24,38,.05), 0 24px 44px -24px rgba(18,24,38,.45); }
.pa-card.blue { --tint: #e8eeff; } .pa-card.green { --tint: #e4f8ec; } .pa-card.yellow { --tint: #fff6d6; } .pa-card.orange { --tint: #fff0e1; } .pa-card.purple { --tint: #eeeaff; } .pa-card.pink { --tint: #ffe7f2; } .pa-card.teal { --tint: #e0f7fa; }
.pa-pic { position: relative; display: block; aspect-ratio: 16 / 10; background: var(--tint); overflow: hidden; }
.pa-pic::after { content: ''; position: absolute; right: -30px; top: -30px; width: 150px; height: 150px; border-radius: 50%; background: radial-gradient(circle, rgba(18,24,38,.10) 1.4px, transparent 1.8px) 0 0 / 12px 12px; mask: radial-gradient(circle, #000 40%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 40%, transparent 70%); pointer-events: none; }
.pa-pic img { position: absolute; inset: 9%; width: 82%; height: 82%; object-fit: contain; object-position: center; filter: drop-shadow(0 14px 18px rgba(18,24,38,.26)); transition: transform 240ms; z-index: 1; }
.pa-card:hover .pa-pic img { transform: scale(1.05) rotate(-1.5deg); }
.pa-card-body { display: grid; gap: 4px; align-content: start; padding: 16px 18px 18px; }
.pa-kind { font-size: 11.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.pa-card b { font-size: 17px; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; }
.pa-line { font-size: 14px; color: var(--ink-2); line-height: 1.45; }
.pa-cta { margin-top: 8px; font-size: 14px; font-weight: 700; color: var(--blue); }
.pa-tag { justify-self: start; margin-top: 6px; font-size: 12px; font-weight: 600; color: var(--blue-ink); background: var(--blue-soft); padding: 4px 9px; border-radius: var(--r-pill); }
.pa-tag[hidden] { display: none; }
.pa-card.locked .pa-pic img { filter: grayscale(1) opacity(.4); }
.pa-card.locked { --tint: #f1eee7; } .pa-card.locked b { color: var(--ink-2); } .pa-card.locked .pa-cta { color: var(--ink-3); }
.pa-card.checking .pa-pic img { opacity: .6; }
.pa-lock { position: absolute; top: 12px; right: 12px; z-index: 2; width: 32px; height: 32px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 2px 6px rgba(18,24,38,.18); }
.pa-lock svg { width: 18px; height: 18px; }
.pa-help { font-size: 14px; color: var(--ink-3); margin: 0; max-width: 70ch; }
@media (max-width: 560px) {
  .pa-grid { grid-template-columns: 1fr; gap: 12px; }
  .pa-card { grid-template-columns: 118px 1fr; grid-template-rows: none; }
  .pa-pic { aspect-ratio: auto; min-height: 118px; height: 100%; }
  .pa-card-body { padding: 14px 14px 14px 12px; } .pa-card b { font-size: 15.5px; } .pa-line { font-size: 13.5px; }
  .pa-shelf-head h2 { font-size: 21px; }
}

/* the dashboard head */
.pa-head { padding: 4px 2px 0; }
.pa-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.025em; margin: 0 0 6px; }
.pa-head p { margin: 0; color: var(--ink-2); font-size: 16.5px; max-width: 62ch; }
@media (max-width: 720px) { .pa-head h1 { font-size: 25px; } .pa-head p { font-size: 15px; } }

/* "Click Here to Get Started!": a sticker and three bouncing arrows over the University card */
.pa-start { display: flex; flex-direction: column; align-items: center; margin: -4px 0 -16px; pointer-events: none; position: relative; z-index: 2; }
.pa-start-text { font-family: var(--font-hand); font-weight: 700; font-size: 36px; line-height: 1; color: var(--ink); background: var(--yellow); border: 2.5px solid var(--ink); border-radius: 14px; padding: 9px 20px 7px; box-shadow: 4px 4px 0 var(--ink); animation: paWiggle 2.4s ease-in-out infinite; white-space: nowrap; }
.pa-start-arrows { display: flex; gap: 26px; margin-top: 6px; }
.pa-start-arrows svg { width: 52px; height: 62px; filter: drop-shadow(3px 3px 0 var(--ink)); animation: paBounce 1.1s cubic-bezier(.3,.8,.3,1) infinite; }
.pa-start-arrows svg:nth-child(2) { animation-delay: .14s; } .pa-start-arrows svg:nth-child(3) { animation-delay: .28s; }
@keyframes paBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(14px); } }
@keyframes paWiggle { 0%, 100% { transform: rotate(-2.5deg); } 50% { transform: rotate(2deg) translateY(-3px); } }
.pa-uni.pa-glow { box-shadow: 0 0 0 4px rgba(255,210,63,.6), var(--soft-shadow); animation: paGlow 1.7s ease-in-out infinite; }
@keyframes paGlow { 50% { box-shadow: 0 0 0 11px rgba(255,210,63,.16), var(--soft-shadow); } }
@media (max-width: 560px) { .pa-start-text { font-size: 28px; padding: 8px 14px 6px; } .pa-start-arrows { gap: 18px; } .pa-start-arrows svg { width: 42px; height: 50px; } }
@media (prefers-reduced-motion: reduce) { .pa-start-text, .pa-start-arrows svg, .pa-uni.pa-glow { animation: none; } }

/* a parent's small forms: the child's account, the child's login */
.pa-form-page { max-width: 520px; margin: 0 auto; padding-top: 18px; }
.pa-back, .ku-back { display: inline-block; font-size: 14.5px; font-weight: 500; color: var(--ink-2); margin: 0 0 14px; text-decoration: none; }
.pa-back:hover, .ku-back:hover { color: var(--ink); }
.pa-form { background: #fff; border: 1px solid var(--calm-line); border-radius: 24px; padding: 30px 32px 28px; box-shadow: var(--soft-shadow); display: grid; gap: 16px; }

.pa-form h1 { font-size: 26px; font-weight: 700; margin: 0; }
.pa-lede { margin: -6px 0 4px; color: var(--ink-2); font-size: 16px; }
.pa-field { display: grid; gap: 6px; }
.pa-field > span { font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: 0; text-transform: none; }
.pa-field input { width: 100%; font-size: 17px; padding: 12px 14px; border: 1px solid var(--hair-2); border-radius: 12px; min-height: 48px; background: #fff; }
.pa-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,245,.18); }
.pa-field small { font-size: 13px; color: var(--ink-3); }
.pa-ages { display: flex; flex-wrap: wrap; gap: 6px; }
.pa-ages button { min-width: 44px; height: 44px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--hair-2); background: #fff; font: 600 15px var(--font-body); color: var(--ink-2); cursor: pointer; }
.pa-ages button.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pa-note { margin: 0; font-size: 14px; color: var(--ink-3); background: #f6f4ef; border-radius: 12px; padding: 12px 14px; }
.pa-error { margin: 0; font-size: 14.5px; font-weight: 500; color: #c22; background: var(--red-soft); border-radius: 12px; padding: 10px 14px; }
.pa-error[hidden] { display: none; }
.pa-form .pa-btn { width: 100%; font-size: 16px; padding: 15px 20px; }
.pa-link { background: none; border: 0; padding: 4px; font: 500 14.5px var(--font-body); color: var(--ink-3); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; justify-self: center; }
.pa-link:hover { color: var(--ink); }
.pa-creds { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 0; }
.pa-creds div { background: #f6f4ef; border-radius: 14px; padding: 14px 16px; }
.pa-creds dt { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.pa-creds dd { margin: 4px 0 0; font: 700 21px ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 560px) { .pa-form { padding: 24px 20px; } .pa-creds { grid-template-columns: 1fr; } }
@media print { .pa-back, .pa-card .pa-btn, .pa-card .pa-link { display: none !important; } .pa-form { box-shadow: none; } }
.pb-listen-page { max-width: 640px; }

/* ═════════ KID: Phenom University ═════════ */
body[data-mode="kid"] { background-color: var(--kid-bg); }
.ku { min-height: 100vh; min-height: 100dvh; }
.ku-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 10px; padding: 10px 16px; max-width: 900px; margin: 0 auto; background: rgba(243,246,255,.92); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.ku-brand { flex: none; }
.ku-uni { font-size: 13.5px; font-weight: 600; color: var(--ink-3); padding-left: 12px; margin-left: 2px; border-left: 1px solid var(--hair-2); white-space: nowrap; }

.ku-gap { flex: 1; }
.ku-score, .ku-who, .ku-exit { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border-radius: var(--r-pill); background: #fff; border: 0; box-shadow: 0 1px 2px rgba(18,24,38,.08); font: 700 15px var(--font-body); color: var(--ink); text-decoration: none !important; }
.ku-score i { font-style: normal; } .ku-score b { font-weight: 800; }
.ku-who { cursor: pointer; } .ku-who i { font-style: normal; color: var(--ink-3); font-size: 12px; }
.ku-exit { font-weight: 600; font-size: 14px; color: var(--ink-2); }
@media (max-width: 640px) { .ku-uni { display: none; } }
@media (max-width: 420px) { .ku-brand .word { display: none; } }
.ku-main { max-width: 900px; margin: 0 auto; padding: 6px 16px 72px; }
.ku-hello { font-family: var(--font-display); font-weight: 700; font-size: 24px; letter-spacing: -.02em; margin: 14px 2px 14px; }
.ku-eyebrow { display: block; font-size: 12.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin-bottom: 4px; }
.ku-next { display: grid; grid-template-columns: 104px 1fr auto; gap: 20px; align-items: center; padding: 24px 26px; border-radius: 28px; background: linear-gradient(135deg, #2457f5 0%, #3f70ff 100%); color: #fff; text-decoration: none !important; box-shadow: 0 6px 0 var(--kid-blue-deep), 0 22px 40px -22px rgba(36,87,245,.7); transition: transform 120ms, box-shadow 120ms; }
a.ku-next:hover { transform: translateY(-2px); box-shadow: 0 8px 0 var(--kid-blue-deep), 0 26px 44px -22px rgba(36,87,245,.7); }
a.ku-next:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--kid-blue-deep); }
.ku-next-art { width: 104px; height: 104px; border-radius: 50%; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.ku-next-art svg { width: 84px; height: 84px; }
.ku-next h1 { color: #fff; font-size: 30px; margin: 0 0 4px; }
.ku-left { margin: 0 0 10px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ku-left svg { width: 22px; height: 22px; }
.ku-bar { height: 12px; border-radius: 12px; background: rgba(255,255,255,.26); overflow: hidden; max-width: 380px; }
.ku-bar i { display: block; height: 100%; border-radius: 12px; background: var(--yellow); min-width: 12px; transition: width 400ms; }
.ku-sub { margin: 8px 0 0; font-size: 14.5px; font-weight: 500; opacity: .9; }
.ku-play { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 140px; padding: 18px 26px; border-radius: 18px; background: var(--yellow); color: var(--ink); font: 800 21px var(--font-body); box-shadow: 0 5px 0 #d6a800; text-decoration: none !important; white-space: nowrap; }
.ku-next.locked { background: linear-gradient(135deg, #5b6680, #7d88a3); box-shadow: 0 6px 0 #4a546b; }
@media (max-width: 640px) {
  .ku-next { grid-template-columns: 72px 1fr; gap: 14px; padding: 20px 18px; border-radius: 24px; } .ku-next-art { width: 72px; height: 72px; } .ku-next-art svg { width: 58px; height: 58px; }
  .ku-next h1 { font-size: 24px; } .ku-play { grid-column: 1 / -1; width: 100%; }
}
.ku-path { margin-top: 34px; }
.ku-path h2, .ks-list-h { font-size: 18px; margin: 0 2px 12px; }
.ku-path ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.ku-path li { margin: 0; }
.ku-node { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 14px 8px 12px; border-radius: 20px; background: #fff; color: var(--ink); text-decoration: none !important; box-shadow: 0 1px 2px rgba(18,24,38,.06); border: 2px solid transparent; transition: transform 120ms; height: 100%; }
.ku-node:hover { transform: translateY(-2px); }
.ku-node-art { position: relative; width: 64px; height: 64px; margin-bottom: 4px; }
.ku-node-art svg { width: 64px; height: 64px; }
.ku-node b { font-family: var(--font-display); font-size: 13.5px; font-weight: 700; letter-spacing: -.01em; }
.ku-node span:last-child { font-size: 12.5px; color: var(--ink-3); font-weight: 500; }
.ku-node .tick, .ku-node .lock { position: absolute; right: -6px; bottom: -4px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-size: 13px; font-weight: 800; background: var(--green); color: #fff; border: 2px solid #fff; }
.ku-node .lock { background: #fff; } .ku-node .lock svg { width: 14px; height: 14px; }
.ku-node.current { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36,87,245,.14); }
.ku-node.locked .ku-node-art > svg { filter: grayscale(1); opacity: .4; }
.ku-node.locked b { color: var(--ink-3); }
@media (max-width: 720px) { .ku-path ol { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 400px) { .ku-path ol { grid-template-columns: repeat(2, 1fr); } }
.ku-extra { margin-top: 30px; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; background: #fff; border-radius: 22px; padding: 18px 22px; box-shadow: 0 1px 2px rgba(18,24,38,.06); }
.ku-ps { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; }
.ku-ps span { grid-column: 2; font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.ku-ps b { grid-row: 1 / span 2; font-family: var(--font-body); font-size: 42px; font-weight: 800; color: var(--blue); letter-spacing: -.03em; line-height: 1; }
.ku-ps p { grid-column: 2; margin: 0; font-size: 14px; color: var(--ink-2); }
.ku-extra nav { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ku-extra nav a { font-size: 14px; font-weight: 600; color: var(--ink-2); padding: 9px 14px; border-radius: var(--r-pill); background: var(--kid-bg); text-decoration: none; }
.ku-extra nav a:hover { color: var(--ink); background: #e6ecff; }
@media (max-width: 640px) { .ku-extra { grid-template-columns: 1fr; } .ku-extra nav { justify-content: flex-start; } }
.nope { animation: nope 360ms; }
@keyframes nope { 20% { transform: translateX(-6px); } 50% { transform: translateX(6px); } 80% { transform: translateX(-3px); } }

/* Jimbo says hello */
.ku-greet { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; margin: 10px 0 14px; }
.ku-greet .jb { width: 76px; height: 76px; }
.ku-greet .ku-hello { margin: 0; }
.ku-greet-line { margin: 2px 0 0; font-size: 16px; font-weight: 600; color: var(--ink-2); }
.ku-greet-line b { color: var(--blue); }
/* the summary: how far the child has come */
.ku-sum { margin-top: 18px; background: #fff; border-radius: 24px; padding: 18px 20px 20px; box-shadow: 0 1px 2px rgba(18,24,38,.06); display: grid; gap: 12px; }
.ku-sum-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ku-sum h2 { font-size: 20px; margin: 0; }
.ku-sum-head .jb { width: 44px; height: 44px; }
.ku-sum-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.ku-stat { background: var(--kid-bg); border-radius: 16px; padding: 12px 8px 10px; text-align: center; animation: rise 320ms both; }
.ku-stat:nth-child(2) { animation-delay: 80ms; } .ku-stat:nth-child(3) { animation-delay: 160ms; } .ku-stat:nth-child(4) { animation-delay: 240ms; }
.ku-stat i { font-style: normal; font-size: 20px; display: block; margin-bottom: 2px; }
.ku-stat b { display: block; font: 800 28px var(--font-body); letter-spacing: -.03em; color: var(--blue); line-height: 1.1; }
.ku-stat span { font-size: 11.5px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .08em; }
.ku-sum-next { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; font-weight: 600; color: var(--ink-2); font-size: 15px; }
.ku-sum-next b { color: var(--ink); }
.ku-sum-pct { font: 800 15px var(--font-body); color: var(--green-ink); white-space: nowrap; }
.ku-sum .ku-bar { background: #e6ebfa; max-width: none; } .ku-sum .ku-bar i { background: var(--green); }
@media (max-width: 520px) { .ku-sum-stats { grid-template-columns: repeat(2, 1fr); } .ku-greet { grid-template-columns: 60px 1fr; } .ku-greet .jb { width: 60px; height: 60px; } .ku-hello { font-size: 22px; } }

/* a stage: its lessons in order */
.ks-head { display: grid; grid-template-columns: 96px 1fr; gap: 18px; align-items: center; background: #fff; border-radius: 26px; padding: 20px 22px; box-shadow: 0 1px 2px rgba(18,24,38,.06); }
.ks-art svg { width: 96px; height: 96px; display: block; }
.ks-head .ku-eyebrow { color: var(--blue); opacity: 1; }
.ks-head h1 { font-size: 28px; margin: 0 0 2px; }
.ks-head p { margin: 0 0 10px; color: var(--ink-2); font-size: 16px; }
.ks-head .ku-bar { background: #e6ebfa; } .ks-head .ku-bar i { background: var(--blue); }
.ks-head .ku-sub { color: var(--ink-3); opacity: 1; margin: 6px 0 0; }
.ks-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 10px; }
.ks-list li { margin: 0; }
.ks-list a, .ks-list div[data-locked] { display: grid; grid-template-columns: 44px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-radius: 18px; background: #fff; color: var(--ink); text-decoration: none !important; box-shadow: 0 1px 2px rgba(18,24,38,.06); border: 2px solid transparent; cursor: pointer; }
.ks-list .ix { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font: 800 17px var(--font-display); background: var(--kid-bg); color: var(--ink-2); }
.ks-list .ix svg { width: 20px; height: 20px; }
.ks-list .t { font-size: 17px; font-weight: 700; letter-spacing: -.01em; }
.ks-list .go { font-size: 14px; font-weight: 700; color: var(--ink-3); white-space: nowrap; }
.ks-stars i { font-style: normal; color: #d9dde7; font-size: 16px; } .ks-stars i.on { color: #ffb800; }
.ks-list .done .ix { background: var(--green); color: #fff; }
.ks-list .next a { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36,87,245,.14); }
.ks-list .next .ix { background: var(--blue); color: #fff; }
.ks-list .next .go { color: #fff; background: var(--blue); padding: 9px 16px; border-radius: var(--r-pill); }
.ks-list .locked .t { color: var(--ink-3); } .ks-list .locked div { box-shadow: none; background: rgba(255,255,255,.55); }
.ks-list .boss .ix { background: #ffe9e9; color: var(--red); } .ks-list .boss.next .ix { background: var(--red); color: #fff; } .ks-list .boss.next a { border-color: var(--red); box-shadow: 0 0 0 4px rgba(240,62,62,.14); } .ks-list .boss.next .go { background: var(--red); }
@media (max-width: 520px) { .ks-head { grid-template-columns: 68px 1fr; padding: 16px; } .ks-art svg { width: 68px; height: 68px; } .ks-head h1 { font-size: 22px; } .ks-stars { display: none; } .ks-list a, .ks-list div[data-locked] { grid-template-columns: 40px 1fr auto; padding: 12px 14px; } .ks-list .ix { width: 40px; height: 40px; } }

/* kid buttons, sheets, the sign-in */
.kid-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 14px 22px; border: 0; border-radius: 18px; background: var(--blue); color: #fff; font: 800 19px var(--font-body); cursor: pointer; box-shadow: 0 5px 0 var(--kid-blue-deep); text-decoration: none !important; transition: transform 80ms, box-shadow 80ms; }
.kid-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--kid-blue-deep); }
.kid-btn.quiet { background: #fff; color: var(--ink-2); box-shadow: 0 0 0 2px var(--hair-2) inset; font-weight: 700; font-size: 16px; min-height: 48px; }
.kid-btn[disabled] { opacity: .5; }
.ku-sheet, .pl-sheet { position: fixed; inset: 0; z-index: 70; background: rgba(18,24,38,.45); display: grid; place-items: center; padding: 20px; animation: fade 160ms; }
.ku-sheet-in, .pl-sheet-in { width: min(380px, 100%); background: #fff; border-radius: 26px; padding: 24px; display: grid; gap: 10px; text-align: center; animation: rise 200ms cubic-bezier(.2,.9,.3,1.2); }
.ku-sheet h2, .pl-sheet h2 { font-size: 22px; margin: 0 0 4px; }
.pl-sheet-in p { margin: 0 0 6px; color: var(--ink-2); }
.ku-kids { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.ku-kids li { margin: 0; }
.ku-kids button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-radius: 16px; border: 2px solid var(--hair); background: #fff; font: 600 17px var(--font-body); cursor: pointer; }
.ku-kids button.on { border-color: var(--blue); background: var(--blue-soft); }
.ku-kids span { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.ku-center { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 8vh; max-width: 420px; }
.ku-signin-logo { margin-bottom: 6px; } .ku-signin-logo svg { width: 40px; height: 40px; }
.ku-center h1 { font-size: 28px; margin: 4px 0 0; }
.ku-center p { margin: 0; color: var(--ink-2); font-size: 17px; }
.ku-locked-parent { background: #fff; border-radius: 22px; padding: 22px; text-align: left; box-shadow: 0 1px 2px rgba(18,24,38,.06); } .ku-locked-parent h2 { font-size: 22px; }
.kid-form { width: 100%; display: grid; gap: 12px; margin-top: 10px; text-align: left; }
.kid-form label { position: relative; display: grid; gap: 6px; }
.kid-form label span { font-size: 14px; font-weight: 700; color: var(--ink-2); letter-spacing: 0; text-transform: none; }
.kid-form input { width: 100%; min-height: 58px; font-size: 21px; font-weight: 600; padding: 12px 16px; border: 2px solid var(--hair-2); border-radius: 16px; background: #fff; }
.kid-form input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(36,87,245,.16); }
.kid-show { position: absolute; right: 10px; bottom: 11px; height: 36px; padding: 0 12px; border: 0; border-radius: 10px; background: var(--kid-bg); font: 700 13px var(--font-body); color: var(--ink-2); cursor: pointer; }
.kid-error { margin: 0; font-size: 15px !important; font-weight: 600; color: #c22 !important; background: var(--red-soft); border-radius: 12px; padding: 10px 14px; }
.kid-error[hidden] { display: none; }
.ku-grown { margin-top: 18px !important; font-size: 14px !important; color: var(--ink-3) !important; }
.ku-page { max-width: 900px; margin: 0 auto; padding: 16px 16px 72px; }
@keyframes fade { from { opacity: 0; } } @keyframes rise { from { transform: translateY(16px) scale(.97); opacity: 0; } }

/* ═════════ PLAYER ═════════ */
body[data-mode="player"] { background-color: #fff; }
.pl { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; background: #fff; }
.pl-top { display: flex; align-items: center; gap: 14px; padding: 12px 16px 8px; width: 100%; max-width: 760px; margin: 0 auto; }
.pl-x, .pl-read { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: #f1f3f8; color: var(--ink-2); font-size: 17px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.pl-x:hover, .pl-read:hover { background: #e5e9f2; color: var(--ink); }
.pl-bar { flex: 1; height: 16px; border-radius: 16px; background: #e9ecf3; overflow: hidden; }
.pl-bar i { display: block; height: 100%; width: 0; min-width: 16px; border-radius: 16px; background: linear-gradient(180deg, #4ade80, #22c55e); transition: width 450ms cubic-bezier(.3,.8,.3,1); }
.pl-bar.wide { flex: none; width: min(320px, 80%); margin: 0 auto; }
.pl-stage { overflow-y: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 760px; margin: 0 auto; padding: 8px 20px 14px; display: flex; flex-direction: column; align-items: center; justify-content: safe center; gap: 12px; text-align: center; }
.pl-foot { width: 100%; max-width: 760px; margin: 0 auto; padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); display: grid; gap: 8px; }
.pl-next { width: 100%; min-height: 60px; border: 0; border-radius: 18px; background: var(--blue); color: #fff; font: 800 20px var(--font-body); cursor: pointer; box-shadow: 0 5px 0 var(--kid-blue-deep); transition: transform 80ms, box-shadow 80ms, background 150ms; }
.pl-next:active:not([disabled]) { transform: translateY(4px); box-shadow: 0 1px 0 var(--kid-blue-deep); }
.pl-next[disabled] { background: #e3e7ef; color: #a3abbb; box-shadow: 0 5px 0 #d0d5e0; cursor: default; }
.pl-next[hidden] { display: none; }
.pl-home { background: none; border: 0; padding: 8px; font: 700 15px var(--font-body); color: var(--ink-3); cursor: pointer; }
.pl-coach { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; max-width: 540px; text-align: left; animation: rise 260ms cubic-bezier(.2,.9,.3,1.1); }
.pl-bot { width: 52px; height: 52px; object-fit: contain; margin-top: 2px; }
.pl-bot.big { width: 120px; height: 120px; margin: 0 0 -6px; }
.pl-bubble { position: relative; background: #f3f6ff; border-radius: 6px 20px 20px 20px; padding: 15px 18px; font-size: 21px; font-weight: 600; line-height: 1.38; color: var(--ink); }

.pl-bubble b { color: var(--blue); font-weight: 800; }
.pl-coach.long .pl-bubble { font-size: 17.5px; font-weight: 500; }

.pl-bubble .btn { margin: 4px 2px; }
.pl-say { display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center; text-align: left; width: 100%; max-width: 520px; }
.pl-say img, .pl-say .jb { width: 44px; height: 44px; object-fit: contain; }
.pl-say p { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; letter-spacing: -.01em; }
.pl-say p b { color: var(--blue); }
.pl-ab, .pr-ab { width: 100%; display: flex; justify-content: center; }
.pl-ab .abacus-wrap, .pr-ab .abacus-wrap { margin: 0; width: 100%; }
.pl .abacus { --ab-h: 40vh; width: min(100%, calc(var(--ab-h) * var(--ab-ratio, .9)), 620px); max-width: none; overflow: visible; }
.pl .abacus-value { font-size: 34px; min-height: 1.1em; }
.pl .abacus-caption { min-height: 0; padding: 2px 12px; }
.pl .abacus-caption:empty { display: none; }
.pl-cap { margin: 0; min-height: 2.7em; font-size: 20px; font-weight: 600; line-height: 1.35; color: var(--ink-2); max-width: 520px; }
.pl-cap b { color: var(--blue); font-weight: 800; } .pl-cap b.good, .pl-cap .good { color: var(--green-ink); }
.pop { animation: pop 260ms cubic-bezier(.2,.9,.3,1.4); }
@keyframes pop { from { transform: scale(.9); opacity: .2; } }

.pl-again { background: none; border: 0; font: 700 15px var(--font-body); color: var(--ink-3); cursor: pointer; padding: 6px 10px; }
.pl-again[hidden] { display: none; }
.pl-choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 440px; }
.pl-choices button { min-height: 68px; border-radius: 18px; border: 2px solid var(--hair-2); background: #fff; font: 800 26px var(--font-display); color: var(--ink); cursor: pointer; box-shadow: 0 4px 0 var(--hair-2); transition: transform 80ms; }
.pl-choices button:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--hair-2); }
.pl-choices button.right { background: var(--green-soft); border-color: var(--green); box-shadow: 0 4px 0 var(--green); color: var(--green-ink); }
.pl-choices button.wrong { background: var(--red-soft); border-color: #f5b5b5; box-shadow: none; color: #c66; animation: nope 360ms; }
/* the end of a lesson */
.pl-done { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.pl-done h1 { font-size: 30px; margin: 0; }
.pl-stars { display: flex; gap: 8px; font-size: 54px; line-height: 1; }
.pl-stars span { color: #e3e7ef; } .pl-stars span.on { color: #e3e7ef; transition: color 200ms; } .pl-stars span.on.pop { color: #ffb800; text-shadow: 0 3px 0 #d99a00; animation: star 420ms cubic-bezier(.2,.9,.3,1.6); }
@keyframes star { from { transform: scale(.3) rotate(-30deg); } }
.pl-score { display: inline-flex; align-items: baseline; gap: 10px; background: #f3f6ff; border-radius: 18px; padding: 12px 20px; margin-top: 4px; }
.pl-score span { font-size: 12.5px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); align-self: center; }
.pl-score b { font: 800 40px var(--font-body); color: var(--blue); letter-spacing: -.03em; line-height: 1; }
.pl-score em { font-style: normal; font-weight: 800; font-size: 18px; color: var(--green-ink); }
.pl-left { margin: 6px 0 0; font-size: 16px; font-weight: 600; color: var(--ink-2); max-width: 440px; }
.pl-parts { list-style: none; margin: 8px 0 0; padding: 0; width: 100%; max-width: 380px; display: grid; gap: 6px; }
.pl-parts li { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; background: #f6f8fc; border-radius: 12px; padding: 10px 14px; text-align: left; font-weight: 600; margin: 0; }
.pl-parts li span { font-weight: 800; } .pl-parts .ok span { color: var(--green-ink); } .pl-parts .no span { color: var(--red); }
/* "Your turn! Grab your abacus": the hand demo, then I did it */
.pl-real { display: flex; gap: 6px 18px; flex-wrap: wrap; justify-content: center; align-items: center; }
.pl-screen { background: none; border: 0; padding: 6px 10px; font: 600 14.5px var(--font-body); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pl-screen:hover { color: var(--ink); }
.hd-step { display: inline-block; font: 800 12px var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--blue-ink); background: var(--blue-soft); padding: 4px 9px; border-radius: var(--r-pill); margin: 0 8px 4px 0; vertical-align: 2px; }
.ab-hands { pointer-events: none; }
.ab-hand { transition: transform 600ms cubic-bezier(.3,.8,.3,1); will-change: transform; filter: drop-shadow(0 4px 3px rgba(18,24,38,.22)); }
.abacus.ab-slow .bead { transition-duration: 480ms !important; transition-timing-function: cubic-bezier(.3,.8,.3,1) !important; }
.pl-cheer { margin: -2px 0 0; font-family: var(--font-hand); font-weight: 700; font-size: 28px; line-height: 1.1; color: var(--blue-ink); }
.pl-sum { list-style: none; margin: 4px 0 0; padding: 0; width: 100%; max-width: 400px; display: grid; gap: 6px; text-align: left; }
.pl-sum li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: center; background: #f6f8fc; border-radius: 12px; padding: 9px 12px; font-size: 15.5px; font-weight: 600; color: var(--ink-2); margin: 0; animation: rise 300ms both; }
.pl-sum li:nth-child(2) { animation-delay: 120ms; } .pl-sum li:nth-child(3) { animation-delay: 240ms; } .pl-sum li:nth-child(4) { animation-delay: 360ms; }
.pl-sum li i { font-style: normal; font-weight: 800; text-align: center; color: var(--green-ink); }
.pl-sum li b { color: var(--ink); }
.pl-nudge { margin: 4px 0 0; font-size: 15px; font-weight: 600; color: var(--ink-3); }
.step-real .pl-coach .pl-bubble { font-size: 19px; }
.step-real .abacus { --ab-h: 32vh; }
.step-real .pl-screen { margin: -6px 0 -4px; }
@media (max-height: 700px) { .step-real .abacus { --ab-h: 26vh; } .step-real .pl-coach .pl-bubble { font-size: 17px; padding: 12px 15px; } .step-real .pl-cap { font-size: 17px; min-height: 2.5em; } .step-real .pl-coach { gap: 10px; } }
@media (max-height: 700px) { .pl-bot.big { width: 92px; height: 92px; } .pl-cheer { font-size: 24px; } }

/* a round of problems */
.pr { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pr-hud { display: flex; align-items: center; justify-content: center; gap: 14px; width: 100%; max-width: 460px; min-height: 26px; font-size: 14px; font-weight: 700; color: var(--ink-3); }
.pr-hud b { color: var(--ink); }
.pr-clock { flex: 1; height: 8px; border-radius: 8px; background: #e9ecf3; overflow: hidden; max-width: 240px; }
.pr-clock i { display: block; height: 100%; width: 100%; background: var(--blue); border-radius: 8px; transition: width 200ms linear; } .pr-clock i.low { background: var(--red); }
.pr-bolts { font-size: 18px; color: var(--ink); } .pr-bolts b { font: 800 22px var(--font-display); }
.pr-streak { min-width: 96px; text-align: right; color: var(--orange); }
.pr-prompt { margin: 0; font-size: 21px; font-weight: 700; line-height: 1.3; min-height: 1.3em; }
.pr-prompt b { color: var(--blue); }
.pr-problem { font: 800 44px/1.15 var(--font-display); letter-spacing: -.02em; color: var(--ink); }
.pr-problem:empty { display: none; }
.pr-problem.stack { display: inline-block; text-align: right; font-size: 34px; padding: 0 10px 6px; border-bottom: 4px solid var(--ink); }
.pr-wait { font: 600 20px var(--font-body); color: var(--ink-3); letter-spacing: 0; }
.pr-flash { width: min(420px, 100%); height: 24vh; min-height: 120px; display: grid; place-items: center; background: #f6f8fc; border-radius: 22px; }
.pr-flash b { font: 800 80px var(--font-display); letter-spacing: -.03em; } .pr-flash b.neg { color: var(--red); }
.pr.has-pad .abacus { --ab-h: 24vh; } .pr.has-ab:not(.has-pad) .abacus { --ab-h: 38vh; }
.pr-fb { min-height: 30px; font-size: 20px; font-weight: 800; }
.pr-fb.good { color: var(--green-ink); } .pr-fb.bad { color: var(--red); }
.pr-alt { background: none; border: 0; padding: 4px 8px; font: 600 14px var(--font-body); color: var(--ink-3); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.pr-alt[hidden] { display: none; }
.shake { animation: nope 360ms; }
.kp { width: 100%; max-width: 320px; display: grid; gap: 8px; }
.kp-out { height: 58px; border-radius: 16px; border: 2px solid var(--hair-2); display: grid; place-items: center; font: 800 32px var(--font-display); letter-spacing: -.02em; background: #fff; }
.kp-out .empty { color: #c5cbd8; }
.kp-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kp-keys button { height: 52px; border-radius: 14px; border: 0; background: #f1f3f8; font: 700 23px var(--font-body); color: var(--ink); cursor: pointer; box-shadow: 0 3px 0 #dde1ea; transition: transform 60ms; touch-action: manipulation; }
.kp-keys button:active { transform: translateY(2px); box-shadow: 0 1px 0 #dde1ea; }
.kp-keys .kp-fn { font-size: 18px; color: var(--ink-2); background: #fff; box-shadow: 0 0 0 2px #e9ecf3 inset; }
@media (max-height: 700px) { .kp-keys button { height: 44px; } .kp-out { height: 48px; font-size: 26px; } .pl-bubble { font-size: 20px; padding: 14px 18px; } .pl-say p { font-size: 19px; } .pr.has-pad .abacus { --ab-h: 20vh; } }
@media (min-width: 760px) { .pl-foot { padding-bottom: 28px; } .pl-next { max-width: 420px; justify-self: center; } }

/* the beads, taught: what glows, what points, what hides */
.abacus .bead.glow path:first-child { animation: glow 900ms ease-in-out infinite; }
@keyframes glow { 0%, 100% { filter: drop-shadow(0 0 3px #ffd23f) drop-shadow(0 0 6px #ffd23f); } 50% { filter: drop-shadow(0 0 7px #ffb800) drop-shadow(0 0 14px #ffb800) brightness(1.15); } }
.abacus .ab-beam.beam-on { fill: var(--yellow); stroke: var(--orange); animation: beam 900ms ease-in-out infinite; }
@keyframes beam { 50% { fill: #ffb800; } }
.abacus .bead { transition: opacity 240ms; }
.abacus.ab-hidden .bead { opacity: 0; }
.ab-finger { pointer-events: none; transition: transform 320ms cubic-bezier(.3,.8,.3,1); }
.ab-finger .ring { fill: rgba(36,87,245,.14); stroke: var(--blue); stroke-width: 3; transform-box: fill-box; transform-origin: center; animation: ring 1000ms ease-out infinite; }
.ab-finger .hand { font-size: 26px; animation: tapit 1000ms ease-in-out infinite; }
@keyframes ring { from { transform: scale(.7); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
@keyframes tapit { 50% { transform: translateY(-4px); } }
.ab-note rect { fill: var(--ink); } .ab-note text { fill: #fff; font: 700 13px var(--font-body); }
.ab-note { animation: fade 240ms; }

/* ═════════ READER ═════════ */
.er { position: fixed; inset: 0; z-index: 30; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; --er-bg: #fbf9f4; --er-ink: #1f1c17; --er-soft: #857d70; --er-line: #e9e3d6; --er-size: 19px; background: var(--er-bg); color: var(--er-ink); font-family: var(--font-body); }
.er[data-theme="sepia"] { --er-bg: #f3e9d2; --er-ink: #3a2f22; --er-soft: #8b7a60; --er-line: #e0d3b4; }
.er[data-theme="night"] { --er-bg: #14161b; --er-ink: #d6d2c9; --er-soft: #8a8c94; --er-line: #2a2d36; }
.er-top { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--er-line); }
.er-back { display: inline-flex; align-items: center; gap: 6px; font-size: 14.5px; font-weight: 500; color: var(--er-soft); text-decoration: none !important; padding: 8px 10px; border-radius: 10px; white-space: nowrap; }
.er-back i { font-style: normal; font-size: 20px; line-height: 1; }
.er-back:hover { color: var(--er-ink); }
@media (max-width: 560px) { .er-back span { display: none; } .er-back { padding: 8px 12px; } .er-top { padding: 8px 8px; } }
.er-title { flex: 1; min-width: 0; text-align: center; display: grid; }
.er-title b { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-title span { font-size: 12.5px; color: var(--er-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.3em; }
.er-btn { flex: none; width: 40px; height: 40px; border-radius: 10px; border: 0; background: none; color: var(--er-soft); font: 600 16px var(--font-body); cursor: pointer; }
.er-btn:hover { color: var(--er-ink); background: var(--er-line); }
.er-view { position: relative; display: flex; justify-content: center; padding: 22px 0 10px; min-height: 0; }
.er-clip { width: min(calc(100% - 52px), 640px); height: 100%; overflow: hidden; }
@media (min-width: 1180px) { .er-clip { width: min(calc(100% - 200px), 1120px); } }
.er-flow { height: 100%; column-fill: auto; font-family: 'Literata', Georgia, 'Times New Roman', serif; font-size: var(--er-size); line-height: 1.62; will-change: transform; }
.er-flow p { margin: 0 0 .85em; hyphens: auto; -webkit-hyphens: auto; orphans: 2; widows: 2; }
.er-flow h1, .er-flow h2, .er-flow h3, .er-flow h4 { color: var(--er-ink); break-after: avoid; -webkit-column-break-after: avoid; }
.er-flow h3 { font-family: var(--font-body); font-size: .98em; font-weight: 700; letter-spacing: 0; line-height: 1.3; margin: 1.5em 0 .55em; }
.er-flow h4 { font-family: var(--font-body); font-size: .9em; font-weight: 700; margin: 1.2em 0 .4em; }
.er-flow b, .er-flow strong { font-weight: 700; }
.er-flow a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.er-flow ul, .er-flow ol { margin: 0 0 .9em; padding-left: 1.3em; } .er-flow li { margin: .25em 0; }
.er-flow blockquote { margin: 1em 0; padding: 0 0 0 1em; border-left: 3px solid var(--er-line); font-style: italic; color: var(--er-soft); }
.er-flow table { width: 100%; border-collapse: collapse; font-family: var(--font-body); font-size: .78em; margin: 1em 0; break-inside: avoid; }
.er-flow td, .er-flow th { border-bottom: 1px solid var(--er-line); padding: 6px 8px 6px 0; text-align: left; vertical-align: top; }
.er-flow img { max-width: 100%; max-height: 46vh; margin: 1em auto; }
.er-flow .pg { break-before: column; }
.er-open { margin: 14% 0 1.5em; break-inside: avoid; }
.er-open span { display: block; font: 700 12px var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--er-soft); margin-bottom: 12px; }
.er-open h1 { font-family: 'Literata', Georgia, serif; font-size: 1.8em; font-weight: 700; line-height: 1.14; letter-spacing: -.015em; margin: 0; }
.er-open::after { content: ''; display: block; width: 44px; height: 2px; background: var(--er-ink); margin-top: 22px; opacity: .8; }
.er-first::first-letter { float: left; font-size: 3.3em; line-height: .86; font-weight: 700; padding: 4px 9px 0 0; }
.er-load { color: var(--er-soft); font-family: var(--font-body); }
.er-cover { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 8px; break-inside: avoid; font-family: var(--font-body); }
.er-cover img { max-height: 48%; width: auto; max-width: 70%; margin: 0 0 14px; filter: drop-shadow(0 18px 26px rgba(0,0,0,.28)); }
.er-cover h1 { font-family: 'Literata', Georgia, serif; font-size: 1.7em; font-weight: 700; line-height: 1.15; margin: 0; letter-spacing: -.015em; }
.er-cover .sub { margin: 0; font-size: 1em; color: var(--er-soft); font-family: 'Literata', Georgia, serif; font-style: italic; }
.er-cover .by { margin: 2px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--er-soft); }
.er-fin { font: 700 12px var(--font-body); letter-spacing: .2em; text-transform: uppercase; color: var(--er-soft); }
.er-go { margin-top: 16px; display: inline-flex; align-items: center; justify-content: center; padding: 13px 28px; border-radius: 999px; border: 0; background: var(--er-ink); color: var(--er-bg) !important; font: 600 15px var(--font-body); cursor: pointer; text-decoration: none !important; }
.er-go.quiet { margin-top: 2px; background: none; color: var(--er-soft) !important; text-decoration: underline !important; text-underline-offset: 3px; padding: 8px 12px; font-weight: 500; font-size: 14px; }
.er-zone { position: absolute; top: 0; bottom: 0; width: 20%; background: none; border: 0; cursor: pointer; color: var(--er-soft); padding: 0; -webkit-tap-highlight-color: transparent; }
.er-zone.prev { left: 0; text-align: left; } .er-zone.next { right: 0; text-align: right; }
.er-zone i { font-style: normal; font-size: 34px; padding: 0 14px; opacity: 0; transition: opacity 150ms; }
.er-zone[disabled] { cursor: default; }
@media (hover: hover) { .er-zone:not([disabled]):hover i { opacity: .7; } }
@media (max-width: 720px) { .er-zone { width: 16%; } }
.er-foot { display: grid; grid-template-columns: minmax(0, auto) 1fr auto; gap: 14px; align-items: center; padding: 8px 22px calc(12px + env(safe-area-inset-bottom)); font-size: 12px; font-weight: 500; color: var(--er-soft); }
.er-loc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.er-prog { height: 3px; border-radius: 3px; background: var(--er-line); overflow: hidden; }
.er-prog i { display: block; height: 100%; width: 0; background: var(--er-soft); transition: width 300ms; }
.er-panel { position: absolute; inset: 0; z-index: 5; background: rgba(0,0,0,.34); display: flex; justify-content: flex-end; animation: fade 160ms; }
.er-panel-in { width: min(360px, 88%); height: 100%; overflow-y: auto; background: var(--er-bg); color: var(--er-ink); padding: 26px 22px; box-shadow: -20px 0 40px -20px rgba(0,0,0,.4); animation: slide 220ms cubic-bezier(.2,.8,.3,1); }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.er-panel h2 { font: 700 13px var(--font-body); letter-spacing: .14em; text-transform: uppercase; color: var(--er-soft); margin: 0 0 14px; }
.er-toc { list-style: none; margin: 0 0 18px; padding: 0; }
.er-toc li { margin: 0; }
.er-toc button { width: 100%; display: grid; grid-template-columns: 26px 1fr; gap: 6px; text-align: left; padding: 11px 10px; border: 0; border-radius: 10px; background: none; color: var(--er-ink); font: 500 15.5px/1.3 'Literata', Georgia, serif; cursor: pointer; }
.er-toc button span { font: 600 13px var(--font-body); color: var(--er-soft); padding-top: 2px; }
.er-toc button:hover, .er-toc button.on { background: var(--er-line); }
.er-side { display: block; width: 100%; text-align: left; padding: 12px 10px; border: 0; border-top: 1px solid var(--er-line); background: none; color: var(--er-ink) !important; font: 500 14.5px var(--font-body); cursor: pointer; text-decoration: none !important; }
.er-size { display: grid; grid-template-columns: 56px 1fr 56px; align-items: center; gap: 10px; margin-bottom: 18px; text-align: center; color: var(--er-soft); font-size: 13px; }
.er-size button { height: 48px; border-radius: 12px; border: 1px solid var(--er-line); background: none; color: var(--er-ink); font: 600 15px 'Literata', Georgia, serif; cursor: pointer; }
.er-size button.big { font-size: 23px; }
.er-themes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.er-themes button { height: 52px; border-radius: 12px; border: 2px solid transparent; font: 600 13.5px var(--font-body); cursor: pointer; }
.er-themes .paper { background: #fbf9f4; color: #1f1c17; border-color: #e9e3d6; } .er-themes .sepia { background: #f3e9d2; color: #3a2f22; } .er-themes .night { background: #14161b; color: #d6d2c9; }
.er-themes button.on { border-color: var(--blue); }

@media (prefers-reduced-motion: reduce) {
  .abacus .bead.glow path:first-child, .ab-finger .ring, .ab-finger .hand, .abacus .ab-beam.beam-on { animation: none; }
  .er-flow { transition: none !important; }
}

/* ═════════ JIMBO: the coach (js/jimbo.js) ═════════
   A blue brain with the bolt. Every pose floats and blinks; hi waves, point nudges, think looks up, cheer jumps.
   Rotations turn about a point in the drawing (shoulders at 93,64 and 27,64), so transform-box is view-box. */
.jb { display: block; overflow: visible; flex: none; }
.jb .jb-fig { animation: jbFloat 3.4s ease-in-out infinite; }
.jb .jb-shadow { transform-box: fill-box; transform-origin: center; animation: jbShadow 3.4s ease-in-out infinite; }
@keyframes jbFloat { 50% { transform: translateY(-3px); } }
@keyframes jbShadow { 50% { transform: scaleX(.88); opacity: .08; } }
.jb .jb-eye { transform-box: fill-box; transform-origin: center; animation: jbBlink 4.8s ease-in-out infinite; }
.jb .jb-eye.r { animation-delay: .06s; }
@keyframes jbBlink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
.jb .jb-bolt { transform-box: fill-box; transform-origin: center; animation: jbBolt 2.6s ease-in-out infinite; }
@keyframes jbBolt { 0%, 100% { filter: drop-shadow(0 0 0 rgba(255,210,63,0)); transform: scale(1); } 50% { filter: drop-shadow(0 0 5px rgba(255,210,63,.95)); transform: scale(1.07); } }
.jb-hi .jb-arm-r { transform-box: view-box; transform-origin: 93px 64px; animation: jbWave 1.1s ease-in-out infinite; }
@keyframes jbWave { 0%, 100% { transform: rotate(-16deg); } 50% { transform: rotate(14deg); } }
.jb-hi .jb-head { transform-box: view-box; transform-origin: 60px 90px; animation: jbTilt 2.2s ease-in-out infinite; }
@keyframes jbTilt { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
.jb-point .jb-arm-r { animation: jbPoke 1.3s ease-in-out infinite; }
@keyframes jbPoke { 50% { transform: translateX(5px); } }
.jb-think .jb-arm-r { transform-box: view-box; transform-origin: 93px 64px; animation: jbTap 1.6s ease-in-out infinite; }
@keyframes jbTap { 50% { transform: rotate(-6deg); } }
.jb-think .jb-dots circle { opacity: 0; animation: jbDot 2.4s ease-in-out infinite; }
.jb-think .jb-dots .d2 { animation-delay: .4s; } .jb-think .jb-dots .d3 { animation-delay: .8s; }
@keyframes jbDot { 20%, 60% { opacity: 1; } 80%, 100% { opacity: 0; } }
.jb-cheer .jb-fig { animation: jbJump .72s cubic-bezier(.3,.8,.3,1) infinite; }
@keyframes jbJump { 0%, 100% { transform: translateY(0); } 38% { transform: translateY(-11px); } 58% { transform: translateY(-9px); } }
.jb-cheer .jb-arm-l { transform-box: view-box; transform-origin: 27px 64px; animation: jbPumpL .72s ease-in-out infinite; }
.jb-cheer .jb-arm-r { transform-box: view-box; transform-origin: 93px 64px; animation: jbPumpR .72s ease-in-out infinite; }
@keyframes jbPumpL { 50% { transform: rotate(14deg); } } @keyframes jbPumpR { 50% { transform: rotate(-14deg); } }
.jb-cheer .jb-sparks path { transform-box: fill-box; transform-origin: center; animation: jbSpark 1.4s ease-out infinite; }
.jb-cheer .jb-sparks .s2 { animation-delay: .45s; } .jb-cheer .jb-sparks .s3 { animation-delay: .9s; }
@keyframes jbSpark { 0% { transform: scale(.2) rotate(0); opacity: 0; } 30% { opacity: 1; } 100% { transform: scale(1.3) rotate(40deg); opacity: 0; } }
.jb-oops .jb-head { transform-box: view-box; transform-origin: 60px 90px; animation: jbTilt 3s ease-in-out infinite; }
.jb-talk .jb-mouth { transform-box: fill-box; transform-origin: center; animation: jbTalk .34s ease-in-out 5; }
@keyframes jbTalk { 50% { transform: scaleY(1.5); } }
.jb-in { animation: jbIn 420ms cubic-bezier(.2,.9,.3,1.3); }
@keyframes jbIn { from { transform: translateY(14px) scale(.8); opacity: 0; } }
/* Jimbo beside a bubble, the signed-in product's coach tip */
.jb-say { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; align-items: start; width: 100%; max-width: 540px; text-align: left; }
.jb-say .jb { width: 56px; height: 56px; margin-top: 2px; }
.jb-bubble { position: relative; background: #f3f6ff; border-radius: 6px 20px 20px 20px; padding: 15px 18px; font-size: 21px; font-weight: 600; line-height: 1.38; color: var(--ink); }
.jb-bubble b { color: var(--blue); font-weight: 800; }
.tip .jb { width: 56px; height: 56px; }
@media (max-width: 480px) { .tip .jb { width: 44px; height: 44px; } }
@media (prefers-reduced-motion: reduce) { .jb *, .jb { animation: none !important; } }

/* ═════════ NEED HELP? (js/contact.js) ═════════ */
.cu-fab { position: fixed; right: 18px; bottom: 18px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px 12px 14px; border-radius: 999px; border: 2px solid var(--ink); background: var(--yellow); color: var(--ink); font: 700 15px var(--font-body); box-shadow: 4px 4px 0 var(--ink); cursor: pointer; transition: transform 90ms, box-shadow 90ms; }
.cu-fab:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
.cu-fab:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--ink); }
.cu-fab .cu-ic { font-size: 18px; line-height: 1; }
body[data-mode="player"] .cu-fab, body[data-mode="reader"] .cu-fab, body.printing-sheet .cu-fab, body.printing-book .cu-fab { display: none; }
body[data-mode="parent"] .cu-fab, body[data-mode="kid"] .cu-fab { border-color: var(--blue); background: var(--blue); color: #fff; box-shadow: 0 10px 24px -10px rgba(36,87,245,.7); }
body[data-mode="parent"] .cu-fab:hover, body[data-mode="kid"] .cu-fab:hover { background: var(--blue-ink); border-color: var(--blue-ink); box-shadow: 0 12px 26px -10px rgba(36,87,245,.8); }
@media (max-width: 520px) { .cu-fab { right: 12px; bottom: 12px; padding: 11px 14px 11px 12px; font-size: 14px; } }
.cu-sheet { position: fixed; inset: 0; z-index: 80; background: rgba(18,24,38,.45); display: grid; align-items: end; justify-items: center; animation: fade 160ms; }
.cu-box { position: relative; width: min(540px, 100%); max-height: 92vh; overflow: auto; background: #fff; border-radius: 26px 26px 0 0; padding: 22px 22px calc(22px + env(safe-area-inset-bottom)); display: grid; gap: 14px; animation: rise 220ms cubic-bezier(.2,.9,.3,1.1); color: var(--ink); }
@media (min-width: 640px) { .cu-sheet { align-items: center; padding: 20px; } .cu-box { border-radius: 26px; } }
.cu-head { display: flex; align-items: center; gap: 12px; }
.cu-head .jb { width: 52px; height: 52px; }
.cu-head h2 { font-size: 22px; margin: 0; font-family: var(--font-body); font-weight: 800; letter-spacing: -.02em; }
.cu-head p { margin: 2px 0 0; color: var(--ink-2); font-size: 14.5px; }
.cu-x { margin-left: auto; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: #f1f3f8; color: var(--ink-2); font-size: 15px; font-weight: 700; cursor: pointer; }
.cu-x:hover { background: #e5e9f2; color: var(--ink); }
.cu-form { display: grid; gap: 10px; position: relative; }
.cu-form label { display: grid; gap: 5px; font-size: 13.5px; font-weight: 600; color: var(--ink); letter-spacing: 0; text-transform: none; }
.cu-form input, .cu-form textarea { width: 100%; font: 400 16px var(--font-body); padding: 11px 14px; border: 1.5px solid var(--hair-2); border-radius: 12px; background: #fff; color: var(--ink); min-height: 46px; outline: none; }
.cu-form textarea { min-height: 112px; resize: vertical; line-height: 1.45; }
.cu-form input:focus, .cu-form textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(36,87,245,.18); }
.cu-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 480px) { .cu-row { grid-template-columns: 1fr; } }
.cu-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cu-send { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; border: 0; border-radius: 14px; background: var(--blue); color: #fff; font: 700 16.5px var(--font-body); cursor: pointer; box-shadow: 0 4px 0 var(--kid-blue-deep); transition: transform 80ms, box-shadow 80ms; }
.cu-send:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--kid-blue-deep); }
.cu-send[disabled] { opacity: .6; cursor: default; }
.cu-send.quiet { background: #fff; color: var(--ink-2); box-shadow: 0 0 0 1.5px var(--hair-2) inset; }
.cu-note { margin: 0; font-size: 13px; color: var(--ink-3); line-height: 1.45; }
.cu-err { margin: 0; font-size: 14.5px; color: #c22; background: var(--red-soft); border-radius: 12px; padding: 10px 14px; line-height: 1.4; }
.cu-err a { color: #c22; font-weight: 700; }
.cu-err[hidden] { display: none; }
.cu-done { display: grid; justify-items: center; gap: 6px; text-align: center; padding: 8px 0 4px; }
.cu-done h2 { font-size: 26px; margin: 0; font-family: var(--font-body); font-weight: 800; }
.cu-done p { margin: 0; color: var(--ink-2); }
/* #/contact */
.cu-cols { align-items: start; grid-template-columns: 1.2fr .8fr; }
.cu-card { border: 2px solid var(--ink); border-radius: 22px; padding: 22px; background: #fff; box-shadow: 8px 8px 0 var(--blue-soft); }
.cu-aside { padding: 6px 0 0 8px; }
.cu-aside h3 { margin-bottom: 10px; }
.cu-aside p { color: var(--ink-2); font-size: 15.5px; margin: 0 0 10px; }
@media (max-width: 760px) { .cu-cols { grid-template-columns: 1fr; } .cu-aside { padding-left: 0; } }
