/* MOBILE FIRST. The reference screens are 360x740, 390x844 and 430x932;
   larger screens get the same column, centred, with a wider street band.
   Tokens are sampled from the game art. */
:root {
  --blue: #2bbcef;
  --blue-light: #60cdf3;
  --blue-deep: #17779f;
  --blue-line: #3f5f6b;
  --brown: #6b5943;
  --brown-dark: #4a3c2b;
  --cream: #fdf6e0;
  --panel-grey: #e6e6e6;
  --panel-line: #c1c7c7;
  --green: #a8e621;
  --green-dark: #2e7812;
  --grey: #d2d4d5;
  --grey-dark: #5c5f61;
  --yellow: #ffd600;               /* the game's arrow buttons (hire: Arrow / ArrowRight) */
  --yellow-dark: #7c5613;
  --red: #ee3030;
  --red-dark: #8f2f37;
  --error: #c81e1e;
  --sky-top: #67b8f4;
  --sky-low: #bddbdc;
  --road: #848480;
  --lane: #f1f1ea;
  --grass: #a8d468;
  --grass-ink: #2f4a12;
  --font-body: "BC Body", "LXGW WenKai TC", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
  --font-title: "BC Title", "BC Body", "Trebuchet MS", system-ui, sans-serif;
  --gutter: 16px;
  --tap: 52px;                     /* inputs and buttons */
  --column: 480px;                 /* the phone layout's width on big screens */
  --band-h: clamp(112px, 28svh, 250px);   /* sky .. upper pavement */
  --road-h: 30px;                  /* asphalt strip under the band */
  --pave-h: 16px;                  /* lower pavement */
  --overlap: 10px;                 /* how far the panel rides up the road */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}
body[data-page="home"], body[data-page="invite"] { --band-h: clamp(140px, 33svh, 300px); }
@media (min-width: 700px) and (min-height: 600px) {
  :root { --band-h: clamp(230px, 34svh, 340px); --road-h: 104px; --pave-h: 28px; --overlap: 84px; }
  body[data-page="home"], body[data-page="invite"] { --band-h: clamp(250px, 38svh, 380px); }
}

/* The title font has no Turkish, CJK or Thai glyphs: those languages draw
   titles with the body font (tools/build_fonts.py checks the others). */
html[lang="tr"], html[lang="zh-TW"], html[lang="th"] { --font-title: var(--font-body); }
html[lang="th"] { --font-body: "Noto Sans Thai", "Leelawadee UI", "Thonburi", "Sarabun", system-ui, sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding: 16px 0 110px; }
body {
  margin: 0;
  min-height: 100vh;               /* fallback */
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  line-height: 1.45;
  color: var(--brown-dark);
  background: var(--grass);        /* the park runs under the page */
  position: relative;
  overflow-x: hidden;
}
h1, h2, h3, p { margin: 0; }
a { color: var(--blue-deep); text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
[hidden] { display: none !important; }
/* English text written into the file for crawlers (tools/prefill_i18n.py)
   stays out of sight until i18n.js has put the reader's language in. */
html:not(.i18n) [data-i18n] { visibility: hidden; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
:focus-visible { outline: 3px solid #1a1a1a; outline-offset: 2px; border-radius: 4px; }
.skip-link {
  position: absolute; left: 8px; top: -80px; z-index: 50;
  background: #fff; color: var(--brown-dark); padding: 12px 14px;
  border: 3px solid var(--brown); border-radius: 8px;
}
.skip-link:focus { top: calc(8px + var(--safe-t)); }

main {
  flex: 1;
  width: 100%; max-width: var(--column);
  margin: calc(var(--overlap) * -1) auto 0;   /* the panel sits over the road */
  padding: 0 8px 20px;
  padding-left: max(8px, env(safe-area-inset-left));
  padding-right: max(8px, env(safe-area-inset-right));
  position: relative; z-index: 2;
}
.site-footer {
  position: relative; z-index: 2;
  display: flex; flex-wrap: wrap; gap: 0 6px; justify-content: center; align-items: center;
  padding: 0 12px calc(10px + var(--safe-b));
  font-size: 13px; color: var(--grass-ink);
}
.site-footer a { color: var(--grass-ink); display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; }
