@font-face {
  font-family: "Lilita One";
  src: url("fonts/LilitaOne-Regular.ttf") format("truetype");
  font-display: swap;
}
@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-Variable.ttf") format("truetype");
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --pink: #ff5fa2;
  --pink-deep: #b8256a;
  --ink: #5b1f3f;
  --gold: #ffc928;
  --cotton: #fff3f8;
  --sky-top: #fcc6e2;
  --sky-low: #d4ecfc;
  --measure: 34rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font: 400 1.0625rem/1.6 "Nunito", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cotton);
}

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

a { color: var(--pink-deep); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.skip {
  position: absolute; left: 1rem; top: -4rem;
  background: var(--ink); color: #fff; padding: .5rem 1rem; border-radius: .5rem;
}
.skip:focus { top: 1rem; }

/* The splash title's look: white fill, thick berry outline. */
.outlined {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-weight: 400;
  color: #fff;
  -webkit-text-stroke: .14em var(--pink-deep);
  paint-order: stroke fill;
  letter-spacing: .01em;
  line-height: 1.05;
  margin: 0;
}

.section-title {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-weight: 400;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  line-height: 1.15;
  color: var(--pink-deep);
  margin: 0 0 2rem;
}

/* Hero: words on one side, the playable ball on the other. */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: 2rem;
  padding: 3rem clamp(1.25rem, 5vw, 5rem);
  background: linear-gradient(var(--sky-top), var(--sky-low));
}
.hero-text { max-width: var(--measure); }
.hero-icon { border-radius: 18px; margin-bottom: 1.25rem; box-shadow: 0 4px 0 var(--pink-deep); }
.hero h1 { font-size: clamp(3.5rem, 10vw, 7rem); margin-bottom: 1.25rem; }
.lede {
  font-family: "Lilita One", "Nunito", sans-serif;
  font-size: clamp(1.4rem, 2.6vw, 1.9rem);
  line-height: 1.2;
  margin: 0 0 .75rem;
}

.ball-toy { margin: 0; position: relative; height: min(78svh, 640px); }
.ball-toy canvas { width: 100%; height: 100%; display: block; cursor: pointer; touch-action: manipulation; }
.ball-toy figcaption {
  position: absolute; left: 50%; bottom: 1rem; transform: translateX(-50%);
  font-weight: 800; font-size: .95rem;
  background: #fffffff0; padding: .3rem .9rem; border-radius: 99px;
  transition: opacity .4s;
}
.ball-toy figcaption.gone { opacity: 0; }

.play {
  display: inline-block;
  margin-top: 1.5rem;
  font: 400 1.25rem/1 "Lilita One", "Nunito", sans-serif;
  color: #fff;
  background: var(--pink);
  padding: 1.05rem 1.6rem;
  border-radius: 1.1rem;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--pink-deep);
  transition: transform .08s, box-shadow .08s;
}
.play:hover { background: #ff73ae; }
.play:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--pink-deep); }

/* Worlds: one band each, in that world's sky colours. */
#worlds { padding: 5rem 0 0; }
#worlds > .section-title, .laps { padding: 0 clamp(1.25rem, 5vw, 5rem); }

.world {
  display: grid;
  grid-template-columns: minmax(0, 18rem) minmax(0, var(--measure));
  justify-content: center;
  align-items: center;
  gap: clamp(2rem, 6vw, 6rem);
  padding: 4rem clamp(1.25rem, 5vw, 5rem);
}
.world:nth-of-type(even) { grid-template-columns: minmax(0, var(--measure)) minmax(0, 18rem); }
.world:nth-of-type(even) img { order: 2; }
.world img { border-radius: 1.75rem; border: 6px solid var(--frame); box-shadow: 0 10px 0 var(--frame); }
.world h3 { font-size: clamp(2rem, 5vw, 3.25rem); margin-bottom: .5rem; -webkit-text-stroke-color: var(--frame); }
.world .levels { font-weight: 800; margin: 0 0 .75rem; color: var(--accent); }
.world p { margin: 0; }

.world.candy   { --frame: #b8256a; --accent: #b8256a; background: linear-gradient(#fcd3e8, #e4f2fd); }
.world.volcano { --frame: #1d0b09; --accent: #ffb37a; background: linear-gradient(#4a1510, #2a0c0a); color: #ffe7d6; }
.world.toy     { --frame: #24489a; --accent: #24489a; background: linear-gradient(#ffe9b8, #f3c98a); }
.world.space   { --frame: #070a1c; --accent: #7ff3ff; background: linear-gradient(#141b44, #0a0f2a); color: #e6f0ff; }

.laps { max-width: calc(var(--measure) + 10rem); margin: 3rem auto 0; font-weight: 700; padding-bottom: 5rem; }

/* Cannons: a plain definition list. */
.cannons { padding: 5rem clamp(1.25rem, 5vw, 5rem); max-width: 60rem; margin: 0 auto; }
.cannons dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.5rem 3rem; margin: 0 0 2rem; }
.cannons dt { font: 400 1.4rem/1.2 "Lilita One", "Nunito", sans-serif; color: var(--pink-deep); }
.cannons dd { margin: .25rem 0 0; }

.get {
  text-align: center;
  padding: 5rem 1.25rem 6rem;
  background: linear-gradient(var(--sky-low), var(--sky-top));
}
.get h2 { font-size: clamp(2.25rem, 6vw, 4rem); margin-bottom: .75rem; }
.get p { margin: 0; font-weight: 700; }

footer {
  padding: 2rem clamp(1.25rem, 5vw, 5rem);
  background: var(--ink);
  color: #f7dbe9;
  font-size: .95rem;
}
footer nav { display: flex; gap: 1.5rem; margin-bottom: .5rem; }
footer a { color: #fff; font-weight: 700; }
footer p { margin: 0; }

/* Privacy page */
.doc { max-width: var(--measure); margin: 0 auto; padding: 3rem 1.25rem 5rem; }
.doc h1 { font-size: clamp(2.25rem, 7vw, 3.25rem); margin: 1.5rem 0 .5rem; }
.doc h2 { font: 400 1.4rem/1.2 "Lilita One", "Nunito", sans-serif; color: var(--pink-deep); margin: 2rem 0 .5rem; }
.doc .back { font-weight: 800; }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; min-height: auto; padding-top: 2rem; }
  .ball-toy { height: 60svh; order: 2; }
  .world, .world:nth-of-type(even) { grid-template-columns: 1fr; justify-items: center; }
  .world:nth-of-type(even) img { order: 0; }
  .world img { width: min(16rem, 70vw); }
}
