body[data-route="progress"],
body[data-route="progress"] .app-shell,
body[data-route="progress"] #page-progress {
  background: var(--academy-page);
}

.progress-v2 {
  --progress-primary: var(--academy-primary);
  --progress-primary-hover: var(--academy-primary-hover);
  --progress-text: var(--academy-text);
  --progress-secondary: var(--academy-secondary);
  --progress-muted: var(--academy-muted);
  --progress-border: var(--academy-border);
  --progress-surface: var(--academy-surface);
  --progress-tint: var(--academy-surface-soft);
  --progress-success: var(--academy-success);
  width: min(var(--academy-content-standard), calc(100% - 48px));
  margin: 0 auto;
  padding: 32px 0 48px;
  color: var(--progress-text);
  font-family: var(--academy-font-sans);
}

body:not(.game-route-active) .progress-v2 :is(h1, h2, h3, h4),
.progress-v2 :is(h1, h2, h3, h4) {
  margin: 0;
  color: var(--progress-text);
  font-family: inherit;
  font-style: normal;
  letter-spacing: -0.025em;
}

.progress-v2-hero {
  position: relative;
  display: flex;
  min-height: clamp(190px, 18vw, 215px);
  align-items: center;
  overflow: hidden;
  padding: clamp(28px, 2.4vw, 34px) clamp(30px, 5vw, 58px);
  border: 1px solid var(--progress-border);
  border-radius: var(--academy-radius-hero);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.98) 0%, rgba(245, 244, 253, 0.94) 54%, rgba(245, 244, 253, 0.58) 100%),
    url("/assets/moonveil-academy-hero.png") center right / cover no-repeat;
  box-shadow: var(--academy-shadow-elevated);
}

.progress-v2-hero-content {
  position: relative;
  z-index: 1;
  max-width: 650px;
}

.progress-v2-kicker,
.progress-v2-section-kicker {
  margin: 0 0 10px;
  color: var(--progress-primary);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.progress-v2-hero h1 {
  font-size: clamp(2rem, 4vw, 3.35rem);
  font-weight: 800;
  line-height: 1.04;
}

.progress-v2-hero-content > p:last-child {
  max-width: 610px;
  margin: 16px 0 0;
  color: var(--progress-secondary);
  font-size: clamp(0.98rem, 1.4vw, 1.1rem);
  line-height: 1.6;
}

.progress-v2-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.progress-v2-stat {
  display: grid;
  min-height: 100px;
  align-content: center;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--progress-border);
  border-radius: var(--academy-radius-card);
  background: var(--progress-surface);
  box-shadow: none;
}

.progress-v2-stat:first-child,
.progress-v2-stat-rank {
  border-color: rgba(104, 101, 216, 0.24);
  background: var(--progress-tint);
}

.progress-v2-stat span {
  color: var(--progress-muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.progress-v2-stat strong {
  color: var(--progress-text);
  font-size: clamp(1.22rem, 2vw, 1.55rem);
  line-height: 1.1;
}

.progress-v2-stat-rank strong {
  color: var(--progress-primary);
}

.progress-v2-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
  margin-top: 18px;
}

.progress-v2-panel {
  min-width: 0;
  padding: clamp(20px, 2.6vw, 30px);
  border: 1px solid var(--progress-border);
  border-radius: var(--academy-radius-card);
  background: var(--progress-surface);
  box-shadow: var(--academy-shadow-subtle);
}

.progress-v2-panel-heading {
  margin-bottom: 20px;
}

.progress-v2-panel-heading h2 {
  font-size: clamp(1.35rem, 2vw, 1.7rem);
  font-weight: 800;
}

.progress-v2-panel-heading div > p:last-child {
  margin: 8px 0 0;
  color: var(--progress-secondary);
  line-height: 1.5;
}

.progress-v2-list,
.progress-v2-activity-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.progress-v2-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 72px;
  padding: 12px 15px;
  border: 1px solid var(--progress-border);
  border-radius: var(--academy-radius-card);
  background: var(--progress-surface);
}

.progress-v2-row.has-avatar {
  grid-template-columns: 42px 44px minmax(0, 1fr) auto;
}

.progress-v2-row.is-current {
  border-color: rgba(104, 101, 216, 0.38);
  background: var(--progress-tint);
}

.progress-v2-row.is-top-three .progress-v2-rank {
  border-color: rgba(104, 101, 216, 0.28);
  color: var(--progress-primary);
  background: rgba(104, 101, 216, 0.1);
}

.progress-v2-rank {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--progress-border);
  border-radius: 50%;
  color: var(--progress-secondary);
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.progress-v2-avatar {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--progress-border);
  border-radius: 50%;
  background: var(--progress-tint);
}

.progress-v2-avatar .account-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.progress-v2-avatar .account-avatar-fallback {
  position: absolute;
  color: var(--progress-primary);
  font-size: 0.72rem;
  font-weight: 800;
}

.progress-v2-person,
.progress-v2-activity-copy {
  min-width: 0;
}

.progress-v2-person > strong,
.progress-v2-activity-copy > strong {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-wrap: anywhere;
}

.progress-v2-person small,
.progress-v2-activity-copy small {
  display: block;
  margin-top: 4px;
  color: var(--progress-secondary);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.progress-v2-you {
  padding: 3px 7px;
  border-radius: 999px;
  color: var(--progress-primary);
  background: rgba(104, 101, 216, 0.12);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.progress-v2-row-xp,
.progress-v2-activity-xp {
  color: var(--progress-primary);
  font-size: 0.92rem;
  white-space: nowrap;
}

.progress-v2-activity-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 12px 14px;
  border: 1px solid var(--progress-border);
  border-radius: var(--academy-radius-card);
  background: var(--progress-surface);
}

.progress-v2-activity-flag {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: var(--progress-tint);
  font-size: 1.2rem;
}

.progress-v2-activity-xp {
  color: var(--progress-success);
}

.progress-v2-empty {
  display: grid;
  min-height: 190px;
  place-content: center;
  justify-items: center;
  padding: 28px;
  border: 1px dashed var(--progress-border);
  border-radius: var(--academy-radius-card);
  background: var(--progress-tint);
  text-align: center;
}

.progress-v2-empty-icon {
  display: grid;
  width: 44px;
  height: 44px;
  margin-bottom: 13px;
  place-items: center;
  border-radius: 50%;
  color: var(--progress-primary);
  background: var(--progress-tint);
  font-size: 1.2rem;
}

.progress-v2-empty h3 {
  font-size: 1.05rem;
}

.progress-v2-empty p {
  max-width: 360px;
  margin: 8px 0 0;
  color: var(--progress-secondary);
  line-height: 1.5;
}

.progress-v2-spinner {
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border: 3px solid rgba(104, 101, 216, 0.18);
  border-top-color: var(--progress-primary);
  border-radius: 50%;
  animation: progress-v2-spin 0.8s linear infinite;
}

@keyframes progress-v2-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .progress-v2 {
    width: min(100% - 32px, 760px);
    padding-top: 24px;
  }

  .progress-v2-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .progress-v2 {
    width: min(100% - 24px, 520px);
    padding: 16px 0 32px;
  }

  .progress-v2-hero {
    min-height: 205px;
    padding: 28px 24px;
    border-radius: var(--academy-radius-card);
    background:
      linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(245, 244, 253, 0.82)),
      url("/assets/moonveil-academy-hero.png") center right / cover no-repeat;
  }

  .progress-v2-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .progress-v2-stat {
    min-height: 92px;
    padding: 17px;
  }

  .progress-v2-layout {
    gap: 14px;
  }

  .progress-v2-panel {
    padding: 18px;
    border-radius: var(--academy-radius-card);
  }

  .progress-v2-row,
  .progress-v2-row.has-avatar {
    grid-template-columns: 38px minmax(0, 1fr) auto;
  }

  .progress-v2-row.has-avatar .progress-v2-avatar {
    display: none;
  }
}

@media (max-width: 420px) {
  .progress-v2-summary {
    grid-template-columns: 1fr 1fr;
  }

  .progress-v2-row,
  .progress-v2-row.has-avatar {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .progress-v2-row-xp {
    grid-column: 2;
    justify-self: start;
  }

  .progress-v2-activity-row {
    grid-template-columns: 36px minmax(0, 1fr);
  }

  .progress-v2-activity-xp {
    grid-column: 2;
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .progress-v2-spinner {
    animation: none;
  }
}
