/* READ.EDU.NP — shared styles */
:root {
  --bg: #F6F7FB;
  --bg2: #FFFFFF;
  --card: #FFFFFF;
  --ink: #0F172A;
  --ink2: #475569;
  --muted: #94A3B8;
  --line: #E6E8F0;
  --brand: #4F46E5;
  --brand2: #7C3AED;
  --accent: #F59E0B;
  --ok: #10B981;
  --bad: #EF4444;
  --soft: #EEF2FF;
  --shadow: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px -8px rgba(15,23,42,.10);
  --shadow-lg: 0 24px 48px -16px rgba(49,46,129,.28);
  --r: 18px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0B1020;
  --bg2: #111833;
  --card: #141C3A;
  --ink: #E8ECF8;
  --ink2: #A9B4D0;
  --muted: #6B7699;
  --line: #233056;
  --soft: #1C2550;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--ink); line-height: 1.6; font-size: 16px; transition: background .25s, color .25s; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input { font: inherit; }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 12px; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; font-size: 18px; }
.logo-mark { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 18px; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: 0 6px 16px -6px var(--brand); }
.logo b { color: var(--accent); }
.spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; border: 1px solid var(--line); background: var(--card); font-size: 18px; transition: transform .15s; }
.icon-btn:hover { transform: translateY(-1px); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 14px; font-weight: 700; font-size: 15px; transition: transform .15s, box-shadow .15s, background .15s; white-space: nowrap; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; box-shadow: 0 10px 24px -10px var(--brand); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 28px -10px var(--brand); }
.btn-ghost { border: 1px solid var(--line); background: var(--card); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 11px; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; padding: 72px 0 56px; }
.hero::before { content: ""; position: absolute; inset: -40% -10% auto; height: 640px; background: radial-gradient(closest-side, rgba(99,102,241,.22), transparent 70%), radial-gradient(closest-side at 80% 30%, rgba(245,158,11,.18), transparent 70%); pointer-events: none; }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 99px; background: var(--soft); color: var(--brand); font-weight: 700; font-size: 13px; }
[data-theme="dark"] .pill { color: #A5B4FC; }
.hero h1 { font-size: clamp(36px, 5.6vw, 64px); line-height: 1.04; letter-spacing: -.035em; margin: 18px 0 16px; font-weight: 800; }
.grad { background: linear-gradient(120deg, var(--brand), var(--brand2) 50%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: clamp(16px, 1.6vw, 19px); color: var(--ink2); max-width: 560px; margin: 0 0 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.stats { display: flex; gap: 28px; margin-top: 36px; flex-wrap: wrap; }
.stats div b { display: block; font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.stats div span { color: var(--muted); font-size: 13px; font-weight: 600; }
.hero-art { position: relative; aspect-ratio: 1; max-width: 460px; justify-self: end; width: 100%; }
.orb { position: absolute; inset: 8%; border-radius: 36% 64% 58% 42% / 42% 38% 62% 58%; background: linear-gradient(140deg, var(--brand), var(--brand2) 55%, var(--accent)); animation: morph 12s ease-in-out infinite; box-shadow: var(--shadow-lg); }
@keyframes morph { 50% { border-radius: 58% 42% 36% 64% / 60% 52% 48% 40%; transform: rotate(8deg); } }
.float-card { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); font-weight: 700; display: flex; align-items: center; gap: 10px; font-size: 14px; animation: bob 6s ease-in-out infinite; }
.float-card i { font-style: normal; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--soft); }
.fc1 { top: 10%; left: -4%; } .fc2 { top: 46%; right: -6%; animation-delay: -2s; } .fc3 { bottom: 6%; left: 10%; animation-delay: -4s; }
@keyframes bob { 50% { transform: translateY(-10px); } }
.orb-sym { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.92); font-size: clamp(90px, 14vw, 150px); font-weight: 300; font-family: "Times New Roman", serif; font-style: italic; }

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
.sec-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.sec-head h2 { font-size: clamp(26px, 3.2vw, 36px); letter-spacing: -.03em; margin: 0; line-height: 1.15; }
.sec-head p { margin: 6px 0 0; color: var(--ink2); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 8px 16px; border-radius: 99px; border: 1px solid var(--line); background: var(--card); font-weight: 700; font-size: 14px; color: var(--ink2); transition: all .15s; }
.chip.on, .chip:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; }
.course { position: relative; overflow: hidden; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); padding: 22px; box-shadow: var(--shadow); transition: transform .2s, box-shadow .2s; display: flex; flex-direction: column; min-height: 230px; text-align: left; }
.course:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.course .sym { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 28px; color: #fff; font-family: "Times New Roman", serif; font-style: italic; margin-bottom: 16px; }
.course .glow { position: absolute; right: -40px; top: -40px; width: 150px; height: 150px; border-radius: 50%; opacity: .14; }
.course .grade { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.course h3 { margin: 2px 0 8px; font-size: 20px; letter-spacing: -.02em; }
.course p { margin: 0 0 16px; color: var(--ink2); font-size: 14px; flex: 1; }
.course .foot { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 14px; }
.badge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 99px; letter-spacing: .04em; text-transform: uppercase; }
.badge.live { background: rgba(16,185,129,.14); color: var(--ok); }
.badge.soon { background: var(--soft); color: var(--muted); }
.course.is-soon { opacity: .78; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow); }
.step .n { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand2)); margin-bottom: 14px; }
.step h4 { margin: 0 0 6px; font-size: 17px; }
.step p { margin: 0; color: var(--ink2); font-size: 14px; }

.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.feat { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
.feat i { font-style: normal; font-size: 20px; }

footer { border-top: 1px solid var(--line); padding: 32px 0 40px; color: var(--muted); font-size: 14px; }
footer .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* ---------- Toast / modal ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 14px; font-weight: 600; font-size: 14px; z-index: 100; transition: transform .3s cubic-bezier(.2,.9,.3,1.2); max-width: calc(100% - 32px); box-shadow: var(--shadow-lg); }
.toast.show { transform: translate(-50%, 0); }
.modal { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; padding: 16px; background: rgba(8,10,25,.6); backdrop-filter: blur(6px); }
.modal.open { display: flex; animation: fade .2s; }
.modal-box { background: var(--card); border-radius: 22px; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); position: relative; animation: pop .25s cubic-bezier(.2,.9,.3,1.2); }
.modal-box.wide { width: min(1000px, 100%); height: calc(100vh - 32px); display: flex; flex-direction: column; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.modal-head h3 { margin: 0; font-size: 17px; flex: 1; }
.modal-body { padding: 20px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }

/* ---------- Gate ---------- */
.gate { min-height: calc(100vh - 64px); display: grid; place-items: center; padding: 32px 16px; position: relative; overflow: hidden; }
.gate::before { content: ""; position: absolute; width: 700px; height: 700px; border-radius: 50%; background: radial-gradient(closest-side, rgba(99,102,241,.25), transparent); top: -200px; right: -200px; }
.gate-card { position: relative; width: min(460px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 26px; padding: 32px; box-shadow: var(--shadow-lg); }
.gate-card .sym { width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; font-size: 30px; color: #fff; font-family: "Times New Roman", serif; font-style: italic; margin-bottom: 18px; }
.gate-card h1 { font-size: 26px; letter-spacing: -.02em; margin: 0 0 4px; line-height: 1.2; }
.gate-card .sub { color: var(--ink2); margin: 0 0 24px; font-size: 15px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.field input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); color: var(--ink); font-size: 16px; outline: none; transition: border .15s, box-shadow .15s; }
.field input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(99,102,241,.15); }
.field input.otp { letter-spacing: .5em; text-align: center; font-size: 24px; font-weight: 800; }
.err { color: var(--bad); font-size: 14px; font-weight: 600; min-height: 20px; margin: -4px 0 10px; }
.demo-note { margin-top: 18px; padding: 12px 14px; border-radius: 14px; background: rgba(245,158,11,.12); color: #B45309; font-size: 13px; font-weight: 600; }
[data-theme="dark"] .demo-note { color: #FCD34D; }
.demo-note code { background: rgba(245,158,11,.2); padding: 1px 6px; border-radius: 6px; font-weight: 800; }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.stepper { display: flex; gap: 6px; margin-bottom: 22px; }
.stepper span { height: 5px; flex: 1; border-radius: 9px; background: var(--line); }
.stepper span.on { background: linear-gradient(90deg, var(--brand), var(--brand2)); }
.w100 { width: 100%; }
.link { color: var(--brand); font-weight: 700; font-size: 14px; }

/* ---------- Course app ---------- */
.app { display: grid; grid-template-columns: 290px 1fr; gap: 24px; padding: 24px 0 64px; align-items: start; }
.side { position: sticky; top: 88px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); max-height: calc(100vh - 110px); overflow: auto; }
.side h5 { margin: 6px 10px 10px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.ch-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; text-align: left; transition: background .15s; }
.ch-btn:hover { background: var(--soft); }
.ch-btn.on { background: var(--soft); box-shadow: inset 3px 0 0 var(--brand); }
.ch-num { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--bg); border: 1px solid var(--line); }
.ch-btn.on .ch-num { background: var(--brand); color: #fff; border-color: var(--brand); }
.ch-btn.done .ch-num { background: var(--ok); color: #fff; border-color: var(--ok); }
.ch-title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.ch-sub { font-size: 12px; color: var(--muted); font-weight: 600; }
.side hr { border: 0; border-top: 1px solid var(--line); margin: 10px 0; }
.progress { margin: 4px 10px 14px; }
.progress .bar { height: 8px; border-radius: 9px; background: var(--line); overflow: hidden; }
.progress .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--ok), #34D399); border-radius: 9px; transition: width .4s; }
.progress small { display: flex; justify-content: space-between; font-weight: 700; color: var(--ink2); font-size: 12px; margin-top: 6px; }

.main { min-width: 0; }
.ch-hero { position: relative; overflow: hidden; border-radius: 24px; padding: 28px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand2)); box-shadow: var(--shadow-lg); margin-bottom: 18px; }
.ch-hero::after { content: attr(data-sym); position: absolute; right: 18px; bottom: -40px; font-size: 180px; opacity: .14; font-family: "Times New Roman", serif; font-style: italic; line-height: 1; }
.ch-hero .k { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; opacity: .8; }
.ch-hero h1 { margin: 4px 0 6px; font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -.03em; line-height: 1.15; position: relative; z-index: 1; }
.ch-hero p { margin: 0 0 16px; opacity: .9; max-width: 640px; position: relative; z-index: 1; }
.ch-hero .actions { display: flex; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.ch-hero .btn { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.3); }
.ch-hero .btn:hover { background: rgba(255,255,255,.28); }
.ch-hero .btn.done { background: #fff; color: var(--ok); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; position: sticky; top: 64px; z-index: 5; background: var(--bg); margin: 0 -2px 8px; }
.tabs::-webkit-scrollbar { display: none; }
.tab { flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; background: var(--card); border: 1px solid var(--line); color: var(--ink2); transition: all .15s; }
.tab .c { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 99px; background: var(--bg); color: var(--muted); }
.tab.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.tab.on .c { background: rgba(255,255,255,.18); color: inherit; }
[data-theme="dark"] .tab.on .c { background: rgba(0,0,0,.2); }
.tab.empty { opacity: .5; }

.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 6px 0 14px; }
.panel-title h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.panel-title h2 i { font-style: normal; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); font-size: 19px; }
.stack { display: grid; gap: 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); animation: rise .35s both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
.card h4 { margin: 0 0 6px; font-size: 16px; }
.card .body { color: var(--ink2); overflow-x: auto; }
.qnum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px; background: var(--soft); color: var(--brand); font-weight: 800; font-size: 13px; margin-right: 8px; }
[data-theme="dark"] .qnum { color: #A5B4FC; }
.q-row { display: flex; align-items: flex-start; gap: 4px; }
.q-row .body { color: var(--ink); flex: 1; min-width: 0; }
.tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: rgba(245,158,11,.14); color: #B45309; margin-bottom: 8px; letter-spacing: .02em; }
[data-theme="dark"] .tag { color: #FCD34D; }
.reveal { margin-top: 12px; }
.reveal-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; color: var(--brand); padding: 7px 12px; border-radius: 10px; background: var(--soft); }
[data-theme="dark"] .reveal-btn { color: #A5B4FC; }
.answer { display: none; margin-top: 10px; padding: 14px 16px; border-radius: 12px; background: rgba(16,185,129,.08); border-left: 4px solid var(--ok); color: var(--ink); overflow-x: auto; }
.reveal.open .answer { display: block; animation: rise .25s; }

.outcome { display: flex; gap: 14px; align-items: flex-start; }
.outcome .tick { flex: none; width: 28px; height: 28px; border-radius: 9px; border: 2px solid var(--line); display: grid; place-items: center; font-size: 14px; color: transparent; transition: all .15s; margin-top: 1px; }
.outcome.ok .tick { background: var(--ok); border-color: var(--ok); color: #fff; }
.outcome { cursor: pointer; }
.outcome .body { color: var(--ink); }

details.acc { background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; animation: rise .35s both; }
details.acc summary { list-style: none; padding: 16px 20px; font-weight: 700; display: flex; align-items: center; gap: 12px; cursor: pointer; }
details.acc summary::-webkit-details-marker { display: none; }
details.acc summary::after { content: "+"; margin-left: auto; font-size: 22px; color: var(--muted); transition: transform .2s; }
details.acc[open] summary::after { transform: rotate(45deg); }
details.acc .body { padding: 0 20px 18px; color: var(--ink2); overflow-x: auto; }

.kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.kw { perspective: 900px; height: 150px; cursor: pointer; animation: rise .35s both; }
.kw-in { position: relative; width: 100%; height: 100%; transition: transform .5s; transform-style: preserve-3d; }
.kw.flip .kw-in { transform: rotateY(180deg); }
.kw-f, .kw-b { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: 16px; padding: 16px; display: grid; place-items: center; text-align: center; border: 1px solid var(--line); box-shadow: var(--shadow); }
.kw-f { background: var(--card); font-weight: 800; font-size: 18px; }
.kw-f small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; margin-top: 6px; }
.kw-b { background: linear-gradient(135deg, var(--brand), var(--brand2)); color: #fff; transform: rotateY(180deg); font-size: 14px; font-weight: 600; }

.f-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 12px; }
.formula { position: relative; }
.formula h4 { padding-right: 52px; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.formula .body { color: var(--ink); font-size: 15px; }
.copy { position: absolute; top: 12px; right: 12px; font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 8px; border-radius: 8px; }
.copy:hover { background: var(--soft); color: var(--brand); }

.mcq-score { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.mcq-score .ring { padding: 6px 12px; border-radius: 99px; background: var(--soft); color: var(--brand); }
.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 12px; }
.opt { display: flex; align-items: center; gap: 10px; text-align: left; padding: 12px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-weight: 600; transition: all .15s; }
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt b { flex: none; width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--line); font-size: 13px; }
.opt.right { border-color: var(--ok); background: rgba(16,185,129,.1); }
.opt.right b { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: rgba(239,68,68,.08); }
.opt.wrong b { background: var(--bad); color: #fff; border-color: var(--bad); }
.opt:disabled { cursor: default; }
.explain { margin-top: 10px; font-size: 14px; color: var(--ink2); display: none; }
.answered .explain { display: block; }

.game-grid, .media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.game { text-align: left; display: flex; flex-direction: column; gap: 10px; transition: transform .2s; cursor: pointer; }
.game:hover { transform: translateY(-3px); }
.game .gi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 24px; background: linear-gradient(135deg, #FDE68A, #F59E0B); }
.game p { margin: 0; color: var(--ink2); font-size: 14px; }
.video { padding: 0; overflow: hidden; }
.video .frame { aspect-ratio: 16/9; background: #000; }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video .vbody { padding: 14px 18px; }
.video .thumb { aspect-ratio: 16/9; display: grid; place-items: center; background: linear-gradient(135deg, #1E1B4B, #4C1D95); color: #fff; font-size: 54px; }
.pdf { display: flex; gap: 14px; align-items: flex-start; }
.pdf .pi { flex: none; width: 52px; height: 62px; border-radius: 10px; background: linear-gradient(160deg, #F87171, #DC2626); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 12px; }
.pdf .acts { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); border: 2px dashed var(--line); border-radius: 18px; }
.empty-state div { font-size: 40px; margin-bottom: 8px; }

/* exam papers */
.paper-head { border-radius: 20px; padding: 22px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 14px; text-align: center; }
.paper-head h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.02em; }
.paper-head .meta { display: flex; justify-content: center; gap: 18px; color: var(--ink2); font-weight: 700; font-size: 14px; flex-wrap: wrap; }
.paper-tools { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
.group-h { margin: 18px 0 8px; font-weight: 800; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.marks { flex: none; font-weight: 800; font-size: 12px; color: var(--muted); padding: 3px 8px; border: 1px solid var(--line); border-radius: 8px; margin-left: 8px; }
.paper-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.paper-card { text-align: left; cursor: pointer; transition: transform .2s; }
.paper-card:hover { transform: translateY(-3px); }

/* flashcards + speed game */
.flash { perspective: 1200px; height: 260px; cursor: pointer; }
.flash .kw-f, .flash .kw-b { font-size: 20px; }
.flash .kw-b { font-size: 22px; }
.game-nav { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; gap: 8px; }
.timer { height: 8px; border-radius: 9px; background: var(--line); overflow: hidden; margin-bottom: 16px; }
.timer i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--bad)); transition: width 1s linear; }
.big-score { text-align: center; padding: 20px 0; }
.big-score b { display: block; font-size: 64px; font-weight: 800; letter-spacing: -.04em; background: linear-gradient(135deg, var(--brand), var(--brand2)); -webkit-background-clip: text; background-clip: text; color: transparent; }

.mobile-only { display: none; }
.loading { display: grid; place-items: center; min-height: 60vh; color: var(--muted); font-weight: 700; gap: 12px; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; margin: .4em 0 !important; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-art { max-width: 340px; justify-self: center; order: -1; }
  .app { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: min(320px, 86vw); max-height: none; border-radius: 0 22px 22px 0; z-index: 80; transform: translateX(-105%); transition: transform .3s cubic-bezier(.2,.9,.3,1); top: 0; padding-top: 20px; }
  .side.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(8,10,25,.5); z-index: 70; display: none; }
  .scrim.open { display: block; }
  .mobile-only { display: inline-flex; }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 40px 0 32px; }
  .hide-sm { display: none !important; }
  .stats { gap: 20px; }
  .gate-card { padding: 24px; border-radius: 22px; }
  .ch-hero { padding: 22px; border-radius: 20px; }
  .card { padding: 16px; }
  .float-card { font-size: 12px; padding: 8px 12px; }
  .float-card i { width: 26px; height: 26px; }
  section.block { padding: 40px 0; }
  .modal { padding: 0; align-items: flex-end; }
  .modal-box { border-radius: 22px 22px 0 0; max-height: 92vh; }
  .modal-box.wide { height: 92vh; }
}

/* ---------- Print (exam papers) ---------- */
@media print {
  .topbar, .side, .tabs, .ch-hero, .paper-tools, .reveal-btn, .mobile-only, .scrim, .toast { display: none !important; }
  body { background: #fff; color: #000; }
  .app { display: block; padding: 0; }
  .card, .paper-head { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}
