﻿/* ============================================================
   SkillRun app styles (V1)
   Dark theme + neon green, bold & playful Gen-Z accents.
   Bottom tab bar app layout.
   ============================================================ */

:root {
  --background: #0a0a0a;
  --foreground: #f5f5f5;
  --card: #141414;
  --card-foreground: #f5f5f5;
  --muted: #1a1a1a;
  --muted-foreground: #a1a1aa;
  --border: #26262b;
  --primary: #30d05c;
  --primary-foreground: #06130a;
  --secondary: #7bf1a8;
  --destructive: #ff4d4f;
  --ring: #30d05c;
  --pink: #ff5ca8;
  --purple: #a78bfa;
  --yellow: #ffd166;
  --cyan: #4dd8ff;
  --orange: #ff9d5c;
  --radius: 1rem;
  --font-heading: "hagrid", "hagrid Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-sans: Manrope, ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --tabbar-h: 62px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}

/* ---------- Phone-on-desktop shell ----------
   Everything lives inside ONE phone-width container. The
   top bar / content / tab bar stack inside it via flex, and
   a media query turns it into a rounded "phone" on desktop. */
.app-shell {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--background);
}

.app-shell > .app-header {
  flex-shrink: 0;
}

.app-shell > .app-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 1.25rem;
}

.app-shell > .app-footer {
  flex-shrink: 0;
}

.app-shell > .tab-bar {
  flex-shrink: 0;
  position: relative;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  line-height: 1.15;
  margin: 0;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.container-narrow {
  max-width: 720px;
}

/* ---------- Header ---------- */
.app-header {
  z-index: 100;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.app-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 1rem;
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.app-header .logo img {
  height: 34px;
  width: auto;
  display: block;
  border-radius: 6px;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.xp-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(48, 208, 92, 0.1);
  color: var(--primary);
  border: 1px solid rgba(48, 208, 92, 0.3);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.link-btn {
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.link-btn:hover {
  color: var(--primary);
  background: rgba(48, 208, 92, 0.1);
}

/* ---------- Main / tab bar ---------- */
.app-main {
  min-height: 0;
}

.tab-bar {
  z-index: 150;
  height: var(--tabbar-h);
  display: flex;
  align-items: stretch;
  background: rgba(16, 16, 16, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}

.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.tab-icon { font-size: 18px; line-height: 1; }

.tab.active {
  color: var(--primary);
}

.tab.active .tab-icon {
  transform: translateY(-1px);
}

.tab:active { background: rgba(48, 208, 92, 0.08); }

/* ---------- Buttons ---------- */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--primary);
  color: var(--primary-foreground);
  font-weight: 800;
  font-size: 15px;
  border: none;
  border-radius: 12px;
  padding: 0.8rem 1.5rem;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.btn-primary:hover {
  transform: translateY(-1px);
  background: #28b850;
  box-shadow: 0 8px 24px rgba(48, 208, 92, 0.35);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: var(--foreground);
  font-weight: 700;
  font-size: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.btn-secondary:hover {
  background: var(--muted);
  border-color: #3a3a42;
}

.btn-block { width: 100%; }

.btn-small {
  background: var(--muted);
  color: var(--foreground);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.4rem 0.8rem;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.btn-small:hover { background: #22222a; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--muted-foreground);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 1.1rem;
  font-size: 13px;
  font-weight: 700;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.btn-ghost:hover {
  color: var(--primary);
  border-color: rgba(48, 208, 92, 0.4);
}

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.badge-green {
  background: rgba(48, 208, 92, 0.12);
  color: var(--primary);
  border: 1px solid rgba(48, 208, 92, 0.3);
}

.badge-muted {
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.badge-pink {
  background: rgba(255, 92, 168, 0.12);
  color: var(--pink);
  border: 1px solid rgba(255, 92, 168, 0.3);
}

.badge-purple {
  background: rgba(167, 139, 250, 0.12);
  color: var(--purple);
  border: 1px solid rgba(167, 139, 250, 0.3);
}

/* ---------- Bars ---------- */
.bar {
  display: block;
  height: 8px;
  background: var(--muted);
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #28b850, var(--primary), var(--secondary));
  border-radius: 999px;
  transition: width 0.6s ease;
}

.bar-caption {
  margin-top: 0.4rem;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* ---------- Section titles ---------- */
.sec-title {
  margin: 1.75rem 0 0.8rem;
}

.sec-title h2 {
  font-size: 19px;
  letter-spacing: -0.01em;
}

.sec-title h2 svg {
  width: 22px;
  height: 22px;
  display: inline-block;
  vertical-align: -3px;
}

.sec-title p {
  color: var(--muted-foreground);
  font-size: 13px;
  margin: 0.2rem 0 0;
}

.page-head {
  padding: 1.75rem 0 0.6rem;
}

.page-head h1 {
  font-size: clamp(28px, 5vw, 38px);
  letter-spacing: -0.02em;
}

.page-head p {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0.3rem 0 0;
}

/* ---------- Home ---------- */
.greet h1 {
  font-size: clamp(26px, 6vw, 36px);
  letter-spacing: -0.02em;
  padding-top: 1.5rem;
}

.greet p {
  color: var(--muted-foreground);
  margin: 0.2rem 0 0;
  font-size: 15px;
}

.wave { display: inline-block; animation: wave 1.6s ease-in-out infinite; transform-origin: 70% 70%; }

@keyframes wave {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(14deg); }
  50% { transform: rotate(-6deg); }
  75% { transform: rotate(8deg); }
}

.xp-card {
  margin-top: 1.25rem;
  background: linear-gradient(135deg, #141414, #0f2414);
  border: 1px solid rgba(48, 208, 92, 0.25);
  border-radius: 16px;
  padding: 1.1rem 1.25rem;
}

.xp-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 0.7rem;
}

.streak {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.7rem;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
}

.streak-flame { font-size: 15px; }

.continue-card {
  display: block;
  background: linear-gradient(135deg, #16a34a, #0d6b2c);
  border-radius: 16px;
  padding: 1.4rem 1.4rem 1.2rem;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.continue-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(48, 208, 92, 0.25);
}

.continue-card::after {
  content: "";
  position: absolute;
  right: -30px;
  top: -30px;
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, rgba(255,255,255,0.18), transparent 70%);
  border-radius: 999px;
}

.continue-num {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

.continue-card h3 { font-size: 22px; margin-top: 0.3rem; }
.continue-card p { opacity: 0.9; font-size: 14px; margin: 0.2rem 0 0; }

.continue-progress { margin-top: 1rem; }

.continue-progress .bar { background: rgba(255,255,255,0.25); }
.continue-progress .bar-fill { background: #ffffff; }

.continue-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.9;
}

.continue-go {
  margin-top: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-weight: 800;
  font-size: 14px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.25rem;
}

.card-done {
  border-color: rgba(48, 208, 92, 0.4);
}

.card-done h3 { font-size: 18px; }
.card-done p { color: var(--muted-foreground); font-size: 14px; margin: 0.4rem 0 0; }

.muted-card { color: var(--muted-foreground); font-size: 14px; }

/* Skill path */
.path {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.75rem 0 0.4rem;
}

.path-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}

.path-check, .path-num {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  background: var(--muted);
  color: var(--muted-foreground);
  border: 1px solid var(--border);
}

.path-node.on .path-check {
  background: var(--primary);
  color: var(--primary-foreground);
  border-color: var(--primary);
}

.path-name {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted-foreground);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.path-node.on .path-name { color: var(--primary); }

.path-line {
  flex-shrink: 0;
  height: 2px;
  width: 22px;
  background: var(--border);
}

.path-line.on { background: var(--primary); }

/* Daily run */
.daily-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.daily-card:hover { transform: translateY(-2px); border-color: rgba(255, 209, 102, 0.5); }

.daily-emoji {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 209, 102, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.daily-card h3 { font-size: 15px; }
.daily-card p { color: var(--muted-foreground); font-size: 13px; margin: 0.1rem 0 0; }

.daily-go {
  margin-left: auto;
  color: var(--yellow);
  font-weight: 800;
  font-size: 14px;
}

/* ---------- Learn ---------- */
.learn-overall {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: 1rem 0 1.25rem;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted-foreground);
}

.learn-overall .bar { flex: 1; }

.mission-card {
  display: flex;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.mission-card:hover {
  transform: translateY(-2px);
  border-color: rgba(48, 208, 92, 0.4);
}

.mission-icon {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(48, 208, 92, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mission-icon svg { width: 26px; height: 26px; }

.mission-body { flex: 1; min-width: 0; }

.mission-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.2rem;
}

.mission-num {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.mission-card h3 { font-size: 17px; }
.mission-card p { color: var(--muted-foreground); font-size: 13px; margin: 0.1rem 0 0; }

.mission-progress {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.7rem;
}

.mission-progress .bar { flex: 1; }

.mission-progress-text {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.mission-card.locked {
  opacity: 0.55;
  cursor: not-allowed;
}

.lock {
  font-size: 20px;
}

.lock-note {
  margin-top: 0.6rem;
  font-size: 12px;
  color: var(--muted-foreground);
}

/* Future paths */
.future-list { display: flex; flex-direction: column; gap: 0.6rem; }

.future-item {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.future-emoji { font-size: 22px; }

.future-item h3 { font-size: 15px; }
.future-item p { color: var(--muted-foreground); font-size: 12px; margin: 0; }

.future-item.on { border-color: rgba(48, 208, 92, 0.35); }

.future-item .badge { margin-left: auto; }

/* ---------- Practice ---------- */
.practice-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.95rem 1.1rem;
  margin-bottom: 0.7rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.practice-card:hover {
  transform: translateY(-2px);
  border-color: rgba(48, 208, 92, 0.4);
}

.practice-card.done { opacity: 0.65; }

.practice-body { flex: 1; min-width: 0; }
.practice-body h3 { font-size: 15px; display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.practice-body h3 svg { width: 20px; height: 20px; flex-shrink: 0; }
.practice-body p { color: var(--muted-foreground); font-size: 13px; margin: 0.1rem 0 0; }

/* ---------- Projects ---------- */
.project-dna { margin-bottom: 0.5rem; }

.project-card {
  display: flex;
  gap: 1rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  margin-bottom: 0.85rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(167, 139, 250, 0.45);
}

.project-card.done { border-color: rgba(48, 208, 92, 0.4); }
.project-card.locked { opacity: 0.6; cursor: not-allowed; }

.project-emoji {
  flex-shrink: 0;
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: rgba(167, 139, 250, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.project-body { flex: 1; min-width: 0; }

.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.project-top h3 { font-size: 17px; }
.project-body > p { color: var(--muted-foreground); font-size: 13px; margin: 0.15rem 0 0; }

.skill-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.6rem;
}

.skill-dot {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  background: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.5rem;
}

.skill-dot.has {
  color: var(--primary);
  border-color: rgba(48, 208, 92, 0.35);
  background: rgba(48, 208, 92, 0.08);
}

/* ---------- Profile ---------- */
.profile-card {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(135deg, #141414, #16101f);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 16px;
  padding: 1.3rem;
  margin-top: 1rem;
}

.avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: var(--background);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-info { flex: 1; min-width: 0; }
.profile-info h2 { font-size: 20px; }
.profile-level { color: var(--muted-foreground); font-size: 13px; margin: 0.15rem 0 0.7rem; }

.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.7rem;
  margin: 1.25rem 0 0.5rem;
}

.stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  padding: 0.9rem 0.4rem;
}

.stat strong {
  display: block;
  font-size: 22px;
  font-family: var(--font-heading);
  color: var(--primary);
}

.stat span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.skill-chip {
  background: rgba(48, 208, 92, 0.1);
  color: var(--primary);
  border: 1px solid rgba(48, 208, 92, 0.3);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-size: 13px;
  font-weight: 700;
}

.achievements { display: flex; flex-direction: column; gap: 0.6rem; }

.ach {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  min-width: 0;
}

.ach-emoji {
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  filter: grayscale(1);
  opacity: 0.5;
}

.ach.got .ach-emoji {
  background: rgba(255, 209, 102, 0.12);
  filter: none;
  opacity: 1;
}

.ach h3 { font-size: 14px; }
.ach p { color: var(--muted-foreground); font-size: 12px; margin: 0.05rem 0 0; }
.ach > div { min-width: 0; overflow-wrap: break-word; }
.ach .badge { margin-left: auto; flex-shrink: 0; }

/* ---------- Onboarding ---------- */
.onboarding {
  position: absolute;
  inset: 0;
  z-index: 300;
  background: rgba(10, 10, 10, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  overflow-y: auto;
}

.ob-card {
  width: 100%;
  max-width: 420px;
}

.ob-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 20px;
  margin-bottom: 0.75rem;
}

.ob-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.ob-card h1 {
  font-size: 30px;
  text-align: center;
  letter-spacing: -0.02em;
}

.ob-sub {
  text-align: center;
  color: var(--muted-foreground);
  margin: 0.4rem 0 1.5rem;
}

.ob-skip {
  width: 100%;
  margin-bottom: 1rem;
}

.ob-options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.ob-option {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ob-option:hover {
  border-color: rgba(48, 208, 92, 0.5);
  transform: translateY(-2px);
}

.ob-emoji { font-size: 26px; }
.ob-text { flex: 1; }
.ob-text strong { font-size: 15px; }
.ob-text small { color: var(--muted-foreground); font-size: 12px; }
.ob-go { color: var(--primary); font-weight: 800; font-size: 18px; }

/* ---------- Workspace ---------- */
.workspace-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 0 0.6rem;
}

.workspace-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 18px;
}

/* Briefing */
.ws-briefing { padding-top: 0.6rem; }

.ws-icon {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: rgba(48, 208, 92, 0.1);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.ws-icon svg { width: 34px; height: 34px; }

.ws-tag {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.build-tag { color: var(--yellow); }

.ws-briefing h1 {
  font-size: clamp(26px, 6vw, 36px);
  letter-spacing: -0.02em;
}

.ws-tagline { color: var(--muted-foreground); font-size: 15px; margin: 0.4rem 0 0; }

.brief-box {
  margin-top: 1.25rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.3rem;
}

.brief-box h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.3rem;
}

.brief-box h3:not(:first-child) { margin-top: 1rem; }

.brief-box p {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0;
}

.mission-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 1rem 0 1.25rem;
}

.part {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.6rem;
  text-align: center;
}

.part-emoji { display: block; font-size: 20px; margin-bottom: 0.3rem; }
.part strong { display: block; font-size: 12px; }
.part small { color: var(--muted-foreground); font-size: 10px; }

/* Workspace head / tabs */
.ws-head {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  padding-top: 0.6rem;
}

.back-btn {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 16px;
  font-weight: 700;
}

.back-btn:hover { border-color: rgba(48, 208, 92, 0.4); color: var(--primary); }

.ws-head-info { flex: 1; min-width: 0; }
.ws-head-info h1 { font-size: 24px; letter-spacing: -0.02em; }

.tabs-ws {
  display: flex;
  gap: 0.4rem;
  margin: 1.1rem 0 0.9rem;
  background: var(--muted);
  border-radius: 12px;
  padding: 0.3rem;
}

.ws-tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 700;
  padding: 0.55rem 0.5rem;
  border-radius: 9px;
  transition: background 0.2s ease, color 0.2s ease;
}

.ws-tab.active {
  background: var(--card);
  color: var(--primary);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.ws-panel { display: none; animation: fadeIn 0.25s ease; }
.ws-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

.instruction-card, .learning-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem 1.3rem;
}

.instruction-card h3, .learning-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary);
  margin-bottom: 0.4rem;
}

.instruction-card p, .learning-card p {
  color: var(--foreground);
  font-size: 15px;
  margin: 0;
}

.example-card {
  margin-top: 0.7rem;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.example-card h3 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.4rem;
}

.example-card pre {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--secondary);
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.ws-panel .btn-block { margin-top: 1rem; }

/* Editor */
.editor-toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--muted);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  flex-wrap: wrap;
}

.file-chip {
  color: var(--muted-foreground);
  font-size: 12px;
  font-family: var(--font-mono);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.5rem;
}

.editor-toolbar .btn-small { margin-left: auto; }

#editor {
  width: 100%;
  min-height: 320px;
  background: #0d0d0d;
  color: #e6e6e6;
  border: 1px solid var(--border);
  border-radius: 0 0 12px 12px;
  outline: none;
  resize: vertical;
  padding: 1rem;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.6;
  tab-size: 2;
  display: block;
}

#editor:focus {
  border-color: rgba(48, 208, 92, 0.5);
  box-shadow: 0 0 0 3px rgba(48, 208, 92, 0.15);
}

.editor-suggest {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.8rem;
  background: #101418;
  border: 1px solid rgba(48, 208, 92, 0.4);
  border-radius: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: #e6e6e6;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  animation: coverPop 0.15s ease;
}
.editor-suggest .suggest-kind {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d0d0d;
  background: var(--primary);
  border-radius: 6px;
  padding: 0.15rem 0.4rem;
}
.editor-suggest code { color: #7ee787; }
.editor-suggest small { margin-left: auto; color: var(--muted-foreground); font-size: 11px; }

/* Preview-first "target" box — a mini browser showing the goal */
.target-box {
  margin-top: 0.7rem;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}
.target-chrome {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: #e6e9ee;
  border-bottom: 1px solid #d4d8df;
}
.target-dot { width: 10px; height: 10px; border-radius: 50%; }
.target-dot:nth-child(1) { background: #f87171; }
.target-dot:nth-child(2) { background: #fbbf24; }
.target-dot:nth-child(3) { background: #34d399; }
.target-url {
  margin-left: 8px;
  font-size: 10px;
  font-family: ui-monospace, Consolas, monospace;
  color: #64748b;
  background: #fff;
  border-radius: 6px;
  padding: 1px 8px;
}
.target-screen {
  background: #ffffff;
  color: #111111;
  padding: 14px 16px;
  min-height: 52px;
  font-size: 14px;
  line-height: 1.6;
}
.target-screen h1 { font-size: 27px; font-weight: 700; margin: 0 0 6px; color: #111; }
.target-screen h2 { font-size: 21px; font-weight: 700; margin: 10px 0 4px; color: #111; }
.target-screen h3 { font-size: 17px; font-weight: 700; margin: 8px 0 3px; color: #111; }
.target-screen p { margin: 0 0 6px; color: #333; }
.target-screen ul, .target-screen ol { margin: 4px 0 8px 20px; padding: 0; color: #333; }
.target-screen li { margin: 2px 0; }

.run-bar {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0.9rem 0 0;
  flex-wrap: wrap;
}

.help-btns { display: flex; gap: 0.5rem; margin-left: auto; }

.help-btn {
  background: transparent;
  border: 1px solid rgba(255, 209, 102, 0.3);
  color: var(--yellow);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.2s ease;
}

.help-btn:hover { background: rgba(255, 209, 102, 0.1); }

#help-panel { margin-top: 0.9rem; }

.help-panel {
  background: rgba(255, 209, 102, 0.07);
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.solution-panel {
  background: rgba(167, 139, 250, 0.07);
  border-color: rgba(167, 139, 250, 0.35);
}

.help-head {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow);
  margin-bottom: 0.4rem;
}

.solution-panel .help-head { color: var(--purple); }

.help-panel p {
  font-size: 14px;
  margin: 0;
}

.help-actions { display: flex; gap: 0.5rem; margin-top: 0.7rem; }

.solution-code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: #e6e6e6;
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  margin: 0 0 0.7rem;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 260px;
  overflow: auto;
}

/* Console / preview */
.console {
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1rem;
  font-family: var(--font-mono);
  font-size: 13px;
  color: #d4d4d4;
  max-height: 200px;
  overflow: auto;
  margin: 0.9rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.console.empty { color: #6b6b6b; }

#preview-wrap {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem;
  margin-top: 0.9rem;
  overflow: auto;
  max-height: 280px;
}

#preview-frame {
  width: 100%;
  height: 250px;
  border: none;
  background: #ffffff;
}

/* Circuit simulator board */
#preview-wrap.circuit-mode {
  background: #0d1117;
  padding: 0.35rem;
}
.circuit-svg {
  width: 100%;
  height: auto;
  display: block;
}

/* Result banner */
.result-banner {
  margin-top: 0.9rem;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
}

.result-banner.pass {
  background: rgba(48, 208, 92, 0.12);
  color: var(--secondary);
  border: 1px solid rgba(48, 208, 92, 0.4);
}

.result-banner.fail {
  background: rgba(255, 77, 79, 0.12);
  color: #ffb3b4;
  border: 1px solid rgba(255, 77, 79, 0.4);
}

.result-banner .xp-gain {
  display: block;
  margin-top: 0.5rem;
  color: var(--yellow);
}

.next-link {
  display: inline-block;
  margin-top: 0.6rem;
  background: var(--primary-foreground);
  color: var(--primary);
  border-radius: 8px;
  padding: 0.5rem 0.95rem;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.next-link:hover { opacity: 0.85; }

/* Complete banner */
.result-banner.complete {
  text-align: center;
  background: linear-gradient(135deg, rgba(48, 208, 92, 0.14), rgba(167, 139, 250, 0.14));
  border-color: rgba(48, 208, 92, 0.5);
  padding: 1.5rem 1.25rem;
}

.complete-icon { font-size: 42px; margin-bottom: 0.5rem; }

.result-banner.complete h2 { font-size: 24px; color: var(--foreground); margin-bottom: 0.3rem; }
.result-banner.complete p { font-size: 14px; color: var(--muted-foreground); margin: 0 0 0.8rem; }

.complete-rewards {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.complete-actions { display: flex; justify-content: center; gap: 0.6rem; flex-wrap: wrap; }

.complete-actions .btn-primary {
  display: inline-flex;
  padding: 0.6rem 1.2rem;
  font-size: 14px;
  border-radius: 10px;
}

.progress-mini {
  margin-top: 0.6rem;
  font-size: 12px;
  color: var(--muted-foreground);
}

.progress-mini .bar { margin-top: 0.3rem; }

/* Build prompt */
.build-card {
  background: var(--card);
  border: 1px solid rgba(255, 209, 102, 0.25);
  border-radius: 14px;
  padding: 1.15rem 1.3rem;
  margin: 1rem 0;
}

.build-card h3 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow);
  margin-bottom: 0.4rem;
}

.build-card p {
  color: var(--foreground);
  font-size: 15px;
  margin: 0;
}

.build-prompt {
  font-family: var(--font-sans);
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted-foreground);
  background: #0d0d0d;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0 0;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- Footer ---------- */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  color: var(--muted-foreground);
  font-size: 13px;
  text-align: center;
}

/* ---------- Install banner ---------- */
.install-banner {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(var(--tabbar-h) + 0.75rem);
  z-index: 160;
  margin: 0 auto;
  max-width: calc(480px - 2rem);
  width: calc(100% - 2rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  background: linear-gradient(135deg, var(--primary), #1e9d46);
  color: var(--primary-foreground);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 10px 30px rgba(48, 208, 92, 0.35);
}

.install-banner button {
  background: var(--background);
  color: var(--primary);
  border: none;
  border-radius: 10px;
  padding: 0.5rem 0.9rem;
  font-size: 13px;
  font-weight: 800;
}

/* ---------- Toast ---------- */
.toast {
  position: absolute;
  bottom: calc(var(--tabbar-h) + 1rem);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--primary);
  color: var(--primary-foreground);
  padding: 0.7rem 1.25rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  z-index: 250;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- Completion / hint cover ---------- */
.cover-overlay {
  position: absolute;
  inset: 0;
  z-index: 270;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  animation: coverIn 0.22s ease;
}

.cover-card {
  width: 100%;
  max-width: 360px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.6rem 1.4rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: coverPop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.cover-card.pass { border-color: rgba(48, 208, 92, 0.5); }
.cover-card.hint { border-color: rgba(255, 209, 102, 0.5); }

.cover-emoji {
  font-size: 44px;
  line-height: 1;
  margin-bottom: 0.4rem;
}

.cover-card h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
  margin-bottom: 0.3rem;
}

.cover-card p {
  color: var(--muted-foreground);
  font-size: 14px;
  margin: 0 0 0.9rem;
}

.cover-rewards {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 0 0 1rem;
  flex-wrap: wrap;
}

.cover-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cover-card .btn-block { width: 100%; }

@keyframes coverIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes coverPop {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- Phone-on-desktop (desktop screens) ---------- */
@media (min-width: 640px) {
  body {
    background:
      radial-gradient(circle at 18% 22%, rgba(48, 208, 92, 0.20), transparent 42%),
      radial-gradient(circle at 82% 28%, rgba(77, 216, 255, 0.12), transparent 40%),
      radial-gradient(circle at 55% 88%, rgba(48, 208, 92, 0.16), transparent 45%),
      radial-gradient(circle at 88% 78%, rgba(167, 139, 250, 0.12), transparent 40%),
      radial-gradient(circle at 6% 80%, rgba(255, 92, 168, 0.10), transparent 38%),
      var(--background);
  }

  .app-shell {
    margin: 1.5rem auto;
    height: calc(100dvh - 3rem);
    border-radius: 1.75rem;
    box-shadow: 0 0 40px rgba(48, 208, 92, 0.18), 0 24px 60px rgba(0, 0, 0, 0.55);
  }

  .app-shell > .app-main {
    scrollbar-width: thin;
    scrollbar-color: rgba(48, 208, 92, 0.4) transparent;
  }
}

/* ============================================================
   V2 expansion styles
   ============================================================ */

/* extra badge accents */
.badge-cyan {
  background: rgba(77, 216, 255, 0.12);
  color: var(--cyan);
  border: 1px solid rgba(77, 216, 255, 0.3);
}

.badge-yellow {
  background: rgba(255, 209, 102, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(255, 209, 102, 0.35);
}

.badge-red {
  background: rgba(255, 77, 79, 0.12);
  color: #ffb3b4;
  border: 1px solid rgba(255, 77, 79, 0.35);
}

.badge-orange {
  background: rgba(255, 157, 92, 0.12);
  color: var(--orange);
  border: 1px solid rgba(255, 157, 92, 0.35);
}

/* paths */
.path-section { margin-top: 1.6rem; }

.path-head {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.path-emoji {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: var(--muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.path-green .path-emoji { background: rgba(48, 208, 92, 0.12); border-color: rgba(48, 208, 92, 0.35); }
.path-purple .path-emoji { background: rgba(167, 139, 250, 0.12); border-color: rgba(167, 139, 250, 0.35); }
.path-cyan .path-emoji { background: rgba(77, 216, 255, 0.12); border-color: rgba(77, 216, 255, 0.35); }

.path-head-info { flex: 1; min-width: 0; }
.path-head-info h2 { font-size: 18px; }
.path-head-info p { color: var(--muted-foreground); font-size: 12px; margin: 0.1rem 0 0; }
.path-head .xp-chip { margin-left: auto; }
.path-head .badge { margin-left: auto; }

.path-bar { margin: 0.7rem 0 0.3rem; }

/* series */
.series-block { margin-top: 1rem; }

.series-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--card);
  border: 1px solid rgba(48, 208, 92, 0.3);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 0.8rem;
}

.series-card.locked { border-color: var(--border); opacity: 0.75; }

.series-emoji {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: rgba(48, 208, 92, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.series-info { flex: 1; min-width: 0; }
.series-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.series-top h3 { font-size: 16px; }
.series-info p { color: var(--muted-foreground); font-size: 12px; margin: 0.15rem 0 0.55rem; }
.series-info .bar { height: 6px; }

/* challenge dots (MISSIONS -> CHALLENGES) */
.challenge-dots {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.6rem;
  flex-wrap: wrap;
}

.ch-dot {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--muted);
  border: 1px solid var(--border);
}

.ch-dot.done { background: var(--primary); border-color: var(--primary); }

.ch-build {
  width: 18px;
  border-radius: 6px;
  background: rgba(255, 209, 102, 0.18);
  border-color: rgba(255, 209, 102, 0.4);
}

.ch-build.done { background: var(--yellow); border-color: var(--yellow); }

/* featured practice */
.featured-practice {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.6rem;
  margin: 0.4rem 0 1.2rem;
}

.feat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

a.feat-card:hover { transform: translateY(-2px); border-color: rgba(48, 208, 92, 0.45); }

.feat-label {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--yellow);
}

.feat-card h3 { font-size: 13px; line-height: 1.3; }
.feat-go { margin-top: auto; font-size: 11px; font-weight: 800; color: var(--primary); }

/* timer chip */
.timer-chip {
  display: none;
  background: rgba(255, 209, 102, 0.12);
  color: var(--yellow);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
}

.timer-chip.out { color: var(--destructive); border-color: rgba(255, 77, 79, 0.5); background: rgba(255, 77, 79, 0.12); }

/* XP breakdown */
.xp-breakdown {
  margin: 0 0 0.9rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.9rem;
  font-size: 12px;
}

.xpb-row {
  display: flex;
  justify-content: space-between;
  color: var(--muted-foreground);
  padding: 0.15rem 0;
}

.xpb-row.bad { color: #ffb3b4; }

.xpb-row.total {
  border-top: 1px solid var(--border);
  margin-top: 0.2rem;
  padding-top: 0.35rem;
  color: var(--primary);
  font-weight: 800;
}

/* mastery */
.mastery-list { display: flex; flex-direction: column; gap: 0.6rem; }

.mastery-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.mastery-name {
  flex-shrink: 0;
  width: 110px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
}

.mastery-row .bar { flex: 1; }
.mastery-pct { font-size: 12px; font-weight: 800; color: var(--primary); width: 38px; text-align: right; }

/* achievement groups */
.ach-group { margin-bottom: 1.1rem; }

.ach-group > h3 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin: 0 0 0.55rem;
}

/* spaced practice note */
.spaced-note {
  margin-top: 1rem;
  background: rgba(167, 139, 250, 0.08);
  border: 1px solid rgba(167, 139, 250, 0.3);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  font-size: 13px;
  color: var(--muted-foreground);
}

.spaced-note strong { color: var(--purple); }

/* ---------- Player row / Home V3 ---------- */
.player-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  background: linear-gradient(135deg, #131313, #101a24);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  margin-top: 1rem;
}
.player-row .avatar { width: 56px; height: 56px; font-size: 24px; }
.player-info { flex: 1; min-width: 0; }
.player-info h1 { font-size: 21px; margin: 0 0 0.35rem; }
.player-stats { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.6rem; }
.stat-pill {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.2rem 0.7rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
}
.player-info .bar-caption { margin-top: 0.3rem; }

/* ---------- Course picker (home + onboarding) ---------- */
.course-grid { display: grid; grid-template-columns: 1fr; gap: 0.8rem; }
.course-card {
  display: flex;
  gap: 0.9rem;
  align-items: center;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.course-card:hover { transform: translateY(-2px); }
.course-card.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.course-emoji {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  background: rgba(255,255,255,0.06);
}
.course-green .course-emoji { background: rgba(48,208,92,0.14); }
.course-purple .course-emoji { background: rgba(167,139,250,0.16); }
.course-cyan .course-emoji { background: rgba(77,163,255,0.16); }
.course-body { flex: 1; min-width: 0; }
.course-body h3 { margin: 0; font-size: 16px; }
.course-body p { margin: 0.2rem 0 0.5rem; font-size: 12px; color: var(--muted-foreground); }
.course-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.course-meta { font-size: 11px; color: var(--muted-foreground); display: block; margin-top: 0.35rem; }

.quick-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.quick-link {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  padding: 0.8rem 0.2rem;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted-foreground);
  text-decoration: none;
}
.quick-link:active { background: rgba(48,208,92,0.08); }

/* ---------- Avatars ---------- */
.avatar.has-img { background: transparent; }
.avatar.has-img img, .header-avatar img, .ob-avatar img, .avatar-btn img {
  width: 100%; height: 100%; object-fit: cover; border-radius: inherit;
}
.header-avatar {
  width: 34px; height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: var(--background);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  overflow: hidden;
  margin-right: 0.5rem;
  vertical-align: middle;
}
.avatar-btn {
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
  transition: border-color 0.2s ease;
}
.avatar-btn:hover { border-color: var(--primary); }

/* ---------- Profile name editor ---------- */
.pf-name-row { display: flex; gap: 0.4rem; align-items: center; flex-wrap: wrap; }
.pf-name-row input[type="text"] {
  flex: 1;
  min-width: 120px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 800;
  padding: 0.35rem 0.6rem;
}
.pf-name-row .ob-dice { font-size: 15px; padding: 0.35rem 0.55rem; }
.profile-stats { grid-template-columns: repeat(5, 1fr); }

/* ---------- Leaderboard ---------- */
.lb-switch {
  display: flex;
  gap: 0.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.3rem;
  margin: 1rem 0;
}
.lb-btn {
  flex: 1;
  text-align: center;
  padding: 0.55rem 0.5rem;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted-foreground);
  text-decoration: none;
}
.lb-btn.active {
  background: var(--primary);
  color: var(--background);
}
.lb-top {
  text-align: center;
  background: linear-gradient(135deg, #1a1408, #141414);
  border: 1px solid rgba(255, 209, 102, 0.35);
  border-radius: 16px;
  padding: 1.4rem 1rem;
  margin-bottom: 1rem;
}
.lb-top-medal { font-size: 40px; }
.lb-top-name { font-family: var(--font-heading); font-size: 22px; font-weight: 800; margin-top: 0.3rem; }
.lb-top-xp { font-size: 26px; font-weight: 800; color: var(--primary); margin: 0.2rem 0; }
.lb-top p { color: var(--muted-foreground); font-size: 13px; margin: 0; }
.lb-list { display: flex; flex-direction: column; gap: 0.5rem; }
.lb-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
}
.lb-row.gold { border-color: rgba(255, 209, 102, 0.45); }
.lb-row.me {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: rgba(48, 208, 92, 0.06);
}
.lb-medal { width: 26px; text-align: center; font-size: 18px; }
.lb-rank { font-size: 13px; font-weight: 800; color: var(--muted-foreground); }
.lb-ava { flex-shrink: 0; }
.lb-ava img { width: 30px; height: 30px; border-radius: 999px; object-fit: cover; display: block; }
.lb-name { flex: 1; min-width: 0; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lb-streak { font-size: 12px; color: var(--muted-foreground); }
.lb-xp { font-size: 13px; font-weight: 800; color: var(--primary); }
.lb-note { margin-top: 1rem; }

/* ---------- Onboarding V2 ---------- */
.ob-identity { display: flex; gap: 0.9rem; align-items: center; margin: 1.1rem 0 1.2rem; }
.ob-avatar {
  flex-shrink: 0;
  width: 72px; height: 72px;
  border-radius: 999px;
  border: 2px dashed rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.05);
  color: var(--muted-foreground);
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}
.ob-avatar:hover { border-color: var(--primary); }
.ob-name-wrap { flex: 1; min-width: 0; }
.ob-name-wrap label { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-foreground); margin-bottom: 0.35rem; }
.ob-name-wrap input[type="text"] {
  width: 100%;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  font-size: 16px;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
}
.ob-name-wrap .ob-dice { font-size: 15px; }
.ob-dice {
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--foreground);
  cursor: pointer;
  padding: 0.5rem 0.6rem;
  line-height: 1;
}
.ob-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin: 0.4rem 0 0.6rem;
}
.ob-option { border: 1px solid var(--border); }
.ob-option.picked {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: rgba(48, 208, 92, 0.07);
}
.ob-option.picked .ob-go { color: var(--primary); }
#ob-start { margin-top: 1rem; }

@media (min-width: 640px) {
  .course-grid { grid-template-columns: repeat(3, 1fr); }
  .course-card { flex-direction: column; text-align: center; align-items: center; }
  .course-top { flex-direction: column; }
}

/* ---------- Inline SVG icons ---------- */
.tab-icon svg { width: 20px; height: 20px; }
.stat-pill svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.streak-flame svg { width: 16px; height: 16px; display: inline-block; vertical-align: -2px; color: #ffb454; }
.course-emoji svg { width: 22px; height: 22px; }
.course-pill svg { width: 16px; height: 16px; display: inline-block; vertical-align: -2px; }
.path-emoji svg, .series-emoji svg { width: 22px; height: 22px; }
.project-emoji svg { width: 24px; height: 24px; }
.ob-emoji svg { width: 26px; height: 26px; }
.ob-mark svg { width: 18px; height: 18px; vertical-align: -3px; }
.ob-avatar-plus svg, .ob-dice svg { width: 20px; height: 20px; display: block; }
.ob-avatar-plus { display: flex; align-items: center; justify-content: center; }
.quick-link svg { width: 16px; height: 16px; display: inline-block; vertical-align: -3px; }
.cover-emoji svg { width: 30px; height: 30px; }
.part-emoji svg { width: 18px; height: 18px; }
.lock svg { width: 20px; height: 20px; }
.future-item svg { width: 16px; height: 16px; margin-top: 0.2rem; color: var(--muted-foreground); flex-shrink: 0; }
.skill-dot svg { width: 12px; height: 12px; display: inline-block; vertical-align: -2px; }
.lock-note svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.help-btn svg { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.ach-emoji svg { width: 20px; height: 20px; }
.lb-medal svg { width: 26px; height: 26px; }
.lb-top-medal svg { width: 56px; height: 56px; }
.lb-medal { display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Course pills ---------- */
.course-pills { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1rem; }
.course-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.course-pill.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.course-pill-meta { font-size: 11px; font-weight: 700; color: var(--muted-foreground); background: var(--muted); border-radius: 999px; padding: 0.1rem 0.45rem; }

/* ---------- Achievements V2 ---------- */
.ach-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.ach-group-head h3 { margin: 0; }
.ach-count { font-size: 11px; font-weight: 800; color: var(--muted-foreground); background: var(--muted); border-radius: 999px; padding: 0.2rem 0.55rem; }
.ach.ach-rare .ach-emoji { background: rgba(56, 132, 255, 0.12); color: #4f8cff; }
.ach.ach-epic .ach-emoji { background: rgba(167, 139, 250, 0.14); color: #a78bfa; }
.ach.ach-legendary .ach-emoji { background: rgba(255, 209, 102, 0.14); color: #ffd154; }
.ach.ach-got.ach-common .ach-emoji { background: rgba(48, 208, 92, 0.12); color: var(--primary); }
.ach.ach-got.ach-rare .ach-emoji { background: rgba(56, 132, 255, 0.18); color: #6ea4ff; }
.ach.ach-got.ach-epic .ach-emoji { background: rgba(167, 139, 250, 0.2); color: #b79cff; }
.ach.ach-got.ach-legendary .ach-emoji { background: rgba(255, 209, 102, 0.2); color: #ffd154; }
.ach .badge { text-transform: capitalize; }

/* ---------- Course progress (profile) ---------- */
.course-progress-list { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 1.2rem; }
.course-progress-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 1rem;
}
.course-progress-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--muted);
}
.course-progress-icon svg { width: 20px; height: 20px; }
.course-green .course-progress-icon { background: rgba(48, 208, 92, 0.12); color: var(--primary); }
.course-purple .course-progress-icon { background: rgba(167, 139, 250, 0.14); color: #a78bfa; }
.course-cyan .course-progress-icon { background: rgba(77, 216, 255, 0.12); color: #4dd8ff; }
.course-progress-body { flex: 1; min-width: 0; }
.course-progress-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 13px; font-weight: 700; margin-bottom: 0.35rem; }

/* ---------- Daily token pill ---------- */
.stat-pill-token {
  color: var(--yellow);
  border-color: rgba(255, 209, 102, 0.35);
  background: rgba(255, 209, 102, 0.08);
}
.stat-pill-token svg { width: 13px; height: 13px; display: inline-block; vertical-align: -2px; }
.stat-pill-token.maxed {
  color: #ff8a8a;
  border-color: rgba(255, 77, 79, 0.4);
  background: rgba(255, 77, 79, 0.1);
}

/* ---------- Compact course list (home) ---------- */
.course-mini-list { display: flex; flex-direction: column; gap: 0.55rem; }
.course-mini {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.course-mini:hover { transform: translateY(-1px); }
.course-mini.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.course-mini-icon {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--muted);
}
.course-mini-icon svg { width: 18px; height: 18px; }
.course-green .course-mini-icon { background: rgba(48, 208, 92, 0.12); color: var(--primary); }
.course-purple .course-mini-icon { background: rgba(167, 139, 250, 0.14); color: #a78bfa; }
.course-cyan .course-mini-icon { background: rgba(77, 216, 255, 0.12); color: #4dd8ff; }
.course-mini-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.1rem; }
.course-mini-body strong { font-size: 14px; }
.course-mini-body span { font-size: 11px; color: var(--muted-foreground); }
.course-mini-go { color: var(--muted-foreground); display: flex; }
.course-mini-go svg { width: 16px; height: 16px; }

/* ---------- Shared app overlay (blurred, scrollable) ---------- */
.app-overlay {
  position: absolute;
  inset: 0;
  z-index: 290;
  background: rgba(10, 10, 10, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  animation: coverIn 0.2s ease;
}
.app-overlay-card {
  width: 100%;
  max-width: 100%;
  max-height: 82vh;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: coverPop 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
.app-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}
.app-overlay-head h3 { margin: 0; font-size: 18px; }
.app-overlay-close {
  background: var(--muted);
  border: 1px solid var(--border);
  color: var(--muted-foreground);
  width: 30px; height: 30px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}
.app-overlay-body { overflow-y: auto; overflow-x: hidden; padding: 0 1.2rem 1.2rem; min-width: 0; }
.app-overlay-head { min-width: 0; }
.app-overlay-head h3 { margin: 0; font-size: 18px; overflow-wrap: break-word; }

/* ---------- Achievement summary card (profile) ---------- */
.ach-summary-card {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.ach-summary-card:hover { transform: translateY(-1px); border-color: rgba(255, 209, 102, 0.4); }
.ach-summary-icon {
  flex-shrink: 0;
  width: 42px; height: 42px;
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 209, 102, 0.14);
  color: var(--yellow);
}
.ach-summary-icon svg { width: 22px; height: 22px; }
.ach-summary-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.35rem; }
.ach-summary-top { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; font-size: 14px; }
.ach-summary-hint { font-size: 11px; color: var(--muted-foreground); }
.ach-summary-go { color: var(--muted-foreground); font-size: 18px; }

/* ---------- Achievement overlay ---------- */
.ach-ov-head { display: flex; flex-direction: column; gap: 0.4rem; font-size: 12px; font-weight: 700; color: var(--muted-foreground); padding: 1rem 0 0.6rem; }

/* ---------- Courses overlay ---------- */
.co-intro { font-size: 12px; color: var(--muted-foreground); padding: 1rem 0 0.4rem; }
.co-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
}
.co-icon {
  flex-shrink: 0;
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--muted);
}
.co-icon svg { width: 20px; height: 20px; }
.co-green .co-icon { background: rgba(48, 208, 92, 0.12); color: var(--primary); }
.co-purple .co-icon { background: rgba(167, 139, 250, 0.14); color: #a78bfa; }
.co-cyan .co-icon { background: rgba(77, 216, 255, 0.12); color: #4dd8ff; }
.co-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 0.3rem; }
.co-body strong { font-size: 14px; }
.co-body > span { font-size: 11px; color: var(--muted-foreground); overflow-wrap: break-word; }
.co-meta { font-size: 11px; color: var(--muted-foreground); }
.co-switch { flex-shrink: 0; }
.co-upcoming { margin-top: 0.6rem; }
.co-upcoming h3 { font-size: 15px; margin: 0 0 0.5rem; }

/* ---------- Achievement celebration (confetti) ---------- */
.ach-celebrate {
  position: absolute;
  inset: 0;
  z-index: 285;
  background: rgba(10, 10, 10, 0.6);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.ach-celebrate-card {
  position: relative;
  width: 100%;
  max-width: 340px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.8rem 1.4rem;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  animation: coverPop 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.ach-celebrate-emoji { font-size: 52px; line-height: 1; margin-bottom: 0.4rem; }
.ach-celebrate-card h2 { font-size: 22px; margin: 0 0 0.4rem; }
.ach-celebrate-card p { color: var(--muted-foreground); font-size: 15px; margin: 0 0 1rem; }
.ach-celebrate-card p strong { color: var(--foreground); }
.ach-more { font-size: 12px; color: var(--yellow); font-weight: 700; }

.confetti {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: inherit;
  pointer-events: none;
}
.confetti-piece {
  position: absolute;
  top: -10px;
  width: 8px;
  height: 12px;
  border-radius: 2px;
  opacity: 0;
  animation-name: confettiFall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes confettiFall {
  0% { transform: translateY(-10px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(420px) rotate(720deg); opacity: 0.2; }
}

/* ---------- Real Terminal cheat-sheet (git missions) ---------- */
.terminal-box {
  margin-top: 0.9rem;
  background: #0d1117;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  text-align: left;
}
.terminal-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted-foreground);
  margin-bottom: 0.5rem;
}
.terminal-label svg { width: 14px; height: 14px; }
.terminal-box pre {
  margin: 0;
  font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #7ee787;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  overflow-x: hidden;
}
.terminal-box pre .term-comment { color: #8b949e; }
.terminal-tip {
  margin: 0.6rem 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  line-height: 1.5;
}
.terminal-tip svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
  color: var(--accent);
}
.terminal-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.6rem;
  padding: 0.45rem 0.8rem;
  border-radius: 8px;
  background: rgba(255, 209, 102, 0.12);
  border: 1px solid rgba(255, 209, 102, 0.35);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  overflow-wrap: break-word;
}
.terminal-link:hover { background: rgba(255, 209, 102, 0.22); }
