@import url('/brand.css');

.top-bar { height: 4px; background: var(--surface-2); }
.top-bar-fill { height: 100%; background: linear-gradient(90deg, var(--lime), var(--blue)); border-radius: 999px; transition: width 1s ease; }

main { padding: 32px 0 60px; }
.page-head { margin-bottom: 32px; }
.page-head h1 { font-family: var(--font-display); font-weight: 600; font-size: 1.9rem; margin-bottom: 4px; }
.page-head p { color: var(--ink-soft); font-size: 0.95rem; }
.page-subline { color: var(--ink-faint); font-size: 0.95rem; margin-top: 6px; }
.lime { color: var(--lime); }

.level-hero {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 24px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 24px;
  box-shadow: var(--shadow);
}

.level-left h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.5rem; margin-bottom: 4px; }
.level-left p { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 16px; }
.xp-bar-wrap { display: flex; align-items: center; gap: 12px; }
.xp-bar-bg { flex: 1; height: 14px; background: var(--surface-2); border-radius: 999px; border: 1px solid var(--border); overflow: hidden; }
.xp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--lime), #9bff4d); border-radius: 999px; transition: width 1.2s ease; }
.xp-label { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ink-faint); white-space: nowrap; }
.level-badge { text-align: center; }
.level-icon { font-size: 3.5rem; display: block; }
.level-name { font-family: var(--font-display); font-weight: 600; font-size: 1rem; color: var(--lime); margin-top: 6px; }
.level-next { font-size: 0.78rem; color: var(--ink-faint); }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 20px; position: relative; overflow: hidden; transition: 0.2s; }
.stat-card:hover { transform: translateY(-4px); border-color: var(--lime); }
.stat-card::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 3px; border-radius: 999px; }
.stat-card.c1::after { background: var(--lime); }
.stat-card.c2::after { background: var(--coral); }
.stat-card.c3::after { background: var(--blue); }
.stat-card.c4::after { background: var(--pink); }
.stat-icon { font-size: 1.5rem; margin-bottom: 10px; }
.stat-val { font-family: var(--font-display); font-weight: 600; font-size: 2rem; margin-bottom: 2px; }
.stat-label { font-size: 0.82rem; color: var(--ink-faint); }
.stat-delta { position: absolute; top: 16px; right: 16px; font-family: var(--font-mono); font-size: 0.72rem; color: var(--lime); background: rgba(200, 255, 77, 0.1); padding: 4px 8px; border-radius: 999px; }
.xp-breakdown-toggle {
  margin-top: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--ink-soft);
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 6px 10px;
  cursor: pointer;
}
.xp-breakdown {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  display: grid;
  gap: 6px;
}
.xp-breakdown div {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--ink-soft);
}
.xp-breakdown strong {
  color: var(--ink);
}

.two-col { display: grid; grid-template-columns: 1.3fr 0.7fr; gap: 20px; margin-bottom: 24px; }
.card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 24px; }
.card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.05rem; margin-bottom: 20px; display: flex; align-items: center; gap: 8px; }
.subj-row { margin-bottom: 14px; }
.subj-top { display: flex; justify-content: space-between; margin-bottom: 6px; font-size: 0.88rem; }
.subj-name { font-weight: 600; }
.subj-count { color: var(--ink-faint); font-family: var(--font-mono); font-size: 0.8rem; }
.subj-bar { height: 10px; background: var(--surface-2); border-radius: 999px; overflow: hidden; }
.subj-fill { height: 100%; border-radius: 999px; transition: width 1.4s ease; }

.streak-dots { display: flex; gap: 8px; margin-bottom: 16px; }
.dot { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; font-family: var(--font-mono); }
.dot.on { background: var(--lime); color: var(--bg-deep); }
.dot.off { background: var(--surface-2); color: var(--ink-faint); }
.streak-stat { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; }
.streak-sub { font-size: 0.82rem; color: var(--ink-faint); }

.insights-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin: 0; }
.insight-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-sm); padding: 20px; position: relative; }
.insight-tag { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; display: inline-block; }
.tag-lime { background: rgba(200, 255, 77, 0.12); color: var(--lime); }
.tag-coral { background: rgba(255, 107, 74, 0.12); color: var(--coral); }
.tag-blue { background: rgba(77, 216, 255, 0.12); color: var(--blue); }
.insight-card h4 { font-family: var(--font-display); font-weight: 600; font-size: 0.98rem; margin-bottom: 6px; }
.insight-card p { font-size: 0.85rem; color: var(--ink-soft); }
.insight-engine { position: absolute; top: 16px; right: 16px; font-size: 1.1rem; }

.timeline { display: flex; flex-direction: column; gap: 14px; }
.milestone { display: flex; gap: 14px; align-items: flex-start; }
.ms-dot { width: 36px; height: 36px; border-radius: 50%; background: var(--surface-2); border: 2px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.ms-dot.done { background: rgba(200, 255, 77, 0.1); border-color: var(--lime); }
.ms-body h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 2px; }
.ms-body p { font-size: 0.8rem; color: var(--ink-faint); }

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.badge-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: var(--ink-soft);
  background: var(--surface-2);
}

.quiz-cta {
  background: linear-gradient(135deg, rgba(200, 255, 77, 0.08), rgba(77, 216, 255, 0.08));
  border: 2px solid var(--lime);
  border-radius: var(--radius-sm);
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.quiz-cta h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; margin-bottom: 4px; }
.quiz-cta p { font-size: 0.88rem; color: var(--ink-soft); }
.quiz-btn { font-family: var(--font-display); font-weight: 600; font-size: 0.92rem; background: var(--lime); color: var(--bg-deep); padding: 12px 24px; border-radius: 999px; box-shadow: var(--shadow-sm); white-space: nowrap; transition: 0.15s; flex-shrink: 0; }
.quiz-btn:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }

.engine-pill-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }
.engine-pill { font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border); }
.engine-pill.live { border-color: rgba(200, 255, 77, 0.4); color: var(--lime); background: rgba(200, 255, 77, 0.08); }
.engine-pill.soon { color: var(--ink-faint); }

@media (max-width: 900px) {
  .stats-grid, .insights-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-grid, .insights-grid { grid-template-columns: 1fr; }
  .level-hero { grid-template-columns: 1fr; }
  .quiz-cta { flex-direction: column; align-items: flex-start; }
}
