@font-face {
  font-family: 'Baloo 2';
  src: url('assets/baloo-2.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}

:root {
  --ink: #2b1a0e;
  --paper: #fff8e1;
  --gold: #ffd23f;
  --gold-dark: #e0a800;
  --sky: #8fd8ff;
  --sky-low: #bfeaff;
  --grass: #6cc24a;
  --grass-dark: #3b8d3b;
  --soil: #8a5a30;
  --soil-dark: #6a4122;
  --rock: #5b5763;
  --rock-dark: #413e49;
  --deep: #241c2b;
  --deep-dark: #120d17;
  --blue: #3d8bfd;
  --gutter: 16px;
  --radius: 22px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--deep-dark);
  color: var(--ink);
  font-family: 'Baloo 2', system-ui, sans-serif;
  font-size: 1.125rem;
  line-height: 1.45;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, video { display: block; width: 100%; height: auto; }
a { color: inherit; }
:focus-visible { outline: 4px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

.sprite { position: absolute; }
.wrap { width: min(1120px, 100%); margin: 0 auto; padding: 0 var(--gutter); }

/* The game's sticker lettering */
.lettered {
  font-weight: 800;
  line-height: 1;
  color: #fff;
  -webkit-text-stroke: .16em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--ink);
}
.lettered span { color: var(--gold); }

.btn {
  display: inline-block;
  padding: .55em 1.25em .45em;
  background: linear-gradient(#ffe066, var(--gold));
  color: var(--ink);
  border: 4px solid var(--ink);
  border-radius: 16px;
  box-shadow: 0 6px 0 var(--ink);
  font-weight: 800;
  font-size: 1.2rem;
  line-height: 1.2;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translateY(2px); box-shadow: 0 4px 0 var(--ink); }
.btn:active { transform: translateY(6px); box-shadow: 0 0 0 var(--ink); }
.btn-alt { background: var(--paper); }
.btn-sm { padding: .35em .9em .25em; font-size: 1.05rem; box-shadow: 0 4px 0 var(--ink); }

/* Header */
.top {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px var(--gutter);
}
.logo {
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  -webkit-text-stroke: .17em var(--ink);
  paint-order: stroke fill;
  text-shadow: 0 .07em 0 var(--ink);
}
.logo .we { color: var(--gold); }
.logo small { font-size: .62em; letter-spacing: .03em; }
.top nav { display: flex; align-items: center; gap: 18px; }
.navlink { font-weight: 700; text-decoration: none; }
.navlink:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 3px; }

/* Sky */
.hero {
  position: relative;
  overflow: hidden;
  padding: 92px 0 0;
  background: linear-gradient(var(--sky), var(--sky-low) 80%);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 28px;
  padding-bottom: 28px;
}
.kicker { font-weight: 700; font-size: 1.15rem; }
.hero h1 { margin: 10px 0 18px; font-size: clamp(3.6rem, 13.5vw, 6.6rem); }
.lede { max-width: 33em; font-weight: 500; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 22px; padding-bottom: 6px; }

.cloud {
  position: absolute;
  height: 44px;
  background: #fff;
  border-radius: 44px;
  opacity: .75;
  animation: drift 46s linear infinite alternate;
}
.cloud::before {
  content: '';
  position: absolute;
  left: 22%;
  bottom: 16px;
  width: 46%;
  aspect-ratio: 1;
  background: inherit;
  border-radius: 50%;
}
.c1 { width: 170px; top: 96px; left: 6%; }
.c2 { width: 120px; top: 56%; left: 44%; animation-duration: 62s; animation-direction: alternate-reverse; }
.c3 { width: 210px; top: 34px; right: 12%; animation-duration: 54s; }
@keyframes drift { to { transform: translateX(90px); } }

/* Hero board: a 12s loop of one round, in pure CSS */
.demo { min-width: 0; }
.board {
  display: block;
  width: 100%;
  height: auto;
  background: var(--grass);
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--ink);
}
.demo figcaption {
  position: relative;
  height: 3.1em;
  margin-top: 18px;
  font-size: 1.05rem;
}
.cap {
  position: absolute;
  inset: 0 auto auto 50%;
  width: max-content;
  max-width: 100%;
  transform: translateX(-50%);
  padding: .3em .9em .2em;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 12px;
  text-align: center;
  font-weight: 600;
}
.cap b { font-weight: 800; }

.m-main { fill: var(--m); }
.m-dark { fill: var(--md); }
.m-skin { fill: var(--ms); }
.m-red, .s-red { --m: #ef4b4b; --md: #a52a2a; --ms: #f1b98a; }
.m-blue, .s-blue { --m: #3d8bfd; --md: #1f4fa8; --ms: #d99a6c; }

.plan-red .d { fill: #ef4b4b; }
.plan-blue .d { fill: #3d8bfd; }
.d { stroke: var(--ink); stroke-width: 3; }
.pop { transform-box: fill-box; transform-origin: center; }
.bonk-t, .stamp-t { font-family: 'Baloo 2', sans-serif; font-weight: 800; text-anchor: middle; }
.bonk-t { font-size: 34px; fill: #fff; stroke: var(--ink); stroke-width: 7px; paint-order: stroke; }
.stamp-t { font-size: 44px; fill: var(--ink); }
.bonk, .stamp { transform-box: fill-box; transform-origin: center; }

.timer { transform-box: fill-box; transform-origin: left; }
.pop, .bonk, .stamp, .cap2, .cap3 { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .d, .pop, .bonk, .stamp, .walker, .timer, .cap { animation: 12s linear infinite; }
  .d1 { animation-name: d1; }
  .d2 { animation-name: d2; }
  .d3 { animation-name: d3; }
  .d4 { animation-name: d4; }
  .timer { animation-name: timer; }
  .stamp { animation-name: stamp; animation-timing-function: ease-out; }
  .pop-bridge { animation-name: pop-bridge; }
  .pop-rock { animation-name: pop-rock; }
  .walk-red { animation-name: walk-red; }
  .walk-blue { animation-name: walk-blue; }
  .bonk { animation-name: bonk; }
  .cap1 { animation-name: cap1; }
  .cap2 { animation-name: cap2; }
  .cap3 { animation-name: cap3; }
}
@keyframes d1 { 0%, 7% { opacity: 0; } 9%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes d2 { 0%, 13% { opacity: 0; } 15%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes d3 { 0%, 19% { opacity: 0; } 21%, 40% { opacity: 1; } 44%, 100% { opacity: 0; } }
@keyframes d4 { 0%, 25% { opacity: 0; } 27%, 40% { opacity: .6; } 44%, 100% { opacity: 0; } }
@keyframes timer { 0% { transform: scaleX(1); opacity: 1; } 36% { transform: scaleX(0); opacity: 1; } 37%, 97% { transform: scaleX(0); opacity: 0; } 100% { transform: scaleX(1); opacity: 1; } }
@keyframes stamp {
  0%, 35% { opacity: 0; transform: scale(1.7) rotate(-4deg); }
  38%, 44% { opacity: 1; transform: scale(1) rotate(-4deg); }
  46%, 100% { opacity: 0; transform: scale(1) rotate(-4deg); }
}
@keyframes pop-bridge {
  0%, 47% { opacity: 0; transform: scale(.3); }
  49% { opacity: 1; transform: scale(1.15); }
  51%, 95% { opacity: 1; transform: scale(1); }
  97%, 100% { opacity: 0; }
}
@keyframes pop-rock {
  0%, 51% { opacity: 0; transform: translateY(-60px); }
  53% { opacity: 1; transform: translateY(0) scale(1.1, .9); }
  55%, 95% { opacity: 1; transform: none; }
  97%, 100% { opacity: 0; }
}
@keyframes walk-red {
  0%, 56% { transform: none; opacity: 1; }
  58% { transform: translate(40px, -14px); }
  60%, 62% { transform: translate(80px, 0); }
  64% { transform: translate(120px, -14px); }
  66%, 68% { transform: translate(160px, 0); }
  70% { transform: translate(208px, -8px); }
  73% { transform: translate(160px, 0); opacity: 1; }
  95% { transform: translate(160px, 0); opacity: 1; }
  97%, 99% { transform: translate(160px, 0); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes walk-blue {
  0%, 56% { transform: none; opacity: 1; }
  58% { transform: translate(-40px, -14px); }
  60%, 62% { transform: translate(-80px, 0); }
  64% { transform: translate(-120px, -14px); }
  66%, 68% { transform: translate(-160px, 0); }
  70% { transform: translate(-200px, -14px); }
  72% { transform: translate(-240px, 0); opacity: 1; }
  95% { transform: translate(-240px, 0); opacity: 1; }
  97%, 99% { transform: translate(-240px, 0); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
@keyframes bonk {
  0%, 69% { opacity: 0; transform: scale(.4) rotate(-14deg); }
  71% { opacity: 1; transform: scale(1.15) rotate(-6deg); }
  73%, 88% { opacity: 1; transform: scale(1) rotate(-6deg); }
  91%, 100% { opacity: 0; transform: scale(1) rotate(-6deg); }
}
@keyframes cap1 { 0%, 44% { opacity: 1; } 46%, 98% { opacity: 0; } 100% { opacity: 1; } }
@keyframes cap2 { 0%, 45% { opacity: 0; } 47%, 69% { opacity: 1; } 71%, 100% { opacity: 0; } }
@keyframes cap3 { 0%, 70% { opacity: 0; } 72%, 96% { opacity: 1; } 98%, 100% { opacity: 0; } }

/* Grass line */
.ground {
  position: relative;
  height: 56px;
  background: linear-gradient(var(--grass), var(--grass-dark));
  border-top: 5px solid var(--ink);
}
.stander { position: absolute; bottom: 14px; width: 84px; height: 84px; }
.s-red { left: max(var(--gutter), calc(50% - 544px)); }
.s-blue { right: max(var(--gutter), calc(50% - 544px)); transform: scaleX(-1); }

/* Strata */
.soil, .rock, .vault { position: relative; padding: 76px 0 84px; }
.soil::before, .rock::before, .vault::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 28px;
  background-repeat: repeat-x;
}
.soil {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cg fill='%23000' opacity='.13'%3E%3Ccircle cx='30' cy='44' r='9'/%3E%3Ccircle cx='172' cy='22' r='5'/%3E%3Ccircle cx='96' cy='130' r='7'/%3E%3Ccircle cx='214' cy='172' r='11'/%3E%3Ccircle cx='44' cy='206' r='4'/%3E%3C/g%3E%3Cg fill='%23fff' opacity='.07'%3E%3Ccircle cx='128' cy='62' r='6'/%3E%3Ccircle cx='178' cy='112' r='4'/%3E%3Ccircle cx='24' cy='130' r='5'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(var(--soil), var(--soil-dark));
}
.soil::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='28'%3E%3Cpath d='M0-4V10H40V22H80V10H120V22H160V-4Z' fill='%233b8d3b' stroke='%232b1a0e' stroke-width='5'/%3E%3C/svg%3E");
}
.rock {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='220'%3E%3Cg fill='none' stroke='%23000' stroke-opacity='.17' stroke-width='5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 50l34 12 18-16 30 10'/%3E%3Cpath d='M180 130l26-12 22 18 44-8'/%3E%3Cpath d='M60 180l24 8 14-12'/%3E%3C/g%3E%3C/svg%3E"),
    linear-gradient(var(--rock), var(--rock-dark));
  color: var(--paper);
}
.rock::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='28'%3E%3Cpath d='M0-4V8H50V20H100V12H150V22H200V-4Z' fill='%236a4122' stroke='%232b1a0e' stroke-width='5'/%3E%3C/svg%3E");
}
.vault {
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='520' height='380'%3E%3Cg fill='%23ffd23f' opacity='.5'%3E%3Ccircle cx='34' cy='60' r='5'/%3E%3Ccircle cx='46' cy='68' r='3'/%3E%3Ccircle cx='430' cy='36' r='4'/%3E%3Ccircle cx='330' cy='316' r='6'/%3E%3Ccircle cx='342' cy='326' r='3'/%3E%3Ccircle cx='90' cy='290' r='3'/%3E%3C/g%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 42%, #5a4120, transparent 62%),
    linear-gradient(var(--deep), var(--deep-dark));
  color: var(--paper);
  text-align: center;
}
.vault::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='28'%3E%3Cpath d='M0-4V12H60V22H120V10H180V-4Z' fill='%23413e49' stroke='%23120d17' stroke-width='5'/%3E%3C/svg%3E");
}

.depth {
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h2.lettered { font-size: clamp(2.5rem, 8vw, 3.8rem); margin-bottom: 26px; }
.intro { max-width: 38em; margin-top: -8px; font-size: 1.2rem; font-weight: 500; }
.soil, .rock { color: var(--paper); }

/* Game card */
.game {
  display: grid;
  gap: 26px;
  padding: 22px;
  background: var(--paper);
  color: var(--ink);
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 10px 0 var(--ink);
}
.tag {
  display: inline-block;
  padding: .12em .7em 0;
  background: var(--grass);
  border: 3px solid var(--ink);
  border-radius: 10px;
  font-size: .95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.game-title { margin: 12px 0 6px; font-size: clamp(2.7rem, 10.5vw, 4.2rem); }
.pitch { margin-bottom: 8px; font-size: 1.3rem; font-weight: 800; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 22px; }
.chips li {
  padding: .22em .75em .1em;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
}
.game-media { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.phone {
  overflow: hidden;
  background: var(--ink);
  border: 6px solid var(--ink);
  border-radius: 22px;
  box-shadow: 0 6px 0 var(--ink);
}
.phone img, .phone video { aspect-ratio: 9 / 16; object-fit: cover; }

/* Next game */
.next {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 34px;
  padding: 18px 20px;
  border: 4px dashed var(--gold);
  border-radius: var(--radius);
}
.next h3 { font-size: 1.5rem; line-height: 1.2; color: var(--gold); }
.next a { color: var(--gold); font-weight: 700; }
.next-pick {
  flex: none;
  width: 50px;
  height: 74px;
  transform-origin: 50% 90%;
}
@media (prefers-reduced-motion: no-preference) {
  .next-pick { animation: dig 1.8s ease-in infinite; }
}
@keyframes dig {
  0%, 55%, 100% { transform: rotate(0); }
  72% { transform: rotate(-24deg); }
  84% { transform: rotate(14deg); }
}

/* How it works */
.steps { display: grid; gap: 16px; margin-top: 30px; }
.steps li {
  position: relative;
  padding: 18px 20px;
  background: var(--paper);
  color: var(--ink);
  border: 5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 0 var(--ink);
}
.num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 8px;
  padding-top: 3px;
  background: var(--gold);
  border: 4px solid var(--ink);
  border-radius: 50%;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}
.steps h3 { font-size: 1.6rem; line-height: 1.2; }

/* Vault */
.vault-chest {
  display: block;
  width: min(260px, 66vw);
  margin: 6px auto 0;
  filter: drop-shadow(0 0 34px rgba(255, 210, 63, .55));
}
.vault .intro { margin: -8px auto 28px; }

.foot { background: var(--deep-dark); color: #b9b0c2; font-size: 1rem; }
.foot .wrap { display: flex; justify-content: space-between; gap: 16px; padding-top: 18px; padding-bottom: 20px; }

/* Narrow phones: the header keeps only the logo and Play */
@media (max-width: 559px) {
  .navlink { display: none; }
  .stander { width: 64px; height: 64px; }
}
@media (hover: none) {
  .btn:hover { transform: none; box-shadow: 0 6px 0 var(--ink); }
  .btn-sm:hover { box-shadow: 0 4px 0 var(--ink); }
}

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, 1fr); }
  .game { padding: 30px; }
}
@media (min-width: 960px) {
  .hero { padding-top: 104px; }
  .hero-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: center; gap: 44px; padding-bottom: 64px; }
  .game { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; gap: 36px; }
}
