:root {
  --bg: #0a0a0c;
  --bg-card: #111114;
  --bg-card-hover: #18181b;
  --border: #27272a;
  --border-active: #3f3f46;
  --accent: #0099ff;
  --accent-dim: #007acc;
  --violet: #a855f7;
  --amber: #fbbf24;
  --red: #ff4d6d;
  --text: #e4e4e7;
  --text-2: #8a8a96;
  --text-muted: #52525a;
  --mono: "IBM Plex Mono", monospace;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  --radius: 5px;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── NAV ── */
.learn-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  height: 52px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,12,0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: visible;
}

.learn-nav__brand {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none !important;
  letter-spacing: 0.01em;
  padding-bottom: 3px;
}
.learn-nav__brand:hover { text-decoration: none !important; }
.brand-esp { color: var(--accent); }
.brand-ilon { color: var(--accent); }
.brand-sep { color: var(--text-muted); margin: 0 4px; }
.brand-learn { color: var(--text); }

.learn-nav__links { display: flex; align-items: center; gap: 1.25rem; }
.learn-nav__links a { color: var(--text-2); font-size: 0.875rem; text-decoration: none; transition: color 0.15s; }
.learn-nav__links a:hover { color: var(--text); }

.btn-nav {
  background: transparent;
  color: var(--accent) !important;
  border: 1px solid var(--accent-dim);
  padding: 5px 13px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  transition: background 0.15s;
}
.btn-nav:hover { background: rgba(0,153,255,0.08) !important; text-decoration: none !important; }

/* ── MAIN ── */
.learn-main { flex: 1; }

/* ── HERO ── */
.learn-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4rem 3rem;
  border-bottom: 1px solid var(--border);
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  gap: 2rem;
}

.hero-inner h1 {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  font-family: var(--mono);
}
.accent { color: var(--accent); }
.hero-sub { color: var(--text-2); font-size: 1rem; margin-bottom: 1.5rem; }

.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #0a0a0c;
  padding: 9px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  margin-right: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: #33adff; text-decoration: none; }
.btn-secondary {
  display: inline-block;
  border: 1px solid var(--border-active);
  color: var(--text-2);
  padding: 9px 20px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}
.btn-secondary:hover { border-color: var(--text-2); color: var(--text); text-decoration: none; }

/* Prestige widget */
.hero-prestige { display: flex; align-items: center; gap: 1rem; flex-shrink: 0; }
.prestige-badge {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(0,153,255,0.08);
  border: 2px solid var(--accent-dim);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  color: var(--accent);
}
.prestige-badge.prestige-10 { background: rgba(168,85,247,0.1); border-color: var(--violet); color: var(--violet); }

.xp-bar { width: 140px; height: 3px; background: var(--border); border-radius: 2px; margin: 4px 0; }
.xp-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease; }
.prestige-title { font-size: 0.85rem; font-weight: 600; display: block; }
.xp-label { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); }

/* ── CATALOGUE ── */
.learn-catalogue {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem;
}

.section-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.course-card:hover { border-color: var(--border-active); background: var(--bg-card-hover); text-decoration: none; }

.course-card__header { display: flex; justify-content: space-between; align-items: center; }
.course-tag {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  background: rgba(0,153,255,0.08);
  padding: 2px 7px;
  border-radius: 3px;
  border: 1px solid rgba(0,153,255,0.15);
}
.difficulty-badge { font-size: 0.7rem; font-family: var(--mono); color: var(--text-muted); }
.difficulty-beginner .difficulty-badge { color: var(--violet); }
.difficulty-intermediate .difficulty-badge { color: var(--amber); }
.difficulty-advanced .difficulty-badge { color: var(--red); }

.course-card__title { font-size: 0.95rem; font-weight: 600; }
.course-card__desc { font-size: 0.85rem; color: var(--text-2); flex: 1; }
.course-card__footer { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; color: var(--text-muted); margin-top: auto; }

.mini-progress { flex: 1; height: 2px; background: var(--border); border-radius: 1px; }
.mini-progress__fill { height: 100%; background: var(--accent); border-radius: 1px; }
.pct-label { font-family: var(--mono); font-size: 0.72rem; }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 5rem 2rem; color: var(--text-2); }
.muted { color: var(--text-muted); margin-top: 0.5rem; font-size: 0.875rem; }

/* ── COURSE / LESSON LAYOUT ── */
.course-layout, .lesson-layout { display: flex; min-height: calc(100vh - 52px); }

/* ── SIDEBAR ── */
.course-sidebar, .lesson-sidebar {
  width: 268px;
  min-width: 268px;
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.75rem;
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-header h2 { font-size: 0.9rem; font-weight: 600; margin: 0.4rem 0 0.25rem; line-height: 1.3; }
.back-link { font-size: 0.78rem; color: var(--text-muted); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.back-link:hover { color: var(--text-2); }
.sidebar-tag { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); }

.sidebar-progress { padding: 0.1rem 0; }
.progress-bar { height: 2px; background: var(--border); border-radius: 1px; margin-bottom: 5px; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 1px; transition: width 0.6s ease; }
.progress-label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }

.sidebar-lessons { display: flex; flex-direction: column; gap: 1px; }
.sidebar-lesson {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 7px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.sidebar-lesson:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.sidebar-lesson.active { background: rgba(0,153,255,0.08); color: var(--text); border-left: 2px solid var(--accent); padding-left: 5px; }
.sidebar-lesson.completed .lesson-check { color: var(--violet); }
.lesson-check { font-family: var(--mono); font-size: 0.72rem; width: 13px; flex-shrink: 0; color: var(--text-muted); }
.lesson-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── COURSE MAIN ── */
.course-main { flex: 1; padding: 2.5rem 3rem; }
.course-hero { margin-bottom: 2.5rem; }
.course-hero h1 { font-size: 1.8rem; font-weight: 700; margin: 0.5rem 0; font-family: var(--mono); }
.course-desc { color: var(--text-2); margin: 0.75rem 0; }
.course-meta { font-size: 0.8rem; color: var(--text-muted); font-family: var(--mono); display: flex; gap: 8px; }

.lessons-list { display: flex; flex-direction: column; gap: 3px; margin-bottom: 2rem; }
.lessons-list h3 { font-size: 0.72rem; color: var(--text-muted); margin-bottom: 0.75rem; font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; }

.lesson-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s;
}
.lesson-item:hover { border-color: var(--border-active); text-decoration: none; }
.lesson-item.completed { border-left: 2px solid var(--violet); }
.lesson-num { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); min-width: 22px; }
.lesson-item__info { flex: 1; }
.lesson-item__title { font-size: 0.88rem; }
.lesson-item__badge {
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--amber);
  background: rgba(251,191,36,0.08);
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 8px;
  border: 1px solid rgba(251,191,36,0.15);
}
.lesson-item__check { color: var(--violet); font-family: var(--mono); font-size: 0.85rem; }

.cta-box {
  background: rgba(0,153,255,0.05);
  border: 1px solid rgba(0,153,255,0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  margin-top: 2rem;
}
.cta-box p { margin-bottom: 1rem; color: var(--text-2); font-size: 0.875rem; }

/* ── LESSON CONTENT ── */
.lesson-content { flex: 1; padding: 2rem 3rem; }
.lesson-header { margin-bottom: 2rem; }
.lesson-breadcrumb {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  gap: 6px;
  align-items: center;
  margin-bottom: 0.75rem;
}
.lesson-breadcrumb a { color: var(--text-muted); transition: color 0.1s; }
.lesson-breadcrumb a:hover { color: var(--text-2); text-decoration: none; }
.lesson-header h1 { font-size: 1.6rem; font-weight: 700; font-family: var(--mono); }

.completed-badge {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--violet);
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  padding: 3px 10px;
  border-radius: 12px;
  margin-top: 0.5rem;
  font-family: var(--mono);
}

/* ── PROSE ── */
.prose { line-height: 1.75; color: var(--text); }
.prose h1, .prose h2, .prose h3 { margin: 1.75rem 0 0.75rem; font-weight: 600; font-family: var(--mono); }
.prose h2 { font-size: 1.15rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
.prose h3 { font-size: 1rem; color: var(--accent); }
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol { margin: 0.75rem 0 1rem 1.5rem; }
.prose li { margin-bottom: 0.25rem; }
.prose code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--violet);
}
.prose pre {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 1rem 0;
}
.prose pre code { background: none; border: none; padding: 0; color: var(--text-2); }
.prose blockquote {
  border-left: 2px solid var(--accent-dim);
  margin: 1rem 0;
  padding: 0.5rem 1rem;
  color: var(--text-2);
  background: rgba(0,153,255,0.04);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose th { background: var(--bg-card); padding: 7px 12px; text-align: left; font-family: var(--mono); font-size: 0.75rem; color: var(--text-2); border-bottom: 1px solid var(--border); }
.prose td { padding: 7px 12px; border-bottom: 1px solid var(--border); font-size: 0.875rem; }
.prose a { color: var(--accent); }
.prose strong { color: var(--text); font-weight: 600; }

/* ── CHALLENGE CALLOUT ── */
.challenge-callout {
  display: flex;
  gap: 1rem;
  background: rgba(251,191,36,0.04);
  border: 1px solid rgba(251,191,36,0.18);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin: 2rem 0;
}
.callout-icon { font-size: 1.3rem; flex-shrink: 0; }
.callout-content h4 { font-size: 0.875rem; font-weight: 600; margin-bottom: 0.25rem; color: var(--amber); }
.callout-content p { font-size: 0.82rem; color: var(--text-2); margin-bottom: 0.75rem; }
.btn-challenge {
  display: inline-block;
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  color: var(--amber);
  padding: 5px 13px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-challenge:hover { background: rgba(251,191,36,0.14); text-decoration: none; }

/* ── LESSON NAV ── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}

.lesson-nav__btn {
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.82rem;
  color: var(--text-2);
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s;
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lesson-nav__btn:hover { border-color: var(--border-active); color: var(--text); text-decoration: none; }
.lesson-nav__btn.next { background: var(--bg-card); }

.btn-complete {
  background: var(--accent);
  color: #0a0a0c;
  border: none;
  padding: 7px 16px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
  white-space: nowrap;
}
.btn-complete:hover { background: #33adff; }

/* ── AUTH PAGES ── */
.auth-page {
  min-height: calc(100vh - 52px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.auth-box {
  width: 100%;
  max-width: 380px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.auth-box h1 { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; margin-bottom: 0.25rem; }
.auth-box .auth-sub { font-size: 0.82rem; color: var(--text-2); margin-bottom: 1.75rem; }
.auth-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 1rem; }
.auth-field label { font-size: 0.78rem; color: var(--text-2); font-family: var(--mono); }
.auth-field input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-field input:focus { border-color: var(--accent-dim); }
.auth-submit {
  width: 100%;
  background: var(--accent);
  color: #0a0a0c;
  border: none;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 9px;
  cursor: pointer;
  font-family: var(--sans);
  margin-top: 0.5rem;
  transition: background 0.15s;
}
.auth-submit:hover { background: #33adff; }
.auth-footer { text-align: center; margin-top: 1.25rem; font-size: 0.8rem; color: var(--text-muted); }
.auth-footer a { color: var(--accent); }
.auth-error {
  background: rgba(255,77,109,0.08);
  border: 1px solid rgba(255,77,109,0.2);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--red);
  margin-bottom: 1rem;
}

/* ── FOOTER ── */
.learn-footer {
  display: flex;
  justify-content: space-between;
  padding: 0.875rem 2rem;
  border-top: 1px solid var(--border);
  font-size: 0.78rem;
  color: var(--text-muted);
  font-family: var(--mono);
}
.learn-footer a { color: var(--text-muted); transition: color 0.1s; }
.learn-footer a:hover { color: var(--text-2); text-decoration: none; }

/* ── COURSE STATS ── */
.course-hero__top { display: flex; align-items: center; gap: 8px; margin-bottom: 0.5rem; }
.course-category-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 2px 7px;
  border-radius: 3px;
}

.course-stats {
  display: flex;
  gap: 1.5rem;
  margin: 1.25rem 0 0;
  padding: 1rem 1.25rem;
  background:
    radial-gradient(ellipse 80% 120% at 50% 140%, rgba(0,153,255,0.22) 0%, transparent 65%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat-item { display: flex; align-items: center; gap: 8px; }
.stat-icon { font-size: 1rem; }
.stat-value { font-family: var(--mono); font-size: 1rem; font-weight: 600; display: block; line-height: 1.1; }
.stat-label { font-size: 0.7rem; color: var(--text-muted); font-family: var(--mono); }

/* ── COURSE SECTIONS ── */
.course-section { margin-bottom: 1.75rem; }
.section-label {
  font-size: 0.7rem;
  font-family: var(--mono);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.6rem;
}

.prereq-list { display: flex; flex-wrap: wrap; gap: 6px; }
.prereq-tag {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  background: rgba(0,153,255,0.06);
  border: 1px solid rgba(0,153,255,0.2);
  padding: 3px 10px;
  border-radius: 3px;
  text-decoration: none;
  transition: background 0.15s;
}
.prereq-tag:hover { background: rgba(0,153,255,0.12); text-decoration: none; }

.skills-list { display: flex; flex-wrap: wrap; gap: 6px; }
.skill-tag {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--violet);
  background: rgba(168,85,247,0.06);
  border: 1px solid rgba(168,85,247,0.18);
  padding: 3px 9px;
  border-radius: 3px;
}

/* ── CHALLENGE BLOCK ── */
.challenge-block {
  margin: 2.5rem 0;
  border: 1px solid rgba(0,153,255,0.2);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(0,153,255,0.03);
}

.challenge-block__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: rgba(0,153,255,0.06);
  border-bottom: 1px solid rgba(0,153,255,0.15);
}
.challenge-block__icon { font-size: 1.1rem; flex-shrink: 0; }
.challenge-block__label {
  font-size: 0.65rem;
  font-family: var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
}
.challenge-block__name { font-size: 0.95rem; font-weight: 600; margin: 0; }
.challenge-block__type {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: 3px;
  background: rgba(0,153,255,0.1);
  color: var(--accent);
  border: 1px solid rgba(0,153,255,0.2);
}
.challenge-block__type.type-container { background: rgba(16,185,129,0.08); color: var(--violet); border-color: rgba(168,85,247,0.2); }

.challenge-block__body { padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }

.challenge-desc { font-size: 0.875rem; }
.challenge-desc code { font-family: var(--mono); font-size: 0.82em; background: var(--bg-card); padding: 1px 5px; border-radius: 3px; color: var(--violet); }
.challenge-desc pre { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.75rem 1rem; overflow-x: auto; margin: 0.5rem 0; }
.challenge-desc pre code { background: none; border: none; padding: 0; color: var(--text-2); }

/* Files */
.challenge-files { display: flex; flex-direction: column; gap: 6px; }
.files-label { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.file-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  background: rgba(0,153,255,0.06);
  border: 1px solid rgba(0,153,255,0.15);
  padding: 4px 10px;
  border-radius: 3px;
  text-decoration: none;
  width: fit-content;
}
.file-link:hover { background: rgba(0,153,255,0.12); text-decoration: none; }

/* Container */
.challenge-container {}
.btn-spawn {
  background: rgba(168,85,247,0.1);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--violet);
  padding: 8px 16px;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.15s;
}
.btn-spawn:hover:not(:disabled) { background: rgba(168,85,247,0.18); }
.btn-spawn:disabled { opacity: 0.5; cursor: default; }

.container-access { display: flex; flex-direction: column; gap: 8px; }
.access-label { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.access-entry { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.access-name { font-size: 0.78rem; color: var(--text-2); }
.access-url {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 3px;
  color: var(--violet);
  flex: 1;
}
.btn-copy {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 3px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: var(--mono);
}
.btn-copy:hover { border-color: var(--border-active); color: var(--text); }
.btn-stop {
  background: transparent;
  border: 1px solid rgba(255,77,109,0.3);
  color: var(--red);
  padding: 5px 10px;
  border-radius: var(--radius);
  font-size: 0.78rem;
  cursor: pointer;
  font-family: var(--sans);
  margin-top: 4px;
  width: fit-content;
}

/* Flag input */
.challenge-flag {}
.flag-input-row { display: flex; align-items: center; gap: 6px; }
.flag-prefix {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-right: none;
  padding: 8px 10px;
  border-radius: var(--radius) 0 0 var(--radius);
}
.flag-input {
  flex: 1;
  font-family: var(--mono);
  font-size: 0.875rem;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  outline: none;
  transition: border-color 0.15s;
  border-radius: 0;
}
.flag-input:focus { border-color: var(--accent-dim); }
.flag-input.flag-error { border-color: var(--red); animation: shake 0.3s ease; }
.btn-flag {
  background: var(--accent);
  color: #0a0a0c;
  border: none;
  padding: 8px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--sans);
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-flag:hover:not(:disabled) { background: #33adff; }
.btn-flag:disabled { opacity: 0.6; cursor: default; }

.flag-feedback { font-size: 0.82rem; font-family: var(--mono); padding: 4px 0; }
.feedback-ok { color: var(--violet); }
.feedback-err { color: var(--red); }

.challenge-flag-locked { font-size: 0.85rem; color: var(--text-muted); }

/* Solved state */
.challenge-solved {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius);
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.875rem;
}
.solved-icon { font-size: 1rem; }

/* XP Toast */
.xp-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--violet);
  color: #0a0a0c;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 1rem;
  padding: 10px 20px;
  border-radius: var(--radius);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s, transform 0.3s;
  z-index: 999;
  pointer-events: none;
}
.xp-toast--show { opacity: 1; transform: translateY(0); }

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ── PROFILE PAGE ── */
.profile-page { max-width: 1000px; margin: 0 auto; padding: 2.5rem 2rem; }

/* Hero */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
}

/* Avatar */
.profile-avatar { position: relative; flex-shrink: 0; }
.avatar-ring {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 2px solid var(--border-active);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.prestige-ring-0 { border-color: var(--border-active); }
.prestige-ring-1, .prestige-ring-2 { border-color: #6366f1; }
.prestige-ring-3, .prestige-ring-4 { border-color: var(--accent); }
.prestige-ring-5, .prestige-ring-6 { border-color: var(--violet); }
.prestige-ring-7, .prestige-ring-8 { border-color: #f59e0b; }
.prestige-ring-9, .prestige-ring-10 { border-color: #ef4444; box-shadow: 0 0 12px rgba(239,68,68,0.3); }

.avatar-letter { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--text); }
.prestige-badge-sm {
  position: absolute;
  bottom: -4px; right: -4px;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  color: var(--text-2);
}
.prestige-badge-sm.p0 { color: var(--text-muted); }
.prestige-badge-sm.p3, .prestige-badge-sm.p4 { color: var(--accent); border-color: var(--accent-dim); }
.prestige-badge-sm.p5, .prestige-badge-sm.p6 { color: var(--violet); border-color: rgba(168,85,247,0.4); }
.prestige-badge-sm.p7, .prestige-badge-sm.p8 { color: #f59e0b; border-color: rgba(245,158,11,0.4); }
.prestige-badge-sm.p9, .prestige-badge-sm.p10 { color: #ef4444; border-color: rgba(239,68,68,0.4); }

/* Identity */
.profile-identity { flex: 1; min-width: 200px; }
.profile-name { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; margin-bottom: 2px; }
.profile-title { font-size: 0.8rem; color: var(--violet); font-family: var(--mono); display: block; margin-bottom: 1rem; }

.xp-section { margin-top: 0.5rem; }
.xp-track { display: flex; flex-direction: column; gap: 5px; }
.xp-bar-large { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.xp-fill-large { height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); border-radius: 3px; transition: width 0.8s ease; }
.xp-labels { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.xp-current { color: var(--accent); }

/* Stats grid */
.profile-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-left: auto;
  min-width: 160px;
}
.pstat {
  display: flex; flex-direction: column; align-items: center;
  padding: 0.75rem 1rem;
  background: var(--bg);
  gap: 2px;
}
.pstat-val { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; color: var(--text); }
.pstat-label { font-size: 0.68rem; color: var(--text-muted); font-family: var(--mono); }

/* Body sections */
.profile-body { display: flex; flex-direction: column; gap: 2rem; }
.profile-section {}
.profile-section-title {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}

/* Course progress cards */
.progress-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 0.75rem; }
.progress-course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; gap: 0.4rem;
  transition: border-color 0.15s;
}
.progress-course-card:hover { border-color: var(--border-active); text-decoration: none; }
.progress-course-card.done { border-color: rgba(168,85,247,0.25); }
.pcc-header { display: flex; justify-content: space-between; align-items: center; }
.pcc-tag { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); background: rgba(0,153,255,0.08); padding: 1px 6px; border-radius: 3px; }
.pcc-pct { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }
.pcc-done-badge { font-family: var(--mono); font-size: 0.68rem; color: var(--violet); background: rgba(168,85,247,0.08); padding: 1px 6px; border-radius: 3px; }
.pcc-title { font-size: 0.875rem; font-weight: 600; }
.pcc-bar { height: 3px; background: var(--border); border-radius: 2px; }
.pcc-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s ease; }
.pcc-meta { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }

/* Recent activity */
.recent-list { display: flex; flex-direction: column; gap: 3px; }
.recent-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.12s;
}
.recent-item:hover { border-color: var(--border-active); text-decoration: none; }
.recent-check { color: var(--violet); font-family: var(--mono); font-size: 0.8rem; flex-shrink: 0; }
.recent-info { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.recent-lesson { font-size: 0.875rem; }
.recent-course { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }
.recent-date { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); flex-shrink: 0; }

/* Prestige roadmap */
.prestige-roadmap {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}
.prestige-step {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; flex: 1; min-width: 80px;
  padding: 0.75rem 0.5rem;
  border-left: 1px solid var(--border);
  opacity: 0.35;
  transition: opacity 0.2s;
}
.prestige-step:first-child { border-left: none; }
.prestige-step.reached { opacity: 0.7; }
.prestige-step.current { opacity: 1; background: rgba(168,85,247,0.05); border-radius: var(--radius); }
.pstep-badge {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.65rem; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
}
.prestige-step.reached .pstep-badge { border-color: var(--violet); color: var(--violet); background: rgba(168,85,247,0.08); }
.prestige-step.current .pstep-badge { border-color: var(--violet); color: var(--violet); box-shadow: 0 0 8px rgba(168,85,247,0.3); }
.pstep-title { font-size: 0.68rem; font-family: var(--mono); color: var(--text-muted); text-align: center; line-height: 1.2; }
.pstep-xp { font-size: 0.6rem; color: var(--text-muted); font-family: var(--mono); }

/* Profile nav link */
.learn-nav__links a.active { color: var(--text); }

.profile-empty { padding: 2rem; text-align: center; color: var(--text-2); }

/* ── LEADERBOARD ── */
.leaderboard-page { max-width: 900px; margin: 0 auto; padding: 2.5rem 2rem; }

.lb-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  margin-bottom: 2rem; gap: 1rem; flex-wrap: wrap;
}
.lb-title { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; margin-bottom: 4px; }
.lb-sub { color: var(--text-2); font-size: 0.85rem; }

.lb-my-rank {
  display: flex; flex-direction: column; align-items: center;
  background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius); padding: 0.75rem 1.5rem; flex-shrink: 0;
}
.lb-my-rank__label { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.lb-my-rank__val { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--violet); line-height: 1.1; }

.lb-table-wrap { overflow-x: auto; }
.lb-table { width: 100%; border-collapse: collapse; }
.lb-table thead tr { border-bottom: 1px solid var(--border); }
.lb-table th {
  font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.08em;
  padding: 0.6rem 0.75rem; text-align: left; font-weight: 500;
}
.col-rank { width: 60px; text-align: center; }
.col-prestige, .col-xp, .col-lessons { width: 100px; }

.lb-row { border-bottom: 1px solid var(--border); transition: background 0.1s; }
.lb-row:hover { background: var(--bg-card); }
.lb-row.me { background: rgba(168,85,247,0.05); }
.lb-row.me td { border-color: rgba(168,85,247,0.1); }
.lb-row td { padding: 0.8rem 0.75rem; vertical-align: middle; }

/* Medals */
.medal { font-size: 1.1rem; display: block; text-align: center; }
.rank-num { font-family: var(--mono); font-size: 0.85rem; color: var(--text-muted); display: block; text-align: center; }
.top-1 td:first-child .rank-num, .top-2 td:first-child .rank-num, .top-3 td:first-child .rank-num {}

/* User cell */
.lb-user { display: flex; align-items: center; gap: 0.75rem; }
.lb-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 0.85rem; font-weight: 700;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-2);
  flex-shrink: 0;
}
.lb-avatar.p3, .lb-avatar.p4 { border-color: var(--accent-dim); color: var(--accent); }
.lb-avatar.p5, .lb-avatar.p6 { border-color: rgba(168,85,247,0.4); color: var(--violet); }
.lb-avatar.p7, .lb-avatar.p8 { border-color: rgba(245,158,11,0.4); color: #f59e0b; }
.lb-avatar.p9, .lb-avatar.p10 { border-color: rgba(239,68,68,0.4); color: #ef4444; }

.lb-user-info { display: flex; flex-direction: column; gap: 1px; }
.lb-username { font-size: 0.9rem; font-weight: 500; }
.lb-user-title { font-size: 0.7rem; color: var(--text-muted); font-family: var(--mono); }

/* Prestige badge */
.lb-prestige-badge {
  font-family: var(--mono); font-size: 0.72rem; font-weight: 700;
  padding: 2px 8px; border-radius: 3px;
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text-muted);
}
.lb-prestige-badge.p3, .lb-prestige-badge.p4 { color: var(--accent); border-color: var(--accent-dim); background: rgba(0,153,255,0.06); }
.lb-prestige-badge.p5, .lb-prestige-badge.p6 { color: var(--violet); border-color: rgba(168,85,247,0.3); background: rgba(168,85,247,0.06); }
.lb-prestige-badge.p7, .lb-prestige-badge.p8 { color: #f59e0b; border-color: rgba(245,158,11,0.3); background: rgba(245,158,11,0.06); }
.lb-prestige-badge.p9, .lb-prestige-badge.p10 { color: #ef4444; border-color: rgba(239,68,68,0.3); background: rgba(239,68,68,0.06); }

/* XP cell */
.lb-xp { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; display: block; margin-bottom: 4px; }
.lb-xp-bar { height: 2px; background: var(--border); border-radius: 1px; }
.lb-xp-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--violet)); border-radius: 1px; }

.lb-lessons { font-family: var(--mono); font-size: 0.85rem; color: var(--text-2); }
.lb-empty { text-align: center; padding: 3rem; color: var(--text-muted); font-size: 0.875rem; }

/* Pagination */
.lb-pagination { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-top: 1.5rem; }
.lb-page-btn { font-family: var(--mono); font-size: 0.8rem; color: var(--text-2); border: 1px solid var(--border); padding: 5px 12px; border-radius: var(--radius); text-decoration: none; transition: border-color 0.1s; }
.lb-page-btn:hover { border-color: var(--border-active); text-decoration: none; }
.lb-page-info { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); }

/* ── LANDING PAGE ── */
.landing-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 5rem 2rem 4rem;
  border-bottom: 1px solid var(--border);
  gap: 3rem;
  background: radial-gradient(ellipse at 50% 0%, rgba(0,153,255,0.06) 0%, transparent 70%);
}

.landing-tag { color: var(--text) !important;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 20px;
}
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: block; }

.landing-h1 {
  font-family: var(--mono);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.landing-accent { color: var(--accent); }

.landing-sub {
  color: var(--text-2);
  font-size: 1.05rem;
  max-width: 520px;
  line-height: 1.6;
}

.landing-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

.landing-stats {
  display: flex;
  gap: 3rem;
  padding: 1.5rem 2.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.landing-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lstat-val { font-family: var(--mono); font-size: 1.8rem; font-weight: 700; color: var(--text); }
.lstat-label { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }

/* Tracks */
.landing-tracks, .landing-featured, .landing-prestige {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border);
}
.tracks-inner { max-width: 1000px; margin: 0 auto; padding: 0 2rem; }

.landing-section-title {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.tracks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.track-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  transition: border-color 0.15s;
}
.track-card:hover { border-color: var(--border-active); }
.track-icon { font-size: 1.5rem; display: block; margin-bottom: 0.75rem; }
.track-card h3 { font-size: 0.95rem; font-weight: 600; font-family: var(--mono); margin-bottom: 0.5rem; color: var(--accent); }
.track-card p { font-size: 0.82rem; color: var(--text-2); line-height: 1.5; }

/* Featured */
.featured-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.featured-see-all { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); text-decoration: none; }
.featured-see-all:hover { text-decoration: underline; }

.featured-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.featured-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.15s;
}
.featured-card:hover { border-color: var(--border-active); text-decoration: none; }
.featured-card__top { display: flex; justify-content: space-between; }
.featured-card__title { font-size: 0.95rem; font-weight: 600; }
.featured-card__desc { font-size: 0.82rem; color: var(--text-2); flex: 1; }
.featured-card__footer { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); margin-top: auto; }

/* Prestige resume (connected user) */
.prestige-resume {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: rgba(168,85,247,0.05);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius);
}
.prestige-resume__badge {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700; font-size: 0.9rem;
  background: var(--bg); border: 2px solid rgba(168,85,247,0.4);
  color: var(--violet); flex-shrink: 0;
}
.prestige-resume__info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.prestige-resume__title { font-size: 0.875rem; font-weight: 600; color: var(--violet); }

/* Catalogue page */
.catalogue-page { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }
.catalogue-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem; }
.catalogue-title { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; }

.catalogue-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-btn {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 4px 10px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
}
.filter-btn:hover { border-color: var(--border-active); color: var(--text); }
.filter-btn.active { background: rgba(0,153,255,0.08); border-color: var(--accent-dim); color: var(--accent); }

/* ── RESPONSIVE MOBILE ── */
@media (max-width: 768px) {

  /* Nav */
  .learn-nav { padding: 0 1rem; }
  .learn-nav__links { gap: 0.75rem; }
  .learn-nav__links a { font-size: 0.8rem; }

  /* Landing */
  .landing-hero { padding: 3rem 1.25rem 2rem; }
  .landing-h1 { font-size: 1.8rem; }
  .landing-stats { gap: 1.5rem; padding: 1rem 1.5rem; flex-wrap: wrap; justify-content: center; }
  .landing-cta { flex-direction: column; align-items: stretch; }
  .landing-cta a { text-align: center; }
  .tracks-inner { padding: 0 1.25rem; }
  .tracks-grid { grid-template-columns: 1fr; }
  .featured-grid { grid-template-columns: 1fr; }

  /* Catalogue */
  .catalogue-page { padding: 1.5rem 1rem; }
  .catalogue-header { flex-direction: column; align-items: flex-start; }
  .courses-grid { grid-template-columns: 1fr; }

  /* Course layout — stack sidebar below content on mobile */
  .course-layout, .lesson-layout { flex-direction: column; }
  .course-sidebar, .lesson-sidebar {
    width: 100%;
    min-width: unset;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 1rem;
  }
  .sidebar-lessons { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .sidebar-lesson { padding: 4px 8px; font-size: 0.75rem; }
  .course-main, .lesson-content { padding: 1.5rem 1rem; }

  /* Lesson nav */
  .lesson-nav { flex-wrap: wrap; gap: 0.5rem; }
  .lesson-nav__btn { font-size: 0.75rem; padding: 6px 10px; max-width: 100%; white-space: normal; }

  /* Profile */
  .profile-page { padding: 1.5rem 1rem; }
  .profile-hero { flex-direction: column; gap: 1.25rem; }
  .profile-stats-grid { width: 100%; grid-template-columns: repeat(4, 1fr); }
  .progress-courses { grid-template-columns: 1fr; }

  /* Leaderboard */
  .leaderboard-page { padding: 1.5rem 1rem; }
  .lb-header { flex-direction: column; }
  .col-lessons { display: none; }
  .lb-user-title { display: none; }

  /* Challenge block */
  .flag-input-row { flex-wrap: wrap; }
  .flag-input { min-width: 0; width: 100%; border-radius: var(--radius); }
  .flag-prefix { border-right: 1px solid var(--border); border-radius: var(--radius) 0 0 var(--radius); }
  .btn-flag { border-radius: var(--radius); width: 100%; }

  /* Auth */
  .auth-page { padding: 1rem; }
  .auth-box { padding: 1.5rem; }

  /* Prestige roadmap — scroll horizontal */
  .prestige-roadmap { padding-bottom: 1rem; }
  .prestige-step { min-width: 70px; }
}

@media (max-width: 480px) {
  .learn-nav__links .learn-nav__user { max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .landing-stats { flex-direction: column; gap: 1rem; padding: 1rem; }
  .profile-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── VERIFY PAGE ── */
.verify-box {
  width: 100%;
  max-width: 480px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.verify-icon { font-size: 2rem; text-align: center; }
.verify-box h1 { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; text-align: center; }

.token-display {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.token-label { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.token-row { display: flex; align-items: center; gap: 8px; }
.token-value {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  flex: 1;
  word-break: break-all;
}
.token-expires { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); }
.btn-copy-token {
  font-family: var(--mono);
  font-size: 0.72rem;
  background: rgba(0,153,255,0.08);
  border: 1px solid rgba(0,153,255,0.2);
  color: var(--accent);
  padding: 4px 10px;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-copy-token:hover { background: rgba(0,153,255,0.15); }

.verify-steps { display: flex; flex-direction: column; gap: 0.75rem; }
.vstep { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; }
.vstep-num {
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(168,85,247,0.3);
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.vstep-text { color: var(--text-2); }
.vstep-text a { color: var(--accent); }
.vstep-text code { font-family: var(--mono); font-size: 0.85em; color: var(--violet); }

.verify-command {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  margin-left: 2rem;
}
.verify-command code {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--violet);
  flex: 1;
}

/* ── TRACK CATALOGUE ── */
.catalogue-sub { font-size: 0.82rem; color: var(--text-muted); font-family: var(--mono); margin-top: 4px; }

.tracks-catalogue { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 1.5rem; }

.track-cat-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.25rem 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.track-cat-card:hover { border-color: var(--border-active); background: var(--bg-card-hover); text-decoration: none; }

.track-cat-icon { font-size: 2rem; flex-shrink: 0; width: 48px; text-align: center; }
.track-cat-content { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.track-cat-title { font-size: 1rem; font-weight: 600; font-family: var(--mono); }
.track-cat-desc { font-size: 0.82rem; color: var(--text-2); }
.track-cat-meta { font-size: 0.75rem; color: var(--text-muted); font-family: var(--mono); display: flex; gap: 6px; }
.track-pct { color: var(--accent); }
.track-cat-bar { height: 2px; background: var(--border); border-radius: 1px; margin-top: 4px; }
.track-cat-fill { height: 100%; background: var(--accent); border-radius: 1px; transition: width 0.6s; }
.track-cat-arrow { color: var(--text-muted); font-family: var(--mono); font-size: 1rem; flex-shrink: 0; }
.track-cat-card:hover .track-cat-arrow { color: var(--accent); }

/* ── TRACK PAGE ── */
.track-page-header { margin-bottom: 2rem; }
.track-page-hero { display: flex; align-items: center; gap: 1rem; margin-top: 0.75rem; }
.track-page-icon { font-size: 2.5rem; flex-shrink: 0; }
.track-page-title { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; }
.track-page-desc { color: var(--text-2); font-size: 0.875rem; margin-top: 4px; }

@media (max-width: 768px) {
  .track-cat-card { flex-wrap: wrap; }
  .track-cat-arrow { display: none; }
}

/* ── SIDEBAR TRACK ACCORDION ── */
.sidebar-track-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.5rem;
}
.sidebar-track-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  padding: 4px 0;
  transition: color 0.12s;
}
.sidebar-track-name:hover { color: var(--accent); text-decoration: none; }
.sidebar-track-icon { font-size: 1rem; }

.sidebar-track-nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }

.sidebar-course-group { border-radius: 4px; overflow: hidden; }
.sidebar-course-group.current { background: rgba(0,153,255,0.04); border: 1px solid rgba(0,153,255,0.12); }

/* Course title row */
.sidebar-course-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  font-size: 0.8rem;
  border-radius: 4px;
  cursor: pointer;
}
.sidebar-course-title.current {
  color: var(--accent);
  font-weight: 600;
  background: transparent;
}
.sidebar-course-title.other {
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  display: flex;
}
.sidebar-course-title.other:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }

.sct-indicator { font-family: var(--mono); font-size: 0.6rem; color: var(--text-muted); flex-shrink: 0; width: 10px; }
.sidebar-course-title.current .sct-indicator { color: var(--accent); }
.sct-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.sct-progress { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); flex-shrink: 0; }
.sidebar-course-title.current .sct-progress { color: var(--accent); }

/* Expanded lessons */
.sidebar-course-lessons {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 2px 0 6px 16px;
}

/* Lesson type dots */
.lesson-type-dot {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 1px 4px;
  border-radius: 3px;
  flex-shrink: 0;
  margin-left: auto;
}
.lesson-type-dot.lab { background: rgba(168,85,247,0.1); color: var(--violet); border: 1px solid rgba(168,85,247,0.2); }
.lesson-type-dot.chall { background: rgba(251,191,36,0.1); color: var(--amber); }

/* ── CHALLENGES PAGE ── */
.challenges-page { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }
.challenges-header { margin-bottom: 1.25rem; }
.challenges-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 1.5rem; }

.challenges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.875rem;
}

.chall-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.chall-card:hover { border-color: var(--border-active); background: var(--bg-card-hover); text-decoration: none; }
.chall-card.solved { border-color: rgba(168,85,247,0.2); }
.chall-card.solved::after {
  content: '✓';
  position: absolute; top: 10px; right: 10px;
  color: var(--violet); font-family: var(--mono); font-size: 0.75rem;
}

.chall-card__top { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.chall-cat { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); background: rgba(0,153,255,0.08); padding: 2px 7px; border-radius: 3px; border: 1px solid rgba(0,153,255,0.15); }
.chall-unsolved-badge { font-family: var(--mono); font-size: 0.65rem; color: var(--amber); }
.chall-blood { font-family: var(--mono); font-size: 0.65rem; color: var(--red); }

.chall-name { font-size: 0.9rem; font-weight: 600; }

.chall-card__footer { display: flex; align-items: center; gap: 8px; font-size: 0.75rem; font-family: var(--mono); color: var(--text-muted); margin-top: auto; }
.chall-xp { color: var(--accent); }
.chall-solved-mark { color: var(--violet); margin-left: auto; }

.chall-blood-tip {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--red);
  background: rgba(255,77,109,0.06);
  border: 1px solid rgba(255,77,109,0.15);
  padding: 2px 8px;
  border-radius: 3px;
  width: fit-content;
}

/* ── CHALLENGE DETAIL ── */
.challenge-detail-page { max-width: 900px; margin: 0 auto; padding: 2.5rem 2rem; }
.challenge-detail-header { margin-bottom: 2rem; }
.cdh-inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 1.5rem; flex-wrap: wrap; margin-top: 0.75rem; }
.cdh-title { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; margin: 0.4rem 0; }
.cdh-meta { font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }

.cdh-xp-box { display: flex; flex-direction: column; gap: 4px; align-items: flex-end; flex-shrink: 0; }
.xp-reward-base { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.xp-reward-blood { font-family: var(--mono); font-size: 0.8rem; color: var(--red); }
.solved-banner { font-family: var(--mono); font-size: 0.9rem; color: var(--violet); background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2); padding: 6px 14px; border-radius: var(--radius); }

.challenge-detail-body .challenge-block { max-width: 100%; }

@media (max-width: 768px) {
  .challenges-page, .challenge-detail-page { padding: 1.5rem 1rem; }
  .challenges-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .challenges-grid { grid-template-columns: 1fr; }
}

/* ── CELEBRATE OVERLAY ── */
.celebrate-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 9999;
  opacity: 0; transition: opacity 0.3s;
  cursor: pointer;
}
.celebrate-overlay.celebrate-show { opacity: 1; }

.celebrate-box {
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: 12px;
  padding: 2.5rem 3rem;
  text-align: center;
  display: flex; flex-direction: column; gap: 0.75rem;
  transform: scale(0.85);
  transition: transform 0.3s;
  max-width: 360px;
}
.celebrate-overlay.celebrate-show .celebrate-box { transform: scale(1); }
.celebrate-box.first-blood { border-color: var(--red); background: rgba(255,77,109,0.06); }

.celebrate-icon { font-size: 3rem; }
.celebrate-title {
  font-family: var(--mono);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--violet);
}
.celebrate-box.first-blood .celebrate-title { color: var(--red); }
.celebrate-xp {
  font-family: var(--mono);
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
}
.celebrate-sub { font-size: 0.85rem; color: var(--text-2); }

/* ── CHALLENGES PAGE REDESIGN ── */
.challenges-page { max-width: 1100px; margin: 0 auto; padding: 2.5rem 2rem; }

.challenges-page-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1.5rem; gap: 1rem; flex-wrap: wrap; }

.chall-user-stats { display: flex; align-items: center; gap: 8px; font-family: var(--mono); }
.cus-val { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.cus-sep { color: var(--text-muted); }
.cus-total { font-size: 1rem; color: var(--text-muted); }
.cus-label { font-size: 0.72rem; color: var(--text-muted); }
.cus-bar { width: 80px; height: 3px; background: var(--border); border-radius: 2px; }
.cus-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s; }

.challenges-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 2rem; }
.filter-sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

.chall-category-group { margin-bottom: 2.5rem; }
.chall-cat-label { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }

/* Cards redesign */
.chall-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.12s, background 0.12s;
}
.chall-card:hover { border-color: var(--border-active); background: var(--bg-card-hover); text-decoration: none; }
.chall-card.solved { border-left: 2px solid var(--violet); }

.chall-card__top { display: flex; gap: 6px; flex-wrap: wrap; min-height: 20px; }
.chall-solved-pill { font-family: var(--mono); font-size: 0.65rem; color: var(--violet); background: rgba(168,85,247,0.08); padding: 2px 7px; border-radius: 10px; border: 1px solid rgba(168,85,247,0.2); }
.chall-virgin-pill { font-family: var(--mono); font-size: 0.65rem; color: var(--accent); background: rgba(0,153,255,0.06); padding: 2px 7px; border-radius: 10px; border: 1px solid rgba(0,153,255,0.15); }
.chall-blood-pill { font-family: var(--mono); font-size: 0.65rem; color: var(--red); }
.chall-card__footer { display: flex; justify-content: space-between; align-items: center; font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); margin-top: auto; }
.chall-xp { color: var(--accent); }
.chall-fb-bonus { color: var(--red); font-size: 0.68rem; }
.chall-solves {}

/* ── CHALLENGE DETAIL LAYOUT ── */
.chall-detail-layout { display: flex; min-height: calc(100vh - 52px); }

.chall-sidebar {
  width: 260px; min-width: 260px;
  border-right: 1px solid var(--border);
  padding: 1.25rem 0.75rem;
  position: sticky; top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 0.75rem;
}
.chall-sidebar-header { padding-bottom: 0.75rem; border-bottom: 1px solid var(--border); }

.chall-sidebar-nav { display: flex; flex-direction: column; gap: 1rem; }
.chall-sidebar-cat { display: flex; flex-direction: column; gap: 1px; }
.chall-sidebar-cat-label { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; padding: 4px 6px; }

.chall-sidebar-item {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 7px; border-radius: 4px;
  font-size: 0.8rem; color: var(--text-2);
  text-decoration: none; transition: background 0.1s, color 0.1s;
}
.chall-sidebar-item:hover { background: var(--bg-card); color: var(--text); text-decoration: none; }
.chall-sidebar-item.active { background: rgba(0,153,255,0.08); color: var(--accent); border-left: 2px solid var(--accent); padding-left: 5px; }
.chall-sidebar-item.solved .csi-check { color: var(--violet); }
.csi-check { font-family: var(--mono); font-size: 0.7rem; width: 12px; flex-shrink: 0; color: var(--text-muted); }
.csi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csi-badge { font-family: var(--mono); font-size: 0.6rem; padding: 1px 4px; border-radius: 3px; }
.csi-badge.virgin { color: var(--accent); background: rgba(0,153,255,0.08); }
.csi-badge.blood { }

/* Detail main */
.chall-detail-main { flex: 1; padding: 2rem 2.5rem; display: flex; flex-direction: column; gap: 1.5rem; }

.chall-detail-hero { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.cdh-left { display: flex; flex-direction: column; gap: 4px; }
.cdh-title { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; }
.cdh-meta { display: flex; align-items: center; gap: 6px; font-family: var(--mono); font-size: 0.78rem; color: var(--text-muted); flex-wrap: wrap; }
.cdh-dot { color: var(--border-active); }
.cdh-blood { color: var(--red); }
.cdh-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.cdh-solved-tag { font-family: var(--mono); font-size: 0.85rem; color: var(--violet); background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2); padding: 6px 14px; border-radius: var(--radius); }
.cdh-xp-stack { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.cdh-xp-main { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--accent); }
.cdh-xp-blood { font-family: var(--mono); font-size: 0.78rem; color: var(--red); }

.chall-nav-buttons { display: flex; justify-content: space-between; padding-top: 1.5rem; border-top: 1px solid var(--border); margin-top: auto; }

/* ── CELEBRATE OVERLAY FIX ── */
.celebrate-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.75);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.celebrate-overlay.celebrate-show { opacity: 1; pointer-events: all; }
.celebrate-box {
  background: var(--bg-card);
  border: 2px solid var(--violet);
  border-radius: 12px;
  padding: 3rem 4rem;
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 0.75rem;
  transform: scale(0.8);
  transition: transform 0.25s;
}
.celebrate-overlay.celebrate-show .celebrate-box { transform: scale(1); }
.celebrate-box.first-blood { border-color: var(--red); }
.celebrate-icon { font-size: 4rem; line-height: 1; }
.celebrate-title { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--violet); }
.celebrate-box.first-blood .celebrate-title { color: var(--red); }
.celebrate-xp { font-family: var(--mono); font-size: 2.5rem; font-weight: 700; color: var(--accent); }
.celebrate-sub { font-size: 0.875rem; color: var(--text-2); }
.celebrate-hint { font-size: 0.72rem; color: var(--text-muted); font-family: var(--mono); margin-top: 0.5rem; }

@media (max-width: 768px) {
  .chall-detail-layout { flex-direction: column; }
  .chall-sidebar { width: 100%; min-width: unset; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border); }
  .chall-sidebar-nav { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
  .chall-sidebar-cat { flex-direction: row; flex-wrap: wrap; gap: 4px; }
  .chall-sidebar-cat-label { width: 100%; }
  .chall-detail-main { padding: 1.5rem 1rem; }
}

/* ── CHALLENGE DETAIL PAGE v2 ── */
.cdp-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 52px);
}

/* Hero */
.cdp-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 2.5rem 3rem 2rem;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(0,153,255,0.03) 0%, transparent 100%);
  gap: 2rem;
  flex-wrap: wrap;
}
.cdp-hero-left { display: flex; flex-direction: column; gap: 8px; }
.cdp-cat-tag {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  background: rgba(0,153,255,0.08);
  border: 1px solid rgba(0,153,255,0.2);
  padding: 2px 10px;
  border-radius: 3px;
  width: fit-content;
}
.cdp-title { font-family: var(--mono); font-size: 2rem; font-weight: 700; letter-spacing: -0.02em; }
.cdp-meta-row { display: flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 0.78rem; }
.cdp-meta-item { color: var(--text-muted); }
.cdp-meta-item.accent { color: var(--accent); }
.cdp-meta-item.blood { color: var(--red); }
.cdp-meta-sep { color: var(--border-active); }

.cdp-hero-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; padding-top: 4px; }
.cdp-solved-pill {
  font-family: var(--mono); font-size: 0.9rem;
  color: var(--violet);
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.2);
  padding: 8px 20px; border-radius: var(--radius);
}
.cdp-xp-display { display: flex; align-items: baseline; gap: 4px; }
.cdp-xp-num { font-family: var(--mono); font-size: 2.2rem; font-weight: 700; color: var(--accent); line-height: 1; }
.cdp-xp-unit { font-family: var(--mono); font-size: 0.9rem; color: var(--accent); }
.cdp-blood-bonus { font-family: var(--mono); font-size: 0.78rem; color: var(--red); }

/* Body */
.cdp-body { display: flex; flex-direction: column; gap: 0; flex: 1; }
.cdp-section {
  padding: 2rem 3rem;
  border-bottom: 1px solid var(--border);
}

/* Description */
.cdp-desc {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--text-2);
  max-width: 680px;
}
.cdp-desc br { display: block; content: ""; margin-bottom: 0.4rem; }

/* Lab card */
.cdp-lab-card {
  background: rgba(168,85,247,0.04);
  border: 1px solid rgba(168,85,247,0.15);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 560px;
}
.cdp-lab-header { display: flex; align-items: center; gap: 0.75rem; }
.cdp-lab-icon { font-size: 1.5rem; }
.cdp-lab-title { display: block; font-weight: 600; font-size: 0.9rem; }
.cdp-lab-sub { display: block; font-size: 0.78rem; color: var(--text-muted); font-family: var(--mono); }
.cdp-spawn-btn {
  background: var(--violet);
  color: #0a0a0c;
  border: none;
  padding: 10px 24px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--sans);
  width: fit-content;
  transition: opacity 0.15s;
}
.cdp-spawn-btn:hover { opacity: 0.85; }
.cdp-spawn-btn:disabled { opacity: 0.4; cursor: default; }
.cdp-access-row { display: flex; flex-direction: column; gap: 6px; }
.cdp-access-label { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.cdp-stop-btn { background: transparent; border: 1px solid rgba(255,77,109,0.3); color: var(--red); padding: 5px 12px; border-radius: var(--radius); font-size: 0.78rem; cursor: pointer; font-family: var(--sans); width: fit-content; }

/* Flag section */
.cdp-flag-section { background: rgba(0,153,255,0.02); }
.cdp-flag-label { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 0.75rem; }
.cdp-flag-row { display: flex; gap: 0; max-width: 560px; }
.cdp-flag-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border);
  border-right: none;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 12px 16px;
  border-radius: var(--radius) 0 0 var(--radius);
  outline: none;
  transition: border-color 0.15s;
}
.cdp-flag-input:focus { border-color: var(--accent-dim); }
.cdp-flag-input.flag-error { border-color: var(--red); animation: shake 0.3s ease; }
.cdp-flag-btn {
  background: var(--accent);
  color: #0a0a0c;
  border: none;
  padding: 12px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--sans);
  white-space: nowrap;
  transition: background 0.15s;
}
.cdp-flag-btn:hover { background: #33adff; }
.cdp-flag-btn:disabled { opacity: 0.5; cursor: default; }

/* Solved banner */
.cdp-solved-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem 3rem;
  color: var(--violet);
  font-family: var(--mono);
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}

/* Login prompt */
.cdp-login-prompt { padding: 2rem 3rem; border-bottom: 1px solid var(--border); }

/* Nav */
.cdp-nav {
  display: flex;
  justify-content: space-between;
  padding: 1.5rem 3rem;
  margin-top: auto;
}
.cdp-nav-btn { display: flex; flex-direction: column; gap: 2px; text-decoration: none; }
.cdp-nav-btn.right { align-items: flex-end; }
.cdp-nav-btn:hover { text-decoration: none; }
.cdp-nav-dir { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.cdp-nav-name { font-size: 0.875rem; color: var(--text-2); transition: color 0.12s; }
.cdp-nav-btn:hover .cdp-nav-name { color: var(--text); }

@media (max-width: 768px) {
  .cdp-hero, .cdp-section, .cdp-solved-banner, .cdp-login-prompt, .cdp-nav { padding-left: 1.25rem; padding-right: 1.25rem; }
  .cdp-title { font-size: 1.5rem; }
  .cdp-xp-num { font-size: 1.6rem; }
}

/* ── CHALLENGES PAGE v3 ── */
.challenges-page { max-width: 1100px; margin: 0 auto; padding: 3rem 2rem; }

.chp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 1rem;
}
.chp-title { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; margin-bottom: 4px; }
.chp-sub { font-size: 0.85rem; color: var(--text-muted); }

.chp-progress { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.chp-prog-nums { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; color: var(--text); line-height: 1; }
.chp-prog-sep { color: var(--text-muted); font-weight: 400; margin: 0 2px; font-size: 1rem; }
.chp-prog-label { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.1em; }
.chp-prog-bar { width: 120px; height: 2px; background: var(--border); border-radius: 1px; }
.chp-prog-fill { height: 100%; background: var(--accent); border-radius: 1px; transition: width 0.6s; }

.chp-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chp-filter-group { display: flex; gap: 4px; }

.chp-cat-section { margin-bottom: 3rem; }
.chp-cat-name {
  font-family: var(--mono);
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.chp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 900px;
}

.chp-card {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background 0.12s;
  position: relative;
}
.chp-card:hover { background: var(--bg-card-hover); text-decoration: none; }
.chp-card.solved { background: rgba(168,85,247,0.03); }
.chp-card.solved::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--violet);
}

.chp-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.chp-card-name { font-size: 0.95rem; font-weight: 600; line-height: 1.3; }
.chp-card-badge { font-family: var(--mono); font-size: 0.65rem; padding: 2px 7px; border-radius: 3px; flex-shrink: 0; }
.chp-card-badge.solved-badge { color: var(--violet); background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2); }

.chp-card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.75rem;
}
.chp-card-xp { color: var(--accent); font-weight: 600; }
.chp-card-solves { color: var(--text-muted); }

@media (max-width: 768px) {
  .challenges-page { padding: 1.5rem 1rem; }
  .chp-grid { grid-template-columns: 1fr; }
}

/* ── PROFILE HERO v2 ── */
.profile-hero-v2 {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 2.5rem 2rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.phv2-avatar-ring {
  width: 64px; height: 64px; border-radius: 50%;
  border: 2px solid var(--border-active);
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-card);
  flex-shrink: 0;
}
.prestige-ring-3, .prestige-ring-4 { border-color: var(--accent); }
.prestige-ring-5, .prestige-ring-6 { border-color: var(--violet); }
.prestige-ring-7, .prestige-ring-8 { border-color: #f59e0b; }
.prestige-ring-9, .prestige-ring-10 { border-color: #ef4444; }
.phv2-initial { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--text); }

.phv2-info { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 0.75rem; }
.phv2-top { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.phv2-name { font-family: var(--mono); font-size: 1.4rem; font-weight: 700; }
.phv2-prestige-badge {
  font-family: var(--mono); font-size: 0.72rem;
  color: var(--accent);
  background: rgba(0,153,255,0.08);
  border: 1px solid rgba(0,153,255,0.2);
  padding: 3px 10px; border-radius: 20px;
}

.phv2-xp-row { display: flex; align-items: center; gap: 0.75rem; }
.phv2-xp-bar { flex: 1; max-width: 260px; height: 4px; background: var(--border); border-radius: 2px; }
.phv2-xp-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.8s ease; }
.phv2-xp-label { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

.phv2-stats {
  display: flex; align-items: center; gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-left: auto;
  flex-shrink: 0;
}
.phv2-stat { display: flex; flex-direction: column; align-items: center; padding: 0.875rem 1.25rem; gap: 2px; }
.phv2-stat-val { font-family: var(--mono); font-size: 1.3rem; font-weight: 700; }
.phv2-stat-key { font-family: var(--mono); font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.phv2-stat-sep { width: 1px; height: 40px; background: var(--border); }

/* ── CATALOGUE v2 ── */
.cat-tracks { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }

.cat-track-row {
  display: flex; align-items: center; gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: var(--bg-card);
  text-decoration: none; color: var(--text);
  transition: background 0.12s;
}
.cat-track-row:hover { background: var(--bg-card-hover); text-decoration: none; }
.cat-track-row.done { border-left: 2px solid var(--violet); }

.ctr-left { display: flex; align-items: center; gap: 1.25rem; flex: 1; min-width: 0; }
.ctr-icon { font-size: 1.5rem; flex-shrink: 0; width: 36px; text-align: center; }
.ctr-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ctr-title { font-size: 0.95rem; font-weight: 600; }
.ctr-desc { font-size: 0.8rem; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 400px; }

.ctr-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; min-width: 160px; }
.ctr-meta { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); display: flex; gap: 6px; }
.ctr-dot { color: var(--border-active); }
.ctr-progress { display: flex; align-items: center; gap: 8px; }
.ctr-prog-bar { width: 100px; height: 3px; background: var(--border); border-radius: 2px; }
.ctr-prog-fill { height: 100%; background: var(--accent); border-radius: 2px; }
.ctr-pct { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); }

.ctr-arrow { color: var(--text-muted); font-size: 1.2rem; flex-shrink: 0; transition: color 0.12s; }
.cat-track-row:hover .ctr-arrow { color: var(--accent); }

@media (max-width: 768px) {
  .cat-track-row { flex-wrap: wrap; padding: 1.25rem; }
  .ctr-right { min-width: unset; }
  .ctr-desc { max-width: 220px; }
}

/* ── NAV AVATAR + DROPDOWN ── */
.nav-avatar-wrap { position: relative; }
.nav-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(0,153,255,0.15);
  border: 1.5px solid var(--accent-dim);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.nav-avatar:hover { background: rgba(0,153,255,0.25); border-color: var(--accent); }

.nav-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border-active);
  border-radius: var(--radius);
  min-width: 200px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.nav-dropdown.open { display: flex; }

.nav-dropdown-header {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 2px;
}
.nav-dd-name { font-size: 0.875rem; font-weight: 600; }
.nav-dd-prestige { font-family: var(--mono); font-size: 0.7rem; color: var(--accent); }

.nav-dd-item {
  padding: 0.6rem 1rem;
  font-size: 0.85rem;
  color: var(--text-2);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.nav-dd-item:hover { background: rgba(255,255,255,0.04); color: var(--text); text-decoration: none; }
.nav-dd-logout { color: var(--red); }
.nav-dd-logout:hover { background: rgba(255,77,109,0.06); }

/* ── CHALLENGES CARD TYPE ── */
.chp-card-type { font-family: var(--mono); font-size: 0.7rem; color: var(--text-muted); }
.chp-card { min-height: 110px; }

/* ── ADMIN GEAR LINK ── */
.admin-gear-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-decoration: none;
  opacity: 0.6;
  transition: opacity 0.15s, color 0.15s;
  margin-left: 2px;
}
.admin-gear-link:hover { opacity: 1; color: var(--accent); text-decoration: none; }

.nav-dd-admin { color: var(--accent) !important; }
.nav-dd-admin:hover { background: rgba(0,153,255,0.08) !important; }
.nav-dd-sep { height: 1px; background: var(--border); margin: 4px 0; }

/* ── LANDING FIXES ── */
.landing-cta { margin-top: 2.5rem; }
.btn-secondary { color: var(--text) !important; }
.landing-section-title { color: var(--text) !important; }

.landing-cta .btn-primary,
.landing-cta .btn-secondary {
  padding: 12px 28px;
  font-size: 0.95rem;
}

/* ── LANDING PAGE REFONTE ── */

/* Hero */
.lp-hero {
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5rem 2rem 3rem;
  background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(0,153,255,0.07) 0%, transparent 70%);
  border-bottom: 1px solid var(--border);
}

.lp-hero-inner { max-width: 700px; display: flex; flex-direction: column; align-items: center; gap: 1.25rem; }

.lp-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  padding: 5px 14px;
  border-radius: 20px;
}

.lp-h1 {
  font-family: var(--mono);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}
.lp-h1-accent { color: var(--accent); }

.lp-sub {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.7;
  max-width: 540px;
}

.lp-cta { display: flex; gap: 0.75rem; margin-top: 0.75rem; flex-wrap: wrap; justify-content: center; }

.lp-btn-main {
  display: inline-flex; align-items: center;
  background: var(--accent);
  color: #0a0a0c !important;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s;
}
.lp-btn-main:hover { background: #33adff; text-decoration: none; }

.lp-btn-outline {
  display: inline-flex; align-items: center;
  border: 1px solid var(--border-active);
  color: var(--text) !important;
  font-size: 0.95rem;
  padding: 12px 28px;
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.15s;
}
.lp-btn-outline:hover { border-color: var(--accent-dim); text-decoration: none; }

/* Stats bar */
.lp-stats-bar {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 3.5rem;
  padding: 1.25rem 2.5rem;
  background:
    radial-gradient(ellipse 90% 120% at 50% 150%, rgba(0,153,255,0.35) 0%, transparent 65%),
    var(--bg-card);
  border: 1px solid rgba(0,153,255,0.2);
  border-radius: var(--radius);
}
.lp-stat { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.lp-stat-n { font-family: var(--mono); font-size: 1.6rem; font-weight: 700; color: var(--text); }
.lp-stat-l { font-family: var(--mono); font-size: 0.68rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.lp-stat-sep { width: 1px; height: 36px; background: var(--border); }

/* Sections */
.lp-section { padding: 5rem 0; border-bottom: 1px solid var(--border); }
.lp-section-alt { background: rgba(255,255,255,0.01); }
.lp-container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

.lp-section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 2.5rem;
}
.lp-section-title { font-family: var(--mono); font-size: 1.1rem; font-weight: 700; color: var(--text); }
.lp-section-sub { font-size: 0.85rem; color: var(--text-2); margin-top: 4px; }
.lp-see-all { font-family: var(--mono); font-size: 0.78rem; color: var(--accent); text-decoration: none; }
.lp-see-all:hover { text-decoration: underline; }

/* Tracks grid */
.lp-tracks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.lp-track {
  background: var(--bg-card);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: background 0.15s;
}
.lp-track:hover { background: var(--bg-card-hover); }
.lp-track-icon { font-size: 1.4rem; }
.lp-track h3 { font-family: var(--mono); font-size: 0.88rem; font-weight: 600; color: var(--text); }
.lp-track p { font-size: 0.8rem; color: var(--text-2); line-height: 1.5; flex: 1; }
.lp-track-tag { font-family: var(--mono); font-size: 0.65rem; color: var(--text-muted); margin-top: auto; }

/* Courses grid */
.lp-courses {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}
.lp-course-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--text);
  display: flex; flex-direction: column; gap: 0.6rem;
  transition: border-color 0.15s;
}
.lp-course-card:hover { border-color: var(--border-active); text-decoration: none; }
.lp-course-top { display: flex; justify-content: space-between; align-items: center; }
.lp-course-cat { font-family: var(--mono); font-size: 0.68rem; color: var(--accent); background: rgba(0,153,255,0.08); padding: 2px 7px; border-radius: 3px; }
.lp-course-diff { font-family: var(--mono); font-size: 0.68rem; }
.lp-course-diff.beginner { color: var(--green); }
.lp-course-diff.intermediate { color: var(--amber); }
.lp-course-diff.advanced { color: var(--red); }
.lp-course-title { font-size: 0.95rem; font-weight: 600; font-family: var(--mono); }
.lp-course-desc { font-size: 0.82rem; color: var(--text-2); flex: 1; }
.lp-course-footer { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); margin-top: auto; }

/* Resume (logged in) */
.lp-resume {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 2rem;
  background: rgba(0,153,255,0.04);
  border: 1px solid rgba(0,153,255,0.15);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.lp-resume-badge {
  width: 52px; height: 52px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-weight: 700;
  background: rgba(0,153,255,0.08);
  border: 2px solid var(--accent-dim);
  color: var(--accent); flex-shrink: 0;
}
.lp-resume-info { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.lp-resume-title { font-family: var(--mono); font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.lp-resume-bar { height: 3px; background: var(--border); border-radius: 2px; }
.lp-resume-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.6s; }
.lp-resume-xp { font-family: var(--mono); font-size: 0.72rem; color: var(--text-muted); }

/* Join CTA */
.lp-join {
  text-align: center;
  padding: 3rem 2rem;
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.lp-join h2 { font-family: var(--mono); font-size: 1.5rem; font-weight: 700; }
.lp-join p { color: var(--text-2); font-size: 0.9rem; }

@media (max-width: 768px) {
  .lp-hero { min-height: 70vh; padding: 4rem 1.5rem 2.5rem; }
  .lp-h1 { font-size: 2.2rem; }
  .lp-tracks { grid-template-columns: 1fr 1fr; }
  .lp-stats-bar { gap: 1.25rem; padding: 1rem 1.5rem; }
  .lp-section { padding: 3rem 0; }
}

/* ── ENTRY CARDS (hero) ── */
.lp-entry-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  width: 100%;
  max-width: 680px;
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.lp-entry-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 1.25rem 1.1rem 1.1rem;
  background: var(--bg-card);
  text-decoration: none;
  color: var(--text);
  border-right: 1px solid var(--border);
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
}
.lp-entry-card:last-child { border-right: none; }
.lp-entry-card:not(.lp-entry-card--soon):hover { background: var(--bg-card-hover); text-decoration: none; }
.lp-entry-card--soon { opacity: 0.45; cursor: default; }

.lp-entry-accent {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
}

.lp-entry-title {
  font-family: var(--mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}
.lp-entry-desc {
  font-size: 0.75rem;
  color: var(--text-2);
  line-height: 1.45;
}
.lp-entry-meta {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent);
  margin-top: 4px;
}

.lp-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #5865F2;
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 20px;
  border-radius: var(--radius);
  text-decoration: none;
  margin-top: 1.25rem;
  transition: background 0.15s;
}
.lp-discord-btn:hover { background: #4752c4; text-decoration: none; color: #fff !important; }

.lp-register-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 1rem;
}
.lp-register-hint a { color: var(--accent); }

@media (max-width: 560px) {
  .lp-entry-cards { grid-template-columns: 1fr; }
  .lp-entry-card { border-right: none; border-bottom: 1px solid var(--border); }
  .lp-entry-card:last-child { border-bottom: none; }
}

@media (max-width: 640px) {
  .lp-entry-cards { grid-template-columns: 1fr; }
  .lp-entry-card { border-right: none; border-bottom: 1px solid var(--border); }
  .lp-entry-card:last-child { border-bottom: none; }
}

.lp-discord-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #5865F2;
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.15s;
}
.lp-discord-btn:hover { background: #4752c4; text-decoration: none; color: #fff !important; }



/* discord btn fix — margin reset since now above cards */
.lp-discord-btn { margin-top: 0; margin-bottom: 0; padding: 11px 24px; font-size: 0.9rem; }



/* ── QUIZ SECTION ── */
.quiz-section {
  margin: 2.5rem 0;
  border: 1px solid rgba(0,153,255,0.2);
  border-radius: var(--radius);
  overflow: hidden;
}

.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.25rem;
  background: rgba(0,153,255,0.06);
  border-bottom: 1px solid rgba(0,153,255,0.15);
}
.quiz-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.quiz-counter {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Quiz question */
.quiz-question-block { padding: 1.5rem 1.25rem; }
.quiz-progress {
  display: flex;
  gap: 4px;
  margin-bottom: 1rem;
}
.quiz-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.quiz-dot.done { background: var(--violet); }
.quiz-dot.current { background: var(--accent); }

.quiz-q-text {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 1.25rem;
  color: var(--text);
}

/* MCQ options */
.quiz-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 1.25rem; }
.quiz-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  text-align: left;
  width: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: 0.875rem;
  line-height: 1.4;
}
.quiz-option:hover:not(:disabled) { border-color: var(--border-active); background: var(--bg-card-hover); }
.quiz-option.selected { border-color: var(--accent-dim); background: rgba(0,153,255,0.06); }
.quiz-option.correct { border-color: var(--violet); background: rgba(168,85,247,0.08); }
.quiz-option.wrong { border-color: var(--red); background: rgba(255,77,109,0.06); }
.quiz-option:disabled { cursor: default; opacity: 0.7; }
.quiz-option-letter {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 18px;
  margin-top: 1px;
}
.quiz-option.selected .quiz-option-letter { color: var(--accent); }
.quiz-option.correct .quiz-option-letter { color: var(--violet); }

/* Text input question */
.quiz-text-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.875rem;
  padding: 10px 12px;
  outline: none;
  margin-bottom: 1.25rem;
  transition: border-color 0.15s;
}
.quiz-text-input:focus { border-color: var(--accent-dim); }
.quiz-text-input.correct { border-color: var(--violet); }
.quiz-text-input.wrong { border-color: var(--red); }

/* Submit button */
.quiz-submit {
  background: var(--accent);
  color: #0a0a0c;
  border: none;
  padding: 8px 20px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: background 0.15s;
}
.quiz-submit:hover:not(:disabled) { background: #33adff; }
.quiz-submit:disabled { opacity: 0.5; cursor: default; }

/* Feedback */
.quiz-feedback {
  margin-top: 1rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  line-height: 1.5;
  display: none;
}
.quiz-feedback.correct { background: rgba(168,85,247,0.08); border: 1px solid rgba(168,85,247,0.2); color: var(--text); }
.quiz-feedback.wrong { background: rgba(255,77,109,0.06); border: 1px solid rgba(255,77,109,0.2); color: var(--text); }
.quiz-feedback-label { font-family: var(--mono); font-size: 0.72rem; font-weight: 700; margin-bottom: 4px; display: block; }
.quiz-feedback.correct .quiz-feedback-label { color: var(--violet); }
.quiz-feedback.wrong .quiz-feedback-label { color: var(--red); }

.quiz-next-btn {
  margin-top: 0.875rem;
  background: transparent;
  border: 1px solid var(--border-active);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius);
  font-size: 0.82rem;
  cursor: pointer;
  font-family: var(--sans);
  transition: border-color 0.12s, color 0.12s;
  display: none;
}
.quiz-next-btn:hover { border-color: var(--accent-dim); color: var(--text); }

/* Complete message */
.quiz-complete-msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 1rem 1.25rem;
  background: rgba(168,85,247,0.06);
  border-top: 1px solid rgba(168,85,247,0.15);
  font-size: 0.875rem;
  color: var(--text-2);
}
.quiz-complete-icon { color: var(--violet); font-size: 1rem; }

/* Lesson header row */
.lesson-header-row { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; }
.lesson-type-pill {
  font-family: var(--mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 10px;
}
.lesson-type-pill.theory { background: rgba(0,153,255,0.08); color: var(--accent); border: 1px solid rgba(0,153,255,0.2); }
.lesson-type-pill.practical { background: rgba(168,85,247,0.08); color: var(--violet); border: 1px solid rgba(168,85,247,0.2); }
.lesson-type-pill.challenge { background: rgba(251,191,36,0.08); color: var(--amber); border: 1px solid rgba(251,191,36,0.2); }

/* ── QUIZ CHECKPOINT ──────────────────────────────────────── */

/* Sidebar: quiz checkpoint item */
.sidebar-lesson.quiz-checkpoint {
  border-left: 2px solid var(--amber);
  background: rgba(251,191,36,0.04);
}
.sidebar-lesson.quiz-checkpoint .lesson-type-dot.quiz-dot-pill {
  background: rgba(251,191,36,0.12);
  color: var(--amber);
  border: 1px solid rgba(251,191,36,0.25);
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
}
.sidebar-lesson.quiz-checkpoint.completed {
  border-left-color: var(--violet);
  background: rgba(168,85,247,0.04);
}

/* Covered lessons bar */
.qcp-covers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
}
.qcp-covers-label {
  color: var(--text2);
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  flex-shrink: 0;
}
.qcp-covers-item {
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text2);
  text-decoration: none;
  transition: color 0.12s, border-color 0.12s;
  font-size: 0.78rem;
}
.qcp-covers-item:hover { color: var(--text); border-color: var(--border-active); }
.qcp-covers-item.done { color: var(--violet); border-color: rgba(168,85,247,0.25); background: rgba(168,85,247,0.06); }

/* Quiz checkpoint section — larger, more prominent */
.quiz-section--checkpoint {
  margin-top: 0;
  border-top: none;
}
.quiz-section--checkpoint .quiz-header {
  padding: 1rem 1.25rem 0.75rem;
}
.quiz-section--checkpoint .quiz-question-block {
  padding: 1.25rem;
}

/* Image in quiz question */
.quiz-q-image {
  display: block;
  max-width: 100%;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-bottom: 1rem;
  background: var(--surface2);
}

/* Locked quiz wall */
.quiz-locked-wall {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 0.75rem;
}
.qlw-icon { font-size: 2.5rem; }
.qlw-title { font-size: 1.2rem; font-weight: 600; color: var(--text); }
.qlw-desc { color: var(--text2); font-size: 0.9rem; }
.qlw-list {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.qlw-list li a {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.875rem;
}
.qlw-list li a:hover { text-decoration: underline; }

/* After-quiz continue button */
.btn-next-after-quiz {
  margin-left: auto;
  padding: 6px 18px;
  background: var(--accent);
  color: #0a0a0c;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.12s;
}
.btn-next-after-quiz:hover { background: #33adff; }

/* Lesson type pill — quiz */
.lesson-type-pill.quiz {
  background: rgba(251,191,36,0.08);
  color: var(--amber);
  border: 1px solid rgba(251,191,36,0.2);
}

/* ── Lesson type dots in sidebar ──────────────────────────── */
.lesson-type-dot {
  font-family: var(--mono);
  font-size: 0.6rem;
  padding: 1px 6px;
  border-radius: 8px;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.lesson-type-dot.theory-dot {
  background: rgba(0,153,255,0.08);
  color: var(--accent);
  border: 1px solid rgba(0,153,255,0.2);
}
/* .lab already exists but let's be explicit */
.lesson-type-dot.lab {
  background: rgba(168,85,247,0.08);
  color: var(--violet);
  border: 1px solid rgba(168,85,247,0.2);
}

/* ── Lesson type in course lesson list ────────────────────── */
.lesson-item__type {
  font-family: var(--mono);
  font-size: 0.62rem;
  padding: 1px 7px;
  border-radius: 8px;
  flex-shrink: 0;
  white-space: nowrap;
}
.lesson-item__type--theory    { background: rgba(0,153,255,0.08);   color: var(--accent); border: 1px solid rgba(0,153,255,0.2); }
.lesson-item__type--practical { background: rgba(168,85,247,0.08);  color: var(--violet); border: 1px solid rgba(168,85,247,0.2); }
.lesson-item__type--challenge { background: rgba(251,191,36,0.08);  color: var(--amber);  border: 1px solid rgba(251,191,36,0.2); }
.lesson-item__type--quiz      { background: rgba(251,191,36,0.06);  color: var(--amber);  border: 1px solid rgba(251,191,36,0.15); }

/* ── HIGHLIGHT.JS OVERRIDES (VSCode Dark+) ───────────────── */
.prose pre {
  padding: 0 !important;
  background: #1e1e1e !important;
  border-color: #333 !important;
}
.prose pre code.hljs {
  padding: 1.1rem 1.25rem;
  font-size: 0.82rem;
  line-height: 1.6;
  border-radius: var(--radius);
  background: #1e1e1e;
}
/* Language label top-right */
.prose pre {
  position: relative;
}
.hljs-keyword  { color: #569cd6; }
.hljs-built_in { color: #4ec9b0; }
.hljs-string   { color: #ce9178; }
.hljs-comment  { color: #6a9955; font-style: italic; }
.hljs-number   { color: #b5cea8; }
.hljs-operator { color: #d4d4d4; }
.hljs-variable { color: #9cdcfe; }
.hljs-title    { color: #dcdcaa; }
.hljs-params   { color: #9cdcfe; }
.hljs-attr     { color: #9cdcfe; }
.hljs-meta     { color: #569cd6; }
.hljs-subst    { color: #d4d4d4; }

/* ── COPY BUTTON ─────────────────────────────────────────── */
.copy-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.6rem;
  background: #2d2d2d;
  border: 1px solid #444;
  color: #9d9d9d;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 3px 10px;
  border-radius: 5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s, background 0.12s, color 0.12s;
  user-select: none;
  z-index: 2;
}
.prose pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { background: #3a3a3a; color: #d4d4d4; border-color: #666; }
.copy-btn--done { background: rgba(168,85,247,0.15) !important; color: var(--violet) !important; border-color: rgba(168,85,247,0.3) !important; opacity: 1 !important; }

/* ── HARDWARE BANNER ─────────────────────────────────────── */
.hardware-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding: 0.875rem 1.1rem;
  background: rgba(251,191,36,0.05);
  border: 1px solid rgba(251,191,36,0.2);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}
.hw-banner-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
  margin-top: 2px;
}
.hw-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.hw-banner-label {
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--amber);
  font-weight: 600;
}
.hw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.hw-chip {
  background: rgba(251,191,36,0.08);
  border: 1px solid rgba(251,191,36,0.2);
  color: var(--text);
  font-size: 0.8rem;
  padding: 3px 10px;
  border-radius: 12px;
}

/* ── Quiz lock wall — lesson list ───────────────────────── */
.qlw-list { list-style: none; padding: 0; margin: 0.5rem 0 0; display: flex; flex-direction: column; gap: 0.35rem; }
.qlw-list li { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.qlw-check { font-family: var(--mono); font-size: 0.8rem; width: 1rem; flex-shrink: 0; }
.qlw-check--todo { color: var(--text2); }
.qlw-list li.qlw-done .qlw-check { color: var(--violet); }
.qlw-title-done { color: var(--text2); text-decoration: line-through; }
.qlw-list li a { color: var(--accent); text-decoration: none; }
.qlw-list li a:hover { text-decoration: underline; }

.qlw-type { font-family: var(--mono); font-size: 0.58rem; padding: 1px 6px; border-radius: 8px; flex-shrink: 0; text-transform: uppercase; letter-spacing: 0.04em; }
.qlw-type--theory    { background: rgba(0,153,255,0.08);  color: var(--accent); border: 1px solid rgba(0,153,255,0.2); }
.qlw-type--practical { background: rgba(168,85,247,0.08); color: var(--violet); border: 1px solid rgba(168,85,247,0.2); }
.qlw-type--challenge { background: rgba(251,191,36,0.08); color: var(--amber);  border: 1px solid rgba(251,191,36,0.2); }

/* ══════════════════════════════════════════════════════════════
   WIKI
══════════════════════════════════════════════════════════════ */

/* Category colors */
.wiki-cat--hardware { color: #f97316; }
.wiki-cat--software { color: var(--accent); }
.wiki-cat--protocol { color: var(--violet); }
.wiki-cat--concept  { color: var(--amber); }

/* Hero */
.wiki-layout { max-width: 1100px; margin: 0 auto; padding: 2rem 2rem 4rem; }
.wiki-hero { text-align: center; padding: 2.5rem 0 2rem; }
.wiki-title { font-size: 2rem; font-weight: 700; margin: 0 0 .4rem; }
.wiki-subtitle { color: var(--text2); font-size: .95rem; margin: 0 0 1.5rem; }

/* Search */
.wiki-search-form { display: flex; gap: .5rem; max-width: 520px; margin: 0 auto; }
.wiki-search-input {
  flex: 1; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius); padding: .6rem 1rem;
  font-size: .9rem; font-family: var(--sans); outline: none;
  transition: border-color .15s;
}
.wiki-search-input:focus { border-color: var(--accent); }
.wiki-search-btn {
  background: var(--accent); color: #0a0a0c; border: none;
  padding: .6rem 1.25rem; border-radius: var(--radius);
  font-weight: 600; font-size: .875rem; cursor: pointer;
  font-family: var(--sans); transition: background .12s;
}
.wiki-search-btn:hover { background: #33adff; }

/* Section */
.wiki-section { margin-bottom: 2.5rem; }
.wiki-section-header {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1rem; padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.wiki-section-header h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.wiki-section-icon { font-size: 1.1rem; }
.wiki-section-count {
  margin-left: auto; font-family: var(--mono); font-size: .72rem;
  color: var(--text2); background: var(--surface); padding: 1px 8px;
  border-radius: 10px; border: 1px solid var(--border);
}

/* Grid */
.wiki-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.wiki-card {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .875rem 1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; transition: border-color .12s, background .12s;
}
.wiki-card:hover { border-color: var(--border-active); background: var(--surface2); }
.wiki-card-icon { font-size: 1.4rem; flex-shrink: 0; margin-top: 1px; }
.wiki-card-body { display: flex; flex-direction: column; gap: .25rem; min-width: 0; }
.wiki-card-title { font-weight: 600; font-size: .875rem; color: var(--text); }
.wiki-card-cat { font-family: var(--mono); font-size: .62rem; text-transform: uppercase; }
.wiki-card-summary { font-size: .78rem; color: var(--text2); line-height: 1.45; margin: 0; }

.wiki-empty { color: var(--text2); text-align: center; padding: 2rem 0; }

/* Entry layout */
.wiki-entry-layout { display: flex; gap: 2rem; max-width: 1100px; margin: 0 auto; padding: 2rem; }
.wiki-sidebar {
  width: 220px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1rem;
  padding-top: .5rem;
}
.wiki-back { color: var(--accent); text-decoration: none; font-size: .85rem; }
.wiki-back:hover { text-decoration: underline; }
.wiki-sidebar-cat {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text2); font-family: var(--mono);
}
.wiki-sidebar-related { display: flex; flex-direction: column; gap: .35rem; }
.wiki-related-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text2); font-family: var(--mono); margin-bottom: .25rem; }
.wiki-related-item { display: flex; align-items: center; gap: .4rem; font-size: .82rem; color: var(--text2); text-decoration: none; padding: 3px 0; transition: color .12s; }
.wiki-related-item:hover { color: var(--text); }

/* Article */
.wiki-article { flex: 1; min-width: 0; }
.wiki-article-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border); }
.wiki-article-icon { font-size: 2.5rem; flex-shrink: 0; margin-top: 4px; }
.wiki-article-breadcrumb { display: flex; align-items: center; gap: .35rem; font-size: .75rem; color: var(--text2); margin-bottom: .35rem; }
.wiki-article-breadcrumb a { color: var(--accent); text-decoration: none; }
.wiki-article-breadcrumb span:last-child { font-family: var(--mono); }
.wiki-article h1 { font-size: 1.5rem; font-weight: 700; margin: 0 0 .4rem; }
.wiki-article-summary { font-size: .9rem; color: var(--text2); margin: 0; }
.wiki-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.wiki-tag { font-family: var(--mono); font-size: .65rem; padding: 1px 8px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); color: var(--text2); }

/* hw-chip link variant */
.hw-chip--link {
  text-decoration: none;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.hw-chip--link:hover {
  background: rgba(251,191,36,0.16);
  border-color: rgba(251,191,36,0.4);
  color: var(--text);
}

/* ── Sidebar wiki — sections par catégorie ──────────────── */
.wiki-sidebar { width: 230px; flex-shrink: 0; display: flex; flex-direction: column; gap: 0; padding-top: .5rem; overflow-y: auto; max-height: calc(100vh - 80px); position: sticky; top: 1rem; }
.wiki-back { color: var(--accent); text-decoration: none; font-size: .85rem; margin-bottom: .75rem; display: block; }
.wiki-back:hover { text-decoration: underline; }

.wiki-sidebar-section { margin-bottom: .5rem; }
.wiki-sidebar-cat-header {
  display: flex; align-items: center; gap: .4rem;
  font-family: var(--mono); font-size: .65rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text2);
  padding: .5rem .25rem .25rem;
  border-top: 1px solid var(--border);
  margin-top: .25rem;
}
.wiki-sidebar-section:first-of-type .wiki-sidebar-cat-header { border-top: none; margin-top: 0; }

.wiki-related-item {
  display: flex; align-items: center; gap: .4rem;
  font-size: .8rem; color: var(--text2); text-decoration: none;
  padding: 4px 6px; border-radius: 4px;
  transition: color .12s, background .12s;
}
.wiki-related-item:hover { color: var(--text); background: var(--surface2); }
.wiki-related-item--active { color: var(--accent) !important; background: rgba(0,153,255,.06); font-weight: 500; }
.wiki-related-icon { font-size: .9rem; flex-shrink: 0; width: 1.2rem; text-align: center; }

/* ── hw-chip link : pas de soulignement ─────────────────── */
.hw-chip--link { text-decoration: none !important; }
.hw-chip--link:hover { text-decoration: none !important; }

/* ── Wiki search bar (dynamic) ───────────────────────────── */
.wiki-search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.wiki-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--radius);
  padding: .65rem 3rem .65rem 2.5rem;
  font-size: .9rem;
  font-family: var(--sans);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  box-sizing: border-box;
}
.wiki-search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0,153,255,.1);
}
.wiki-search-icon {
  position: absolute;
  left: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text2);
  font-size: 1.1rem;
  pointer-events: none;
  line-height: 1;
}
.wiki-search-count {
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--mono);
  font-size: .7rem;
  color: var(--text2);
  pointer-events: none;
  white-space: nowrap;
}

/* Smooth card hide/show */
.wiki-card { transition: opacity .1s; }
.wiki-card[style*="display: none"] { display: none !important; }

/* ── Level-up overlay ───────────────────────────────── */
.levelup-box { border: 2px solid var(--accent); box-shadow: 0 0 32px var(--accent)40; }
.levelup-badge {
  font-size: 2.4rem; font-weight: 900; color: var(--accent);
  letter-spacing: -1px; margin: .4rem 0 .1rem;
}
.levelup-title {
  font-size: 1rem; font-weight: 600; color: var(--text-muted);
  letter-spacing: .5px; text-transform: uppercase; margin-bottom: .5rem;
}
