/*
 * The estate's one stylesheet (M8a): the arcade skin's colours (src/styles/skins.css) on system
 * faces, so a generated page paints at once with no web font and no script.
 */

:root {
  color-scheme: dark;
  --bg: #030806;
  --bg-2: #061a10;
  --panel: #06120c;
  --panel-2: #0a1f14;
  --ink: #dcffe9;
  --ink-dim: #8fc3a6;
  --accent: #00fa69;
  --accent-ink: #02140a;
  /* Free credits and the second month free: a gold that reads on this page and the app's white. */
  --gold: #b07d00;
  --line-soft: #0f5a33;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 72ch;
  /* A shared game's card's tokens (src/styles/game-card.css), which a skin sets on the front
     page: Play's cards in the page's own face, their title at 16px. */
  --radius: 12px;
  --font-display: inherit;
  --ui-fit: 0.67;
  --ui-track: normal;
  --ui-case: none;
}

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

html {
  background: var(--bg);
  color: var(--ink);
  font:
    18px/1.6 system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  overflow-x: hidden;
}

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

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

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

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2rem, 5.5vw, 3.4rem);
  margin: 0 0 0.5em;
}

h2 {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  margin: 2.2em 0 0.6em;
}

h3 {
  font-size: 1.1rem;
  margin: 1.4em 0 0.4em;
}

/* The header, the breadcrumbs and the footer. */

.top {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.top nav {
  display: flex;
  gap: 18px;
  margin-left: auto;
  font-size: 0.9rem;
}

.top nav a {
  color: var(--ink-dim);
  text-decoration: none;
}

.top nav a:hover {
  color: var(--ink);
}

/* The affiliate program's link: beside the call to action, kept on a phone. */
.top__earn {
  color: var(--ink-dim);
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.top__earn:hover {
  color: var(--ink);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 14px var(--gutter) 0;
  list-style: none;
  font-size: 0.8rem;
  color: var(--ink-dim);
}

.crumbs li + li::before {
  content: '/';
  margin-right: 6px;
}

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

main {
  padding: 0 var(--gutter) 64px;
}

article {
  max-width: 1100px;
  margin: 0 auto;
}

.copy,
.prompts,
.faq,
.post .body,
.post .toc,
.hero p {
  max-width: var(--measure);
}

.hero {
  padding: 40px 0 8px;
}

.hero > p {
  font-size: 1.12rem;
  color: var(--ink-dim);
}

.meta,
.note {
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.btn {
  display: inline-block;
  margin-top: 8px;
  padding: 12px 22px;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.top .btn {
  margin: 0;
  padding: 8px 14px;
  font-size: 0.85rem;
}

/* The gallery strip. */

.strip {
  margin: 32px 0 0;
}

.strip ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.strip li {
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
}

.strip span {
  display: block;
  padding: 6px 10px;
  font-size: 0.72rem;
  color: var(--ink-dim);
}

.strip figcaption {
  margin-top: 10px;
  font-size: 0.8rem;
  color: var(--ink-dim);
}

/* The blocks. */

.copy ul,
.copy ol,
.post .body ul,
.post .body ol {
  padding-left: 1.2em;
}

.copy li,
.post .body li {
  margin: 0.3em 0;
}

.prompts ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prompts li {
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-style: italic;
}

.how ol {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.how li {
  padding: 18px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
}

.how h3 {
  margin-top: 0.5em;
}

.how p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.num {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.promise ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  list-style: none;
}

.promise li {
  padding: 8px 14px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.9rem;
}

.faq details {
  padding: 14px 0;
  border-bottom: 1px solid var(--line-soft);
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
}

.faq details p {
  margin: 0.6em 0 0;
  color: var(--ink-dim);
}

.related ul,
.index ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related a,
.index a {
  color: var(--ink-dim);
  text-decoration: none;
}

.related a:hover,
.index a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.cta {
  margin-top: 56px;
  padding: 36px var(--gutter);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: linear-gradient(160deg, var(--panel-2), var(--panel));
  text-align: center;
}

.cta h2 {
  margin-top: 0;
}

/* The pricing page: the Monthly / Annual toggle, a card a plan, its badge on top, the rows it lacks
   struck through; the packs. */

.period {
  position: relative;
  display: flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin: 28px auto 0;
  padding: 4px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
}

.period legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.period label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-dim);
  font-weight: 700;
  /* A long language's saving wraps under its word, inside the segment, never past the screen. */
  flex-wrap: wrap;
  justify-content: center;
  text-align: center;
  cursor: pointer;
}

.period input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: 0;
}

.period label:has(input:checked) {
  background: var(--accent);
  color: var(--accent-ink);
}

.period label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.period__save {
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid currentColor;
  font-size: 0.75rem;
  white-space: nowrap;
}

.pricing:has(.period input[value='month']:checked) .plan__year,
.pricing:has(.period input[value='year']:checked) .plan__month {
  display: none;
}

.plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.plan {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
}

.plan[data-badge] {
  border-color: var(--accent);
}

.plan h2 {
  margin: 0;
}

.plan p {
  margin: 0;
}

.plan__badge {
  align-self: flex-start;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.75rem;
  font-weight: 700;
}

.plan__blurb {
  color: var(--ink-dim);
  font-size: 0.92rem;
}

.plan__price {
  margin-top: 10px;
  color: var(--ink-dim);
}

.plan__price s {
  margin-right: 4px;
  opacity: 0.7;
}

.plan__price strong {
  color: var(--ink);
  font-size: 2.2rem;
}

.plan__credits {
  font-weight: 700;
}

.plan__offer {
  color: var(--gold);
  font-weight: 700;
}

.plan ul {
  display: grid;
  gap: 6px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.92rem;
}

.plan ul.plan__headline {
  padding: 12px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
}

.plan li::before {
  content: '✓ ';
  color: var(--accent);
}

.plan li.off {
  color: var(--ink-dim);
  opacity: 0.6;
}

.plan li.off::before {
  content: '✕ ';
  color: var(--ink-dim);
}

.plan .btn {
  margin-top: auto;
  text-align: center;
}

.plan > .note {
  margin: 10px 0 12px;
}

/* The pricing page's heading, with the mark turning beside it. */
.pricing__title {
  display: flex;
  align-items: center;
  gap: 14px;
}

.pricing__mark img {
  display: block;
  width: 64px;
  height: 64px;
}

@media (min-width: 768px) {
  .pricing__mark img {
    width: 88px;
    height: 88px;
  }
}

/* The price test (estate/families/pricing.ts): the tested card's own price is held back until the
   script shows the visitor's arm, so no visitor sees another arm's price first; a script that
   never runs lets it show after a moment. */
.pricing:not([data-arm-shown]) [data-arm-own] {
  visibility: hidden;
  animation: arm-fallback 0s 1.5s forwards;
}

@keyframes arm-fallback {
  to {
    visibility: visible;
  }
}

/* The pricing page's leaving offer (src/pricing/exit.ts): a small centred sheet, the percent
   large in the offer's gold, one bright button and a quiet No thanks under it. */
.leaving {
  position: relative;
  width: min(380px, calc(100vw - 32px));
  padding: 36px 28px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: radial-gradient(120% 70% at 50% 0%, var(--panel-2), var(--panel) 70%);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 24px 60px rgb(0 0 0 / 55%);
}

.leaving[open] {
  animation: leaving-in 180ms ease-out;
}

@keyframes leaving-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }
}

@media (prefers-reduced-motion: reduce) {
  .leaving[open] {
    animation: none;
  }
}

.leaving::backdrop {
  background: rgb(0 0 0 / 65%);
  backdrop-filter: blur(2px);
}

.leaving__x {
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 6px;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  line-height: 1;
  cursor: pointer;
}

.leaving__eyebrow {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.leaving__title {
  display: grid;
  margin: 4px 0 12px;
  font-size: 1.15rem;
  font-weight: 600;
}

.leaving__percent {
  color: var(--gold);
  font-size: 4rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.leaving__line {
  margin: 0 0 20px;
  color: var(--ink-dim);
  line-height: 1.5;
}

.leaving__take {
  display: block;
  width: 100%;
  margin: 0;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.leaving__no {
  margin-top: 10px;
  padding: 8px;
  border: 0;
  background: none;
  color: var(--ink-dim);
  font: inherit;
  font-size: 0.9rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.leaving__x:focus-visible,
.leaving__no:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The top-up: the cheapest rungs as one-press buttons, the amount box with its free credits beside it, Buy credits, and the ladder folded
   under it until the box is pressed or holds an amount. */
.topup {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.topup__picks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topup__pick {
  padding: 8px 16px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.topup__pick:hover,
.topup__pick:focus-visible {
  border-color: var(--accent);
}

.topup__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}

.topup__box {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  font-size: 1.2rem;
  font-weight: 700;
}

.topup__box:focus-within {
  border-color: var(--accent);
}

.topup__box input {
  width: 9.5em;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  outline: none;
  appearance: textfield;
}

.topup__box input::-webkit-inner-spin-button,
.topup__box input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

.topup__gets {
  margin: 0;
  color: var(--ink-dim);
  font-weight: 700;
}

.topup__gets--free {
  color: var(--gold);
  font-size: 1.2rem;
  letter-spacing: 0.02em;
}

.topup .note {
  margin: 0;
}

.topup .note:empty {
  display: none;
}

.topup .btn {
  justify-self: start;
}

.topup__ladder {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}

/* Folded, it is hidden from a screen reader too, once the fold has closed. */
.topup__ladder > div {
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0.25s;
}

.topups:has(.topup input:focus, .topup input:not(:placeholder-shown)) .topup__ladder {
  grid-template-rows: 1fr;
}

.topups:has(.topup input:focus, .topup input:not(:placeholder-shown)) .topup__ladder > div {
  visibility: visible;
  transition: visibility 0s;
}

.topups tr.on td {
  color: var(--accent);
  font-weight: 700;
}

.topups table,
.terms table {
  width: 100%;
  max-width: 560px;
  border-collapse: collapse;
}

.topups th,
.topups td,
.terms th,
.terms td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.terms table {
  max-width: 720px;
}

.terms th {
  color: var(--ink-dim);
  font-weight: 600;
}

.topups td:last-child {
  color: var(--accent);
  font-size: 0.85rem;
}

/* A comparison: the verdict, the table, the facts and their sources, the notice. */

.verdict {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.verdict > h2 {
  grid-column: 1 / -1;
}

.verdict > div {
  padding: 18px 20px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.verdict h3 {
  margin-top: 0;
}

.verdict ul {
  margin: 0;
  padding-left: 1.1em;
  color: var(--ink-dim);
}

.compare table,
.gen-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.compare th,
.compare td,
.gen-table th,
.gen-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.compare thead th {
  color: var(--ink);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.compare tbody th {
  width: 22%;
  color: var(--ink);
}

.compare td {
  color: var(--ink-dim);
}

.sources ol {
  padding-left: 1.2em;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.sources a,
.notice {
  color: var(--ink-dim);
}

.notice {
  margin-top: 24px;
  font-size: 0.8rem;
}

/* A "make a game like" page: the glance, the mechanics; the hub's groups. */

.glance table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.glance th,
.glance td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  vertical-align: top;
}

.glance th {
  width: 30%;
  color: var(--ink);
}

.glance td {
  color: var(--ink-dim);
}

.yours-note {
  margin: 12px 0 0;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  color: var(--ink);
  font-size: 0.92rem;
}

.mechanics ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 0;
  list-style: none;
}

.mechanics li {
  padding: 16px 18px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.mechanics h3 {
  margin: 0 0 0.4em;
}

.mechanics p {
  margin: 0;
  color: var(--ink-dim);
}

.group h2 {
  margin-top: 40px;
}

.cards h3 {
  margin: 0 0 0.4em;
  font-size: 1.1rem;
}

.index .more a {
  color: var(--accent);
}

/* A post and the blog's index. */

.toc {
  margin: 24px 0;
  padding: 16px 22px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
}

.toc h2 {
  margin: 0 0 0.4em;
  font-size: 1rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.92rem;
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  padding: 0;
  list-style: none;
}

.cards a {
  display: block;
  height: 100%;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
}

.cards a:hover {
  border-color: var(--accent);
}

.cards h2 {
  margin: 0 0 0.4em;
  font-size: 1.15rem;
}

.cards p {
  margin: 0;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.foot {
  padding: 40px var(--gutter);
  border-top: 1px solid var(--line-soft);
  background: var(--bg-2);
  font-size: 0.85rem;
}

.index {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.index h3 {
  margin: 0 0 0.6em;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink);
}

.fine {
  max-width: 1100px;
  margin: 28px auto 0;
  color: var(--ink-dim);
}

/* The asset generator's own link: in the sections on a wide screen, beside Affiliates on a phone. */
.top__gen {
  display: none;
}

/* The sections fold away before they wrap; the footer's index carries every page. */
@media (max-width: 880px) {
  .top nav {
    display: none;
  }

  .top__gen {
    display: inline;
    margin-left: auto;
  }

  .top__gen + .top__earn {
    margin-left: 0;
  }

  .top__earn {
    margin-left: auto;
  }
}

/*
 * A narrow phone: two rows, so no font can push the bar past the screen: the mark and the call to
 * action, then the asset generator and Affiliates under them.
 */
@media (max-width: 480px) {
  .top {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .top .btn {
    margin-left: auto;
    white-space: nowrap;
  }

  /* The line break: a full-width item between the first row and the links. */
  .top::after {
    content: '';
    order: 1;
    flex-basis: 100%;
  }

  .top__earn {
    order: 2;
  }

  .top__gen,
  .top__gen + .top__earn {
    margin-left: 0;
  }
}

@media (max-width: 560px) {
  .strip ul {
    grid-template-columns: repeat(2, 1fr);
  }

  .compare thead {
    display: none;
  }

  .compare tr,
  .compare th,
  .compare td {
    display: block;
  }

  .compare tbody th {
    width: auto;
    padding: 16px 0 4px;
    border-bottom: 0;
  }

  .compare td {
    padding: 4px 0 8px;
  }

  .compare td::before {
    content: attr(data-label) ': ';
    color: var(--ink);
    font-weight: 600;
  }
}

/* A free tool: its picks, its result, and where the result goes. */

.tool {
  margin: 28px 0;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.tool form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
}

.tool label {
  display: grid;
  gap: 4px;
  flex: 1 1 160px;
  font-size: 0.85rem;
  color: var(--ink-dim);
}

.tool select {
  width: 100%;
  padding: 11px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
}

.tool button {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.tool__result {
  margin: 18px 0 6px;
  padding: 18px;
  border-radius: 8px;
  background: var(--panel-2);
  min-height: 9em;
}

.tool__title {
  margin: 0 0 8px;
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.tool__detail {
  margin: 0;
  color: var(--ink-dim);
}

.tool__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 0;
}

.btn--quiet {
  background: transparent;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

/* A game's frame and its share links: a free game's page and a shared game's Play page. */

.stage {
  margin: 20px 0;
  background: #000;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  overflow: hidden;
}

.stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.stage--upright {
  aspect-ratio: 9 / 16;
  max-height: 80dvh;
  max-width: calc(80dvh * 9 / 16);
  margin-inline: auto;
}

.stage--sideways,
.stage--desktop,
.stage--both {
  aspect-ratio: 16 / 9;
  max-height: 80dvh;
}

/* A game made for a phone and a desktop plays on the device that opens it: upright on a phone so held. */
@media (pointer: coarse) and (orientation: portrait) {
  .stage--both {
    aspect-ratio: 9 / 16;
    max-width: calc(80dvh * 9 / 16);
    margin-inline: auto;
  }
}

.play-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
}

.play-actions .btn {
  margin: 0;
}

/* A shared game's line for a visitor on the device it is not made for (worker/src/play/device.ts):
   a phone's game, on a computer (a mouse's fine pointer), with its QR; a desktop's game, on a phone
   (a finger's coarse pointer, as the game's own controls read it). Hidden everywhere else. */
.device-hint {
  display: none;
  gap: 14px;
  align-items: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: -8px auto 20px;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  color: var(--ink-dim);
}

.device-hint p {
  margin: 0;
}

.device-hint svg {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 6px;
}

@media (hover: hover) and (pointer: fine) {
  .device-hint--phone {
    display: flex;
  }
}

@media (hover: none) and (pointer: coarse) {
  .device-hint--desktop {
    display: flex;
  }
}

.share {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0 24px;
}

.share span {
  margin-right: 4px;
  color: var(--ink-dim);
}

.share a {
  padding: 6px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.9rem;
  text-decoration: none;
}

.share a:hover {
  border-color: var(--accent);
}

.prompts ol {
  display: grid;
  gap: 10px;
  margin: 0 0 1em;
  padding: 0;
  list-style: none;
}

.prompts ol li {
  padding: 12px 16px;
  border-left: 3px solid var(--accent);
  background: var(--panel);
  font-style: italic;
}

.free-cards img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  margin-bottom: 12px;
  border-radius: 8px;
  object-fit: cover;
  background: var(--panel-2);
}

/* The templates page (`/templates`, families/templates.ts): a dense wall of big tiles with thin
   gutters, a rhythm of big, wide and tall ones (src/templates/tiles.ts), each tile's names and its
   hand-off shown on hover, always on a touch screen. */

article.templates {
  max-width: 1600px;
}

.templates__filters {
  display: grid;
  gap: 10px;
  margin: 8px 0 0;
}

.templates__filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.templates__filter > span {
  min-width: 3.5em;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
}

.templates__filter button {
  padding: 5px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
}

.templates__filter button:hover {
  border-color: var(--accent);
}

.templates__filter button[aria-pressed='true'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.templates__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  grid-auto-rows: 180px;
  grid-auto-flow: dense;
  gap: 4px;
  margin: 16px 0 24px;
  padding: 0;
  list-style: none;
  border-radius: 12px;
  overflow: hidden;
}

.templates__grid > li {
  min-width: 0;
  background: var(--panel-2);
}

.templates__grid > li[hidden] {
  display: none;
}

.templates__grid > .templates__big {
  grid-column: span 2;
  grid-row: span 2;
}

.templates__grid > .templates__wide {
  grid-column: span 2;
}

.templates__grid > .templates__tall {
  grid-row: span 2;
}

.templates__grid a {
  position: relative;
  display: block;
  height: 100%;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
}

.templates__grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.templates__name,
.templates__go {
  position: absolute;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.templates__name {
  inset: auto 0 0;
  padding: 28px 12px 10px;
  background: linear-gradient(transparent, rgb(0 0 0 / 75%));
  font-size: 0.85rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.templates__go {
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.78rem;
  font-weight: 700;
}

.templates__grid a:hover img,
.templates__grid a:focus-visible img {
  transform: scale(1.04);
}

.templates__grid a:hover > span,
.templates__grid a:focus-visible > span {
  opacity: 1;
}

@media (hover: none) {
  .templates__name {
    opacity: 1;
  }
}

@media (max-width: 560px) {
  /* Each filter one row, swiped sideways, so the tiles start on the first screen. */
  .templates__filter {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .templates__filter > * {
    flex: none;
  }

  .templates__grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 120px;
  }
}

/*
 * The free asset library: its browse, its cards, a pack's page and the panel. Served after
 * estate.css as the one stylesheet (write.ts).
 */

/* What the browse's script hides stays hidden, whatever a class sets its display to. */
[hidden] {
  display: none !important;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.library__head p {
  max-width: var(--measure);
}

.browse {
  margin: 20px 0 0;
}

.browse__search {
  display: flex;
  gap: 10px;
  max-width: 640px;
}

.browse__search label {
  flex: 1;
  min-width: 0;
}

.browse__search input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
}

.browse__search input::placeholder {
  color: var(--ink-dim);
}

.browse__search .btn {
  margin: 0;
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.browse__shelves {
  margin: 16px calc(-1 * var(--gutter)) 0;
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}

.browse__shelves::-webkit-scrollbar {
  display: none;
}

.browse__shelves ul {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 0 0 4px;
  list-style: none;
  width: max-content;
}

.browse__shelves a {
  display: block;
  padding: 7px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 0.85rem;
  text-decoration: none;
  white-space: nowrap;
}

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

.browse__shelves a[aria-current='page'] {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
}

.browse__caption {
  margin: 18px 0 12px;
  color: var(--ink-dim);
  font-size: 0.9rem;
}

.browse__caption span {
  color: var(--ink);
}

.browse__more {
  margin: 20px 0 0;
  text-align: center;
}

.browse__more .btn {
  border: 0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.assets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.asset a {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  transition:
    border-color 0.15s,
    transform 0.15s;
}

.asset a:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.asset__pic {
  display: block;
  aspect-ratio: 4 / 3;
  background: var(--panel-2);
}

.asset__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.asset__name {
  display: block;
  padding: 10px 12px 0;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.3;
}

.asset__meta {
  display: block;
  padding: 4px 12px 12px;
  color: var(--ink-dim);
  font-size: 0.76rem;
}

.shelf {
  margin: 36px 0 0;
}

.shelf header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.shelf h2 {
  margin: 0;
  font-size: clamp(1.2rem, 2.6vw, 1.5rem);
}

.shelf__all {
  font-size: 0.85rem;
  white-space: nowrap;
}

/* A row held to one line of four (`shelfRow`'s `line`), two by two on a narrow screen. */
.assets--line {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 760px) {
  .assets--line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* A pack's page. */

.pack__head {
  padding: 32px 0 4px;
}

.pack__head h1 {
  margin: 0.15em 0 0.25em;
}

.pack__shelf {
  margin: 0;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pack__by {
  margin: 0;
  color: var(--ink-dim);
}

.pack__top {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr);
  gap: 28px;
  align-items: start;
  margin-top: 24px;
}

.pack__media {
  display: grid;
  gap: 12px;
  margin: 0;
}

.pack__media img,
.pack__media video {
  width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel-2);
}

.pack__media figcaption {
  margin-top: 4px;
  color: var(--ink-dim);
  font-size: 0.85rem;
}

.pack__media audio {
  width: 100%;
}

.pack__facts {
  position: sticky;
  top: 16px;
  padding: 20px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.btn--download {
  display: block;
  margin: 0;
  padding: 14px 22px;
  font-size: 1.05rem;
  text-align: center;
}

.pack__facts .note {
  margin: 8px 0 0;
  text-align: center;
}

.pack__facts dl,
.panel dl {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 8px 14px;
  margin: 18px 0 0;
  font-size: 0.9rem;
}

.pack__facts dt,
.panel dt {
  color: var(--ink-dim);
}

.pack__facts dd,
.panel dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.pack__contents ul {
  columns: 3 180px;
  column-gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--ink-dim);
}

.pack__contents li {
  padding: 3px 0;
  break-inside: avoid;
}

.pack__contents details {
  margin-top: 10px;
}

.pack__contents summary {
  color: var(--accent);
  cursor: pointer;
}

.pack__contents details ul {
  margin-top: 8px;
}

/* A piece: its own square cell of its pack's atlas, the atlas moved so the cell fills the frame. */

.asset__cell,
.panel__cell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
}

/* Above the card's and the panel's own picture rules, wherever those sit in this file. */
.asset__pic.asset__cell img,
.panel__pic.panel__cell img {
  position: absolute;
  max-width: none;
  height: auto;
  aspect-ratio: auto;
  object-fit: fill;
}

.pack__pieces {
  margin: 28px 0 0;
}

.pack__pieces p {
  margin: 0 0 12px;
  color: var(--ink-dim);
}

.pack__pieces summary {
  margin: 14px 0 10px;
  color: var(--accent);
  cursor: pointer;
}

.assets--pieces {
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 10px;
}

.assets--pieces .asset__name {
  padding: 8px 10px 0;
  font-size: 0.84rem;
}

.assets--pieces .asset__meta {
  padding: 2px 10px 10px;
}

/* The panel a card with no page opens. */

.panel {
  width: min(880px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100dvh - 2 * var(--gutter));
  padding: 0;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: var(--panel);
  color: var(--ink);
}

.panel::backdrop {
  background: rgb(0 0 0 / 0.65);
}

.panel[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.panel form {
  position: absolute;
  top: 8px;
  right: 8px;
  margin: 0;
}

.panel__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: rgb(0 0 0 / 0.55);
  color: var(--ink);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.panel__pic {
  background: var(--panel-2);
}

.panel__pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.panel__body {
  padding: 22px;
}

.panel__body h2 {
  margin: 0.2em 0 0.25em;
  font-size: 1.5rem;
}

.panel__body .btn--download {
  margin-top: 18px;
}

@media (max-width: 760px) {
  .pack__top {
    grid-template-columns: minmax(0, 1fr);
  }

  .pack__facts {
    position: static;
  }

  .panel[open] {
    grid-template-columns: minmax(0, 1fr);
    overflow-y: auto;
  }

  .panel__pic img {
    aspect-ratio: 4 / 3;
    height: auto;
  }
}

@media (max-width: 560px) {
  .library__head > p {
    font-size: 1rem;
  }

  .assets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .browse__search .btn {
    display: none;
  }

  .asset__name {
    font-size: 0.85rem;
  }

  .assets--pieces {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

/* A signed-in visitor's files, under the Download (`src/library/direct.ts`). */
.direct {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.direct a,
.direct button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid currentcolor;
  border-radius: 10px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 0.9rem;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.direct span {
  flex: none;
  opacity: 0.7;
}

/*
 * The asset generator's pages (estate/families/gen.ts): the hero with its install box and stage, a
 * real output on a soft checker (its transparent pixels read as clear), a sheet's clip stepped
 * through by CSS with no script, the run sets, the screens, the steps, the price table, the command
 * blocks and the docs. Served after estate.css, on its colours.
 */

.gen {
  --gen-check-a: #0b1d14;
  --gen-check-b: #0f2419;
  --gen-mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
  max-width: 1180px;
}

.gen h2 {
  margin-top: 2.8em;
  letter-spacing: -0.015em;
}

.gen-lead {
  max-width: 62ch;
  margin: 0 0 26px;
  font-size: 1.06rem;
  line-height: 1.6;
  color: var(--ink-dim);
}

/* The hero: the words and the install box beside the stage; stacked on a phone. */

.gen-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(20px, 4vw, 56px);
  align-items: center;
  padding: 40px 0 8px;
  /* The stage's glow reaches past it; never past the screen. */
  overflow-x: clip;
}

.gen-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 5vw, 3.7rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.gen-hero__text > p {
  max-width: 56ch;
  font-size: 1.1rem;
  color: var(--ink-dim);
}

.gen-kicker {
  margin: 0 0 14px;
  color: var(--accent) !important;
  font-family: var(--gen-mono);
  font-size: 0.78rem !important;
  letter-spacing: 0.02em;
}

.gen-install {
  margin-top: 22px;
}

.gen-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

/* What it makes, beside the hero's words: a checklist, each line to where the page shows it. */

.gen-check {
  position: relative;
  padding: clamp(18px, 2.6vw, 28px);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background:
    radial-gradient(
      90% 70% at 80% 0%,
      color-mix(in srgb, var(--accent) 10%, transparent),
      transparent 65%
    ),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 24px 60px rgb(0 0 0 / 0.4);
}

.gen-check__head {
  margin: 0 0 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.gen-check ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The one look, on its own line over the groups. */
.gen-check__lead {
  display: block;
  margin: 0 0 14px;
  padding: 12px 14px !important;
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  border-radius: 14px !important;
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-weight: 600;
}

.gen-check__groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.gen-check__name {
  margin: 0 0 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.gen-check a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 5px 8px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 0.92rem;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color 150ms ease;
}

.gen-check a:hover,
.gen-check a:focus-visible {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.gen-check__tick {
  flex: none;
  color: var(--accent);
  font-weight: 700;
}

/*
 * See prompt: a prompt folded under what it made, a small pill that opens it in place. The page
 * stays about the pictures; the words that made each one are a tap away.
 */
.gen-see {
  min-width: 0;
  width: 100%;
}

.gen-see > summary {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 11px 4px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--ink-dim);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
  cursor: pointer;
  user-select: none;
  transition:
    color 150ms ease,
    border-color 150ms ease,
    background-color 150ms ease;
}

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

.gen-see > summary:hover,
.gen-see > summary:focus-visible,
.gen-see[open] > summary {
  border-color: color-mix(in srgb, var(--accent) 55%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--accent);
}

.gen-see__icon {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: rotate 150ms ease;
}

.gen-see[open] .gen-see__icon {
  rotate: 90deg;
}

.gen-see__body {
  margin-top: 8px;
  animation: gen-see-open 180ms ease-out;
}

.gen-see__body > code {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 5%, transparent);
  font-family: var(--gen-mono);
  font-size: 0.74rem;
  line-height: 1.55;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.gen-see__body > .gen-code {
  margin: 0;
}

@keyframes gen-see-open {
  from {
    opacity: 0;
    translate: 0 -4px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gen-see__body {
    animation: none;
  }
}

/* A real output: its picture on a checker, the command that made it and its cost under it. */

.gen-out {
  display: flex;
  flex-direction: column;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: var(--panel);
  transition:
    border-color 160ms ease,
    translate 160ms ease;
}

.gen-out:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line-soft));
}

.gen-out__pic {
  display: grid;
  flex: 1;
  place-items: center;
  min-height: 0;
  padding: 12px;
  background: repeating-conic-gradient(var(--gen-check-a) 0 25%, var(--gen-check-b) 0 50%) 0 0 /
    18px 18px;
}

.gen-out__pic > img {
  max-height: 320px;
  width: auto;
  object-fit: contain;
}

.gen-out figcaption {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
  padding: 10px 12px;
  font-size: 0.74rem;
  color: var(--ink-dim);
}

.gen-out figcaption code {
  font-family: var(--gen-mono);
  color: var(--ink);
  overflow-wrap: anywhere;
}

.gen-cost {
  padding: 1px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--accent);
  white-space: nowrap;
}

.gen-clip {
  flex-basis: 100%;
  color: var(--accent);
}

/* A sheet's clip, stepped through its row by CSS at the clip's own speed. */

.gen-out--play .gen-out__pic {
  overflow: hidden;
}

/*
 * A sheet's clip: a box one frame in shape, enlarged from its ground line so a body drawn small in
 * a tall frame fills the tile, the sheet inside it moved to the clip's row and stepped along it.
 * `translate` is composited, so a playing clip repaints nothing.
 */
.gen-play {
  position: relative;
  overflow: hidden;
  width: min(100%, 220px);
  scale: var(--zoom, 1);
  transform-origin: 50% var(--ground, 100%);
}

.gen-play__sheet {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  height: auto;
  translate: 0 var(--y);
  animation: gen-play var(--dur) steps(var(--n), jump-none) infinite;
}

@keyframes gen-play {
  to {
    translate: var(--to) var(--y);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gen-play__sheet {
    animation: none;
  }
}

/* The grids the outputs sit in. */

.gen-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
  gap: 12px;
}

.gen-grid--plays {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
}

.gen-grid--models {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}

/* The style runs: a look, its character and its sheet, a row each. */

.gen-styles {
  display: grid;
  gap: 14px;
}

.gen-grid--style {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
}

.gen-grid--style .gen-out--look .gen-out__pic {
  padding: 0;
}

.gen-grid--style .gen-out--look img {
  width: 100%;
  max-height: none;
}

/* A run's set: its look on the left, what was drawn in it on the right. */

.gen-set {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 18px;
  margin-bottom: 34px;
}

.gen-set__name {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  align-items: baseline;
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 1.15rem;
}

.gen-set__name span {
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--accent);
}

.gen-set__then {
  margin: 0 0 10px;
  color: var(--ink-dim);
  font-size: 0.85rem;
}

.gen-set__look .gen-out__pic img {
  width: 100%;
  max-height: none;
}

/* The interface and the title screen: laptop screens wide, phones narrow. */

.gen-screens {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(0, 0.7fr) minmax(0, 1.4fr);
  gap: 12px;
  align-items: start;
}

.gen-screens .gen-out--ui:last-child {
  grid-column: 1 / -1;
}

.gen-screens .gen-out__pic {
  padding: 0;
}

.gen-screens .gen-out__pic img {
  width: 100%;
  max-height: none;
}

/* The files, the prices and the agents' lines. */

ul.gen-files {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 10px 22px;
  padding: 0;
  list-style: none;
}

ul.gen-files li {
  padding-left: 14px;
  border-left: 3px solid var(--accent);
  color: var(--ink-dim);
}

ul.gen-files strong {
  color: var(--ink);
}

.gen-table {
  overflow-x: auto;
}

.gen-table table {
  min-width: 420px;
}

.gen-table thead th {
  color: var(--ink-dim);
  font-size: 0.78rem;
  font-weight: 600;
}

.gen-table tbody th {
  font-weight: 500;
}

.gen-num {
  text-align: right !important;
  font-variant-numeric: tabular-nums;
}

.gen-table td.gen-num {
  color: var(--accent);
  font-weight: 700;
}

.gen-code {
  margin: 10px 0 14px;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #01060a;
  color: var(--ink);
  font-family: var(--gen-mono);
  font-size: 0.82rem;
  line-height: 1.6;
}

.gen-code--install {
  margin-top: 0;
  font-size: 0.95rem;
}

.gen-code--install code::before {
  content: '$ ';
  color: var(--accent);
}

/* The setup prompt a maker sends their agent: a bar with Copy over the whole prompt, wrapped so
   it reads on a phone. */

.gen-prompt {
  position: relative;
  max-width: 940px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #01060a;
}

/* The copy icon in the corner; a tick for a moment once it has copied (`data-copied`). */
.gen-prompt__copy {
  position: absolute;
  top: 10px;
  right: 10px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: #01060a;
  color: var(--ink-dim);
  cursor: pointer;
}

.gen-prompt__copy:hover,
.gen-prompt__copy:focus-visible {
  color: var(--ink);
  background: var(--panel-2);
}

.gen-prompt__copy svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.gen-prompt__done,
.gen-prompt__copy[data-copied] .gen-prompt__icon {
  display: none;
}

.gen-prompt__copy[data-copied] .gen-prompt__done {
  display: block;
  color: var(--accent);
}

/* The prompt is long: it stops at a few lines and scrolls inside its box, the copy taking it whole. */
.gen-code--prompt {
  max-height: 13.5em;
  margin: 0;
  padding: 16px 54px 16px 18px;
  overflow-y: auto;
  border: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  color: var(--ink-dim);
  font-size: 0.86rem;
}

.gen-prompt__cmd {
  color: var(--accent);
}

.gen code:not(pre code) {
  font-family: var(--gen-mono);
  font-size: 0.88em;
}

.gen-guides__groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 0 28px;
}

.gen-guides .related h2 {
  margin-top: 0.8em;
  font-size: 1rem;
}

.gen-guides .related ul {
  flex-direction: column;
  gap: 6px;
}

/* The docs: their contents, each verb as a card, its line of help folded. */

.gen--docs {
  max-width: 900px;
}

.gen-doc {
  max-width: var(--measure);
}

.gen-verbs {
  display: grid;
  /* A column no wider than the page: a long command scrolls in its own block. */
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.gen-verb {
  padding: 4px 18px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.gen-verb h3 {
  margin: 0.8em 0 0.2em;
}

.gen-verb p {
  margin: 0.3em 0;
  color: var(--ink-dim);
}

.gen-verb summary {
  color: var(--ink-dim);
  font-size: 0.82rem;
  cursor: pointer;
}

.gen-help {
  font-family: var(--gen-mono);
  font-size: 0.76rem !important;
  overflow-wrap: anywhere;
}

/* A style run: its look and character, then its character's board of every facing and clip. */

.gen-runs {
  display: grid;
  gap: 34px;
}

.gen-run__cast {
  display: grid;
  grid-template-columns: minmax(0, 420px) minmax(0, 260px);
  gap: 12px;
  margin-bottom: 14px;
}

.gen-run__cast .gen-out--look img {
  width: 100%;
  max-height: none;
}

/*
 * A character's run, one panel: its name, look and front down the side, its board beside them on
 * one stage, the clips standing on it with no frame of their own.
 */
.gen-run--board {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  grid-template-areas:
    'head head'
    'side board'
    'made made';
  gap: 18px clamp(16px, 3vw, 36px);
  align-items: start;
  padding: clamp(16px, 2.6vw, 30px);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background:
    radial-gradient(
      90% 60% at 75% 10%,
      color-mix(in srgb, var(--accent) 8%, transparent),
      transparent 65%
    ),
    linear-gradient(180deg, var(--panel-2), var(--panel));
  box-shadow: 0 18px 50px rgb(0 0 0 / 0.35);
}

.gen-run__head {
  grid-area: head;
}

.gen-run__head .gen-set__name {
  margin: 0;
  font-size: 1.35rem;
}

.gen-run__side {
  grid-area: side;
}

.gen-run--board > .gen-board,
.gen-run--board > .gen-strip-wrap {
  grid-area: board;
}

.gen-run__made {
  min-width: 0;
}

.gen-run--board > .gen-run__made {
  grid-area: made;
}

.gen-run__made .gen-code {
  margin: 0;
  font-size: 0.72rem;
}

.gen-models > .gen-run__made {
  margin-top: 4px;
}

.gen-run--board .gen-run__cast {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  margin: 0;
}

.gen-run--board .gen-run__cast .gen-out {
  border-color: transparent;
  background: none;
}

.gen-run--board .gen-run__cast .gen-out__pic {
  border-radius: 14px;
}

.gen-run--board .gen-run__cast .gen-out:nth-child(2) .gen-out__pic img {
  max-height: 240px;
}

.gen-board {
  display: grid;
  grid-template-columns: 64px repeat(var(--facings), minmax(0, 1fr));
  gap: 2px 10px;
  align-items: center;
}

.gen-board__facing,
.gen-board__move {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.gen-board__facing {
  padding-bottom: 4px;
  text-align: center;
}

.gen-board__own {
  grid-column: 1 / -1;
  margin: 14px 0 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  font-size: 0.82rem;
  color: var(--ink-dim);
}

/* A clip on the stage: a soft pool of light at its feet, its frames and speed under it. */
.gen-tile {
  display: grid;
  justify-items: center;
  margin: 0;
  padding: 6px 4px 4px;
  border-radius: 14px;
  background: radial-gradient(
    60% 22% at 50% 84%,
    color-mix(in srgb, var(--accent) 16%, transparent),
    transparent 70%
  );
  transition: background-color 160ms ease;
}

.gen-tile:hover {
  background-color: color-mix(in srgb, var(--ink) 4%, transparent);
}

.gen-tile img {
  display: block;
  width: 100%;
  max-width: 260px;
  height: auto;
}

.gen-tile figcaption {
  font-size: 0.66rem;
  text-align: center;
  color: var(--ink-dim);
  opacity: 0.7;
}

.gen-tile--none {
  align-self: stretch;
  background: none;
}

.gen-grid--pair .gen-out__pic img {
  width: 100%;
  height: auto;
  max-height: none;
}

/* A scene: a looping video, its first frame instead where less motion is asked. */

.gen-out--scene {
  max-width: 900px;
  margin-inline: auto;
}

.gen-out--scene .gen-out__pic {
  padding: 0;
}

.gen-scene__video,
.gen-scene__still {
  display: block;
  width: 100%;
  height: auto;
}

.gen-scene__still {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .gen-scene__video {
    display: none;
  }

  .gen-scene__still {
    display: block;
  }
}

/* Places inside and out, two to a row. */

.gen-places {
  display: grid;
  gap: 12px;
}

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

/* The engines: a card each, works today or coming soon. */

.gen-engines {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.gen-engine {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: var(--panel);
}

.gen-engine h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  margin: 0 0 8px;
}

.gen-engine__state {
  padding: 1px 8px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--accent);
}

.gen-engine--soon .gen-engine__state {
  border-color: var(--line-soft);
  color: var(--ink-dim);
}

.gen-engine p {
  margin: 0 0 10px;
  font-size: 0.88rem;
}

@media (max-width: 1040px) {
  .gen-run--board {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'head' 'side' 'board' 'made';
  }

  .gen-run--board .gen-run__cast {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  }
}

@media (max-width: 880px) {
  .gen-hero,
  .gen-set {
    grid-template-columns: minmax(0, 1fr);
  }

  .gen-screens {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .gen-screens .gen-out--start:first-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .gen-check__groups {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }

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

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

  .gen-grid--style .gen-out--look {
    grid-column: 1 / -1;
  }

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

  .gen-run--board .gen-run__cast {
    grid-template-columns: minmax(0, 1fr);
  }

  .gen-board {
    grid-template-columns: 52px repeat(var(--facings), minmax(0, 1fr));
    gap: 4px;
  }

  .gen-board figcaption {
    display: none;
  }
}

/* The 3D characters: a panel each, its versions side by side (a lone one takes the first half), three reels a version. */

.gen-models {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
}

.gen-model {
  padding: clamp(14px, 2.4vw, 24px);
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background:
    radial-gradient(
      120% 80% at 30% 0%,
      color-mix(in srgb, var(--accent) 7%, transparent),
      transparent 60%
    ),
    var(--panel);
}

.gen-model .gen-set__name {
  margin: 0 0 10px;
}

.gen-model__versions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2vw, 28px);
}

.gen-version {
  min-width: 0;
}

.gen-version + .gen-version {
  padding-left: clamp(12px, 2vw, 28px);
  border-left: 1px solid var(--line-soft);
}

.gen-version__label {
  margin: 0 0 6px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.gen-version__reels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

@media (max-width: 720px) {
  .gen-model__versions {
    grid-template-columns: minmax(0, 1fr);
  }

  .gen-version + .gen-version {
    padding: 12px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line-soft);
  }
}

/* The scene's own files, three to a row. */

.gen-grid--three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.gen-grid--three .gen-out__pic img {
  width: 100%;
  height: auto;
  max-height: 260px;
  object-fit: contain;
}

/* A character of one facing: its clips in one row, each named over it, its own attacks marked. */

.gen-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px 10px;
}

.gen-strip__cell {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.gen-strip__cell--own .gen-board__move {
  color: var(--accent);
}

.gen-strip__own {
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: var(--ink-dim);
}

.gen-show {
  scroll-margin-top: 80px;
}

.gen-show > h2 {
  display: flex;
  align-items: center;
  gap: 14px;
  text-wrap: balance;
}

.gen-show > h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line-soft), transparent);
}

/* The sounds: a row of cards a group, each a player and the command that wrote it. */

.gen-sounds {
  display: grid;
  gap: 8px;
}

.gen-sounds__row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.gen-sound {
  display: grid;
  gap: 10px;
  align-content: start;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  font-size: 0.74rem;
  color: var(--ink-dim);
}

.gen-sound figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink);
}

.gen-sound figcaption span {
  color: var(--ink-dim);
  font-size: 0.78rem;
}

.gen-sound audio {
  width: 100%;
  height: 36px;
}

.gen-sound code {
  font-family: var(--gen-mono);
  overflow-wrap: anywhere;
}

/* The auto-rig, step by step: four numbered steps in a row, an arrow between. */

.gen-rig {
  padding: clamp(16px, 2.6vw, 28px);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background:
    radial-gradient(
      90% 70% at 50% 0%,
      color-mix(in srgb, var(--accent) 9%, transparent),
      transparent 65%
    ),
    linear-gradient(180deg, var(--panel-2), var(--panel));
}

.gen-rig__line {
  max-width: 80ch;
  margin: 0 0 18px;
  color: var(--ink-dim);
}

.gen-rig__steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.gen-rig__step {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 6px;
}

.gen-rig__step + .gen-rig__step::before {
  content: '→';
  position: absolute;
  top: 50%;
  left: -14px;
  transform: translate(-25%, -50%);
  color: var(--accent);
  font-size: 1.1rem;
}

.gen-rig__n {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

.gen-rig__say {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink);
}

.gen-rig__step .gen-out {
  border-color: transparent;
  background: none;
}

.gen-rig__step .gen-out__pic img {
  width: 100%;
  height: auto;
  max-height: 240px;
}

@media (max-width: 720px) {
  .gen-rig__steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .gen-rig__step + .gen-rig__step::before {
    display: none;
  }
}

/* A shared game's card (src/picked/card.ts), the one look the front page's carousel and Play's
   pages share: its game's screen filling the card to its edges, its title (and on Play its pitch)
   on a shade at its foot. The front page's skin dresses it with its tokens, and the estate's
   stylesheet carries it too (estate/write.ts) with the same tokens on its own root (estate.css).

   A list of cards laid out by their games' shapes is a `game-tiles` grid, a mosaic of tiles one
   height (`@tyrbo/brand/tiles`), its column half an upright phone's width at that height (the
   clip's 390 by 844): an upright phone game fills two columns at the full height (`tall`) or one
   at half of it, two stacked (`duo`), so the boxes come in two sizes; two sideways or desktop games
   (`pair`) lie stacked across four columns, each about 2 to 1 (between a desktop's 16:9 and a
   phone held sideways, cropping a sliver at most); a lone wide one (`hero`) spans eight columns at
   the full height where the list is wide enough, and elsewhere lies as half a pair at the list's
   end. Each list sets its tiles' height (`--tile-height`) and gap (`--tile-gap`), and says where a
   hero lies as half a pair: the front page's rail (picked.css), Play's grid
   (worker/src/play/document.ts). */
.game-tiles {
  --tile-column: calc((var(--tile-height) * 390 / 844 - var(--tile-gap)) / 2);

  list-style: none;
  display: grid;
  gap: var(--tile-gap);
}

.game-tiles > [data-fit] {
  display: grid;
  gap: var(--tile-gap);
  min-width: 0;
  min-height: 0;
  grid-column: span 2;
}

.game-tiles > [data-fit='duo'] {
  grid-column: span 1;
  grid-template-rows: 1fr 1fr;
}

.game-tiles > [data-fit='pair'] {
  grid-column: span 4;
  grid-template-rows: 1fr 1fr;
}

.game-tiles > [data-fit='hero'] {
  grid-column: span 8;
}

/* A small box says its title smaller. */
.game-tiles > [data-fit='duo'] .game-card__name {
  font-size: calc(17px * var(--ui-fit));
  line-height: 20px;
}

.game-tiles > [data-fit='duo'] .game-card__words {
  padding: 24px 8px 8px;
}

.game-tiles > [data-fit='duo'] .game-card__pitch {
  display: none;
}

.game-card {
  position: relative;
  display: block;
  height: 100%;
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--ink);
  overflow: hidden;
  text-decoration: none;
  box-shadow:
    0 0 0 1px var(--line-soft),
    0 6px 18px rgb(0 0 0 / 0.18);
  transition:
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.game-card:hover,
.game-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px var(--accent),
    0 10px 26px rgb(0 0 0 / 0.26);
  transform: translateY(-2px);
}

/* The game's screen, the whole card: its still and its clip each filling it. */
.game-card__screen {
  position: absolute;
  inset: 0;
  display: block;
  background: var(--panel-2);
}

.game-card__screen > * {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The clip shows over the still only while it plays; it opens on the still's frame. */
.game-card__clip {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.game-card[data-playing] .game-card__clip {
  opacity: 1;
}

/* A still that did not load keeps its place, the panel showing through. */
.game-card[data-unpictured] .game-card__screen img {
  visibility: hidden;
}

/* The title and the pitch on a shade at the card's foot: the title on one line in every skin's
   face (about the looks' names' size: 10 to 15px as each face fits), cut short with an ellipsis
   past the card; the pitch under it, two lines at most. */
.game-card__words {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  gap: 2px;
  padding: 36px 12px 10px;
  background: linear-gradient(to top, rgb(0 0 0 / 0.72), rgb(0 0 0 / 0.38) 55%, transparent);
  color: #fff;
  text-shadow: 0 1px 2px rgb(0 0 0 / 0.5);
}

.game-card__name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: var(--font-display);
  font-size: calc(24px * var(--ui-fit));
  line-height: 26px;
  letter-spacing: var(--ui-track);
  text-transform: var(--ui-case);
}

.game-card__pitch {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  font-size: 0.8rem;
  line-height: 1.35;
  opacity: 0.88;
}

/* Its plays, while a seat shows them: small, under the rest. */
.game-card__plays {
  font-size: 0.72rem;
  line-height: 1.3;
  opacity: 0.8;
}

/* A card with no still keeps its place, its words on the panel. */
.game-card[data-unpictured] .game-card__words {
  background: none;
  color: var(--ink);
  text-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .game-card,
  .game-card__clip {
    transition: none;
  }

  .game-card:hover,
  .game-card:focus-visible {
    transform: none;
  }
}
