/* ============================================
   MICROSERVICES DOJO — Cozy Glass System
   Dark · Light · Calm · Thumb-friendly
   ============================================ */

:root {
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 22px;
  --radius-pill: 100px;

  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;

  /* Light Mode */
  --bg-deep: #F5F2EE;
  --bg-glass: rgba(255,255,255,0.78);
  --border-glass: rgba(0,0,0,0.06);
  --text: #2A2A2A;
  --text-dim: #6B6B6B;
  --text-tertiary: #A0A0A0;
  --text-inverse: #FFFFFF;
  --accent: #6B8E5A;
  --accent-glow: rgba(107,142,90,0.14);
  --accent-light: #8CAB7A;
  --success: #5A9A7A;
  --error: #C2706A;
  --warning: #C9A35A;
  --info: #5A8A9A;
  --code-bg: #F0EDE8;
  --code-text: #2A2A2A;

  /* Clear glass with tint (matches nd28 homepage) */
  --glass: rgba(251,246,240,0.42);
  --glass-tint: linear-gradient(90deg, rgba(211,79,138,0.10), rgba(46,158,143,0.08));
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --mono: 'Geist Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.08);
  --shadow-accent: 0 4px 20px rgba(107,142,90,0.12);
}

body.dark {
  --bg-deep: #12141A;
  --bg-glass: rgba(28,32,40,0.78);
  --border-glass: rgba(255,255,255,0.08);
  --text: #E8E6E3;
  --text-dim: #8A8F9A;
  --text-tertiary: #4A4F5A;
  --text-inverse: #12141A;
  --accent: #8CAB7A;
  --accent-glow: rgba(140,171,122,0.14);
  --accent-light: #A5C494;
  --success: #7AB89A;
  --error: #D48882;
  --warning: #D4B872;
  --info: #7A9AA8;
  --code-bg: #1A1C22;
  --code-text: #C8CCD4;

  /* Clear glass with tint (matches nd28 homepage) */
  --glass: rgba(21,19,28,0.42);
  --glass-tint: linear-gradient(90deg, rgba(247,184,210,0.14), rgba(95,211,196,0.10));
  --font: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  --mono: 'Geist Mono', 'SF Mono', Monaco, 'Cascadia Code', monospace;

  --shadow-sm: 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,0.45);
  --shadow-accent: 0 4px 20px rgba(140,171,122,0.10);
}

/* ============================================
   RESET & BASE
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 16px;
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============================================
   BACKGROUND
   ============================================ */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-deep);
}

.bg-layer::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 10%, var(--accent-glow) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 90%, rgba(90,110,160,0.04) 0%, transparent 50%);
}

/* ============================================
   APP SHELL
   ============================================ */
.app-shell {
  position: relative;
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

/* ============================================
   SECTIONS
   ============================================ */
.app-main {
  display: none;
  padding: 0 1.25rem 120px;
}

.app-main.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.cozy-hint {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.9375rem;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
}

/* ============================================
   GLASS CARDS
   ============================================ */
.glass-card {
  background: var(--glass-tint), var(--glass);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  padding: 1.5rem;
}

.card-heading {
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

/* ============================================
   HOME
   ============================================ */
.center-card {
  max-width: 100%;
}

.mission-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.mission-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  padding: 1.125rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: left;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  transition: all 0.2s ease;
}

.mission-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
  background: var(--accent-glow);
}

.mission-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.mission-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.125rem;
}

.mission-meta {
  font-size: 0.8125rem;
  color: var(--text-dim);
  font-weight: 500;
}

.home-stats {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0 -1.25rem 0.75rem;
  padding: max(0.6rem, env(safe-area-inset-top)) 1.25rem 0.6rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
}

.stat-pill {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dim);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.xp-bar-thin {
  flex: 1;
  height: 6px;
  background: var(--border-glass);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.xp-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
   SKILL PATH
   ============================================ */
.skill-path {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 0.5rem 0.25rem 1.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.skill-path::-webkit-scrollbar { display: none; }

.skill-node {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  scroll-snap-align: center;
  padding: 0.25rem;
  background: transparent;
  border: none;
  color: inherit;
  font-family: inherit;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.skill-node:disabled { cursor: default; }

.node-done { opacity: 1; }
.node-current { opacity: 1; }

.node-circle {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  background: var(--bg-glass);
  border: 2px solid var(--border-glass);
  transition: all 0.3s ease;
}

.node-current .node-circle {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow), var(--shadow-accent);
}

.node-done .node-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--text-inverse);
}

.node-name {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-dim);
  text-align: center;
  max-width: 60px;
  line-height: 1.2;
}

.connector {
  width: 18px;
  height: 2px;
  background: var(--border-glass);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.connector.done { background: var(--accent); }

/* ============================================
   CHALLENGE LIST
   ============================================ */
.challenge-list {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
}

.challenge-card {
  width: 100%;
  padding: 1.25rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  text-align: left;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  transition: all 0.2s ease;
}

.challenge-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
}

.challenge-difficulty {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.difficulty-easy { color: var(--success); }
.difficulty-medium { color: var(--warning); }
.difficulty-hard { color: var(--error); }

.challenge-title {
  font-size: 1.0625rem;
  font-weight: 800;
  margin-bottom: 0.375rem;
  letter-spacing: -0.01em;
}

.challenge-desc {
  font-size: 0.9375rem;
  color: var(--text-dim);
  line-height: 1.5;
}

/* ============================================
   FLOATING DOCK
   ============================================ */
.floating-dock {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.375rem;
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 0.375rem;
  box-shadow: var(--shadow-lg);
  z-index: 100;
}

.dock-item {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.dock-icon { font-size: 1.5rem; }

.dock-item:active { transform: scale(0.88); }

.dock-item.active {
  background: var(--accent-glow);
  color: var(--accent);
  box-shadow: var(--shadow-accent);
}

/* ============================================
   MODALS
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: calc(100% - 2.5rem);
  max-width: 420px;
  max-height: 88vh;
  background: var(--bg-glass);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  z-index: 210;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.modal-handle {
  width: 36px;
  height: 4px;
  background: var(--text-tertiary);
  border-radius: 2px;
  margin: 0.625rem auto;
  opacity: 0.45;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 2;
}

.modal-body {
  overflow-y: auto;
  padding: 0.5rem 1.25rem 1rem;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 0.75rem 1.25rem 1.25rem;
  border-top: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.modal-title {
  font-size: 1.0625rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  margin-bottom: 0.5rem;
}

/* Bottom sheet on small screens */
@media (max-width: 640px) {
  .modal {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    transform: translateY(100%);
    width: 100%;
    max-width: 100%;
    max-height: calc(100dvh - 6vh);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
  }
  .modal.open {
    transform: translateY(0);
  }
}

/* ============================================
   PROFILE MODAL
   ============================================ */
.profile-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.level-circle {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--accent-glow);
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  margin: 0 auto 0.375rem;
}

.level-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-dim);
}

.xp-block { margin-bottom: 1.25rem; }

.xp-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-bottom: 0.375rem;
}

.xp-bar {
  width: 100%;
  height: 10px;
  background: var(--border-glass);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.badges-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.875rem;
  margin-bottom: 1.25rem;
}

.badge-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  opacity: 0.35;
  transition: opacity 0.3s ease;
}

.badge-cell.earned { opacity: 1; }

.badge-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.375rem;
}

.badge-cell.earned .badge-icon {
  background: var(--accent-glow);
  border-color: var(--accent);
}

.badge-name {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-dim);
  line-height: 1.2;
}

.settings-block { margin-top: 1rem; }

.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 0.875rem 1rem;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  margin-bottom: 0.625rem;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.setting-row:active {
  background: var(--accent-glow);
}

.setting-row.danger { color: var(--error); }

.setting-value {
  color: var(--text-dim);
  font-weight: 700;
}

/* ============================================
   CONCEPT & CHALLENGE MODAL CONTENT
   ============================================ */
.concept-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: var(--accent-glow);
  color: var(--accent);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
}

.concept-title, .challenge-title {
  font-size: 1.125rem;
  font-weight: 800;
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
}

.cozy-text {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.diagram-box {
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 1rem;
}

.quiz-question {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.quiz-option {
  width: 100%;
  padding: 1rem;
  margin-bottom: 0.625rem;
  background: var(--bg-glass);
  border: 2px solid var(--border-glass);
  border-radius: var(--radius-lg);
  text-align: left;
  font-size: 0.9375rem;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-option:active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.quiz-option.correct {
  border-color: var(--success);
  background: rgba(90,154,122,0.10);
}

.quiz-option.wrong {
  border-color: var(--error);
  background: rgba(194,112,106,0.10);
}

.code-toggle {
  width: 100%;
  padding: 0.75rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  color: var(--text-dim);
  font-size: 0.875rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin: 0.75rem 0;
  transition: all 0.2s ease;
}

.code-toggle:active {
  background: var(--accent-glow);
  color: var(--accent);
}

.code-block {
  display: none;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: var(--radius-lg);
  padding: 1rem;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.code-block.visible { display: block; }

/* ============================================
   REFLECTION MODAL
   ============================================ */
.mood-row {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin: 0.75rem 0 1rem;
}

.mood-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  background: var(--bg-glass);
  font-size: 1.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.mood-btn:active { transform: scale(0.92); }

.mood-btn.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: scale(1.06);
}

.prompt-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  margin-bottom: 1rem;
}

.prompt-card {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
}

.prompt-card:active,
.prompt-card.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.prompt-label {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}

.form-textarea {
  width: 100%;
  min-height: 120px;
  padding: 1rem;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border-glass);
  background: var(--bg-deep);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  line-height: 1.6;
  resize: vertical;
  transition: all 0.15s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 0 1.5rem;
  border-radius: var(--radius-pill);
  border: none;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  width: 100%;
  text-decoration: none;
  color: inherit;
  font-family: inherit;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--text-inverse);
  box-shadow: var(--shadow-accent);
}

.btn-primary:active { background: var(--accent-light); }

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(12px);
}

.btn-secondary:active { background: var(--accent-glow); }

.btn-small {
  min-height: 36px;
  padding: 0 0.875rem;
  font-size: 0.875rem;
  width: auto;
}

/* ============================================
    TOASTS
    ============================================ */
.toast {
  position: fixed;
  bottom: 108px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 0.875rem 1.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  white-space: nowrap;
}

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

/* ============================================
    CELEBRATION
    ============================================ */
.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
}

.celebration-layer.active {
  opacity: 1;
  animation: celebrationFade 1.4s ease forwards;
}

@keyframes celebrationFade {
  0%   { opacity: 0; }
  15%  { opacity: 1; }
  70%  { opacity: 1; }
  100% { opacity: 0; }
}

.bloom-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  transform: scale(0.5);
  opacity: 0;
}

.celebration-layer.active .bloom-ring {
  animation: bloomExpand 1.2s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes bloomExpand {
  0%   { transform: scale(0.5); opacity: 0; }
  30%  { transform: scale(1.8); opacity: 0.6; }
  100% { transform: scale(3.5); opacity: 0; }
}

.checkmark-svg {
  width: 80px;
  height: 80px;
  position: relative;
  z-index: 2;
}

.checkmark-circle {
  stroke-dasharray: 276;
  stroke-dashoffset: 276;
}

.celebration-layer.active .checkmark-circle {
  animation: drawCircle 0.5s ease 0.15s forwards;
}

@keyframes drawCircle {
  to { stroke-dashoffset: 0; }
}

.checkmark-path {
  stroke-dasharray: 60;
  stroke-dashoffset: 60;
}

.celebration-layer.active .checkmark-path {
  animation: drawPath 0.4s ease 0.45s forwards;
}

@keyframes drawPath {
  to { stroke-dashoffset: 0; }
}

/* ============================================
    RESOURCES
    ============================================ */
.resource-list {
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.resource-item {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.resource-item:active {
  border-color: var(--accent);
  background: var(--accent-glow);
  transform: scale(0.98);
}

.resource-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}

.resource-info {
  flex: 1;
  min-width: 0;
}

.resource-title {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.125rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.resource-type {
  font-size: 0.8125rem;
  color: var(--text-dim);
  text-transform: capitalize;
}

.resource-arrow {
  font-size: 1.125rem;
  color: var(--text-dim);
}

/* ============================================
    BOOKMARKS
    ============================================ */
.bookmark-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  color: var(--text-tertiary);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.bookmark-btn:active { transform: scale(0.9); }

.bookmark-btn.active {
  color: var(--warning);
  border-color: var(--warning);
  background: rgba(201, 163, 90, 0.10);
}

.bookmark-row {
  display: block;
  width: 100%;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.bookmark-row:active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

/* ============================================
    PROGRESS
    ============================================ */
.progress-card {
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.625rem;
}

.progress-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.progress-count {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dim);
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-glass);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ============================================
    BUILD INFO
    ============================================ */
.info-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--text-tertiary);
  background: transparent;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.5rem;
  transition: all 0.2s ease;
}

.info-btn:active {
  transform: scale(0.9);
  border-color: var(--accent);
  color: var(--accent);
}

.build-info {
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  animation: fadeInUp 0.25s ease;
}

.build-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.375rem 0;
  border-bottom: 1px solid var(--border-glass);
}

.build-row:last-child {
  border-bottom: none;
}

.build-row span:first-child {
  color: var(--text-dim);
  font-weight: 600;
}

.build-row span:last-child {
  color: var(--text);
  font-weight: 700;
  font-family: 'SF Mono', Monaco, monospace;
  font-size: 0.75rem;
}

.build-refresh {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  color: var(--text-dim);
  font-size: 0.8125rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
}

.build-refresh:active {
  background: var(--accent-glow);
  color: var(--accent);
  border-color: var(--accent);
}

/* ============================================
    SEARCH
    ============================================ */
.search-input {
  width: 100%;
  padding: 0.875rem 1rem;
  margin-bottom: 1rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-glass);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: all 0.2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-glow);
}

.search-input::placeholder {
  color: var(--text-tertiary);
}

/* ============================================
    ONBOARDING
    ============================================ */
.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.onboarding-overlay:not(.hidden) {
  opacity: 1;
  pointer-events: auto;
}

.onboarding-card {
  background: var(--bg-glass);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.4s var(--ease-smooth);
}

.onboarding-emoji {
  font-size: 3rem;
  margin-bottom: 0.75rem;
}

.onboarding-title {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.onboarding-text {
  font-size: 1rem;
  color: var(--text-dim);
  line-height: 1.6;
  margin-bottom: 1.5rem;
}

/* ============================================
    REFLECTIONS LIST
    ============================================ */
.reflection-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-glass);
}

.reflection-item:last-child {
  border-bottom: none;
}

.reflection-date {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
}

.reflection-prompt {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.25rem;
  color: var(--text);
}

.reflection-text {
  font-size: 0.875rem;
  color: var(--text-dim);
  line-height: 1.5;
}

.reflection-mood {
  font-size: 1rem;
  margin-top: 0.25rem;
}

/* ============================================
    INSTALL BANNER
    ============================================ */
.install-banner {
  position: fixed;
  top: 0.75rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 150;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-pill);
  padding: 0.625rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow-md);
  animation: fadeInUp 0.3s ease;
}

.install-btn {
  background: var(--accent);
  color: var(--text-inverse);
  border: none;
  padding: 0.375rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
}

.install-btn:active { transform: scale(0.95); }

.install-dismiss {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
}

/* ============================================
    STATS CARD
    ============================================ */
.stats-card {
  padding: 1.25rem;
  margin-bottom: 1rem;
}

.stats-title {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.75rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.875rem;
  text-align: center;
}

.stat-cell {
  padding: 0.625rem 0.25rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-dim);
  margin-top: 0.25rem;
}

/* ============================================
    RL BRAIN (Q-TABLE HEATMAP)
    ============================================ */
.rl-grid {
  display: grid;
  grid-template-columns: auto repeat(3, 1fr);
  gap: 0.25rem;
  padding: 0.5rem;
  background: var(--bg-glass);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
}

.rl-cell {
  padding: 0.375rem 0.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  font-family: 'SF Mono', Monaco, monospace;
  transition: background 0.3s ease;
}

.rl-header {
  color: var(--text-dim);
  background: transparent;
  font-weight: 700;
  text-transform: capitalize;
}

.rl-header.rl-current {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ============================================
    PHASED SKILL PATH
    ============================================ */
.phase-modal .modal-body {
  animation: fadeInUp 0.35s ease;
}

.phase-block {
  margin-bottom: 1.5rem;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-sm);
}

.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.phase-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 800;
  color: var(--text);
}

.phase-icon {
  font-size: 1.125rem;
}

.phase-progress {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-dim);
}

.phase-bar-wrap {
  width: 100%;
  height: 4px;
  background: var(--border-glass);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin-bottom: 1rem;
}

.phase-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-light));
  border-radius: var(--radius-pill);
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.phase-nodes {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 0.5rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.phase-nodes::-webkit-scrollbar { display: none; }

.phase-connector {
  width: 18px;
  height: 2px;
  background: var(--border-glass);
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.phase-connector.done { background: var(--accent); }

.skill-path-line {
  fill: none;
  stroke: var(--border-glass);
  stroke-width: 2;
  stroke-linecap: round;
}

.skill-path-line.done {
  stroke: var(--accent);
  stroke-dasharray: 200;
  stroke-dashoffset: 0;
  animation: drawLine 0.8s ease forwards;
}

@keyframes drawLine {
  from { stroke-dashoffset: 200; }
}

/* ============================================
    UTILITIES
    ============================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }

/* Scrollbar */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-glass); border-radius: var(--radius-pill); }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
