:root {
  --ink: #091642;
  --muted: #647099;
  --panel: rgba(255, 255, 255, 0.84);
  --line: rgba(49, 68, 140, 0.12);
  --navy: #071236;
  --purple: #6d38f5;
  --purple-dark: #3117b8;
  --blue: #0984d8;
  --green: #17b35b;
  --orange: #f06b05;
  --shadow: 0 22px 55px rgba(29, 39, 98, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% -10%, rgba(106, 56, 245, 0.18), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(11, 151, 226, 0.2), transparent 34rem),
    linear-gradient(135deg, #f8fbff 0%, #eef2ff 48%, #ffffff 100%);
}

button,
a {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  display: grid;
  grid-template-columns: 268px minmax(640px, 1fr) 330px;
  gap: 24px;
  max-width: 1580px;
  margin: 0 auto;
  padding: 0 18px 34px;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-height: 100vh;
  padding: 24px 18px;
  color: #fff;
  background:
    radial-gradient(circle at 10% 12%, rgba(108, 56, 245, 0.5), transparent 12rem),
    linear-gradient(180deg, #091741 0%, #02091f 100%);
  border-radius: 0 0 24px 24px;
  box-shadow: 14px 0 42px rgba(5, 13, 40, 0.2);
}

.brand,
.store-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #ffca38;
  font-size: 34px;
  background: linear-gradient(145deg, #1b2370, #6739f6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.brand strong {
  display: block;
  font-size: 21px;
  line-height: 1;
}

em {
  color: #9e63ff;
  font-style: normal;
}

.brand small,
.store-brand p {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 10px;
  font-weight: 800;
}

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

.main-nav a {
  display: grid;
  grid-template-columns: 30px 1fr 14px;
  align-items: center;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.main-nav a.active {
  color: #fff;
  background: linear-gradient(135deg, #7344ff, #4c22e4);
  box-shadow: 0 12px 30px rgba(88, 51, 245, 0.42);
}

.main-nav span {
  font-size: 22px;
}

.profile-card,
.streak-card {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.profile-card {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  margin-top: auto;
}

.avatar,
.mini-avatar {
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 37%, #ffc38f 0 22%, transparent 23%),
    radial-gradient(circle at 46% 64%, #4b2b19 0 8%, transparent 9%),
    radial-gradient(circle at 50% 40%, #5f2d14 0 27%, transparent 28%),
    linear-gradient(135deg, #1b98ff, #7144ff);
  border: 3px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 10px 24px rgba(8, 13, 43, 0.25);
}

.avatar {
  width: 58px;
  height: 58px;
}

.mini-avatar {
  width: 43px;
  height: 43px;
}

.profile-card h2,
.profile-card p,
.streak-card p {
  margin: 0;
}

.profile-card h2 {
  font-size: 15px;
}

.profile-card p {
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.progress,
.mini-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: rgba(101, 117, 171, 0.24);
}

.progress span,
.progress i,
.mini-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #58e06a, #7a3cff);
}

.profile-card .wide,
.xp-copy,
.wallet {
  grid-column: 1 / -1;
}

.wallet {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-weight: 900;
}

.wallet button {
  width: 25px;
  height: 25px;
  border-radius: 50%;
  color: #fff;
  background: rgba(111, 72, 247, 0.85);
}

.streak-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
}

.streak-card strong {
  font-size: 28px;
}

.streak-card span {
  font-size: 36px;
}

.week-dots {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
}

.week-dots span {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  color: #08234f;
  background: #75f073;
  font-size: 10px;
  font-weight: 900;
}

.dashboard {
  min-width: 0;
  padding-top: 16px;
}

.topbar,
.resource-strip,
.stage-picker {
  display: flex;
  align-items: center;
}

.topbar {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.stage-picker {
  gap: 10px;
  min-height: 50px;
  padding: 0 18px;
  color: #230aad;
  border-radius: 12px;
  background: #e9e4ff;
  box-shadow: inset 0 0 0 1px rgba(75, 42, 193, 0.08);
}

.stage-picker span {
  color: #34406f;
}

.stage-select-label {
  display: grid;
  gap: 2px;
}

.stage-select-label strong {
  color: #230aad;
  font-size: 14px;
}

.stage-select-label span {
  font-size: 12px;
  font-weight: 800;
}

.stage-picker select {
  width: 180px;
  min-height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid rgba(75, 42, 193, 0.14);
  border-radius: 9px;
  color: #230aad;
  background: rgba(255, 255, 255, 0.72);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.gem-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #d4c9ff;
}

.resource-strip {
  gap: 18px;
  font-weight: 900;
}

.resource-strip span {
  display: grid;
  grid-template-columns: auto auto;
  gap: 0 8px;
  align-items: center;
}

.resource-strip small {
  grid-column: 2;
  color: var(--muted);
  font-size: 11px;
}

.resource-strip button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: var(--ink);
  background: transparent;
  font-size: 24px;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 285px;
  border-radius: 18px;
  background: #08154a;
  box-shadow: var(--shadow);
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 8, 45, 0.88), rgba(2, 8, 45, 0.34) 42%, rgba(2, 8, 45, 0));
}

.hero-panel img {
  width: 100%;
  height: 100%;
  min-height: 285px;
  object-fit: cover;
  display: block;
}

.hero-copy {
  position: absolute;
  z-index: 2;
  top: 50%;
  left: 44px;
  width: min(470px, calc(100% - 70px));
  transform: translateY(-50%);
  color: #fff;
}

.hero-copy p,
.hero-copy h1,
.hero-copy span {
  margin: 0;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.3);
}

.hero-copy p {
  color: #6ce8ff;
  font-weight: 800;
}

.hero-copy h1 {
  margin-top: 12px;
  font-size: clamp(34px, 4vw, 50px);
  line-height: 1.05;
  letter-spacing: 0;
}

.hero-copy span {
  display: block;
  max-width: 360px;
  margin: 18px 0 24px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.45;
}

.primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  padding: 0 22px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #8b5bff, #5228e6);
  box-shadow: 0 14px 28px rgba(74, 33, 212, 0.32);
  font-weight: 900;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin: 18px 0 12px;
}

.section-heading h2,
.section-heading h3,
.with-subcopy p {
  margin: 0;
}

.section-heading h2 {
  font-size: 20px;
}

.section-heading a {
  color: #2b16d6;
  font-size: 13px;
  font-weight: 900;
}

.with-subcopy {
  align-items: start;
  margin-top: 26px;
}

.with-subcopy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stage-grid,
.course-grid,
.mission-row {
  display: grid;
  gap: 16px;
}

.stage-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stage-card {
  position: relative;
  overflow: hidden;
  min-height: 170px;
  padding: 18px;
  border-radius: 12px;
  color: #fff;
  box-shadow: var(--shadow);
}

.stage-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.2), transparent 6rem);
}

.stage-card.green,
.course-card.green {
  background: linear-gradient(145deg, #16b956, #08753f);
}

.stage-card.blue,
.course-card.blue {
  background: linear-gradient(145deg, #088ee3, #073978);
}

.stage-card.violet,
.course-card.violet {
  background: linear-gradient(145deg, #8a3cff, #321db7);
}

.stage-card.orange,
.course-card.orange {
  background: linear-gradient(145deg, #fb7907, #c64700);
}

.stage-card.active {
  outline: 5px solid rgba(124, 96, 255, 0.35);
}

.stage-card small,
.stage-card h3,
.stage-card p,
.stage-icon,
.stage-card b {
  position: relative;
  z-index: 1;
}

.stage-card small,
.course-card small {
  font-weight: 900;
}

.stage-card h3 {
  margin: 8px 0 4px;
  font-size: 18px;
}

.stage-card p {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.stage-icon {
  position: absolute;
  right: 12px;
  bottom: 2px;
  font-size: 64px;
  filter: drop-shadow(0 12px 10px rgba(0, 0, 0, 0.22));
}

.stage-card b {
  position: absolute;
  right: 14px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #18b65a;
  background: #fff;
}

.stage-card.locked b {
  color: #d56615;
}

.course-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.course-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  padding: 18px;
  border-radius: 12px;
  color: #fff;
  box-shadow: var(--shadow);
}

.course-card div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.course-card h3 {
  margin: 0;
  min-height: 42px;
  font-size: 16px;
  line-height: 1.25;
}

.course-card div:first-child span {
  padding: 5px 8px;
  border-radius: 8px;
  background: #ffbd25;
  font-size: 10px;
  font-weight: 900;
}

.course-card strong {
  display: block;
  margin: 10px 0;
  font-size: 54px;
  filter: drop-shadow(0 12px 12px rgba(0, 0, 0, 0.2));
}

.course-card .progress {
  width: 68%;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.38);
}

.course-card .progress span {
  background: rgba(255, 255, 255, 0.9);
}

.course-card em {
  position: absolute;
  right: 18px;
  bottom: 19px;
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.mission-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 26px;
}

.mission-card {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 14px;
  min-height: 112px;
  padding: 18px;
  border-radius: 14px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mission-card.dark {
  color: #fff;
  background:
    radial-gradient(circle at 88% 22%, rgba(45, 210, 255, 0.24), transparent 8rem),
    linear-gradient(145deg, #0c2f65, #071438);
}

.mission-card > span {
  font-size: 42px;
}

.mission-card h3,
.mission-card p {
  margin: 0;
}

.mission-card p,
.mission-card small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.mission-card.dark p,
.mission-card.dark small {
  color: rgba(255, 255, 255, 0.78);
}

.mini-progress {
  height: 6px;
  margin: 12px 0 5px;
}

.right-rail {
  display: grid;
  align-content: start;
  gap: 16px;
  padding-top: 75px;
}

.mentor-card,
.metric-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mentor-card {
  color: #fff;
  background:
    radial-gradient(circle at 80% 20%, rgba(109, 56, 245, 0.6), transparent 10rem),
    linear-gradient(180deg, #121b63, #070d35);
}

.mentor-card img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  display: block;
}

.mentor-bubble {
  margin: -26px 22px 22px;
  position: relative;
  padding: 22px;
  border-radius: 16px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
}

.mentor-bubble h2,
.mentor-bubble p {
  margin: 0;
}

.mentor-bubble p {
  margin: 12px 0 18px;
  color: #18275e;
  font-weight: 700;
  line-height: 1.55;
}

.compact {
  width: 100%;
}

.metric-card {
  padding: 22px;
}

.level {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 16px;
}

.shield {
  display: grid;
  place-items: center;
  width: 66px;
  height: 76px;
  color: #fff;
  background: linear-gradient(160deg, #ff8a16, #6539ff);
  clip-path: polygon(50% 0, 92% 15%, 82% 82%, 50% 100%, 18% 82%, 8% 15%);
  font-size: 28px;
  font-weight: 900;
}

.metric-card h3,
.metric-card p {
  margin: 0;
}

.metric-card p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.skill-list {
  display: grid;
  gap: 13px;
}

.skill {
  display: grid;
  grid-template-columns: 34px 1fr 45px minmax(76px, 1fr) 34px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.skill span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, #55c7ff, #7441f4);
  font-weight: 900;
}

.skill .progress {
  height: 5px;
}

.skill em {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.achievement {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
}

.achievement > span {
  font-size: 46px;
}

.mobile-showcase,
.store-banner {
  max-width: 1580px;
  margin: 0 auto;
}

.mobile-showcase {
  display: grid;
  grid-template-columns: repeat(2, 310px);
  justify-content: center;
  gap: 34px;
  padding: 28px 18px;
}

.phone {
  width: 310px;
  height: 635px;
  padding: 12px;
  border-radius: 42px;
  background: #050713;
  box-shadow: 0 20px 50px rgba(5, 12, 34, 0.3);
}

.phone-screen {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: 100%;
  border-radius: 32px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 8%, rgba(119, 69, 250, 0.7), transparent 11rem),
    linear-gradient(180deg, #111c64, #080e38 55%, #070924);
}

.phone-screen header {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 18px;
}

.phone-screen header small {
  display: block;
  opacity: 0.8;
  font-size: 10px;
  font-weight: 800;
}

.phone-hero {
  position: relative;
  min-height: 190px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(7, 12, 46, 0.88), rgba(7, 12, 46, 0.18)),
    url("../assets/hero-adventure.png") center right / cover;
}

.phone-hero p,
.phone-hero h2 {
  margin: 0;
}

.phone-hero h2 {
  max-width: 150px;
  margin: 8px 0 18px;
  font-size: 18px;
}

.phone-hero button,
.next-quest button:last-child {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #854fff, #4c22e7);
  font-weight: 900;
}

.mobile-stage-strip {
  display: grid;
  grid-template-columns: repeat(4, 68px);
  gap: 8px;
  overflow-x: auto;
  padding: 14px 14px 6px;
}

.mobile-stage-strip .stage-card {
  min-height: 96px;
  padding: 8px;
  border-radius: 9px;
}

.mobile-stage-strip .stage-card h3 {
  display: none;
}

.mobile-stage-strip .stage-card p,
.mobile-stage-strip .stage-card small {
  font-size: 10px;
}

.mobile-stage-strip .stage-icon {
  right: 4px;
  bottom: 10px;
  font-size: 34px;
}

.mobile-stage-strip .stage-card b {
  width: 18px;
  height: 18px;
  right: 4px;
  bottom: 4px;
  border-width: 2px;
  font-size: 9px;
}

.phone-screen h3 {
  margin: 12px 18px 10px;
}

.mobile-courses {
  display: grid;
  gap: 9px;
  padding: 0 12px 90px;
}

.mobile-courses .course-card {
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  min-height: 70px;
  padding: 10px;
  border-radius: 9px;
}

.mobile-courses .course-card div:first-child {
  display: block;
}

.mobile-courses .course-card h3 {
  min-height: 0;
  font-size: 12px;
}

.mobile-courses .course-card strong {
  grid-column: 1;
  grid-row: 1 / 4;
  margin: 0;
  font-size: 34px;
}

.mobile-courses .course-card small,
.mobile-courses .course-card .progress {
  grid-column: 2;
}

.mobile-courses .course-card em {
  position: static;
  grid-column: 3;
}

.mobile-tabbar {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 70px;
  background: rgba(7, 11, 43, 0.92);
  backdrop-filter: blur(20px);
}

.mobile-tabbar span {
  display: grid;
  justify-items: center;
  gap: 2px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 900;
}

.mobile-tabbar small {
  font-size: 9px;
}

.mobile-tabbar button {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #a771ff, #4d20ee);
  font-size: 34px;
  box-shadow: 0 10px 26px rgba(86, 46, 236, 0.5);
}

.quest-map {
  background:
    radial-gradient(circle at 55% 18%, rgba(62, 195, 255, 0.45), transparent 11rem),
    linear-gradient(180deg, #111c65, #184ec5 52%, #111858);
}

.quest-map::before {
  content: "";
  position: absolute;
  inset: 80px 20px 116px;
  background:
    radial-gradient(circle at 50% 8%, #6fd768 0 35px, transparent 36px),
    radial-gradient(circle at 18% 32%, #cd8f2c 0 38px, transparent 39px),
    radial-gradient(circle at 70% 48%, #b351e4 0 40px, transparent 41px),
    radial-gradient(circle at 40% 72%, #13a8d9 0 44px, transparent 45px);
  filter: drop-shadow(0 18px 14px rgba(6, 13, 58, 0.28));
}

.floating-island {
  position: absolute;
  z-index: 2;
  padding: 10px 12px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #37c66b, #128640);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 18px rgba(6, 12, 48, 0.28);
}

.island-one {
  top: 174px;
  left: 58px;
}

.island-two {
  top: 250px;
  right: 30px;
}

.island-three {
  top: 326px;
  left: 42px;
}

.island-four {
  top: 430px;
  left: 80px;
}

.locked {
  background: rgba(8, 13, 47, 0.72);
}

.route-line {
  position: absolute;
  top: 214px;
  left: 106px;
  width: 126px;
  height: 240px;
  border: 4px dashed rgba(255, 225, 88, 0.8);
  border-left: 0;
  border-bottom: 0;
  border-radius: 0 120px 0 0;
  transform: rotate(18deg);
}

.next-quest {
  position: absolute;
  z-index: 3;
  right: 14px;
  bottom: 84px;
  left: 14px;
  padding: 16px;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.95);
}

.next-quest > button:first-child {
  position: absolute;
  top: 14px;
  right: 14px;
  background: transparent;
  font-size: 22px;
}

.next-quest h3,
.next-quest p {
  margin: 2px 0;
}

.next-quest p {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.next-quest button:last-child {
  width: 100%;
  margin-top: 14px;
}

.next-quest button span {
  float: right;
}

.store-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  padding: 22px 34px;
  color: #fff;
  border-radius: 22px;
  background: linear-gradient(135deg, #0b1547, #050a25);
  box-shadow: var(--shadow);
}

.store-brand h2 {
  margin: 0;
}

.store-brand strong {
  display: block;
  margin-top: 8px;
  color: #ffce39;
}

.store-brand small {
  color: rgba(255, 255, 255, 0.8);
}

.store-buttons {
  display: flex;
  gap: 14px;
}

.store-buttons button {
  min-width: 180px;
  min-height: 58px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 8px;
  color: #fff;
  background: #050505;
  font-size: 20px;
  font-weight: 900;
}

.store-buttons small {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
}

@media (max-width: 1240px) {
  .app-shell {
    grid-template-columns: 238px minmax(0, 1fr);
  }

  .right-rail {
    grid-column: 2;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-top: 0;
  }

  .mentor-card {
    grid-row: span 2;
  }

}

@media (max-width: 920px) {
  .app-shell {
    display: block;
    padding: 0 14px 24px;
  }

  .sidebar {
    position: static;
    min-height: 0;
    margin: 14px 0;
    border-radius: 22px;
  }

  .main-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .main-nav a {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 58px;
    padding: 8px;
    font-size: 11px;
  }

  .main-nav b {
    display: none;
  }

  .profile-card,
  .streak-card {
    display: none;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .stage-grid,
  .course-grid,
  .mission-row,
  .right-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .store-banner {
    align-items: flex-start;
    flex-direction: column;
    margin: 0 14px 24px;
  }
}

@media (max-width: 680px) {
  .topbar,
  .resource-strip {
    align-items: stretch;
    width: 100%;
  }

  .stage-picker {
    width: 100%;
    justify-content: center;
  }

  .resource-strip {
    justify-content: space-between;
  }

  .hero-panel {
    min-height: 430px;
  }

  .hero-panel::after {
    background: linear-gradient(180deg, rgba(2, 8, 45, 0.9), rgba(2, 8, 45, 0.28), rgba(2, 8, 45, 0.8));
  }

  .hero-panel img {
    min-height: 430px;
  }

  .hero-copy {
    top: auto;
    bottom: 26px;
    left: 24px;
    transform: none;
  }

  .stage-grid,
  .course-grid,
  .mission-row,
  .right-rail,
  .mobile-showcase {
    grid-template-columns: 1fr;
  }

  .mobile-showcase {
    justify-items: center;
  }

  .store-buttons {
    flex-direction: column;
    width: 100%;
  }

  .store-buttons button {
    width: 100%;
  }
}

.scale-app {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 24px;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 18px 34px;
}

.product-workspace {
  min-width: 0;
  padding-top: 16px;
}

.app-topbar {
  margin-bottom: 16px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  margin-top: 24px;
}

.workspace-main {
  min-width: 0;
}

.view-root {
  min-height: 480px;
}

.app-rail {
  padding-top: 0;
}

.card-action {
  position: absolute;
  right: 14px;
  top: 14px;
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: #fff;
  background: rgba(4, 9, 39, 0.38);
  font-size: 11px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.card-action:disabled {
  opacity: 0.65;
  cursor: default;
}

.feature-band,
.tutor-shell,
.project-composer,
.table-card {
  margin-top: 26px;
  padding: 22px;
  border-radius: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.feature-band h2,
.tutor-shell h2,
.feature-band p,
.project-composer p {
  margin-top: 0;
}

.insight-grid,
.analytics-grid,
.plan-grid,
.guild-grid,
.portfolio-grid,
.market-grid,
.certificate-grid {
  display: grid;
  gap: 16px;
}

.insight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.insight-grid article,
.analytics-grid article,
.portfolio-card,
.guild-card,
.plan-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.insight-grid p,
.guild-card p,
.portfolio-card p,
.plan-card li {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.analytics-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.analytics-grid strong {
  display: block;
  font-size: 34px;
  line-height: 1;
}

.analytics-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.quest-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.quest-lane {
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.quest-lane h3,
.quest-lane p {
  margin: 0;
}

.quest-lane > p {
  margin: 6px 0 16px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.quest-row {
  position: relative;
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 96px;
  margin-top: 12px;
  padding: 12px;
  border-radius: 12px;
  color: #fff;
  box-shadow: 0 12px 30px rgba(29, 39, 98, 0.12);
}

.quest-row > strong {
  grid-column: 1;
  grid-row: 1 / 4;
  font-size: 36px;
}

.quest-row > div:first-child,
.quest-row > small,
.quest-row > .progress {
  grid-column: 2;
}

.quest-row h3 {
  margin: 0;
  padding-right: 110px;
  font-size: 15px;
}

.quest-row div:first-child span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 900;
}

.quest-row small {
  font-weight: 800;
}

.quest-row em {
  grid-column: 3;
  grid-row: 2;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
}

.quest-row .progress {
  height: 7px;
  background: rgba(255, 255, 255, 0.35);
}

.quest-row .progress span {
  background: rgba(255, 255, 255, 0.9);
}

.tutor-chat {
  display: grid;
  gap: 12px;
  min-height: 280px;
  max-height: 430px;
  overflow: auto;
  padding: 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, #0c1451, #071236);
}

.chat-message {
  max-width: 78%;
  padding: 14px;
  border-radius: 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.chat-message.student {
  justify-self: end;
  background: linear-gradient(135deg, #7c4cff, #4320d8);
}

.chat-message.mentor {
  justify-self: start;
  background: rgba(255, 255, 255, 0.16);
}

.chat-message p {
  margin: 6px 0 0;
  line-height: 1.45;
}

.tutor-form,
.project-composer form {
  display: grid;
  grid-template-columns: 190px 1fr auto;
  gap: 12px;
  margin-top: 16px;
}

.project-composer form {
  grid-template-columns: 1fr 160px auto;
}

.tutor-form input,
.tutor-form select,
.project-composer input,
.project-composer select,
.project-composer textarea {
  min-height: 48px;
  width: 100%;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 700;
}

.project-composer textarea {
  grid-column: 1 / 3;
  min-height: 92px;
  padding: 14px;
  resize: vertical;
}

.portfolio-grid,
.plan-grid,
.certificate-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.market-grid,
.guild-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portfolio-card h3,
.guild-card h3,
.plan-card h3 {
  margin: 8px 0;
}

.portfolio-card small,
.guild-card small {
  color: #4420d6;
  font-weight: 900;
}

.portfolio-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.portfolio-card div span {
  padding: 6px 9px;
  border-radius: 999px;
  color: #2c1ab8;
  background: #e9e4ff;
  font-size: 11px;
  font-weight: 900;
}

.plan-card strong {
  display: block;
  font-size: 32px;
}

.plan-card ul {
  min-height: 112px;
  padding-left: 18px;
}

.assignment-row {
  display: grid;
  grid-template-columns: 1.4fr minmax(120px, 1fr) 46px;
  align-items: center;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.assignment-row:last-child {
  border-bottom: 0;
}

.assignment-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  margin: 0;
  padding: 26px;
  border-radius: 14px;
  color: rgba(255, 255, 255, 0.74);
  background: rgba(255, 255, 255, 0.1);
  font-weight: 800;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 360px;
  padding: 14px 16px;
  border-radius: 12px;
  color: #fff;
  background: #071236;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
  font-weight: 900;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.auth-mode .scale-app {
  display: none;
}

#authRoot {
  display: none;
}

.auth-mode #authRoot {
  display: block;
}

.auth-page {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) 440px;
  min-height: 100vh;
}

.auth-art {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 34px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(4, 9, 39, 0.9), rgba(4, 9, 39, 0.38)),
    url("../assets/hero-adventure.png") center / cover;
}

.auth-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(109, 56, 245, 0.4), transparent 22rem);
}

.auth-brand,
.auth-hero-copy {
  position: relative;
  z-index: 1;
}

.auth-hero-copy {
  max-width: 720px;
}

.auth-hero-copy p,
.auth-hero-copy h1,
.auth-hero-copy span {
  margin: 0;
}

.auth-hero-copy p {
  color: #6ce8ff;
  font-weight: 900;
}

.auth-hero-copy h1 {
  margin-top: 12px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.02;
  letter-spacing: 0;
}

.auth-hero-copy span {
  display: block;
  max-width: 620px;
  margin-top: 18px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.5;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px;
  background: rgba(255, 255, 255, 0.92);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 24px;
  padding: 6px;
  border-radius: 12px;
  background: #e9e4ff;
}

.auth-tabs button {
  min-height: 44px;
  border-radius: 9px;
  color: #2a2280;
  background: transparent;
  font-weight: 900;
}

.auth-tabs button.active {
  color: #fff;
  background: linear-gradient(135deg, #8b5bff, #5228e6);
}

.auth-panel h2 {
  margin: 0 0 18px;
  font-size: 34px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.auth-form input,
.auth-form select {
  min-height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-weight: 750;
}

.auth-note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.5;
}

.auth-demo-btn {
  width: 100%;
  margin-top: 12px;
}

.auth-link-action {
  margin-top: 12px;
  width: 100%;
}

.form-error {
  margin: 0 0 14px;
  padding: 12px;
  border-radius: 10px;
  color: #8f1d1d;
  background: #ffe6e6;
  font-weight: 900;
}

.avatar-button,
.text-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: transparent;
}

.text-action {
  min-height: 34px;
  padding: 0 12px;
  color: #2b16d6;
  background: #e9e4ff;
  font-size: 12px;
  font-weight: 900;
}

.resource-strip .text-action {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(43, 22, 214, 0.12);
  color: #34406f;
  background: rgba(255, 255, 255, 0.68);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stage-card,
.mission-card,
.clickable-card,
.guild-card button,
.portfolio-card button,
.plan-card button,
.assignment-row button {
  cursor: pointer;
}

.stage-card:hover,
.mission-card:hover,
.clickable-card:hover,
.portfolio-card:hover,
.guild-card:hover,
.plan-card:hover {
  transform: translateY(-2px);
}

.stage-card,
.mission-card,
.portfolio-card,
.guild-card,
.plan-card {
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 9, 39, 0.62);
  backdrop-filter: blur(12px);
}

.modal-card {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  padding: 26px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 30px 90px rgba(4, 9, 39, 0.35);
}

.modal-card h2 {
  margin: 0 42px 12px 0;
  font-size: 28px;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--ink);
  background: #e9e4ff;
  font-size: 22px;
  font-weight: 800;
}

.modal-copy {
  margin: 0 0 18px;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.55;
}

.project-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.project-detail-meta span {
  padding: 7px 10px;
  border-radius: 999px;
  color: #2c1ab8;
  background: #e9e4ff;
  font-size: 12px;
  font-weight: 900;
}

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

.secondary-btn {
  min-height: 50px;
  padding: 0 18px;
  border: 1px solid rgba(43, 22, 214, 0.14);
  border-radius: 10px;
  color: #2b16d6;
  background: #fff;
  font-weight: 900;
}

.payment-form {
  display: grid;
  gap: 12px;
}

.payment-option {
  display: grid;
  grid-template-columns: 22px 42px 1fr;
  gap: 10px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.payment-option > span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, #8b5bff, #5228e6);
  font-weight: 900;
}

.payment-option strong,
.payment-option small {
  grid-column: 3;
}

.payment-option small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.card-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.card-fields input {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 750;
}

.quest-objectives {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(233, 228, 255, 0.5);
}

.quest-objectives h3 {
  margin: 0 0 12px;
}

.quest-objectives label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  color: #34406f;
  font-weight: 800;
}

.journey-preview,
.journey-activity {
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(233, 228, 255, 0.52);
}

.journey-preview p {
  margin: 8px 0;
  color: var(--muted);
  font-weight: 750;
  line-height: 1.45;
}

.journey-preview ol {
  margin: 10px 0 0;
  padding-left: 22px;
  color: #34406f;
  font-weight: 850;
}

.journey-progress {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.journey-progress span {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  color: #2b16d6;
  background: #e9e4ff;
  font-weight: 900;
}

.journey-progress span.done,
.journey-progress span.active {
  color: #fff;
  background: linear-gradient(135deg, #8b5bff, #5228e6);
}

.choice-grid,
.builder-grid,
.checklist {
  display: grid;
  gap: 10px;
}

.choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.choice-grid button,
.sim-card,
.reward-card,
.pizza-lab {
  min-height: 74px;
  padding: 14px;
  border: 1px solid rgba(43, 22, 214, 0.14);
  border-radius: 12px;
  color: #091642;
  background: #fff;
  font-weight: 900;
}

.builder-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.builder-grid.single {
  grid-template-columns: 1fr;
}

.builder-grid label,
.checklist label {
  display: grid;
  gap: 7px;
  color: #34406f;
  font-weight: 900;
}

.builder-grid input,
.journey-textarea {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 750;
}

.journey-textarea {
  min-height: 110px;
  padding: 12px;
  resize: vertical;
}

.sim-card p,
.pizza-lab small {
  display: block;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reward-card {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #17b35b, #0984d8);
  font-size: 20px;
}

.pizza-lab {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pizza-lab > span {
  font-size: 54px;
}

.pizza-lab strong {
  display: block;
  font-size: 28px;
}

@media (max-width: 1320px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .app-rail {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .auth-page {
    grid-template-columns: 1fr;
  }

  .auth-art {
    min-height: 360px;
  }
}

@media (max-width: 960px) {
  .scale-app {
    display: block;
    padding: 0 14px 24px;
  }

  .workspace-grid {
    margin-top: 16px;
  }

  .quest-board,
  .analytics-grid,
  .insight-grid,
  .portfolio-grid,
  .plan-grid,
  .certificate-grid,
  .guild-grid,
  .market-grid,
  .app-rail {
    grid-template-columns: 1fr;
  }

  .tutor-form,
  .project-composer form,
  .project-composer textarea {
    grid-template-columns: 1fr;
    grid-column: auto;
  }

  .assignment-row {
    grid-template-columns: 1fr;
  }

  .choice-grid,
  .builder-grid {
    grid-template-columns: 1fr;
  }
}
