#map-page {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: auto;
  background: var(--bg);
}

#map-header {
  padding: 40px 48px 28px;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 48px;
  position: relative;
}

#map-header-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

#map-intro-video {
  flex: 1;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
}

#map-intro-video iframe {
  width: 100%;
  height: 100%;
  display: block;
}

#map-course-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--orange);
  margin-bottom: 6px;
}

#map-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

#map-description {
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 680px;
  line-height: 1.6;
  margin-bottom: 16px;
}

#btn-sandbox {
  display: inline-block;
  margin-top: 20px;
  text-decoration: none;
  background: var(--orange);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 8px;
  box-shadow: 0 4px 0 #8a2e00;
  transition: background 0.15s, transform 0.1s, box-shadow 0.1s;
}

#btn-sandbox:hover { background: #f06020; }

#btn-sandbox:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #8a2e00;
}

/* ── Scroll area ── */
#tree-scroll {
  padding: 20px 48px 48px;
}

#map-page::-webkit-scrollbar { height: 6px; width: 6px; }
#map-page::-webkit-scrollbar-track { background: transparent; }
#map-page::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }

/* ── Positioned container ── */
#tree-container {
  position: relative;
}

/* ── SVG lines ── */
#tree-svg {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}

.tree-line {
  stroke: #333;
  stroke-width: 2;
}

.tree-line-vert {
  stroke: #2a2a2a;
  stroke-dasharray: 4 4;
}

.tree-arrow {
  fill: #444;
}

.level-label {
  font-family: 'Source Code Pro', ui-monospace, monospace;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  fill: #e1510a;
}

/* ── Lesson nodes ── */
.lesson-node {
  position: absolute;
  width: 170px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.lesson-node:hover {
  border-color: var(--orange);
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(225, 81, 10, 0.18);
}

.lesson-thumb-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #111;
  overflow: hidden;
}

.lesson-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.lesson-info {
  padding: 12px 14px;
}

.lesson-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.4;
}

/* Completed node */
.lesson-node.complete {
  border-color: var(--orange);
  box-shadow: 0 0 16px rgba(225, 81, 10, 0.3);
}

.complete-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 20px;
  height: 20px;
  background: var(--orange);
  color: #fff;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Locked node */
.lesson-node.locked {
  opacity: 0.35;
  pointer-events: none;
  filter: grayscale(1);
}

/* Unlock animation on connector lines */
@keyframes drawLine {
  from { stroke-dashoffset: var(--line-len); }
  to   { stroke-dashoffset: 0; }
}

.tree-line-vert.unlocked {
  stroke: #e1510a55;
  stroke-dasharray: var(--line-len);
  animation: drawLine 0.8s ease forwards;
}

/* Topbar link buttons */
#btn-skillmap {
  text-decoration: none;
  background: #2e2e2e;
  color: var(--white);
  box-shadow: 0 4px 0 #000;
}

#btn-skillmap:hover { background: #3a3a3a; }

#btn-skillmap:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #000;
}

