/* ============ GiveGoodMusic – styles ============ */
@font-face { font-family: "Bravura"; src: url("../assets/fonts/Bravura.woff2") format("woff2"); font-display: block; }
@font-face { font-family: "Nunito"; src: url("../assets/fonts/Nunito.ttf") format("truetype"); font-weight: 200 1000; font-display: swap; }

:root {
  --bg: #F6F3FF; --card: #fff; --ink: #2A2140; --muted: #7B7394; --line: #E7E1F7; --soft: #F1ECFF;
  --brand: #6C4CF1; --brand-d: #4F33CF; --brand-l: #EDE8FF;
  --green: #36C15A; --green-d: #27994A; --green-l: #E3F9E8;
  --red: #FF5A6A; --red-d: #D63B4C; --red-l: #FFE7EA;
  --orange: #FF9F1C; --orange-d: #DB8000; --yellow: #FFC83D; --yellow-d: #E0A500;
  --blue: #2EA8FF; --blue-d: #1186DA; --pink: #FF6FB1; --teal: #17C3B2;
  --g1: #36C15A; --g1d: #27994A; --g2: #2EA8FF; --g2d: #1186DA; --g3: #8A5CF6; --g3d: #6A3FDB;
  --g4: #FF9F1C; --g4d: #DB8000; --g5: #FF5A8A; --g5d: #D93A6C;
  --g6: #17C3B2; --g6d: #0E968A; --g7: #3D5AFE; --g7d: #2238C9; --g8: #C2185B; --g8d: #8E0F42;
  --radius: 18px; --shadow: 0 2px 0 var(--line);
  --font: "Nunito", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; font-weight: 900; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.45rem; } h3 { font-size: 1.15rem; }
p { margin: 0 0 .8em; }
.boot { display: grid; place-items: center; height: 100vh; font-weight: 800; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.hidden { display: none !important; }
.mus { font-family: "Bravura"; font-size: 1.55em; line-height: 0; vertical-align: -0.05em; font-style: normal; display: inline-block; padding: 0 .06em; }
.mus.sm { font-size: 1.2em; }
.mus.acc { font-size: 1.25em; vertical-align: -0.1em; }

/* ---------- buttons (chunky 3D) ---------- */
.btn { --c: var(--brand); --cd: var(--brand-d); appearance: none; border: 0; cursor: pointer; font-weight: 900; font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
  color: #fff; background: var(--c); border-radius: 16px; padding: 13px 22px; box-shadow: 0 4px 0 var(--cd); transition: transform .06s, box-shadow .06s, filter .15s; display: inline-flex; align-items: center; justify-content: center; gap: 8px; user-select: none; }
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--cd); }
.btn[disabled] { --c: #E5E1EE !important; --cd: #CFC9DC !important; color: #A49DB6 !important; cursor: not-allowed; filter: none; }
.btn.green { --c: var(--green); --cd: var(--green-d); }
.btn.red { --c: var(--red); --cd: var(--red-d); }
.btn.orange { --c: var(--orange); --cd: var(--orange-d); }
.btn.blue { --c: var(--blue); --cd: var(--blue-d); }
.btn.yellow { --c: var(--yellow); --cd: var(--yellow-d); color: #4B3600; }
.btn.ghost { --c: #fff; --cd: var(--line); color: var(--brand); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.btn.ghost:active { box-shadow: 0 0 0 var(--line); }
.btn.sm { padding: 8px 14px; font-size: 13px; border-radius: 12px; }
.btn.wide { width: 100%; }
.btn.lg { padding: 16px 28px; font-size: 17px; }
.iconbtn { border: 0; background: transparent; cursor: pointer; padding: 6px; border-radius: 10px; color: var(--muted); font-size: 20px; line-height: 1; }
.iconbtn:hover { background: var(--soft); color: var(--brand); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; border-right: 2px solid var(--line); background: #fff; padding: 18px 14px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; }
.logo { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; font-weight: 1000; font-size: 21px; letter-spacing: -.02em; color: var(--brand); }
.logo .give { color: var(--orange); }
.logo svg { width: 38px; height: 38px; flex: none; }
.logo .wm { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.beta-tag { display: inline-block; padding: 2px 8px; border-radius: 99px; background: #FFF1DC; color: var(--orange-d); border: 1.5px solid #FFD9A3; font-size: 10.5px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4; white-space: nowrap; vertical-align: 1px; }
.logo .beta-tag { margin-top: 4px; }
.grade-guides { font-weight: 700; color: var(--muted); }
.grade-guides a { font-weight: 800; white-space: nowrap; }
.beta-tag.lg { font-size: 13px; padding: 3px 12px; margin-top: -6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; font-weight: 800; color: var(--ink); border: 2px solid transparent; font-size: 15px; text-transform: uppercase; letter-spacing: .03em; }
.nav a:hover { background: var(--soft); }
.nav a.on { background: var(--brand-l); border-color: #CFC2FF; color: var(--brand); }
.nav a .ni { width: 30px; height: 30px; display: grid; place-items: center; font-size: 22px; }
.side .spacer { flex: 1; }
.side .who { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; background: var(--soft); font-weight: 800; cursor: pointer; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; background: #fff; border: 2px solid var(--line); flex: none; }
.main { min-width: 0; }
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(246,243,255,.92); backdrop-filter: blur(6px); display: flex; align-items: center; gap: 10px; padding: 12px 24px; border-bottom: 2px solid var(--line); }
.topbar .title { font-weight: 900; font-size: 18px; }
.stats { margin-left: auto; display: flex; gap: 6px; }
.stat { display: flex; align-items: center; gap: 6px; font-weight: 900; padding: 6px 10px; border-radius: 12px; cursor: default; font-size: 16px; }
.stat:hover { background: #fff; }
.stat svg { width: 24px; height: 24px; }
.stat.streak { color: var(--orange); } .stat.xp { color: var(--yellow-d); } .stat.hearts { color: var(--red); }
.stat.streak.off { color: #B8B1C8; }
.page { padding: 24px; max-width: 1080px; margin: 0 auto; }
.cols { display: grid; grid-template-columns: 1fr 300px; gap: 24px; align-items: start; }
.rail { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; }
.card { background: var(--card); border: 2px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card.flat { box-shadow: none; }
.card h3 { margin-bottom: .5em; }
.footer { text-align: center; color: var(--muted); font-size: 12.5px; padding: 28px 18px 90px; line-height: 1.5; }
.footer b { color: var(--ink); }
.bottomnav { display: none; }

@media (max-width: 980px) { .cols { grid-template-columns: 1fr; } .rail { position: static; } }
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .bottomnav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 40; background: #fff; border-top: 2px solid var(--line); justify-content: space-around; padding: 6px 4px 8px; }
  .bottomnav a { display: grid; place-items: center; font-size: 22px; padding: 6px 10px; border-radius: 12px; }
  .bottomnav a.on { background: var(--brand-l); }
  .page { padding: 16px; }
  .topbar { padding: 10px 14px; }
  .topbar .title { font-size: 15px; }
}

/* ---------- grade tabs & map ---------- */
.gradetabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.gtab { --c: var(--g1); --cd: var(--g1d); border: 2px solid var(--line); background: #fff; color: var(--ink); font-weight: 900; padding: 8px 14px; border-radius: 14px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; box-shadow: 0 3px 0 var(--line); }
.gtab .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--c); }
.gtab.on { background: var(--c); color: #fff; border-color: var(--cd); box-shadow: 0 3px 0 var(--cd); }
.gtab.on .dot { background: #fff; }
.g1 { --c: var(--g1); --cd: var(--g1d); } .g2 { --c: var(--g2); --cd: var(--g2d); } .g3 { --c: var(--g3); --cd: var(--g3d); } .g4 { --c: var(--g4); --cd: var(--g4d); } .g5 { --c: var(--g5); --cd: var(--g5d); } .g6 { --c: var(--g6); --cd: var(--g6d); } .g7 { --c: var(--g7); --cd: var(--g7d); } .g8 { --c: var(--g8); --cd: var(--g8d); }

.unit-banner { background: var(--c); color: #fff; border-radius: 18px; padding: 16px 20px; display: flex; align-items: center; gap: 14px; box-shadow: 0 4px 0 var(--cd); margin: 10px 0 18px; }
.unit-banner .ut { font-weight: 1000; font-size: 20px; }
.unit-banner .us { opacity: .92; font-weight: 700; font-size: 14px; }
.unit-banner .ub { margin-left: auto; }
.unit-banner .btn { --c: rgba(255,255,255,.18); --cd: rgba(0,0,0,.15); border: 2px solid rgba(255,255,255,.45); }
.path { position: relative; display: flex; flex-direction: column; align-items: center; padding: 6px 0 22px; }
.node-wrap { position: relative; height: 96px; width: 100%; display: flex; justify-content: center; }
.node { position: relative; width: 74px; height: 70px; border-radius: 50%; border: 0; cursor: pointer; background: var(--c); box-shadow: 0 7px 0 var(--cd); color: #fff; font-size: 30px; display: grid; place-items: center; transition: transform .1s; }
.node:hover { transform: scale(1.06); }
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--cd); }
.node.locked { background: #E2DEEA; box-shadow: 0 7px 0 #C9C3D6; color: #A9A2BA; }
.node.done { background: var(--yellow); box-shadow: 0 7px 0 var(--yellow-d); }
.node .ring { position: absolute; inset: -9px; border-radius: 50%; border: 5px solid var(--c); opacity: .35; display: none; }
.node.current .ring { display: block; }
.node.current .ring { animation: pulse 1.6s infinite; opacity: .6; }
.node-label { position: absolute; top: 76px; white-space: nowrap; font-weight: 800; font-size: 13px; color: var(--ink); background: rgba(255,255,255,.85); padding: 1px 8px; border-radius: 8px; }
.node .stars { position: absolute; bottom: -10px; font-size: 12px; letter-spacing: -2px; }
.start-bubble { position: absolute; top: -40px; background: #fff; color: var(--c); border: 2px solid var(--line); font-weight: 1000; font-size: 13px; padding: 5px 12px; border-radius: 12px; animation: bob 1.4s ease-in-out infinite; text-transform: uppercase; white-space: nowrap; z-index: 2; }
.start-bubble:after { content: ""; position: absolute; left: 50%; bottom: -8px; margin-left: -7px; border: 7px solid transparent; border-top-color: #fff; }
.node.exam { width: 86px; height: 82px; font-size: 38px; }
.map-deco { position: absolute; font-size: 40px; opacity: .9; pointer-events: none; }
@keyframes pulse { 0% { transform: scale(.95); opacity: .7; } 70% { transform: scale(1.18); opacity: 0; } 100% { opacity: 0; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }

/* ---------- rail widgets ---------- */
.goal-ring { display: flex; align-items: center; gap: 14px; }
.ring-svg { width: 76px; height: 76px; transform: rotate(-90deg); }
.bar { height: 14px; background: #EEEAF6; border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c, var(--green)); border-radius: 99px; transition: width .5s; box-shadow: inset 0 -3px 0 rgba(0,0,0,.08); position: relative; }
.bar > i:after { content: ""; position: absolute; left: 8px; right: 8px; top: 3px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.35); }
.badge-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.badge { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.badge .bi { width: 54px; height: 54px; margin: 0 auto 4px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; background: #EEEAF6; filter: grayscale(1); opacity: .55; }
.badge.got .bi { background: linear-gradient(160deg, #FFE27A, #FFB627); filter: none; opacity: 1; box-shadow: 0 3px 0 #E0A500; }
.badge.got { color: var(--ink); }

/* ---------- topic page ---------- */
.topic-head { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.topic-emoji { width: 64px; height: 64px; border-radius: 20px; background: var(--c); display: grid; place-items: center; font-size: 34px; box-shadow: 0 4px 0 var(--cd); flex: none; }
.crumbs { font-size: 13px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0 18px; }
.stepbtn { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 10px 8px; cursor: pointer; font-weight: 900; color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: 2px; box-shadow: 0 3px 0 var(--line); font-size: 13.5px; position: relative; }
.stepbtn .si { font-size: 24px; }
.stepbtn.on { border-color: var(--c); box-shadow: 0 3px 0 var(--c); background: #fff; color: var(--cd); }
.stepbtn.done:after { content: "✓"; position: absolute; top: 4px; right: 8px; color: var(--green); font-weight: 1000; }
@media (max-width: 600px) { .steps { grid-template-columns: repeat(2, 1fr); } }
.bullets { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.bullets li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; font-size: 16.5px; }
.bullets li:before { content: ""; flex: none; width: 12px; height: 12px; border-radius: 50%; margin-top: 7px; background: var(--c, var(--brand)); box-shadow: 0 0 0 4px color-mix(in srgb, var(--c, var(--brand)) 22%, transparent); }
.tip { background: #FFF7DA; border: 2px solid #FFE39A; border-radius: 14px; padding: 12px 14px; display: flex; gap: 10px; font-weight: 700; }
.score-box { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px; display: flex; justify-content: center; overflow-x: auto; }
.score-box svg { max-width: 100%; height: auto; }
.wex .wstep { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 2px dashed var(--line); }
.wex .wstep .n { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-weight: 1000; }
.wex .answer { background: var(--green-l); border: 2px solid #A9EBBB; border-radius: 14px; padding: 12px 14px; font-weight: 800; margin-top: 10px; }
.reveal-anim { animation: popin .35s cubic-bezier(.2,1.4,.5,1); }
@keyframes popin { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ---------- notation svg ---------- */
.score text.m { font-family: "Bravura"; font-size: 40px; }
.score .lbl { font-family: var(--font); font-weight: 800; font-size: 12px; fill: var(--ink); }
.score .lbl.big { font-size: 15px; fill: var(--brand); }
.score .tempo { font-family: var(--font); font-weight: 900; font-size: 13px; fill: var(--ink); }
.score .ital { font-family: Georgia, serif; font-style: italic; font-weight: 600; font-size: 13px; }
.score .hl { color: var(--brand); }
.score .ev { transition: opacity .25s, transform .3s cubic-bezier(.2,1.5,.5,1), color .15s; transform-box: fill-box; transform-origin: center; }
.score .ev.hide { opacity: 0; transform: scale(.4) translateY(10px); }
.score .ev.lit { color: var(--orange); }
.score .ev.lit .lbl { fill: var(--orange); }
.score .ev.good { color: var(--green); } .score .ev.bad { color: var(--red); }
.score .boxr { fill: rgba(108,76,241,.07); stroke: var(--brand); stroke-width: 1.5; stroke-dasharray: 4 3; }

/* ---------- video player ---------- */
.vp { border-radius: 22px; overflow: hidden; background: #1E1538; border: 3px solid #1E1538; box-shadow: 0 6px 0 #CFC6EC; user-select: none; }
.vp-stage { container-type: size; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: radial-gradient(120% 120% at 20% 10%, #FFFFFF 0%, #F3EEFF 45%, #E6DEFF 100%); }
.vp-scene { position: absolute; inset: 0 0 18% 0; display: flex; align-items: center; justify-content: center; padding: 4% 5% 0 18%; }
.vp-cap { position: absolute; left: 16%; right: 3%; bottom: 3.5%; min-height: 12%; background: rgba(30,21,56,.88); color: #fff; font-weight: 800; font-size: clamp(13px, 2.2vw, 19px); border-radius: 14px; padding: 8px 14px; display: flex; align-items: center; transition: opacity .2s; line-height: 1.3; }
.vp-cap:empty { opacity: 0; }
.vp-cap.off { display: none; }
.vp-mascot { position: absolute; left: 1.5%; bottom: 2%; width: 14%; transition: transform .3s; }
.vp-mascot svg { width: 100%; height: auto; overflow: visible; }
.vp-bigplay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(30,21,56,.25); cursor: pointer; z-index: 5; }
.vp-bigplay .pb { width: 92px; height: 92px; border-radius: 50%; background: var(--orange); box-shadow: 0 6px 0 var(--orange-d); display: grid; place-items: center; color: #fff; font-size: 40px; padding-left: 8px; transition: transform .15s; }
.vp-bigplay:hover .pb { transform: scale(1.08); }
.vp-bigplay .pt { position: absolute; top: 14%; color: #fff; font-weight: 1000; font-size: clamp(18px, 3vw, 26px); text-shadow: 0 2px 8px rgba(0,0,0,.4); background: rgba(30,21,56,.55); padding: 4px 16px; border-radius: 12px; }
.vp-ctrl { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #1E1538; color: #fff; }
.vp-ctrl button { background: transparent; border: 0; color: #fff; font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 10px; font-weight: 900; }
.vp-ctrl button:hover { background: rgba(255,255,255,.12); }
.vp-ctrl button.off { opacity: .45; }
.vp-ctrl .time { font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 800; opacity: .85; min-width: 76px; }
.vp-scrub { position: relative; flex: 1; height: 26px; cursor: pointer; display: flex; align-items: center; }
.vp-scrub .track { position: absolute; left: 0; right: 0; height: 8px; border-radius: 8px; background: rgba(255,255,255,.18); overflow: hidden; }
.vp-scrub .fill { height: 100%; background: var(--orange); width: 0; }
.vp-scrub .tick { position: absolute; width: 3px; height: 8px; background: #1E1538; top: 9px; }
.vp-scrub .tick.q { background: var(--yellow); width: 8px; height: 8px; border-radius: 50%; top: 9px; margin-left: -4px; }
.vp-scrub .knob { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff; margin-left: -9px; box-shadow: 0 2px 4px rgba(0,0,0,.3); }

@media (max-width: 560px) { .vp-ctrl { gap: 4px; padding: 6px 6px; } .vp-ctrl .time, .vp-ctrl .fs { display: none; } .vp-ctrl button { padding: 4px 5px; font-size: 18px; } .vp-scrub { min-width: 90px; } }
/* scene content */
.sc { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3%; }
.sc .in-el { opacity: 0; transform: translateY(14px) scale(.9); transition: opacity .35s, transform .45s cubic-bezier(.2,1.5,.45,1); }
.sc .in-el.in { opacity: 1; transform: none; }
.sc-title .big { font-size: clamp(48px, 10vw, 110px); line-height: 1; animation: bob 1.6s ease-in-out infinite; }
.sc-title .t { font-size: clamp(24px, 4.6vw, 48px); font-weight: 1000; color: var(--brand); text-align: center; letter-spacing: -.02em; }
.sc-title .s { font-size: clamp(14px, 2.4vw, 22px); font-weight: 800; color: var(--muted); text-align: center; }
.sc-rays { position: absolute; inset: -40%; background: repeating-conic-gradient(from 0deg, rgba(108,76,241,.06) 0deg 10deg, transparent 10deg 20deg); animation: spin 30s linear infinite; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.sc .scorewrap { width: 100%; display: flex; justify-content: center; }
.sc .scorewrap svg { max-width: 100%; height: auto; }
.vcard .top .mus { font-size: 1.5em; }
.sc .heading { font-weight: 1000; font-size: clamp(16px, 3vw, 28px); color: var(--ink); text-align: center; }
.sc-cards { display: flex; gap: 3%; justify-content: center; width: 100%; }
.vcard { background: #fff; border-radius: 18px; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--line); padding: 3% 2%; flex: 1; max-width: 26%; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.vcard .top { font-size: clamp(30px, 6vw, 64px); line-height: 1.1; min-height: 1.3em; display: flex; align-items: center; justify-content: center; }
.vcard .top .mus { font-size: 1em; line-height: 1; }
.vcard .nm { font-weight: 1000; font-size: clamp(13px, 2.2vw, 22px); color: var(--brand); }
.vcard .sb { font-weight: 800; font-size: clamp(11px, 1.7vw, 16px); color: var(--muted); }
.sc-big { font-size: clamp(34px, 7.5vw, 84px); font-weight: 1000; display: flex; gap: .3em; align-items: center; justify-content: center; flex-wrap: wrap; color: var(--ink); }
.sc-big .mus { font-size: 1.1em; line-height: 1; }
.sc-big .op { color: var(--orange); }
.sc-big-sub { font-size: clamp(14px, 2.6vw, 24px); font-weight: 800; color: var(--muted); text-align: center; }
.sc-list { display: flex; flex-direction: column; gap: 3%; width: 90%; }
.sc-list .li { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 14px; padding: 2% 3%; font-weight: 900; font-size: clamp(14px, 2.5vw, 24px); border: 3px solid var(--line); }
.sc-list .li .ck { flex: none; width: 1.4em; height: 1.4em; border-radius: 50%; background: var(--green); color: #fff; display: grid; place-items: center; font-size: .8em; }
.sc-quiz .q { font-weight: 1000; font-size: clamp(16px, 3vw, 28px); text-align: center; }
.sc-quiz .opts { display: flex; gap: 2.5%; justify-content: center; flex-wrap: wrap; width: 100%; }
.sc-quiz .opt { background: #fff; border: 3px solid var(--line); box-shadow: 0 5px 0 var(--line); border-radius: 16px; padding: 1.6% 3%; font-weight: 1000; font-size: clamp(14px, 2.6vw, 26px); cursor: pointer; color: var(--ink); font-family: inherit; min-width: 18%; }
.sc-quiz .opt:hover { border-color: var(--brand); }
.sc-quiz .opt.right { background: var(--green-l); border-color: var(--green); box-shadow: 0 5px 0 var(--green); color: var(--green-d); }
.sc-quiz .opt.wrong { background: var(--red-l); border-color: var(--red); box-shadow: 0 5px 0 var(--red); color: var(--red-d); animation: shake .4s; }
.sc-quiz .badge-q { background: var(--yellow); color: #4B3600; font-weight: 1000; font-size: clamp(11px, 1.8vw, 15px); padding: 4px 12px; border-radius: 99px; letter-spacing: .06em; }
.sc-term .word { font-size: clamp(36px, 8vw, 88px); font-weight: 1000; color: var(--brand); font-style: italic; font-family: Georgia, "Times New Roman", serif; }
.sc-term .lang { background: var(--brand-l); color: var(--brand); font-weight: 900; padding: 4px 12px; border-radius: 99px; font-size: clamp(11px, 1.8vw, 16px); }
.sc-term .mean { font-size: clamp(16px, 3.2vw, 32px); font-weight: 900; }
.sc-compare { display: flex; gap: 3%; width: 100%; justify-content: center; }
.sc-compare .pane { flex: 1; background: #fff; border-radius: 16px; border: 3px solid var(--line); padding: 2%; display: flex; flex-direction: column; align-items: center; gap: 6px; max-width: 48%; }
.sc-compare .pane .pl { font-weight: 1000; color: var(--brand); font-size: clamp(13px, 2.2vw, 20px); }
.sc-compare .pane svg { max-width: 100%; height: auto; }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(120vh) rotate(720deg); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

/* piano keyboard */
.kbd { position: relative; display: flex; user-select: none; }
.kbd .wk { position: relative; width: 44px; height: 160px; background: #fff; border: 2px solid #2A2140; border-radius: 0 0 9px 9px; margin-right: -2px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; font-weight: 900; color: #B0A8C4; font-size: 13px; transition: background .12s; }
.kbd .bk { position: absolute; width: 28px; height: 98px; background: #2A2140; border-radius: 0 0 7px 7px; z-index: 2; cursor: pointer; top: 0; transition: background .12s; }
.kbd .wk.lit { background: #FFD872; color: #4B3600; }
.kbd .bk.lit { background: var(--orange); }
.kbd .wk.sel { background: #CFC2FF; color: var(--brand-d); } .kbd .bk.sel { background: var(--brand); }
.kbd .wk.ok { background: #A9EBBB; } .kbd .bk.ok { background: var(--green); }
.kbd .wk.bad { background: #FFC2C8; } .kbd .bk.bad { background: var(--red); }
.kbd .wk:hover { background: #F4F0FF; } .kbd .bk:hover { background: #46396B; }
.kbd .klabel { position: absolute; top: -30px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-weight: 1000; font-size: 13px; padding: 2px 8px; border-radius: 8px; white-space: nowrap; z-index: 3; }
.kbd-wrap { display: flex; justify-content: center; padding-top: 34px; overflow-x: auto; }

.kbd2 { max-width: 760px; margin: 0 auto; }
.kbd2 .wk2 { flex: 1; position: relative; background: #fff; border: 2px solid #2A2140; border-left-width: 1px; border-right-width: 1px; border-radius: 0 0 8px 8px; cursor: pointer; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 6%; transition: background .12s; box-shadow: inset 0 -6px 0 #EEEAF6; }
.kbd2 .wk2 .kl { font-weight: 900; font-size: clamp(9px, 1.4vw, 13px); color: #B0A8C4; }
.kbd2 .bk2 { position: absolute; top: 0; height: 60%; background: #2A2140; border-radius: 0 0 6px 6px; z-index: 2; cursor: pointer; transition: background .12s; box-shadow: inset 0 -5px 0 #120C24; }
.kbd2 .wk2:hover { background: #F6F2FF; } .kbd2 .bk2:hover { background: #46396B; }
.kbd2 .down { filter: brightness(.9); }
.kbd2 .wk2.lit { background: #FFD872; box-shadow: inset 0 -6px 0 #F0B400; } .kbd2 .bk2.lit { background: var(--orange); box-shadow: inset 0 -5px 0 var(--orange-d); }
.kbd2 .wk2.lit2 { background: #BFF0CC; } .kbd2 .bk2.lit2 { background: var(--green); }
.kbd2 .wk2.sel { background: #D9CFFF; } .kbd2 .bk2.sel { background: var(--brand); }
.kbd2 .wk2.ok { background: #A9EBBB; } .kbd2 .bk2.ok { background: var(--green); }
.kbd2 .wk2.bad { background: #FFC2C8; } .kbd2 .bk2.bad { background: var(--red); }
.kbd2 .ktag { position: absolute; top: -28px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; font-weight: 1000; font-size: clamp(10px, 1.5vw, 14px); padding: 1px 7px; border-radius: 8px; white-space: nowrap; z-index: 4; animation: popin .3s cubic-bezier(.2,1.4,.5,1); }
.kbd2 .ktag.t { background: var(--orange); } .kbd2 .ktag.s { background: var(--blue); }
.kbd2 .bk2 .ktag { top: -28px; }

/* ---------- lesson runner ---------- */
.lesson { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column; }
.lesson-top { display: flex; align-items: center; gap: 16px; padding: 18px 24px; max-width: 980px; width: 100%; margin: 0 auto; }
.lesson-top .bar { flex: 1; height: 18px; }
.lesson-top .bar > i { --c: var(--green); }
.hearts-pill { display: flex; align-items: center; gap: 6px; font-weight: 1000; color: var(--red); font-size: 18px; }
.hearts-pill svg { width: 26px; height: 26px; }
.lesson-body { flex: 1; overflow-y: auto; padding: 8px 24px 24px; }
.lesson-inner { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.q-kind { font-weight: 900; color: var(--brand); font-size: 14px; text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 8px; }
.q-prompt { font-size: 24px; font-weight: 1000; line-height: 1.25; }
.q-row { display: flex; gap: 16px; align-items: center; }
.q-row .mini-mascot { width: 96px; flex: none; }
.q-row .bubble { border: 2px solid var(--line); border-radius: 16px; padding: 12px 16px; font-weight: 800; position: relative; background: #fff; }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.opts.letters { grid-template-columns: repeat(auto-fit, minmax(64px, 1fr)); }
.opts.scores { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.opt { border: 2px solid var(--line); background: #fff; border-radius: 16px; padding: 14px 16px; font-weight: 800; font-size: 17px; cursor: pointer; box-shadow: 0 4px 0 var(--line); color: var(--ink); text-align: left; display: flex; align-items: center; gap: 10px; transition: transform .05s; font-family: inherit; }
.opt .k { flex: none; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 8px; display: grid; place-items: center; font-size: 13px; color: var(--muted); font-weight: 900; }
.opt:hover { background: #FAF8FF; }
.opt:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--line); }
.opt.sel { border-color: #A994FF; background: var(--brand-l); box-shadow: 0 4px 0 #A994FF; color: var(--brand-d); }
.opt.sel .k { border-color: #A994FF; color: var(--brand); }
.opt.right { border-color: var(--green); background: var(--green-l); box-shadow: 0 4px 0 var(--green); }
.opt.wrong { border-color: var(--red); background: var(--red-l); box-shadow: 0 4px 0 var(--red); }
.opts.letters .opt { justify-content: center; font-size: 24px; font-weight: 1000; padding: 14px 6px; }
.opts.scores .opt { flex-direction: column; align-items: stretch; padding: 8px; }
.opts.scores .opt svg { width: 100%; height: auto; }
.opts.scores .opt .k { align-self: flex-start; }
.opt .mus { font-size: 2em; line-height: 1; }
.play-btn { width: 84px; height: 84px; border-radius: 22px; border: 0; background: var(--blue); box-shadow: 0 5px 0 var(--blue-d); color: #fff; cursor: pointer; display: grid; place-items: center; font-size: 34px; }
.play-btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--blue-d); }
.play-btn.sm { width: 56px; height: 56px; font-size: 24px; border-radius: 16px; }
.lesson-foot { border-top: 2px solid var(--line); padding: 18px 24px; transition: background .2s; }
.lesson-foot .inner { max-width: 980px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.lesson-foot.ok { background: var(--green-l); border-color: transparent; }
.lesson-foot.bad { background: var(--red-l); border-color: transparent; }
.fb { display: flex; align-items: center; gap: 14px; flex: 1; }
.fb .fi { width: 60px; height: 60px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 32px; flex: none; }
.fb .fi svg { width: 46px; height: auto; }
.fb .ft { font-weight: 1000; font-size: 22px; }
.fb .fx { font-weight: 700; font-size: 15px; }
.ok .fb .ft, .ok .fb .fx { color: var(--green-d); }
.bad .fb .ft, .bad .fb .fx { color: var(--red-d); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.match .col { display: flex; flex-direction: column; gap: 10px; }
.match .opt { justify-content: center; text-align: center; min-height: 60px; }
.match .opt.done { opacity: .35; pointer-events: none; border-color: var(--green); box-shadow: 0 4px 0 var(--green); }
.order-slot { min-height: 70px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; }
.order-pool { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 8px; }
.tile { border: 2px solid var(--line); border-radius: 12px; background: #fff; padding: 10px 14px; font-weight: 900; font-size: 18px; cursor: pointer; box-shadow: 0 3px 0 var(--line); font-family: inherit; color: var(--ink); }
.tile.used { visibility: hidden; }
.place-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.place-wrap svg { max-width: 100%; height: auto; touch-action: none; }
.acc-bar { display: flex; gap: 8px; }
.acc-bar button { width: 52px; height: 48px; font-size: 26px; }
.acc-bar button.on { background: var(--brand-l); border-color: var(--brand); }
.done-screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; padding: 24px; }
.done-screen h1 { color: var(--yellow-d); font-size: 2.2rem; }
.done-stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.dstat { border: 2px solid var(--c); border-radius: 16px; overflow: hidden; min-width: 130px; }
.dstat .dh { background: var(--c); color: #fff; font-weight: 1000; font-size: 12px; text-transform: uppercase; padding: 4px; letter-spacing: .06em; }
.dstat .dv { font-size: 24px; font-weight: 1000; padding: 10px; color: var(--c); }

/* ---------- modal / toast / tour ---------- */
.modal-back { position: fixed; inset: 0; background: rgba(30,21,56,.5); z-index: 80; display: grid; place-items: center; padding: 20px; animation: fade .2s; }
.modal { background: #fff; border-radius: 22px; padding: 24px; max-width: 460px; width: 100%; text-align: center; animation: popin .3s cubic-bezier(.2,1.4,.5,1); }
.modal .mm { width: 120px; margin: 0 auto 8px; }
@keyframes fade { from { opacity: 0; } }
.toasts { position: fixed; top: 76px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.toast { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 10px 16px; font-weight: 900; box-shadow: 0 6px 20px rgba(60,40,120,.15); display: flex; align-items: center; gap: 10px; animation: popin .35s cubic-bezier(.2,1.4,.5,1); }
.toast .ti { font-size: 28px; }
.tour-hole { position: fixed; z-index: 95; border-radius: 16px; box-shadow: 0 0 0 9999px rgba(30,21,56,.62); transition: all .35s; pointer-events: none; border: 3px solid var(--yellow); }
.tour-tip { position: fixed; z-index: 96; background: #fff; border-radius: 18px; padding: 16px 18px; width: 320px; box-shadow: 0 10px 30px rgba(0,0,0,.25); transition: all .35s; }
.tour-tip .tm { display: flex; gap: 10px; align-items: flex-start; }
.tour-tip .tm svg { width: 60px; flex: none; }
.tour-tip h4 { margin: 0 0 4px; font-size: 17px; }
.tour-tip p { margin: 0; font-weight: 600; font-size: 14.5px; }
.tour-tip .tb { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.tour-tip .dots { display: flex; gap: 4px; } .tour-tip .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); } .tour-tip .dots i.on { background: var(--brand); }

/* ---------- onboarding ---------- */
.onb { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; gap: 18px; text-align: center; background: radial-gradient(100% 80% at 50% 0%, #fff 0%, var(--bg) 60%); }
.onb .mascot-hero { width: 190px; }
.onb h1 { font-size: 2.2rem; }
.onb .brand { font-size: 2.6rem; font-weight: 1000; letter-spacing: -.03em; color: var(--brand); }
.onb .brand .give { color: var(--orange); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; width: 100%; max-width: 640px; }
.choice { border: 2px solid var(--line); background: #fff; border-radius: 18px; padding: 14px; cursor: pointer; font-weight: 900; box-shadow: 0 4px 0 var(--line); font-family: inherit; font-size: 15px; color: var(--ink); }
.choice .ce { font-size: 38px; display: block; }
.choice.sel { border-color: var(--brand); background: var(--brand-l); box-shadow: 0 4px 0 var(--brand); color: var(--brand-d); }
.inp { border: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 18px; font-weight: 800; font-family: inherit; width: 100%; max-width: 360px; background: #fff; color: var(--ink); outline: none; }
.inp:focus { border-color: var(--brand); }
select.inp { max-width: 100%; }
.onb-dots { display: flex; gap: 6px; } .onb-dots i { width: 36px; height: 8px; border-radius: 8px; background: var(--line); } .onb-dots i.on { background: var(--brand); }

/* ---------- overview, exams, tables ---------- */
.grade-card { border: 2px solid var(--line); border-radius: 20px; background: #fff; overflow: hidden; margin-bottom: 18px; }
.grade-card .gh { background: var(--c); color: #fff; padding: 16px 20px; display: flex; align-items: center; gap: 14px; }
.grade-card .gh .gn { font-size: 34px; font-weight: 1000; width: 58px; height: 58px; border-radius: 16px; background: rgba(255,255,255,.2); display: grid; place-items: center; }
.grade-card .gb { padding: 16px 20px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.unit-box h4 { color: var(--cd); font-size: 14px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.unit-box a { display: flex; gap: 8px; align-items: center; padding: 4px 0; color: var(--ink); font-weight: 700; font-size: 14.5px; }
.unit-box a:hover { color: var(--brand); }
.unit-box a .ck { color: var(--green); font-weight: 1000; width: 16px; }
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.how .hw { background: #fff; border: 2px solid var(--line); border-radius: 18px; padding: 14px; text-align: center; }
.how .hw .he { font-size: 38px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tbl th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px; border-bottom: 2px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid var(--line); font-weight: 700; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 12px; font-weight: 900; background: var(--soft); color: var(--brand); }
.pill.green { background: var(--green-l); color: var(--green-d); } .pill.red { background: var(--red-l); color: var(--red-d); } .pill.orange { background: #FFF0D9; color: var(--orange-d); } .pill.gold { background: #FFF3C4; color: #9A6B00; }
.exam-shell { max-width: 860px; margin: 0 auto; }
.exam-head { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 2px solid var(--line); padding: 12px 20px; display: flex; gap: 14px; align-items: center; }
.timer { font-variant-numeric: tabular-nums; font-weight: 1000; font-size: 20px; padding: 6px 14px; border-radius: 12px; background: var(--soft); color: var(--brand); }
.timer.low { background: var(--red-l); color: var(--red-d); animation: pulse2 1s infinite; }
@keyframes pulse2 { 50% { opacity: .6; } }
.qnav { display: flex; flex-wrap: wrap; gap: 5px; }
.qnav button { width: 30px; height: 30px; border-radius: 8px; border: 2px solid var(--line); background: #fff; font-weight: 900; font-size: 12px; cursor: pointer; color: var(--ink); font-family: inherit; }
.qnav button.ans { background: var(--brand-l); border-color: #A994FF; color: var(--brand); }
.qnav button.cur { outline: 3px solid var(--orange); }
.qnav button.right { background: var(--green-l); border-color: var(--green); color: var(--green-d); }
.qnav button.wrong { background: var(--red-l); border-color: var(--red); color: var(--red-d); }
.sec-title { font-size: 13px; font-weight: 1000; color: var(--brand); text-transform: uppercase; letter-spacing: .07em; }
.explain { background: #F4F1FF; border-left: 5px solid var(--brand); border-radius: 10px; padding: 10px 14px; font-weight: 700; font-size: 15px; }
.result-hero { text-align: center; padding: 24px; border-radius: 22px; background: linear-gradient(160deg, var(--c), var(--cd)); color: #fff; }
.result-hero .big { font-size: 64px; font-weight: 1000; line-height: 1; }
.chart-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 10px; }
.chart-bars .cb { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; font-size: 12px; font-weight: 800; color: var(--muted); }
.chart-bars .cb i { width: 100%; max-width: 38px; background: var(--yellow); border-radius: 8px 8px 4px 4px; box-shadow: inset 0 -4px 0 rgba(0,0,0,.08); min-height: 4px; }
.chart-bars .cb.today i { background: var(--orange); }
.glossary-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.gterm { background: #fff; border: 2px solid var(--line); border-radius: 16px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; }
.gterm .gw { font-family: Georgia, serif; font-style: italic; font-weight: 700; font-size: 20px; color: var(--brand-d); }
.gterm .gm { font-weight: 700; }
.gterm .gb { display: flex; gap: 6px; margin-top: 6px; }
.seg { display: inline-flex; background: #EEEAF6; border-radius: 14px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 12px; border-radius: 10px; font-weight: 900; cursor: pointer; color: var(--muted); font-family: inherit; font-size: 13.5px; }
.seg button.on { background: #fff; color: var(--brand); box-shadow: 0 2px 0 var(--line); }

/* ---------- mascot ---------- */
.bop { overflow: visible; display: block; }
.bop .eye-happy, .bop .m-open, .bop .m-sad, .bop .sweat { display: none; }
.bop .bop-all { animation: bopIdle 2.6s ease-in-out infinite; transform-origin: 58px 140px; }
.bop .bop-flag { animation: flagWiggle 1.1s ease-in-out infinite alternate; transform-origin: 90px 20px; }
.bop .eye-open { animation: blink 4.2s infinite; transform-origin: 57px 98px; }
.bop.happy .eye-open, .bop.cheer .eye-open { display: none; }
.bop.happy .eye-happy, .bop.cheer .eye-happy { display: inline; }
.bop.happy .m-smile, .bop.cheer .m-smile, .bop.talk .m-smile, .bop.wow .m-smile { display: none; }
.bop.happy .m-open, .bop.cheer .m-open, .bop.wow .m-open { display: inline; }
.bop.talk .m-open { display: inline; animation: talk .22s ease-in-out infinite alternate; transform-origin: 58px 112px; }
.bop.cheer .bop-all { animation: bopJump .55s ease-in-out infinite; }
.bop.happy .bop-all { animation: bopJump .9s ease-in-out 2; }
.bop.cheer .bop-arm-l, .bop.wave .bop-arm-l { animation: wave .35s ease-in-out infinite alternate; transform-origin: 24px 106px; }
.bop.cheer .bop-arm-r { animation: wave2 .35s ease-in-out infinite alternate; transform-origin: 92px 108px; }
.bop.sad .m-smile { display: none; } .bop.sad .m-sad, .bop.sad .sweat { display: inline; }
.bop.sad .bop-all { animation: none; transform: rotate(-4deg) translateY(3px); }
.bop.think .pupils { transform: translate(-2px, -4px); }
.bop.wow .bop-all { animation: none; transform: scale(1.05); }
@keyframes bopIdle { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-4px) rotate(-2deg); } }
@keyframes bopJump { 0%, 100% { transform: translateY(0) scale(1, 1); } 30% { transform: translateY(-16px) scale(.96, 1.04); } 60% { transform: translateY(0) scale(1.05, .95); } }
@keyframes flagWiggle { from { transform: rotate(-6deg); } to { transform: rotate(8deg); } }
@keyframes blink { 0%, 93%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.08); } }
@keyframes talk { from { transform: scaleY(.45); } to { transform: scaleY(1.05); } }
@keyframes wave { from { transform: rotate(10deg); } to { transform: rotate(-30deg); } }
@keyframes wave2 { from { transform: rotate(-10deg); } to { transform: rotate(-60deg); } }

/* ---------- certificate & print ---------- */
.cert { background: #fff; aspect-ratio: 1.414; max-width: 900px; margin: 0 auto; position: relative; padding: 5%; border-radius: 6px; box-shadow: 0 10px 40px rgba(60,40,120,.15); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; overflow: hidden; }
.cert:before { content: ""; position: absolute; inset: 2.2%; border: 6px double var(--c); border-radius: 10px; }
.cert .ch { font-size: clamp(13px, 1.6vw, 16px); font-weight: 900; letter-spacing: .3em; text-transform: uppercase; color: var(--cd); }
.cert .cn { font-family: Georgia, serif; font-style: italic; font-size: clamp(30px, 5vw, 56px); color: var(--ink); margin: 2% 0; border-bottom: 2px solid var(--line); padding: 0 6%; }
.cert .ct { font-size: clamp(14px, 2vw, 20px); font-weight: 800; }
.cert .cg { font-size: clamp(22px, 3.4vw, 40px); font-weight: 1000; color: var(--c); margin: 1% 0; }
.cert .cf { display: flex; justify-content: space-between; width: 80%; margin-top: 4%; font-size: 13px; font-weight: 800; color: var(--muted); }
.cert .cf div { border-top: 2px solid var(--ink); padding-top: 6px; min-width: 30%; }
.cert .seal { position: absolute; right: 7%; bottom: 9%; width: 13%; }
.cert .cm { position: absolute; left: 6%; bottom: 7%; width: 11%; }
.cert .notes-deco { position: absolute; font-family: Bravura; font-size: 60px; color: var(--c); opacity: .12; }
.ws { background: #fff; max-width: 820px; margin: 0 auto; padding: 32px 40px; border: 2px solid var(--line); border-radius: 8px; }
.ws-head { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 3px solid var(--ink); padding-bottom: 10px; margin-bottom: 16px; }
.ws-q { break-inside: avoid; padding: 10px 0 14px; border-bottom: 1px dashed #ccc; }
.ws-q .wn { font-weight: 1000; margin-right: 6px; }
.ws-q .wo { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 8px; font-weight: 700; align-items: center; }
.ws-q .wo .box { display: inline-block; width: 16px; height: 16px; border: 2px solid #555; border-radius: 4px; vertical-align: -3px; margin-right: 6px; }
.ws-q .wo.sc { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.ws-q svg { max-width: 100%; height: auto; }
.ws-key { break-before: page; }
@media print {
  body { background: #fff; }
  .side, .topbar, .bottomnav, .noprint, .footer { display: none !important; }
  .shell { display: block; }
  .page { padding: 0; max-width: none; }
  .ws { border: 0; padding: 0; }
  .cert { box-shadow: none; max-width: none; width: 100%; }
  @page { margin: 14mm; }
}
@media print { .cert-page @page { size: landscape; } }

/* ---------- "Get the app" page (js/pages/app.js – switched off while the site is website-only) ---------- */
.app-hero { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.app-how { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.app-how .card.mine { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.app-steps { margin: 0; padding-left: 22px; font-weight: 700; line-height: 1.6; }
.app-steps li { margin: 4px 0; }
.kbdish { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 6px; border: 2px solid var(--line); border-bottom-width: 3px; border-radius: 8px; background: #fff; font-size: 14px; vertical-align: middle; }
@media (max-width: 760px) { .app-how { grid-template-columns: 1fr; } }

/* notched phones & the home-screen app: keep clear of the status bar, notch and home indicator */
html { -webkit-tap-highlight-color: transparent; }
body { padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
.topbar { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.side { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
.exam-head { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.lesson-top { padding-top: calc(18px + env(safe-area-inset-top, 0px)); }
.lesson-foot { padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px)); }
.footer { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
@media (max-width: 760px) {
  .topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }
  .bottomnav { padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
}
.standalone .onb { padding-top: calc(24px + env(safe-area-inset-top, 0px)); }

/* ---------- video: hooks, fun facts, "up next" ---------- */
.vp-scene > .sc { animation: ggScIn .42s cubic-bezier(.2,1.2,.4,1) both; }
@keyframes ggScIn { from { opacity: 0; transform: translateX(5%) scale(.97); } to { opacity: 1; transform: none; } }
.sc-hook { position: relative; text-align: center; gap: 2.5%; }
.hook-burst { position: absolute; inset: -30%; background: radial-gradient(circle at 50% 42%, rgba(255,200,61,.38) 0 16%, rgba(108,76,241,.12) 34%, transparent 60%); animation: ggPulse 1.4s ease-in-out infinite; pointer-events: none; }
.hook-big { font-size: clamp(54px, 12vw, 130px); line-height: 1; filter: drop-shadow(0 6px 0 rgba(0,0,0,.08)); position: relative; }
.hook-big.in { animation: ggHookPop .7s cubic-bezier(.2,1.6,.4,1) both, ggWobble 2.4s ease-in-out .8s infinite; }
.hook-t { position: relative; font-size: clamp(21px, 4.3vw, 46px); font-weight: 1000; color: var(--ink); max-width: 92%; line-height: 1.12; letter-spacing: -.02em; }
.hook-t b, .hook-t strong { color: var(--brand); }
.hook-s { position: relative; font-size: clamp(14px, 2.4vw, 22px); font-weight: 800; color: var(--muted); }
@keyframes ggHookPop { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 60% { transform: scale(1.15) rotate(4deg); opacity: 1; } 100% { transform: none; } }
@keyframes ggWobble { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 75% { transform: rotate(6deg); } }
@keyframes ggPulse { 0%, 100% { transform: scale(1); opacity: .85; } 50% { transform: scale(1.08); opacity: 1; } }
.fact-card { position: relative; width: min(86%, 720px); background: #fff; border: 3px solid var(--yellow); border-radius: 22px; padding: 5% 5% 4%; text-align: center; box-shadow: 0 8px 0 rgba(224,165,0,.28); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.fact-tag { position: absolute; top: -.95em; left: 50%; transform: translateX(-50%) rotate(-2deg); background: var(--yellow); color: #4a3500; font-weight: 1000; font-size: clamp(12px, 2vw, 18px); padding: .25em .9em; border-radius: 99px; white-space: nowrap; letter-spacing: .04em; }
.fact-big { font-size: clamp(40px, 8vw, 86px); line-height: 1.1; }
.fact-t { font-size: clamp(16px, 3vw, 31px); font-weight: 1000; color: var(--ink); line-height: 1.2; }
.sc-next { gap: 5%; }
.next-tag { font-weight: 1000; letter-spacing: .14em; color: var(--muted); font-size: clamp(12px, 2vw, 18px); }
.next-card { display: flex; align-items: center; gap: 14px; background: var(--brand); color: #fff; border-radius: 20px; padding: 3% 5%; box-shadow: 0 8px 0 var(--brand-d); max-width: 90%; }
.next-ic { font-size: clamp(34px, 7vw, 72px); line-height: 1; }
.next-tt { font-size: clamp(19px, 3.6vw, 40px); font-weight: 1000; display: flex; flex-direction: column; line-height: 1.15; }
.next-tt small { font-size: .45em; font-weight: 800; opacity: .85; }
.sc-quiz.bonus .badge-q { background: var(--orange); color: #fff; }

/* figured bass numbers under the stave */
.score text.lbl.fig { font-weight: 800; font-size: 14px; }

/* ---------- language picker ---------- */
.topbar .lang-btn { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 5px 10px; font: inherit; font-weight: 900; font-size: 13px; cursor: pointer; display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; }
.topbar .lang-btn + .stats { margin-left: 8px; }
@media (max-width: 560px) { .topbar .lang-btn span { display: none; } .topbar .lang-btn { padding: 4px 7px; } }
.lang-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-top: 8px; }
.lang-choice { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lang-choice small { color: var(--muted); font-weight: 700; }
.lang-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.lang-pill { border: 2px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font: inherit; font-weight: 800; font-size: 14px; cursor: pointer; }
.lang-pill.on { border-color: var(--brand); background: var(--brand-l); color: var(--brand-d); }
.topbar .title { margin-right: auto; }
.topbar .lang-btn { margin-left: 0 !important; }
.topbar > .stats { margin-left: 8px; }
.topbar { gap: 8px; }
