:root {
  color-scheme: light;
  --ink: #101820;
  --muted: #68747b;
  --paper: #fffaf0;
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --line: rgba(16, 24, 32, 0.13);
  --teal: #0f8f8b;
  --teal-dark: #096963;
  --mint: #9ee6cf;
  --gold: #f6bd49;
  --coral: #f36f61;
  --blue: #5d8de6;
  --violet: #7567cf;
  --shadow: 0 24px 70px rgba(20, 40, 50, 0.18);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 12% 8%, rgba(246, 189, 73, 0.38), transparent 24rem),
    radial-gradient(circle at 86% 16%, rgba(93, 141, 230, 0.24), transparent 26rem),
    radial-gradient(circle at 50% 90%, rgba(15, 143, 139, 0.18), transparent 28rem),
    linear-gradient(135deg, #effaf5 0%, #fff7e7 46%, #eef6ff 100%);
  color: var(--ink);
  font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.38) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.32) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.85), transparent 78%);
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  padding: 0.75rem 1rem;
  background: var(--ink);
  color: white;
  border-radius: 0.5rem;
}

.skip-link:focus {
  top: 1rem;
}

.topbar,
main,
.site-footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0.75rem;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.75rem;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 36px rgba(26, 46, 55, 0.12);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 0.85rem;
  background: linear-gradient(145deg, var(--teal), #19aaa5);
  color: white;
  box-shadow: 0 12px 24px rgba(15, 143, 139, 0.22);
  font-size: 1.16rem;
  font-weight: 900;
}

.brand strong,
.site-footer strong {
  display: block;
  font-size: 1.08rem;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.topnav a {
  padding: 0.68rem 0.85rem;
  border-radius: 999px;
  color: #334047;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 900;
}

.topnav a:hover,
.topnav a:focus {
  background: rgba(15, 143, 139, 0.1);
  color: var(--teal-dark);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.72fr);
  align-items: stretch;
  gap: 1.2rem;
  min-height: 460px;
  padding: 2.1rem 0 1.2rem;
}

.hero-copy,
.hero-panel,
.stats-strip,
.library-head,
.project-band,
.site-footer {
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1.35rem, 5vw, 3.4rem);
  border-radius: 1.5rem;
}

.eyebrow {
  margin: 0 0 0.55rem;
  color: var(--teal-dark);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 1rem;
  font-size: clamp(3rem, 8vw, 6.8rem);
  line-height: 0.86;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0.35rem;
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  line-height: 1;
  letter-spacing: 0;
}

.hero-text {
  max-width: 45rem;
  margin-bottom: 1.5rem;
  color: #40515a;
  font-size: clamp(1.02rem, 2vw, 1.22rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.primary-action,
.secondary-action,
.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  padding: 0.78rem 1.05rem;
  border-radius: 0.72rem;
  text-decoration: none;
  font-weight: 900;
}

.primary-action,
.play-button {
  background: var(--ink);
  color: white;
  box-shadow: 0 14px 28px rgba(16, 24, 32, 0.18);
}

.secondary-action {
  border: 1px solid rgba(16, 24, 32, 0.14);
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
}

.hero-panel {
  display: grid;
  align-content: stretch;
  gap: 1rem;
  overflow: hidden;
  padding: 1rem;
  border-radius: 1.5rem;
}

.hero-panel-top {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-weight: 900;
}

.hero-panel-top strong {
  color: var(--ink);
}

.featured-stack {
  display: grid;
  gap: 0.75rem;
}

.mini-card {
  display: grid;
  grid-template-columns: 5.7rem 1fr;
  gap: 0.75rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.58);
}

.mini-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.8rem;
}

.mini-card strong,
.mini-card span {
  display: block;
}

.mini-card span {
  margin-top: 0.2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 800;
}

.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  margin: 0.2rem 0 1rem;
  border-radius: 1.1rem;
  background: rgba(16, 24, 32, 0.1);
}

.stats-strip article {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
}

.stats-strip span {
  display: block;
  margin-bottom: 0.18rem;
  color: var(--teal-dark);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.stats-strip strong {
  color: var(--muted);
  font-size: 0.84rem;
}

.library-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  padding: 1rem;
  border-radius: 1.1rem;
}

#library-count {
  margin: 0;
  color: var(--muted);
  font-weight: 800;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.filter-button {
  min-height: 2.4rem;
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #35434a;
  cursor: pointer;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 900;
}

.filter-button.is-active,
.filter-button:hover,
.filter-button:focus {
  border-color: transparent;
  background: var(--teal);
  color: white;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  padding-bottom: 1rem;
}

.game-card {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 100%;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.66);
  backdrop-filter: blur(18px);
  box-shadow: 0 20px 46px rgba(24, 45, 55, 0.15);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.game-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 60px rgba(24, 45, 55, 0.2);
}

.cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dfeeea;
}

.cover-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.34), transparent 54%);
}

.cover-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.favorite-button {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  backdrop-filter: blur(16px);
}

.favorite-button.is-favorite {
  background: #fff1c7;
  color: #9c6600;
}

.cover-warning {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.75rem;
  z-index: 2;
  display: none;
  padding: 0.5rem 0.65rem;
  border-radius: 0.45rem;
  background: rgba(23, 35, 41, 0.9);
  color: white;
  font-size: 0.78rem;
  font-weight: 900;
}

.is-missing-cover .cover-warning {
  display: block;
}

.card-body {
  display: grid;
  gap: 0.85rem;
  padding: 1rem;
}

.card-topline,
.card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
  justify-content: space-between;
}

.status-badge,
.genre-pill,
.metric-pill,
.tags span {
  display: inline-flex;
  align-items: center;
  min-height: 1.75rem;
  padding: 0.28rem 0.68rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.status-badge {
  background: #e8f8f2;
  color: #08705f;
}

.status-badge.status-beta {
  background: #fff2cf;
  color: #8b5b00;
}

.status-badge.status-prototype {
  background: #ffe5e5;
  color: #9b3232;
}

.genre-pill {
  background: #eef4ff;
  color: #315f9d;
}

.metric-pill {
  border: 1px solid rgba(16, 24, 32, 0.1);
  background: rgba(255, 255, 255, 0.62);
  color: #46555c;
}

.game-card h3 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.08;
}

.game-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.tags span {
  min-height: 1.6rem;
  border: 1px solid var(--line);
  color: var(--muted);
}

.play-button {
  width: 100%;
}

.play-button:hover,
.play-button:focus,
.primary-action:hover,
.primary-action:focus {
  background: var(--teal-dark);
}

.empty-state {
  margin: 2rem 0;
  padding: 1.5rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: white;
}

.project-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 1.2rem;
  padding: 1.25rem;
  border-radius: 1.2rem;
}

.project-band p {
  max-width: 44rem;
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.project-links {
  display: grid;
  gap: 0.75rem;
}

.project-links a {
  display: grid;
  gap: 0.2rem;
  padding: 1rem;
  border: 1px solid rgba(16, 24, 32, 0.1);
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.62);
  text-decoration: none;
}

.project-links a:hover,
.project-links a:focus {
  border-color: rgba(15, 143, 139, 0.4);
  background: white;
}

.project-links strong {
  font-size: 1.05rem;
}

.project-links span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 800;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 1.15rem;
  border-radius: 1.1rem;
  color: #39474e;
}

.site-footer p {
  max-width: 42rem;
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-content: start;
  justify-content: flex-end;
  gap: 0.55rem;
}

.footer-links a {
  padding: 0.55rem 0.72rem;
  border: 1px solid rgba(16, 24, 32, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 900;
}

@media (max-width: 940px) {
  .hero,
  .project-band {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 680px) {
  .topbar,
  .library-head,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar {
    position: static;
  }

  .topnav,
  .filter-row,
  .footer-links {
    justify-content: flex-start;
  }

  .hero {
    min-height: 0;
    padding-top: 1rem;
  }

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

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

@media (max-width: 420px) {
  .topbar,
  main,
  .site-footer {
    width: min(100% - 20px, 1180px);
  }

  .hero-copy,
  .hero-panel,
  .project-band {
    border-radius: 1rem;
  }

  h1 {
    font-size: 2.75rem;
  }
}
