/* CreeCade's site styles (P1 design 4 and 5). The component rules are scoped to .site (MainLayout) and .game-strip
   (GameLayout), so the games' own styles never meet them. The :root custom properties and @font-face are document-wide
   (the strip uses the tokens), and body { margin: 0 } is global (game-page.css sets the same).
   Mockups: _Docs/specs/2026-10-02-platform-p1-site-shell-mockups/. */

@font-face {
  font-family: 'Libre Baskerville';
  font-style: italic;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/libre-baskerville-700-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/libre-franklin-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/libre-franklin-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Libre Franklin';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/libre-franklin-latin-700-normal.woff2') format('woff2');
}

:root {
  --wall: #2f8a63;
  --sign: #f6c531;
  --red: #c8281e;
  --ink: #1f1f1f;
  --white: #fff;
  --rule: #e6e1d4;
  --menu-hover: #f3efe2;
  --strip-muted: #cfcbc2;
  --foot-text: #d9d6cf;
  --serif: 'Libre Baskerville', Georgia, serif;
  --sans: 'Libre Franklin', system-ui, sans-serif;
}

body {
  margin: 0;
}

.site,
.site *,
.game-strip,
.game-strip * {
  box-sizing: border-box;
}

/* The `hidden` attribute always wins over a component's own display (the install sign and pill, spec 2 §6) */
.site [hidden] {
  display: none !important;
}

.site :focus-visible,
.game-strip :focus-visible {
  outline: 3px solid var(--sign);
  outline-offset: 3px;
}

/* On a light surface (the yellow sign, white boards, the language menu) a yellow ring would vanish, so it is ink. */
.site .sign :focus-visible,
.site .install :focus-visible,
.site .get__panel :focus-visible,
.site .mode :focus-visible,
.site .paper :focus-visible,
.site .lang__menu :focus-visible {
  outline-color: var(--ink);
}

/* The page: a painted wall, with faint plank lines */
.site {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--wall) repeating-linear-gradient(90deg, rgba(0, 0, 0, .05) 0 2px, transparent 2px 46px);
  color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
}

.site a {
  color: inherit;
}

/* Top bar */
.site .bar {
  background: var(--ink);
}

.site .bar__in {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.site .bar__tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.site .brand img {
  display: block;
}

.site .brand span {
  font: italic 700 1.55rem/1 var(--serif);
  color: var(--sign);
}

/* Language menu */
.site .lang {
  position: relative;
}

.site .lang summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--sign);
  color: var(--ink);
  font: 700 .85rem/1 var(--sans);
}

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

.site .lang__chevron {
  font-size: .7rem;
}

.site .lang[open] .lang__chevron {
  transform: rotate(180deg);
}

.site .lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  min-width: 168px;
  margin: 0;
  padding: 6px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
}

.site .lang__menu button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: 4px;
  background: none;
  color: var(--ink);
  font: 600 .95rem var(--sans);
  text-align: left;
  cursor: pointer;
}

.site .lang__menu button:hover {
  background: var(--menu-hover);
}

.site .lang__menu button[aria-current="true"] {
  font-weight: 700;
}

.site .lang__menu button[aria-current="true"] i {
  color: var(--wall);
}

/* Install pill (spec 2 §6.3): outlined in sign yellow on the ink bar; on iPhone its panel is the language menu's box */
.site .get {
  position: static;
}

.site .get summary,
.site button.get {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 2px solid var(--sign);
  border-radius: 999px;
  background: none;
  color: var(--sign);
  font: 700 .85rem/1 var(--sans);
  white-space: nowrap;
}

.site .get summary::-webkit-details-marker {
  display: none;
}

.site .get__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 2;
  width: min(290px, calc(100vw - 32px));
  padding: 14px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
}

.site .get__panel p {
  margin: 0 0 10px;
  font-size: .9rem;
}

/* The person button (P2 spec §7.3): outlined in sign yellow like the install pill, filled on /profile */
.site .me {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 30px;
  border: 2px solid var(--sign);
  border-radius: 999px;
  color: var(--sign);
  font: 700 .85rem/1 var(--sans);
  text-decoration: none;
}

.site .me[aria-current="page"] {
  background: var(--sign);
  color: var(--ink);
}

/* The wall between the bar and the footer */
.site .wall-main {
  flex: 1;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 16px 40px;
}

/* Homepage: the big sign and the small signs */
.site .wall {
  display: grid;
  gap: 28px;
}

.site .sign {
  padding: 22px 20px 24px;
  background: var(--sign);
  border: 4px solid var(--ink);
  border-radius: 6px;
  box-shadow: 4px 5px 10px rgba(0, 0, 0, .22);
  transform: rotate(-1.2deg);
}

.site .sign__name {
  margin: 0;
  font: italic 700 clamp(2.4rem, 8vw, 3.9rem)/1.02 var(--serif);
  color: var(--red);
}

.site .sign__name a {
  text-decoration: none;
}

.site .sign__line {
  max-width: 30ch;
  margin: 10px 0 20px;
  font-size: 1.15rem;
  font-weight: 600;
}

.site .sign__body {
  display: grid;
  gap: 20px;
}

.site .sign__art {
  display: none;
}

.site .buttons {
  display: grid;
  gap: 10px;
}

.site .btn {
  display: block;
  padding: 14px 16px;
  border-radius: 10px;
  font: 700 1.05rem/1.2 var(--sans);
  text-align: center;
  text-decoration: none;
}

.site .btn--primary {
  background: var(--red);
  color: var(--white);
  border: 3px solid var(--ink);
  box-shadow: 0 4px 0 var(--ink);
}

.site .btn--primary:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--ink);
}

.site a.btn--primary {
  color: var(--white);
}

.site .btn--alt {
  background: var(--white);
  color: var(--ink);
  border: 3px solid var(--ink);
}

.site .howto {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-weight: 700;
  text-underline-offset: 3px;
}

.site .soon {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.site .small {
  padding: 14px 14px 16px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
  transform: rotate(.8deg);
}

.site .soon .small:nth-child(2) {
  transform: rotate(-.6deg);
}

.site .small__name {
  margin: 0;
  font: italic 700 1.35rem/1.1 var(--serif);
  color: var(--wall);
}

.site .small p {
  margin: 6px 0 10px;
  font-size: .92rem;
  line-height: 1.4;
}

.site .tag {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 4px;
  background: var(--red);
  color: var(--white);
  font: 700 .8rem/1 var(--sans);
}

/* While the install pill shows on a phone, it and the language chip share a tight bar: trim their gaps and padding so the
   bar never scrolls sideways. The pill keeps its "Install" label at every width. Below 450px (max-width 449px) the chip
   shows only its icon and arrow while the pill shows; its name stays in the page for screen readers. Below 360px
   (max-width 359px), only while the pill shows, the marble drops to 28px and the wordmark to 1.15rem and the gutters and
   paddings tighten, so the bar fits at 320px. With no pill the chip keeps its name at every width, and the bar keeps the P1
   look at every width except below 390px, where the wordmark and the gaps tighten (the rule is max-width 389px so a 390px
   phone keeps the P1 wordmark). */
@media (max-width: 420px) {
  .site .bar__in:has(.get:not([hidden])) {
    gap: 8px;
  }

  .site .bar__tools:has(.get:not([hidden])) {
    gap: 6px;
  }

  .site .bar__tools:has(.get:not([hidden])) .get summary,
  .site .bar__tools:has(.get:not([hidden])) button.get {
    gap: 5px;
    padding: 5px 9px;
  }

  .site .bar__tools:has(.get:not([hidden])) .lang summary {
    gap: 5px;
    padding: 7px 10px;
  }
}

@media (max-width: 449px) {
  .site .bar__tools:has(.get:not([hidden])) .get summary,
  .site .bar__tools:has(.get:not([hidden])) button.get {
    padding: 5px 8px;
  }

  .site .bar__tools:has(.get:not([hidden])) .lang .lang__name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/* Narrow phones: a smaller wordmark and tighter tools, so the marble, wordmark, install pill, person button and language
   pill all fit at 360px (P2 spec §7.3). */
@media (max-width: 389px) {
  .site .brand {
    gap: 8px;
  }

  .site .brand span {
    font-size: 1.3rem;
  }

  .site .bar__tools {
    gap: 6px;
  }
}

/* Very narrow phones (320px) with the pill showing: the pill label stays, so the wordmark, gutters and paddings give a little more. */
@media (max-width: 359px) {
  .site .bar__in:has(.get:not([hidden])) {
    padding-inline: 10px;
    gap: 6px;
  }

  .site .bar__in:has(.get:not([hidden])) .brand {
    gap: 6px;
  }

  .site .bar__in:has(.get:not([hidden])) .brand img {
    width: 28px;
    height: auto;
  }

  .site .bar__in:has(.get:not([hidden])) .brand span {
    font-size: 1.15rem;
  }

  .site .bar__tools:has(.get:not([hidden])) {
    gap: 4px;
  }

  .site .bar__tools:has(.get:not([hidden])) .get summary,
  .site .bar__tools:has(.get:not([hidden])) button.get {
    padding: 5px 7px;
  }

  .site .bar__tools:has(.get:not([hidden])) .lang summary {
    padding: 7px 8px;
  }
}

/* Install sign (spec 2 §6.3): a white board like the small signs, across the row on phones, under them on wide screens */
.site .install {
  grid-column: 1 / -1;
  position: relative;
  padding: 14px 14px 16px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
  transform: rotate(-.4deg);
}

.site .install__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 36px;
}

.site .install__tile {
  flex: none;
  display: block;
}

.site .install__name {
  margin: 0;
  font: italic 700 1.35rem/1.1 var(--serif);
  color: var(--wall);
}

.site .install p {
  max-width: 46ch;
  margin: 10px 0 14px;
  font-size: .92rem;
  line-height: 1.4;
}

.site .install .btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 11px 18px;
}

.site .install__close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--ink);
  font-size: 1.15rem;
  cursor: pointer;
}

.site .install__close:hover {
  background: var(--menu-hover);
}

/* iPhone's two steps: a real sequence, so numbered */
.site .steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.site .steps li {
  counter-increment: step;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .95rem;
  font-weight: 600;
}

.site .steps li::before {
  content: counter(step);
  flex: none;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font: 700 .8rem/1 var(--sans);
}

.site .steps__key {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 2px solid var(--ink);
  border-radius: 6px;
  font-weight: 700;
  white-space: nowrap;
}

@media (min-width: 520px) {
  .site .buttons {
    grid-template-columns: repeat(2, max-content);
  }

  .site .buttons .btn {
    min-width: 170px;
    white-space: nowrap;
  }
}

@media (min-width: 860px) {
  .site .install {
    padding: 18px 18px 20px;
  }

  .site .install__name {
    font-size: 1.6rem;
  }

  .site .install p {
    font-size: 1rem;
  }

  .site .wall-main {
    padding: 48px 32px 56px;
  }

  .site .wall {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
  }

  .site .sign {
    padding: 40px 44px;
  }

  .site .sign__name {
    font-size: 4.6rem;
  }

  .site .sign__line {
    margin: 14px 0 26px;
    font-size: 1.35rem;
  }

  .site .sign__body--art {
    grid-template-columns: 1fr 220px;
    align-items: end;
    gap: 28px;
  }

  .site .sign__art {
    display: block;
    width: 220px;
    height: auto;
  }

  .site .btn {
    padding: 16px 18px;
    font-size: 1.15rem;
  }

  .site .soon {
    grid-template-columns: 1fr;
    padding-top: 14px;
  }

  .site .small {
    padding: 18px 18px 20px;
  }

  .site .small__name {
    font-size: 1.6rem;
  }

  .site .small p {
    font-size: 1rem;
  }
}

@media (min-width: 860px) and (min-height: 760px) {
  .site .wall-main:has(> .wall) {
    display: flex;
    align-items: center;
  }

  .site .wall {
    width: 100%;
  }
}

/* A link on the wall above a board. White on the wall is only ever large and bold (P1 design 4.1). */
.site .crumb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 700;
  text-underline-offset: 3px;
}

.site a.crumb {
  color: var(--white);
}

/* Money Football hub */
.site .hub {
  display: grid;
  gap: 26px;
  max-width: 860px;
  margin: 0 auto;
}

.site .hub .sign__line {
  max-width: 46ch;
  font-size: 1.1rem;
  font-weight: 400;
}

.site .hub .howto {
  justify-self: start;
  margin-top: 0;
  font-size: 1.2rem;
}

.site .hub a.howto {
  color: var(--white);
}

.site .modes {
  display: grid;
  gap: 22px;
}

.site .mode {
  display: flex;
  flex-direction: column;
  padding: 18px 18px 20px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
  transform: rotate(.6deg);
}

.site .mode:nth-child(2) {
  transform: rotate(-.5deg);
}

.site .mode h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font: italic 700 1.6rem/1.1 var(--serif);
  color: var(--wall);
}

.site .mode h2 i {
  font-size: 1.1rem;
  color: var(--ink);
}

.site .mode p {
  flex: 1;
  margin: 8px 0 16px;
}

.site .mode .btn {
  align-self: start;
  min-width: 150px;
}

@media (min-width: 700px) {
  .site .modes {
    grid-template-columns: 1fr 1fr;
  }
}

/* Reading boards: how to play, legal pages. Never tilted, so long text stays easy to read. */
.site .paper {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 18px 8px;
  background: var(--white);
  border: 4px solid var(--ink);
  border-radius: 6px;
}

.site .paper__title {
  margin: 0 0 8px;
  font: italic 700 clamp(2rem, 6vw, 3rem)/1.08 var(--serif);
  color: var(--red);
}

.site .paper__lede {
  max-width: 60ch;
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.site .paper--short {
  max-width: 640px;
  padding-bottom: 28px;
}

.site .paper--short p {
  max-width: 52ch;
}

/* The offline page (spec 2 §5.5): the two game buttons sit right under the line, and a closing note follows */
.site .paper--offline .paper__foot {
  padding-top: 6px;
  border-top: 0;
}

.site .paper__note {
  margin: 0 0 22px;
  font-size: .9rem;
}

/* The daily puzzle page (daily game design 5.1): a short board holding the game, which brings its own styles
   (wwwroot/games/daily/daily.css) and draws its controls with this file's btn, field, alert and notice. */
.site .daily .paper__title {
  margin-bottom: 16px;
}

/* Once the game is drawn the board keeps its height, so nothing below it jumps between loading and the puzzle. */
.site .daily [data-creecade-game]:has(.dg) {
  min-height: 18rem;
}

/* The game host's own lines: the game could not load, or the browser has no JavaScript. On a full-screen game page
   game-page.css draws them light on dark; that file is not loaded here, so they take the look of an alert. */
.site .daily .creecade-host-error {
  margin: 0;
  padding: 8px 10px;
  background: #fbe9e7;
  border-left: 4px solid var(--red);
  font: 600 1rem/1.5 var(--sans);
  color: var(--ink);
}

.site .rule {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: start;
  padding: 20px 0;
  border-top: 2px solid var(--rule);
}

.site .rule:first-of-type {
  border-top: 0;
}

.site .rule__diagram {
  display: block;
  width: 84px;
  height: auto;
}

.site .rule h2 {
  margin: 0 0 6px;
  font: italic 700 1.3rem/1.15 var(--serif);
  color: var(--wall);
}

.site .rule p {
  max-width: 58ch;
  margin: 0;
}

.site .paper__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 18px 0 20px;
  border-top: 2px solid var(--rule);
}

/* The profile page (P2 spec §7, mockups/profile.html) */
.site .notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  padding: 8px 10px;
  background: #e3f1ea;
  border-left: 4px solid var(--wall);
  font-weight: 600;
}

.site .who {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px;
  margin: 0 0 6px;
}

.site .who__name {
  font: italic 700 clamp(2rem, 6vw, 3rem)/1.08 var(--serif);
  color: var(--red);
  overflow-wrap: anywhere;
}

.site .who__code {
  font: 700 1.3rem/1 var(--sans);
  color: var(--ink);
  opacity: .75;
}

.site .field {
  display: grid;
  gap: 6px;
  margin: 14px 0 16px;
}

.site .field label {
  font-weight: 700;
}

.site .field input {
  width: 100%;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 600 1.1rem var(--sans);
}

.site .field input[aria-invalid="true"] {
  border-color: var(--red);
}

.site .field__error {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--red);
  font-size: .95rem;
  font-weight: 700;
}

.site .field__error i {
  margin-top: 3px;
}

.site .field__hint {
  margin: 0;
  font-size: .9rem;
}

.site .profile button.btn {
  width: 100%;
  cursor: pointer;
}

/* The unsubscribe page (P6 spec 3 §8): one question, one full-width button, as the other short papers' forms. */
.site .unsubscribe button.btn {
  width: 100%;
  cursor: pointer;
}

/* Alerts on this phone (P6 spec 2 §7.4): a setting row between the nickname form and the device section */
.site .alerts {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 2px solid var(--rule);
}

.site .alerts__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
}

.site .alerts__label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: italic 700 1.2rem/1.2 var(--serif);
  color: var(--wall);
}

.site .alerts__label i {
  font-size: 1rem;
  color: var(--ink);
}

.site .alerts__note {
  margin: 0;
  overflow-wrap: anywhere;
}

/* The email row (P6 spec 3 §9) follows a visible push row as one settings group: no second rule line */
.site .alerts:not([hidden]) + .alerts--email {
  margin-top: 12px;
  padding-top: 0;
  border-top: 0;
}

/* A switch on a white board: ink outline, the knob slides right and the track turns wall green when on */
.site .switch {
  position: relative;
  flex: none;
  width: 58px;
  height: 34px;
  padding: 0;
  border: 3px solid var(--ink);
  border-radius: 17px;
  background: var(--white);
  cursor: pointer;
  transition: background-color 150ms ease-out;
}

.site .switch__knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ink);
  transition: transform 150ms ease-out;
}

.site .switch[aria-checked="true"] {
  background: var(--wall);
}

.site .switch[aria-checked="true"] .switch__knob {
  transform: translateX(24px);
  background: var(--white);
}

.site .switch:disabled {
  opacity: .6;
  cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
  .site .switch,
  .site .switch__knob {
    transition: none;
  }
}

.site .device {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 2px solid var(--rule);
}

.site .device h2 {
  margin: 0 0 6px;
  font: italic 700 1.2rem/1.2 var(--serif);
  color: var(--wall);
}

.site .device p {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
}

.site .forget summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site .forget summary::-webkit-details-marker {
  display: none;
}

.site .forget__box {
  margin-top: 10px;
  padding: 12px;
  border: 3px solid var(--red);
  border-radius: 8px;
}

.site .forget__box p {
  margin: 0 0 10px;
}

.site .btn--danger {
  background: var(--white);
  color: var(--red);
  border: 3px solid var(--red);
}

/* The sign-in pages (P3 spec §8, mockups/signin.html) */
.site .alert {
  margin: 0 0 12px;
  padding: 8px 10px;
  background: #fbe9e7;
  border-left: 4px solid var(--red);
  font-weight: 600;
}

.site .alert-message {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.site .alert-message i {
  margin-top: 3px;
  color: var(--red);
}

.site .ways {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.site .btn--way {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.site .btn--way svg {
  width: 20px;
  height: 20px;
  flex: none;
}

.site .or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
  font-weight: 700;
}

.site .or::before,
.site .or::after {
  content: "";
  flex: 1;
  border-top: 2px solid var(--rule);
}

.site .field select {
  width: 100%;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: var(--white);
  color: var(--ink);
  font: 600 1.1rem var(--sans);
}

.site .field select[aria-invalid="true"] {
  border-color: var(--red);
}

.site .field--pair {
  grid-template-columns: 1.4fr 1fr;
  column-gap: 10px;
}

.site .field--pair > label,
.site .field--pair > .field__error {
  grid-column: 1 / -1;
}

.site .field input.field__code {
  font-size: 1.5rem;
  letter-spacing: .3em;
  text-align: center;
}

.site .stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.site .stack > form {
  min-width: 0;
}

.site .stack button.btn,
.site .profile .paper__lede {
  overflow-wrap: anywhere;
}

.site .links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 16px 0 0;
}

.site .links a,
.site .link-btn {
  font: 700 1rem/1.4 var(--sans);
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site .link-btn {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.site .device > a.btn {
  margin-top: 10px;
}

.site .device > a.btn + .forget,
.site .device > form + .forget {
  margin-top: 16px;
}

@media (min-width: 640px) {
  .site .rule {
    grid-template-columns: 150px 1fr;
    gap: 28px;
    align-items: center;
  }

  .site .rule__diagram {
    width: 150px;
  }

  .site .rule h2 {
    font-size: 1.5rem;
  }
}

@media (min-width: 700px) {
  .site .paper {
    padding: 36px 40px 16px;
  }

  .site .paper--short {
    padding-bottom: 36px;
  }
}

/* Online games (P4 spec 1 §8, mockups/pages.html) */

/* Options: one choice per row. The radio inputs are there for the keyboard and the form; their labels are the segments. */
.site .pick {
  min-width: 0;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.site .pick legend {
  margin-bottom: 6px;
  padding: 0;
  font-weight: 700;
}

.site .pick__row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 10px;
}

.site .pick__row label {
  padding: 11px 6px;
  border-left: 3px solid var(--ink);
  font: 600 .95rem/1.2 var(--sans);
  text-align: center;
  cursor: pointer;
}

.site .pick__row label:first-of-type {
  border-left: 0;
}

.site .pick__row input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.site .pick__row input:checked + label {
  background: var(--sign);
  font-weight: 700;
}

.site .pick__row input:focus-visible + label {
  outline: 3px solid var(--ink);
  outline-offset: -6px;
}

.site .tick {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0 20px;
  font-weight: 700;
}

.site .tick input {
  width: 24px;
  height: 24px;
  accent-color: var(--wall);
}

.site .play button.btn {
  width: 100%;
  cursor: pointer;
}

/* The share step */
.site .link-box {
  margin: 14px 0;
  padding: 10px 12px;
  border: 3px dashed var(--ink);
  border-radius: 10px;
  font: 700 1.05rem/1.3 var(--sans);
  overflow-wrap: anywhere;
}

.site .btn--icon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.site .rules {
  margin: 0 0 4px;
  padding: 0;
  list-style: none;
  font-size: .95rem;
}

.site .rules li {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.site .rules i {
  color: var(--wall);
  font-size: .8rem;
}

/* The invite: a challenge painted on the yellow sign. Kept to a board's width on a wide screen. */
.site .sign--invite {
  max-width: 640px;
  margin: 0 auto;
  padding: 20px 18px 22px;
  transform: rotate(-.8deg);
}

.site .sign--invite .sign__name {
  font-size: clamp(2rem, 9vw, 2.6rem);
  overflow-wrap: anywhere;
}

.site .sign--invite .sign__line {
  margin: 8px 0 12px;
}

.site .sign--invite .field label {
  font-weight: 700;
}

.site .sign--invite button.btn {
  width: 100%;
  cursor: pointer;
}

/* Red on the yellow sign is only ever large (the sign's name). A nickname error here is small, so it is ink. */
.site .sign--invite .field__error {
  color: var(--ink);
}

/* Game rows: who it is against, a status line, and the row's button on the right */
.site .games {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site .games li {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 2px solid var(--rule);
}

.site .games li:first-child {
  border-top: 0;
}

.site .games__who {
  font-size: 1.05rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.site .games__code {
  font-weight: 700;
  opacity: .7;
}

.site .games__line {
  grid-column: 1;
  margin: 0;
  font-size: .9rem;
}

.site .games .btn {
  grid-row: 1 / span 2;
  grid-column: 2;
  padding: 9px 14px;
  font-size: .95rem;
}

.site .games__group {
  margin: 18px 0 0;
  font: italic 700 1.2rem/1.2 var(--serif);
  color: var(--wall);
}

.site .games__group:first-of-type {
  margin-top: 8px;
}

/* A waiting game that just started (UAT 2026-10-24 #01): game-watch.js moves its row up and tags it in sign yellow, the
   site's mark for something new. It lands once; nothing else on the list moves. */
.site .games__joined {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 0;
  padding: 3px 9px;
  border-radius: 4px;
  background: var(--sign);
  color: var(--ink);
  font-size: .85rem;
  font-weight: 700;
  animation: games-joined 320ms ease-out both;
}

@keyframes games-joined {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

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

/* Says the mark to a screen reader: the list itself is swapped silently. */
.site .games__sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Three ways to play on the big sign: the primary spans the row */
.site .buttons--three {
  grid-template-columns: 1fr 1fr;
}

.site .buttons--three .btn--primary {
  grid-column: 1 / -1;
}

/* Your games: a white board under the big sign */
.site .board {
  padding: 14px 14px 6px;
  background: var(--white);
  border: 3px solid var(--ink);
  border-radius: 6px;
}

.site .board__name {
  margin: 0 0 4px;
  font: italic 700 1.35rem/1.1 var(--serif);
  color: var(--wall);
}

.site .board__more {
  display: block;
  padding: 10px 0 8px;
  border-top: 2px solid var(--rule);
  font-weight: 700;
  text-underline-offset: 3px;
}

/* The hub's third way to play */
.site .mode:nth-child(3) {
  transform: rotate(.4deg);
}

@media (min-width: 520px) {
  .site .buttons--three {
    grid-template-columns: repeat(2, max-content);
  }
}

/* On a wide screen the big signs stack in the left-hand column with the board under them, and the small signs keep the right-hand column beside them */
@media (min-width: 860px) {
  .site .wall > .sign,
  .site .wall > .board {
    grid-column: 1;
  }

  .site .wall > .soon {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .site .wall:has(> .sign + .sign):has(> .board) > .soon {
    grid-row: 1 / span 3;
  }
}

/* Rematch (P4 spec 2 §8.5) */

/* A row whose action is a form: its button, or its two answers side by side, sits where a row's link sits */
.site .games__actions {
  grid-row: 1 / span 2;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site .games__actions form {
  margin: 0;
}

.site .games__actions button.btn {
  cursor: pointer;
  white-space: nowrap;
}

/* On a phone two answers get a line of their own under the row's words, so a long name is never squeezed */
@media (max-width: 480px) {
  .site .games__row--answer {
    grid-template-columns: 1fr;
  }

  .site .games__row--answer .games__actions {
    grid-row: auto;
    grid-column: 1;
    margin-top: 6px;
  }

  .site .games__row--answer .games__actions form {
    flex: 1;
  }

  .site .games__row--answer .games__actions button.btn {
    width: 100%;
  }
}

/* Footer */
.site .foot {
  background: var(--ink);
  color: var(--foot-text);
}

.site .foot__in {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  font-size: .9rem;
}

.site .foot a {
  color: var(--white);
  text-underline-offset: 3px;
}

.site .foot small {
  margin-left: auto;
  font-size: .85rem;
}

/* Game pages: the slim ink strip above the game (P1 design 5.3) */
.game-strip {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 0 4px;
  background: var(--ink);
  color: var(--white);
  font: 400 1rem/1 var(--sans);
}

.game-strip__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: var(--sign);
  font-size: 1.1rem;
  text-decoration: none;
}

.game-strip__back:hover {
  background: #333;
}

.game-strip img {
  display: block;
}

.game-strip__game {
  margin-left: 4px;
  font: italic 700 1.1rem/1 var(--serif);
  color: var(--sign);
  white-space: nowrap;
}

.game-strip__mode {
  margin-left: 4px;
  overflow: hidden;
  font-size: .85rem;
  color: var(--strip-muted);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* The owner's numbers page (P7 spec §6): one reading board. It borrows the pick, field, btn and notice patterns. */
.site .numbers {
  max-width: 760px;
  padding-bottom: 24px;
}

.site .numbers__dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.site .numbers__dates .field,
.site .numbers__dates input {
  min-width: 0;
}

.site .numbers__dates input {
  padding-left: 8px;
  padding-right: 8px;
  font-size: 1rem;
}

.site .numbers__form .btn {
  width: 100%;
  margin-top: 4px;
  cursor: pointer;
}

.site .numbers__caption {
  margin: 20px 0 8px;
  font-size: .95rem;
  font-weight: 600;
}

.site .numbers__table {
  width: 100%;
  border-collapse: collapse;
  font: 400 .95rem/1.3 var(--sans);
  font-variant-numeric: tabular-nums;
}

.site .numbers__table th,
.site .numbers__table td {
  padding: 8px 6px;
  border-bottom: 1px solid var(--rule);
  text-align: right;
  vertical-align: baseline;
}

.site .numbers__table thead th {
  border-bottom: 3px solid var(--ink);
  font-weight: 700;
}

.site .numbers__table tbody th[scope="row"] {
  font-weight: 400;
  text-align: left;
}

.site .numbers__group th {
  padding-top: 20px;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--rule);
  font: 700 1.05rem/1.2 var(--sans);
  text-align: left;
}

.site .numbers__table tbody:first-of-type .numbers__group th {
  border-top: 0;
}

.site .numbers__change {
  font-weight: 700;
  white-space: nowrap;
}

.site .numbers__change--up {
  color: var(--wall);
}

.site .numbers__change--down {
  color: var(--red);
}

.site .numbers__change--flat,
.site .numbers__change--none {
  color: var(--ink);
}

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

@media (max-width: 480px) {
  .site .numbers {
    padding-left: 12px;
    padding-right: 12px;
  }

  .site .numbers__table {
    font-size: .88rem;
  }

  .site .numbers__table th,
  .site .numbers__table td {
    padding: 8px 3px;
  }
}
