:root {
  --background: #f3fbf5;
  --surface: #ffffff;
  --surface-blue: #e5f4ff;
  --text: #163126;
  --muted: #546a61;
  --border: #c8e4d2;
  --green: #249455;
  --green-dark: #12613a;
  --blue: #1f82c0;
  --blue-dark: #14537c;
  --yellow: #f5cb3c;
  --yellow-dark: #9a7114;
  --danger: #e05c4b;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #e5f4ff 0, var(--background) 340px),
    var(--background);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

a {
  color: var(--green-dark);
}

.site-header {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  padding: 16px clamp(18px, 5vw, 64px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.brand::before {
  background: var(--yellow);
  border: 2px solid var(--green-dark);
  content: "";
  display: inline-block;
  height: 14px;
  margin-right: 10px;
  vertical-align: -1px;
  width: 14px;
}

.site-nav {
  display: flex;
  gap: 18px;
}

.site-nav a {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a:focus {
  color: var(--blue-dark);
}

.hero {
  align-items: center;
  display: grid;
  gap: clamp(28px, 6vw, 80px);
  grid-template-columns: minmax(0, 1fr) minmax(280px, 480px);
  min-height: min(680px, calc(100vh - 65px));
  padding: clamp(40px, 8vw, 88px) clamp(18px, 5vw, 64px);
}

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

.hero h1,
.page-heading h1,
.game-heading h1 {
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1;
  margin: 0 0 20px;
}

.hero p,
.page-heading p,
.game-heading p,
.section-heading p {
  color: var(--muted);
  font-size: 18px;
  max-width: 640px;
}

.button {
  background: var(--green);
  border-radius: 8px;
  color: white;
  display: inline-flex;
  font-weight: 700;
  margin-top: 12px;
  padding: 12px 18px;
  text-decoration: none;
}

.button:hover,
.button:focus {
  background: var(--green-dark);
}

.pixel-scene {
  aspect-ratio: 4 / 3;
  background: linear-gradient(var(--surface-blue) 0 68%, #78bf6b 68% 100%);
  border: 3px solid var(--text);
  border-radius: 8px;
  box-shadow: 12px 12px 0 rgba(29, 37, 34, 0.12);
  min-height: 260px;
  position: relative;
}

.snake-dot,
.food-dot,
.bird-shape,
.pipe-shape {
  display: block;
  position: absolute;
}

.snake-dot {
  background: var(--green);
  border: 3px solid var(--green-dark);
  height: 34px;
  width: 34px;
}

.snake-dot-one {
  bottom: 20%;
  left: 12%;
}

.snake-dot-two {
  bottom: 20%;
  left: calc(12% + 34px);
}

.snake-dot-three {
  bottom: 20%;
  left: calc(12% + 68px);
}

.food-dot {
  background: var(--danger);
  border: 3px solid #8a2c25;
  bottom: 38%;
  height: 28px;
  left: 54%;
  width: 28px;
}

.bird-shape {
  background: var(--yellow);
  border: 3px solid var(--yellow-dark);
  border-radius: 50% 55% 45% 55%;
  height: 42px;
  right: 24%;
  top: 34%;
  width: 54px;
}

.pipe-shape {
  background: #4f9e5f;
  border: 3px solid var(--green-dark);
  right: 8%;
  width: 54px;
}

.pipe-shape-top {
  height: 32%;
  top: 0;
}

.pipe-shape-bottom {
  bottom: 0;
  height: 30%;
}

.section,
.page-heading,
.page-list,
.game-page {
  padding: clamp(34px, 6vw, 72px) clamp(18px, 5vw, 64px);
}

.section-heading h2,
.page-heading h1,
.game-card h2,
.game-card h3 {
  margin-top: 0;
}

.game-list {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 26px;
}

.game-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px;
}

.game-card:hover {
  border-color: var(--blue);
}

.game-card p {
  color: var(--muted);
}

.game-card a {
  font-weight: 700;
}

.game-heading {
  margin-bottom: 18px;
  width: min(100%, 760px);
}

.game-page {
  align-items: center;
  display: flex;
  flex-direction: column;
  padding-block: clamp(20px, 3vw, 40px);
}

.game-heading h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.game-heading p {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  font-weight: 700;
  margin-bottom: 18px;
  text-decoration: none;
}

.mobile-game-message {
  background: var(--surface-blue);
  border: 2px solid var(--blue);
  border-radius: 8px;
  display: none;
  margin-top: 24px;
  padding: 22px;
}

.mobile-game-message h2 {
  margin: 0 0 8px;
}

.mobile-game-message p {
  color: var(--muted);
  margin: 0;
}

.game-frame-wrap {
  --game-aspect: 3 / 2;
  --game-height: 400px;
  aspect-ratio: var(--game-aspect);
  background: var(--text);
  border: 3px solid var(--text);
  border-radius: 8px;
  height: clamp(300px, calc(100vh - 300px), var(--game-height));
  max-width: 100%;
  overflow: hidden;
}

.game-frame {
  aspect-ratio: var(--game-aspect);
  background: #111;
  border: 0;
  display: block;
  height: 100%;
  min-height: 0;
  width: 100%;
}

@media (max-width: 780px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

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

  .pixel-scene {
    min-height: 220px;
  }

  .game-heading h1 {
    font-size: clamp(38px, 12vw, 54px);
  }

}

@media (max-width: 780px), (hover: none) and (pointer: coarse) {
  .desktop-play-area {
    display: none;
  }

  .mobile-game-message {
    display: block;
  }
}
