:root {
  color-scheme: light;
  --ink: #172126;
  --muted: #4e6168;
  --paper: #fff9ef;
  --teal: #25b7a5;
  --blue: #4f8cff;
  --pink: #ff6aa2;
  --yellow: #ffd34f;
  --green: #6acb57;
  --line: rgba(23, 33, 38, 0.14);
  --shadow: 0 24px 60px rgba(23, 33, 38, 0.16);
}

* {
  box-sizing: border-box;
}

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

body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-family:
    Inter, ui-rounded, "Trebuchet MS", Arial, sans-serif;
  background:
    linear-gradient(90deg, rgba(37, 183, 165, 0.12) 1px, transparent 1px),
    linear-gradient(rgba(37, 183, 165, 0.12) 1px, transparent 1px),
    var(--paper);
  background-size: 36px 36px;
}

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

.shell {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
  padding: 18px 0 72px;
}

.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 56px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 1.15rem;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 3px solid var(--ink);
  border-radius: 12px;
  background: var(--teal);
  color: #fff;
  box-shadow: 5px 5px 0 var(--ink);
  font-size: 0.9rem;
  letter-spacing: 0;
}

.nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav a {
  border: 2px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 16px;
  color: var(--muted);
  font-weight: 800;
}

.hero {
  display: grid;
  flex: 1 1 auto;
  grid-template-columns: minmax(300px, 0.58fr) minmax(760px, 1.42fr);
  align-items: start;
  gap: clamp(28px, 4vw, 70px);
  min-height: 0;
  padding: clamp(24px, 5vh, 48px) 0 12px;
}

.hero-copy {
  max-width: 460px;
}

.eyebrow {
  width: max-content;
  margin: 0 0 18px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  padding: 8px 14px;
  box-shadow: 4px 4px 0 var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
}

h1 {
  margin: 0;
  font-size: clamp(3.8rem, 8.4vw, 7rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h1 span {
  display: block;
}

.no-ads-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  padding: 9px 14px;
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 950;
  line-height: 1;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(138px, 1fr));
  justify-content: stretch;
  align-content: start;
  column-gap: clamp(20px, 2.4vw, 38px);
  row-gap: 26px;
  max-height: calc(100vh - 190px);
  overflow-y: auto;
  padding-top: 26px;
  padding-bottom: 24px;
  scrollbar-width: thin;
}

.game-card {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: start;
  width: 100%;
  min-height: 0;
  border-radius: 12px;
  padding: 14px;
  overflow: hidden;
  transition:
    transform 160ms ease,
    filter 160ms ease;
}

.game-card:hover,
.game-card:focus-visible {
  transform: translateY(-4px);
  filter: drop-shadow(0 12px 14px rgba(23, 33, 38, 0.16));
  outline: none;
}

.game-card:focus-visible {
  outline: 4px solid var(--blue);
  outline-offset: 6px;
}

.game-art {
  display: block;
  align-self: start;
  width: 158px;
  aspect-ratio: 1;
  height: 158px;
  margin: 0 auto 14px;
  border: 0;
  border-radius: 18px;
  object-fit: contain;
  filter: drop-shadow(0 7px 0 rgba(23, 33, 38, 0.18));
}

.game-title {
  display: block;
  width: 100%;
  margin-top: 0;
  text-align: center;
  font-size: 1.28rem;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: 0;
}

.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 10px;
  z-index: 5;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 0 12px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 800;
}

@media (max-height: 780px) and (min-width: 761px) {
  .shell {
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .masthead {
    min-height: 48px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    box-shadow: 4px 4px 0 var(--ink);
  }

  .no-ads-badge {
    padding: 7px 12px;
    font-size: 0.98rem;
  }

  .hero {
    min-height: auto;
    padding-top: 20px;
    gap: clamp(24px, 3.5vw, 54px);
  }

  h1 {
    font-size: clamp(3.35rem, 7.5vw, 6.05rem);
    line-height: 0.98;
  }

  .game-grid {
    max-height: calc(100vh - 180px);
    padding-top: 14px;
    padding-bottom: 24px;
    column-gap: clamp(18px, 2.2vw, 30px);
    row-gap: 22px;
    grid-template-columns: repeat(5, minmax(122px, 1fr));
  }

  .game-art {
    width: 132px;
    height: 132px;
  }

  .game-title {
    font-size: 1.08rem;
  }
}

.site-footer a,
.legal-page a {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.legal-page {
  max-width: 820px;
  margin: 44px auto 0;
  border: 4px solid var(--ink);
  border-radius: 8px;
  background: #fff;
  padding: clamp(20px, 4vw, 38px);
  box-shadow: 8px 8px 0 var(--ink);
}

.legal-page h1 {
  font-size: clamp(2.4rem, 7vw, 4.8rem);
}

.legal-page h2 {
  margin: 30px 0 8px;
  font-size: 1.25rem;
  line-height: 1.15;
}

.legal-page p {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 1.04rem;
  font-weight: 650;
  line-height: 1.55;
}

.legal-page .updated {
  margin: 14px 0 24px;
  color: var(--ink);
  font-weight: 900;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 900;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .shell {
    width: min(100% - 22px, 620px);
    padding-top: 14px;
    padding-bottom: 86px;
  }

  .hero {
    grid-template-columns: 1fr;
    align-items: start;
    min-height: auto;
    padding-top: 26px;
    gap: 14px;
  }

  .hero-copy {
    max-width: 100%;
  }

  h1 {
    font-size: clamp(2.8rem, 16vw, 4.6rem);
    line-height: 0.98;
    max-width: 8.2em;
  }

  h1 span {
    display: inline;
  }

  .game-grid {
    grid-template-columns: repeat(2, minmax(150px, 190px));
    justify-content: start;
    max-height: none;
    overflow: visible;
    padding-top: 0;
    gap: 18px;
  }
}

@media (min-width: 761px) and (max-width: 1040px) {
  .hero {
    grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  }

  .game-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    justify-content: start;
    gap: 24px;
  }
}
