/* Lumo — SAT prep. Implemented from the "Lumo SAT Prep" Claude Design project.
   Tokens: Inter, ink #101827, brand purple #6D28D9, navy sidebar, slate grays. */

@font-face {
  font-family: 'Inter';
  src: url('fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --ink: #101827;
  --slate-7: #334155;
  --slate-6: #475569;
  --slate-5: #606F85;
  --slate-4: #94A3B8;
  --slate-3: #CBD5E1;
  --border: #E2E8F0;
  --border-soft: #EEF2F6;
  --bg-soft: #F8FAFC;
  --bg-softer: #F1F5F9;
  --purple: #6D28D9;
  --purple-hover: #5B21B6;
  --purple-deep: #5B21B6;
  --purple-wash: #F5F3FF;
  --purple-line: #EDE9FE;
  --purple-lt: #8B5CF6;
  --pink: #DB2777;
  --magenta: #C026D3;
  --magenta-deep: #9D174D;
  --lime: #A3E635;
  --amber: #F59E0B;
  --orange: #F97316;
  --green: #22C55E;
  --green-deep: #166534;
  --green-wash: #DCFCE7;
  --sky-wash: #E0F2FE;
  --sky-ink: #0C4A6E;
  --lav-bg: #FBFAFF;
  --grad-purple: linear-gradient(135deg, #7C3AED 0%, #5B21B6 100%);
  --grad-pink: linear-gradient(135deg, #D1196F 0%, #A21CAF 100%);
  --grad-lilac: linear-gradient(135deg, #8452F5 0%, #6D28D9 100%);
}

::selection { background: var(--purple-line); color: var(--ink); }
:focus-visible { outline: 2px solid var(--purple); outline-offset: 2px; border-radius: 6px; }

html, body { height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  accent-color: var(--purple);
}
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-hover); }
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
.hidden { display: none !important; }

.ic { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic-fill { fill: currentColor; stroke: none; }

/* ============ Mascot (Lumo blob) ============ */
.lumo { position: relative; flex: none; background: var(--grad-purple); }
.lumo::before, .lumo::after {
  content: ''; position: absolute; background: #fff; border-radius: 50%;
  width: 20%; height: 24%; top: 38%;
}
.lumo::before { left: 22%; }
.lumo::after { left: 58%; }
.lumo .dot {
  position: absolute; border-radius: 50%; background: var(--lime);
  width: 29%; height: 29%; left: -8%; top: -8%;
}
.lumo.lilac { background: var(--grad-lilac); }
.lumo.pink { background: linear-gradient(150deg, #F9A8D4, #C026D3); }
.lumo.round { border-radius: 50%; }

/* ============ App shell ============ */
.shell { display: flex; height: 100vh; overflow: hidden; }
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.view { flex: 1; overflow-y: auto; display: none; }
.view.active { display: block; }

/* ============ Sidebar — icon rail ============ */
.sidebar {
  width: 76px; flex: none; background: #101827; color: #fff;
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 0 12px; gap: 10px; overflow: visible; z-index: 40;
}
.sb-brand { width: 40px; height: 40px; flex: none; cursor: pointer; }
.lumo-svg { width: 100%; height: 100%; overflow: visible; display: block; }
.lumo-blob { fill: url(#lumoGrad); }
.lumo-svg .eye { fill: #fff; }
.lumo-svg .spark { fill: var(--lime); }

.sb-nav {
  position: relative; flex: 1; min-height: 0; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 8px 0; overflow-y: auto; overflow-x: visible;
}
.sb-nav::-webkit-scrollbar { width: 0; }

.sb-item {
  position: relative; width: 46px; height: 46px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 15px; color: var(--slate-3);
  transition: color .18s ease, background .18s ease;
}
.sb-item .ic { width: 21px; height: 21px; position: relative; z-index: 2; }
.sb-item:hover { color: #fff; }
/* Fallback highlight when GSAP is unavailable; the pill takes over when it is. */
.sb-item.active { color: #fff; background: var(--purple); }
.sidebar.gsap-on .sb-item.active { background: none; }

/* The travelling pill that FLIPs between items. */
.sb-pill {
  position: absolute; inset: 0; border-radius: 15px;
  background: var(--purple); z-index: 1; pointer-events: none;
  box-shadow: 0 6px 18px rgba(109, 40, 217, .45);
}


/* Hover label. Lives outside the rail so it is never clipped. */
.sb-tip {
  position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%) scale(.9);
  background: var(--ink); color: #fff; font-size: 12.5px; font-weight: 600;
  padding: 7px 11px; border-radius: 9px; white-space: nowrap;
  opacity: 0; pointer-events: none; z-index: 60;
  box-shadow: 0 6px 20px rgba(16,24,39,.35);
  transition: opacity .16s ease, transform .16s cubic-bezier(.34,1.56,.64,1);
}
.sb-tip::before {
  content: ''; position: absolute; right: 100%; top: 50%; transform: translateY(-50%);
  border: 5px solid transparent; border-right-color: var(--ink);
}
.sb-item:hover .sb-tip, .sb-user:hover .sb-tip,
.sb-item:focus-visible .sb-tip, .sb-user:focus-visible .sb-tip {
  opacity: 1; transform: translateY(-50%) scale(1);
}

.sb-badge {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
  background: var(--pink); color: #fff; border: 2px solid #101827;
  font-size: 10px; font-weight: 700; line-height: 13px; text-align: center;
}

.sb-foot { width: 100%; display: flex; justify-content: center; padding-top: 8px; border-top: 1px solid rgba(255,255,255,.08); }
.sb-user { position: relative; width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.sb-user .lumo { width: 32px; height: 32px; border-radius: 50%; background: var(--grad-lilac); }
.sb-user .lumo .dot { display: none; }
.sb-user:hover { background: rgba(255,255,255,.08); }

/* ============ Banners ============ */
.announce-bar {
  height: 38px; flex: none; background: var(--sky-wash); color: var(--sky-ink);
  display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px;
}
.announce-bar a { font-weight: 600; text-decoration: underline; color: inherit; }

/* ============ Common ============ */
.page { padding: 28px 44px 44px; display: flex; flex-direction: column; gap: 24px; max-width: 1180px; margin: 0 auto; width: 100%; }
.page-title { font-size: 32px; font-weight: 700; letter-spacing: -.8px; }
.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-title { display: flex; align-items: center; gap: 9px; font-size: 20px; font-weight: 600; }
.section-title .ic { color: var(--slate-5); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; font-weight: 600; transition: background .12s ease, border-color .12s ease, transform .1s ease; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--purple); color: #fff; font-size: 14.5px; padding: 11px 20px; border-radius: 10px; box-shadow: 0 4px 14px rgba(109,40,217,.28); }
.btn-primary:hover { background: var(--purple-hover); }
.btn-primary:disabled { opacity: .5; cursor: default; box-shadow: none; }
.btn-outline { border: 1px solid var(--border); color: var(--slate-6); font-size: 12.5px; padding: 8px 14px; border-radius: 9px; background: #fff; }
.btn-outline:hover { border-color: var(--slate-4); }
.btn-soft { background: var(--bg-softer); color: var(--slate-7); font-size: 12.5px; padding: 7px 14px; border-radius: 8px; }
.btn-soft:hover { background: var(--border); }
.pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; font-weight: 600; }
.pill-purple { background: var(--purple-wash); color: var(--purple); font-size: 12.5px; padding: 7px 14px; }
.pill-slate { background: var(--bg-softer); color: var(--slate-7); font-size: 12.5px; padding: 7px 14px; }
.card { border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.muted { color: var(--slate-5); }
.tabnum { font-variant-numeric: tabular-nums; }

/* ============ Home ============ */
.topbar-row { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 9px; width: 250px; height: 38px; padding: 0 14px;
  border: 1px solid var(--border); border-radius: 999px; color: var(--slate-5); font-size: 13.5px;
}
.search input { border: none; outline: none; flex: 1; font-family: inherit; font-size: 13.5px; color: var(--ink); background: none; }
.iconbtn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; color: var(--slate-5); background: #fff; }
.iconbtn:hover { border-color: var(--slate-4); }
.statpills { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; height: 38px; }
.statpills .sp { display: flex; align-items: center; gap: 6px; padding: 0 14px; font-size: 13.5px; font-weight: 700; }
.statpills .div { width: 1px; height: 38px; background: var(--border); }

.greeting { font-size: 38px; font-weight: 700; letter-spacing: -1px; }
.greeting .brand { color: var(--purple); }
.cta-row { display: flex; align-items: center; gap: 20px; }
.textlink { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--slate-6); }
.textlink:hover { color: var(--ink); }

.promo-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.promo-card { display: flex; align-items: center; gap: 14px; border-radius: 14px; padding: 16px 18px; border: 1px solid var(--border); background: var(--bg-soft); }
.promo-card.tinted { background: var(--purple-wash); border-color: var(--purple-line); }
.promo-card .lumo { width: 34px; height: 34px; border-radius: 13px 13px 15px 15px; }
.promo-card .body { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.promo-card .t { font-size: 14.5px; font-weight: 700; }
.promo-card .d { font-size: 13px; color: var(--slate-5); }
.pillbtn { font-size: 12.5px; font-weight: 600; padding: 7px 15px; border-radius: 999px; }
.pillbtn.solid { background: var(--purple); color: #fff; }
.pillbtn.soft { background: var(--purple-line); color: var(--purple); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat-card {
  background: var(--bg-soft); border: 1px solid var(--border-soft); border-radius: 14px;
  padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 4px;
}
.stat-card .lbl { font-size: 13px; color: var(--slate-5); }
.stat-card .num { font-size: 34px; font-weight: 700; letter-spacing: -1px; }
.stat-card .btn-outline { align-self: flex-start; font-size: 12px; padding: 6px 12px; border-radius: 8px; }

.plan-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
.plan-list { display: flex; flex-direction: column; gap: 10px; }
.plan-sub { font-size: 13.5px; font-weight: 600; color: var(--slate-5); }
.task { border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 9px; }
.task .row1 { display: flex; align-items: center; gap: 10px; }
.task .chk { width: 24px; height: 24px; border: 1.8px solid var(--slate-3); border-radius: 6px; flex: none; }
.task .name { font-size: 15px; font-weight: 600; }
.tag { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; }
.tag-pro { color: #fff; background: var(--pink); }
.tag-overdue { color: #B45309; background: #FEF3C7; }
.task .row2 { display: flex; align-items: center; gap: 12px; }
.tag-subject { font-size: 11.5px; font-weight: 600; color: var(--purple); background: var(--purple-wash); padding: 5px 10px; border-radius: 7px; }
.task .time { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--slate-5); }
.task .spacer { flex: 1; }

.exam-card { border: 1px solid var(--border); border-radius: 14px; padding: 20px; display: flex; flex-direction: column; gap: 16px; background: #fff; }
.exam-card .t { font-size: 14.5px; font-weight: 600; color: var(--slate-7); }
.exam-nums { display: flex; align-items: baseline; gap: 14px; }
.exam-nums .grp { display: flex; align-items: baseline; gap: 4px; }
.exam-nums .n { font-size: 36px; font-weight: 700; letter-spacing: -1.2px; }
.exam-nums .u { font-size: 13px; color: var(--slate-5); }
.exam-card .hr { height: 1px; background: var(--border-soft); }
.exam-card .foot { display: flex; align-items: center; justify-content: space-between; }
.exam-card .date { font-size: 13px; color: var(--slate-5); }
.exam-card .switch { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; }

/* ============ Question Rush ============ */
.title-row { display: flex; align-items: center; gap: 12px; }
.title-row .ic { width: 26px; height: 26px; color: var(--slate-5); }
.info-card { border: 1px solid #BAE6FD; background: #F0F9FF; border-radius: 14px; padding: 20px 22px; display: flex; gap: 14px; }
.info-card .lumo { width: 32px; height: 32px; border-radius: 12px 12px 14px 14px; }
.info-card .t { font-size: 17px; font-weight: 700; }
.info-card .d { font-size: 13.5px; line-height: 1.6; color: var(--slate-6); max-width: 760px; text-wrap: pretty; margin-top: 7px; }

.hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hero-card { border-radius: 16px; padding: 22px 24px; display: flex; gap: 16px; min-height: 186px; position: relative; overflow: hidden; color: #fff; }
/* Gradient fills are not tied to one card type — .mode-sm uses them too. */
.grad-pink { background: var(--grad-pink); }
.grad-purple { background: var(--grad-purple); }
.grad-lilac { background: var(--grad-lilac); }
.hero-card .body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.hero-card .t { font-size: 20px; font-weight: 700; }
.hero-card .prog-row { display: flex; align-items: baseline; justify-content: space-between; color: #fff; font-size: 13px; }
.hero-card .prog-row b { font-weight: 700; }
.hero-track { height: 6px; border-radius: 999px; background: rgba(255,255,255,.32); }
.hero-fill { height: 6px; border-radius: 999px; background: #fff; }
.hero-card .grow { flex: 1; }
.hero-btn { align-self: flex-start; display: inline-flex; align-items: center; gap: 7px; background: #fff; font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 999px; }
.hero-btn.on-pink { color: var(--magenta-deep); }
.hero-btn.on-purple { color: var(--purple-deep); }
.hero-art {
  width: 132px; flex: none; border-radius: 14px; display: flex; align-items: center; justify-content: center;
}
.hero-art .lumo { width: 64px; height: 64px; border-radius: 26px 26px 30px 30px; background: rgba(255,255,255,.25); }
.hero-art .lumo::before, .hero-art .lumo::after { background: #fff; }
.hero-art .lumo .dot { background: var(--lime); }

.session-row { border: 1px solid var(--border); border-radius: 14px; padding: 16px 20px; display: flex; align-items: center; gap: 18px; }
.session-row .body { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.session-row .l1 { display: flex; align-items: baseline; gap: 10px; }
.session-row .cnt { font-size: 15.5px; font-weight: 700; }
.session-row .ago { font-size: 13px; color: var(--slate-5); }
.session-row .l2 { display: flex; align-items: center; gap: 20px; font-size: 12.5px; color: var(--slate-6); flex-wrap: wrap; }
.session-row .m { display: flex; align-items: center; gap: 6px; }

/* ============ Play hub ============ */
.play-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.play-head .sub { font-size: 13.5px; color: var(--slate-5); margin-top: 6px; }
.online-pill { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--border); border-radius: 999px; padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--slate-7); }
.dot-g { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.rank-pill { display: inline-flex; align-items: center; gap: 6px; background: var(--purple-wash); color: var(--purple); font-size: 12.5px; font-weight: 700; padding: 9px 15px; border-radius: 999px; }

.play-grid { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.play-col { display: flex; flex-direction: column; gap: 16px; }
.mode-tag { font-size: 10.5px; font-weight: 700; color: var(--purple-deep); background: #fff; padding: 3px 8px; border-radius: 6px; }
.mode-sub { font-size: 13.5px; line-height: 1.55; color: #fff; max-width: 420px; }
.mode-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #fff; }
.dot-lime { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.duel-modes { display: flex; gap: 6px; }
.duel-mode {
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 999px;
  background: rgba(16,24,39,.22); color: #fff;
}
.duel-mode.sel { background: #fff; color: var(--purple-deep); }
.mode-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.mode-sm { border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 8px; min-height: 172px; color: #fff; }

.ladder-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 16px; background: var(--bg-soft); }
.ladder-card .t { font-size: 14.5px; font-weight: 700; }
.ladder-card .d { font-size: 13px; color: var(--slate-5); }
.ladder-prog { width: 200px; display: flex; flex-direction: column; gap: 6px; }
.track { height: 6px; border-radius: 999px; background: var(--border); }
.track .fill { height: 6px; border-radius: 999px; background: var(--purple); }
.ladder-prog .lbl { font-size: 11.5px; color: var(--slate-5); text-align: right; }

.friends-card { border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.friends-card .head { display: flex; align-items: center; justify-content: space-between; }
.friends-card .t { font-size: 15px; font-weight: 700; }
.friend { display: flex; align-items: center; gap: 11px; }
.friend .ava { position: relative; flex: none; }
.friend .ava .circ { width: 32px; height: 32px; border-radius: 50%; background: var(--purple-line); }
.friend .ava .st { position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; }
.friend .body { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.friend .n { font-size: 13.5px; font-weight: 600; }
.friend .s { font-size: 11.5px; color: var(--slate-5); }
.friend-btn { font-size: 11.5px; font-weight: 700; padding: 6px 12px; border-radius: 999px; }
.friend-btn.solid { background: var(--purple); color: #fff; }
.friend-btn.soft { background: var(--bg-softer); color: var(--slate-7); }

.code-card { border: 1px solid var(--border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.code-card .t { font-size: 15px; font-weight: 700; }
.code-card .d { font-size: 12.5px; color: var(--slate-5); line-height: 1.5; }
.code-card input {
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px; font-family: inherit;
  font-size: 13px; font-weight: 700; letter-spacing: 3px; text-transform: uppercase; text-align: center; outline: none; width: 100%;
}
.code-card input:focus { border-color: var(--purple); }
.code-card .row { display: flex; gap: 8px; }
.code-card .row .btn { flex: 1; }

/* ============ Queue ============ */
.center-stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px; background: var(--lav-bg); min-height: 100%; padding: 40px; }
@keyframes lumoPulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
@keyframes lumoRing { 0% { transform: scale(.85); opacity: .55; } 100% { transform: scale(1.5); opacity: 0; } }
.queue-stage { position: relative; width: 180px; height: 180px; display: flex; align-items: center; justify-content: center; }
.queue-ring { position: absolute; width: 150px; height: 150px; border-radius: 50%; border: 2px solid #C4B5FD; animation: lumoRing 2.4s ease-out infinite; }
.queue-ring.r2 { animation-delay: 1.2s; }
.queue-stage .lumo {
  width: 96px; height: 96px; border-radius: 38px 38px 46px 46px;
  animation: lumoPulse 2s ease-in-out infinite; box-shadow: 0 14px 34px rgba(109,40,217,.35);
}
.stage-title { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.stage-sub { font-size: 14px; color: var(--slate-5); }
.chip-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stage-btns { display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.btn-lg-outline { border: 1px solid var(--border); color: var(--slate-6); font-size: 13.5px; font-weight: 600; padding: 11px 22px; border-radius: 10px; background: #fff; }
.btn-lg-outline:hover { border-color: var(--slate-4); }

/* ============ Lobby ============ */
.eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: 1px; color: var(--purple); }
.lobby-vs { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; justify-content: center; }
.player-card {
  width: 300px; border: 1px solid var(--border); border-radius: 16px; padding: 24px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; background: #fff;
}
.player-card .lumo { width: 64px; height: 64px; border-radius: 50%; }
.player-card .n { font-size: 17px; font-weight: 700; }
.player-card .s { font-size: 12.5px; color: var(--slate-5); }
.ready-pill { width: 100%; display: flex; align-items: center; justify-content: center; gap: 7px; font-size: 12.5px; font-weight: 700; padding: 9px; border-radius: 9px; }
.ready-pill.yes { background: var(--green-wash); color: var(--green-deep); }
.ready-pill.no { background: var(--bg-softer); color: var(--slate-5); }
.dot-a { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.vs-block { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs-block .vs { font-size: 22px; font-weight: 800; color: var(--slate-3); letter-spacing: 1px; }
.vs-block .in { font-size: 12px; color: var(--slate-5); }
.lobby-code-chip {
  font-size: 22px; font-weight: 800; letter-spacing: 8px; color: var(--ink);
  background: #fff; border: 1px dashed var(--slate-3); border-radius: 12px; padding: 12px 16px 12px 24px; user-select: all;
}
.btn-ready { background: var(--purple); color: #fff; font-size: 14.5px; font-weight: 700; padding: 13px 34px; border-radius: 11px; box-shadow: 0 6px 18px rgba(109,40,217,.3); }
.btn-ready:hover { background: var(--purple-hover); }
.btn-ready:disabled { opacity: .55; box-shadow: none; }

/* ============ Match ============ */
#v-match.active { display: flex; flex-direction: column; }
.match-head { padding: 20px 44px 18px; border-bottom: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 14px; flex: none; }
.match-head .r1 { display: flex; align-items: center; justify-content: space-between; }
.match-mode { font-size: 12px; font-weight: 700; color: var(--purple); background: var(--purple-wash); padding: 6px 12px; border-radius: 999px; letter-spacing: .5px; }
.match-progress { font-size: 13px; color: var(--slate-5); margin-left: 10px; }
.match-timer {
  display: flex; align-items: center; gap: 8px; background: var(--ink); color: #fff;
  padding: 8px 16px; border-radius: 999px; font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.match-timer.low { background: #B91C1C; }
.hth { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.hth.solo { grid-template-columns: 1fr; }
.hth-side { display: flex; flex-direction: column; gap: 7px; }
.hth-side .r { display: flex; align-items: center; gap: 9px; }
.hth-side .ava { width: 26px; height: 26px; border-radius: 50%; background: var(--grad-lilac); flex: none; }
.hth-side.them .ava { background: linear-gradient(150deg, #F9A8D4, #C026D3); }
.hth-side .n { font-size: 13.5px; font-weight: 700; }
.hth-side .grow { flex: 1; }
.hth-side .pts { font-size: 13.5px; font-weight: 700; color: var(--purple); }
.hth-side.them .pts { color: var(--magenta); }
.hth-track { height: 8px; border-radius: 999px; background: var(--bg-softer); }
.hth-fill { height: 8px; border-radius: 999px; background: var(--purple); transition: width .4s cubic-bezier(.16,1,.3,1); }
.hth-side.them .hth-fill { background: var(--magenta); }

.match-body { flex: 1; padding: 30px 44px; display: flex; gap: 26px; overflow: hidden; min-height: 0; }
.q-col { flex: 1; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; min-width: 0; padding-bottom: 10px; }
.q-card { border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 12px; background: var(--lav-bg); }
.q-kicker { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; color: var(--slate-5); text-transform: uppercase; }
.q-passage { font-size: 14.5px; line-height: 1.65; color: var(--slate-7); white-space: pre-wrap; border-bottom: 1px solid var(--border); padding-bottom: 14px; }
.q-text { font-size: 19px; line-height: 1.55; font-weight: 500; text-wrap: pretty; }
.choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice-grid.stack { grid-template-columns: 1fr; }
.mchoice {
  display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--border); background: #fff;
  border-radius: 12px; padding: 15px 18px; text-align: left; font-family: inherit;
  transition: border-color .12s ease, background .12s ease;
}
.mchoice:hover:not(:disabled) { border-color: var(--purple-lt); }
.mchoice .key {
  width: 26px; height: 26px; flex: none; border-radius: 8px; background: var(--bg-softer); color: var(--slate-5);
  font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.mchoice .val { font-size: 16px; font-weight: 600; line-height: 1.45; }
.mchoice.sel { border-color: var(--purple); background: var(--purple-wash); }
.mchoice.sel .key { background: var(--purple); color: #fff; }
.mchoice.correct { border-color: var(--green-deep); background: #F0FDF4; }
.mchoice.correct .key { background: var(--green-deep); color: #fff; }
.mchoice.wrong { border-color: #B91C1C; background: #FEF2F2; }
.mchoice.wrong .key { background: #B91C1C; color: #fff; }
.mchoice:disabled { cursor: default; }
.match-actions { display: flex; align-items: center; gap: 14px; }
.reveal-card { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 10px; background: #fff; }
.reveal-card .t { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.reveal-card .t.good { color: var(--green-deep); }
.reveal-card .t.bad { color: #B91C1C; }
.reveal-card .ex { font-size: 13.5px; line-height: 1.6; color: var(--slate-7); }
.reveal-card .counts { display: flex; gap: 8px; flex-wrap: wrap; }
.count-pill { border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 600; color: var(--slate-6); background: #fff; }
.count-pill.correct { border-color: var(--green-deep); background: #F0FDF4; color: var(--green-deep); }
.auto-note { font-size: 12.5px; color: var(--slate-5); }

.side-col { width: 280px; flex: none; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.side-card { border: 1px solid var(--border); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 11px; }
.side-card .t { font-size: 13.5px; font-weight: 700; }
.qtrack { display: flex; gap: 6px; }
.qtrack .q {
  flex: 1; height: 26px; border-radius: 7px; background: var(--bg-softer); color: var(--slate-5);
  display: flex; align-items: center; justify-content: center; font-size: 10.5px; font-weight: 700;
}
.qtrack .q.me { background: var(--purple); color: #fff; }
.qtrack .q.them { background: var(--magenta); color: #fff; }
.qtrack .q.now { background: var(--purple-line); color: var(--purple); }
.legend { display: flex; align-items: center; gap: 14px; font-size: 11.5px; color: var(--slate-5); }
.legend .sw { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: 0; }
.side-card.soft { background: var(--bg-soft); }
.side-card .d { font-size: 12.5px; line-height: 1.5; color: var(--slate-5); }
.track-lime .fill { background: var(--lime); }
.tip-card { border: 1px solid var(--purple-line); background: var(--purple-wash); border-radius: 14px; padding: 16px; display: flex; gap: 12px; align-items: center; }
.tip-card .lumo { width: 34px; height: 34px; border-radius: 13px 13px 15px 15px; }
.tip-card .d { font-size: 12.5px; line-height: 1.5; color: var(--purple-deep); }

/* ============ Results ============ */
.result-hero { font-size: 26px; font-weight: 700; letter-spacing: -.5px; }
.result-sub { font-size: 14px; color: var(--slate-5); }
.result-grid { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 560px; }
.result-row {
  display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 18px; background: #fff; font-weight: 600; font-size: 14.5px;
}
.result-row.me { border-color: var(--purple); background: var(--purple-wash); }
.result-row .rank { width: 28px; color: var(--slate-5); font-weight: 700; }
.result-row .grow { flex: 1; text-align: left; }
.result-row .detail { font-size: 12.5px; color: var(--slate-5); font-weight: 500; }
.result-row .sc { font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-list { display: flex; flex-direction: column; gap: 7px; width: 100%; max-width: 560px; }
.bd-row { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.bd-row .lbl { width: 220px; text-align: right; color: var(--slate-5); }
.bd-row .track { flex: 1; }
.bd-row .val { width: 46px; text-align: left; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ============ Question Bank ============ */
.bank-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.field-inline { font-size: 13px; font-weight: 600; color: var(--slate-5); }
.bank-controls .seg-btn { padding: 7px 14px; font-size: .88rem; }
.bank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bank-card {
  border: 1px solid var(--border); border-radius: 14px; padding: 18px;
  display: flex; flex-direction: column; gap: 10px; background: #fff;
  transition: border-color .15s ease;
}
.bank-card:hover { border-color: var(--purple-line); }
.bank-card .top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.bank-card .name { font-size: 15px; font-weight: 700; }
.bank-card .count { font-size: 12.5px; color: var(--slate-5); font-variant-numeric: tabular-nums; white-space: nowrap; }
.diff-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.diff-chip {
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
  background: var(--bg-softer); color: var(--slate-6);
}
.diff-chip.e { background: #F0FDF4; color: var(--green-deep); }
.diff-chip.m { background: var(--purple-wash); color: var(--purple); }
.diff-chip.h { background: #FEF2F2; color: #B91C1C; }
.bank-card .skills { font-size: 12px; color: var(--slate-5); line-height: 1.55; }
.bank-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.mastery { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--slate-5); }
.mastery .track { width: 74px; height: 5px; }

/* ============ Mistakes ============ */
.mistake {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px; background: #fff;
}
.mistake .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mistake .kicker { font-size: 11px; font-weight: 700; letter-spacing: .6px; color: var(--slate-5); text-transform: uppercase; }
.mistake .qt { font-size: 14.5px; line-height: 1.55; font-weight: 500; }
.mistake .answers { display: flex; gap: 8px; flex-wrap: wrap; }
.ans-chip { font-size: 11.5px; font-weight: 600; padding: 5px 11px; border-radius: 999px; }
.ans-chip.mine { background: #FEF2F2; color: #B91C1C; }
.ans-chip.right { background: #F0FDF4; color: var(--green-deep); }
.mistake .why { font-size: 13px; line-height: 1.6; color: var(--slate-6); border-left: 2px solid var(--purple-line); padding-left: 12px; }
.mistake .acts { display: flex; gap: 8px; }
.empty-note {
  border: 1px dashed var(--border-strong); border-radius: 14px; padding: 28px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center;
}
.empty-note .lumo { width: 46px; height: 46px; border-radius: 18px 18px 22px 22px; }
.empty-note .t { font-size: 15px; font-weight: 700; }
.empty-note .d { font-size: 13px; color: var(--slate-5); max-width: 360px; line-height: 1.55; }

/* ============ Vocab ============ */
.vocab-wrap { display: flex; flex-direction: column; gap: 16px; align-items: center; max-width: 620px; width: 100%; }
.vocab-card {
  width: 100%; min-height: 230px; border-radius: 18px; padding: 34px 30px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: var(--grad-purple); color: #fff; text-align: center;
  box-shadow: 0 10px 30px rgba(109,40,217,.22);
  transition: transform .18s cubic-bezier(.16,1,.3,1);
}
.vocab-card:hover { transform: translateY(-2px); }
.vocab-card.flipped { background: #fff; color: var(--ink); border: 1px solid var(--border); box-shadow: var(--shadow); }
.vocab-front, .vocab-back { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.vc-word { font-size: 34px; font-weight: 700; letter-spacing: -.8px; }
.vc-pos { font-size: 13px; font-style: italic; }
.vc-hint { font-size: 12px; margin-top: 8px; }
.vc-def { font-size: 19px; font-weight: 500; line-height: 1.5; }
.vc-ex { font-size: 14px; color: var(--slate-5); line-height: 1.6; font-style: italic; max-width: 460px; }
.vocab-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: center; }

/* ============ Coming soon / empty state ============ */
.soon .lumo { width: 72px; height: 72px; border-radius: 28px 28px 34px 34px; }
.soon .t { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.soon .d { font-size: 13.5px; color: var(--slate-5); max-width: 380px; text-align: center; line-height: 1.6; }

/* ============ Modal & toast ============ */
.overlay { position: fixed; inset: 0; background: rgba(16,24,39,.45); display: flex; align-items: center; justify-content: center; z-index: 60; }
.modal { background: #fff; border-radius: 16px; padding: 28px; width: 360px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 60px rgba(16,24,39,.3); }
.modal .lumo { width: 44px; height: 44px; border-radius: 17px 17px 20px 20px; }
.modal .t { font-size: 18px; font-weight: 700; }
.modal .d { font-size: 13px; color: var(--slate-5); line-height: 1.5; }
.modal input {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px;
  font-family: inherit; font-size: 14px; outline: none;
}
.modal input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-wash); }
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-weight: 600; font-size: 13px; box-shadow: 0 6px 20px rgba(16,24,39,.25); z-index: 70;
}

/* ============ Question tools (highlight + calculator) ============ */
.tool-row { display: flex; gap: 8px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); background: #fff; color: var(--slate-6);
  border-radius: 8px; padding: 6px 11px; font-size: 12.5px; font-weight: 600;
  font-family: inherit; transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.tool-btn:hover { border-color: var(--slate-4); color: var(--ink); }
.tool-btn.on { border-color: var(--purple); color: var(--purple); background: var(--purple-wash); }

.q-passage mark, .q-text mark {
  background: #FEF08A; color: inherit; padding: 1px 0; border-radius: 2px;
}
.q-passage.marking, .q-text.marking { cursor: text; background: linear-gradient(transparent, transparent); }

.calc-panel {
  position: fixed; right: 20px; bottom: 20px; width: 500px; z-index: 60;
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  box-shadow: 0 16px 44px rgba(16,24,39,.18); padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.desmos-mount {
  width: 100%; height: 460px; border-radius: 9px; overflow: hidden;
  display: none; border: 1px solid var(--border-soft);
}
.desmos-mount.ready { display: block; }
.calc-note { font-size: 12px; color: var(--slate-5); }
.calc-note.hidden { display: none; }
#calc-fallback { display: flex; flex-direction: column; gap: 10px; }
#calc-fallback.hidden { display: none; }
.calc-head { display: flex; align-items: center; justify-content: space-between; }
.calc-title { font-size: 13.5px; font-weight: 700; }
.calc-x { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; font-size: 20px; line-height: 1; color: var(--slate-5); }
.calc-x:hover { color: var(--ink); }
#calc-input {
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 10px 12px;
  font-family: ui-monospace, Menlo, monospace; font-size: 14px; outline: none; width: 100%;
}
#calc-input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px var(--purple-wash); }
.calc-out {
  font-family: ui-monospace, Menlo, monospace; font-size: 13px; color: var(--slate-5);
  min-height: 19px; word-break: break-all;
}
.calc-out.val { color: var(--purple); font-weight: 700; font-size: 15px; }
.calc-out.err { color: #B91C1C; }
#calc-graph { width: 100%; height: 200px; border: 1px solid var(--border-soft); border-radius: 9px; background: #fff; }
.calc-zoom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.calc-range { font-size: 11.5px; color: var(--slate-5); font-variant-numeric: tabular-nums; }

/* ============ Shared bits for the newer screens ============ */
.back-link {
  display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
  font-size: 12.5px; font-weight: 600; color: var(--slate-5); padding: 6px 0;
}
.back-link:hover { color: var(--purple); }
.linkbtn { font-size: 12.5px; font-weight: 600; color: var(--slate-5); align-self: flex-start; padding: 6px 0; }
.linkbtn:hover { color: var(--purple); }
.linkbtn.danger:hover { color: #DC2626; }
.empty-note.small { padding: 18px; font-size: 12.5px; color: var(--slate-5); line-height: 1.55; display: block; text-align: left; }
.you-tag { font-size: 10px; font-weight: 700; color: var(--purple); background: var(--purple-wash); padding: 2px 6px; border-radius: 5px; vertical-align: middle; }
.pill-lime { background: #F7FEE7; color: #4D7C0F; font-size: 12.5px; padding: 7px 14px; }
.btn-done { background: var(--green-wash); color: var(--green-deep); font-size: 14.5px; padding: 11px 20px; border-radius: 10px; }
.grow { flex: 1; }

/* ============ Masterclass ============ */
.mc-progress { display: flex; align-items: center; gap: 12px; }
/* Registering --pct as an angle lets the ring animate instead of jumping. */
@property --pct { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.mc-ring {
  --pct: 0deg;
  position: relative;
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: conic-gradient(var(--purple) var(--pct), var(--purple-line) 0);
  transition: --pct .5s ease;
}
.mc-ring-num { width: 42px; height: 42px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--purple); font-variant-numeric: tabular-nums; }
.mc-prog-lbl { font-size: 12.5px; color: var(--slate-5); font-weight: 600; }
.mc-groups { display: flex; flex-direction: column; gap: 26px; }
.mc-loading { font-size: 13px; color: var(--slate-5); }
.mc-group { display: flex; flex-direction: column; gap: 12px; }
.mc-group-head { display: flex; align-items: baseline; justify-content: space-between; }
.mc-domain { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.mc-group-count { font-size: 12px; font-weight: 700; color: var(--slate-5); font-variant-numeric: tabular-nums; }
.mc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(288px, 1fr)); gap: 14px; }
.mc-card {
  text-align: left; border: 1px solid var(--border); border-radius: 15px; padding: 17px;
  display: flex; flex-direction: column; gap: 9px; background: #fff;
  transition: border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}
.mc-card:hover { border-color: var(--purple-lt); box-shadow: 0 8px 22px rgba(109,40,217,.10); transform: translateY(-2px); }
.mc-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.mc-skill { font-size: 10.5px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--purple); }
.mc-check {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 1.5px solid var(--border); display: grid; place-items: center; color: transparent;
}
.mc-card.done .mc-check { background: var(--green); border-color: var(--green); color: #fff; }
.mc-card-title { font-size: 15px; font-weight: 700; line-height: 1.35; letter-spacing: -.2px; }
.mc-card-sum { font-size: 12.5px; color: var(--slate-5); line-height: 1.55; }
.mc-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 3px; }
.mc-mins { font-size: 11.5px; color: var(--slate-5); font-weight: 600; }
.mc-go { font-size: 12px; font-weight: 700; color: var(--purple); }

/* ============ Lesson reader ============ */
.lesson-page { max-width: 760px; gap: 18px; }
.lesson-head { display: flex; flex-direction: column; gap: 9px; }
.lesson-kicker { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--purple); }
.lesson-title { font-size: 29px; font-weight: 700; letter-spacing: -.7px; line-height: 1.2; }
.lesson-summary { font-size: 15px; color: var(--slate-6); line-height: 1.6; }
.lesson-body { display: flex; flex-direction: column; gap: 16px; }
.lb { border-radius: 14px; padding: 19px 20px; display: flex; flex-direction: column; gap: 10px; }
.lb p { font-size: 14.5px; line-height: 1.68; color: var(--slate-7); }
.lb-h { font-size: 12px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--slate-5); }
.lb-concept { border: 1px solid var(--border); background: #fff; }
.lb-steps, .lb-desmos { background: var(--bg-soft); border: 1px solid var(--border-soft); }
.lb-desmos { background: var(--purple-wash); border-color: var(--purple-line); }
.lb-list { display: flex; flex-direction: column; gap: 9px; padding-left: 20px; }
.lb-list li { font-size: 14.5px; line-height: 1.6; color: var(--slate-7); }
.lb-list li::marker { color: var(--purple); font-weight: 700; }
.lb-calc { align-self: flex-start; margin-top: 4px; }
.lb-tag { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; align-self: flex-start; padding: 3px 8px; border-radius: 6px; }
.lb-tip { background: var(--green-wash); }
.lb-tip .lb-tag { background: var(--green-wash); color: var(--green-deep); }
.lb-trap { background: #FEF3C7; }
.lb-trap .lb-tag { background: #FEF3C7; color: #92400E; }
.lb-example { border: 1.5px solid var(--purple-line); background: #fff; }
.lb-passage {
  font-size: 14px; line-height: 1.7; color: var(--slate-7); background: var(--bg-soft);
  border-left: 3px solid var(--purple-line); border-radius: 0 10px 10px 0; padding: 14px 16px;
}
.lb-q { font-size: 15px !important; font-weight: 600; color: var(--ink) !important; }
.lb-choices { display: flex; flex-direction: column; gap: 8px; }
.lb-choice {
  display: flex; align-items: flex-start; gap: 11px; text-align: left; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 11px; background: #fff;
  transition: border-color .12s ease, background .12s ease;
}
.lb-choice:not(:disabled):hover { border-color: var(--purple-lt); background: var(--purple-wash); }
.lb-choice .ltr {
  width: 22px; height: 22px; flex: none; border-radius: 6px; background: var(--bg-softer);
  display: grid; place-items: center; font-size: 11.5px; font-weight: 700; color: var(--slate-6);
}
.lb-choice .txt { font-size: 14px; line-height: 1.5; color: var(--slate-7); }
.lb-choice.correct { border-color: var(--green); background: var(--green-wash); }
.lb-choice.correct .ltr { background: var(--green); color: #fff; }
.lb-choice.wrong { border-color: #FCA5A5; background: #FEF2F2; }
.lb-choice.wrong .ltr { background: #EF4444; color: #fff; }
.lb-choice:disabled { cursor: default; }
.lb-walk { display: flex; flex-direction: column; gap: 7px; padding: 14px 16px; background: var(--bg-soft); border-radius: 11px; }
.lb-walk-h { font-size: 12.5px; font-weight: 700; color: var(--purple); }
.lesson-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--border-soft); margin-top: 4px; padding-top: 18px; }

/* ============ Ask Lumo ============ */
.coach-page { max-width: 820px; }
.coach-thread { display: flex; flex-direction: column; gap: 14px; min-height: 220px; }
.coach-msg { display: flex; gap: 11px; }
.coach-msg.you { justify-content: flex-end; }
.coach-msg.you .bubble {
  background: var(--purple); color: #fff; font-size: 14px; line-height: 1.5;
  padding: 11px 16px; border-radius: 14px 14px 4px 14px; max-width: 78%;
}
.coach-msg.lumo-msg .lumo.round { flex: none; width: 30px; height: 30px; }
.coach-card {
  flex: 1; border: 1px solid var(--border); border-radius: 4px 14px 14px 14px;
  padding: 16px 18px; display: flex; flex-direction: column; gap: 9px; background: #fff;
}
.coach-card .ck { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; color: var(--purple); }
.coach-card .t { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.coach-card p { font-size: 14px; line-height: 1.65; color: var(--slate-7); }
.coach-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.coach-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.coach-chip {
  font-size: 12.5px; font-weight: 600; color: var(--slate-6); background: var(--bg-softer);
  padding: 8px 14px; border-radius: 999px;
}
.coach-chip:hover { background: var(--purple-wash); color: var(--purple); }
.coach-bar { display: flex; gap: 10px; }
.coach-bar input {
  flex: 1; border: 1px solid var(--border); border-radius: 11px; padding: 12px 16px;
  font-family: inherit; font-size: 14px; outline: none;
}
.coach-bar input:focus { border-color: var(--purple); }

/* ============ My Classes ============ */
.class-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.class-card {
  text-align: left; border: 1px solid var(--border); border-radius: 15px; padding: 17px;
  display: flex; flex-direction: column; gap: 8px; background: #fff;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.class-card:hover { border-color: var(--purple-lt); box-shadow: 0 8px 22px rgba(109,40,217,.10); }
.cc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.cc-name { font-size: 15.5px; font-weight: 700; letter-spacing: -.2px; }
.cc-role { font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: var(--bg-softer); color: var(--slate-6); }
.cc-role.teacher { background: var(--purple-wash); color: var(--purple); }
.cc-meta { font-size: 12.5px; color: var(--slate-5); }
.cc-foot { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.cc-code { font-size: 12px; font-weight: 700; letter-spacing: 2px; color: var(--slate-5); }
.cc-badge { font-size: 10.5px; font-weight: 700; color: var(--green-deep); background: var(--green-wash); padding: 3px 8px; border-radius: 6px; }
.class-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 20px; }
#class-detail { display: flex; flex-direction: column; gap: 18px; }
.class-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.class-head-main { display: flex; flex-direction: column; gap: 4px; }
.class-name { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.class-meta { font-size: 13px; color: var(--slate-5); }
.class-code-chip {
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border);
  border-radius: 12px; padding: 10px 14px; background: var(--bg-soft);
}
.class-code-chip .lbl { font-size: 11px; font-weight: 600; color: var(--slate-5); text-transform: uppercase; letter-spacing: .5px; }
.class-code-chip .code { font-size: 18px; font-weight: 700; letter-spacing: 4px; color: var(--purple); }
.assign-card {
  border: 1px solid var(--purple-line); background: var(--purple-wash); border-radius: 14px;
  padding: 18px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.assign-main { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 200px; }
.assign-card .t { font-size: 15px; font-weight: 700; }
.assign-card .d { font-size: 13px; color: var(--slate-6); }
.teacher-tools { border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.tt-title { font-size: 14px; font-weight: 700; }
.tt-row { display: flex; gap: 9px; flex-wrap: wrap; }
.tt-row input, .tt-row select {
  border: 1px solid var(--border); border-radius: 9px; padding: 9px 12px;
  font-family: inherit; font-size: 13px; outline: none; background: #fff; color: var(--slate-7);
}
.tt-row input { flex: 1; min-width: 180px; }
.tt-row input:focus, .tt-row select:focus { border-color: var(--purple); }
.roster-card { border: 1px solid var(--border); border-radius: 15px; overflow: hidden; }
.roster-head { display: flex; align-items: baseline; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border-soft); }
.roster-head .t { font-size: 15px; font-weight: 700; }
.roster-head .d { font-size: 12.5px; color: var(--slate-5); }
.roster-table { display: flex; flex-direction: column; }
.roster-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 10px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--border-soft); }
.roster-row:last-child { border-bottom: none; }
.roster-row.head { background: var(--bg-soft); }
.roster-row.head span { font-size: 11px; font-weight: 700; letter-spacing: .4px; text-transform: uppercase; color: var(--slate-5); }
.roster-row.me { background: var(--purple-wash); }
.roster-row .rn { font-size: 13.5px; font-weight: 600; }
.roster-row .rv { font-size: 13px; color: var(--slate-6); }
.tick { font-size: 11.5px; font-weight: 700; color: var(--slate-5); }
.tick.done { color: var(--green-deep); }
.roster-card .empty-note { border: none; padding: 24px; }

/* ============ Apply as a tutor ============ */
.elig-card { border: 1px solid var(--border); border-radius: 15px; padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.elig-card .t { font-size: 15px; font-weight: 700; }
.elig-list { display: flex; flex-direction: column; gap: 9px; }
.elig { display: flex; align-items: center; gap: 11px; }
.elig .dot { width: 20px; height: 20px; flex: none; border-radius: 50%; border: 1.5px solid var(--border); display: grid; place-items: center; color: transparent; }
.elig.ok .dot { background: var(--green); border-color: var(--green); color: #fff; }
.elig .lbl { flex: 1; font-size: 13.5px; color: var(--slate-7); }
.elig .val { font-size: 12.5px; font-weight: 700; color: var(--slate-5); }
.elig.ok .val { color: var(--green-deep); }
.elig-note { font-size: 12.5px; color: var(--slate-5); line-height: 1.55; }
.tutor-form { display: flex; flex-direction: column; gap: 18px; margin-top: 20px; }
.tf-row { display: flex; gap: 14px; flex-wrap: wrap; }
.tf { flex: 1; min-width: 190px; display: flex; flex-direction: column; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--slate-6); position: relative; }
.tf input, .tf select, .tf textarea {
  border: 1px solid var(--border); border-radius: 10px; padding: 11px 13px;
  font-family: inherit; font-size: 14px; font-weight: 400; color: var(--ink); outline: none; background: #fff; width: 100%;
}
.tf textarea { resize: vertical; line-height: 1.6; }
.tf input:focus, .tf select:focus, .tf textarea:focus { border-color: var(--purple); }
.tf-count { font-size: 11.5px; color: var(--slate-5); align-self: flex-end; font-weight: 600; }
.tf-subjects { display: flex; flex-direction: column; gap: 10px; border: none; }
.tf-subjects legend { font-size: 12.5px; font-weight: 600; color: var(--slate-6); margin-bottom: 10px; }
.chipset { display: flex; flex-wrap: wrap; gap: 9px; }
.chip-check { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 999px; padding: 9px 15px; cursor: pointer; font-size: 13px; color: var(--slate-7); }
.chip-check input { accent-color: var(--purple); }
.chip-check:has(input:checked) { border-color: var(--purple); background: var(--purple-wash); color: var(--purple); font-weight: 600; }
.tf-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tf-error { font-size: 13px; color: #DC2626; font-weight: 600; }
.status-card { border: 1px solid var(--border); border-radius: 16px; padding: 24px; display: flex; flex-direction: column; gap: 11px; align-items: flex-start; }
.status-badge { font-size: 10.5px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; background: var(--amber); color: #fff; padding: 4px 10px; border-radius: 6px; }
.status-card .t { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }
.status-card .d { font-size: 13.5px; color: var(--slate-5); line-height: 1.6; max-width: 560px; }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; width: 100%; margin-top: 8px; }
.ts-cell { display: flex; flex-direction: column; gap: 3px; background: var(--bg-soft); border-radius: 10px; padding: 11px 13px; }
.ts-cell .k { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--slate-5); }
.ts-cell .v { font-size: 13.5px; color: var(--slate-7); word-break: break-word; }

/* ============ Friends, invites, teams ============ */
.mycode { display: flex; align-items: center; gap: 7px; border-radius: 8px; padding: 6px 10px; min-height: 32px; background: var(--bg-softer); }
.mycode:hover { background: var(--purple-wash); }
.mycode .lbl { font-size: 10.5px; font-weight: 600; color: var(--slate-5); text-transform: uppercase; letter-spacing: .4px; }
.mycode .code { font-size: 12.5px; font-weight: 700; letter-spacing: 1.5px; color: var(--purple); }
.friend-add { display: flex; gap: 8px; }
.friend-add input {
  flex: 1; min-width: 0; border: 1px solid var(--border); border-radius: 9px; padding: 8px 11px;
  font-family: inherit; font-size: 12.5px; font-weight: 700; letter-spacing: 2px;
  text-transform: uppercase; text-align: center; outline: none;
}
.friend-add input:focus { border-color: var(--purple); }
.friend-btn:disabled { opacity: .55; cursor: default; }
.friend-x { font-size: 17px; line-height: 1; color: var(--slate-3); padding: 2px 4px; border-radius: 5px; }
.friend-x:hover { color: #DC2626; background: #FEF2F2; }
.invite-pop {
  position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid var(--purple-line); border-radius: 15px; padding: 14px 16px;
  box-shadow: 0 16px 40px rgba(16,24,39,.16); max-width: 380px;
  animation: invitePop .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes invitePop { from { opacity: 0; transform: translateY(14px) scale(.96); } }
.invite-pop .body { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.invite-pop .t { font-size: 14px; font-weight: 700; }
.invite-pop .d { font-size: 12px; color: var(--slate-5); line-height: 1.45; }
.invite-pop .btn-primary { font-size: 13px; padding: 9px 16px; }
.invite-x { font-size: 19px; line-height: 1; color: var(--slate-3); padding: 0 2px; align-self: flex-start; }
.invite-x:hover { color: var(--slate-6); }
.team-block { display: flex; flex-direction: column; gap: 10px; }
.team-tag { font-size: 11px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--slate-5); text-align: center; }
.player-card.compact { padding: 14px 16px; gap: 4px; }
.player-card.compact.me { border-color: var(--purple-lt); }

/* ============ View entrance ============ */
/* Resting state is visible. The animation only ever plays *towards* that, and
   uses no fill mode, so a throttled or interrupted run can never leave content
   hidden. Depth of the rise stands in for a stagger delay. */
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes railIn { from { opacity: 0; transform: translateY(8px); } }
.view.animate-in > .page > *,
.view.animate-in > .center-stage > * { animation: viewIn .34s cubic-bezier(.2,.72,.3,1); }
.view.animate-in > .page > *:nth-child(n+3),
.view.animate-in > .center-stage > *:nth-child(n+3) { animation-duration: .42s; }
.view.animate-in > .page > *:nth-child(n+5),
.view.animate-in > .center-stage > *:nth-child(n+5) { animation-duration: .5s; }
.sidebar.rail-in .sb-item { animation: railIn .38s cubic-bezier(.2,.72,.3,1); }

@media (prefers-reduced-motion: reduce) {
  .view.animate-in > .page > *,
  .view.animate-in > .center-stage > *,
  .sidebar.rail-in .sb-item { animation: none; }
}

/* ============ Responsive ============ */
@media (max-width: 1080px) {
  .sidebar { width: 200px; }
  .page { padding: 20px 24px 36px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .plan-grid, .play-grid { grid-template-columns: 1fr; }
  .match-body { flex-direction: column; overflow-y: auto; }
  .q-col { overflow: visible; }
  .side-col { width: 100%; }
}

/* Narrow screens: the nav moves to a minimal top bar instead of a full-height
   sidebar — brand on the left, avatar on the right, one scrollable row of
   labels underneath. No group headings, no badges competing for space. */
@media (max-width: 900px) {
  .shell { flex-direction: column; height: auto; min-height: 100vh; }
  .sidebar {
    width: 100%; flex: none; flex-direction: column; position: sticky; top: 0; z-index: 40;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .sidebar { padding: 8px 0 6px; gap: 0; align-items: stretch; }
  .sb-brand { width: 30px; height: 30px; position: absolute; top: 12px; left: 12px; }
  .sb-nav {
    flex: none; flex-direction: row; gap: 4px; padding: 0 56px 4px;
    justify-content: flex-start; overflow-x: auto; overflow-y: hidden; scrollbar-width: none;
  }
  .sb-nav::-webkit-scrollbar { display: none; }
  .sb-item { width: 42px; height: 42px; border-radius: 13px; }
  .sb-item .ic { width: 19px; height: 19px; }
  /* label drops below the icon so it cannot run off the screen edge */
  .sb-tip { left: 50%; top: calc(100% + 8px); transform: translate(-50%, 0) scale(.9); }
  .sb-item:hover .sb-tip, .sb-user:hover .sb-tip,
  .sb-item:focus-visible .sb-tip, .sb-user:focus-visible .sb-tip { transform: translate(-50%, 0) scale(1); }
  .sb-tip::before { right: auto; left: 50%; top: auto; bottom: 100%; transform: translateX(-50%);
    border-right-color: transparent; border-bottom-color: var(--ink); }
  .sb-badge { min-width: 15px; height: 15px; font-size: 9px; line-height: 11px; top: 3px; right: 3px; }
  .sb-foot { position: absolute; top: 10px; right: 12px; width: auto; padding: 0; border-top: none; }
  .sb-user { width: 32px; height: 32px; }
  .sb-user .lumo { width: 28px; height: 28px; }
  .main { overflow: visible; }
  .view { overflow: visible; }

  /* one banner is enough on a small screen */
  .announce-bar { display: none !important; }
  /* the two icon buttons duplicate nav items; the nav row already covers them */
  .topbar-row .iconbtn { display: none; }
  .topbar-row { flex-wrap: wrap; gap: 8px; }
  .search { flex: 1; min-width: 160px; width: auto; }
  .page { padding: 18px 16px 40px; }
  .hero-grid, .mode-grid, .promo-cards, .bank-grid { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .hth { grid-template-columns: 1fr; gap: 10px; }
  .greeting { font-size: 26px; }
  .page-title { font-size: 24px; }
  .match-head, .match-body { padding-left: 16px; padding-right: 16px; }
  .match-body { padding-top: 18px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .lobby-vs { flex-direction: column; }
  .player-card { width: 100%; max-width: 320px; }
  .calc-panel { right: 10px; left: 10px; bottom: 10px; width: auto; padding: 12px; }
  .desmos-mount { height: 60vh; }
}
@media (max-width: 560px) {
  .stat-grid, .stat-grid[style] { grid-template-columns: 1fr !important; }
  .bd-row .lbl { width: 120px; font-size: 11.5px; }
  .search { width: 100%; }
  .topbar-row { flex-wrap: wrap; }
}

/* ============ Narrow screens: never let content widen a column ============
   A 1fr track is minmax(auto, 1fr), so its minimum is the widest unbreakable
   thing inside it. On a phone that pushed every Play card 25px past the screen,
   where .shell's overflow clipped it off. minmax(0, 1fr) caps the track at the
   container instead. */
@media (max-width: 1080px) {
  .plan-grid, .play-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .hero-grid, .mode-grid, .promo-cards, .bank-grid, .choice-grid { grid-template-columns: minmax(0, 1fr); }
}
/* The mascot art is decoration; on a phone its 132px belongs to the text. */
@media (max-width: 560px) {
  .hero-art { display: none; }
}
/* Subject chips are pills: wrapping their label turned them into circles. */
.duel-modes { flex-wrap: wrap; }
.duel-mode { white-space: nowrap; }
/* The ladder's fixed 200px bar left its title two words wide on a phone. */
@media (max-width: 560px) {
  .ladder-card { flex-wrap: wrap; }
  .ladder-prog { width: 100%; }
}
/* Match header pill: a long domain wrapped it into a two-line blob on phones.
   One line with an ellipsis; the question kicker below spells the domain out. */
.match-mode { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.match-head .r1 > span:first-child { min-width: 0; }
