:root {
  color-scheme: light;
  --bg: #fbfaff;
  --surface: #ffffff;
  --surface-2: #f4f0ff;
  --ink: #171321;
  --muted: #6f687d;
  --line: #e8e1f5;
  --purple: #7c3aed;
  --purple-dark: #5b21b6;
  --purple-soft: #ede7ff;
  --cyan: #0891b2;
  --amber: #b45309;
  --green: #138a55;
  --red: #c24141;
  --shadow: 0 18px 50px rgba(76, 29, 149, 0.14);
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 10%, rgba(34, 211, 238, 0.14), transparent 28%),
    linear-gradient(180deg, #fff 0%, var(--bg) 42%, #f8fbff 100%);
  color: var(--ink);
}

button {
  font: inherit;
}

.shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  border-right: 1px solid var(--line);
  padding: 28px 18px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 8px 24px;
  color: var(--ink);
  text-decoration: none;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark,
.avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: linear-gradient(145deg, var(--purple), var(--purple-dark));
  color: white;
  box-shadow: 0 10px 24px rgba(124, 58, 237, 0.28);
  font-weight: 900;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.mobile-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  padding: 13px 14px;
  cursor: pointer;
  font-weight: 800;
}

.nav-item:hover,
.nav-item.is-active,
.mobile-tab.is-active {
  background: var(--purple-soft);
  color: var(--purple-dark);
}

.icon {
  width: 24px;
  text-align: center;
  font-size: 18px;
}

.app {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 28px 32px 44px;
}

.topbar,
.section-head,
.lesson-header,
.hero-actions,
.stats {
  display: flex;
  align-items: center;
}

.topbar,
.section-head {
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--purple-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
}

h1 {
  font-size: clamp(32px, 5vw, 46px);
}

h2 {
  font-size: clamp(24px, 3vw, 34px);
}

h3 {
  font-size: 18px;
}

p {
  line-height: 1.5;
}

.stats {
  gap: 10px;
}

.stat {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 76px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  padding: 9px 12px;
  color: var(--ink);
  font-weight: 900;
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  align-items: center;
  gap: 26px;
  margin: 26px 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.92), rgba(244,240,255,0.9)),
    linear-gradient(135deg, rgba(124,58,237,0.11), rgba(8,145,178,0.1));
  box-shadow: var(--shadow);
}

.hero-copy {
  max-width: 640px;
}

.hero-copy p {
  margin: 12px 0 20px;
  max-width: 560px;
  color: var(--muted);
  font-size: 17px;
}

.pill,
.small-badge,
.level-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: #eefafe;
  color: var(--cyan);
  padding: 6px 11px;
  font-size: 12px;
  font-weight: 900;
}

.mascot {
  width: min(260px, 100%);
  justify-self: center;
  filter: drop-shadow(0 20px 28px rgba(76, 29, 149, 0.18));
}

.primary-btn,
.ghost-btn {
  min-height: 48px;
  border-radius: var(--radius);
  padding: 0 18px;
  cursor: pointer;
  font-weight: 900;
}

.primary-btn {
  border: 0;
  background: linear-gradient(180deg, #8b5cf6, var(--purple));
  color: white;
  box-shadow: inset 0 -3px 0 rgba(76, 29, 149, 0.38), 0 12px 24px rgba(124, 58, 237, 0.23);
}

.primary-btn:active {
  transform: translateY(2px);
  box-shadow: inset 0 -1px 0 rgba(76, 29, 149, 0.38), 0 8px 16px rgba(124, 58, 237, 0.18);
}

.ghost-btn {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--purple-dark);
}

.hero-actions {
  gap: 10px;
  flex-wrap: wrap;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
}

.track-panel,
.side-panel > *,
.practice-card,
.profile-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 34px rgba(76, 29, 149, 0.08);
}

.track-panel {
  padding: 24px;
}

.path {
  position: relative;
  display: grid;
  gap: 20px;
  margin-top: 24px;
  padding: 10px 0 6px;
}

.path::before {
  content: "";
  position: absolute;
  top: 42px;
  bottom: 48px;
  left: 42px;
  width: 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--purple), #c4b5fd, #d8b4fe);
  opacity: 0.42;
}

.level-node {
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  min-height: 90px;
  padding: 12px 14px;
}

.node-button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 0;
  border-radius: 50%;
  background: #d9d3e8;
  color: white;
  box-shadow: inset 0 -6px 0 rgba(0, 0, 0, 0.12);
  cursor: pointer;
  font-size: 28px;
  font-weight: 900;
}

.level-node.is-open .node-button {
  background: linear-gradient(180deg, #9f7aea, var(--purple));
  box-shadow: inset 0 -7px 0 rgba(76, 29, 149, 0.42), 0 12px 24px rgba(124, 58, 237, 0.26);
}

.level-node.is-done .node-button {
  background: linear-gradient(180deg, #22c55e, var(--green));
}

.level-copy p {
  margin: 6px 0 0;
  color: var(--muted);
}

.node-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.side-panel {
  display: grid;
  align-content: start;
  gap: 16px;
}

.mission-box,
.leader-box,
.practice-card,
.profile-card {
  padding: 22px;
}

.mission-box p:not(.eyebrow),
.practice-card p,
.profile-card p {
  margin: 8px 0 16px;
  color: var(--muted);
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #ece7f5;
}

.meter span,
.lesson-progress span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--purple), #22d3ee);
  transition: width 0.3s ease;
}

.leader-box ol {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.leader-box li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.leader-box li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.practice-view,
.profile-view {
  margin-top: 24px;
}

.practice-card,
.profile-card {
  max-width: 760px;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
}

.mobile-tabs {
  display: none;
}

.lesson-dialog {
  width: min(760px, calc(100vw - 28px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  background: transparent;
}

.lesson-dialog::backdrop {
  background: rgba(23, 19, 33, 0.42);
  backdrop-filter: blur(8px);
}

.lesson-card {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 30px 70px rgba(23, 19, 33, 0.32);
}

.lesson-header {
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 26px;
  line-height: 1;
}

.lesson-progress {
  flex: 1;
  height: 12px;
  border-radius: 999px;
  background: #ece7f5;
}

.lesson-hearts {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--purple-dark);
  font-weight: 900;
}

.question-area {
  padding: 30px 28px 24px;
}

.question-area h2 {
  margin: 12px 0 22px;
  font-size: clamp(24px, 4vw, 36px);
}

.answers {
  display: grid;
  gap: 12px;
}

.answer-btn {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 64px;
  border: 2px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  font-weight: 800;
}

.answer-btn:hover {
  border-color: #c4b5fd;
  background: #fbf8ff;
}

.answer-key {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--purple-soft);
  color: var(--purple-dark);
  font-weight: 900;
}

.answer-btn.is-correct {
  border-color: rgba(19, 138, 85, 0.55);
  background: #eefcf4;
}

.answer-btn.is-wrong {
  border-color: rgba(194, 65, 65, 0.55);
  background: #fff1f1;
}

.answer-btn:disabled {
  cursor: default;
}

.feedback {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
  background: #f7f3ff;
}

.feedback.is-correct {
  background: #effcf5;
}

.feedback.is-wrong {
  background: #fff4f4;
}

.feedback p {
  margin: 0;
}

.feedback-label {
  color: var(--purple-dark);
  font-weight: 900;
}

@media (max-width: 920px) {
  .shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .app {
    padding: 22px 16px 92px;
  }

  .topbar {
    align-items: flex-start;
  }

  .stats {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  .hero-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .hero-band {
    padding: 22px;
  }

  .mascot {
    width: 210px;
  }

  .mobile-tabs {
    position: fixed;
    right: 12px;
    bottom: 12px;
    left: 12px;
    z-index: 3;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.88);
    padding: 8px;
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 34px rgba(23, 19, 33, 0.14);
  }

  .mobile-tab {
    justify-content: center;
    gap: 5px;
    padding: 10px 8px;
    font-size: 18px;
  }

  .mobile-tab span {
    font-size: 11px;
  }
}

@media (max-width: 620px) {
  .topbar {
    display: grid;
  }

  .stats {
    justify-content: start;
  }

  .stat {
    min-width: 68px;
  }

  .hero-band {
    overflow: hidden;
  }

  .level-node {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .node-button {
    width: 64px;
    height: 64px;
    font-size: 24px;
  }

  .path::before {
    left: 34px;
  }

  .node-meta {
    grid-column: 2;
    justify-self: start;
  }

  .feedback {
    grid-template-columns: 1fr;
  }

  .feedback .primary-btn {
    width: 100%;
  }

  .question-area {
    padding: 24px 18px 20px;
  }

  .answer-btn {
    grid-template-columns: 30px minmax(0, 1fr);
    font-size: 15px;
  }
}
