:root {
  color-scheme: dark;
  --bg: #11130f;
  --panel: #191d17;
  --panel-strong: #22281f;
  --text: #f5f0df;
  --muted: #b8b09b;
  --line: rgba(245, 240, 223, 0.14);
  --mint: #68d7aa;
  --amber: #f0b45b;
  --rose: #df6e7d;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background:
    linear-gradient(135deg, rgba(104, 215, 170, 0.12), transparent 32%),
    linear-gradient(315deg, rgba(240, 180, 91, 0.14), transparent 30%),
    radial-gradient(circle at 60% 20%, rgba(223, 110, 125, 0.16), transparent 28%),
    var(--bg);
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(245, 240, 223, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245, 240, 223, 0.035) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
}

a {
  color: inherit;
}

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

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 10;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  transform: translateY(-140%);
  transition: transform 160ms ease;
}

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

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.masthead {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  min-height: 28vh;
  padding: 28px 0 32px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  max-width: 720px;
  margin: 0;
  font-size: clamp(2.8rem, 12vw, 6.5rem);
  line-height: 0.92;
}

.lead {
  max-width: 560px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
}

.status-panel {
  display: grid;
  gap: 8px;
  min-width: 168px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 29, 23, 0.78);
  box-shadow: var(--shadow);
}

.status-panel span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 5px;
  background: rgba(245, 240, 223, 0.06);
  color: var(--muted);
  font-size: 0.86rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0 0 22px;
}

.filter-pill {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(25, 29, 23, 0.72);
  color: var(--muted);
  cursor: default;
  font: inherit;
}

.filter-pill.is-active {
  border-color: rgba(104, 215, 170, 0.55);
  background: rgba(104, 215, 170, 0.16);
  color: var(--text);
}

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

.game-card {
  display: grid;
  grid-template-columns: minmax(150px, 34%) minmax(0, 1fr);
  overflow: hidden;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(25, 29, 23, 0.82);
  box-shadow: var(--shadow);
  animation: rise 520ms cubic-bezier(0.2, 0.7, 0.2, 1) both;
  animation-delay: calc(var(--index) * 80ms);
}

.game-card--mint {
  --accent: var(--mint);
}

.game-card--amber {
  --accent: var(--amber);
}

.cover-art {
  position: relative;
  min-height: 100%;
  overflow: hidden;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 34%, transparent), transparent 58%),
    radial-gradient(circle at 70% 28%, color-mix(in srgb, var(--accent) 36%, transparent), transparent 22%),
    var(--panel-strong);
}

.cover-art::before,
.cover-art::after {
  position: absolute;
  content: "";
}

.cover-art::before {
  inset: 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 8px;
}

.cover-art::after {
  width: 140px;
  height: 140px;
  right: -42px;
  bottom: -34px;
  border: 28px solid color-mix(in srgb, var(--accent) 38%, transparent);
  border-radius: 999px;
}

.cover-number {
  position: absolute;
  left: 24px;
  bottom: 22px;
  color: color-mix(in srgb, var(--accent) 86%, white);
  font-family: Consolas, "SFMono-Regular", monospace;
  font-size: 3.2rem;
  font-weight: 800;
}

.cover-line {
  position: absolute;
  top: 52px;
  right: 28px;
  width: 58%;
  height: 2px;
  background: color-mix(in srgb, var(--accent) 70%, transparent);
}

.cover-dot {
  position: absolute;
  top: 82px;
  left: 28px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 85%, white);
}

.card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 28px;
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: auto;
}

.meta-row span {
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--accent) 80%, white);
  font-size: 0.78rem;
}

h2 {
  margin: 34px 0 8px;
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  line-height: 1.05;
}

.subtitle,
.description {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.subtitle {
  color: color-mix(in srgb, var(--accent) 72%, white);
}

.description {
  margin-top: 14px;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.play-link,
.repo-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 46%, transparent);
  border-radius: 6px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.play-link {
  justify-content: space-between;
  width: min(100%, 180px);
  background: color-mix(in srgb, var(--accent) 18%, transparent);
}

.repo-link {
  min-width: 116px;
  background: rgba(245, 240, 223, 0.05);
}

.play-link:hover,
.play-link:focus-visible,
.repo-link:hover,
.repo-link:focus-visible {
  border-color: color-mix(in srgb, var(--accent) 78%, white);
  background: color-mix(in srgb, var(--accent) 28%, transparent);
  transform: translateY(-2px);
  outline: none;
}

.filter-pill:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 3px;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 820px) {
  .shell {
    width: min(100% - 24px, 620px);
    padding-top: 24px;
  }

  .masthead {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .status-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    min-width: 0;
  }

  .status-panel span {
    justify-content: center;
    text-align: center;
  }

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

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 420px);
    padding-bottom: 34px;
  }

  .masthead {
    padding-bottom: 22px;
  }

  .lead {
    font-size: 0.98rem;
  }

  .status-panel {
    grid-template-columns: 1fr;
  }

  .toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 16px;
  }

  .filter-pill {
    flex: 0 0 auto;
  }

  .game-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .cover-art {
    min-height: 180px;
  }

  .card-body {
    padding: 22px;
  }

  h2 {
    margin-top: 28px;
  }

  .play-link {
    width: 100%;
  }

  .repo-link {
    flex: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
