/* Backyard Island. One stylesheet, no build step.
   The colors are the game's own: the sky values are DayNight.cs's keyframes, the sea is the sea in the hero picture
   and the rest are UIKit.cs's. Lilita One is the font the game itself uses. Body text uses the phone's own rounded or
   system font, so no font is fetched from anywhere else. */

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

:root {
  --ink: #0F1424;
  --panel: rgb(15 20 36 / .86);
  --panel-solid: #171C30;
  --gold: #FFD140;
  --green: #1F8F3C;
  --orange: #C96A08;
  --blue: #2E79DE;
  --purple: #9E5CDB;
  --pink: #CF4A70;
  --red: #D63D31;

  --sky-8am: #9EC7F2;
  --sky-day: #8CC0F2;
  --sky-dusk: #332E6B;
  --sky-night: #090D26;
  --sea: #1C6A98;

  --display: "Lilita One", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --body: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --gutter: 16px;
  --wide: 1160px;
}

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

html {
  color-scheme: only light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--sky-day);
  color: var(--ink);
  font: 400 1.125rem/1.5 var(--body);
  overflow-x: clip;
}

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

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.04;
  margin: 0;
  text-wrap: balance;
}

p { margin: 0 0 .8em; }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-underline-offset: .16em; text-decoration-thickness: .08em; }
a[href^="tel:"] { white-space: nowrap; }

:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  box-shadow: 0 0 0 3px var(--ink);
  border-radius: 8px;
}

/* ---------- Parts lifted from the game's screen ---------- */

/* The game's buttons: a solid rounded block, white letters with a soft shadow, a small press when tapped. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 9px 16px;
  border-radius: 14px;
  background: var(--green);
  color: #fff;
  font: 400 1.125rem/1.1 var(--display);
  letter-spacing: .02em;
  text-decoration: none;
  text-shadow: 0 1px 1px rgb(0 0 0 / .35);
  box-shadow: 0 4px 0 rgb(15 20 36 / .28);
  transition: transform .09s ease-out, box-shadow .09s ease-out;
}
.btn:active { transform: translateY(3px) scale(.98); box-shadow: 0 1px 0 rgb(15 20 36 / .28); }
.btn.is-big { min-height: 60px; padding: 12px 30px; font-size: 1.5rem; }
.btn.is-off, .btn.is-off:active {
  background: #5B6276;
  box-shadow: none;
  transform: none;
}

/* A picture from the game, in a phone's dark edge. */
.shot {
  margin: 0;
  border: 5px solid var(--ink);
  border-radius: 20px;
  background: var(--ink);
  overflow: hidden;
  box-shadow: 0 7px 0 rgb(15 20 36 / .22);
}
.shot img { width: 100%; }

/* The name, as the game draws it: gold in a thick dark outline, so it reads over any picture. */
.title {
  color: var(--gold);
  font-size: clamp(3.2rem, 16.5vw, 9.6rem);
  line-height: .98;
  letter-spacing: .005em;
  text-align: center;
  text-transform: uppercase;
  text-shadow:
    .045em 0 0 var(--ink), -.045em 0 0 var(--ink), 0 .045em 0 var(--ink), 0 -.045em 0 var(--ink),
    .032em .032em 0 var(--ink), -.032em .032em 0 var(--ink), .032em -.032em 0 var(--ink), -.032em -.032em 0 var(--ink),
    0 .105em 0 var(--ink), .04em .1em 0 var(--ink), -.04em .1em 0 var(--ink);
}
.title span { display: block; }

/* ---------- Top bar ---------- */

.bar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: max(10px, env(safe-area-inset-top)) var(--gutter) 6px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin-inline: auto;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font: 400 1.0625rem/1 var(--display);
  text-decoration: none;
  min-height: 44px;
}
.brand img { width: 32px; height: 32px; border-radius: 8px; }
.bar nav { display: flex; gap: 4px; }
.bar nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-weight: 600;
  font-size: 1rem;
}

/* ---------- Home: one big picture, which becomes the video ---------- */

.home { background: var(--sea); color: #fff; }

/* Upright screens: the title on the sky, the whole 16:9 frame, then the line on the sea.
   The game only runs sideways, so a box taller than 16:9 would cut off most of a recording. */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.hero .title {
  position: relative;
  order: 1;
  align-self: stretch;
  padding: max(18px, env(safe-area-inset-top)) var(--gutter) 14px;
  background: var(--sky-day);
}

/* The poster picture and the video share this box. */
.hero-media {
  position: relative;
  order: 2;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--sky-day);
  /* A low-poly edge, like the island's own art. */
  clip-path: polygon(0 0, 100% 0, 100% 96%, 82% 99%, 64% 96.5%, 46% 100%, 27% 97%, 12% 100%, 0 97%);
}
.hero-media > img, .hero-media > video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: 54% 50%;
}

.hero-line {
  position: relative;
  order: 3;
  margin: 12px var(--gutter) 0;
  color: #fff;
  font: 400 clamp(1.125rem, 1.9vw, 1.5rem)/1.2 var(--display);
  letter-spacing: .01em;
  text-align: center;
  text-wrap: balance;
}

/* The App Store link and the Android download, just under the hero. */
.get-btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.get {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0 var(--gutter);
  text-align: center;
}
.get small { font-size: .9375rem; font-weight: 500; text-wrap: balance; }

/* One word each, on the game's own button colors. */
.places {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 12px;
  max-width: calc(var(--wide) + 2 * var(--gutter));
  margin: 14px auto 0;
  padding: 0 var(--gutter);
  list-style: none;
}
.places li:last-child { grid-column: 1 / -1; }

/* The word sits under the picture, never over it: the pictures have words of their own (GOAL!, GO!). */
.place {
  margin: 0;
  overflow: hidden;
  border: 4px solid var(--ink);
  border-radius: 18px;
  background: var(--tile);
  box-shadow: 0 6px 0 rgb(15 20 36 / .3);
}
.place img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}
.places li:last-child img { aspect-ratio: 16 / 9; }
.place figcaption {
  padding: .3em .5em .34em;
  color: #fff;
  font: 400 clamp(1.25rem, 2.1vw, 1.625rem)/1.1 var(--display);
  letter-spacing: .02em;
  text-align: center;
  text-shadow: 0 1px 1px rgb(0 0 0 / .35);
}
.p-green { --tile: var(--green); }
.p-blue { --tile: var(--blue); }
.p-red { --tile: var(--red); }
.p-orange { --tile: var(--orange); }
.p-purple { --tile: var(--purple); }
.p-pink { --tile: var(--pink); }
.p-gold { --tile: var(--gold); }
.p-gold figcaption { color: var(--ink); text-shadow: none; }

/* Who made it, above the footer. */
.about {
  max-width: 40rem;
  margin: 36px auto 0;
  padding: 0 var(--gutter);
  text-align: center;
}
.about h2 { margin: 0; font: 400 1.75rem/1.1 var(--display); letter-spacing: .01em; }
.about p { margin: 10px 0 0; font-weight: 500; line-height: 1.45; text-wrap: pretty; }

/* Tiny, at the bottom of the home page and /try/. */
.foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 18px;
  padding: 18px var(--gutter) max(10px, env(safe-area-inset-bottom));
  font-size: .9375rem;
}
.foot a { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------- Grown-ups' pages: the game's dark grown-ups panel, at night ---------- */

.at-night {
  background: linear-gradient(var(--sky-dusk), var(--sky-night) 420px) no-repeat;
  background-color: var(--sky-night);
  color: #F2F4FA;
}
.at-night .bar { color: #fff; }

.grown { padding: 8px 10px 40px; }
.grown-panel {
  position: relative;
  max-width: 46rem;
  margin: 0 auto;
  padding: 22px 18px 26px;
  border-radius: 22px;
  background: var(--panel-solid);
}
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgb(255 255 255 / .12);
  color: #fff;
}
.close svg { width: 20px; height: 20px; }
.grown-panel h1 {
  padding-right: 48px;
  color: var(--gold);
  font-size: clamp(2.4rem, 10vw, 3.5rem);
}
.when { margin: 8px 0 18px; color: #C9CEDD; font-size: 1rem; }
.grown-panel h2 {
  margin: 30px 0 8px;
  color: var(--gold);
  font-size: 1.625rem;
}
.grown-panel a { color: #A9D2FA; }
.grown-panel ul, .grown-panel ol { margin: 0 0 .8em; padding-left: 1.3em; }
.grown-panel li { margin-bottom: .34em; }
.grown-panel li::marker { color: #C9CEDD; }

.short-version {
  margin: 0 0 8px;
  padding: 16px;
  border-radius: 16px;
  background: rgb(255 255 255 / .07);
}
h1 + .short-version { margin-top: 18px; }

.marks { list-style: none; padding-left: 0 !important; }
.marks li { position: relative; padding-left: 32px; }
.marks svg { position: absolute; left: 2px; top: .22em; width: 20px; height: 20px; }
.marks.yes svg { color: #6BE08A; }
.marks.no svg { color: #FF8A7E; }

/* ---------- /try/ : daytime, two big buttons ---------- */

.try { background: linear-gradient(var(--sky-8am), var(--sky-day) 500px) no-repeat; background-color: var(--sky-day); }
.try-main {
  max-width: 52rem;
  margin: 0 auto;
  padding: max(20px, env(safe-area-inset-top)) var(--gutter) 0;
  text-align: center;
}
.try .title { font-size: clamp(3rem, 15vw, 5.5rem); }

.phones {
  display: grid;
  gap: 24px;
  margin-top: 30px;
}
.phone p { margin: 14px 0 0; font-weight: 500; text-wrap: balance; }

.btn.is-huge {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  min-height: 136px;
  padding: 18px;
  border-radius: 20px;
  font-size: 3rem;
  line-height: 1;
}
.btn.is-huge small { font-size: 1.25rem; letter-spacing: .05em; }

.try-ask {
  max-width: 30rem;
  margin: 34px auto 0;
  font: 400 1.5rem/1.2 var(--display);
  text-wrap: balance;
}

/* ---------- 404 ---------- */

.lost {
  max-width: 40rem;
  margin: 0 auto;
  padding: 18px var(--gutter) 56px;
}
.lost h1 { font-size: clamp(2.8rem, 13vw, 4.5rem); margin-bottom: 10px; }
.lost .shot { margin: 20px 0 24px; }

/* ---------- Wider screens ---------- */

/* Sideways screens: the picture fills the hero at its own 16:9, unless the window is too short for that.
   The title sits over the sea and the line over the sand, so neither one covers the island. */
@media (min-aspect-ratio: 1 / 1) {
  .hero { height: min(100vh, 56.25vw); height: min(100svh, 56.25vw); min-height: 320px; padding-bottom: min(36px, 5vh); }
  .hero .title { background: none; font-size: clamp(3rem, 9vw, 10rem); }
  .hero .title span { display: inline; }
  .hero-media { position: absolute; inset: 0; width: auto; aspect-ratio: auto; }
  .hero-line {
    max-width: calc(100% - 2 * var(--gutter));
    margin: auto 0 0;
    padding: .42em .8em .46em;
    border-radius: 13px;
    background: var(--panel);
  }
}

@media (min-width: 640px) {
  .phones { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 760px) {
  :root { --gutter: 28px; }
  .title { font-size: clamp(4rem, 9vw, 10rem); }
  .title span { display: inline; }
  .try .title { font-size: clamp(3rem, 8vw, 5.5rem); }
  .hero .title { padding-top: max(26px, env(safe-area-inset-top)); }
  .places { grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px 16px; margin-top: 18px; }
  .places li { grid-column: span 3; }
  .places li:nth-child(n + 5) { grid-column: span 4; }
  .places li:last-child img { aspect-ratio: 4 / 3; }
  .grown { padding-inline: 20px; }
  .grown-panel { padding: 30px 34px 36px; }
}

/* ---------- Calm and print ---------- */

@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .hero-media > video { display: none; }
}

@media print {
  body, .at-night, .try { background: #fff; color: #000; }
  .bar nav, .close { display: none; }
  .grown-panel { background: #fff; color: #000; padding: 0; }
  .grown-panel h1, .grown-panel h2, .grown-panel a { color: #000; }
  .when, .grown-panel li::marker { color: #000; }
  .short-version { background: none; padding: 0; }
}
