:root {
  --bg: #f7fbfa;
  --surface: #ffffff;
  --surface-soft: #eef9f5;
  --line: #dfe9e7;
  --text: #142033;
  --muted: #66758a;
  --primary: #00a870;
  --primary-dark: #00875a;
  --blue: #2f6fed;
  --gold: #f6b84b;
  --danger: #e34f6f;
  --shadow: 0 12px 30px rgba(20, 32, 51, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.5;
}

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

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid rgba(0, 168, 112, 0.24);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--text);
  color: #fff;
  padding: 10px 14px;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(120px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 68px;
  padding: 0 6vw;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #18c29a);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  color: var(--text);
  font-size: 18px;
  font-weight: 850;
}

.brand small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.top-nav {
  display: flex;
  justify-content: center;
  gap: 30px;
  color: #27364d;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.top-nav a {
  position: relative;
  padding: 24px 0 22px;
}

.top-nav a::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 999px;
  background: var(--primary);
  content: "";
  transform: scaleX(0);
  transition: transform 140ms ease;
}

.top-nav a:hover,
.top-nav a.is-active {
  color: var(--primary-dark);
}

.top-nav a:hover::after,
.top-nav a.is-active::after {
  transform: scaleX(1);
}

.header-cta,
.primary-action,
.secondary-action,
.outline-button,
.like-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--primary);
  padding: 0 18px;
  font-weight: 850;
  cursor: pointer;
}

.header-cta,
.primary-action {
  justify-self: end;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(0, 168, 112, 0.18);
}

.secondary-action,
.outline-button {
  background: #fff;
  color: var(--primary-dark);
}

.hero-section,
.content-section,
.site-footer {
  padding-inline: 6vw;
}

.hero-section {
  position: relative;
  overflow: hidden;
  padding-top: 72px;
  padding-bottom: 42px;
  background:
    linear-gradient(180deg, rgba(247, 251, 250, 0.9), rgba(255, 255, 255, 0.98) 52%, var(--bg)),
    var(--bg);
}

.hero-asset {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 0;
  width: min(68vw, 1040px);
  height: 430px;
  object-fit: cover;
  object-position: right top;
  opacity: 0.68;
  pointer-events: none;
}

.hero-content,
.metrics-grid,
.featured-grid,
#data-status {
  position: relative;
  z-index: 1;
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 900;
}

.hero-content h1 {
  margin: 0;
  max-width: 760px;
  color: var(--text);
  font-size: 46px;
  line-height: 1.16;
  font-weight: 900;
}

.hero-copy {
  max-width: 620px;
  margin: 18px 0 0;
  color: #3e506a;
  font-size: 18px;
  font-weight: 650;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 28px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 54px;
}

.metric-card,
.feature-card,
.stage-card,
.panel,
.material-card,
.profile-card,
.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 118px;
  padding: 20px;
}

.metric-label,
.metric-card p,
.feature-card p,
.stage-card p,
.panel p,
.material-card p,
.profile-card p,
.rule-card p,
.footer-links {
  margin: 0;
  color: var(--muted);
}

.metric-label {
  display: block;
  font-size: 13px;
  font-weight: 850;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 30px;
  line-height: 1;
  font-weight: 900;
}

.metric-card p {
  margin-top: 10px;
  font-size: 13px;
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.feature-card {
  padding: 18px;
}

.feature-card h3,
.stage-card h3,
.panel h3,
.material-card h3,
.profile-card h3,
.rule-card h3 {
  margin: 0;
  color: var(--text);
}

.feature-card h3 {
  margin-top: 12px;
  font-size: 18px;
}

.feature-card p {
  margin-top: 8px;
}

.feature-card strong {
  display: block;
  margin-top: 14px;
  color: var(--primary-dark);
}

#data-status {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#data-status.is-error {
  color: var(--danger);
}

.content-section {
  padding-top: 64px;
  padding-bottom: 20px;
}

.page-head {
  padding-bottom: 0;
}

.page-head h1 {
  margin: 0;
  color: var(--text);
  font-size: 40px;
  line-height: 1.16;
  font-weight: 900;
}

.page-head p:last-child {
  max-width: 720px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.compact-section {
  padding-top: 28px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.section-heading.stacked {
  align-items: start;
}

.section-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.18;
}

.section-heading > p,
.section-heading div + p {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
}

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

.stage-card {
  position: relative;
  min-height: 340px;
  padding: 20px;
}

.stage-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 900;
}

.stage-card h3 {
  margin-top: 16px;
  font-size: 21px;
}

.stage-card .date {
  margin-top: 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.task-list {
  margin: 18px 0 0;
  padding-left: 22px;
  color: #3e506a;
}

.task-list li + li {
  margin-top: 8px;
}

.status-pill,
.pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 24px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 850;
}

.status-pill {
  position: absolute;
  right: 18px;
  bottom: 18px;
}

.pill.muted {
  background: #eef3f7;
  color: var(--muted);
}

.ranking-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  min-width: 0;
  padding: 20px;
}

.ranking-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.ranking-row,
.stage-pop-row {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
}

.ranking-row:hover,
.stage-pop-row:hover,
.material-card:hover {
  border-color: rgba(0, 168, 112, 0.45);
}

.rank-badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: #eef3f7;
  color: var(--muted);
  font-weight: 900;
}

.rank-badge.top {
  background: #fff4dc;
  color: #b97800;
}

.ranking-row small,
.ranking-row b,
.stage-pop-row span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.ranking-row b {
  color: var(--primary-dark);
  font-size: 15px;
}

.stage-popularity {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.stage-pop-row {
  grid-template-columns: minmax(120px, 0.42fr) minmax(0, 1fr);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(150px, 0.34fr));
  gap: 12px;
  margin-bottom: 18px;
}

.filter-bar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.filter-bar input,
.filter-bar select {
  min-height: 42px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.materials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.material-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 320px;
  padding: 18px;
}

.material-card.is-highlighted {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 168, 112, 0.14), var(--shadow);
}

.card-head,
.card-meta,
.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.card-head {
  margin-bottom: 14px;
}

.material-card h3 {
  font-size: 19px;
}

.material-card p {
  margin-top: 8px;
}

.scenario {
  border-left: 3px solid var(--line);
  padding-left: 10px;
}

.skill-spec {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 7px 10px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.skill-spec dt {
  color: var(--text);
  font-weight: 850;
}

.skill-spec dd {
  margin: 0;
}

.card-meta {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  justify-content: space-between;
  margin-top: 14px;
}

.like-button {
  border-color: rgba(227, 79, 111, 0.25);
  background: #fff6f8;
  color: var(--danger);
}

.like-button.is-liked,
.like-button:disabled {
  border-color: var(--line);
  background: #eef3f7;
  color: var(--muted);
  cursor: default;
}

.empty-state {
  grid-column: 1 / -1;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 28px;
  color: var(--muted);
}

.profile-card {
  padding: 22px;
}

.profile-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
}

.avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-size: 28px;
  font-weight: 900;
}

.profile-head h3 {
  font-size: 30px;
}

.profile-stats,
.score-box,
.rules-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

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

.stat,
.rule-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

.stat strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  font-weight: 900;
}

.profile-stage-list {
  display: grid;
  gap: 16px;
  margin-top: 22px;
}

.profile-stage {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.profile-stage h4,
.teammates h4 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 20px;
}

.profile-stage .material-card {
  margin-top: 14px;
  min-height: auto;
  box-shadow: none;
}

.locked {
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #f9fbfc;
  padding: 22px;
  text-align: center;
}

.teammates {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.teammates a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 12px;
  color: var(--primary-dark);
  font-weight: 850;
}

.rule-card h3 {
  font-size: 18px;
}

.rule-card p {
  margin-top: 8px;
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
  padding-bottom: 34px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
}

.footer-links span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  padding: 8px 12px;
}

.site-footer p {
  margin: 16px 0 0;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .top-nav {
    grid-column: 1 / -1;
    order: 3;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .top-nav a {
    padding: 6px 0 10px;
  }

  .metrics-grid,
  .stage-grid,
  .profile-stats,
  .rules-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 760px) {
  .site-header,
  .hero-section,
  .content-section,
  .site-footer {
    padding-inline: 18px;
  }

  .site-header {
    gap: 14px;
    padding-top: 10px;
  }

  .header-cta {
    min-height: 36px;
    padding-inline: 12px;
  }

  .hero-section {
    padding-top: 44px;
  }

  .hero-asset {
    width: 100%;
    height: 280px;
    opacity: 0.26;
  }

  .hero-content h1 {
    font-size: 34px;
  }

  .hero-copy {
    font-size: 16px;
  }

  .metrics-grid,
  .featured-grid,
  .stage-grid,
  .ranking-layout,
  .materials-grid,
  .profile-stats,
  .score-box,
  .rules-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar {
    grid-template-columns: 1fr;
  }

  .section-heading {
    display: block;
  }

  .section-heading > p,
  .section-heading div + p {
    margin-top: 8px;
  }

  .profile-head {
    grid-template-columns: 1fr;
  }

  .ranking-row {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ranking-row b {
    grid-column: 2;
  }
}
