/* The one place colours, faces and sizes are written; every other rule refers to these. DESIGN.md mirrors this block. */
:root {
  --bg: #f6f4fb;
  --surface: #ffffff;
  --well: #ebe8f4;
  --tray: #e4e0f0;
  --hole: #d9d4e8;
  --line: #dfdbeb;
  --ink: #221a3a;
  --ink-2: #554e6e;
  --ink-3: #6f6889;
  --accent: #4b32e0;
  --accent-hi: #3a23c2;
  --accent-soft: #ece8ff;
  --danger: #c0283f;
  /* The one dark band in the article (How to Play). */
  --night: var(--ink);
  --night-ink: var(--bg);
  --night-ink-2: var(--foot-text);
  --night-ink-3: var(--foot-dim);
  --night-line: rgb(255 255 255 / 0.13);
  --night-tray: rgb(255 255 255 / 0.07);
  --night-hole: rgb(255 255 255 / 0.06);
  --focus: #4b32e0;
  /* Tile colour by number. --lv is the power of two (1 → 0, 2 → 1, 4 → 2 …). Each doubling turns the hue 36°
     (violet, blue, sky, mint, green, lime, apricot, coral, rose, orchid) and gets a little darker and stronger,
     so 512 stays clearly apart from 1 although their hues meet again. */
  --tile-h0: 290;
  --tile-step: 36;
  --tile-l0: 0.89;
  --tile-l-step: 0.021;
  --tile-c0: 0.085;
  --tile-c-step: 0.009;
  --tile-ink-l: 0.27;

  --f-display: "Bricolage Grotesque", ui-sans-serif, system-ui, sans-serif;
  --f-word: "Outfit", ui-sans-serif, system-ui, sans-serif;
  --f-body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
  --r: 12px;
  --r-tile: 14px;
  --shadow-1: 0 1px 2px rgb(34 26 58 / 0.08);
  --shadow-2: 0 1px 2px rgb(34 26 58 / 0.05), 0 12px 32px -8px rgb(34 26 58 / 0.14);
  --shadow-lift: 0 10px 18px -6px rgb(34 26 58 / 0.35);
  --shadow-drag: 0 18px 30px -10px rgb(34 26 58 / 0.45);
  --shadow-win: 0 18px 36px -10px rgb(34 26 58 / 0.45);
  --on-accent: #ffffff;
  --foot-text: var(--hole);
  --foot-dim: #bdb8d3;
  --foot-faint: #a7a2bf;
  --foot-rule: rgb(255 255 255 / 0.12);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --wrap: 1120px;
  --read: 720px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--s7); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 var(--f-body);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--ink); }
h1, h2, h3 { font-family: var(--f-word); line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; margin: 0; }
h1 { font-size: 46px; font-weight: 700; line-height: 1.05; }
h2 { font-size: 40px; font-weight: 700; line-height: 1.1; }
h3 { font-size: 22px; font-weight: 600; }
p { margin: 0 0 var(--s4); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hi); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
button { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
table { font-variant-numeric: tabular-nums; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--s5); }
.skip { position: absolute; left: var(--s4); top: -64px; background: var(--ink); color: var(--on-accent); padding: var(--s2) var(--s4); border-radius: var(--r); z-index: 10; }
.skip:focus { top: var(--s4); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s5);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: 16px; text-decoration: none; color: var(--ink); cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, transform 0.15s var(--ease-out);
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn-main { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-main:hover { background: var(--accent-hi); border-color: var(--accent-hi); color: var(--on-accent); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  h1 { font-size: 30px; }
  h2 { font-size: 30px; }
  h3 { font-size: 18px; }
  .wrap { padding: 0 var(--s4); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Header, footer and the plain-text pages (privacy, terms, contact). */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; min-height: 60px; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; gap: var(--s2); font: 700 21px/1 var(--f-word); letter-spacing: -0.02em; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-tld { color: var(--accent); }
.foot .brand-tld { color: var(--foot-dim); }
/* The mark: one tile sliding onto another, the move the whole game is made of. */
.brand-mark { width: 30px; height: 30px; overflow: visible; }
.brand-mark .m-back { fill: oklch(0.8 0.11 254); }
.brand-mark .m-front { fill: var(--accent); stroke: var(--bg); stroke-width: 2.5; }
.brand-mark .m-spark { fill: var(--on-accent); }
.foot .brand-mark .m-front { stroke: var(--ink); }
.top-nav { display: flex; gap: var(--s5); }
.top-nav a { color: var(--ink-2); font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.top-nav a:hover { color: var(--ink); }

.foot { margin-top: var(--s8); background: var(--ink); color: var(--foot-text); }
.foot-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: var(--s6) var(--s7); padding-top: var(--s7); padding-bottom: var(--s6); }
.foot .brand { color: var(--on-accent); margin-bottom: var(--s3); }
.foot-about p { max-width: 46ch; font-size: 15px; color: var(--foot-dim); }
.foot-col { display: grid; gap: var(--s2); align-content: start; justify-items: start; }
.foot-h { margin: 0 0 var(--s1); font: 600 14px/1.3 var(--f-word); color: var(--foot-faint); }
.foot-col a { color: var(--on-accent); font-size: 15px; text-decoration: none; }
.foot-col a:hover { color: var(--on-accent); text-decoration: underline; text-underline-offset: 3px; }
.foot-legal { grid-column: 1 / -1; margin: 0; padding-top: var(--s4); border-top: 1px solid var(--foot-rule); font-size: 14px; color: var(--foot-faint); }

.doc { max-width: calc(var(--read) + 2 * var(--s5)); padding-top: var(--s7); }
.doc h1 { margin-bottom: var(--s3); }
/* Each plain page opens with its "Last updated" line; it reads as a note under the H1. */
.doc .prose > p:first-child { margin-bottom: var(--s6); font-size: 15px; color: var(--ink-3); }
.doc .prose h2 { font-size: 28px; margin: var(--s7) 0 var(--s3); }
.prose h2 { font-size: 28px; margin: var(--s6) 0 var(--s3); }
@media (min-width: 1024px) { .doc { font-size: 18px; } }
.prose h3 { margin: var(--s5) 0 var(--s2); }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 var(--s4); }
.prose li { margin-bottom: var(--s2); }
.prose li::marker { color: var(--ink-3); }
.lost { text-align: left; padding-bottom: var(--s7); }

@media (max-width: 640px) {
  .top-nav { gap: var(--s3); }
  .top-nav a { font-size: 14px; }
  .brand { font-size: 18px; }
  .brand-mark { width: 26px; height: 26px; }
  .foot-in { grid-template-columns: 1fr 1fr; }
  .foot-about { grid-column: 1 / -1; }
  .doc { padding-top: var(--s6); }
}
@media (max-width: 360px) {
  .top-nav { gap: var(--s2); }
  .top-nav a { font-size: 13px; }
  .brand { font-size: 16px; gap: 6px; }
}

/* The board. A tile paints itself from --lv, the number's power of two; see the tile tokens in 10-base.css.
   Drag position uses the `translate` property and effects use keyframed `transform`, so they never cancel each other. */
.sb-tile, .rules li, .thumb i, .chain i {
  --l: calc(var(--tile-l0) - var(--lv, 0) * var(--tile-l-step));
  --c: calc(var(--tile-c0) + var(--lv, 0) * var(--tile-c-step));
  --h: calc(var(--tile-h0) - var(--lv, 0) * var(--tile-step));
  --face: oklch(var(--l) var(--c) var(--h));
  --face-top: oklch(calc(var(--l) + 0.035) calc(var(--c) - 0.01) var(--h));
  --edge: oklch(calc(var(--l) - 0.12) calc(var(--c) + 0.02) var(--h));
  --digit: oklch(var(--tile-ink-l) calc(var(--c) * 0.9) var(--h));
}

.sb-game {
  --gap: 10px;
  --pad: 20px;
  position: relative;
  width: 100%;
  background: var(--surface);
  border-radius: 24px;
  padding: var(--pad);
  box-shadow: var(--shadow-2);
}
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); height: 44px; }
.sb-tabs { display: inline-flex; padding: var(--s1); background: var(--well); border-radius: 999px; }
.sb-tab {
  min-height: 36px; padding: 0 var(--s4); border: 0; border-radius: 999px; background: transparent;
  font-weight: 600; font-size: 15px; color: var(--ink-2); cursor: pointer; transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.sb-tab:hover { color: var(--ink); }
.sb-tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.sb-clock {
  min-width: 64px; padding: 0 var(--s3); height: 36px; display: grid; place-items: center;
  border-radius: 999px; background: var(--well);
  font: 600 18px/1 var(--f-display); font-variant-numeric: tabular-nums; color: var(--ink);
}
.sb-sub { display: flex; align-items: center; height: 36px; margin: var(--s2) 0 var(--s3); }
.sb-chip { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sb-chip.is-done { color: var(--accent); }
.sb-chip[hidden], .sb-sizes[hidden] { display: none; }
.sb-sizes { display: flex; gap: var(--s2); }
.sb-size {
  min-height: 32px; padding: 0 var(--s3); border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
.sb-size:hover { border-color: var(--ink-3); color: var(--ink); }
.sb-size[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--on-accent); }

/* The tray the tiles sit in. Its padding equals the gap, so every cell has the same frame. */
.sb-stage { position: relative; container-type: inline-size; }
.sb-board {
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  grid-template-rows: repeat(var(--n), minmax(0, 1fr));
  gap: var(--gap);
  padding: var(--gap);
  aspect-ratio: 1;
  border-radius: 18px;
  background: var(--tray);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.sb-cell, .sb-board > i { position: relative; border-radius: var(--r-tile); background: var(--hole); box-shadow: inset 0 2px 3px rgb(34 26 58 / 0.1); }
.sb-cell { display: grid; }

.sb-tile {
  position: relative;
  display: grid; place-items: center;
  width: 100%; height: 100%;
  padding: 0; border: 0; border-radius: var(--r-tile);
  background: linear-gradient(var(--face-top), var(--face) 60%);
  color: var(--digit);
  box-shadow: 0 4px 0 var(--edge), 0 6px 12px -4px rgb(34 26 58 / 0.25);
  font: 800 calc(100cqi / var(--n) * 0.36) / 1 var(--f-display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  cursor: grab;
  touch-action: none;
  translate: 0 -2px;
  transition: translate 0.22s var(--ease-spring), scale 0.18s var(--ease-out);
}
.sb-tile.is-long { font-size: calc(100cqi / var(--n) * 0.28); }
@media (hover: hover) { .sb-tile:hover { translate: 0 -4px; } }
.sb-tile:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sb-tile.is-sel { translate: 0 -6px; scale: 1.05; box-shadow: 0 4px 0 var(--edge), var(--shadow-lift); }
.sb-tile.is-sel::after { opacity: 1; border-color: var(--ink); }

/* Dragging: the tile sits under the finger, lifted and slightly larger, above its neighbors. */
.sb-tile.is-drag { z-index: 3; cursor: grabbing; scale: 1.08; transition: scale 0.12s var(--ease-out); box-shadow: 0 4px 0 var(--edge), var(--shadow-drag); will-change: translate; }
.sb-tile.is-return { z-index: 2; }
.sb-tile.is-flying { z-index: 3; scale: 0.94; transition: translate 0.12s cubic-bezier(0.3, 0, 0.6, 1), scale 0.12s; }
/* The tile a drop would merge into opens up to receive it; a non-matching one dims. */
/* Only scale and opacity change while a finger moves, so the browser can do it without repainting. */
.sb-tile::after { content: ""; position: absolute; inset: -6px; border-radius: calc(var(--r-tile) + 6px); border: 3px solid var(--edge); opacity: 0; pointer-events: none; transition: opacity 0.12s; }
.sb-tile.is-target { scale: 1.06; }
.sb-tile.is-target::after { opacity: 1; }
.sb-tile.is-nope { opacity: 0.55; transition: translate 0.22s var(--ease-spring), scale 0.18s var(--ease-out), opacity 0.12s; }

/* Hint: the tile to move bobs; the tile to drop on breathes; both carry an accent ring. */
.sb-tile.is-hint { animation: sb-bob 1.1s var(--ease-out) infinite; box-shadow: 0 4px 0 var(--edge), 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }
.sb-tile.is-hint-to { box-shadow: 0 4px 0 var(--edge), 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); animation: sb-breathe 1.1s ease-in-out infinite; }

/* Merge: the target swells and settles while a ring in its new colour spreads out of it. */
.sb-tile.is-pop { animation: sb-pop 0.4s var(--ease-out); }
.sb-tile.is-pop::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  animation: sb-ring 0.4s var(--ease-out) forwards;
}
/* The cell the tile left closes like a socket. */
.sb-cell.is-hole::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--surface); animation: sb-hole 0.32s var(--ease-out) forwards;
}
.sb-tile.is-deal { animation: sb-deal 0.5s var(--ease-spring) backwards; }
.sb-tile.is-last { animation: sb-win 0.9s var(--ease-out) both; }

/* Stuck: every empty cell shows a red cross and the board shakes once. */
.sb-cell.is-dead::after {
  content: ""; position: absolute; inset: 36%;
  background:
    linear-gradient(45deg, transparent 43%, var(--danger) 43% 57%, transparent 57%),
    linear-gradient(-45deg, transparent 43%, var(--danger) 43% 57%, transparent 57%);
  opacity: 0.8;
}
.sb-game.is-stuck .sb-board { animation: sb-shake 0.42s var(--ease-out); }

/* Status line: a pill laid over the date row for a few seconds, so it never hides tiles. */
.sb-sub { position: relative; }
.sb-toast {
  position: absolute; inset: 0; z-index: 4;
  display: flex; align-items: center; justify-content: center;
  margin: 0; padding: 0 var(--s4);
  border-radius: 999px; background: var(--ink); color: var(--on-accent);
  font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  translate: 0 6px; opacity: 0; pointer-events: none;
  transition: opacity 0.2s, translate 0.25s var(--ease-out);
}
.sb-toast.is-on { opacity: 1; translate: 0 0; }
.sb-game.is-stuck .sb-toast { background: var(--danger); }

.sb-tools { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); height: 60px; margin-top: var(--s3); }
.sb-tool {
  display: grid; place-items: center; align-content: center; gap: 2px;
  border: 0; border-radius: var(--r); background: transparent;
  font-size: 13px; font-weight: 600; color: var(--ink-2); cursor: pointer;
  transition: background-color 0.15s, color 0.15s, scale 0.15s var(--ease-out);
}
.sb-tool svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .sb-tool:hover:not(:disabled) { background: var(--well); color: var(--ink); } }
.sb-tool:active:not(:disabled) { scale: 0.94; }
.sb-tool:disabled { opacity: 0.35; cursor: not-allowed; }
.sb-tool.is-cue { color: var(--accent); background: var(--accent-soft); animation: sb-breathe 1.1s ease-in-out infinite; }

/* Layers over the board: the rules card and the result card. */
.sb-layer {
  position: absolute; inset: 0; z-index: 5;
  display: grid; place-items: center; padding: var(--s3);
  border-radius: inherit;
  background: color-mix(in oklab, var(--tray) 72%, transparent);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  animation: sb-fade 0.2s ease-out;
}
.sb-layer[hidden] { display: none; }
.sb-card {
  width: min(100%, 360px); padding: var(--s5);
  border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-drag);
  text-align: center;
  animation: sb-rise 0.35s var(--ease-spring) both;
}
.sb-card-kicker { margin: 0 0 var(--s1); font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sb-card-title { margin: 0 0 var(--s4); font: 800 22px/1.2 var(--f-display); letter-spacing: -0.02em; color: var(--ink); }
.is-win .sb-card-title { font-size: 28px; }
.sb-final { width: 72px; height: 72px; margin: calc(-1 * var(--s1)) auto var(--s3); font-size: 28px; cursor: default; animation: sb-pop 0.5s 0.15s var(--ease-out) backwards; }
.sb-stats { display: flex; justify-content: center; gap: var(--s5); margin: 0 0 var(--s5); }
.sb-stats div { display: flex; flex-direction: column-reverse; }
.sb-stats dt { font-size: 13px; color: var(--ink-2); }
.sb-stats dd { margin: 0; font: 800 24px/1.1 var(--f-display); font-variant-numeric: tabular-nums; }
.sb-card-actions { display: grid; gap: var(--s2); }
.sb-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 0 var(--s5);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 700; font-size: 16px; color: var(--ink); cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, scale 0.15s var(--ease-out);
}
.sb-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.sb-btn:active { scale: 0.97; }
@media (hover: hover) { .sb-btn:hover { border-color: var(--ink-3); } }
.sb-btn-main { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
@media (hover: hover) { .sb-btn-main:hover { background: var(--accent-hi); border-color: var(--accent-hi); } }
.sb-link { margin-top: var(--s3); border: 0; background: none; padding: var(--s1); font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.is-rules .sb-btn-main { width: 100%; margin-top: var(--s2); }

.sb-demo { --cell: 64px; --cols: 3; position: relative; display: grid; grid-template-columns: repeat(var(--cols), var(--cell)); gap: 8px; padding: 8px; margin: 0 auto var(--s4); width: max-content; border-radius: 14px; background: var(--tray); --n: 3; container-type: normal; }
.sb-demo .sb-cell, .sb-finger { width: var(--cell); height: var(--cell); }
.sb-demo .sb-cell { border-radius: 12px; }
.sb-demo .sb-tile { font-size: calc(var(--cell) * 0.44); border-radius: 12px; cursor: default; transition: translate 0.4s var(--ease-out); }
.sb-finger {
  position: absolute; left: 8px; top: 8px; pointer-events: none; z-index: 4;
  transition: translate 0.4s var(--ease-out);
}
.sb-finger::after {
  content: ""; position: absolute; left: 50%; top: 58%; width: 26px; height: 26px; margin: -13px;
  border-radius: 50%; background: rgb(34 26 58 / 0.25); border: 2px solid var(--surface);
  transition: scale 0.15s;
}
.sb-finger.is-down::after { scale: 0.8; background: rgb(34 26 58 / 0.4); }
.sb-steps { list-style: none; counter-reset: step; padding: 0; margin: 0 0 var(--s3); text-align: left; display: grid; gap: var(--s2); }
.sb-steps li { counter-increment: step; position: relative; padding-left: 32px; font-size: 15px; line-height: 1.45; color: var(--ink-2); }
.sb-steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 22px; height: 22px; display: grid; place-items: center; border-radius: 7px;
  background: var(--accent-soft); color: var(--accent); font: 800 13px/1 var(--f-display);
}

/* Before the script runs: the same frame with empty cells, so nothing jumps when the game appears. */
.sb-ghost .g-head { display: block; height: 44px; }
.sb-ghost .g-sub { display: block; height: 36px; margin: var(--s2) 0 var(--s3); }
.sb-ghost .g-tools { display: block; height: 60px; margin-top: var(--s3); }
.sb-game.is-live .sb-ghost { display: none; }
.sb-noscript { margin: var(--s4) 0 0; text-align: center; color: var(--ink-2); }

@keyframes sb-deal { from { opacity: 0; transform: translateY(16px) scale(0.7); } }
@keyframes sb-pop { 0% { transform: scale(0.82); } 45% { transform: scale(1.14); } 75% { transform: scale(0.97); } 100% { transform: scale(1); } }
@keyframes sb-ring { 0% { box-shadow: 0 0 0 0 var(--face); opacity: 0.9; } 100% { box-shadow: 0 0 0 16px var(--face); opacity: 0; } }
@keyframes sb-hole { from { opacity: 0.9; transform: scale(1); } to { opacity: 0; transform: scale(0.6); } }
@keyframes sb-bob { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-4px); } }
@keyframes sb-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
@keyframes sb-shake { 20% { transform: translateX(-7px); } 45% { transform: translateX(6px); } 70% { transform: translateX(-3px); } }
@keyframes sb-win {
  0% { transform: scale(1); }
  40% { transform: scale(1.18) rotate(-2deg); box-shadow: 0 4px 0 var(--edge), var(--shadow-win); }
  100% { transform: scale(1.06); box-shadow: 0 4px 0 var(--edge), var(--shadow-lift); }
}
@keyframes sb-fade { from { opacity: 0; } }
@keyframes sb-rise { from { opacity: 0; transform: translateY(14px) scale(0.96); } }

@media (max-width: 640px) {
  .sb-game { --gap: 7px; --pad: 12px; border-radius: 20px; }
  .sb-board { border-radius: 14px; }
  .sb-tab { padding: 0 var(--s3); }
  .sb-tools { height: 56px; margin-top: var(--s2); }
  .sb-ghost .g-tools { height: 56px; margin-top: var(--s2); }
  .sb-sub, .sb-ghost .g-sub { margin: var(--s1) 0 var(--s2); height: 32px; }
  .sb-layer { padding: var(--s2); }
  .sb-card { padding: var(--s4); }
  .sb-card-title { margin-bottom: var(--s3); }
  .is-win .sb-card-title { font-size: 24px; }
  .sb-final { width: 56px; height: 56px; font-size: 22px; margin-bottom: var(--s2); }
  .sb-stats { margin-bottom: var(--s4); }
  .sb-demo { --cell: 52px; }
  .sb-steps li { font-size: 14px; }
}

/* Home page: one centred column. The board is the first thing on every screen; the article follows on the same axis
   in full-width bands (see DESIGN.md Layout). */
.stage {
  padding: var(--s6) var(--s5) var(--s7);
  background:
    radial-gradient(ellipse 60% 55% at 50% 38%, var(--accent-soft), transparent 70%),
    var(--bg);
}
.stage-in { max-width: 540px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; }
.stage-title { font: 700 46px/1.05 var(--f-word); letter-spacing: -0.02em; margin: 0; text-align: center; text-wrap: balance; }
.stage-sub { margin: var(--s2) 0 var(--s5); font-size: 17px; color: var(--ink-2); text-align: center; text-wrap: balance; }
.engage { display: flex; align-items: center; justify-content: center; gap: var(--s2); margin-top: var(--s4); }
.chip {
  display: inline-flex; align-items: center; gap: var(--s2);
  min-height: 40px; padding: 0 var(--s3);
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
  font-weight: 600; font-size: 15px; color: var(--ink-2); cursor: pointer; font-variant-numeric: tabular-nums;
}
.chip svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.chip:hover { border-color: var(--ink-3); color: var(--ink); }
.chip[data-gf-liked] { color: var(--danger); border-color: var(--danger); }
.chip[data-gf-liked] svg { fill: currentColor; }
.chip-msg { font-size: 14px; color: var(--ink-2); }


/* The article: one reading column on the stage's axis; each section is a full-width band. */
.read-col, .block-in { max-width: calc(var(--read) + 2 * var(--s5)); }
/* The intro reads as the stage's caption: centred under the board, on the same ground. */
.intro { padding: 0 var(--s5) var(--s8); text-align: center; }
.lead { max-width: 60ch; margin: 0 auto; font-size: 20px; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }
.block { padding: 96px 0; }
.block-in > h2 { margin-bottom: var(--s5); }
.block .prose > :last-child { margin-bottom: 0; }
.sec-lead { font-size: 19px; }

/* Bands. How to Play is the dark one; tokens are re-pointed so tiles, cells and text adapt without new rules. */
.block-how-to-play {
  --ink: var(--night-ink); --ink-2: var(--night-ink-2); --ink-3: var(--night-ink-3);
  --line: var(--night-line); --tray: var(--night-tray); --hole: var(--night-hole);
  background: var(--night); color: var(--ink);
}
.block-linkedin-sumbreak, .block-talk { background: var(--surface); }
.block-tips { background: var(--accent-soft); }

/* How to play: the looping merge, then the rules. */
.loop { margin: var(--s6) 0 var(--s7); text-align: center; }
.loop .sb-demo { margin-bottom: var(--s3); box-shadow: inset 0 0 0 1px var(--line); }
.loop .sb-finger::after { background: rgb(255 255 255 / 0.35); border-color: rgb(255 255 255 / 0.8); }
.loop .sb-finger.is-down::after { background: rgb(255 255 255 / 0.55); }
.loop figcaption { font-size: 15px; color: var(--ink-3); }
.prose .rules { list-style: none; padding: 0; margin: 0 0 var(--s6); counter-reset: rule; display: grid; gap: var(--s5); }
.prose .rules li { counter-increment: rule; position: relative; margin: 0; padding-left: 60px; color: var(--ink-2); }
.rules li b { display: block; margin-bottom: 2px; color: var(--ink); font: 600 20px/1.3 var(--f-word); }
.rules li::before {
  content: counter(rule); position: absolute; left: 0; top: 0;
  width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(var(--face-top), var(--face) 60%); color: var(--digit); box-shadow: 0 3px 0 var(--edge);
  font: 800 20px/1 var(--f-display);
}
.rules li:nth-child(1) { --lv: 0; } .rules li:nth-child(2) { --lv: 1; } .rules li:nth-child(3) { --lv: 2; } .rules li:nth-child(4) { --lv: 3; }

/* Art made of tiles: board thumbnails for the modes and the chain in the closing band. */
.thumb { display: grid; grid-template-columns: repeat(var(--n), 1fr); gap: 3px; width: 88px; height: 88px; padding: 5px; border-radius: 14px; background: var(--tray); }
.thumb i { border-radius: 3px; background: var(--face); }
.chain i {
  width: 34px; height: 34px; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(var(--face-top), var(--face) 60%); color: var(--digit); box-shadow: 0 2px 0 var(--edge);
  font: 800 16px/1 var(--f-display); font-style: normal;
}
.chain i::after { content: attr(data-v); }

/* Daily and unlimited: two rows, each a board thumbnail and the text with its button. */
.modes { display: grid; margin-bottom: var(--s6); border-block: 1px solid var(--line); }
.mode { display: grid; grid-template-columns: 88px 1fr; gap: 0 var(--s5); padding: var(--s6) 0; }
.mode + .mode { border-top: 1px solid var(--line); }
.mode .thumb { grid-row: span 3; }
.prose .mode h3 { margin: 0 0 var(--s2); }
.mode p { margin: 0 0 var(--s4); color: var(--ink-2); }
.btn-play {
  justify-self: start; display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s5);
  border-radius: 999px; background: var(--accent); color: var(--on-accent); font-weight: 600; text-decoration: none;
  transition: background-color 0.15s, transform 0.15s var(--ease-out);
}
.btn-play::after { content: "→"; }
.btn-play:hover { background: var(--accent-hi); color: var(--on-accent); }
.btn-play:active { transform: scale(0.97); }
.mode + .mode .btn-play { background: var(--surface); color: var(--accent-hi); box-shadow: inset 0 0 0 1px var(--line); }
.mode + .mode .btn-play:hover { box-shadow: inset 0 0 0 1px var(--accent); }

/* LinkedIn comparison. */
.compare-wrap { overflow-x: auto; margin-top: var(--s5); }
.compare { width: 100%; border-collapse: collapse; font-size: 16px; }
.compare th, .compare td { text-align: left; padding: var(--s3) var(--s4); border-bottom: 1px solid var(--line); vertical-align: top; }
.compare thead th { font: 600 15px/1.3 var(--f-word); color: var(--ink-2); }
.compare tbody th { font-weight: 600; color: var(--ink); width: 24%; }
.compare td:last-child { color: var(--ink); background: var(--accent-soft); }
.compare thead th:last-child { background: var(--accent-soft); color: var(--accent-hi); border-radius: 10px 10px 0 0; }

/* Tips: three panels, each with its own looping demo; a row of three on wide screens, stacked below. */
.block-tips .block-in { max-width: var(--wrap); }
.block-tips h2 { text-align: center; margin-inline: auto; }
.prose .tips { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5); }
.prose .tips li { margin: 0; padding: var(--s4) var(--s4) var(--s5); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-2); color: var(--ink-2); }
.tip-art { display: grid; place-items: center; min-height: 172px; margin-bottom: var(--s4); padding: var(--s4); border-radius: 12px; background: var(--bg); container-type: inline-size; }
/* Cells shrink so the five-tile chain fits a narrow panel: 100cqi minus the tray padding and gaps, split by --cols. */
.tip-art .sb-demo { --cell: min(52px, (100cqi - 16px - (var(--cols) - 1) * 8px) / var(--cols)); margin: 0; }
.tips b { display: block; margin-bottom: var(--s1); color: var(--ink); font: 600 20px/1.3 var(--f-word); }

/* Closing band: back to the board. */
.cta { padding: 96px 0; background: var(--accent); color: var(--on-accent); text-align: center; }
.chain { display: flex; justify-content: center; gap: 6px; margin-bottom: var(--s5); }
.chain i { width: 40px; height: 40px; font-size: 17px; }
.cta-title { margin: 0 0 var(--s2); font: 700 40px/1.1 var(--f-word); letter-spacing: -0.02em; text-wrap: balance; }
.cta-sub { margin: 0 0 var(--s5); color: rgb(255 255 255 / 0.82); text-wrap: balance; }
.cta-go { display: flex; justify-content: center; flex-wrap: wrap; gap: var(--s3); }
.cta .btn-play { background: var(--surface); color: var(--accent-hi); }
.cta .btn-play:hover { background: var(--accent-soft); color: var(--accent-hi); }
.cta .btn-play.is-ghost { background: transparent; color: var(--on-accent); box-shadow: inset 0 0 0 1.5px rgb(255 255 255 / 0.6); }
.cta .btn-play.is-ghost:hover { background: rgb(255 255 255 / 0.1); }
.cta :focus-visible { outline-color: var(--on-accent); }
main:has(.read) + .foot { margin-top: 0; }

/* FAQ. */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { list-style: none; cursor: pointer; padding: var(--s4) var(--s6) var(--s4) 0; position: relative; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: var(--s1); top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--ink-2); border-bottom: 2px solid var(--ink-2);
  transform: translateY(-70%) rotate(45deg); transition: transform 0.2s var(--ease-out);
}
.faq details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq summary h3 { font-size: 20px; display: inline; }
.faq details p { margin: 0 0 var(--s4); color: var(--ink-2); max-width: 70ch; }

/* Comments. */
.talk-form { display: grid; gap: var(--s3); margin-bottom: var(--s6); }
.field { display: grid; gap: var(--s1); }
.field-label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r); padding: var(--s3);
}
.field input:focus, .field textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.talk-actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.talk-form [data-gf-reply-cancel], .talk-to:empty { display: none; }
.talk-form[data-gf-replying] [data-gf-reply-cancel] { display: inline-flex; }
.talk-msg { font-size: 14px; color: var(--ink-2); }
.talk-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s4); }
.talk-list[data-gf-empty]::before { content: "No comments yet. Share your time or a tip for today's board."; color: var(--ink-3); }
.talk-list[data-gf-off] { display: none; }
.talk-item { padding: var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.talk-head { margin: 0 0 var(--s1); font-size: 14px; color: var(--ink-3); }
.talk-head b { color: var(--ink); }
.talk-owner { display: none; font-size: 12px; font-weight: 600; color: var(--accent); }
.talk-item[data-gf-owner] > .talk-head .talk-owner { display: inline; }
.talk-text { margin: 0 0 var(--s2); }
.talk-reply { border: 0; background: none; padding: 0; color: var(--accent); font-weight: 600; font-size: 14px; cursor: pointer; }
.talk-replies { list-style: none; padding: 0 0 0 var(--s5); margin: var(--s3) 0 0; display: grid; gap: var(--s3); }

@media (min-width: 1024px) {
  .read { font-size: 18px; }
}
@media (max-width: 960px) {
  .prose .tips { grid-template-columns: 1fr; max-width: var(--read); margin-inline: auto; }
}
@media (max-width: 640px) {
  .stage { padding: var(--s3) var(--s3) var(--s6); }
  .stage-title { font-size: 28px; }
  .stage-sub { font-size: 14px; margin: var(--s1) 0 var(--s3); }
  .intro { padding: 0 var(--s4) var(--s7); }
  .lead { font-size: 17px; }
  .block, .cta { padding: 64px 0; }
  .sec-lead { font-size: 17px; }
  .prose .rules li { padding-left: 52px; }
  .rules li::before { width: 36px; height: 36px; font-size: 17px; }
  .rules li b, .tips b { font-size: 18px; }
  .tip-art { min-height: 148px; }
  .mode { grid-template-columns: 64px 1fr; gap: 0 var(--s4); }
  .thumb { width: 64px; height: 64px; gap: 2px; padding: 4px; border-radius: 11px; }
  .chain { gap: 4px; }
  .chain i { width: 34px; height: 34px; font-size: 14px; }
  .chain i:nth-child(n+7) { display: none; }
  .cta-title { font-size: 28px; }
  .compare { font-size: 14px; }
  .compare th, .compare td { padding: var(--s2); }
}
