/*
 * The landing page's style sheet: the design system of CONCEPT 9.35 (DESIGN.md, "Three acts on a
 * cardboard stage", #2067). A studio frame of kraft cardboard (header and footer) around a dark
 * stage, and one token set per world, which a world's act or page puts on (`.world-<id>`), so a new
 * world adds a token set and the frame stays. Mobile first, from 320 px phones to wide monitors,
 * with a maximum content width. No script and nothing from other sites (the CSP allows styles,
 * images and fonts from the page itself only). Sizes in rem, so 200% text zoom reflows instead of
 * clipping. Every text colour passes WCAG AA on its background (DESIGN.md, "Colour tokens";
 * test/assets.test.ts computes the pairs).
 */

/*
 * The fonts (SIL Open Font License 1.1, the licences in fonts/), as WOFF2: Titan One for display
 * (the whole font, converted unchanged: its Reserved Font Name bars a modified copy), Alegreya Sans
 * for the body and Alegreya Sans SC for the labels (subset to Latin and Latin Extended-A; no
 * Reserved Font Name). Japanese and Korean fall back glyph by glyph to the system's fonts.
 */
@font-face {
  font-family: 'Titan One';
  src: url('fonts/TitanOne-Regular.woff2?v=0c1cea58704d3f90') format('woff2');
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('fonts/AlegreyaSans-Regular.woff2?v=709dbe11c0c14c9d') format('woff2');
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('fonts/AlegreyaSans-Medium.woff2?v=9056a3056409aacc') format('woff2');
  font-weight: 500;
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans';
  src: url('fonts/AlegreyaSans-ExtraBold.woff2?v=bd1645be9466b0bf') format('woff2');
  font-weight: 800;
  font-display: swap;
}

@font-face {
  font-family: 'Alegreya Sans SC';
  src: url('fonts/AlegreyaSansSC-ExtraBold.woff2?v=2b142c7f71df5766') format('woff2');
  font-weight: 800;
  font-display: swap;
}

/* The studio frame's tokens (DESIGN.md, "Colour tokens", "Type"). */
:root {
  --stage: #1a120c;
  --stage-2: #241912;
  --line: #4d3725;
  --kraft: #d9b98c;
  --kraft-dark: #b8935f;
  --paper: #f3e8d4;
  --paper-muted: #cdb796;
  --ink: #2b1d12;
  --ink-muted: #6b5440;
  --cta: #f2b632;
  --cta-ink: #2b1d12;

  --display: 'Titan One', 'Arial Rounded MT Bold', 'Trebuchet MS', system-ui, sans-serif;
  --body:
    'Alegreya Sans', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Apple SD Gothic Neo',
    'Noto Sans CJK JP', 'Noto Sans CJK KR', 'Malgun Gothic', system-ui, -apple-system, 'Segoe UI',
    Roboto, sans-serif;
  --label: 'Alegreya Sans SC', var(--body);

  --step--1: clamp(0.88rem, 0.85rem + 0.15vw, 0.95rem);
  --step-0: clamp(1.05rem, 1rem + 0.25vw, 1.2rem);
  --step-1: clamp(1.3rem, 1.15rem + 0.7vw, 1.7rem);
  --step-2: clamp(1.7rem, 1.4rem + 1.4vw, 2.6rem);
  --step-3: clamp(2.3rem, 1.7rem + 3vw, 4.4rem);

  --space-s: clamp(0.75rem, 0.6rem + 0.6vw, 1.1rem);
  --space-m: clamp(1.25rem, 1rem + 1.2vw, 2rem);
  --space-l: clamp(2.5rem, 1.8rem + 3vw, 5rem);
  --gutter: max(16px, 4vw);
  --content: 73.75rem;
  --column: 46rem;
  --radius: 0.875rem;
  color-scheme: dark;
}

/* Korean pages put the Korean system fonts first, so their Han characters are Korean ones too. */
:root:lang(ko) {
  --body:
    'Alegreya Sans', 'Apple SD Gothic Neo', 'Noto Sans CJK KR', 'Malgun Gothic', system-ui,
    sans-serif;
}

/*
 * The worlds' token sets (DESIGN.md, "Per world"): each from its own art, the ground, the text, a
 * muted text and the accents. A world's act or page sets one of these classes; inside it, `.act`
 * paints the world's ground.
 */
.world-tomb {
  --w-bg: #24170b;
  --w-surface: #3a2512;
  --w-text: #f6e7d0;
  --w-muted: #c9a882;
  --w-accent: #f1aa60;
  --w-accent-2: #f1aa60;
}

.world-orbit {
  --w-bg: #0a1d21;
  --w-surface: #16353d;
  --w-text: #e6f3f3;
  --w-muted: #9db7ba;
  --w-accent: #84c9cc;
  --w-accent-2: #f39a4a;
}

.world-harvest {
  --w-bg: #1e2716;
  --w-surface: #3c3d1c;
  --w-text: #f4ead0;
  --w-muted: #b9b892;
  --w-accent: #d8cf8a;
  --w-accent-2: #c9a3e0;
}

.act {
  background: var(--w-bg);
  color: var(--w-text);
}

.act a {
  color: var(--w-accent);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--stage);
  color: var(--paper);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  overflow-wrap: break-word;
}

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

a {
  color: var(--cta);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--paper);
}

:focus-visible {
  outline: 3px solid var(--cta);
  outline-offset: 3px;
  border-radius: 2px;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
  color: var(--paper);
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem);
  color: var(--kraft);
}

h3 {
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

strong,
b {
  font-weight: 800;
}

/*
 * Japanese and Korean (#816): Titan One has no CJK glyphs, so their headings fall back to the
 * system font (Hiragino, Apple SD Gothic Neo, Noto Sans CJK), set bold to stand up like Titan One.
 * Short lines break between phrases, never inside a word: Japanese by phrase where the browser
 * can (Chrome; the captions by their headline's parts, below), Korean at spaces, as Korean
 * text is set.
 */
:lang(ja) h1,
:lang(ko) h1,
:lang(ja) h2,
:lang(ko) h2,
:lang(ja) .subtitle,
:lang(ko) .subtitle {
  font-weight: 700;
}

:lang(ja) h2,
:lang(ja) .subtitle {
  word-break: auto-phrase;
}

:lang(ko) {
  word-break: keep-all;
}

p,
ul {
  margin: 0 0 1rem;
}

/* Hidden on screen, read by screen readers (the language switch's name). */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The skip link: hidden until focused from the keyboard. */
.skip {
  position: absolute;
  left: 0.5rem;
  top: -10rem;
  padding: 0.5rem 1rem;
  background: var(--cta);
  color: var(--cta-ink);
  font-weight: 800;
  z-index: 20;
}

.skip:focus {
  top: 0.5rem;
}

.wrap {
  width: 100%;
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/*
 * The studio frame (#2067): a kraft cardboard header with a torn bottom edge and a kraft footer
 * with a torn top edge, both drawn in CSS (corrugation lines over a gradient, no image), on every
 * page. Ink on kraft, 8.8:1.
 */
.frame,
footer {
  position: relative;
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.07) 0 3px, transparent 3px 9px),
    linear-gradient(var(--kraft), var(--kraft-dark));
  color: var(--ink);
}

.frame {
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem max(var(--gutter), calc((100% - var(--content)) / 2 + var(--gutter)));
}

.frame::after,
footer::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 0.75rem;
  background: var(--kraft-dark);
}

.frame::after {
  top: 100%;
  clip-path: polygon(
    0 0,
    100% 0,
    100% 40%,
    96% 100%,
    91% 30%,
    85% 90%,
    79% 35%,
    72% 100%,
    66% 30%,
    59% 85%,
    52% 25%,
    46% 100%,
    39% 35%,
    32% 90%,
    26% 25%,
    19% 100%,
    12% 30%,
    6% 85%,
    0 30%
  );
}

.frame a {
  color: var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.1;
  text-decoration: none;
}

/* The app icon, decorative beside the name (the page's favicon, so already loaded). */
.brand::before {
  content: '';
  flex: none;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 22%;
  background: url('icon.png?v=929b1f8d43257bd4') center / cover;
  box-shadow: 0 2px 0 rgb(0 0 0 / 0.25);
}

.frame .brand:hover {
  color: var(--ink);
  text-decoration: underline;
}

/*
 * The language switch: a pill that opens the list of the page's languages under it, no script
 * (`<details>`). The list hangs from the header's right content edge, not from the pill: on a
 * desktop that is the pill's own edge, and on a phone, where the pill wraps under the name to the
 * left, the list still opens on the screen. It never gets wider than the screen and wraps its
 * items, so a phone never scrolls sideways.
 */

.lang > summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.4rem 1rem;
  border: 2px solid var(--ink);
  border-radius: 999px;
  font-family: var(--label);
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
  list-style: none;
  cursor: pointer;
}

.lang > summary::-webkit-details-marker {
  display: none;
}

.lang > summary::after {
  /* Safari < 17.4 and older Chromium drop the alt-text form; the plain one stays for them. */
  content: '\25BE';
  content: '\25BE' / '';
  font-size: 0.9em;
}

.lang[open] > summary::after {
  content: '\25B4' / '';
}

.lang > summary:hover {
  background: rgb(255 255 255 / 0.2);
}

.lang nav {
  position: absolute;
  /* Above the header's torn edge (`.frame::after`), which would otherwise paint over its top. */
  z-index: 1;
  top: calc(100% - 0.25rem);
  right: max(var(--gutter), calc((100% - var(--content)) / 2 + var(--gutter)));
  min-width: 12rem;
  max-width: calc(100vw - 2 * var(--gutter));
  padding: 0.5rem;
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 0.5rem 1.5rem rgb(0 0 0 / 0.45);
}

.frame nav ul {
  display: flex;
  flex-direction: column;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.lang nav a {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
}

.lang nav a:hover {
  background: rgb(217 185 140 / 0.45);
  color: var(--ink);
}

.lang nav a[aria-current='page'] {
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: var(--cta);
  text-decoration-thickness: 3px;
}

.frame :focus-visible {
  outline-color: var(--ink);
}

/* The footer: the page's links, centred, on kraft. */
footer {
  margin-top: auto;
  padding: calc(var(--space-m) + 0.75rem) var(--gutter) var(--space-m);
  text-align: center;
  font-weight: 500;
}

footer::before {
  bottom: 100%;
  background: var(--kraft);
  clip-path: polygon(
    0 70%,
    5% 10%,
    11% 75%,
    18% 0,
    24% 70%,
    31% 15%,
    38% 80%,
    45% 0,
    51% 65%,
    58% 10%,
    65% 75%,
    71% 0,
    78% 70%,
    84% 15%,
    90% 80%,
    95% 5%,
    100% 60%,
    100% 100%,
    0 100%
  );
}

footer a {
  display: inline-block;
  padding: 0.6rem 0.35rem;
  color: var(--ink);
  font-weight: 800;
}

footer a:hover {
  color: var(--ink);
  text-decoration-thickness: 3px;
}

footer a[aria-current='page'] {
  text-decoration-color: var(--cta);
  text-decoration-thickness: 3px;
}

/* The release's version line (CONCEPT 9.36): small and plain under the links. */
footer .version {
  margin: 0.25rem 0 0;
  font-size: var(--step--1);
  font-weight: 400;
}

footer :focus-visible {
  outline-color: var(--ink);
}

body > main,
body > div {
  margin-bottom: var(--space-l);
}

/*
 * The worlds' pages' hero (world.tsx) until their rewrite (#2069), on the frame's tokens.
 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-m);
  padding-top: var(--space-l);
  padding-bottom: var(--space-m);
  align-items: center;
}

.hero h1 {
  margin: 1rem 0 0.25rem;
  font-size: var(--step-3);
  line-height: 1.05;
  text-shadow: 0 3px 0 #000;
}

.subtitle {
  margin: 0 0 1rem;
  color: var(--cta);
  font-family: var(--label);
  font-weight: 800;
  font-size: var(--step-1);
  letter-spacing: 0.04em;
  line-height: 1.25;
}

.tagline {
  font-size: var(--step-1);
  line-height: 1.4;
  max-width: 36rem;
}

.hero-art {
  margin: 0;
}

.hero-art img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}

/* The store placeholders: plainly not buttons until the stores have the game (#824). */
.stores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.stores li {
  display: flex;
  flex: 1 1 8rem;
  max-width: 14rem;
  flex-direction: column;
  padding: 0.6rem 1rem;
  border: 2px dashed var(--paper-muted);
  border-radius: var(--radius);
  line-height: 1.3;
}

.store-name {
  font-weight: 800;
  font-size: 1.125rem;
}

.soon {
  color: var(--paper-muted);
  font-size: var(--step--1);
}

/*
 * A live store (#824): the yellow button of the game's Play button, the store's name as its text;
 * it presses down when pressed.
 */
.stores li:has(.store-link) {
  padding: 0;
  border: 0;
}

.store-link {
  display: flex;
  flex: 1;
  align-items: center;
  min-height: 3rem;
  padding: 0.6rem 1.25rem;
  border-radius: 999px;
  background: var(--cta);
  box-shadow: 0 4px 0 #8a5a10;
  color: var(--cta-ink);
  text-decoration: none;
}

.store-link:hover {
  color: var(--cta-ink);
  text-decoration: underline;
}

.store-link:active {
  box-shadow: 0 1px 0 #8a5a10;
  transform: translateY(3px);
}

/*
 * The QR code of /get (#824): only on a wide screen with a mouse, where the visitor is not on the
 * phone the game goes to. Pure CSS, no script; elsewhere it is not shown (and, lazy, not loaded).
 */
.qr {
  display: none;
}

@media (min-width: 48rem) and (hover: hover) and (pointer: fine) {
  .qr {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.5rem 0 0;
    max-width: 24rem;
  }

  .qr img {
    flex: none;
    width: 10rem;
    height: 10rem;
    border-radius: 0.5rem;
  }

  .qr figcaption {
    color: var(--paper-muted);
    font-size: var(--step--1);
    line-height: 1.4;
  }
}

/* The sections below the hero. */
section {
  padding-top: var(--space-m);
  padding-bottom: var(--space-m);
}

.band {
  background: var(--stage-2);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.lead {
  font-size: var(--step-1);
  line-height: 1.4;
  max-width: 44rem;
}

/*
 * A world's gallery (page.tsx, Gallery, #1529): a row of game screens that scrolls sideways and
 * snaps to each picture. No script: a finger swipes it, the keyboard scrolls it once it has focus,
 * a mouse uses the scroll bar, and browsers with CSS scroll buttons (::scroll-button, below) add
 * previous and next buttons. Nothing advances by itself. The next picture always shows at the
 * edge, so the row reads as one that scrolls.
 */
.gallery {
  margin: 1.5rem 0 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 0.25rem;
  scrollbar-color: var(--line) transparent;
  border-radius: var(--radius);
  container-type: scroll-state;
}

.gallery:focus-visible {
  outline: 3px solid var(--cta);
  outline-offset: 3px;
}

.gallery ul {
  display: flex;
  gap: 1rem;
  margin: 0;
  padding: 0.25rem 0.25rem 1rem;
  list-style: none;
}

.gallery li {
  flex: 0 0 min(62%, 15rem);
  scroll-snap-align: start;
}

.gallery img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--stage-2);
}

/*
 * The previous and next buttons where the browser can make them from CSS (Chrome 135 and later):
 * named by the gallery's data-previous and data-next, in the page's language. Elsewhere the row
 * still swipes and scrolls. When every picture fits on one row (a wide window), the buttons would
 * scroll nothing, so they go; the scroll-state query brings them back as soon as the row overflows
 * again, on a resize too (#2085). A browser without scroll-state queries keeps them, disabled.
 */
.gallery::scroll-button(*) {
  width: 2.75rem;
  height: 2.75rem;
  margin: 0.5rem 0.5rem 0 0;
  border: 2px solid var(--cta);
  border-radius: 50%;
  background: var(--stage-2);
  color: var(--paper);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.gallery::scroll-button(*):disabled {
  border-color: var(--line);
  color: var(--paper-muted);
  cursor: default;
}

.gallery::scroll-button(*):focus-visible {
  outline: 3px solid var(--paper);
  outline-offset: 2px;
}

.gallery::scroll-button(inline-start) {
  content: '\2039' / attr(data-previous);
}

.gallery::scroll-button(inline-end) {
  content: '\203A' / attr(data-next);
}

@container not scroll-state(scrollable: x) {
  .gallery::scroll-button(*) {
    display: none;
  }
}

/*
 * The home page (page.tsx, CONCEPT 9.35, DESIGN.md "Three acts on a cardboard stage", #2068): the
 * hero with its stage, the ticket stubs, one act per world, how it plays, the deal and the final
 * call. Every text sits on a flat ground of its tokens or on a scrim that fades the art into it.
 */
.label {
  margin: 0;
  font-family: var(--label);
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.08em;
  line-height: 1.3;
  color: var(--cta);
}

.home-hero {
  padding-top: var(--space-l);
  padding-bottom: var(--space-m);
  text-align: center;
}

.home-hero h1 {
  margin: 0 0 0.25rem;
  font-size: var(--step-3);
  line-height: 1.05;
  text-shadow: 0 3px 0 #000;
}

.home-hero .subtitle {
  margin: 0;
}

.lede {
  max-width: 38rem;
  margin: var(--space-s) auto 0;
  font-size: var(--step-1);
  line-height: 1.4;
}

/* The one primary action: the yellow of the game's Play button, pressed down when pressed. */
.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 3rem;
  margin-top: var(--space-m);
  padding: 0.9rem 1.9rem;
  border-radius: 999px;
  background: var(--cta);
  box-shadow:
    0 5px 0 #8a5a10,
    0 12px 24px rgb(0 0 0 / 0.4);
  color: var(--cta-ink);
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1;
  text-decoration: none;
}

.cta::before {
  content: '';
  width: 0;
  height: 0;
  border-block: 0.5em solid transparent;
  border-left: 0.8em solid currentColor;
}

.cta:hover {
  color: var(--cta-ink);
  text-decoration: underline;
}

.cta:active {
  box-shadow: 0 2px 0 #8a5a10;
  transform: translateY(3px);
}

.cta:focus-visible {
  outline-color: var(--paper);
}

.stores-note {
  margin: 0.75rem auto 0;
  color: var(--paper-muted);
  font-size: var(--step--1);
}

/*
 * The stage: three backdrops in one kraft proscenium, each hero in front of their own world. The
 * cells are taller on a phone, so the heroes stay large there too.
 */
.stage {
  margin-top: var(--space-l);
  padding: 0.75rem 0.75rem 1.75rem;
  border-radius: 1.375rem;
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.07) 0 3px, transparent 3px 9px),
    linear-gradient(var(--kraft), var(--kraft-dark));
  box-shadow:
    inset 0 -1rem 0 #6e5230,
    0 30px 60px rgb(0 0 0 / 0.55);
}

.stage-inner {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  aspect-ratio: 1 / 0.95;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #000;
  list-style: none;
}

.stage .backdrop {
  position: relative;
  overflow: hidden;
}

.stage .backdrop + .backdrop {
  border-left: 5px solid var(--kraft-dark);
}

.stage .backdrop-art,
.stage .backdrop .front {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stage .backdrop .front {
  z-index: 2;
}

.stage .backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 3;
  background: linear-gradient(transparent 60%, rgb(0 0 0 / 0.55));
  pointer-events: none;
}

.actor {
  position: absolute;
  z-index: 1;
  bottom: 11%;
  left: 50%;
  width: auto;
  height: 68%;
  max-width: 94%;
  object-fit: contain;
  transform: translateX(-50%);
  filter: drop-shadow(0 10px 8px rgb(0 0 0 / 0.5));
}

.world-orbit .actor {
  height: 58%;
  bottom: 16%;
}

.world-harvest .actor {
  bottom: 7%;
}

/* Teodor peeks out of the cabbages in the corner, his leaves in front of him. */
.peek {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 13%;
  width: 46%;
}

.peek img {
  width: 100%;
  transform: rotate(-6deg);
}

.peek .leaves {
  position: absolute;
  left: -12%;
  bottom: -18%;
  width: 124%;
  max-width: none;
  transform: none;
}

.tag {
  position: absolute;
  z-index: 4;
  /* Centred between both edges, not shifted from the middle, so a name may use the cell's width
     before it wraps. */
  left: 4%;
  right: 4%;
  bottom: 0.6rem;
  width: fit-content;
  margin-inline: auto;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 0 3px 0 rgb(0 0 0 / 0.3);
  color: var(--ink);
  font-family: var(--label);
  font-weight: 800;
  font-size: clamp(0.72rem, 0.55rem + 0.6vw, 1rem);
  letter-spacing: 0.04em;
  line-height: 1.1;
  text-align: center;
  /* A phone's column is narrow: a long one-word name (German "Trümmerorbit") breaks, hyphenated
     in the page's language, rather than overflow the cell. */
  hyphens: auto;
  overflow-wrap: break-word;
  transform: rotate(-2deg);
}

@media (min-width: 40rem) {
  .stage-inner {
    aspect-ratio: 2 / 1;
  }

  .actor {
    height: 72%;
    bottom: 9%;
  }

  .world-orbit .actor {
    height: 62%;
    bottom: 14%;
  }

  .world-harvest .actor {
    bottom: 3%;
  }

  .peek {
    width: 32%;
    bottom: 5%;
  }
}

/* The facts in place of reviews: paper ticket stubs with punched ends. */
.tickets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin: 0 auto;
  padding-top: var(--space-m);
  padding-bottom: var(--space-l);
  list-style: none;
}

.tickets li {
  padding: 0.75rem 1.4rem;
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
  font-size: var(--step--1);
  line-height: 1.2;
  mask:
    radial-gradient(circle 7px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle 7px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}

.tickets li:nth-child(odd) {
  transform: rotate(-1.2deg);
}

.tickets li:nth-child(even) {
  transform: rotate(1deg);
}

/*
 * An act: the world's ground (`.act`, above), its backdrop faint behind a scrim that fades into
 * the ground on the text's side, so its texts stand on the ground's colour.
 */
.act {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-top: var(--space-l);
  padding-bottom: var(--space-l);
}

.act-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.act-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.act-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(var(--w-bg), transparent 30%, transparent 70%, var(--w-bg)),
    linear-gradient(90deg, var(--w-bg) 15%, rgb(0 0 0 / 0) 80%);
}

.act.flip .act-bg::after {
  background:
    linear-gradient(var(--w-bg), transparent 30%, transparent 70%, var(--w-bg)),
    linear-gradient(270deg, var(--w-bg) 15%, rgb(0 0 0 / 0) 80%);
}

.act-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-l);
  align-items: center;
}

.act .label {
  color: var(--w-accent);
}

.act h2 {
  margin: 0.4rem 0 0.75rem;
  font-size: var(--step-3);
  line-height: 1.05;
  color: var(--w-text);
  text-shadow: 0 3px 0 rgb(0 0 0 / 0.6);
}

.act-copy > p {
  max-width: 34rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  list-style: none;
}

.chips li {
  padding: 0.3rem 0.8rem;
  border: 1.5px solid var(--w-accent);
  border-radius: 999px;
  background: var(--w-bg);
  color: var(--w-accent);
  font-weight: 500;
  font-size: var(--step--1);
}

.trophies {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.trophies img {
  flex: none;
  width: 3.25rem;
  height: 3.25rem;
  filter: drop-shadow(0 4px 4px rgb(0 0 0 / 0.4));
}

.trophies p,
.act-free {
  margin: 0;
  color: var(--w-muted);
  font-size: var(--step--1);
  line-height: 1.4;
}

.trophies p {
  flex: 1 1 12rem;
}

.act-free {
  margin-bottom: 1rem;
}

.act .more a {
  font-weight: 800;
  text-underline-offset: 4px;
}

.act .more a::after {
  content: ' \2192';
}

.act a:hover {
  color: var(--w-text);
}

.act :focus-visible {
  outline-color: var(--w-text);
}

/* A board and a map page pinned up like cards with tape, the hero cut-out in front of them. */
.act-art {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-s);
  align-items: end;
  max-width: 36rem;
  margin: 0 auto;
  padding-bottom: 1.5rem;
}

.card {
  position: relative;
  margin: 0;
  padding: 0.5rem 0.5rem 0.6rem;
  border-radius: 6px;
  background: var(--paper);
  box-shadow: 0 16px 30px rgb(0 0 0 / 0.45);
}

.card img {
  border-radius: 3px;
}

.card::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  width: 4.5rem;
  height: 1.4rem;
  background: rgb(240 226 180 / 0.82);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.2);
  transform: translateX(-50%) rotate(-3deg);
}

.card:nth-child(1) {
  transform: rotate(-2.5deg);
}

.card:nth-child(2) {
  transform: rotate(2deg) translateY(-18px);
}

.act-actor {
  position: absolute;
  z-index: 2;
  right: -4%;
  bottom: -2%;
  width: 36%;
  filter: drop-shadow(0 12px 10px rgb(0 0 0 / 0.55));
}

.act.flip .act-actor {
  right: auto;
  left: -4%;
}

@media (min-width: 48rem) {
  .act-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }

  .act.flip .act-copy {
    order: 2;
  }

  .act-actor {
    right: -8%;
    width: 34%;
  }

  .act.flip .act-actor {
    left: -8%;
  }
}

/* How it plays: the store's opening paragraph, then four cards. */
.how {
  padding-top: var(--space-l);
  padding-bottom: var(--space-l);
}

.how h2,
.offer h2,
.home-final h2 {
  margin: 0.4rem 0 0.75rem;
  font-size: var(--step-2);
}

.how-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-s);
  margin-top: var(--space-m);
}

.how-card {
  padding: var(--space-m);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--stage-2);
}

.how-card h3 {
  margin: 0 0 0.5rem;
  color: var(--cta);
  font-size: var(--step-1);
  line-height: 1.2;
}

.how-card p {
  margin: 0;
}

/* The deal: the price, in full, on kraft. */
.offer {
  padding: var(--space-l) var(--space-m);
  border-radius: var(--radius);
  background:
    repeating-linear-gradient(90deg, rgb(0 0 0 / 0.07) 0 3px, transparent 3px 9px),
    linear-gradient(var(--kraft), var(--kraft-dark));
  color: var(--ink);
  text-align: center;
}

.offer .label,
.offer h2 {
  color: var(--ink);
}

.offer h2 {
  font-size: var(--step-3);
  text-shadow: none;
}

.offer p:last-child {
  max-width: 40rem;
  margin: 0 auto;
  font-weight: 500;
}

/* The final call: the stores, centred, and the QR code on wide screens with a mouse. */
.home-final {
  padding-top: var(--space-l);
  text-align: center;
}

.home-final .stores,
.home-final figure {
  justify-content: center;
  margin-inline: auto;
}

.home-final figure {
  text-align: left;
}

.home-final > p {
  max-width: 38rem;
  margin: 1.5rem auto 0;
}

/*
 * Motion, CSS only and only for visitors who did not ask for less: the heroes rise onto the stage
 * one after another, the tags drop in, and the acts' cards and heroes slide up as they come into
 * view where the browser can tie motion to scrolling. Each plays once; nothing moves by itself.
 */
@media (prefers-reduced-motion: no-preference) {
  .actor {
    animation: rise 0.9s cubic-bezier(0.2, 0.9, 0.25, 1.15) both;
  }

  .stage .backdrop:nth-child(2) .actor {
    animation-delay: 0.15s;
  }

  .stage .backdrop:nth-child(3) .actor {
    animation-delay: 0.3s;
  }

  .tag {
    animation: drop 0.6s 0.6s ease-out both;
  }

  @keyframes rise {
    from {
      transform: translate(-50%, 40%);
      opacity: 0;
    }
  }

  @keyframes drop {
    from {
      transform: translateY(-30px) rotate(-8deg);
      opacity: 0;
    }
  }

  @supports (animation-timeline: view()) {
    .card,
    .act-actor {
      animation: slide-in linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 35%;
    }

    @keyframes slide-in {
      from {
        opacity: 0;
        translate: 0 60px;
      }
    }
  }
}

/*
 * The subpages (subpage.tsx): the privacy policy and the support page (legal.tsx), the press kit,
 * the manual and the worlds' pages. One readable column under the frame.
 */
.legal > main {
  width: 100%;
  max-width: calc(var(--column) + 2 * var(--gutter));
  margin: 0 auto var(--space-l);
  padding: var(--space-m) var(--gutter) 0;
}

.legal h1 {
  margin: 0.5rem 0 1rem;
  font-size: var(--step-2);
  line-height: 1.1;
  text-shadow: 0 3px 0 #000;
}

.legal h3 {
  margin: 1.5rem 0 0.5rem;
  color: var(--paper);
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.6;
}

.legal li {
  margin-bottom: 0.25rem;
}

/* The press kit (press.tsx, #815): the legal pages' column, the facts and the downloads. */
.press section {
  padding: 1rem 0 0;
}

.press dt {
  color: var(--paper-muted);
  font-family: var(--label);
  font-weight: 800;
  font-size: var(--step--1);
  letter-spacing: 0.04em;
}

.press dd {
  margin: 0 0 0.75rem;
}

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.downloads li {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.downloads img {
  width: 100%;
  margin-bottom: 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--line);
}

.downloads .meta {
  color: var(--paper-muted);
  font-size: 0.875rem;
  line-height: 1.4;
}

/*
 * A world's page (world.tsx, #1833, #2069): one act on the stage, the whole page in the world's
 * token set. The opening shows the hero's picture over a blurred copy of itself that fades into the
 * world's ground; below, the sections at the landing page's width.
 */
.world-page {
  background: var(--w-bg);
  color: var(--w-text);
}

.world-page > main {
  max-width: none;
  padding: 0;
}

.world-page main > section {
  padding-top: var(--space-m);
}

.world-page main a {
  color: var(--w-accent);
}

.world-page h2 {
  color: var(--w-accent);
}

.opening {
  position: relative;
  overflow: hidden;
  margin-top: -1rem;
  isolation: isolate;
}

.opening .backdrop {
  position: absolute;
  inset: -2rem;
  z-index: -1;
  width: calc(100% + 4rem);
  max-width: none;
  height: calc(100% + 4rem);
  object-fit: cover;
  filter: blur(18px) saturate(1.15);
  opacity: 0.55;
}

.opening::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, var(--w-bg) 10%, transparent),
    linear-gradient(transparent 55%, var(--w-bg));
}

.opening-grid {
  display: grid;
  gap: var(--space-m);
  align-items: center;
  padding-top: var(--space-l);
  padding-bottom: var(--space-m);
}

.opening h1 {
  margin: 0 0 0.75rem;
  font-size: var(--step-3);
  line-height: 1.05;
  text-shadow: 0 3px 0 #000;
}

.act-label {
  margin: 0;
  color: var(--w-accent-2);
  font-family: var(--label);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.cutout {
  margin: 0;
}

.cutout img {
  max-width: min(20rem, 80%);
  margin: 0 auto;
  border: 6px solid var(--paper);
  border-radius: var(--radius);
  box-shadow: 0 1rem 2rem rgb(0 0 0 / 0.5);
  transform: rotate(2deg);
}

/* "Get the game": the game's yellow Play button, pressed down when pressed. */
.world-page .get-link {
  display: inline-block;
  padding: 0.75rem 1.75rem;
  border-radius: 999px;
  background: var(--cta);
  box-shadow: 0 4px 0 #8a5a10;
  color: var(--cta-ink);
  font-family: var(--display);
  font-size: var(--step-1);
  text-decoration: none;
}

.world-page .get-link:hover {
  color: var(--cta-ink);
  text-decoration: underline;
}

.world-page .get-link:active {
  box-shadow: 0 1px 0 #8a5a10;
  transform: translateY(3px);
}

.world-page .lead {
  max-width: var(--column);
}

.mechanics,
.acts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 1rem;
  padding: 0;
  list-style: none;
}

.mechanics li,
.acts li {
  padding: var(--space-s);
  border-radius: var(--radius);
  background: var(--w-surface);
  border-top: 4px solid var(--w-accent);
}

.mechanics strong {
  display: block;
  color: var(--w-accent);
  font-size: var(--step-1);
}

/* What is free: a paper ticket stub, ink on paper. */
.ticket {
  max-width: var(--column);
  padding: var(--space-m);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  mask:
    radial-gradient(circle at 0 50%, #0000 0.9rem, #000 0.95rem) left / 51% 100% no-repeat,
    radial-gradient(circle at 100% 50%, #0000 0.9rem, #000 0.95rem) right / 51% 100% no-repeat;
}

.world-page .ticket h2 {
  color: var(--ink);
}

.ticket .facts {
  font-size: var(--step-1);
  font-weight: 800;
}

.acts a {
  font-family: var(--display);
  font-size: var(--step-1);
}

.acts p {
  margin: 0.25rem 0 0;
  color: var(--w-muted);
}

.final {
  margin-bottom: var(--space-l);
  text-align: center;
}

.final .stores {
  justify-content: center;
}

@media (min-width: 48rem) {
  .opening-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    min-height: 34rem;
  }
}

/*
 * The player manual (manual.tsx, CONCEPT 9.34): the subpages' headings, the contents in a left
 * column and the text in the middle; on a phone the contents collapse above the text.
 */
.manual-layout {
  width: 100%;
  max-width: calc(var(--content) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-m) var(--gutter) 2rem;
}

.manual-layout > main {
  min-width: 0;
  max-width: var(--column);
}

.manual .contents {
  display: none;
}

.contents-phone {
  margin: 0.5rem 0 1rem;
  padding: 0.25rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--stage-2);
}

.contents-phone > summary {
  padding: 0.5rem 0;
  font-weight: 800;
  cursor: pointer;
}

.contents ul,
.contents-phone ul {
  margin: 0;
  padding-left: 1rem;
  list-style: none;
}

.contents > ul,
.contents-phone nav > ul {
  padding-left: 0;
}

.contents a,
.contents-phone a {
  display: inline-block;
  padding: 0.2rem 0;
  line-height: 1.4;
}

.manual [id] {
  scroll-margin-top: 1rem;
}

.manual article img {
  margin: 1rem 0;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
}

.manual section {
  padding: 0;
}

.manual section > details {
  margin: 0 0 1rem;
}

.manual section > details > summary {
  padding: 0.5rem 0.75rem;
  border: 1px dashed var(--line);
  border-radius: 0.5rem;
  color: var(--paper-muted);
  cursor: pointer;
}

.manual section > details[open] > summary {
  margin-bottom: 1rem;
}

/*
 * The manual's screenshots (manual.tsx, CONCEPT 9.34, "Screenshots from the device"): on a phone a
 * strip of small thumbnails under the section's heading, which scrolls sideways on its own (the
 * page never does); from 48rem a column right of the text, the text keeping one width whether its
 * section has screenshots or not.
 */
.shots {
  display: flex;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0 0 0.25rem;
  overflow-x: auto;
  list-style: none;
}

.shots li {
  flex: none;
}

.shots a {
  display: block;
  border-radius: 0.375rem;
}

.manual article .shots img {
  width: 4.5rem;
  margin: 0;
  border-radius: 0.375rem;
}

.shots a:hover img {
  border-color: var(--cta);
}

.shot-text {
  min-width: 0;
}

/* The viewer (assets/manual.js): the screenshot as large as the screen allows, on black. */
html:has(.viewer[open]) {
  overflow: hidden;
}

.viewer {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 4rem 1rem 1rem;
  border: 0;
  background: rgb(0 0 0 / 0.92);
  color: var(--paper);
}

.viewer[open] {
  display: flex;
}

/* A browser without <dialog> (Safari before 15.4) would show the closed viewer inline. */
.viewer:not([open]) {
  display: none;
}

.viewer::backdrop {
  background: rgb(0 0 0 / 0.6);
}

.viewer-frame {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.viewer-image {
  width: auto;
  max-height: 100%;
  object-fit: contain;
  border-radius: 0.5rem;
}

.viewer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  border: 0;
  border-radius: 999px;
  background: var(--cta);
  color: var(--cta-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.viewer-close:hover {
  background: var(--paper);
}

@media (min-width: 48rem) {
  .manual-layout > main {
    max-width: 56rem;
  }

  /*
   * The thumbnails float in the column the article's right padding keeps free (their margin box
   * is 0 wide, so no text wraps round them), each list below the one before (`clear: right`),
   * lifted level with the heading they follow by that heading's own height (one line and its
   * bottom margin; a relative offset, so the lift never moves the next list up into it).
   *
   * A heading with no text of its own (a `##` straight followed by its first `###`) does not
   * hold the page for its thumbnails: they run on beside the next section, whose thumbnails start
   * below them, only as far down as needed. A section with text ends below its thumbnails
   * (`::after`), so a run of short sections (Settings) never lets them drift away from their
   * text. The article contains the last ones (flow-root).
   */
  .manual article {
    display: flow-root;
    padding-right: 8.5rem;
  }

  .shot-group > .shots {
    position: relative;
    float: right;
    clear: right;
    flex-direction: column;
    gap: 0.75rem;
    width: 7rem;
    margin: 0 -8.5rem 1rem 1.5rem;
    overflow: visible;
    padding: 0;
  }

  .shot-group:not(:has(> .shot-text:empty))::after {
    content: '';
    display: block;
    clear: right;
  }

  /*
   * The bottom margin takes the lift back, so what clears a list starts 1rem below where it is
   * seen; a heading-only section's list ends where the largest lift (a `##`'s) still keeps the
   * next list, lifted by its own heading, 1rem below it.
   */
  .shot-group > h2 + .shots {
    top: calc(-1 * (2rem * 1.15 + 0.75rem));
    margin-bottom: calc(1rem - (2rem * 1.15 + 0.75rem));
  }

  .shot-group > h3 + .shots {
    top: calc(-1 * (1.125rem * 1.6 + 0.5rem));
    margin-bottom: calc(1rem - (1.125rem * 1.6 + 0.5rem));
  }

  .shot-group:has(> .shot-text:empty) > h2 + .shots {
    margin-bottom: 1rem;
  }

  .shot-group:has(> .shot-text:empty) > h3 + .shots {
    margin-bottom: calc(1rem + (2rem * 1.15 + 0.75rem) - (1.125rem * 1.6 + 0.5rem));
  }

  .manual article .shots img {
    width: 100%;
  }
}

@media (min-width: 60rem) {
  .manual-layout {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
  }

  .manual .contents {
    display: block;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
    padding: 1rem 0;
  }

  .manual .contents > p {
    margin: 0 0 0.5rem;
    color: var(--paper-muted);
    font-family: var(--label);
    font-weight: 800;
    letter-spacing: 0.04em;
  }

  .contents-phone {
    display: none;
  }
}

@media (min-width: 48rem) {
  .hero {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  }

  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: no-preference) {
  html,
  .gallery {
    scroll-behavior: smooth;
  }
}
