/* ==========================================================================
   MakeGPT Academy — design system
   ========================================================================== */
:root {
  --font: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --bg: #f4f5f9;
  --surface: #ffffff;
  --surface-2: #f8f9fc;
  --surface-3: #f1f3f8;
  --ink: #0b1220;
  --ink-2: #2b3445;
  --muted: #667085;
  --faint: #98a2b3;
  --line: #e6e8f0;
  --line-2: #d6dae5;

  --brand: #4f46e5;
  --brand-600: #4338ca;
  --brand-700: #3730a3;
  --brand-50: #eef0ff;
  --brand-100: #e0e3ff;
  --accent: #0ea5e9;

  --success: #059669;
  --success-50: #e9faf3;
  --success-100: #c9f2e0;
  --warn: #c2700a;
  --warn-50: #fff8eb;
  --warn-100: #fdebc8;
  --danger: #dc2626;
  --danger-50: #fef1f1;
  --gold: #f5a524;
  --gold-50: #fff7e6;
  --boss: #6d28d9;
  --boss-50: #f4efff;

  --side: #0b1220;
  --side-2: #131c2e;
  --side-ink: #cbd2e1;
  --side-muted: #7d889e;

  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow-sm: 0 1px 3px rgba(16, 24, 40, .08), 0 1px 2px rgba(16, 24, 40, .04);
  --shadow: 0 8px 24px -6px rgba(16, 24, 40, .10), 0 2px 6px rgba(16, 24, 40, .05);
  --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .18);
  --ring: 0 0 0 4px rgba(79, 70, 229, .16);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.2; }
p { margin: 0; }
code, .mono { font-family: var(--mono); }
[data-lucide] { width: 18px; height: 18px; stroke-width: 2; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* -------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid transparent;
  font-weight: 650; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 2px rgba(16,24,40,.1), inset 0 1px 0 rgba(255,255,255,.12); }
.btn-primary:hover { background: var(--brand-600); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1b2437; }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-3); }
.btn-outline { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); box-shadow: var(--shadow-xs); }
.btn-outline:hover { background: var(--surface-2); border-color: #c4c9d6; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15px; border-radius: 12px; }
.btn-sm { height: 34px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .45; cursor: not-allowed; transform: none; }

/* -------------------------------------------------------------- forms */
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.input {
  height: 46px; width: 100%; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--surface); font: inherit; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:hover { border-color: #c4c9d6; }
.input:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.input-icon { position: relative; }
.input-icon > [data-lucide] { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; }
.input-icon .input { padding-left: 42px; }

/* -------------------------------------------------------------- chips / pills */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--ink-2);
  white-space: nowrap;
}
.pill [data-lucide] { width: 14px; height: 14px; }
.pill-brand { background: var(--brand-50); color: var(--brand-700); }
.pill-success { background: var(--success-50); color: var(--success); }
.pill-warn { background: var(--warn-50); color: var(--warn); }
.pill-danger { background: var(--danger-50); color: var(--danger); }
.pill-gold { background: var(--gold-50); color: #a15c00; }
.pill-boss { background: var(--boss-50); color: var(--boss); }
.pill-dark { background: rgba(255,255,255,.1); color: #fff; }
.tag {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line);
}
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* -------------------------------------------------------------- cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-xs); }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 15px; }

/* -------------------------------------------------------------- progress */
.bar { display: block; height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), #7c72ff); transition: width .8s var(--ease); }
.bar-gold > span { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.bar-success > span { background: linear-gradient(90deg, #059669, #34d399); }
.bar-warn > span { background: linear-gradient(90deg, #d97706, #fbbf24); }
.bar-danger > span { background: linear-gradient(90deg, #dc2626, #f87171); }

/* ==========================================================================
   App shell (sidebar layout)
   ========================================================================== */
.shell { display: grid; grid-template-columns: 256px 1fr; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: var(--side); color: var(--side-ink); padding: 22px 16px;
  background-image: radial-gradient(600px 300px at -20% -10%, rgba(79,70,229,.35), transparent 60%);
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px 24px; color: #fff; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, #6366f1, #22d3ee); box-shadow: 0 6px 16px -4px rgba(99,102,241,.6);
}
.brand-mark [data-lucide] { color: #fff; width: 19px; height: 19px; }
.brand-name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; line-height: 1.1; }
.brand-sub { font-size: 11.5px; color: var(--side-muted); font-weight: 500; }
.nav { display: grid; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--side-muted); padding: 14px 12px 8px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 10px;
  color: var(--side-ink); font-weight: 600; transition: background .15s, color .15s;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; }
.nav a.active { background: rgba(255,255,255,.08); color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.06); }
.nav a.active [data-lucide] { color: #a5b4fc; }
.nav a .soon { margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--side-muted); border: 1px solid rgba(255,255,255,.12); border-radius: 6px; padding: 1px 6px; }
.side-foot { margin-top: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.side-foot > * { min-width: 0; }   /* a long email must not push the footer wider than the sidebar */
.level-card { background: var(--side-2); border: 1px solid rgba(255,255,255,.06); border-radius: 14px; padding: 14px; }
.level-card .row { display: flex; justify-content: space-between; align-items: baseline; font-size: 12.5px; }
.level-card .lv { color: #fff; font-weight: 700; font-size: 14px; }
.level-card .bar { background: rgba(255,255,255,.08); margin: 10px 0 8px; height: 6px; }
.level-card .sub { color: var(--side-muted); font-size: 12px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; }
.user-chip:hover { background: rgba(255,255,255,.05); }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #818cf8, #4f46e5); color: #fff; font-weight: 700; font-size: 13.5px;
}
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .nm { color: #fff; font-weight: 650; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .em { color: var(--side-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip a { color: var(--side-muted); padding: 6px; border-radius: 8px; display: grid; }
.user-chip a:hover { color: #fff; background: rgba(255,255,255,.08); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; gap: 16px;
  padding: 0 36px; background: rgba(244,245,249,.82); backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .crumbs { display: flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 600; font-size: 13.5px; }
.topbar .crumbs b { color: var(--ink); }
.topbar .spacer { flex: 1; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-xs);
}
.stat-pill [data-lucide] { width: 17px; height: 17px; }
.stat-pill .k { color: var(--muted); font-weight: 600; }
.ic-gold { color: var(--gold); }
.ic-flame { color: #f97316; }
.ic-brand { color: var(--brand); }
.content { padding: 12px 36px 56px; max-width: 1280px; }
.menu-btn { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 8px 0 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; font-weight: 800; }
.page-head p { color: var(--muted); margin-top: 6px; font-size: 15px; }

/* ==========================================================================
   Login
   ========================================================================== */
.auth { display: grid; grid-template-columns: 1.05fr 1fr; min-height: 100vh; background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden; color: #fff; padding: 44px 56px; display: flex; flex-direction: column;
  background:
    radial-gradient(700px 420px at 85% 10%, rgba(34,211,238,.25), transparent 60%),
    radial-gradient(800px 600px at 0% 100%, rgba(99,102,241,.55), transparent 60%),
    linear-gradient(160deg, #0b1220 0%, #121a35 55%, #1e1b4b 100%);
}
.auth-art .grid-bg {
  position: absolute; inset: 0; opacity: .5; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse at 60% 40%, #000 30%, transparent 75%);
}
.auth-art .brand { padding: 0; position: relative; }
.auth-hero { position: relative; margin-top: auto; max-width: 520px; }
.auth-hero h1 { font-size: 44px; font-weight: 800; letter-spacing: -.035em; line-height: 1.06; }
.auth-hero h1 em { font-style: normal; background: linear-gradient(90deg, #a5b4fc, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #b8c0d6; font-size: 16px; margin-top: 16px; max-width: 460px; }
.auth-points { display: grid; gap: 12px; margin-top: 30px; }
.auth-point { display: flex; gap: 12px; align-items: flex-start; color: #dbe1ef; font-size: 14px; }
.auth-point .ic { width: 30px; height: 30px; border-radius: 9px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.auth-point .ic [data-lucide] { width: 16px; height: 16px; color: #a5b4fc; }
.auth-point b { color: #fff; display: block; font-size: 14px; }
.auth-chat {
  position: relative; margin: 40px 0 0; max-width: 470px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 18px; padding: 16px; backdrop-filter: blur(6px); display: grid; gap: 10px;
}
.auth-chat .m { font-size: 13.5px; padding: 10px 13px; border-radius: 12px; max-width: 88%; }
.auth-chat .t { background: rgba(255,255,255,.1); color: #eef1f8; border-top-left-radius: 4px; }
.auth-chat .l { background: #4f46e5; color: #fff; justify-self: end; border-top-right-radius: 4px; }
.auth-chat .x { justify-self: start; font-size: 12px; font-weight: 700; color: #fbbf24; display: flex; gap: 6px; align-items: center; }
.auth-foot { position: relative; color: #7d889e; font-size: 12.5px; margin-top: 36px; }
.auth-form-wrap { display: grid; place-items: center; padding: 40px 24px; }
.auth-form { width: 100%; max-width: 400px; }
.auth-form h2 { font-size: 28px; font-weight: 800; }
.auth-form .sub { color: var(--muted); margin: 8px 0 28px; font-size: 15px; }
.auth-form form { display: grid; gap: 16px; }
.auth-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.auth-row a { color: var(--brand); font-weight: 650; }
.check { display: inline-flex; gap: 8px; align-items: center; color: var(--ink-2); cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); }
.divider { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12.5px; font-weight: 600; margin: 4px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.demo-note { margin-top: 22px; display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--muted); font-size: 13px; }
.demo-note [data-lucide] { color: var(--brand); margin-top: 1px; }

/* ==========================================================================
   Missions
   ========================================================================== */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat { padding: 18px 20px; display: flex; gap: 14px; align-items: flex-start; }
.stat .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.stat .ic [data-lucide] { width: 20px; height: 20px; }
.stat .k { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.stat .v { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; }
.stat .v small { font-size: 13px; color: var(--muted); font-weight: 600; }
.stat .bar { margin-top: 10px; height: 6px; }
.stat-body { flex: 1; min-width: 0; }
.ic-soft-brand { background: var(--brand-50); color: var(--brand); }
.ic-soft-gold { background: var(--gold-50); color: #d97706; }
.ic-soft-flame { background: #fff1e8; color: #ea580c; }
.ic-soft-success { background: var(--success-50); color: var(--success); }
.ic-soft-boss { background: var(--boss-50); color: var(--boss); }

.featured {
  position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 32px; color: #fff; margin-bottom: 34px;
  display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center;
  background:
    radial-gradient(520px 300px at 100% 0%, rgba(34,211,238,.28), transparent 60%),
    radial-gradient(600px 380px at 0% 100%, rgba(124,58,237,.45), transparent 60%),
    linear-gradient(135deg, #111a33, #1e1b4b);
  box-shadow: var(--shadow-lg);
}
.featured .grid-bg { position: absolute; inset: 0; opacity: .35; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 36px 36px; mask-image: linear-gradient(90deg, transparent, #000 70%); }
.featured > * { position: relative; }
.featured h2 { font-size: 30px; font-weight: 800; letter-spacing: -.03em; margin: 12px 0 10px; }
.featured p { color: #c3cadb; max-width: 520px; font-size: 15px; }
.featured .meta { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 24px; }
.featured .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.featured .btn-outline { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.18); color: #fff; box-shadow: none; }
.featured .btn-outline:hover { background: rgba(255,255,255,.12); }
.mini-map { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 18px; padding: 20px; backdrop-filter: blur(6px); }
.mini-map .title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #a3acc2; margin-bottom: 16px; display: flex; justify-content: space-between; }
.mm-row { display: flex; align-items: center; }
.mm-node { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; flex: none; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #cbd2e1; }
.mm-node.boss { width: 38px; height: 38px; background: linear-gradient(135deg, #7c3aed, #db2777); border: none; color: #fff; box-shadow: 0 0 0 6px rgba(124,58,237,.18); }
.mm-node.boss [data-lucide] { width: 18px; height: 18px; }
.mm-line { flex: 1; height: 2px; background: repeating-linear-gradient(90deg, rgba(255,255,255,.25) 0 6px, transparent 6px 11px); }
.mm-legend { display: flex; justify-content: space-between; margin-top: 12px; font-size: 11.5px; color: #8f99b0; font-weight: 600; }

.section-title { display: flex; align-items: center; justify-content: space-between; margin: 0 0 16px; }
.section-title h2 { font-size: 18px; font-weight: 800; }
.filters { display: flex; gap: 6px; background: var(--surface); border: 1px solid var(--line); padding: 4px; border-radius: 11px; }
.filters button { border: 0; background: transparent; height: 30px; padding: 0 12px; border-radius: 8px; font-weight: 650; font-size: 13px; color: var(--muted); cursor: pointer; }
.filters button.on { background: var(--ink); color: #fff; }

.mission-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.mcard { position: relative; display: flex; flex-direction: column; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.mcard:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); }
.mcard .cover { height: 112px; position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 14px 16px; }
.mcard .cover .glyph { position: absolute; right: -10px; top: -14px; width: 120px; height: 120px; opacity: .18; color: #fff; stroke-width: 1.4; }
.mcard .cover .chip { position: relative; display: inline-flex; gap: 6px; align-items: center; background: rgba(255,255,255,.18); color: #fff; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; backdrop-filter: blur(4px); }
.mcard .cover .chip [data-lucide] { width: 13px; height: 13px; }
.mcard .body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.mcard .mname { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .02em; }
.mcard h3 { font-size: 16px; font-weight: 750; }
.mcard .tags { display: flex; flex-wrap: wrap; gap: 6px; }
.mcard .foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.mcard .foot .left { display: flex; gap: 14px; }
.mcard .foot span { display: inline-flex; gap: 5px; align-items: center; }
.mcard .foot [data-lucide] { width: 15px; height: 15px; }
.mcard.locked .cover { filter: saturate(.25) brightness(.95); }
.mcard.locked h3, .mcard.locked .tags { opacity: .7; }
.mcard .lock { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; gap: 6px; align-items: center; background: rgba(11,18,32,.6); color: #fff; font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 999px; }
.mcard .lock [data-lucide] { width: 13px; height: 13px; }
.stars { display: inline-flex; gap: 2px; }
.stars [data-lucide] { width: 15px; height: 15px; color: var(--line-2); fill: var(--line-2); }
.stars .on { color: var(--gold) !important; fill: var(--gold) !important; }

.cv-indigo { background: linear-gradient(135deg, #4f46e5, #7c3aed); }
.cv-rose { background: linear-gradient(135deg, #e11d48, #f97316); }
.cv-amber { background: linear-gradient(135deg, #d97706, #f59e0b); }
.cv-yellow { background: linear-gradient(135deg, #ca8a04, #84cc16); }
.cv-cyan { background: linear-gradient(135deg, #0891b2, #2563eb); }
.cv-violet { background: linear-gradient(135deg, #7c3aed, #c026d3); }
.cv-emerald { background: linear-gradient(135deg, #059669, #0d9488); }
.cv-fuchsia { background: linear-gradient(135deg, #c026d3, #e11d48); }
.cv-sky { background: linear-gradient(135deg, #0284c7, #4f46e5); }

/* ==========================================================================
   Briefing
   ========================================================================== */
.brief { display: grid; grid-template-columns: 1fr 380px; gap: 22px; align-items: start; }
.brief-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); color: #fff; padding: 34px; background: radial-gradient(500px 300px at 100% 0%, rgba(34,211,238,.25), transparent 60%), linear-gradient(135deg, #111a33, #312e81); }
.brief-hero .grid-bg { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 32px 32px; mask-image: linear-gradient(90deg, transparent, #000); }
.brief-hero > * { position: relative; }
.brief-hero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 12px 0 6px; }
.brief-hero .proj { color: #a5b4fc; font-weight: 650; }
.brief-hero blockquote { margin: 22px 0 0; padding: 16px 18px; border-left: 3px solid #818cf8; background: rgba(255,255,255,.06); border-radius: 0 12px 12px 0; color: #dfe4f0; font-size: 15px; font-style: italic; }
.brief-hero .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }

.route { padding: 6px 22px 22px; }
.route-item { display: grid; grid-template-columns: 38px 1fr auto; gap: 14px; align-items: center; padding: 10px 0; position: relative; }
.route-item + .route-item { border-top: 1px dashed var(--line); }
.route-num { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 13px; }
.route-item.boss .route-num { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; }
.route-item h4 { font-size: 14.5px; font-weight: 700; }
.route-item p { color: var(--muted); font-size: 13px; margin-top: 2px; }

.rules { display: grid; gap: 12px; padding: 18px 22px 22px; }
.rule { display: flex; gap: 12px; align-items: flex-start; }
.rule .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.rule .ic [data-lucide] { width: 17px; height: 17px; }
.rule b { font-size: 13.5px; display: block; }
.rule span { color: var(--muted); font-size: 13px; }

.board-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 18px; }
.board-opt { position: relative; cursor: pointer; }
.board-opt input { position: absolute; opacity: 0; }
.board-opt .box { border: 1.5px solid var(--line-2); border-radius: 14px; padding: 16px 14px; display: grid; gap: 8px; transition: border-color .15s, background .15s, box-shadow .15s; height: 100%; }
.board-opt .box [data-lucide] { width: 22px; height: 22px; color: var(--muted); }
.board-opt .box b { font-size: 14px; }
.board-opt .box span { font-size: 12.5px; color: var(--muted); }
.board-opt input:checked + .box { border-color: var(--brand); background: var(--brand-50); box-shadow: var(--ring); }
.board-opt input:checked + .box [data-lucide] { color: var(--brand); }
.board-opt input:focus-visible + .box { box-shadow: var(--ring); }

/* ==========================================================================
   Play
   ========================================================================== */
.play { height: 100vh; display: grid; grid-template-rows: auto 1fr; background: var(--bg); overflow: hidden; }
.play-top {
  height: 64px; display: flex; align-items: center; gap: 16px; padding: 0 20px; background: var(--surface); border-bottom: 1px solid var(--line);
}
.play-top .exit { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); }
.play-top .exit:hover { background: var(--surface-2); color: var(--ink); }
.play-top .ttl { min-width: 0; }
.play-top .ttl .k { font-size: 11.5px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.play-top .ttl .v { font-weight: 750; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stage-steps { display: flex; align-items: center; gap: 10px; margin: 0 auto; }
.stage-step { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 13px; color: var(--faint); }
.stage-step .n { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); }
.stage-step.on { color: var(--ink); }
.stage-step.on .n { background: var(--brand); color: #fff; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-50); }
.stage-step.done .n { background: var(--success); color: #fff; border-color: var(--success); }
.stage-step.boss.on .n { background: linear-gradient(135deg, #7c3aed, #db2777); border: none; box-shadow: 0 0 0 4px var(--boss-50); }
.stage-sep { width: 46px; height: 2px; background: var(--line-2); border-radius: 2px; }
.hud { display: flex; align-items: center; gap: 8px; }
.hud .stat-pill { height: 36px; }
.hud .coins { display: inline-flex; gap: 3px; }
.coin { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fde68a, #f59e0b 60%, #b45309); box-shadow: inset 0 -1px 0 rgba(0,0,0,.15); transition: transform .3s, opacity .3s, filter .3s; }
.coin.spent { filter: grayscale(1); opacity: .3; transform: scale(.85); }
.combo { display: none; }
.combo.on { display: inline-flex; background: linear-gradient(135deg, #fff1e8, #ffe4d1); border-color: #fed7aa; color: #c2410c; animation: pop .4s var(--ease); }

.play-body { display: grid; grid-template-columns: 290px 1fr; min-height: 0; }
.pane { min-height: 0; overflow: auto; }
.pane-left { background: var(--surface); border-right: 1px solid var(--line); padding: 22px 18px; display: flex; flex-direction: column; gap: 20px; }
.pane-right { background: var(--surface); border-left: 1px solid var(--line); display: flex; flex-direction: column; }

.mapv { display: grid; }
.mapv-item { display: grid; grid-template-columns: 34px 1fr; gap: 12px; position: relative; padding-bottom: 16px; }
.mapv-item:not(:last-child)::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--line); }
.mapv-item.cleared:not(:last-child)::before { background: var(--success); }
.mapv-dot { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800; background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--faint); position: relative; z-index: 1; transition: all .3s var(--ease); }
.mapv-dot [data-lucide] { width: 16px; height: 16px; }
.mapv-item.active .mapv-dot { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 0 0 5px var(--brand-50); }
.mapv-item.cleared .mapv-dot { background: var(--success); border-color: var(--success); color: #fff; }
.mapv-item.boss .mapv-dot { border-style: dashed; }
.mapv-item.boss.active .mapv-dot { background: linear-gradient(135deg, #7c3aed, #db2777); border: none; box-shadow: 0 0 0 5px var(--boss-50); }
.mapv-item.just-cleared .mapv-dot { animation: celebrate .8s var(--ease); }
.mapv-txt { padding-top: 6px; }
.mapv-txt b { font-size: 13.5px; font-weight: 700; display: block; color: var(--ink-2); }
.mapv-txt span { font-size: 12px; color: var(--faint); }
.mapv-item.locked .mapv-txt b { color: var(--muted); }
.mapv-item.active .mapv-txt b { color: var(--ink); }

.side-card { border: 1px solid var(--line); border-radius: 14px; padding: 14px; background: var(--surface-2); }
.side-card .t { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.switch { position: relative; width: 40px; height: 23px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: .2s var(--ease); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(17px); }
.board-row { display: flex; align-items: center; gap: 10px; }
.board-row .txt { flex: 1; font-size: 13px; }
.board-row .txt b { display: block; font-size: 13.5px; }
.board-row .txt span { color: var(--muted); font-size: 12px; }

/* chat */
.chat { display: grid; grid-template-rows: 1fr auto; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; }
.feed { overflow: auto; padding: 28px 28px 12px; scroll-behavior: smooth; }
.feed-inner { max-width: 760px; margin: 0 auto; display: grid; gap: 14px; }
.msg { display: flex; gap: 12px; align-items: flex-start; animation: rise .35s var(--ease) both; }
.msg .av { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.msg .av [data-lucide] { width: 17px; height: 17px; }
.msg.tutor .av { background: linear-gradient(135deg, #4f46e5, #06b6d4); color: #fff; }
.msg .bubble { max-width: 620px; padding: 13px 16px; border-radius: 16px; font-size: 14.5px; }
.msg.tutor .bubble { background: var(--surface); border: 1px solid var(--line); border-top-left-radius: 5px; box-shadow: var(--shadow-xs); }
.msg.tutor.question .bubble { border-color: var(--brand-100); box-shadow: 0 0 0 3px rgba(79,70,229,.04), var(--shadow-xs); }
.msg.tutor.question.boss .bubble { border-color: #ddd0ff; box-shadow: 0 0 0 3px rgba(109,40,217,.05), var(--shadow-xs); }
.msg .fmt { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); margin-bottom: 6px; }
.msg .fmt [data-lucide] { width: 14px; height: 14px; }
.msg.boss .fmt { color: var(--boss); }
.msg.learner { flex-direction: row-reverse; }
.msg.learner .av { background: var(--ink); color: #fff; font-weight: 700; font-size: 12.5px; }
.msg.learner .bubble { background: var(--ink); color: #fff; border-top-right-radius: 5px; }
.msg.learner .bubble .tapped { display: flex; gap: 6px; align-items: center; font-size: 11.5px; color: #a3acc2; font-weight: 650; margin-bottom: 3px; }
.msg.learner .bubble .tapped [data-lucide] { width: 13px; height: 13px; }
.msg.tutor.probe .bubble { background: var(--surface); }
.msg.tutor.ack .bubble { padding: 9px 14px; font-weight: 600; }
.msg.tutor.ack.good .bubble { background: var(--success-50); border-color: var(--success-100); color: #065f46; }
.msg.tutor.ack.partial .bubble { background: var(--warn-50); border-color: var(--warn-100); color: #8a4b05; }
.msg.tutor.hint .bubble { background: var(--gold-50); border-color: #fde3b0; }
.msg.tutor.hint .fmt { color: #b45309; }
.sys { display: flex; justify-content: center; animation: rise .35s var(--ease) both; }
.sys .inner { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.sys.checkpoint .inner { background: var(--success-50); color: var(--success); border: 1px solid var(--success-100); }
.sys.stage .inner { background: linear-gradient(135deg, #f4efff, #fde8f3); color: var(--boss); border: 1px solid #e9d8ff; }
.reveal { display: flex; gap: 12px; margin-left: 46px; animation: rise .35s var(--ease) both; }
.reveal-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; gap: 16px; align-items: center; box-shadow: var(--shadow-xs); flex-wrap: wrap; }
.reveal-card .cap { max-width: 250px; font-size: 13px; color: var(--ink-2); }
.reveal-card .cap b { display: flex; gap: 6px; align-items: center; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.oled { width: 220px; aspect-ratio: 2 / 1; background: #05070d; border-radius: 10px; padding: 12px 14px; border: 6px solid #1f2633; box-shadow: inset 0 0 22px rgba(56,189,248,.08); font-family: var(--mono); font-size: 12px; line-height: 1.55; color: #7dd3fc; text-shadow: 0 0 6px rgba(125,211,252,.55); }
.oled div { white-space: nowrap; overflow: hidden; opacity: 0; animation: type .5s steps(20) forwards; }
.oled div:nth-child(2) { animation-delay: .35s; }
.oled div:nth-child(3) { animation-delay: .7s; }
.oled div:nth-child(4) { animation-delay: 1.05s; }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }

/* composer */
.composer { border-top: 1px solid var(--line); background: var(--surface); padding: 16px 28px 18px; }
.composer-inner { max-width: 760px; margin: 0 auto; }
.composer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.composer-head .instr { font-size: 12.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 7px; }
.composer-head .instr [data-lucide] { width: 15px; height: 15px; }
.composer-actions { display: flex; align-items: center; gap: 8px; }
.hint-btn { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 12px; border-radius: 9px; border: 1px solid #fde3b0; background: var(--gold-50); color: #a15c00; font-weight: 700; font-size: 13px; cursor: pointer; }
.hint-btn:hover:not([disabled]) { background: #ffefcc; }
.hint-btn[disabled] { opacity: .5; cursor: not-allowed; }
.hint-btn [data-lucide] { width: 15px; height: 15px; }

.opts { display: grid; gap: 10px; grid-template-columns: repeat(2, 1fr); }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left; padding: 13px 14px; border-radius: 13px;
  border: 1.5px solid var(--line-2); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 14px;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.opt:hover { border-color: #b9bff7; background: #fbfbff; }
.opt:focus-visible { outline: none; box-shadow: var(--ring); }
.opt .oi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); flex: none; transition: .15s; }
.opt .oi [data-lucide] { width: 17px; height: 17px; }
.opt .key { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--faint); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-family: var(--mono); }
.opt.sel { border-color: var(--brand); background: var(--brand-50); box-shadow: var(--ring); }
.opt.sel .oi { background: var(--brand); color: #fff; }
.opt.wrong { animation: shake .4s; border-color: #fca5a5; background: var(--danger-50); }

.kit { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.kcard { position: relative; border: 1.5px solid var(--line-2); border-radius: 14px; padding: 14px 10px 12px; text-align: center; cursor: pointer; background: var(--surface); display: grid; gap: 6px; justify-items: center; transition: .15s; }
.kcard:hover { border-color: #b9bff7; transform: translateY(-2px); }
.kcard .ki { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-2); transition: .15s; }
.kcard .ki [data-lucide] { width: 21px; height: 21px; }
.kcard b { font-size: 13px; line-height: 1.25; }
.kcard span { font-size: 11.5px; color: var(--muted); }
.kcard .tick { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; background: #fff; }
.kcard .tick [data-lucide] { width: 13px; height: 13px; color: #fff; stroke-width: 3; opacity: 0; }
.kcard.sel { border-color: var(--brand); background: var(--brand-50); box-shadow: var(--ring); }
.kcard.sel .ki { background: var(--brand); color: #fff; }
.kcard.sel .tick { background: var(--brand); border-color: var(--brand); }
.kcard.sel .tick [data-lucide] { opacity: 1; }

.seq { display: grid; gap: 8px; }
.seq-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: grab; user-select: none; transition: box-shadow .15s, border-color .15s, transform .15s; font-weight: 600; }
.seq-item:hover { border-color: #b9bff7; }
.seq-item.dragging { opacity: .5; }
.seq-item.over { border-color: var(--brand); box-shadow: var(--ring); }
.seq-item .num { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-700); font-weight: 800; font-size: 12.5px; flex: none; }
.seq-item .grip { color: var(--faint); }
.seq-item .lbl { flex: 1; }
.seq-item .mv { display: flex; gap: 4px; }
.seq-item .mv button { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface-2); display: grid; place-items: center; cursor: pointer; color: var(--muted); }
.seq-item .mv button:hover { color: var(--ink); background: var(--surface-3); }
.seq-item .mv [data-lucide] { width: 15px; height: 15px; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 36px; position: relative; }
.match-col { display: grid; gap: 10px; }
.mitem { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--surface); cursor: pointer; font-weight: 600; font-size: 13.5px; min-height: 50px; transition: .15s; }
.mitem:hover { border-color: #b9bff7; }
.mitem.mono { font-family: var(--mono); font-size: 13px; }
.mitem.armed { border-color: var(--brand); box-shadow: var(--ring); background: var(--brand-50); }
.mitem .pin { margin-left: auto; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #fff; flex: none; }
.mitem.p0 { border-color: #818cf8; background: #f3f4ff; } .mitem.p0 .pin { background: #4f46e5; }
.mitem.p1 { border-color: #5eead4; background: #effdfa; } .mitem.p1 .pin { background: #0d9488; }
.mitem.p2 { border-color: #f9a8d4; background: #fff2f8; } .mitem.p2 .pin { background: #db2777; }

.code-pick { background: #0b1220; border-radius: 14px; padding: 10px 0; font-family: var(--mono); font-size: 13px; overflow: auto; }
.code-line { display: flex; align-items: center; gap: 0; padding: 4px 14px 4px 0; cursor: pointer; color: #d6deeb; border-left: 3px solid transparent; transition: background .12s; white-space: pre; }
.code-line:hover { background: rgba(255,255,255,.05); }
.code-line .ln { width: 44px; text-align: right; padding-right: 14px; color: #4b5671; user-select: none; flex: none; }
.code-line.sel { background: rgba(239,68,68,.15); border-left-color: #f87171; }
.code-line.sel .ln { color: #fca5a5; }
.code-line .cm { color: #6b7894; font-style: italic; }

.typed { position: relative; }
.typed textarea {
  width: 100%; min-height: 92px; max-height: 220px; resize: vertical; padding: 14px 16px 52px; border-radius: 14px;
  border: 1.5px solid var(--line-2); font: inherit; font-size: 14.5px; color: var(--ink); background: var(--surface); transition: border-color .15s, box-shadow .15s;
}
.typed textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--ring); }
.typed .bar-under { position: absolute; left: 12px; right: 12px; bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.typed .kbd { font-size: 12px; color: var(--faint); font-weight: 600; }
.kbd kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--surface-2); color: var(--muted); }
.typed.boss textarea { border-color: #d9c8ff; }
.typed.boss textarea:focus { border-color: var(--boss); box-shadow: 0 0 0 4px rgba(109,40,217,.14); }
.submit-row { display: flex; justify-content: flex-end; margin-top: 12px; }
.boss-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; margin-bottom: 12px; color: #fff; background: linear-gradient(135deg, #4c1d95, #9d174d); }
.boss-banner .bi { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.boss-banner b { display: block; font-size: 14px; }
.boss-banner span { font-size: 12.5px; color: #f1dcff; }

/* right pane */
.tabs { display: flex; gap: 4px; padding: 12px 14px 0; border-bottom: 1px solid var(--line); }
.tab { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border: 0; background: transparent; font-weight: 700; font-size: 13px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab [data-lucide] { width: 16px; height: 16px; }
.tab.on { color: var(--ink); border-bottom-color: var(--brand); }
.tab .lockmini { width: 14px; height: 14px; color: var(--faint); }
.tabpanel { padding: 18px; overflow: auto; flex: 1; min-height: 0; display: none; }
.tabpanel.on { display: block; }
.codeview { background: #0b1220; border-radius: 14px; padding: 14px 0; font-family: var(--mono); font-size: 12px; line-height: 1.65; color: #d6deeb; overflow: auto; }
.codeview .l { display: flex; white-space: pre; padding-right: 14px; }
.codeview .l .ln { width: 38px; text-align: right; padding-right: 12px; color: #4b5671; user-select: none; flex: none; }
.tok-k { color: #c792ea; } .tok-s { color: #c3e88d; } .tok-c { color: #6b7894; font-style: italic; } .tok-n { color: #f78c6c; } .tok-f { color: #82aaff; } .tok-p { color: #ffcb6b; }
.locked-panel { text-align: center; padding: 40px 18px; color: var(--muted); }
.locked-panel .li { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 14px; background: var(--surface-3); color: var(--faint); }
.locked-panel .li [data-lucide] { width: 24px; height: 24px; }
.locked-panel b { color: var(--ink); display: block; margin-bottom: 4px; }
.intel { display: grid; gap: 14px; }
.intel-sec h4 { font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin-bottom: 10px; }
.comp-list { display: grid; gap: 8px; }
.comp { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.comp .ci { width: 34px; height: 34px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-2); }
.comp b { font-size: 13.5px; display: block; }
.comp span { font-size: 12px; color: var(--muted); }
.comp.hidden-comp { border-style: dashed; background: transparent; }
.comp.hidden-comp b { color: var(--faint); }
.xp-list { display: grid; gap: 6px; max-height: 220px; overflow: auto; }
.xp-row { display: flex; justify-content: space-between; font-size: 13px; padding: 7px 10px; border-radius: 9px; background: var(--surface-2); }
.xp-row b { color: #b45309; }
.xp-row .cb { color: #ea580c; font-size: 11px; font-weight: 800; margin-left: 6px; }
.empty { color: var(--faint); font-size: 13px; }

/* toasts */
.toasts { position: fixed; bottom: 24px; right: 24px; z-index: 100; display: grid; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--ink); color: #fff; font-weight: 700; font-size: 13.5px; box-shadow: var(--shadow-lg); animation: toastIn .35s var(--ease) both; }
.toast.out { animation: toastOut .3s ease forwards; }
.toast .xp { color: #fbbf24; }
.toast [data-lucide] { width: 16px; height: 16px; }
.toast.err { background: #7f1d1d; }
.xp-fly { position: fixed; z-index: 120; pointer-events: none; font-weight: 800; color: #d97706; font-size: 15px; animation: fly 1s var(--ease) forwards; }

/* ==========================================================================
   Debrief
   ========================================================================== */
.db-hero { position: relative; overflow: hidden; border-radius: var(--r-xl); padding: 36px; color: #fff; display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; margin-bottom: 22px; background: radial-gradient(600px 300px at 100% 0%, rgba(251,191,36,.18), transparent 60%), radial-gradient(600px 400px at 0% 100%, rgba(99,102,241,.5), transparent 60%), linear-gradient(135deg, #0f172a, #1e1b4b); }
.db-hero .grid-bg { position: absolute; inset: 0; opacity: .3; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 34px 34px; mask-image: radial-gradient(ellipse at 30% 50%, #000 20%, transparent 70%); }
.db-hero > * { position: relative; }
.db-hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -.03em; margin: 10px 0 6px; }
.db-hero p { color: #c3cadb; }
.big-stars { display: flex; gap: 10px; margin: 20px 0 0; }
.big-stars [data-lucide] { width: 40px; height: 40px; color: rgba(255,255,255,.18); fill: rgba(255,255,255,.08); stroke-width: 1.5; }
.big-stars .on { color: #fbbf24; fill: #fbbf24; filter: drop-shadow(0 4px 14px rgba(251,191,36,.45)); animation: starIn .6s var(--ease) both; }
.big-stars .on:nth-child(2) { animation-delay: .2s; }
.big-stars .on:nth-child(3) { animation-delay: .4s; }
.ring-wrap { position: relative; width: 168px; height: 168px; }
.ring-wrap svg { transform: rotate(-90deg); }
.ring-wrap .lbl { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring-wrap .lbl b { font-size: 42px; font-weight: 800; letter-spacing: -.04em; display: block; line-height: 1; }
.ring-wrap .lbl span { font-size: 12px; color: #a3acc2; font-weight: 600; }
.ring-track { stroke: rgba(255,255,255,.1); }
.ring-val { stroke: url(#rg); stroke-linecap: round; transition: stroke-dashoffset 1.4s var(--ease); }

.db-grid { display: grid; grid-template-columns: 1fr 360px; gap: 22px; align-items: start; }
.cp-table { padding: 6px 22px 10px; }
.cp-group { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 16px 0 6px; display: flex; align-items: center; gap: 8px; }
.cp-row { border-top: 1px solid var(--line); }
.cp-sum { display: grid; grid-template-columns: 40px 1fr 160px 50px 24px; gap: 14px; align-items: center; padding: 14px 0; cursor: pointer; list-style: none; }
.cp-sum::-webkit-details-marker { display: none; }
.cp-id { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-weight: 800; font-size: 12.5px; background: var(--surface-3); color: var(--ink-2); }
.cp-id.boss { background: linear-gradient(135deg, #7c3aed, #db2777); color: #fff; }
.cp-name b { font-size: 14.5px; font-weight: 700; display: block; }
.cp-name .notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; }
.cp-score { font-weight: 800; font-size: 17px; text-align: right; }
.cp-chev { color: var(--faint); transition: transform .2s; }
details[open] .cp-chev { transform: rotate(180deg); }
.cp-detail { padding: 0 0 18px 54px; display: grid; gap: 14px; }
.dims { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.dim { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.dim .k { font-size: 11.5px; color: var(--muted); font-weight: 650; display: flex; justify-content: space-between; }
.dim .v { font-size: 18px; font-weight: 800; margin-top: 2px; }
.dim .bar { height: 5px; margin-top: 6px; }
.evidence { display: grid; gap: 8px; }
.ev { display: grid; grid-template-columns: 120px 1fr auto; gap: 12px; align-items: start; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.ev .f { color: var(--muted); font-weight: 650; font-size: 12px; }
.ev .a { color: var(--ink-2); }

.reward-total { display: flex; align-items: center; gap: 14px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.reward-total .xi { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; box-shadow: 0 8px 18px -6px rgba(245,158,11,.6); }
.reward-total .xi [data-lucide] { width: 24px; height: 24px; }
.reward-total b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; display: block; line-height: 1.1; }
.reward-total span { color: var(--muted); font-size: 13px; font-weight: 600; }
.rw-rows { padding: 12px 22px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.rw-row { display: flex; justify-content: space-between; font-size: 13.5px; }
.rw-row span { color: var(--muted); font-weight: 600; }
.rw-row b { font-weight: 750; }
.levelup { margin: 16px 22px; padding: 14px; border-radius: 14px; background: linear-gradient(135deg, var(--brand-50), #f0fbff); border: 1px solid var(--brand-100); }
.levelup .row { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 14px; }
.levelup .row [data-lucide] { color: var(--brand); }
.levelup .bar { margin-top: 10px; background: #fff; }
.levelup .sub { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.badge-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 4px 22px 22px; }
.bdg { display: grid; justify-items: center; text-align: center; gap: 8px; padding: 16px 10px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); }
.bdg .bi { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: conic-gradient(from 200deg, #6366f1, #22d3ee, #a855f7, #6366f1); box-shadow: 0 8px 20px -8px rgba(99,102,241,.7), inset 0 0 0 3px rgba(255,255,255,.35); }
.bdg .bi [data-lucide] { width: 22px; height: 22px; }
.bdg b { font-size: 13px; }
.bdg span { font-size: 11.5px; color: var(--muted); }
.bdg.new { animation: pop .5s var(--ease) both; border-color: var(--brand-100); background: linear-gradient(180deg, #fff, var(--brand-50)); }
.bdg.locked .bi { background: var(--surface-3); color: var(--faint); box-shadow: none; }
.bdg.locked b { color: var(--muted); }
.bdg .bar { width: 80%; height: 5px; }
.insights { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 22px; }
.insight { padding: 18px 20px; display: flex; gap: 14px; }
.insight .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.insight h4 { font-size: 13px; color: var(--muted); font-weight: 650; }
.insight p { font-weight: 700; margin-top: 3px; font-size: 14.5px; }
.insight a { color: var(--brand); font-weight: 700; font-size: 13px; display: inline-flex; gap: 4px; align-items: center; margin-top: 6px; }
.insight a [data-lucide] { width: 15px; height: 15px; }

/* progress page */
.prog-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.level-track { padding: 22px; }
.lvl-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 18px; }
.lvl-step { text-align: center; }
.lvl-step .dot { height: 8px; border-radius: 99px; background: var(--surface-3); margin-bottom: 8px; }
.lvl-step.done .dot { background: var(--brand); }
.lvl-step.cur .dot { background: linear-gradient(90deg, var(--brand), var(--brand-100)); }
.lvl-step b { font-size: 12.5px; display: block; }
.lvl-step span { font-size: 11.5px; color: var(--muted); }
.lvl-step.cur b { color: var(--brand); }
.hist { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.hist th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 650; padding: 10px 22px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.hist td { padding: 14px 22px; border-bottom: 1px solid var(--line); }
.hist tr:last-child td { border-bottom: 0; }
.empty-state { text-align: center; padding: 40px 22px; color: var(--muted); }
.empty-state .ei { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin: 0 auto 12px; background: var(--brand-50); color: var(--brand); }

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 60% { transform: scale(1.05); opacity: 1; } 100% { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
@keyframes celebrate { 0% { transform: scale(1); } 40% { transform: scale(1.3); box-shadow: 0 0 0 10px rgba(5,150,105,.15); } 100% { transform: scale(1); } }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
@keyframes type { from { opacity: 1; max-width: 0; } to { opacity: 1; max-width: 100%; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(12px); } }
@keyframes fly { 0% { opacity: 0; transform: translateY(0) scale(.8); } 20% { opacity: 1; transform: translateY(-8px) scale(1.1); } 100% { opacity: 0; transform: translateY(-46px) scale(1); } }
@keyframes starIn { from { transform: scale(.3) rotate(-30deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

.pane-toggle { display: none !important; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .play-body { grid-template-columns: 250px 1fr; }
  .mission-grid { grid-template-columns: repeat(2, 1fr); }
  .kit { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1080px) {
  .play-body { grid-template-columns: minmax(0, 1fr); }
  .pane-left, .pane-right { display: none; }
  .play.show-left .pane-left, .play.show-right .pane-right { display: flex; position: fixed; top: 64px; bottom: 0; z-index: 40; width: min(360px, 92vw); box-shadow: var(--shadow-lg); }
  .play.show-left .pane-left { left: 0; }
  .play.show-right .pane-right { right: 0; }
  .pane-toggle { display: inline-flex !important; }
  .brief, .db-grid, .prog-grid { grid-template-columns: 1fr; }
  .featured { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .insights { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; z-index: 60; width: 270px; transform: translateX(-100%); transition: transform .25s var(--ease); }
  .shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .menu-btn { display: inline-flex; }
  .topbar, .content { padding-left: 16px; padding-right: 16px; }
  .stage-steps .stage-step span.lbl { display: none; }
  .stage-sep { width: 22px; }
}
@media (max-width: 640px) {
  .mission-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px; flex-direction: column; gap: 10px; }
  .stat .ic { width: 36px; height: 36px; }
  .topbar { gap: 8px; }
  .topbar .stat-pill { padding: 0 10px; height: 34px; }
  .topbar .stat-pill .k { display: none; }
  .topbar .crumbs { min-width: 0; overflow: hidden; white-space: nowrap; }
  .section-title { flex-wrap: wrap; gap: 10px; }
  .filters { width: 100%; overflow-x: auto; }
  .filters button { flex: 1; padding: 0 8px; }
  .opts { grid-template-columns: 1fr; }
  .kit { grid-template-columns: repeat(2, 1fr); }
  .match { gap: 10px 14px; }
  .feed { padding: 18px 16px 10px; }
  .composer { padding: 14px 16px; }
  .play-top { padding: 0 12px; gap: 8px; }
  .play-top .ttl, .hud .xp-k, .stage-steps { display: none; }
  .hud { margin-left: auto; }
  .composer { max-height: 56vh; overflow: auto; }
  .seq-item { padding: 9px 10px; gap: 8px; }
  .seq-item .grip { display: none; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .dims { grid-template-columns: repeat(2, 1fr); }
  .cp-sum { grid-template-columns: 36px 1fr 46px 20px; }
  .cp-sum .bar { display: none; }
  .cp-detail { padding-left: 0; }
  .ev { grid-template-columns: 1fr; gap: 4px; }
  .db-hero { grid-template-columns: 1fr; padding: 26px; }
  .page-head h1 { font-size: 24px; }
  .featured { padding: 24px; }
  .reveal { margin-left: 0; }
}

/* Mission map grouped by the 2 stages */
.mapv-stages { display: grid; gap: 12px; }
.mapv-stage { border: 1px solid var(--line); border-radius: 14px; padding: 12px 12px 0; background: var(--surface); }
.mapv-stage.on { border-color: var(--brand-100); background: var(--brand-50); }
.mapv-stage.boss.on { border-color: var(--boss-50); background: var(--boss-50); }
.mapv-stage.done { border-color: color-mix(in srgb, var(--success) 35%, transparent); }
.mapv-stage-h { display: grid; grid-template-columns: 18px 1fr; column-gap: 8px; align-items: center; margin-bottom: 12px; }
.mapv-stage-h [data-lucide] { width: 16px; height: 16px; color: var(--brand); }
.mapv-stage.boss .mapv-stage-h [data-lucide] { color: #7c3aed; }
.mapv-stage-h b { font-size: 12.5px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; color: var(--ink); }
.mapv-stage-h span { grid-column: 2; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.mapv-stage .mapv-item:last-child { padding-bottom: 12px; }

/* Login hero — simplified */
.auth-hero { margin-top: auto; margin-bottom: auto; padding: 48px 0; max-width: 600px; }
.auth-hero h1 { margin-top: 24px; font-size: 40px; line-height: 1.15; }
.auth-hero p { margin-top: 20px; font-size: 16.5px; line-height: 1.6; max-width: 420px; }
.auth-points { list-style: none; padding: 0; margin: 40px 0 0; display: grid; gap: 18px; }
.auth-points li { display: flex; align-items: center; gap: 14px; color: #e6eaf3; font-size: 15px; font-weight: 600; }
.auth-points .ic { width: 36px; height: 36px; border-radius: 10px; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.auth-points .ic [data-lucide] { width: 17px; height: 17px; color: #a5b4fc; }
.auth-foot { margin-top: 0; }

/* Multiple choice: options already ruled out */
.opt.out { opacity: .5; cursor: not-allowed; text-decoration: line-through; text-decoration-color: var(--faint); background: var(--surface-2); }
.opt.out .oi { color: var(--danger, #dc2626); }
.opt.out:hover { transform: none; border-color: var(--line); box-shadow: none; }
.opts.wide { grid-template-columns: 1fr; }

/* ---------------- Home: categories ---------------- */
.resume-strip { display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin-bottom: 22px; transition: box-shadow .2s, border-color .2s; }
.resume-strip:hover { box-shadow: var(--shadow); border-color: var(--brand-100); }
.resume-strip > div { flex: 1; min-width: 0; }
.resume-strip b { display: block; font-size: 15px; }
.resume-strip div span { color: var(--muted); font-size: 13.5px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.cat-card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; }
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-2); }
.cat-cover { position: relative; height: 150px; overflow: hidden; display: flex; align-items: flex-end; padding: 20px 24px; }
.cat-cover .grid-bg { opacity: .35; }
.cat-ic, .topic-ic { position: relative; width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.28); color: #fff; backdrop-filter: blur(6px); }
.cat-ic [data-lucide], .topic-ic [data-lucide] { width: 26px; height: 26px; }
.cat-glyph { position: absolute; right: -18px; top: -22px; width: 170px; height: 170px; color: #fff; opacity: .16; stroke-width: 1.2; }
.cat-body { padding: 22px 24px 22px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.cat-body h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.cat-body p { color: var(--muted); font-size: 15px; line-height: 1.55; }
.cat-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-tags .tag { display: inline-flex; align-items: center; gap: 5px; }
.cat-tags .tag [data-lucide] { width: 13px; height: 13px; }
.cat-foot { margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--muted); font-weight: 600; }
.cat-foot .go { color: var(--brand); display: inline-flex; gap: 6px; align-items: center; font-weight: 700; }
.cat-foot .go [data-lucide] { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.cat-card:hover .go [data-lucide] { transform: translateX(3px); }

/* ---------------- General: topics ---------------- */
.topic-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.topic-card { all: unset; box-sizing: border-box; display: flex; flex-direction: column; cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.topic-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.topic-card:focus-visible { box-shadow: var(--ring); }
.topic-cover { position: relative; height: 130px; overflow: hidden; display: flex; align-items: flex-end; justify-content: space-between; padding: 18px 20px; }
.topic-cover .cat-glyph { width: 140px; height: 140px; }
.soon-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #fff; background: rgba(15,23,42,.35); border: 1px solid rgba(255,255,255,.25); padding: 5px 10px; border-radius: 999px; backdrop-filter: blur(4px); }
.soon-pill [data-lucide] { width: 13px; height: 13px; }
.topic-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; }
.topic-body h3 { font-size: 18px; font-weight: 800; }
.topic-body p { color: var(--muted); font-size: 14px; line-height: 1.55; }
.soon-modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 16px; background: rgba(11,18,32,.5); backdrop-filter: blur(6px); }
.soon-modal[hidden] { display: none; }
.soon-card { width: min(400px, 100%); background: var(--surface); border-radius: 20px; padding: 28px 24px 22px; text-align: center; box-shadow: var(--shadow-lg); animation: pop .35s var(--ease); }
.soon-ic { width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-50); color: var(--brand); }
.soon-ic [data-lucide] { width: 28px; height: 28px; }
.soon-card h3 { font-size: 20px; font-weight: 800; }
.soon-card p { color: var(--muted); margin: 8px 0 20px; font-size: 14.5px; }
.soon-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

@media (max-width: 1080px) { .topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cat-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .topic-grid { grid-template-columns: 1fr; }
  .cat-cover { height: 120px; }
  .resume-strip { flex-wrap: wrap; }
}
.cat-cover .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px); background-size: 28px 28px; mask-image: linear-gradient(90deg, transparent, #000 75%); }

/* Login: real auth */
.form-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: -8px 0 18px; border-radius: 12px; background: var(--danger-50); border: 1px solid #fecaca; color: #991b1b; font-size: 13.5px; font-weight: 600; }
.form-alert [data-lucide] { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.input-icon.pw { position: relative; }
.input-icon.pw .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: transparent; border-radius: 8px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.pw-toggle:hover { background: var(--surface-2); color: var(--ink); }
.pw-toggle [data-lucide] { width: 18px; height: 18px; position: static; transform: none; }
.sso-note { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); font-size: 13.5px; color: var(--ink-2); }
.sso-note b { display: block; color: var(--ink); font-size: 14px; margin-bottom: 2px; }
.sso-ic { width: 34px; height: 34px; border-radius: 10px; flex: none; display: grid; place-items: center; background: var(--brand); color: #fff; }
.sso-ic [data-lucide] { width: 17px; height: 17px; }
.auth-foot-link { margin-top: 20px; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-foot-link a { color: var(--brand); font-weight: 650; }

/* ---------- General: live topic cards, activity, progress ---------- */
a.topic-card { color: inherit; text-decoration: none; }
.topic-body { flex: 1; }
.topic-prog { margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.tp-row { display: flex; justify-content: space-between; font-size: 13px; font-weight: 650; color: var(--ink-2); }
.tp-row b { color: var(--ink); }
.topic-prog .bar { height: 6px; }
.tp-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.tp-meta span { display: inline-flex; align-items: center; gap: 5px; }
.tp-meta [data-lucide] { width: 14px; height: 14px; }
.topic-go { align-self: flex-start; margin-top: 8px; }
.act-list { list-style: none; margin: 0; padding: 6px 22px 12px; }
.act-list li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.act-list li:last-child { border-bottom: 0; }
.act-list li > span:nth-child(2) { flex: 1; min-width: 0; }
.act-list li b { color: #b45309; font-size: 13px; white-space: nowrap; }
.act-list .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.act-list .ic [data-lucide] { width: 16px; height: 16px; }
.gen-areas { display: grid; gap: 16px; padding: 18px 22px 22px; }
.gen-area-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 14px; margin-bottom: 8px; }
.gen-area-head a { color: var(--brand); font-weight: 650; font-size: 13px; text-decoration: none; }
.gen-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.gen-chip { font-size: 12px; font-weight: 650; padding: 4px 9px; border-radius: 999px; background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); display: inline-flex; align-items: center; gap: 4px; }
.gen-chip.on { background: var(--brand-50); color: var(--brand-700); border-color: var(--brand-100); }
.gen-chip.star { background: var(--success-50); color: var(--success); border-color: transparent; }
.gen-chip [data-lucide] { width: 12px; height: 12px; }

/* ==========================================================================
   General page — dark "playground" theme shared with the CORE, Sensor and
   Actuator games (navy surfaces, neon accents). Scoped to .gen.
   ========================================================================== */
.main:has(.gen) {
  --g-bg: #0a0f24; --g-bg-2: #10183a; --g-card: #151f47; --g-card-2: #1c2858; --g-line: #2a3a78;
  --g-text: #eef2ff; --g-muted: #a6b2dc; --g-faint: #6f7bb0;
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(155,123,255,.10), transparent 60%),
    radial-gradient(800px 460px at 0% 20%, rgba(56,225,255,.07), transparent 60%),
    var(--g-bg);
  min-height: 100vh; color: var(--g-text);
}
.main:has(.gen) .topbar { background: rgba(10,15,36,.78); }
.main:has(.gen) .topbar.scrolled { border-bottom-color: var(--g-line); }
.main:has(.gen) .topbar .crumbs { color: var(--g-muted); }
.main:has(.gen) .topbar .crumbs a:hover { color: var(--g-text); }
.main:has(.gen) .topbar .crumbs b { color: var(--g-text); }
.main:has(.gen) .stat-pill { background: var(--g-card); border-color: var(--g-line); color: var(--g-text); box-shadow: none; }
.main:has(.gen) .stat-pill .k { color: var(--g-muted); }
.main:has(.gen) .ic-gold { color: #ffc24b; }

/* per-game accents */
.gen .ac-microcontroller { --a1: #9b7bff; --a2: #38e1ff; --a-rgb: 155,123,255; }
.gen .ac-sensors         { --a1: #38e1ff; --a2: #7af0c8; --a-rgb: 56,225,255; }
.gen .ac-actuators       { --a1: #ffc24b; --a2: #ff8f5a; --a-rgb: 255,194,75; }

.gen .page-head { margin-bottom: 28px; }
.gen .page-head .eyebrow { color: #38e1ff; letter-spacing: .14em; }
.gen .page-head h1 { color: var(--g-text); font-size: 30px; letter-spacing: -.02em; }
.gen .page-head p { color: var(--g-muted); max-width: 720px; }

/* topic cards */
.gen .topic-grid { gap: 22px; }
.gen .topic-card {
  background: linear-gradient(180deg, var(--g-card), var(--g-bg-2));
  border: 1px solid var(--g-line); border-radius: 18px;
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
}
.gen .topic-card:hover {
  transform: translateY(-3px); border-color: rgba(var(--a-rgb), .55);
  box-shadow: 0 18px 40px -16px rgba(var(--a-rgb), .35), 0 0 0 1px rgba(var(--a-rgb), .15);
}
.gen .topic-card:focus-visible { outline: 2px solid var(--a1); outline-offset: 3px; }
.gen .topic-cover {
  height: 124px;
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(320px 160px at 100% 0%, rgba(var(--a-rgb), .28), transparent 70%),
    #0d1433;
  border-bottom: 1px solid var(--g-line);
}
.gen .topic-cover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--a1), var(--a2));
}
.gen .topic-ic {
  background: rgba(var(--a-rgb), .12); border: 1px solid rgba(var(--a-rgb), .4); color: var(--a1);
  box-shadow: 0 0 24px -6px rgba(var(--a-rgb), .6); backdrop-filter: none;
}
.gen .cat-glyph { color: var(--a1); opacity: .14; }
.gen .soon-pill { background: rgba(10,15,36,.72); border-color: rgba(var(--a-rgb), .35); color: var(--g-text); }
.gen .soon-pill [data-lucide] { color: var(--a1); }

.gen .topic-body { gap: 10px; padding: 20px 22px 22px; }
.gen .topic-body h3 { color: var(--g-text); font-size: 18px; font-weight: 750; }
.gen .topic-body p { color: var(--g-muted); }
.gen .tag { background: rgba(255,255,255,.03); border-color: var(--g-line); color: #c7d0f0; font-weight: 600; }
.gen .topic-prog { border-top-color: var(--g-line); margin-top: 8px; padding-top: 14px; }
.gen .tp-row { color: var(--g-muted); }
.gen .tp-row b { color: var(--a1); font-family: var(--mono); font-weight: 600; }
.gen .bar { background: rgba(255,255,255,.06); }
.gen .bar > span { background: linear-gradient(90deg, var(--a1), var(--a2)); box-shadow: 0 0 10px rgba(var(--a-rgb), .5); }
.gen .tp-meta { color: var(--g-faint); }
.gen .topic-go {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border-radius: 10px;
  font-weight: 700; font-size: 13.5px; color: #08122e;
  background: linear-gradient(135deg, var(--a1), var(--a2));
  transition: filter .15s, box-shadow .15s;
}
.gen .topic-go [data-lucide] { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.gen .topic-card:hover .topic-go { box-shadow: 0 6px 18px -6px rgba(var(--a-rgb), .7); filter: brightness(1.06); }
.gen .topic-card:hover .topic-go [data-lucide] { transform: translateX(3px); }

/* recent activity */
.gen .gen-card { margin-top: 24px; background: linear-gradient(180deg, var(--g-card), var(--g-bg-2)); border: 1px solid var(--g-line); border-radius: 18px; }
.gen .card-head { border-bottom-color: var(--g-line); }
.gen .card-head h3 { color: var(--g-text); }
.gen .xp-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px; font-size: 12px; font-weight: 700;
  color: #ffc24b; background: rgba(255,194,75,.1); border: 1px solid rgba(255,194,75,.3); }
.gen .xp-pill [data-lucide] { width: 13px; height: 13px; }
.gen .act-list li { border-bottom-color: rgba(42,58,120,.6); color: #dbe2fb; }
.gen .act-list .ic { background: rgba(var(--a-rgb, 56,225,255), .12); color: var(--a1, #38e1ff); border: 1px solid rgba(var(--a-rgb, 56,225,255), .3); }
.gen .act-list li b { color: #ffc24b; font-family: var(--mono); font-weight: 600; }
.gen .empty-state { color: var(--g-muted); }
.gen .empty-state b { color: var(--g-text); }
.gen .empty-state .ei { background: rgba(56,225,255,.1); color: #38e1ff; }

/* ---------------- Home in the playground theme (reuses the .gen shell styles above) ---------------- */
.gen .ac-general  { --a1: #9b7bff; --a2: #38e1ff; --a-rgb: 155,123,255; }
.gen .ac-products { --a1: #4be38c; --a2: #38e1ff; --a-rgb: 75,227,140; }
.gen .ac-violet { --a1: #9b7bff; --a-rgb: 155,123,255; }
.gen .ac-amber  { --a1: #ffc24b; --a-rgb: 255,194,75; }
.gen .ac-flame  { --a1: #ff8f5a; --a-rgb: 255,143,90; }
.gen .ac-pink   { --a1: #ff5fa2; --a-rgb: 255,95,162; }
.gen .ac-cyan   { --a1: #38e1ff; --a-rgb: 56,225,255; }

.gen .cat-grid { gap: 24px; }
.gen .cat-card {
  background: linear-gradient(180deg, var(--g-card), var(--g-bg-2)); border: 1px solid var(--g-line); border-radius: 20px;
}
.gen .cat-card:hover {
  border-color: rgba(var(--a-rgb), .55);
  box-shadow: 0 20px 44px -18px rgba(var(--a-rgb), .4), 0 0 0 1px rgba(var(--a-rgb), .15);
}
.gen .cat-cover {
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 24px 24px,
    radial-gradient(420px 200px at 100% 0%, rgba(var(--a-rgb), .3), transparent 70%),
    #0d1433;
  border-bottom: 1px solid var(--g-line);
}
.gen .cat-cover .grid-bg { display: none; }
.gen .cat-cover::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px;
  background: linear-gradient(90deg, var(--a1), var(--a2));
}
.gen .cat-ic {
  background: rgba(var(--a-rgb), .12); border: 1px solid rgba(var(--a-rgb), .4); color: var(--a1);
  box-shadow: 0 0 24px -6px rgba(var(--a-rgb), .6); backdrop-filter: none;
}
.gen .cat-body .eyebrow { color: var(--a1); letter-spacing: .14em; }
.gen .cat-body h2 { color: var(--g-text); }
.gen .cat-body p { color: var(--g-muted); }
.gen .cat-tags .tag [data-lucide] { color: var(--a1); }
.gen .cat-foot { border-top-color: var(--g-line); color: var(--g-faint); }
.gen .cat-foot .go {
  height: 34px; padding: 0 14px; border-radius: 10px; color: #08122e;
  background: linear-gradient(135deg, var(--a1), var(--a2));
}
.gen .cat-card:hover .go { box-shadow: 0 6px 18px -6px rgba(var(--a-rgb), .7); filter: brightness(1.06); }

.gen .card { background: linear-gradient(180deg, var(--g-card), var(--g-bg-2)); border-color: var(--g-line); box-shadow: none; }
.gen .stat .ic { background: rgba(var(--a-rgb), .12); color: var(--a1); border: 1px solid rgba(var(--a-rgb), .3); }
.gen .stat .k { color: var(--g-muted); }
.gen .stat .v { color: var(--g-text); }
.gen .stat .v small { color: var(--g-faint); }
.gen .stat .bar > span { background: linear-gradient(90deg, #9b7bff, #38e1ff); box-shadow: 0 0 10px rgba(155,123,255,.5); }
.gen .resume-strip .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: rgba(var(--a-rgb), .12); color: var(--a1); border: 1px solid rgba(var(--a-rgb), .3); }
.gen .resume-strip b { color: var(--g-text); }
.gen .resume-strip div span { color: var(--g-muted); }
.gen .resume-strip:hover { border-color: rgba(56,225,255,.5); box-shadow: 0 16px 36px -18px rgba(56,225,255,.45); }
.gen .resume-strip .btn-primary { background: linear-gradient(135deg, #38e1ff, #7af0c8); color: #08122e; }

/* ---------------- Back / Forward buttons in the top bar ---------------- */
.hist-nav { display: inline-flex; gap: 4px; flex: none; }
.hist-btn {
  width: 34px; height: 34px; display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  box-shadow: var(--shadow-xs); transition: background .15s, color .15s, border-color .15s;
}
.hist-btn [data-lucide] { width: 17px; height: 17px; }
.hist-btn:hover:not(:disabled) { background: var(--brand-50); color: var(--brand); border-color: var(--brand-100); }
.hist-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.hist-btn:disabled { opacity: .4; cursor: default; }
.main:has(.gen) .hist-btn { background: var(--g-card); border-color: var(--g-line); color: var(--g-muted); box-shadow: none; }
.main:has(.gen) .hist-btn:hover:not(:disabled) { background: var(--g-card-2); color: #38e1ff; border-color: rgba(56,225,255,.45); }
@media (max-width: 640px) { .hist-btn { width: 32px; height: 32px; } }
/* the buttons live on each page's title line: Back at the start, Forward at the far right */
.page-head > div:first-child { flex: 1; min-width: 0; }
.ph-line { display: flex; align-items: center; gap: 12px; }
.ph-line .hist-fwd { margin-left: auto; }
.ph-line + h1 { margin-top: 6px; }
.ph-solo { margin: 4px 0 18px; }


/* ---------------- Products in the playground theme (same dark theme as Home and General) ---------------- */
.gen-prod.ac-indigo, .gen-prod .ac-indigo  { --a1: #9b7bff; --a2: #38e1ff; --a-rgb: 155,123,255; }
.gen-prod.ac-rose, .gen-prod .ac-rose    { --a1: #ff5a6a; --a2: #ff8f5a; --a-rgb: 255,90,106; }
.gen-prod.ac-amber, .gen-prod .ac-amber   { --a1: #ffc24b; --a2: #ff8f5a; --a-rgb: 255,194,75; }
.gen-prod.ac-yellow, .gen-prod .ac-yellow  { --a1: #e8d84b; --a2: #4be38c; --a-rgb: 232,216,75; }
.gen-prod.ac-cyan, .gen-prod .ac-cyan    { --a1: #38e1ff; --a2: #7af0c8; --a-rgb: 56,225,255; }
.gen-prod.ac-violet, .gen-prod .ac-violet  { --a1: #9b7bff; --a2: #ff5fa2; --a-rgb: 155,123,255; }
.gen-prod.ac-emerald, .gen-prod .ac-emerald { --a1: #4be38c; --a2: #38e1ff; --a-rgb: 75,227,140; }
.gen-prod.ac-fuchsia, .gen-prod .ac-fuchsia { --a1: #ff5fa2; --a2: #9b7bff; --a-rgb: 255,95,162; }
.gen-prod.ac-sky, .gen-prod .ac-sky     { --a1: #5eb3f6; --a2: #9b7bff; --a-rgb: 94,179,246; }

.gen-prod.ac-products { --a1: #4be38c; --a2: #38e1ff; --a-rgb: 75,227,140; }

.main:has(.gen) .menu-btn { background: var(--g-card); border-color: var(--g-line); color: var(--g-text); box-shadow: none; }

/* the featured mission */
.gen-prod .featured {
  border: 1px solid var(--g-line); border-radius: 20px; box-shadow: none;
  background:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 26px 26px,
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 26px 26px,
    radial-gradient(560px 300px at 100% 0%, rgba(var(--a-rgb), .28), transparent 65%),
    radial-gradient(520px 340px at 0% 100%, rgba(56,225,255,.10), transparent 65%),
    #0d1433;
}
.gen-prod .featured::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.gen-prod .featured .grid-bg { display: none; }
.gen-prod .featured h2 { color: var(--g-text); }
.gen-prod .featured p { color: var(--g-muted); }
.gen-prod .pill-dark { background: rgba(10,15,36,.72); border: 1px solid rgba(var(--a-rgb), .3); color: var(--g-text); }
.gen-prod .pill-dark [data-lucide] { color: var(--a1); }
.gen-prod .btn-primary { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #08122e; border: 0; box-shadow: 0 8px 22px -10px rgba(var(--a-rgb), .7); }
.gen-prod .btn-primary:hover { filter: brightness(1.07); box-shadow: 0 10px 26px -10px rgba(var(--a-rgb), .85); }
.gen-prod .featured .btn-outline { background: rgba(255,255,255,.04); border-color: var(--g-line); color: var(--g-text); }
.gen-prod .featured .btn-outline:hover { background: var(--g-card-2); border-color: rgba(var(--a-rgb), .5); }
.gen-prod .mini-map { background: rgba(10,15,36,.6); border-color: var(--g-line); }
.gen-prod .mini-map .title { color: var(--g-muted); }
.gen-prod .mm-node { background: var(--g-card); border-color: var(--g-line); color: var(--g-muted); }
.gen-prod .mm-node:not(.boss) { color: var(--a1); border-color: rgba(var(--a-rgb), .4); }
.gen-prod .mm-line { background: repeating-linear-gradient(90deg, rgba(var(--a-rgb), .45) 0 6px, transparent 6px 11px); }
.gen-prod .mm-node.boss { background: linear-gradient(135deg, #7c3aed, #db2777); border: 0; color: #fff; box-shadow: 0 0 0 6px rgba(124,58,237,.22); }
.gen-prod .mm-legend { color: var(--g-faint); }

/* the mission list */
.gen-prod .section-title h2 { color: var(--g-text); }
.gen-prod .filters { background: var(--g-card); border-color: var(--g-line); }
.gen-prod .filters button { color: var(--g-muted); }
.gen-prod .filters button:hover:not(.on) { color: var(--g-text); background: rgba(255,255,255,.05); }
.gen-prod .filters button.on { background: linear-gradient(135deg, var(--a1), var(--a2)); color: #08122e; }
.gen-prod .mission-grid { gap: 22px; }
.gen-prod .mcard {
  background: linear-gradient(180deg, var(--g-card), var(--g-bg-2)); border: 1px solid var(--g-line); border-radius: 18px; box-shadow: none;
}
.gen-prod .mcard:not(.locked):hover {
  transform: translateY(-3px); border-color: rgba(var(--a-rgb), .55);
  box-shadow: 0 18px 40px -16px rgba(var(--a-rgb), .35), 0 0 0 1px rgba(var(--a-rgb), .15);
}
.gen-prod .mcard:focus-visible { outline: 2px solid var(--a1); outline-offset: 3px; }
.gen-prod .mcard .cover {
  height: 112px; border-bottom: 1px solid var(--g-line);
  background:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 22px 22px,
    radial-gradient(320px 160px at 100% 0%, rgba(var(--a-rgb), .28), transparent 70%),
    #0d1433;
}
.gen-prod .mcard .cover::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--a1), var(--a2)); }
.gen-prod .mcard .cover .glyph { color: var(--a1); opacity: .16; }
.gen-prod .mcard .cover .chip { background: rgba(10,15,36,.72); border: 1px solid rgba(var(--a-rgb), .35); color: var(--g-text); }
.gen-prod .mcard .cover .chip [data-lucide] { color: var(--a1); }
.gen-prod .mcard .mname { color: var(--a1); letter-spacing: .08em; }
.gen-prod .mcard h3 { color: var(--g-text); font-weight: 750; }
.gen-prod .mcard .foot { border-top-color: var(--g-line); color: var(--g-faint); }
.gen-prod .mcard .mgo { color: #08122e; background: linear-gradient(135deg, var(--a1), var(--a2)); padding: 5px 12px; border-radius: 9px; font-weight: 700; }
.gen-prod .mcard:not(.locked):hover .mgo { box-shadow: 0 6px 18px -6px rgba(var(--a-rgb), .7); }
.gen-prod .stars [data-lucide] { color: rgba(255,255,255,.14); fill: rgba(255,255,255,.14); }
.gen-prod .stars .on { color: #ffc24b !important; fill: #ffc24b !important; }
.gen-prod .mcard.locked { opacity: .78; }
.gen-prod .mcard.locked .cover { filter: saturate(.4) brightness(.9); }
.gen-prod .mcard .lock { background: rgba(10,15,36,.8); border: 1px solid var(--g-line); }
@media (max-width: 1100px) { .gen-prod .mission-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 720px) { .gen-prod .mission-grid { grid-template-columns: 1fr; } .gen-prod .featured { grid-template-columns: 1fr; padding: 24px; } }


/* ==========================================================================
   Products flow in the playground theme: briefing, mission, debrief, progress.
   The app's colour variables are swapped for the dark navy set, so every card,
   text and border follows; the rules below fix what used fixed light colours.
   ========================================================================== */
.gen-prod, body:has(.play) {
  --bg: #0a0f24; --surface: #151f47; --surface-2: #10183a; --surface-3: #1c2858;
  --ink: #eef2ff; --ink-2: #dbe2fb; --muted: #a6b2dc; --faint: #6f7bb0;
  --line: #2a3a78; --line-2: #3a4a8e;
  --brand: #9b7bff; --brand-600: #8665f0; --brand-700: #c4b3ff; --brand-50: rgba(155,123,255,.14); --brand-100: rgba(155,123,255,.32);
  --accent: #38e1ff;
  --success: #4be38c; --success-50: rgba(75,227,140,.12); --success-100: rgba(75,227,140,.32);
  --warn: #ffc24b; --warn-50: rgba(255,194,75,.12); --warn-100: rgba(255,194,75,.32);
  --danger: #ff5a6a; --danger-50: rgba(255,90,106,.12);
  --gold: #ffc24b; --gold-50: rgba(255,194,75,.12);
  --boss: #c9a2ff; --boss-50: rgba(192,132,252,.14);
  --shadow-xs: none; --shadow-sm: none; --shadow: 0 10px 28px -10px rgba(0,0,0,.6); --shadow-lg: 0 24px 48px -12px rgba(0,0,0,.6);
  --ring: 0 0 0 4px rgba(155,123,255,.28);
}
body:has(.play) {
  background:
    radial-gradient(900px 480px at 85% -10%, rgba(155,123,255,.10), transparent 60%),
    radial-gradient(800px 460px at 0% 20%, rgba(56,225,255,.07), transparent 60%),
    var(--bg);
}
.gen-prod .btn-primary, body:has(.play) .btn-primary { background: linear-gradient(135deg, var(--a1, #9b7bff), var(--a2, #38e1ff)); color: #08122e; border: 0; box-shadow: 0 8px 22px -10px rgba(155,123,255,.7); }
.gen-prod .btn-primary:hover:not(:disabled), body:has(.play) .btn-primary:hover:not(:disabled) { filter: brightness(1.07); }
.gen-prod .btn-dark, body:has(.play) .btn-dark { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); }
.gen-prod .btn-outline, body:has(.play) .btn-outline { background: rgba(255,255,255,.04); border-color: var(--line); color: var(--ink); }
.gen-prod .btn-outline:hover:not(:disabled), body:has(.play) .btn-outline:hover:not(:disabled) { background: var(--surface-3); border-color: var(--line-2); }
.gen-prod .page-head h1, .gen-prod h1, .gen-prod h2, .gen-prod h3, .gen-prod h4 { color: var(--ink); }
.gen-prod .ic-soft-brand { background: rgba(155,123,255,.14); color: #b9a3ff; }
.gen-prod .ic-soft-gold { background: rgba(255,194,75,.13); color: #ffc24b; }
.gen-prod .ic-soft-flame { background: rgba(255,143,90,.14); color: #ff8f5a; }
.gen-prod .ic-soft-boss { background: rgba(192,132,252,.14); color: #c9a2ff; }
.gen-prod .ic-soft-success { background: rgba(75,227,140,.13); color: #4be38c; }
/* things that used the ink colour as a dark fill with white text */
.msg.learner .av, .msg.learner .bubble { background: linear-gradient(135deg, #4f46e5, #7c3aed); color: #fff; }
.toast { background: var(--surface-3); color: var(--ink); border: 1px solid var(--line-2); }
.stage-step.on .n, .mapv-item.active .mapv-dot, .opt.sel .oi, .kcard.sel .ki { color: #08122e; }
.opt:hover { border-color: rgba(155,123,255,.6); background: rgba(155,123,255,.08); }
.hint-btn:hover:not([disabled]) { background: rgba(255,194,75,.14); }
.mitem.p0 { border-color: #9b7bff; background: rgba(155,123,255,.12); } .mitem.p0 .pin { background: #9b7bff; color: #08122e; }
.mitem.p2 { border-color: #ff5fa2; background: rgba(255,95,162,.12); }
.levelup .bar { background: rgba(255,255,255,.1); }
.finish-overlay { background: rgba(5,8,22,.7); }
.levelup { background: linear-gradient(135deg, rgba(155,123,255,.16), rgba(56,225,255,.08)); border-color: var(--brand-100); }
.bdg.new { background: linear-gradient(180deg, rgba(155,123,255,.16), rgba(56,225,255,.06)); border-color: rgba(155,123,255,.45); }
.msg.tutor.ack.good .bubble { color: #4be38c; }
.msg.tutor.ack.partial .bubble { color: #ffc24b; }
@media (max-width: 640px) {
  .cp-table { padding-left: 14px; padding-right: 14px; }
  .cp-sum { grid-template-columns: 40px minmax(0, 1fr) 36px 20px; gap: 10px; }
  .cp-sum > .bar { display: none; }
  .cp-detail { padding-left: 0; }
  .dims { grid-template-columns: repeat(2, 1fr); }
  .db-hero { grid-template-columns: 1fr; padding: 24px; }
}
.gen-prod .bar-success > span { background: linear-gradient(90deg, #2bbf73, #4be38c); box-shadow: 0 0 10px rgba(75,227,140,.4); }
.gen-prod .bar-warn > span { background: linear-gradient(90deg, #e0a020, #ffc24b); box-shadow: 0 0 10px rgba(255,194,75,.35); }
.gen-prod .bar-danger > span { background: linear-gradient(90deg, #e0455a, #ff7a88); box-shadow: 0 0 10px rgba(255,90,106,.4); }
.gen-prod .bar-gold > span { background: linear-gradient(90deg, #e0a020, #ffc24b); }
.db-grid > *, .brief > * { min-width: 0; }
.db-grid { grid-template-columns: minmax(0, 1fr) 360px; }
@media (max-width: 1080px) { .db-grid { grid-template-columns: 1fr; } }

