:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #eef2ef;
  color: #18211d;
  --ink: #18211d;
  --muted: #647069;
  --line: #cad3ce;
  --surface: #ffffff;
  --green: #226b50;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: #eef2ef;
}

button {
  font: inherit;
}

[hidden] {
  display: none !important;
}

.site-header {
  border-bottom: 1px solid #c8d1cc;
  background: #ffffff;
}

.site-nav {
  display: flex;
  width: min(1160px, 100%);
  min-height: 64px;
  align-items: center;
  justify-content: space-between;
  margin: 0 auto;
  padding: 0 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
  background: #1f614a;
  color: #ffffff;
  font-size: 14px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid #d4dcd8;
  border-radius: 6px;
  background: #f5f7f5;
  font-size: 13px;
  font-weight: 850;
}

.nav-links a,
.nav-links span {
  padding: 7px 12px;
  border-radius: 4px;
}

.nav-links a {
  color: #65716b;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links span {
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(24, 33, 29, 0.1);
}

.page {
  width: min(1160px, 100%);
  margin: 0 auto;
  padding: 40px 24px 72px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 48px;
  align-items: end;
  padding: 8px 0 38px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.intro h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1;
  letter-spacing: 0;
}

.intro-copy > p:last-child {
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.catalog-stats {
  display: flex;
  margin: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.catalog-stats div {
  min-width: 108px;
  padding: 12px 16px;
  border-left: 1px solid var(--line);
}

.catalog-stats div:last-child {
  border-right: 1px solid var(--line);
}

.catalog-stats dt {
  margin-bottom: 4px;
  color: #748079;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.catalog-stats dd {
  margin: 0;
  color: var(--ink);
  font-size: 16px;
  font-weight: 900;
}

.catalog {
  border-top: 1px solid var(--line);
  padding-top: 30px;
}

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

.catalog-heading h2 {
  margin: 0;
  font-size: 27px;
  letter-spacing: 0;
}

.result-count {
  flex: none;
  padding-bottom: 2px;
  color: #748079;
  font-size: 13px;
  font-weight: 800;
}

.filter-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  margin: 0 -8px 18px;
  padding: 8px;
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
  background: rgba(238, 242, 239, 0.96);
  backdrop-filter: blur(10px);
}

.filter-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-tabs::-webkit-scrollbar {
  display: none;
}

.filter-tab {
  display: inline-flex;
  min-height: 40px;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid #bdc9c3;
  border-radius: 5px;
  background: #ffffff;
  color: #526059;
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}

.filter-tab span {
  color: #839089;
  font-size: 11px;
}

.filter-tab:hover {
  border-color: #75857d;
  color: var(--ink);
}

.filter-tab.active {
  border-color: #1f614a;
  background: #1f614a;
  color: #ffffff;
}

.filter-tab.active span {
  color: #c9e2d6;
}

.filter-tab:focus-visible,
.game-card:focus-visible,
.nav-links a:focus-visible,
.brand:focus-visible {
  outline: 3px solid #c9dc55;
  outline-offset: 3px;
}

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

.game-card {
  position: relative;
  display: grid;
  min-width: 0;
  min-height: 172px;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 15px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid #c8d1cc;
  border-left: 4px solid var(--card-accent);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.game-card:hover {
  border-color: var(--card-accent);
  box-shadow: 0 7px 18px rgba(24, 33, 29, 0.08);
  transform: translateY(-1px);
}

.game-icon {
  display: block;
  width: 56px;
  height: 56px;
  border-radius: 7px;
}

.card-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.card-heading {
  display: flex;
  min-width: 0;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.card-heading > div {
  min-width: 0;
}

.game-meta {
  margin: 0 0 3px;
  color: var(--card-accent);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.game-card h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.badge {
  display: inline-flex;
  min-height: 23px;
  flex: none;
  align-items: center;
  padding: 3px 7px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 900;
  text-transform: uppercase;
}

.badge.new {
  background: #d9ed58;
  color: #26300d;
}

.badge.progress {
  background: #e7e0f5;
  color: #59439a;
}

.game-description {
  display: -webkit-box;
  margin: 8px 0 13px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-footer {
  display: flex;
  min-height: 28px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  color: #718078;
  font-size: 11px;
  font-weight: 750;
}

.launch {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  border: 1px solid #c7d0cb;
  border-radius: 50%;
  color: var(--card-accent);
  font-size: 16px;
  font-weight: 900;
}

@media (max-width: 780px) {
  .intro {
    grid-template-columns: 1fr;
    gap: 25px;
    align-items: start;
  }

  .catalog-stats {
    width: max-content;
    max-width: 100%;
  }

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

@media (max-width: 520px) {
  .site-nav {
    min-height: 60px;
    padding: 0 16px;
  }

  .brand > span:last-child {
    display: none;
  }

  .nav-links {
    gap: 3px;
  }

  .nav-links a,
  .nav-links span {
    padding: 7px 10px;
  }

  .page {
    padding: 28px 14px 52px;
  }

  .intro {
    padding: 4px 0 28px;
  }

  .intro h1 {
    font-size: 38px;
  }

  .intro-copy > p:last-child {
    font-size: 16px;
  }

  .catalog-stats {
    width: 100%;
  }

  .catalog-stats div {
    min-width: 0;
    flex: 1;
    padding: 10px;
  }

  .catalog-stats dd {
    font-size: 14px;
    overflow-wrap: anywhere;
  }

  .catalog-heading {
    align-items: start;
  }

  .catalog-heading h2 {
    font-size: 23px;
  }

  .filter-bar {
    margin-right: -14px;
    margin-left: -14px;
    padding-right: 14px;
    padding-left: 14px;
  }

  .game-card {
    min-height: 164px;
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 12px;
    padding: 14px 12px;
  }

  .game-icon {
    width: 48px;
    height: 48px;
  }

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

  .badge {
    min-height: 21px;
    padding: 3px 5px;
  }
}

@media (max-width: 350px) {
  .catalog-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .catalog-stats div {
    padding: 8px 6px;
  }

  .catalog-stats dt {
    font-size: 9px;
  }

  .game-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .game-icon {
    width: 42px;
    height: 42px;
  }

  .card-heading {
    gap: 5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .game-card {
    transition: none;
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    background: #171b19;
    color: #f1f4f1;
    --ink: #f1f4f1;
    --muted: #aab5ae;
    --line: #46514b;
    --surface: #242a27;
  }

  body,
  .filter-bar {
    background: #171b19;
  }

  .site-header,
  .nav-links,
  .filter-tab {
    background: #242a27;
  }

  .site-header,
  .catalog,
  .catalog-stats,
  .catalog-stats div,
  .nav-links,
  .game-card,
  .filter-tab {
    border-color: #46514b;
  }

  .nav-links span {
    background: #343c38;
  }

  .nav-links a,
  .filter-tab,
  .card-footer,
  .result-count,
  .catalog-stats dt {
    color: #aab5ae;
  }

  .filter-tab.active {
    border-color: #64a385;
    background: #347156;
    color: #ffffff;
  }

  .launch {
    border-color: #59645e;
  }
}
