/* ============================================================
   SnarkyType Typing Tutor — Stylesheet
   Served at /tutor-assets/tutor.css
   Dark theme matching the main SnarkyType brand.
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

/* ── Base ──────────────────────────────────────────────────── */

:root {
  --bg:          #0b1220;
  --surface:     #0e1722;
  --surface-2:   #111d2e;
  --border:      #1e3a50;
  --border-soft: #162030;
  --cyan:        #06b6d4;
  --cyan-glow:   rgba(6, 182, 212, 0.18);
  --cyan-dim:    rgba(6, 182, 212, 0.08);
  --text:        #e6eef6;
  --text-muted:  #94a3b8;
  --text-dim:    #475569;
  --green:       #22c55e;
  --orange:      #f97316;
  --red:         #ef4444;
  --purple:      #a78bfa;
  --yellow:      #facc15;
  --radius-sm:   8px;
  --radius-md:   12px;
  --radius-lg:   18px;
  --shadow:      0 8px 32px rgba(0,0,0,0.45);
  --font:        'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono:        'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Courier New', monospace;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  margin: 0;
  padding: 0;
  line-height: 1.6;
}

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

img { display: block; max-width: 100%; }

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #475569; }

/* ── Navbar ────────────────────────────────────────────────── */

.tutor-nav {
  width: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 58px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.tutor-nav-brand {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--cyan);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.tutor-nav-brand .tutor-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--cyan);
  color: var(--bg);
  padding: 2px 7px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.tutor-nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.tutor-nav-link {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.15s, background 0.15s;
}

.tutor-nav-link:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.tutor-nav-link.active { color: var(--cyan); }

.tutor-nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border-soft);
}

.tutor-nav-user strong { color: var(--text); }

.tutor-btn-nav {
  padding: 7px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  background: var(--cyan);
  color: var(--bg);
  transition: background 0.15s, transform 0.1s;
  text-decoration: none;
  display: inline-block;
}

.tutor-btn-nav:hover { background: #22d3ee; transform: translateY(-1px); text-decoration: none; }

/* ── Page container ────────────────────────────────────────── */

.tutor-page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.tutor-page-narrow {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Typography ────────────────────────────────────────────── */

.tutor-h1 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.2;
}

.tutor-h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}

.tutor-h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 14px;
}

.tutor-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 32px;
}

/* ── Cards ─────────────────────────────────────────────────── */

.tutor-card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px;
}

.tutor-card-hover {
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}

.tutor-card-hover:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.12);
  text-decoration: none;
}

/* ── Buttons ────────────────────────────────────────────────── */

.tutor-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  text-decoration: none;
}

.tutor-btn:hover { text-decoration: none; }

.tutor-btn-primary {
  background: var(--cyan);
  color: var(--bg);
}
.tutor-btn-primary:hover { background: #22d3ee; transform: translateY(-1px); }

.tutor-btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.tutor-btn-secondary:hover { background: #1a2d42; transform: translateY(-1px); }

.tutor-btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.tutor-btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }

.tutor-btn-lg {
  padding: 13px 30px;
  font-size: 1.05rem;
}

.tutor-btn-sm {
  padding: 6px 15px;
  font-size: 0.83rem;
}

/* ── KPI chips / stats ─────────────────────────────────────── */

.tutor-kpi-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.tutor-kpi {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  text-align: center;
}

.tutor-kpi-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
  margin-bottom: 4px;
}

.tutor-kpi-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── Progress bar ──────────────────────────────────────────── */

.tutor-progress-bar {
  height: 6px;
  background: var(--surface-2);
  border-radius: 99px;
  overflow: hidden;
  margin-top: 8px;
}

.tutor-progress-fill {
  height: 100%;
  background: var(--cyan);
  border-radius: 99px;
  transition: width 0.4s ease;
}

.tutor-progress-fill.done { background: var(--green); }

/* ── Badges ─────────────────────────────────────────────────── */

.tutor-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.tutor-badge-done     { background: rgba(34,197,94,0.15);  color: var(--green);  border: 1px solid rgba(34,197,94,0.25); }
.tutor-badge-new      { background: rgba(6,182,212,0.15);  color: var(--cyan);   border: 1px solid rgba(6,182,212,0.25); }
.tutor-badge-hard     { background: rgba(239,68,68,0.12);  color: #f87171;       border: 1px solid rgba(239,68,68,0.22); }
.tutor-badge-category { background: var(--surface-2);      color: var(--text-muted); border: 1px solid var(--border); }

/* ── Lesson card ────────────────────────────────────────────── */

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: var(--text);
}

.lesson-card:hover {
  border-color: var(--cyan);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(6, 182, 212, 0.1);
  text-decoration: none;
  color: var(--text);
}

.lesson-card.completed {
  border-color: rgba(34, 197, 94, 0.3);
}

.lesson-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.lesson-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.lesson-card-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.lesson-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.lesson-card-stat {
  font-size: 0.8rem;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  gap: 4px;
}

.lesson-card-stat strong { color: var(--text-muted); }

.lesson-card-wpm {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--cyan);
}

/* ── Typing area ────────────────────────────────────────────── */

.tutor-typing-wrap {
  position: relative;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 36px 32px;
  font-family: var(--mono);
  font-size: 1.8rem;
  line-height: 2.1;
  letter-spacing: 0.02em;
  cursor: text;
  min-height: 230px;
  overflow: hidden;
  user-select: none;
  transition: border-color 0.15s;
}

.tutor-typing-wrap:focus-within { border-color: rgba(6, 182, 212, 0.5); box-shadow: 0 0 0 2px rgba(6,182,212,0.08); }

.tutor-char { transition: color 0.08s; }
.tutor-char.correct { color: var(--cyan); }
.tutor-char.incorrect { color: var(--red); background: rgba(239,68,68,0.12); border-radius: 2px; }
.tutor-char.current { color: var(--text); }
.tutor-char.pending { color: var(--text-dim); }

.tutor-caret {
  position: absolute;
  display: inline-block;
  width: 2px;
  background: var(--cyan);
  border-radius: 1px;
  pointer-events: none;
  transition: left 0.04s, top 0.04s;
  box-shadow: 0 0 8px var(--cyan);
}

@keyframes tutor-caret-blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

.tutor-caret.idle { animation: tutor-caret-blink 0.95s step-end infinite; }

.tutor-typing-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 0.9rem;
  pointer-events: none;
  gap: 8px;
}

/* ── Lesson live stats bar ─────────────────────────────────── */

.tutor-live-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}

.tutor-live-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 60px;
}

.tutor-live-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
}

.tutor-live-stat-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.06em;
  margin-top: 2px;
}

/* ── Result overlay ────────────────────────────────────────── */

.tutor-result {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tutor-result.show { display: flex; }

.tutor-result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow);
}

.tutor-result-emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 16px;
}

.tutor-result-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
}

.tutor-result-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 28px;
}

.tutor-result-stats {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 28px;
}

.tutor-result-stat {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 16px 24px;
  min-width: 100px;
}

.tutor-result-stat-val {
  font-size: 2rem;
  font-weight: 800;
  color: var(--cyan);
  line-height: 1;
}

.tutor-result-stat-lbl {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}

.tutor-result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Category section ──────────────────────────────────────── */

.tutor-category-section {
  margin-bottom: 40px;
}

.tutor-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

/* ── Hero (home page) ──────────────────────────────────────── */

.tutor-hero {
  text-align: center;
  padding: 60px 0 48px;
}

.tutor-hero-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 16px;
}

.tutor-hero-title {
  font-size: clamp(2rem, 6vw, 3.4rem);
  font-weight: 900;
  color: var(--text);
  margin: 0 0 16px;
  line-height: 1.1;
}

.tutor-hero-title span { color: var(--cyan); }

.tutor-hero-desc {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.tutor-hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ── Feature grid (home page) ──────────────────────────────── */

.tutor-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
  margin: 48px 0;
}

.tutor-feature {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 24px 20px;
}

.tutor-feature-icon {
  font-size: 1.8rem;
  margin-bottom: 12px;
}

.tutor-feature-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.tutor-feature-desc {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ── Next lesson banner ────────────────────────────────────── */

.tutor-next-banner {
  display: flex;
  align-items: center;
  gap: 20px;
  background: linear-gradient(135deg, rgba(6,182,212,0.1), rgba(6,182,212,0.04));
  border: 1px solid rgba(6,182,212,0.25);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin-bottom: 32px;
  text-decoration: none;
  transition: border-color 0.15s, transform 0.15s;
  color: var(--text);
}

.tutor-next-banner:hover {
  border-color: var(--cyan);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--text);
}

.tutor-next-banner-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--cyan);
  margin-bottom: 4px;
}

.tutor-next-banner-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.tutor-next-banner-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.tutor-next-banner-arrow {
  font-size: 1.5rem;
  color: var(--cyan);
  margin-left: auto;
  flex-shrink: 0;
}

/* ── Toast ─────────────────────────────────────────────────── */

.tutor-toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  z-index: 1000;
  transition: transform 0.25s ease;
  pointer-events: none;
  white-space: nowrap;
}

.tutor-toast.show { transform: translateX(-50%) translateY(0); }
.tutor-toast.success { border-color: rgba(34,197,94,0.4); color: var(--green); }
.tutor-toast.error   { border-color: rgba(239,68,68,0.4);  color: #f87171; }

/* ── Target row (lesson detail) ────────────────────────────── */

.tutor-target-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.tutor-target-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  padding: 5px 14px;
  font-size: 0.83rem;
  color: var(--text-muted);
}

.tutor-target-chip strong { color: var(--cyan); }

/* ── Responsive ────────────────────────────────────────────── */

@media (max-width: 640px) {
  .tutor-page, .tutor-page-narrow { padding: 24px 16px 60px; }
  .tutor-nav { padding: 0 16px; height: 52px; }
  .tutor-live-stats { gap: 14px; padding: 12px 14px; flex-wrap: wrap; }
  .tutor-typing-wrap { font-size: 1.15rem; padding: 24px 18px; }
  .tutor-kpi-row { grid-template-columns: repeat(2, 1fr); }
  .lesson-grid { grid-template-columns: 1fr; }
  .tutor-result-stats { flex-direction: column; align-items: center; }
  .tutor-hero { padding: 36px 0 32px; }
}

/* ── Pathway (lessons page) ────────────────────────────────── */

.pathway-page {
  max-width: 680px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

.pathway-header {
  text-align: center;
  padding: 32px 0 48px;
}

.pathway-zone-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 6px 18px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 32px;
}

.pathway-zone-label .zone-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan);
}

/* The scrollable pathway container */
.pathway-track {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

/* SVG spine that connects nodes */
.pathway-svg {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  width: 320px;
  pointer-events: none;
  z-index: 0;
}

/* Zone separator */
.pathway-zone-sep {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 8px;
  z-index: 2;
  position: relative;
}

.pathway-zone-sep-line {
  flex: 1;
  height: 1px;
  background: var(--border-soft);
}

.pathway-zone-sep-label {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--border-soft);
}

/* Each pathway row alternates left / right / center */
.pathway-row {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 6px 0;
}

.pathway-row.left  { justify-content: flex-start; padding-left: 24px; }
.pathway-row.right { justify-content: flex-end;   padding-right: 24px; }
.pathway-row.center { justify-content: center; }

/* The node itself */
.pathway-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  width: 200px;
  transition: transform 0.15s;
}

.pathway-node:hover { transform: scale(1.04); text-decoration: none; color: var(--text); }

.pathway-node-bubble {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  position: relative;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.pathway-node:hover .pathway-node-bubble {
  border-color: var(--cyan);
  box-shadow: 0 0 0 4px rgba(6,182,212,0.15), 0 4px 20px rgba(0,0,0,0.4);
}

.pathway-node.completed .pathway-node-bubble {
  background: rgba(34,197,94,0.12);
  border-color: var(--green);
}

.pathway-node.in-progress .pathway-node-bubble {
  border-color: var(--cyan);
  background: rgba(6,182,212,0.08);
}

.pathway-node.locked .pathway-node-bubble {
  opacity: 0.45;
  filter: grayscale(0.8);
}

/* Checkmark for completed */
.pathway-node-check {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 900;
  color: #fff;
  border: 2px solid var(--bg);
}

/* Progress ring (SVG circle) */
.pathway-node-ring {
  position: absolute;
  inset: -4px;
  width: calc(100% + 8px);
  height: calc(100% + 8px);
  border-radius: 50%;
}

.pathway-node-label {
  margin-top: 8px;
  text-align: center;
}

.pathway-node-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.pathway-node.locked .pathway-node-title {
  color: var(--text-dim);
}

.pathway-node-wpm {
  font-size: 0.72rem;
  color: var(--cyan);
  font-weight: 700;
  margin-top: 2px;
}

.pathway-node-target {
  font-size: 0.7rem;
  color: var(--text-dim);
  margin-top: 1px;
}

/* Active / next node pulse */
@keyframes pathway-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(6,182,212,0.4), 0 4px 16px rgba(0,0,0,0.3); }
  50%       { box-shadow: 0 0 0 8px rgba(6,182,212,0.0), 0 4px 16px rgba(0,0,0,0.3); }
}

.pathway-node.next-up .pathway-node-bubble {
  border-color: var(--cyan);
  animation: pathway-pulse 2s ease-in-out infinite;
}

/* Connector line between bubbles */
.pathway-connector {
  width: 3px;
  background: var(--border-soft);
  border-radius: 2px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  transition: background 0.3s;
}

.pathway-connector.done { background: rgba(34,197,94,0.4); }
.pathway-connector.active { background: rgba(6,182,212,0.35); }

/* Curved connector path (drawn per-row) */
.pathway-curve-row {
  width: 100%;
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

/* ── Progress strip inside typing area ─────────────────────── */

.tutor-typing-progress-wrap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border-soft);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  overflow: hidden;
  pointer-events: none;
}

.tutor-typing-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--cyan), #22d3ee);
  transition: width 0.12s ease;
}

/* ── Keyboard section ───────────────────────────────────────── */

.kb-section {
  margin-top: 36px;
}

.kb-hint-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  margin-bottom: 10px;
}

.kb-hint-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: 99px;
  padding: 3px 18px;
  min-width: 130px;
  text-align: center;
  display: inline-block;
  transition: color 0.15s;
}

.kb-wrap {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 18px 20px 16px;
  overflow-x: auto;
}

.kb-rows {
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: flex-start;
  min-width: 580px;
}

.kb-row {
  display: flex;
  gap: 4px;
}

.kb-key {
  --kc: #2a3f55;
  min-width: 40px;
  height: 42px;
  padding: 0 8px;
  background: #0d1a27;
  border: 1px solid #1a3244;
  border-bottom: 3px solid var(--kc);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-family: var(--mono);
  color: #4a6272;
  user-select: none;
  cursor: default;
  white-space: nowrap;
  transition: transform 0.07s, background 0.1s, color 0.1s, box-shadow 0.12s;
}

/* Finger colour-coded bottom rail */
.kb-key[data-f="lp"] { --kc: #7c3aed; }
.kb-key[data-f="lr"] { --kc: #2563eb; }
.kb-key[data-f="lm"] { --kc: #059669; }
.kb-key[data-f="li"] { --kc: #d97706; }
.kb-key[data-f="lt"] { --kc: #db2777; }
.kb-key[data-f="rt"] { --kc: #db2777; }
.kb-key[data-f="ri"] { --kc: #d97706; }
.kb-key[data-f="rm"] { --kc: #059669; }
.kb-key[data-f="rr"] { --kc: #2563eb; }
.kb-key[data-f="rp"] { --kc: #7c3aed; }

.kb-wide  { min-width: 62px; }
.kb-space { min-width: 220px; flex: 1; }

/* Next-key pulse */
.kb-key.kb-next {
  background: rgba(6,182,212,0.09);
  border-color: rgba(6,182,212,0.3);
  box-shadow: 0 0 0 2px rgba(6,182,212,0.4);
  color: var(--cyan);
  animation: kb-pulse 1.2s ease-in-out infinite;
}

@keyframes kb-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(6,182,212,0.45), 0 0 8px rgba(6,182,212,0.12); }
  50%       { box-shadow: 0 0 0 3px rgba(6,182,212,0.22), 0 0 16px rgba(6,182,212,0.22); }
}

/* Key press feedback */
.kb-key.kb-correct {
  background: rgba(6,182,212,0.18) !important;
  border-bottom-color: var(--cyan) !important;
  color: var(--cyan) !important;
  transform: translateY(2px);
}

.kb-key.kb-wrong {
  background: rgba(239,68,68,0.18) !important;
  border-bottom-color: var(--red) !important;
  color: var(--red) !important;
  transform: translateY(2px);
}

/* ── Hands ─────────────────────────────────────────────────── */

.kb-hands-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 20px 0;
  margin-top: 6px;
  min-width: 580px;
}

.kb-hand {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.kb-fingers-row {
  display: flex;
  align-items: flex-end;
  gap: 3px;
}

.kb-hand-palm {
  height: 20px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.kb-finger {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.kb-finger-tip {
  width: 24px;
  height: 48px;
  border-radius: 12px 12px 3px 3px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  transition: transform 0.09s ease, background 0.09s, border-color 0.09s, box-shadow 0.09s;
}

/* Realistic finger lengths */
.kb-finger-lp .kb-finger-tip, .kb-finger-rp .kb-finger-tip { height: 36px; }
.kb-finger-lr .kb-finger-tip, .kb-finger-rr .kb-finger-tip { height: 50px; }
.kb-finger-lm .kb-finger-tip, .kb-finger-rm .kb-finger-tip { height: 58px; }
.kb-finger-li .kb-finger-tip, .kb-finger-ri .kb-finger-tip { height: 50px; }
.kb-finger-lt .kb-finger-tip, .kb-finger-rt .kb-finger-tip {
  height: 22px;
  width: 30px;
  border-radius: 10px;
  transform: translateY(10px);
}

/* Per-finger colour variables */
.kb-finger-lp, .kb-finger-rp { --kfc: #7c3aed; }
.kb-finger-lr, .kb-finger-rr { --kfc: #2563eb; }
.kb-finger-lm, .kb-finger-rm { --kfc: #059669; }
.kb-finger-li, .kb-finger-ri { --kfc: #d97706; }
.kb-finger-lt, .kb-finger-rt { --kfc: #db2777; }

/* Active finger press */
.kb-finger.kb-finger-active .kb-finger-tip {
  border-color: var(--kfc) !important;
  background: color-mix(in srgb, var(--kfc) 20%, var(--surface-2)) !important;
  box-shadow: 0 0 14px color-mix(in srgb, var(--kfc) 55%, transparent);
  transform: translateY(6px) !important;
}

.kb-finger-lt.kb-finger-active .kb-finger-tip,
.kb-finger-rt.kb-finger-active .kb-finger-tip {
  transform: translateY(14px) !important;
}

@media (max-width: 720px) {
  .kb-section { display: none; }
}

