@import url('fonts/fonts.css');

/* Hallmark · shape: app screen · genre: playful · theme: custom, notebook and sticky notes (Pajamo design system)
 * nav: the logo and the room code · signature: sticky notes on ruled notebook paper, written in marker · states: one file per screen, every state in it
 * axes: light/marker-hand/sticky-pastels · posture: white ruled page, colour only on the notes · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E3 S4 R4 V4 · weakest: E, the look leans on texture more than on motion */
/* waive: texture budget. The owner chose paper 2 (smooth, nearly flat); the ruled lines and grain are the page itself. */
/* waive: handwriting faces. The notebook idea needs a hand; body copy is set larger to keep it readable for older players. */

/* 1. Tokens */
:root {
  color-scheme: light;
  --space-3xs: 2px;
  --space-2xs: 4px;
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  --color-paper: oklch(97.5% 0.008 95);
  --color-paper-2: oklch(92% 0.05 88);
  --color-card: oklch(99% 0.004 95);
  --color-ink: oklch(24% 0.07 265);
  --color-ink-2: oklch(30% 0.07 265);
  --color-muted: oklch(41% 0.055 265);
  --color-rule: oklch(62% 0.05 265);
  --color-line: oklch(82% 0.055 240);
  --color-margin: oklch(74% 0.14 15);
  --color-yellow: oklch(90% 0.155 92);
  --color-pink: oklch(82% 0.125 0);
  --color-green: oklch(88% 0.14 140);
  --color-blue: oklch(85% 0.08 225);
  --color-accent: oklch(76% 0.19 355);
  --color-focus: oklch(45% 0.2 265);
  --color-error: oklch(52% 0.19 27);
  --color-success: oklch(50% 0.12 150);
  --color-shade: oklch(24% 0.07 265 / 0.5);
  --color-veil: oklch(24% 0.07 265 / 0.45);

  --font-display: 'Permanent Marker', 'Comic Sans MS', cursive;
  --font-body: 'Patrick Hand', 'Comic Sans MS', cursive;
  --font-pixel: 'Silkscreen', 'Courier New', monospace;
  --font-chrome: system-ui, sans-serif;

  --text-head: 2.35rem;
  --text-name: 1.6rem;
  --text-body: 1.3rem;
  --text-small: 1.15rem;
  --text-huge: 6rem;

  --radius-note: 2px;
  --radius-drawn: 255px 15px 225px 15px / 15px 225px 15px 255px;
  --border-drawn: 3px solid var(--color-ink);
  --shadow-sticky: 0 12px 10px -9px var(--color-shade);
  --shadow-press: 4px 5px 0 var(--color-ink);

  --control: 60px;
  --measure: 30rem;
  --site-measure: 68rem;

  --ease-snap: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-micro: 120ms;
  --dur-short: 220ms;

  --z-raised: 10;
  --z-sticky: 200;
  --z-modal: 400;
  --z-toast: 500;

  /* Paper 2: smooth, nearly flat. Multiplied over the page and over every note. */
  --tooth: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='420' height='420'%3E%3Cfilter id='t' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' seed='3' stitchTiles='stitch'/%3E%3CfeDiffuseLighting surfaceScale='0.45' diffuseConstant='1.14' lighting-color='white'%3E%3CfeDistantLight azimuth='225' elevation='61'/%3E%3C/feDiffuseLighting%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23t)'/%3E%3C/svg%3E");
  --rules: repeating-linear-gradient(
    transparent 0 calc(2rem - 2px),
    var(--color-line) calc(2rem - 2px) 2rem
  );
  --margin: linear-gradient(
    90deg,
    transparent 0 0.5rem,
    var(--color-margin) 0.5rem calc(0.5rem + 2px),
    transparent calc(0.5rem + 2px)
  );
}

/* 2. Base */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html,
body {
  overflow-x: clip;
}
body {
  min-height: 100dvh;
  margin: 0;
  background: var(--tooth), var(--margin), var(--rules), var(--color-paper);
  background-blend-mode: multiply;
  color: var(--color-ink);
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}
h1,
h2,
h3 {
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  overflow-wrap: break-word;
  text-wrap: balance;
}
h1 {
  font-size: var(--text-head);
}
h2 {
  font-size: var(--text-name);
}
h3 {
  font-family: var(--font-body);
  font-size: var(--text-name);
}
p {
  margin: 0;
  text-wrap: pretty;
}
a {
  color: inherit;
  text-underline-offset: 0.16em;
}
button,
input,
select,
textarea {
  font: inherit;
}
svg {
  display: block;
}
[hidden] {
  display: none !important;
}
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.visually-hidden {
  position: absolute;
  overflow: hidden;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
}
.hint {
  color: var(--color-muted);
  font-size: var(--text-small);
}
/* The room reference: what someone tells us when they write about a bad night. A hint, never
   a headline, so it is not taken for the room code. Markup: <p class="hint ref">Room reference
   <b class="ref__id">R-7F3K2Q</b>. If you write to us, tell us this.</p>
   One press selects the whole reference, to copy it. */
.ref__id {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  -webkit-user-select: all;
  user-select: all;
}
.stack {
  display: grid;
  gap: var(--space-md);
}
.stack--tight {
  gap: var(--space-xs);
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}
.center {
  justify-items: center;
  text-align: center;
}

/* Something the owner has not decided yet (a price, an address). Never ship one of these. */
.todo {
  padding: 0 0.25em;
  border: 1px dashed var(--color-muted);
  color: var(--color-muted);
}

/* 3. Shells */
.room {
  display: grid;
  gap: var(--space-lg);
  align-content: start;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-md) var(--space-md) var(--space-xl);
}
.bar {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;
}
.code-pill {
  padding: var(--space-2xs) var(--space-sm);
  border: 2px solid var(--color-ink);
  border-radius: var(--radius-drawn);
  background: var(--color-card);
  font-size: var(--text-small);
  font-variant-numeric: tabular-nums;
}

/* 4. The logo. Markup: an <a class="pj-logo"> holding <span class="pj-logo__name">Pajamo</span>.
   pajamo.js adds the two notes behind and the pixel controller. Without script it is the name on a yellow note. */
.pj-logo {
  position: relative;
  display: inline-block;
  color: var(--color-ink);
  font-size: 1.05rem;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}
.pj-logo > .pj-logo__name,
.pj-logo__face {
  position: relative;
  z-index: 1;
  display: inline-grid;
  gap: 0.3em;
  justify-items: center;
  padding: 0.5em 0.7em 0.55em;
  background: var(--tooth), var(--color-yellow);
  background-blend-mode: multiply;
  box-shadow: var(--shadow-sticky);
  rotate: -3deg;
}
.pj-logo--wide .pj-logo__face {
  grid-auto-flow: column;
  gap: 0.5em;
  align-items: center;
}
.pj-logo__under {
  position: absolute;
  inset: 0;
  background: var(--tooth), var(--color-pink);
  background-blend-mode: multiply;
  box-shadow: var(--shadow-sticky);
  rotate: 3deg;
  translate: 0.24em 0.16em;
}
.pj-logo__under--blue {
  background: var(--tooth), var(--color-blue);
  rotate: -8deg;
  translate: -0.2em 0.2em;
}
.pj-logo__name {
  font-family: var(--font-pixel);
  font-size: 1em;
  font-weight: 700;
  text-shadow: 0.07em 0.07em 0 var(--color-accent);
  text-transform: uppercase;
}
.pj-logo__pad {
  width: 5.2em;
  height: 2.925em;
  filter: drop-shadow(0.1em 0.1em 0 var(--color-accent));
  shape-rendering: crispEdges;
}
.pj-logo--wide .pj-logo__pad {
  width: 2.6em;
  height: 1.46em;
}
.pj-logo--big {
  font-size: 2.6rem;
}
.pj-logo--icon .pj-logo__name {
  display: none;
}
.px-k {
  fill: var(--color-ink);
}
.px-w {
  fill: var(--color-card);
}
.px-y {
  fill: var(--color-yellow);
}
.px-p {
  fill: var(--color-accent);
}
.px-b {
  fill: var(--color-blue);
}

/* 5. Sticky notes */
.sticky {
  --swatch: var(--color-yellow);
  display: grid;
  gap: var(--space-xs);
  padding: var(--space-lg);
  border-radius: var(--radius-note);
  background: var(--tooth), var(--swatch);
  background-blend-mode: multiply;
  box-shadow: var(--shadow-sticky);
  rotate: -2deg;
}
.sticky--pink {
  --swatch: var(--color-pink);
}
.sticky--green {
  --swatch: var(--color-green);
}
.sticky--blue {
  --swatch: var(--color-blue);
}
.sticky--white {
  --swatch: var(--color-card);
}
.sticky--kraft {
  --swatch: var(--color-paper-2);
}
.sticky--flat {
  rotate: none;
}
.sticky--tilt {
  rotate: 1.5deg;
}

/* 6. Players */
.tags {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tag {
  --swatch: var(--color-pink);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  justify-content: space-between;
  min-height: var(--control);
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-note);
  background: var(--tooth), var(--swatch);
  background-blend-mode: multiply;
  box-shadow: var(--shadow-sticky);
  rotate: -1.6deg;
}
.tag:nth-child(even) {
  rotate: 1.3deg;
}
.tag:nth-child(3n) {
  rotate: -0.7deg;
}
.tag:nth-child(4n + 2),
.tag.tag--green {
  --swatch: var(--color-green);
}
.tag:nth-child(4n + 3),
.tag.tag--blue {
  --swatch: var(--color-blue);
}
.tag:nth-child(4n + 4),
.tag.tag--yellow {
  --swatch: var(--color-yellow);
}
.tag.tag--pink {
  --swatch: var(--color-pink);
}
.tag__name {
  overflow: hidden;
  min-width: 0;
  font-size: var(--text-name);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag__marks {
  display: flex;
  flex: none;
  gap: var(--space-xs);
}
.tag--you {
  box-shadow:
    inset 0 0 0 3px var(--color-ink),
    var(--shadow-sticky);
}
.tag--away {
  opacity: 0.6;
}
.tag--empty,
.tag--empty:nth-child(n) {
  justify-content: center;
  border: 2px dashed var(--color-rule);
  border-radius: var(--radius-drawn);
  background: none;
  box-shadow: none;
  color: var(--color-muted);
  rotate: none;
}
.tags--small {
  display: flex;
  flex-wrap: wrap;
}
.tags--small .tag {
  min-height: 44px;
}
.tags--small .tag__name {
  font-size: var(--text-body);
}
.mark {
  padding: var(--space-2xs) var(--space-sm);
  border-radius: var(--radius-drawn);
  background: var(--color-card);
  box-shadow: inset 0 0 0 2px var(--color-ink);
  font-size: var(--text-small);
}
.mark--host {
  background: var(--color-ink);
  color: var(--color-card);
}
.mark--you {
  background: none;
  box-shadow: none;
  text-decoration: underline wavy;
}
.mark--away {
  background: none;
  box-shadow: inset 0 0 0 2px var(--color-rule);
  color: var(--color-muted);
}

/* 7. Controls */
.btn {
  display: flex;
  gap: var(--space-xs);
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: var(--control);
  padding: 0 var(--space-lg);
  border: var(--border-drawn);
  border-radius: var(--radius-drawn);
  background: var(--tooth), var(--color-card);
  background-blend-mode: multiply;
  box-shadow: var(--shadow-press);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-name);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition:
    translate var(--dur-micro) var(--ease-snap),
    box-shadow var(--dur-micro) var(--ease-snap);
}
.btn--primary {
  background: var(--tooth), var(--color-accent);
}
.btn--yellow {
  background: var(--tooth), var(--color-yellow);
}
.btn--small {
  width: auto;
  min-height: 44px;
  padding-inline: var(--space-md);
  font-size: var(--text-body);
}
.btn--quiet {
  width: auto;
  min-height: 44px;
  padding-inline: var(--space-xs);
  border: 0;
  background: none;
  box-shadow: none;
  font-family: var(--font-body);
  font-size: var(--text-body);
  text-decoration: underline;
}
.btn--danger {
  color: var(--color-error);
}
.btn:hover {
  translate: -1px -2px;
}
.btn:active {
  box-shadow: 1px 1px 0 var(--color-ink);
  translate: 3px 4px;
}
.btn--quiet:hover,
.btn--quiet:active {
  box-shadow: none;
  translate: none;
}
.btn:disabled,
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  translate: none;
}
.btn[aria-busy='true'] {
  cursor: progress;
}
.field {
  display: grid;
  gap: var(--space-xs);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: var(--control);
  padding: var(--space-xs) var(--space-md);
  border: var(--border-drawn);
  border-radius: var(--radius-drawn);
  background: var(--color-card);
  color: var(--color-ink);
  font-size: var(--text-name);
}
.field textarea {
  min-height: 9rem;
  border-radius: var(--radius-note);
  font-size: var(--text-body);
}
.field [aria-invalid] {
  border-color: var(--color-error);
}
.field__help {
  min-height: 1lh;
  color: var(--color-muted);
  font-size: var(--text-small);
}
.field__help--error {
  color: var(--color-error);
}
/* A big either-or choice: play or watch, pick a team, pick a plan */
.choices {
  display: grid;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  border: 0;
}
.choice {
  position: relative;
  display: grid;
  gap: var(--space-2xs);
  min-height: var(--control);
  padding: var(--space-sm) var(--space-md);
  border: var(--border-drawn);
  border-radius: var(--radius-drawn);
  background: var(--tooth), var(--color-card);
  background-blend-mode: multiply;
  cursor: pointer;
}
.choice input {
  position: absolute;
  opacity: 0;
}
.choice:has(input:checked) {
  background: var(--tooth), var(--color-yellow);
  box-shadow: var(--shadow-press);
}
.choice:has(input:focus-visible) {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.choice:has(input:disabled) {
  opacity: 0.5;
  cursor: not-allowed;
}
.choice__title {
  font-family: var(--font-display);
  font-size: var(--text-name);
}

/* 8. The room code as letter tiles: six letters in two groups of three ("KFT MQZ") */
.tiles {
  display: flex;
  gap: var(--space-xs);
  margin: 0;
  padding: 0;
  list-style: none;
}
.tiles li {
  --swipe: var(--color-yellow);
  display: grid;
  flex: 1;
  place-items: center;
  max-width: 5rem;
  aspect-ratio: 1;
  border: var(--border-drawn);
  border-radius: var(--radius-drawn);
  background:
    var(--tooth), linear-gradient(transparent 56%, var(--swipe) 56% 88%, transparent 88%),
    var(--color-card);
  background-blend-mode: multiply;
  font-family: var(--font-display);
  font-size: var(--text-head);
  rotate: -4deg;
}
.tiles li:nth-child(even) {
  rotate: 3deg;
  translate: 0 6px;
}
.tiles li:nth-child(2) {
  --swipe: var(--color-pink);
}
.tiles li:nth-child(3) {
  --swipe: var(--color-green);
}
.tiles li:nth-child(4) {
  --swipe: var(--color-blue);
}
.tiles--big li {
  max-width: 7rem;
  font-size: 3.6rem;
}
/* Two groups of three: six tiles in one row, and a gap before the fourth that reads as the
   space in "KFT MQZ". Markup: <ul class="tiles tiles--groups"> with class="tiles__gap" on the
   fourth <li>. A TV code's six digits (T1) are set the same way. */
.tiles--groups {
  gap: var(--space-2xs);
}
.tiles--groups li {
  font-size: clamp(1.4rem, 7vw, 2.1rem);
}
.tiles--groups .tiles__gap {
  margin-inline-start: var(--space-md);
}
.tiles--groups li:nth-child(5) {
  --swipe: var(--color-pink);
}
.tiles--groups li:nth-child(6) {
  --swipe: var(--color-green);
}
.tiles--big.tiles--groups li {
  font-size: clamp(1.9rem, 9.5vw, 3.6rem);
}
/* Placeholder for the scan square until the real one is generated */
.scan {
  display: grid;
  place-items: center;
  width: 100%;
  max-width: 14rem;
  aspect-ratio: 1;
  padding: var(--space-md);
  border: 2px dashed var(--color-muted);
  background: var(--color-card);
  color: var(--color-muted);
  font-size: var(--text-small);
  text-align: center;
}

/* 9. Messages */
.banner {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border: var(--border-drawn);
  border-radius: var(--radius-drawn);
  background: var(--tooth), var(--color-blue);
  background-blend-mode: multiply;
}
.banner--warn {
  background: var(--tooth), var(--color-yellow);
}
.banner--error {
  background: var(--tooth), var(--color-pink);
}
.toast {
  position: fixed;
  z-index: var(--z-toast);
  right: var(--space-md);
  bottom: var(--space-lg);
  left: var(--space-md);
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-drawn);
  background: var(--color-ink);
  color: var(--color-card);
  text-align: center;
}
.has-states .toast {
  bottom: 4rem;
}
/* A sheet that rises from the bottom of the phone: the room menu, confirmations */
.veil {
  position: fixed;
  z-index: var(--z-modal);
  inset: 0;
  display: grid;
  align-items: end;
  background: var(--color-veil);
}
.drawer {
  display: grid;
  gap: var(--space-md);
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
  border-top: var(--border-drawn);
  background: var(--tooth), var(--color-paper);
  background-blend-mode: multiply;
}
.has-states .drawer {
  padding-bottom: 4.5rem;
}

/* 10. Play */
.count {
  font-family: var(--font-display);
  font-size: var(--text-huge);
  line-height: 1;
  text-align: center;
}
.score {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: var(--space-md);
  align-items: center;
  text-align: center;
}
.score__side {
  display: grid;
  gap: var(--space-2xs);
}
.score__num {
  font-family: var(--font-display);
  font-size: 4rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.teams {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}
.team {
  display: grid;
  gap: var(--space-sm);
  align-content: start;
}
/* The controller: one thumb, one slider. Fills the screen below the bar. */
.pad {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 60dvh;
  border: var(--border-drawn);
  border-radius: var(--radius-note);
  background: var(--tooth), var(--color-yellow);
  background-blend-mode: multiply;
  touch-action: none;
}
.pad__thumb {
  width: 7rem;
  height: 7rem;
  border: var(--border-drawn);
  border-radius: 50%;
  background: var(--color-accent);
  box-shadow: var(--shadow-press);
}
.pad__label {
  position: absolute;
  bottom: var(--space-md);
  color: var(--color-ink-2);
}
/* The game picture on the big screen and in the how-to-play card: a placeholder court */
.court {
  position: relative;
  aspect-ratio: 16 / 9;
  border: var(--border-drawn);
  background: var(--tooth), var(--color-card);
  background-blend-mode: multiply;
}
.court::before {
  content: '';
  position: absolute;
  inset: 0 50% 0 auto;
  border-right: 3px dashed var(--color-rule);
}
.court__paddle {
  position: absolute;
  top: 38%;
  left: 4%;
  width: 2.2%;
  height: 26%;
  background: var(--color-accent);
}
.court__paddle--far {
  top: 52%;
  right: 4%;
  left: auto;
  background: var(--color-blue);
}
.court__ball {
  position: absolute;
  top: 44%;
  left: 58%;
  width: 3%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--color-ink);
}

/* 11. The public site and the host account */
.site {
  display: grid;
  gap: var(--space-2xl);
  width: 100%;
  max-width: var(--site-measure);
  margin-inline: auto;
  padding: var(--space-md) var(--space-lg) var(--space-3xl);
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  align-items: center;
  justify-content: space-between;
}
.site-nav__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-nav__links a[aria-current] {
  text-decoration: underline wavy;
}
.hero {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: var(--space-xl);
  align-items: center;
}
.hero h1 {
  font-size: clamp(2.6rem, 5.2vw, 4.4rem);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
}
.hero__actions .btn {
  width: auto;
}
.section {
  display: grid;
  gap: var(--space-lg);
}
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
}
.game-card {
  display: grid;
  gap: var(--space-xs);
  align-content: start;
  color: inherit;
  text-decoration: none;
}
.game-card:nth-child(even) {
  rotate: 1.2deg;
}
.game-card--locked {
  opacity: 0.75;
}
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
  gap: var(--space-lg);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
}
.steps li::before {
  content: counter(step);
  font-family: var(--font-display);
  font-size: var(--text-head);
}
.price {
  font-family: var(--font-display);
  font-size: 3rem;
  line-height: 1;
}
.faq {
  display: grid;
  gap: var(--space-sm);
}
.faq details {
  padding: var(--space-sm) var(--space-md);
  border: var(--border-drawn);
  border-radius: var(--radius-drawn);
  background: var(--color-card);
}
.faq summary {
  font-size: var(--text-name);
  cursor: pointer;
}
.prose {
  display: grid;
  gap: var(--space-md);
  max-width: 40rem;
}
.site-foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  justify-content: space-between;
  padding-top: var(--space-lg);
  border-top: 2px dashed var(--color-rule);
  font-size: var(--text-small);
}
.site-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin: 0;
  padding: 0;
  list-style: none;
}
/* The account area: one narrow column, like the room */
.account {
  display: grid;
  gap: var(--space-lg);
  align-content: start;
  width: 100%;
  max-width: 44rem;
  margin-inline: auto;
  padding: var(--space-md) var(--space-md) var(--space-3xl);
}
.rows {
  display: grid;
  margin: 0;
}
.rows > div {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs) var(--space-md);
  justify-content: space-between;
  padding: var(--space-sm) 0;
  border-bottom: 2px dashed var(--color-rule);
}
.rows dt {
  color: var(--color-muted);
}
.rows dd {
  margin: 0;
}

/* 12. Big screen: read from across the room. Put class="tv" on the html element. */
.tv {
  font-size: clamp(16px, 1.25vw, 40px);
}
.tv .screen {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--space-xl) var(--space-2xl);
  width: 100%;
  max-width: 100rem;
  min-height: 100dvh;
  margin-inline: auto;
  padding: var(--space-xl) var(--space-2xl);
}
.tv .screen--one {
  grid-template-columns: minmax(0, 1fr);
}
.tv .bar {
  grid-column: 1 / -1;
}
.tv .pj-logo {
  font-size: 1.7rem;
}
.tv h1 {
  max-width: 11ch;
  font-size: 5.25rem;
  line-height: 1.05;
}
.tv .screen--one h1 {
  max-width: none;
}
.tv h2 {
  font-size: 2.5rem;
}
.tv .col {
  display: grid;
  gap: var(--space-xl);
  align-content: center;
}
.tv .join__ways {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: var(--space-lg);
  align-items: center;
}
.tv .tiles li {
  flex: none;
  width: 4.75rem;
  font-size: 3rem;
}
.tv .tag {
  min-height: 5.5rem;
  padding-inline: var(--space-lg);
}
.tv .tag__name {
  font-size: 2.75rem;
}
.tv .mark,
.tv .hint,
.tv .code-pill {
  font-size: 1.5rem;
}
.tv .hint {
  color: var(--color-ink-2);
}
.tv .score__num {
  font-size: 9rem;
}
.tv .count {
  font-size: 14rem;
}

/* 13. Review chrome: the strip that switches between the states of a screen. Not part of the product. */
.state-bar {
  position: fixed;
  z-index: var(--z-toast);
  right: 0;
  bottom: 0;
  left: 0;
  display: flex;
  gap: var(--space-xs);
  overflow-x: auto;
  padding: var(--space-xs);
  background: var(--color-ink);
  font-family: var(--font-chrome);
  font-size: 0.8rem;
}
.state-bar a {
  flex: none;
  padding: var(--space-2xs) var(--space-xs);
  border-radius: 4px;
  color: var(--color-card);
  text-decoration: none;
}
.state-bar a[aria-current] {
  background: var(--color-yellow);
  color: var(--color-ink);
}
.has-states body {
  padding-bottom: 3rem;
}
.has-states [data-state]:not(.is-shown) {
  display: none;
}

@media (max-width: 48rem) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }
  .site {
    gap: var(--space-xl);
    padding-inline: var(--space-md);
  }
}
@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
  .btn:hover,
  .btn:active {
    translate: none;
  }
}

/* 14. Fixes found while building the screens */
a.code-pill {
  text-decoration: none;
}
/* A colour asked for by name beats the colour a tag gets from its place in the list */
.tags .tag.tag--pink {
  --swatch: var(--color-pink);
}
.tags .tag.tag--green {
  --swatch: var(--color-green);
}
.tags .tag.tag--blue {
  --swatch: var(--color-blue);
}
.tags .tag.tag--yellow {
  --swatch: var(--color-yellow);
}
:is(h1, h2, h3, .price) .todo {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: 1.4;
}
.veil {
  overflow-y: auto;
}
.hero--top {
  align-items: start;
}
/* Dashed outlines are filled with plain paper so the ruled lines do not run through them */
.tag--empty,
.tag--empty:nth-child(n),
.todo {
  background: var(--tooth), var(--color-paper);
  background-blend-mode: multiply;
}

/* 15. Second pass, shared fixes */
/* On the big screen the type scales with the screen, so the spacing must too */
.tv {
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;
  --space-2xl: 3.5rem;
}
.has-states.tv .screen {
  min-height: calc(100dvh - 3rem);
}
/* The handwriting face draws a tiny @, so e-mail addresses are set in a plain face */
.field input[type='email'],
.email {
  font-family: var(--font-chrome);
  font-size: var(--text-body);
}
/* A tick box with its sentence */
.check {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
}
.check input {
  flex: none;
  width: 1.75rem;
  height: 1.75rem;
  margin: 0.1em 0 0;
  accent-color: var(--color-ink);
}
/* Three small notes that hop in turn while something is working: the logo's yellow, pink
   and blue. The markup is unchanged (three spans in .dots). The space above them is theirs,
   so a hop never touches the line before. Under reduced motion they sit still. */
.dots {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  padding: var(--space-lg) 0 var(--space-xs);
}
.dots span {
  width: 1.5rem;
  height: 1.5rem;
  /* The ink edge keeps each one visible on a note of its own colour. */
  border: 2px solid var(--color-ink);
  background: var(--tooth), var(--color-yellow);
  background-blend-mode: multiply;
  box-shadow: var(--shadow-sticky);
  rotate: -3deg;
  animation: note-hop 1.2s ease-in-out infinite;
}
.dots span:nth-child(2) {
  background: var(--tooth), var(--color-pink);
  rotate: 4deg;
  animation-delay: 0.15s;
}
.dots span:nth-child(3) {
  background: var(--tooth), var(--color-blue);
  rotate: -5deg;
  animation-delay: 0.3s;
}
@keyframes note-hop {
  0%,
  60%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  30% {
    transform: translateY(-1.1rem) rotate(8deg);
  }
}
.cards--fit {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}
.narrow {
  max-width: var(--measure);
}
@media (max-width: 48rem) {
  .site-nav {
    gap: var(--space-xs) var(--space-md);
  }
  .site-nav__links {
    gap: var(--space-sm);
    font-size: var(--text-small);
  }
}
@media (prefers-reduced-motion: reduce) {
  .dots span {
    animation: none;
  }
}
/* Empty seats are yellow (owner, 2026-11-29); the dashed outline still marks them as open */
.tag--empty,
.tag--empty:nth-child(n) {
  background: var(--tooth), var(--color-yellow);
  color: var(--color-ink-2);
}

/* 16. Bare mode: the screen as the product shows it, with no review strip (the previewer uses ?bare=1) */
.is-bare body {
  padding-bottom: 0;
}
.is-bare .toast {
  bottom: var(--space-lg);
}
.is-bare .drawer {
  padding-bottom: var(--space-xl);
}
.is-bare.tv .screen {
  min-height: 100dvh;
}

/* 17. One controller for phone, tablet and laptop. The room column widens on bigger screens,
   the pad never grows past a comfortable reach, and the keyboard hint shows only where a
   keyboard and a fine pointer are likely. */
.pad {
  max-height: 30rem;
  cursor: grab;
}
.keys-hint {
  display: none;
}
@media (min-width: 48rem) {
  .room {
    --measure: 40rem;
    padding-top: var(--space-lg);
  }
  .pad__thumb {
    width: 8rem;
    height: 8rem;
  }
}
@media (hover: hover) and (pointer: fine) {
  .keys-hint {
    display: block;
  }
}
.pad__label {
  text-align: center;
}

/* 18. Findings from the Hallmark lint: figures that line up, and the browser's own parts in the palette */
:root {
  --color-accent-ink: var(--color-ink);
  caret-color: var(--color-ink);
  scrollbar-color: var(--color-rule) var(--color-paper);
}
::selection {
  background: var(--color-yellow);
  color: var(--color-ink);
}
.count,
.price,
.score__num {
  font-variant-numeric: tabular-nums;
}
.btn--primary {
  color: var(--color-accent-ink);
}
