* {
  box-sizing: border-box;
}

:root {
  --ink: #172016;
  --muted: #66705c;
  --paper: #fffaf0;
  --surface: #ffffff;
  --field: #d9e8bd;
  --leaf: #2f6f3e;
  --leaf-dark: #174728;
  --soil: #56371f;
  --soil-soft: #8a6238;
  --wheat: #f2c96d;
  --potato: #c98b45;
  --potato-red: #b66a5f;
  --game-bg: #f6f7d7;
  --game-grid: rgba(47, 111, 62, 0.1);
  --bg: var(--game-bg);
  --grid: var(--game-grid);
  --food: var(--potato);
  --snake: #46b85a;
  --snake-head: #176d32;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: "Segoe UI", Arial, Helvetica, sans-serif;
  background:
    linear-gradient(rgba(255, 250, 240, 0.82), rgba(255, 250, 240, 0.96)),
    repeating-linear-gradient(90deg, #d9e8bd 0 24px, #cfdfad 24px 48px);
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px clamp(16px, 4vw, 48px);
  background: rgba(255, 250, 240, 0.92);
  border-bottom: 1px solid rgba(86, 55, 31, 0.18);
  backdrop-filter: blur(12px);
}

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

.brand-mark,
.potato-shape {
  display: inline-block;
  width: 26px;
  height: 34px;
  background: var(--potato);
  border: 2px solid rgba(86, 55, 31, 0.35);
  border-radius: 48% 42% 52% 44%;
  box-shadow: inset -5px -6px 0 rgba(86, 55, 31, 0.13);
  transform: rotate(-16deg);
}

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

.site-nav a {
  padding: 8px 12px;
  color: var(--soil);
  font-weight: 800;
  text-decoration: none;
  border-radius: 6px;
}

.site-nav a:hover {
  background: rgba(242, 201, 109, 0.35);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(24px, 6vw, 70px);
  min-height: calc(100vh - 66px);
  padding: clamp(36px, 7vw, 86px) clamp(16px, 6vw, 76px);
}

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

.eyebrow {
  margin: 0 0 10px;
  color: var(--leaf);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

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

h1 {
  max-width: 820px;
  margin-bottom: 18px;
  color: var(--soil);
  font-size: clamp(2.5rem, 8vw, 6.4rem);
  line-height: 0.92;
  letter-spacing: 0;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 660px;
  margin-bottom: 28px;
  color: #3e4b37;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}

.button.primary,
button {
  color: #fffaf0;
  background: var(--leaf);
  box-shadow: 0 12px 28px rgba(47, 111, 62, 0.26);
}

.button.secondary {
  color: var(--soil);
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(86, 55, 31, 0.18);
}

.button:hover,
button:hover {
  transform: translateY(-1px);
}

.hero-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.hero-image {
  grid-column: 1 / -1;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border: 1px solid rgba(86, 55, 31, 0.14);
  border-radius: 8px;
  box-shadow: 0 22px 58px rgba(86, 55, 31, 0.18);
}

.potato-card {
  display: grid;
  min-height: 164px;
  padding: 18px;
  align-content: end;
  color: var(--soil);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(86, 55, 31, 0.14);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgba(86, 55, 31, 0.12);
}

.potato-card.large {
  grid-row: span 2;
  min-height: 342px;
}

.potato-card strong {
  margin-top: 18px;
  font-size: 1.35rem;
}

.potato-card small {
  color: var(--muted);
  font-weight: 700;
}

.potato-shape {
  width: 76px;
  height: 100px;
  border-width: 3px;
}

.potato-shape.red {
  background: var(--potato-red);
}

.potato-shape.gold {
  background: #d2a14c;
}

.hub-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(86, 55, 31, 0.16);
  border-block: 1px solid rgba(86, 55, 31, 0.16);
}

.hub-strip a {
  display: grid;
  gap: 6px;
  min-height: 126px;
  padding: 22px clamp(16px, 4vw, 40px);
  text-decoration: none;
  background: rgba(255, 250, 240, 0.88);
}

.hub-strip span {
  color: var(--leaf);
  font-weight: 900;
}

.hub-strip strong {
  color: var(--soil);
  font-size: 1.25rem;
}

.hub-strip small {
  color: var(--muted);
  font-size: 0.95rem;
}

.game-section,
.devotion-section,
.guide-section,
.facts-section {
  padding: clamp(48px, 7vw, 86px) clamp(16px, 6vw, 76px);
}

.game-section {
  background:
    linear-gradient(rgba(23, 71, 40, 0.9), rgba(23, 71, 40, 0.9)),
    linear-gradient(135deg, var(--leaf-dark), var(--leaf));
  color: #fffaf0;
}

.section-heading {
  max-width: 760px;
  margin: 0 auto 28px;
  text-align: center;
}

.section-heading h2 {
  margin-bottom: 10px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1;
  letter-spacing: 0;
}

.section-heading p:not(.eyebrow) {
  color: currentColor;
  opacity: 0.78;
  line-height: 1.6;
}

.game-shell {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

#score {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 126px;
  padding: 8px 14px;
  color: #fffaf0;
  font-weight: 900;
  background: var(--soil);
  border-radius: 999px;
}

.game-topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.game-stage {
  position: relative;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
  background: var(--game-bg);
  border: 4px solid var(--soil);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.76),
    0 18px 38px rgba(86, 55, 31, 0.24);
}

canvas:focus {
  outline: 3px solid rgba(242, 201, 109, 0.85);
  outline-offset: 4px;
}

#overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #fffaf0;
  background: rgba(23, 32, 22, 0.72);
  border-radius: 8px;
  backdrop-filter: blur(3px);
}

#overlay.hidden {
  display: none;
}

#message {
  font-size: clamp(1.35rem, 4vw, 2.2rem);
  font-weight: 900;
}

.hint {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  text-align: center;
}

.guide-section {
  background: var(--paper);
}

.devotion-section {
  background: #fffaf0;
}

.devotion-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 1080px;
  margin: 0 auto;
}

.devotion-grid article {
  padding: 24px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(86, 55, 31, 0.12);
  border-radius: 8px;
}

.devotion-grid h3 {
  margin-bottom: 10px;
  color: var(--soil);
  font-size: 1.2rem;
}

.devotion-grid p {
  color: var(--muted);
  line-height: 1.65;
}

.guide-grid,
.facts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
}

.guide-grid article,
.facts-grid article {
  padding: 22px;
  background: var(--surface);
  border: 1px solid rgba(86, 55, 31, 0.12);
  border-radius: 8px;
  box-shadow: 0 16px 42px rgba(86, 55, 31, 0.1);
}

.guide-grid h3,
.facts-grid h3 {
  margin-bottom: 8px;
  color: var(--soil);
  font-size: 1.35rem;
}

.guide-grid p,
.facts-grid p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.facts-section {
  background: #f3e7cf;
}

.facts-grid span {
  display: inline-flex;
  margin-bottom: 18px;
  color: var(--leaf);
  font-size: 1.85rem;
  font-weight: 900;
}

.site-footer {
  padding: 24px clamp(16px, 6vw, 76px);
  color: #fffaf0;
  background: var(--soil);
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-weight: 800;
}

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

  .site-nav {
    width: 100%;
    justify-content: space-between;
  }

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

  .hub-strip,
  .devotion-grid,
  .guide-grid,
  .facts-grid {
    grid-template-columns: 1fr;
  }

  .game-topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .site-nav a {
    padding-inline: 8px;
    font-size: 0.94rem;
  }

  .hero-board {
    grid-template-columns: 1fr;
  }

  .potato-card.large {
    min-height: 210px;
  }

  .game-shell {
    padding: 10px;
  }
}
