/* GAME's website: shared type, colour and pieces. The palette is the game's: its sky,
   grass, wood and the logo's blue. British English throughout. */

@font-face { font-family: 'Lilita One'; src: url('../fonts/LilitaOne-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Port Lligat Slab'; src: url('../fonts/PortLligatSlab-Regular.ttf') format('truetype'); font-display: swap; }
@font-face { font-family: 'Open Sans'; src: url('../fonts/OpenSans-Semibold.ttf') format('truetype'); font-weight: 600; font-display: swap; }

:root {
  --sky: #bfe0f6;
  --sky-deep: #8fc3e8;
  --grass: #72ae3f;
  --grass-deep: #4f8a2a;
  --wood: #7b4f2c;
  --wood-light: #a8733f;
  --wood-dark: #4a2e19;
  --blue: #3f8fd6;
  --blue-deep: #235f9c;
  --ink: #213041;
  --paper: #fbfdff;
  --muted: #5a6b7c;
  --card: #ffffff;
  --line: rgba(33, 48, 65, 0.12);
  --sun: #fff6d6;
  --shadow: 0 18px 40px rgba(18, 44, 72, 0.18);
  --display: 'Lilita One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --serif: 'Port Lligat Slab', Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --numbers: 'Open Sans', system-ui, sans-serif;
  --radius: 22px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #eaf2fa;
    --paper: #0f1a24;
    --muted: #a7b7c6;
    --card: #182635;
    --line: rgba(234, 242, 250, 0.12);
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }
}
:root[data-theme="dark"] {
  --ink: #eaf2fa; --paper: #0f1a24; --muted: #a7b7c6; --card: #182635;
  --line: rgba(234, 242, 250, 0.12); --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 var(--sans);
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; letter-spacing: 0.01em; margin: 0 0 0.4em; }
h1 { font-size: clamp(2.4rem, 7vw, 5rem); }
h2 { font-size: clamp(2rem, 5vw, 3.4rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); }
p { margin: 0 0 1em; }
.lede { font-family: var(--serif); font-size: clamp(1.1rem, 2.1vw, 1.45rem); line-height: 1.5; color: var(--muted); }
.wrap { width: min(1180px, 100% - 2 * var(--gutter)); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--card); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 6px; }

/* The site bar: the logo small, the pages, and Play. */
.site-bar {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  display: flex; align-items: center; gap: 12px;
  padding: 10px var(--gutter);
  transition: background 0.3s, box-shadow 0.3s, backdrop-filter 0.3s;
}
.site-bar.is-solid { background: color-mix(in srgb, var(--paper) 82%, transparent); backdrop-filter: blur(14px); box-shadow: 0 1px 0 var(--line); }
.site-bar .brand img { height: 38px; width: auto; }
.site-bar nav { margin-left: auto; display: flex; align-items: center; gap: clamp(8px, 2vw, 22px); }
.site-bar nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.95rem; }
.site-bar nav a:hover { color: var(--blue); }
.site-bar nav .hide-small { display: inline; }
@media (max-width: 640px) { .site-bar nav .hide-small { display: none; } }

/* Wooden buttons, like the plank's. */
.btn {
  --h: 54px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--h); padding: 0 26px;
  font: 1.15rem/1 var(--display); letter-spacing: 0.02em; color: #fff; text-decoration: none;
  background: linear-gradient(180deg, #5aa7ea, var(--blue) 55%, var(--blue-deep));
  border: 0; border-radius: 999px; cursor: pointer;
  box-shadow: 0 5px 0 #1b4a78, 0 12px 24px rgba(20, 60, 100, 0.28);
  transition: transform 0.12s, box-shadow 0.12s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 #1b4a78, 0 6px 12px rgba(20, 60, 100, 0.25); }
.btn.wood { background: linear-gradient(180deg, var(--wood-light), var(--wood) 60%, var(--wood-dark)); box-shadow: 0 5px 0 #321d0e, 0 12px 24px rgba(60, 30, 10, 0.3); }
.btn.ghost { background: color-mix(in srgb, var(--card) 70%, transparent); color: var(--ink); box-shadow: inset 0 0 0 2px var(--line); }
.btn.small { --h: 42px; padding: 0 18px; font-size: 1rem; box-shadow: 0 4px 0 #1b4a78; }

/* Store links. Plain labelled buttons: Apple's and Google's badge art has its own
   licence terms, and goes in once the listings are live. */
.stores { display: flex; flex-wrap: wrap; gap: 12px; }
.store {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 8px 18px;
  border-radius: 14px; background: #111; color: #fff; text-decoration: none; line-height: 1.1;
}
.store small { display: block; font-size: 0.72rem; opacity: 0.8; }
.store strong { font-size: 1.05rem; font-weight: 600; }
.store svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.store[aria-disabled="true"] { opacity: 0.88; cursor: default; }

/* Pages that are mostly text: privacy, support, terms, press. */
.page-hero {
  position: relative; padding: 130px 0 70px; overflow: hidden;
  background: url('../img/sky-1200.webp') center 30% / cover no-repeat, var(--sky);
  color: #17324d;
}
.page-hero::after { content: ''; position: absolute; inset: auto 0 -1px 0; height: 60px; background: linear-gradient(to bottom, transparent, var(--paper)); }
.page-hero h1 { text-shadow: 0 3px 0 rgba(255, 255, 255, 0.6); }
.page-hero .lede { color: #2d4a66; }
.prose { max-width: 44rem; padding-block: 30px 80px; }
.prose h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 1.6em; }
.prose li { margin-bottom: 0.4em; }
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: clamp(20px, 3vw, 34px); }
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; font: 1.4rem/1 var(--display); color: var(--blue); }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

/* The footer: grass, with the cast along the top. */
.site-foot {
  position: relative; margin-top: 110px; padding: 50px 0 40px; color: #eef8e6;
  background: linear-gradient(180deg, var(--grass), var(--grass-deep));
}
/* A hill along the top, for the characters to stand on. */
.site-foot::before {
  content: ''; position: absolute; left: 0; right: 0; top: -59px; height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 60' preserveAspectRatio='none'%3E%3Cpath d='M0 60V34c160-30 330-38 520-18s380 22 560 0 260-26 360-10v54z' fill='%2372ae3f'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
}
.site-foot .cols { display: flex; flex-wrap: wrap; gap: 30px 60px; align-items: flex-start; justify-content: space-between; }
.site-foot a { color: #fff; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 10px 24px; }
.site-foot .fine { margin-top: 30px; font-size: 0.85rem; opacity: 0.85; }
.site-foot .cast { position: absolute; top: -76px; left: 0; right: 0; height: 70px; pointer-events: none; overflow: hidden; }
.site-foot .cast img { position: absolute; bottom: 4px; height: 56px; width: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

/* The press kit's screenshots. */
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; margin: 20px 0 10px; }
.shots figure { margin: 0; }
.shots img { width: 100%; border-radius: 14px; box-shadow: var(--shadow); background: #111; }
.shots figcaption { font-size: 0.88rem; color: var(--muted); margin-top: 8px; }
.prose .shots { max-width: none; }
.prose:has(.shots) { max-width: 60rem; }
.shots img[src*="logo"] { background: var(--sky); padding: 16px; }

/* The Music and Sound effects switches: a white glyph on a dark rounded tile, struck through
   when off, as the app draws them (GlyphToggle). */
.audio-switches { display: flex; gap: 6px; }
.audio-switches[hidden] { display: none; }
.audio-switch, .tile-btn {
  position: relative; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 11px; cursor: pointer;
  color: #fff; background: linear-gradient(#444, #262626);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35); transition: transform 0.15s;
}
.audio-switch:hover, .tile-btn:hover { transform: translateY(-2px); }
.audio-switch:active, .tile-btn:active { transform: translateY(1px); }
.audio-switch:focus-visible, .tile-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.audio-switch svg, .tile-btn svg { width: 58%; height: 58%; fill: currentColor; vertical-align: middle; }
.audio-switch[aria-pressed="false"] svg { opacity: 0.45; }
.audio-switch[aria-pressed="false"]::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 3px; height: 72%; margin: -36% 0 0 -1.5px;
  border-radius: 2px; background: #fff; transform: rotate(-45deg);
}
@media (prefers-reduced-motion: reduce) { .audio-switch, .audio-switch:hover, .audio-switch:active, .tile-btn, .tile-btn:hover, .tile-btn:active { transition: none; transform: none; } }
