@font-face {
  font-family: "Baloo 2";
  src: url("../assets/Baloo2.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f7f1e6;
  --meadow: #e4efe3;
  --ink: #2c2118;
  --ink-soft: #6e5848;
  --card: #fff9f2;
  --grass: #6aaa48;
  --grass-deep: #4e8c38;
  --wood: #c4894a;
  --wood-dark: #7a4e28;
  --heart: #d4534a;
  --sun: #ffe44a;
  --sun-deep: #f6a318;
  --sun-shadow: rgba(200, 106, 18, 0.4);
  --text-shadow: rgba(196, 90, 16, 0.45);
  --link: #3e5f93;
  --brown: #6b3a12;
  --coral: #e4544a;
  --gold: #f2c431;
  --blue: #3d86d6;
  --aqua: #2eaea4;
  --pink: #e25b93;
  --orange: #f08a2c;
  --amber: #c46a22;
  --purple: #7a62d0;
  --lime: #b6e14a;
  --header: 64px;
  --dock: 92px;
  color-scheme: light;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  overflow-x: clip;
  min-height: 100dvh;
  color: var(--ink);
  font: 17px/1.5 ui-rounded, "SF Pro Rounded", "Nunito", system-ui, sans-serif;
  background: #8ecaf0;
}

body.page-home { background: var(--paper); }
.page-home .shell { padding-bottom: var(--dock); }

img { max-width: 100%; height: auto; display: block; }

a { color: var(--link); }

button, input, textarea { font: inherit; }

.skip {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 20;
  padding: 8px 12px;
  background: var(--card);
  color: var(--ink);
  border-radius: 10px;
  transform: translateY(-150%);
}

.skip:focus { transform: none; }

.shell {
  width: 100%;
  min-height: 100dvh;
  background: var(--paper);
  position: relative;
}

.top h1 { margin: 0; line-height: 0; }

.page-home .top {
  position: absolute;
  inset: 0 0 auto 0;
  z-index: 2;
  height: auto;
  justify-content: center;
  align-items: flex-start;
  padding-top: 10px;
  background: none;
}

.page-home .logo {
  width: min(232px, 62vw);
  height: auto;
  filter: drop-shadow(0 8px 12px rgba(44, 33, 24, 0.22));
}

.top {
  position: relative;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header);
  padding: 0 16px;
  background: linear-gradient(rgba(126, 196, 232, 0.2), rgba(126, 196, 232, 0));
}

.page-privacy .top {
  background: rgba(247, 241, 230, 0.92);
  backdrop-filter: blur(10px);
}

.wordmark { width: min(148px, 46vw); }

.nav {
  color: #fff;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.15rem;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(44, 33, 24, 0.55);
  padding: 8px;
}

.page-privacy .nav {
  color: var(--link);
  text-shadow: none;
}

.hero {
  position: relative;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: -6% 0;
  z-index: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  will-change: transform;
}

.hero-ui {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100dvh;
  padding: 176px 22px 28px;
}

.hero-spacer { flex: 1; }

.store {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 78px;
  padding: 12px 18px;
  border: 0;
  border-radius: 22px;
  background: linear-gradient(var(--sun), var(--sun-deep));
  color: #fff;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.15rem;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-shadow: 0 1px 0 var(--text-shadow);
  box-shadow: 0 5px 10px var(--sun-shadow);
  will-change: transform;
}

.store svg { width: 22px; height: 26px; flex: none; }

.store:focus-visible,
.nav:focus-visible,
.cell:focus-visible,
.ghost:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
}

.fine {
  margin: 10px 0 0;
  text-align: center;
  color: #fff;
  text-shadow: 0 1px 2px rgba(44, 33, 24, 0.55);
}

.section { padding: 36px 20px; }

.section h2,
.privacy h1,
.privacy h2 {
  font-family: "Baloo 2", system-ui, sans-serif;
  line-height: 1.15;
  margin: 0 0 8px;
}

.section h2 { font-size: 2rem; color: var(--brown); }
.split { line-height: 1.2; }

.lead { margin: 0 0 18px; color: var(--ink-soft); }

.cards { display: grid; gap: 12px; }

.card {
  padding: 16px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 8px 0 rgba(122, 78, 40, 0.12);
  transform-style: preserve-3d;
  will-change: transform;
}

.card b {
  display: block;
  margin-bottom: 4px;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.2rem;
  color: var(--brown);
}

.card p { margin: 0; color: var(--ink-soft); }

.swatch {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  border-radius: 10px;
}

.play {
  background: url("../assets/grass.jpg") center / cover;
  color: #fff;
}

.play h2,
.play .lead { color: #fff; text-shadow: 0 1px 2px rgba(44, 33, 24, 0.45); }

.play-board {
  width: min(100%, 420px);
  margin-inline: auto;
}

.fence {
  position: relative;
  width: 100%;
  padding: 22px 16px 16px;
  border: 12px solid var(--wood);
  border-radius: 16px;
  box-shadow:
    inset 0 0 0 3px rgba(122, 78, 40, 0.45),
    0 10px 0 rgba(78, 56, 44, 0.25);
  background: rgba(255, 255, 255, 0.08);
}

.post {
  position: absolute;
  width: 18px;
  height: 26px;
  border-radius: 4px;
  background: linear-gradient(#e0b273, var(--wood-dark));
  box-shadow: inset 0 0 0 2px rgba(44, 33, 24, 0.15);
}

.post.nw { top: -8px; left: -8px; }
.post.ne { top: -8px; right: -8px; }
.post.sw { bottom: -8px; left: -8px; }
.post.se { bottom: -8px; right: -8px; }

.grid {
  display: grid;
  width: 100%;
  aspect-ratio: 1;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(5, minmax(0, 1fr));
  gap: 5px;
}

.cell {
  position: relative;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 10px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.cell::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: var(--pad);
  opacity: 0.8;
}

.cell img {
  position: absolute;
  inset: 4%;
  width: 92%;
  height: 92%;
  object-fit: contain;
  pointer-events: none;
  z-index: 1;
}

.cell.is-cross::after {
  content: "";
  position: absolute;
  inset: 24%;
  background:
    linear-gradient(#fff, #fff) center / 22% 100% no-repeat,
    linear-gradient(#fff, #fff) center / 100% 22% no-repeat;
  transform: rotate(45deg);
  z-index: 1;
}

.board-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 0;
}

.status {
  margin: 0;
  min-height: 1.5em;
  text-shadow: 0 1px 2px rgba(44, 33, 24, 0.45);
}

.win {
  width: min(360px, calc(100vw - 32px));
  margin: auto;
  padding: 28px 22px 18px;
  border: 0;
  border-radius: 32px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(22, 48, 138, 0.18);
  color: var(--ink);
  text-align: center;
}

.win::backdrop { background: rgba(0, 0, 0, 0.22); }

.win h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

.win p {
  margin: 0 0 18px;
  color: var(--link);
  font-weight: 700;
}

.win .store { width: 100%; min-height: 64px; }

.win-again {
  display: block;
  margin: 12px auto 0;
  border: 0;
  padding: 8px 12px;
  background: none;
  color: var(--link);
  font-weight: 700;
  cursor: pointer;
}

.ghost {
  border: 0;
  border-radius: 14px;
  padding: 10px 14px;
  background: var(--card);
  color: var(--link);
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1rem;
  cursor: pointer;
}

.cta { padding-bottom: 28px; }

.form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.form label { display: grid; gap: 4px; color: var(--ink-soft); }

.form input,
.form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(44, 33, 24, 0.08);
}

.form textarea { min-height: 110px; resize: vertical; }

.hp {
  position: absolute;
  left: -9999px;
  height: 0;
  overflow: hidden;
}

.form button {
  min-height: 52px;
  border: 0;
  border-radius: 16px;
  background: var(--link);
  color: #fff;
  font-family: "Baloo 2", system-ui, sans-serif;
  font-size: 1.2rem;
  cursor: pointer;
}

.note { min-height: 1.4em; margin: 0; color: var(--grass-deep); }

.foot {
  padding: 8px 20px 28px;
  color: var(--ink-soft);
  text-align: center;
}

.dock {
  position: fixed;
  z-index: 6;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(rgba(247, 241, 230, 0), var(--paper) 28%);
}

.dock[hidden] { display: none; }

.dock .store { min-height: 64px; font-size: 1.35rem; }

.sparks {
  position: fixed;
  inset: 0;
  z-index: 7;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.privacy {
  padding: 12px 20px 48px;
}

.privacy h1 { font-size: 2rem; color: var(--brown); }

.privacy h2 { font-size: 1.35rem; margin-top: 1.6rem; color: var(--ink); }

.privacy .meta { color: var(--ink-soft); }

.privacy hr {
  border: 0;
  border-top: 1px solid rgba(44, 33, 24, 0.12);
  margin: 2rem 0;
}

@media (min-width: 900px) {
  .page-home .shell { padding-bottom: 0; }
  .dock { display: none; }

  .top { padding-inline: 40px; }
  .wordmark { width: 180px; }
  .page-home .logo { width: 320px; }
  .page-home .hero-ui { padding-top: 88px; }

  .page-home .hero,
  .page-home .hero-ui { min-height: 100dvh; }

  .hero-ui {
    width: min(760px, calc(100% - 80px));
    margin-inline: auto;
  }

  .hero-ui > .store { width: min(440px, 100%); align-self: center; font-size: 1.45rem; }
  .hero-bg img { object-position: center 42%; }

  .section { padding: 72px 64px; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 20px; }

  .play {
    display: grid;
    grid-template-columns: minmax(260px, 1fr) minmax(280px, 460px);
    gap: 28px 64px;
    align-items: center;
  }

  .play-board { width: min(100%, 460px); justify-self: end; }

  .cta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
  }

  .cta .store { width: min(440px, 100%); font-size: 1.45rem; }

  .privacy {
    width: min(760px, 100%);
    margin-inline: auto;
    padding-bottom: 80px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-bg img, .card, .store { will-change: auto; }
}
