/* index.html (the home page): one stylesheet for the whole page. Colours sampled from the game's own screens (Store/screenshots).

   Layout rule: everything sits on one column (.wrap, 1120px with a 16px gutter on phones). Bands of colour run
   the full width, but what is inside them starts and ends on the column's edges, the screenshot reel included. */

:root {
  --night: #090e1d;        /* the top strip */
  --felt: #1f2d55;         /* the table */
  --felt-deep: #141c36;
  --felt-panel: #19244a;
  --slot: #172447;
  --edge: #3b3442;         /* the table's dark edge */
  --line: #2c3b6b;         /* quiet rules and inactive dots */
  --wood: #b58952;         /* the rail's plywood */
  --wood-dark: #8b5b34;
  --wood-ink: #2a1c0e;
  --frame: #af8252;
  --chalkboard: #1e2623;
  --chalk: #cfd6d0;
  --chalk-dim: #9fa9a2;
  --chalk-green: #72c67c;  /* TABLE CLEARED */
  --brass: #e9c36a;        /* labels, the logo's gold */
  --brass-deep: #cc9e44;
  --paper: #f3ead2;        /* cards and buttons */
  --paper-edge: #cfc3a6;
  --ink: #181818;
  --ink-soft: #4d4638;
  --chips: #508bdc;
  --chips-ink: #24569e;
  --chips-soft: #8db6f2;
  --mult: #dd5642;
  --mult-ink: #a3261a;
  --mult-soft: #f2907f;
  --cream: #efe6d2;
  --cream-dim: #b9c0d6;
  --hazard: #f2c230;

  --slab: "Montagu Slab", Rockwell, "Roboto Slab", Georgia, serif;
  --show: "Limelight", "Montagu Slab", Georgia, serif;

  --wrap: 1120px;
  --gutter: 1rem;
  --sect: clamp(4rem, 9vw, 6.5rem);   /* one vertical rhythm for every section */
  --bar-h: 3.5rem;
  --r: 10px;
  --shadow-wood: 0 14px 30px rgba(40, 22, 6, 0.5);
  --shadow-felt: 0 14px 34px rgba(0, 0, 0, 0.5);
  --ease-out: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (min-width: 700px) { :root { --gutter: 1.5rem; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--bar-h);   /* links to a section land below the bar */
  scrollbar-gutter: stable;           /* the page never jumps sideways when the viewer locks scrolling */
  background: var(--night);
}
html:has(dialog[open]) { overflow: hidden; }
body {
  margin: 0;
  font-family: var(--slab);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--cream);
  background-color: var(--felt);
  background-image: radial-gradient(rgba(255, 255, 255, 0.055) 1.1px, transparent 1.6px); /* the felt's dots */
  background-size: 22px 22px;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p { margin: 0; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: 1rem; top: -4rem; z-index: 50;
  background: var(--paper); color: var(--ink); padding: 0.5rem 0.9rem; border-radius: 6px;
}
.skip:focus { top: 1rem; }

/* ---------- Shared pieces ---------- */
/* Big headings: Limelight, as on the game's boards. Brass on the felt, dark wood on wood and paper. */
.show {
  font-family: var(--show);
  font-weight: 400;
  font-size: clamp(2rem, 5.4vw, 3.1rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-wrap: balance;
  color: var(--brass);
}

/* The rail's small brass labels (TRAY, PATRONS, MATCHES). */
.label {
  display: inline-block;
  background: var(--brass);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.5;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.18rem 0.7rem;
  border-radius: 4px;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.25);
}

/* Every section opens the same way: label, heading, one line. */
.head { display: grid; justify-items: center; gap: 0.75rem; text-align: center; margin-bottom: clamp(2rem, 5vw, 3.25rem); }
.head .lede { max-width: 34em; color: var(--cream-dim); text-wrap: balance; }

/* A plywood frame with brass screws, as round the game's boards. */
.frame {
  padding: 10px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 5px 5px, #f3d98e 0 2px, #8a6a2c 2.2px 3px, transparent 3.4px) 0 0 / 10px 10px no-repeat,
    radial-gradient(circle at 5px 5px, #f3d98e 0 2px, #8a6a2c 2.2px 3px, transparent 3.4px) 100% 0 / 10px 10px no-repeat,
    radial-gradient(circle at 5px 5px, #f3d98e 0 2px, #8a6a2c 2.2px 3px, transparent 3.4px) 0 100% / 10px 10px no-repeat,
    radial-gradient(circle at 5px 5px, #f3d98e 0 2px, #8a6a2c 2.2px 3px, transparent 3.4px) 100% 100% / 10px 10px no-repeat,
    linear-gradient(180deg, #c99b5f, #9a6b3f);
  box-shadow: var(--shadow-felt);
}
.frame img { width: 100%; border-radius: 3px; background: var(--night); }
.frame > a { display: block; border-radius: 3px; }

/* The game's tile buttons: cream, with a thick lower edge. */
.btn {
  display: inline-block;
  min-width: 15rem;
  padding: 0.7rem 1.6rem 0.75rem;
  text-align: center;
  text-decoration: none;
  color: var(--ink);
  background: linear-gradient(180deg, #f8f1e2, var(--paper));
  border-radius: 12px;
  border-bottom: 7px solid var(--paper-edge);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.4);
}
.btn b { display: block; font-size: 1.45rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; line-height: 1.2; }
.btn small { display: block; font-size: 0.9rem; color: var(--ink-soft); }
a.btn { transition: translate 0.15s, border-bottom-width 0.15s; }
a.btn:hover { background: #fffaf0; }
a.btn:active { translate: 0 4px; border-bottom-width: 3px; margin-bottom: 4px; }
.btn.is-off { cursor: default; }

/* Round cream keys: the reel's and the viewer's arrows. */
.round {
  flex: none;
  display: grid; place-items: center;
  width: 46px; height: 46px; padding: 0;
  border: 0; border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(180deg, #fbf5e8, var(--paper));
  box-shadow: inset 0 -4px 0 var(--paper-edge), 0 6px 14px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  transition: translate 0.15s, box-shadow 0.15s, opacity 0.2s;
}
.round svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.round:hover { background: #fffaf0; }
.round:active { translate: 0 2px; box-shadow: inset 0 -2px 0 var(--paper-edge), 0 3px 8px rgba(0, 0, 0, 0.4); }
.round:disabled { opacity: 0.35; cursor: default; translate: none; }

html:not(.js) .js-only { display: none !important; } /* controls that need the script */
.mi { width: 1.05em; height: 1.05em; flex: none; } /* a match */

.chips { color: var(--chips-ink); font-weight: 700; }
.mult { color: var(--mult-ink); font-weight: 700; }

/* A placeholder nobody can miss. Search the files for "PLACEHOLDER". */
.todo {
  display: inline-block;
  padding: 0.05em 0.5em;
  color: var(--ink);
  background: repeating-linear-gradient(-45deg, var(--hazard) 0 10px, #f7d55c 10px 20px);
  border: 2px dashed var(--ink);
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.9em;
}

/* ---------- A drawn domino: blue pips on top, red below, as in the game ---------- */
.tile {
  --w: var(--tw, 28px);
  position: relative;
  flex: none;
  display: grid;
  grid-template-rows: 1fr 1fr;
  width: var(--w);
  height: calc(var(--w) * 2);
  border-radius: calc(var(--w) * 0.14);
  background: linear-gradient(170deg, #f8f1e1, #ddd4bf);
  box-shadow: inset 0 calc(var(--w) * -0.08) 0 #978a6e, 0 3px 7px rgba(0, 0, 0, 0.45);
  transform-origin: 100% 100%;
}
.tile::after { /* the divider and its brass pin */
  content: "";
  position: absolute; left: 14%; right: 14%; top: calc(50% - 1px); height: 2px;
  background: radial-gradient(circle, #c9a04f 0 3px, transparent 3.5px), #6e6453;
}
/* Pips are painted, not built: a half is one element and data-n (0 to 6) places its pips on a 3 x 3 grid.
   Blue on the top half (chips), red on the bottom (mult), each with a darker rim. Works without the script. */
.half {
  --pip: #2f6fcc; --pip-rim: #1d4f9a;
  --d: radial-gradient(circle closest-side, var(--pip) 0 60%, var(--pip-rim) 64% 72%, transparent 77%);
  padding: 15%;
  background-origin: content-box;
  background-repeat: no-repeat;
  background-size: 33.34% 33.34%;
}
.half.bot { --pip: #bf3a30; --pip-rim: #8f231b; }
.half[data-n="1"] { background-image: var(--d); background-position: 50% 50%; }
.half[data-n="2"] { background-image: var(--d), var(--d); background-position: 0 0, 100% 100%; }
.half[data-n="3"] { background-image: var(--d), var(--d), var(--d); background-position: 0 0, 50% 50%, 100% 100%; }
.half[data-n="4"] { background-image: var(--d), var(--d), var(--d), var(--d); background-position: 0 0, 100% 0, 0 100%, 100% 100%; }
.half[data-n="5"] { background-image: var(--d), var(--d), var(--d), var(--d), var(--d); background-position: 0 0, 100% 0, 50% 50%, 0 100%, 100% 100%; }
.half[data-n="6"] { background-image: var(--d), var(--d), var(--d), var(--d), var(--d), var(--d); background-position: 0 0, 100% 0, 0 50%, 100% 50%, 0 100%, 100% 100%; }

/* Lying flat, as on the game's table: the top half on the left. */
.tile.flat { grid-template-rows: none; grid-template-columns: 1fr 1fr; width: calc(var(--w) * 2); height: var(--w); transform-origin: 50% 50%; }
.tile.flat::after { left: calc(50% - 1px); right: auto; top: 14%; bottom: 14%; width: 2px; height: auto; }
.tile.flat .half { padding: 7.5%; }
.half.hl { border-radius: calc(var(--w) * 0.12); box-shadow: inset 0 0 0 2px var(--brass), 0 0 10px rgba(233, 195, 106, 0.55); }

/* Materials, as the game paints them. */
.tile.glass {
  background: linear-gradient(160deg, rgba(225, 242, 255, 0.95), rgba(150, 196, 232, 0.8) 55%, rgba(120, 170, 215, 0.85));
  box-shadow: inset 0 calc(var(--w) * -0.08) 0 #6f98bd, inset 1px 1px 0 rgba(255, 255, 255, 0.8), 0 3px 7px rgba(0, 0, 0, 0.45);
}
.tile.glass::before { /* a glint */
  content: ""; position: absolute; left: 14%; top: 6%; width: 18%; height: 40%; border-radius: 40%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), transparent); pointer-events: none;
}
.tile.ebony { background: linear-gradient(170deg, #4a3a30, #241a16); box-shadow: inset 0 calc(var(--w) * -0.08) 0 #120c0a, 0 3px 7px rgba(0, 0, 0, 0.45); }
.tile.ebony .half.top { --pip: #7fb0ff; --pip-rim: #4a80d8; }
.tile.ebony .half.bot { --pip: #ff7466; --pip-rim: #d24a3d; }
.tile.ebony::after { background: radial-gradient(circle, #c9a04f 0 3px, transparent 3.5px), #6d5a4c; }
.tile.brass { background: linear-gradient(165deg, #fbe39b, #d9aa4c 60%, #b98a35); box-shadow: inset 0 calc(var(--w) * -0.08) 0 #8a6a2c, inset 1px 1px 0 rgba(255, 250, 220, 0.8), 0 3px 7px rgba(0, 0, 0, 0.45); }
.tile.brass .half.top { --pip: #1f4f9e; --pip-rim: #143a78; }
.tile.brass .half.bot { --pip: #9e2a20; --pip-rim: #741c15; }
.tile.brass::after { background: #8a6a2c; }
.tile.stone {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.18) 0 8%, transparent 9%),
    radial-gradient(circle at 70% 62%, rgba(0, 0, 0, 0.18) 0 7%, transparent 8%),
    radial-gradient(circle at 40% 80%, rgba(0, 0, 0, 0.14) 0 6%, transparent 7%),
    linear-gradient(170deg, #b8b6ae, #8d8a82);
  box-shadow: inset 0 calc(var(--w) * -0.08) 0 #66635c, 0 3px 7px rgba(0, 0, 0, 0.45);
}
.tile.stone::after { display: none; }
.tile.stone .half { background-image: none; }
.tile.giant { --w: calc(var(--tw, 28px) * 1.35); }
.tile.pinned::before { /* the brass pin, on the divider */
  content: ""; position: absolute; left: 50%; top: 50%; z-index: 1;
  width: calc(var(--w) * 0.34); aspect-ratio: 1; translate: -50% -50%; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff1b8, #e9c36a 45%, #8a6a2c 85%);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.tile.pinned { box-shadow: inset 0 calc(var(--w) * -0.08) 0 #978a6e, 0 0 0 2px rgba(233, 195, 106, 0.35), 0 3px 7px rgba(0, 0, 0, 0.45); }

/* ---------- Things that arrive as you scroll (only when the script runs) ---------- */
.js:not(.still) .rv { opacity: 0; translate: 0 28px; transition: opacity 0.7s ease, translate 0.7s var(--ease-out); }
.js:not(.still) .rv.in { opacity: 1; translate: 0 0; }
@media (min-width: 860px) { /* sideways only where there is room for it */
  .js:not(.still) .rv.from-l { translate: -44px 0; }
  .js:not(.still) .rv.from-r { translate: 44px 0; }
  .js:not(.still) .rv.from-l.in, .js:not(.still) .rv.from-r.in { translate: 0 0; }
}
main { overflow-x: clip; } /* things sliding in from the side never widen the page */

/* ---------- The bar that follows you down ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 30;
  display: none;
  background: var(--night);
  border-bottom: 3px solid var(--wood-dark);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  translate: 0 -110%;
  visibility: hidden; /* so the keyboard can't land on links that are off screen */
  transition: translate 0.3s ease, visibility 0s 0.3s;
}
.js .bar { display: block; }
.bar.on { translate: 0 0; visibility: visible; transition: translate 0.3s ease; }
.bar-in { display: flex; align-items: center; gap: 0.75rem; height: var(--bar-h); }
.bar-logo { flex: none; margin-right: auto; padding: 0.25rem 0; border-radius: 4px; }
.bar-logo img { width: 112px; }
.bar-nav ul { list-style: none; display: flex; gap: 0.15rem; margin: 0; padding: 0; }
.bar-nav a {
  position: relative; display: block;
  padding: 0.45rem 0.65rem; border-radius: 6px;
  color: var(--cream); text-decoration: none; font-size: 0.95rem; white-space: nowrap;
  transition: color 0.2s;
}
.bar-nav a::after {
  content: ""; position: absolute; left: 0.65rem; right: 0.65rem; bottom: 0.2rem; height: 2px; border-radius: 1px;
  background: var(--brass); scale: 0 1; transition: scale 0.25s var(--ease-out);
}
.bar-nav a:hover, .bar-nav a[aria-current] { color: var(--brass); }
.bar-nav a[aria-current]::after { scale: 1 1; }
.bar-cta { flex: none; margin-left: 0.4rem; }
.prog { position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; pointer-events: none; }
.prog i { display: block; height: 100%; background: var(--brass); transform-origin: 0 50%; transform: scaleX(0); }

.menu-btn {
  display: none; flex: none;
  width: 44px; height: 44px; margin-right: -6px; padding: 0 11px;
  border: 0; border-radius: 8px; background: transparent; cursor: pointer;
  flex-direction: column; justify-content: center; gap: 5px;
}
.menu-btn i { display: block; height: 3px; border-radius: 2px; background: var(--cream); transition: translate 0.25s, rotate 0.25s, opacity 0.2s; }
.bar.open .menu-btn i:nth-child(1) { translate: 0 8px; rotate: 45deg; }
.bar.open .menu-btn i:nth-child(2) { opacity: 0; }
.bar.open .menu-btn i:nth-child(3) { translate: 0 -8px; rotate: -45deg; }

@media (max-width: 1039px) {
  .menu-btn { display: flex; }
  .bar-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    margin-top: 3px; /* below the bar's wood edge */
    background: var(--night);
    border-bottom: 3px solid var(--wood-dark);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.45);
    display: none;
  }
  .bar.open .bar-nav { display: block; animation: drop 0.22s ease both; }
  .bar-nav ul { flex-direction: column; gap: 0; width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; padding: 0.4rem 0 0.8rem; }
  .bar-nav a { padding: 0.85rem 0.1rem; font-size: 1.1rem; border-bottom: 1px solid #1a2342; border-radius: 0; }
  .bar-nav li:last-child a { border-bottom: 0; }
  .bar-nav a::after { left: auto; right: 0.1rem; top: 50%; bottom: auto; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; scale: 0; }
}
@keyframes drop { from { opacity: 0; translate: 0 -8px; } }
@media (max-width: 379px) { /* the smallest phones: logo, label and menu still fit on one line */
  .bar-in { gap: 0.5rem; }
  .bar-logo img { width: 96px; }
  .bar-cta { margin-left: 0; font-size: 0.68rem; padding-inline: 0.5rem; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: clip;
  min-height: 100svh;
  padding: clamp(2.25rem, 7vh, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  text-align: center;
  /* one lamp from the top left, as on the game's table */
  background:
    radial-gradient(ellipse 60% 50% at 28% 0%, rgba(233, 195, 106, 0.09), transparent 70%),
    linear-gradient(180deg, var(--night) 0, rgba(9, 14, 29, 0.85) 38%, rgba(9, 14, 29, 0) 100%);
}
.hero .copy { position: relative; z-index: 2; }
.js:not(.still) .hero .copy { will-change: transform, opacity; }
.hero h1 { width: min(86%, 620px); margin: 0 auto; }
.hero h1 img { width: 100%; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.55)); }
.pitch {
  max-width: 22em;
  margin: 1.3rem auto 0;
  font-size: clamp(1.3rem, 3.6vw, 1.9rem);
  font-weight: 600;
  line-height: 1.25;
  color: #fff8e6;
  text-wrap: balance;
}
.sub { max-width: 32em; margin: 0.8rem auto 0; color: var(--cream-dim); text-wrap: balance; }
.cta { margin-top: 1.7rem; }
.scroll-cue {
  display: block; width: fit-content; margin: 1.1rem auto 0; padding: 0.25rem 0.5rem;
  color: var(--brass); font-size: 0.95rem; text-underline-offset: 3px;
}
.scroll-cue::after { content: ""; display: block; width: 10px; height: 10px; margin: 0.4rem auto 0; border-right: 3px solid; border-bottom: 3px solid; rotate: 45deg; }
.js:not(.still) .scroll-cue::after { animation: nod 1.6s ease-in-out infinite; }
@keyframes nod { 50% { translate: 0 6px; } }

.js:not(.still) .hero h1 img { animation: slam 0.7s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.js:not(.still) .hero .pitch { animation: rise 0.7s 0.25s ease both; }
.js:not(.still) .hero .sub { animation: rise 0.7s 0.4s ease both; }
.js:not(.still) .hero .cta { animation: rise 0.7s 0.55s ease both; }
@keyframes slam { from { opacity: 0; scale: 1.5; rotate: -4deg; } to { opacity: 1; scale: 1; rotate: 0deg; } }
@keyframes rise { from { opacity: 0; translate: 0 22px; } to { opacity: 1; translate: 0 0; } }

/* Drifting tiles: only where there is room beside the words. */
.drift { position: absolute; inset: 0; z-index: 1; pointer-events: none; display: none; }
.drift .tile { position: absolute; transform-origin: 50% 50%; will-change: translate; }
@media (min-width: 760px) { .js:not(.still) .drift { display: block; } }
@media (max-width: 1099px) { .drift .wide { display: none; } }

.shot-stage { position: relative; z-index: 2; perspective: 1400px; margin-top: clamp(2rem, 5vw, 3rem); }
.hero .frame { transform-origin: 50% 100%; }
.js:not(.still) .hero .frame { will-change: transform; }

/* ---------- A lane of dominoes that goes over as it passes ---------- */
.lane {
  display: none;
  overflow: clip;
  background: linear-gradient(180deg, var(--felt-deep), var(--felt));
  border-block: 10px solid var(--edge);
  padding: 28px 0 12px;
}
.js .lane { display: block; }
/* The script sizes the tiles so the line starts on the column's left edge and, fallen, ends on its right. */
.chain { --tw: 22px; display: flex; align-items: flex-end; gap: calc(var(--tw) * 0.7); height: calc(var(--tw) * 2 + 4px); }
.chain.live .tile { will-change: rotate; } /* a layer per tile only while its lane is on screen */
.lane, .stage, .night { contain: layout style; }

/* ---------- The topple: pinned while a real line is laid, flicked and counted ---------- */
/* .pin is set in the page head unless "reduce motion" is on; the script drops it when the stage can't fit the
   screen (a phone on its side), and then the topple plays as it scrolls past instead. */
.topple { position: relative; }
.pin .topple { height: 300vh; }
.stage { padding: var(--sect) 0; }
.pin .stage {
  position: sticky; top: 0;
  min-height: 100svh;
  display: grid; align-content: center;
  padding: calc(var(--bar-h) + 1rem) 0 1rem;
}
.stage .head { margin-bottom: clamp(1rem, 3vh, 2rem); }

.caps { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
@media (min-width: 860px) { .caps { grid-template-columns: repeat(3, 1fr); } }
.caps li {
  padding: 0.95rem 1.1rem 1.05rem;
  border-radius: var(--r);
  background: rgba(9, 14, 29, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.06);
  transition: opacity 0.35s, background-color 0.35s, border-color 0.35s;
}
.caps b { display: flex; align-items: center; gap: 0.6rem; font-size: 1.12rem; line-height: 1.25; color: #fff8e6; }
.caps .n {
  flex: none; display: grid; place-items: center;
  width: 1.6rem; height: 1.6rem; border-radius: 6px;
  background: var(--brass); color: var(--ink); font-size: 0.9rem;
  transition: background-color 0.35s, color 0.35s;
}
.caps p { margin-top: 0.45rem; color: var(--cream-dim); }
.caps .chips { color: var(--chips-soft); }
.caps .mult { color: var(--mult-soft); }
.pin .caps li { opacity: 0.4; }
.pin .caps li .n { background: var(--line); color: var(--cream); }
.pin .caps li.on { opacity: 1; background: rgba(9, 14, 29, 0.78); border-color: rgba(233, 195, 106, 0.45); }
.pin .caps li.on .n { background: var(--brass); color: var(--ink); }

.cap-dots { display: none; justify-content: center; gap: 0.45rem; margin-top: 0.8rem; }
.cap-dots i { width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width 0.3s var(--ease-out), background-color 0.3s; }
.cap-dots i.on { width: 22px; background: var(--brass); }
@media (max-width: 859px) {
  /* One caption at a time on a phone. They share one cell, so the tallest sets the height and nothing below moves. */
  .pin .caps li { grid-area: 1 / 1; visibility: hidden; opacity: 0; transition: opacity 0.3s, visibility 0s 0.3s; }
  .pin .caps li.on { visibility: visible; opacity: 1; transition: opacity 0.3s; }
  .pin .cap-dots { display: flex; }
}

/* The table: felt, a lamp pool, the dark edge in front. */
.table3 {
  margin-top: clamp(1rem, 2.5vh, 1.6rem);
  padding: clamp(0.9rem, 2.5vh, 1.4rem) 0.5rem 0;
  border-radius: 16px 16px 8px 8px;
  background:
    radial-gradient(ellipse 55% 75% at 30% 0%, rgba(255, 236, 190, 0.08), transparent 70%),
    radial-gradient(rgba(255, 255, 255, 0.05) 1.1px, transparent 1.6px) 0 0 / 22px 22px,
    var(--felt-panel);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-bottom: 12px solid var(--edge);
  box-shadow: inset 0 -18px 24px -16px rgba(0, 0, 0, 0.5), 0 18px 40px rgba(0, 0, 0, 0.35);
}
.hud { display: flex; align-items: flex-start; justify-content: center; gap: clamp(0.3rem, 1.6vw, 0.8rem); font-weight: 700; }
.cell { display: grid; justify-items: center; }
.op { font-size: 1.5rem; line-height: 3.7rem; color: var(--cream-dim); }
.box {
  min-width: clamp(4.3rem, 18vw, 5.8rem);
  padding: 0.3rem 0.6rem 0.35rem;
  border-radius: var(--r);
  border-bottom: 6px solid;
  text-align: center; color: #fff;
}
.box small { display: block; font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.88; white-space: nowrap; }
.box b { display: block; font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1.1; font-variant-numeric: tabular-nums; }
.box.c { background: var(--chips); border-color: var(--chips-ink); }
.box.m { background: var(--mult); border-color: var(--mult-ink); }
.box.t {
  min-width: clamp(5.6rem, 24vw, 7.2rem);
  background: var(--night); border-color: #04060d; color: var(--cream-dim);
  box-shadow: inset 0 0 0 2px var(--line);
  transition: color 0.3s, box-shadow 0.3s;
}
.box.t.on { color: var(--brass); box-shadow: inset 0 0 0 2px var(--brass); }
/* as wide as the box above and no wider, so the count never nudges the row sideways */
.adds { width: 0; min-width: 100%; min-height: 1.4rem; margin-top: 0.3rem; text-align: center; font-size: 0.85rem; white-space: pre; font-variant-numeric: tabular-nums; }
.adds.c { color: var(--chips-soft); }
.adds.m { color: var(--mult-soft); }

.line3 {
  --tw: clamp(34px, min(10vw, 7.5vh), 72px);
  display: flex; align-items: flex-end; gap: calc(var(--tw) * 0.7);
  width: calc(var(--tw) * 6.4); height: calc(var(--tw) * 2);
  margin: clamp(0.6rem, 2vh, 1.2rem) auto 0;
}
.line3 .tile { will-change: rotate, translate, opacity; }
html:not(.js) .line3 { display: none; } /* the tiles are drawn by the script */
.pattern {
  min-height: 1.6em; padding: 0.7rem 0 0.75rem;
  text-align: center; color: var(--brass);
  font-size: clamp(0.78rem, 2.4vw, 0.88rem); font-weight: 700; letter-spacing: 0.07em; text-transform: uppercase;
  transition: opacity 0.3s;
}
.pin .pattern { opacity: 0; }
.pin .pattern.on { opacity: 1; }

/* Short screens (small phones, small laptops): tighten the pinned stage so it fits. */
@media (max-height: 700px) {
  .stage .head .label { display: none; }
  .stage .show { font-size: clamp(1.7rem, 4.5vw, 2.4rem); }
  .caps li { padding: 0.7rem 0.9rem 0.8rem; }
  .caps p { font-size: 0.95rem; line-height: 1.45; }
  .pin .stage { padding-top: calc(var(--bar-h) + 0.5rem); }
  .box b { font-size: 1.6rem; }
  .op { line-height: 3.3rem; }
}

/* ---------- How it plays: the plywood rail ---------- */
.rail {
  color: var(--ink);
  background: var(--wood) url("../img/wood.webp") 0 0 / 560px 175px;
  border-block: 6px solid #6e4a2a;
  box-shadow: inset 0 10px 18px -8px rgba(0, 0, 0, 0.45), inset 0 -10px 18px -8px rgba(0, 0, 0, 0.35);
  padding: var(--sect) 0;
}
.rail .show { color: var(--wood-ink); }

.features { display: grid; gap: clamp(2.75rem, 6vw, 4.5rem); margin: 0; padding: 0; list-style: none; }
.feature { display: grid; align-items: center; }
.feature .frame { box-shadow: var(--shadow-wood); }
.feature .frame a { overflow: hidden; }
.feature .frame img { scale: 1.06; transition: filter 0.3s; }
.js:not(.still) .feature .frame img { will-change: transform; }
.feature .frame a:hover img { filter: brightness(1.06); }
.feature .card {
  position: relative; z-index: 1;
  margin: -1.6rem 0.6rem 0; /* tucked over the screenshot's lower edge */
  padding: 1.15rem 1.3rem 1.3rem;
  background: var(--paper);
  border-radius: var(--r);
  border-bottom: 6px solid var(--paper-edge);
  box-shadow: 0 10px 22px rgba(40, 22, 6, 0.45);
}
.feature h3 { display: flex; align-items: center; gap: 0.75rem; font-size: clamp(1.3rem, 3vw, 1.5rem); line-height: 1.2; text-wrap: balance; }
.feature p { margin-top: 0.6rem; color: #2b261d; }
.feature .half {
  flex: none; width: 2.6rem; height: 2.6rem; padding: 0.35rem; /* not a percentage: that would be of the heading's width */
  border-radius: 7px; background: linear-gradient(170deg, #fffaf0, #e4dbc6);
  box-shadow: inset 0 -3px 0 #978a6e, 0 2px 4px rgba(0, 0, 0, 0.3);
}
@media (min-width: 860px) {
  .feature { grid-template-columns: 1.55fr 1fr; }
  .feature .card { margin: 0 0 0 -3rem; rotate: 0.8deg; }
  .feature:nth-child(even) .frame { order: 2; }
  .feature:nth-child(even) .card { margin: 0 -3rem 0 0; rotate: -0.8deg; }
}

/* ---------- What's what: chalkboards in plywood frames, as the game hangs them ---------- */
.guide { padding: var(--sect) 0; }
.gnav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.65rem 0.5rem; width: min(100% - 2 * var(--gutter), 64rem); margin: 0 auto clamp(2rem, 4vw, 2.75rem); }
.gnav a { /* the game's tile buttons, small */
  padding: 0.32rem 0.8rem 0.28rem;
  border-radius: 8px; border-bottom: 4px solid var(--paper-edge);
  background: linear-gradient(180deg, #fbf5e8, var(--paper));
  color: var(--ink); text-decoration: none; font-size: 0.88rem; font-weight: 700;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: translate 0.15s, border-bottom-width 0.15s;
}
.gnav a:hover { background: #fffaf0; }
.gnav a:active { translate: 0 2px; border-bottom-width: 2px; margin-bottom: 2px; }

.bento { display: grid; gap: clamp(1.5rem, 3vw, 2rem); }
@media (min-width: 960px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } .bento .wide { grid-column: 1 / -1; } }
.board { scroll-margin-top: calc(var(--bar-h) + 1rem); }
.slate {
  height: 100%;
  padding: clamp(1.15rem, 3vw, 1.75rem);
  border-radius: 3px;
  color: var(--chalk);
  background:
    radial-gradient(ellipse 70% 50% at 18% 0%, rgba(255, 255, 255, 0.05), transparent 65%),
    radial-gradient(ellipse 50% 40% at 85% 100%, rgba(255, 255, 255, 0.035), transparent 70%),
    var(--chalkboard);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35), inset 0 3px 14px rgba(0, 0, 0, 0.4);
}
.slate > * + * { margin-top: 1.1rem; }
.board h3 { font-family: var(--show); font-weight: 400; font-size: clamp(1.45rem, 3vw, 1.8rem); line-height: 1.1; letter-spacing: 0.03em; text-transform: uppercase; color: var(--brass); }
.board h4 { margin: 0 0 0.6rem; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--chalk-green); }
.board a { color: var(--brass); text-underline-offset: 3px; }
.board .intro { max-width: 52em; }
.board .foot-note { font-size: 0.92rem; color: var(--chalk-dim); }
.board b { color: var(--cream); }
.chalk-note { font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--chalk-dim); }

.facts { margin-bottom: 0; }
.facts div { display: grid; grid-template-columns: 7rem 1fr; gap: 0.75rem; padding: 0.55rem 0; border-top: 1px dashed rgba(207, 214, 208, 0.18); }
.facts dt { font-weight: 700; color: var(--cream); }
.facts dd { margin: 0; }
@media (max-width: 420px) { .facts div { grid-template-columns: 1fr; gap: 0.1rem; } }

/* A table: the game's top-left board and a hand on the rail */
.tb-viz { display: grid; justify-items: center; gap: 0.9rem; }
.scoreboard {
  width: min(100%, 22rem); padding: 0.6rem 0.8rem 0.7rem;
  border-radius: 4px; border: 2px solid #8a6a2c; background: #141a17;
  box-shadow: 0 0 0 1px #000, 0 6px 14px rgba(0, 0, 0, 0.4);
  font-size: 0.85rem;
}
.sb-top { display: flex; justify-content: space-between; gap: 0.5rem; color: var(--brass); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; font-variant-numeric: tabular-nums; }
.sb-bar { height: 6px; margin: 0.45rem 0 0.5rem; border-radius: 3px; background: #2a332f; overflow: hidden; }
.sb-bar i { display: block; width: 35%; height: 100%; background: var(--chalk-green); }
.sb-row { display: flex; align-items: center; gap: 0.45rem; font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--chalk-dim); }
.sb-row .pips { display: flex; gap: 3px; margin-right: 0.6rem; }
.sb-row .pips i { width: 9px; height: 9px; border-radius: 50%; background: #3a4440; }
.sb-row .pips i.on { background: var(--brass); }
.hand-row {
  --tw: clamp(21px, 5.4vw, 30px);
  display: flex; align-items: flex-end; gap: calc(var(--tw) * 0.3);
  padding: 0.7rem 0.85rem 0.9rem; border-radius: 6px;
  background: var(--wood) url("../img/wood.webp") 0 0 / 560px 175px;
  box-shadow: inset 0 -4px 0 rgba(0, 0, 0, 0.25), 0 6px 14px rgba(0, 0, 0, 0.35);
}

/* Tiles and links */
.tl-viz { display: flex; align-items: center; justify-content: center; gap: clamp(1rem, 4vw, 2.25rem); }
.flip { flex: none; padding: 0.5rem; border: 0; border-radius: 10px; background: none; cursor: pointer; }
.flip .tile { transform-origin: 50% 50%; transition: translate 0.2s var(--ease-out); }
.flip:hover .tile { translate: 0 -3px; }
.tile.big { --tw: clamp(52px, 13vw, 68px); }
.callouts { display: grid; gap: 0.6rem; }
.co { padding-left: 0.75rem; border-left: 4px solid; font-size: 0.95rem; line-height: 1.3; }
.co b { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.co span { font-size: 1.2rem; font-weight: 700; }
.co.c { border-color: var(--chips); } .co.c b, .co.c span { color: var(--chips-soft); }
.co.m { border-color: var(--mult); } .co.m b, .co.m span { color: var(--mult-soft); }
.co.hint { padding: 0; border: 0; font-size: 0.85rem; color: var(--chalk-dim); }
.tl-more { display: flex; justify-content: center; gap: clamp(1.5rem, 6vw, 3rem); }
.tl-more figure { --tw: 26px; display: grid; justify-items: center; gap: 0.45rem; margin: 0; }
.tl-more figcaption { max-width: 9rem; text-align: center; font-size: 0.82rem; line-height: 1.35; color: var(--chalk-dim); }
.links { display: grid; gap: 0.75rem; }
.link-row { --tw: clamp(19px, 4.4vw, 25px); display: flex; flex-wrap: wrap; align-items: center; row-gap: 0.4rem; }
.verdict { margin-left: 0.8rem; font-size: 0.9rem; color: var(--chalk-dim); }
.verdict.yes { color: var(--chalk-green); font-weight: 700; }
/* where two tiles meet: a brass staple when they link */
.joint { position: relative; flex: none; width: 8px; height: 10px; }
.joint.on::before { content: ""; position: absolute; left: -5px; right: -5px; top: 0; bottom: 0; border: 2px solid var(--brass); border-radius: 5px; box-shadow: 0 0 6px rgba(233, 195, 106, 0.6); }

/* Patterns: the game's board, with the line each one needs */
.pat-grid { display: grid; gap: 1.25rem; }
.pat-view {
  display: grid; align-content: center; gap: 0.8rem;
  min-height: 9rem; padding: 1rem 0.6rem;
  border-radius: 8px 8px 5px 5px;
  background: radial-gradient(rgba(255, 255, 255, 0.05) 1.1px, transparent 1.6px) 0 0 / 22px 22px, var(--felt-panel);
  border-bottom: 8px solid var(--edge);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.4);
}
@media (min-width: 860px) {
  .pat-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .pat-view { order: 2; position: sticky; top: calc(var(--bar-h) + 1.5rem); padding: 1.25rem; }
}
@media (max-width: 859px) { .pat-view { position: sticky; top: calc(var(--bar-h) + 0.6rem); z-index: 2; } }
.pat-view { container-type: inline-size; }
/* five flat tiles (ten tile widths) and four joints always fit the felt */
.pat-line { --tw: clamp(14px, calc((100cqi - 40px) / 10.4), 34px); display: flex; justify-content: center; align-items: center; min-height: calc(var(--tw) * 1.6); }
.pat-cap { text-align: center; font-size: 0.95rem; color: var(--cream); text-wrap: balance; }
.pat-cap b { color: var(--brass); }
.pat-cap .c { color: var(--chips-soft); } .pat-cap .m { color: var(--mult-soft); }
.pat-list { list-style: none; margin: 0; padding: 0; }
.pat {
  width: 100%;
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "n v" "r v"; gap: 0.1rem 1rem; align-items: center;
  padding: 0.55rem 0.75rem; border: 0; border-bottom: 1px dashed rgba(207, 214, 208, 0.15); border-radius: 0;
  background: transparent; text-align: left; cursor: pointer;
  transition: background-color 0.2s;
}
.pat:hover { background: rgba(255, 255, 255, 0.04); }
.pat[aria-pressed="true"] { background: rgba(233, 195, 106, 0.1); box-shadow: inset 4px 0 0 var(--brass); }
.pn { grid-area: n; font-weight: 700; color: var(--cream); }
.pat[aria-pressed="true"] .pn { color: var(--brass); }
.pr { grid-area: r; font-size: 0.85rem; line-height: 1.35; color: var(--chalk-dim); }
.pv { grid-area: v; display: flex; align-items: center; gap: 0.3rem; color: var(--chalk-dim); font-variant-numeric: tabular-nums; }
.pv b { min-width: 2.5rem; padding: 0.08rem 0.35rem; border-radius: 5px; border-bottom: 3px solid; color: #fff; text-align: center; font-size: 0.95rem; }
.pv .c { background: var(--chips); border-color: var(--chips-ink); }
.pv .m { background: var(--mult); border-color: var(--mult-ink); }

/* Materials */
.mats { list-style: none; margin-bottom: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 7.6rem), 1fr)); gap: 1.5rem 1rem; }
.mats li { --tw: 34px; display: grid; grid-template-rows: 96px auto auto; justify-items: center; align-content: start; gap: 0.35rem; text-align: center; }
.mats .tile { align-self: end; }
.mats li > b { margin-top: 0.3rem; font-size: 1.05rem; }
.mats li > span:last-child { font-size: 0.86rem; line-height: 1.42; color: #aab4ad; }

/* Patrons: five seats on the rail, cards as the game draws them */
.seat-rail {
  padding: 0.75rem 0.85rem 1rem; border-radius: 6px;
  background: var(--wood) url("../img/wood.webp") 0 0 / 560px 175px;
  box-shadow: inset 0 10px 16px -10px rgba(0, 0, 0, 0.5), 0 8px 18px rgba(0, 0, 0, 0.35);
}
.rail-note { margin-left: 0.7rem; font-size: 0.85rem; color: #3b2a17; }
.seats { list-style: none; margin: 0.75rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.7rem; counter-reset: seat; }
.r-common { --card: #efe6d2; --ink2: #1e1e28; }
.r-uncommon { --card: #2a2420; --ink2: #efe6d2; }
.r-rare { --card: #e9c46a; --ink2: #4a3510; }
.r-legend { --card: #3a2466; --ink2: #fff4c2; }
.pcard {
  position: relative; counter-increment: seat;
  display: grid; justify-items: center; align-content: start; gap: 0.4rem;
  padding: 0.7rem 0.55rem 0.75rem; border-radius: 6px;
  background: var(--card); color: var(--ink2); text-align: center;
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.18), 0 6px 12px rgba(40, 22, 6, 0.45);
}
.pcard::before { content: counter(seat); position: absolute; top: 0.3rem; right: 0.5rem; font-size: 0.8rem; font-weight: 700; opacity: 0.55; }
.pcard b { position: relative; width: 100%; padding-top: 0.5rem; border-top: 1px solid currentColor; border-color: color-mix(in srgb, var(--ink2) 30%, transparent); color: inherit; font-size: 0.92rem; line-height: 1.2; }
.pcard b::before { /* the card's brass pin */
  content: ""; position: absolute; top: -4px; left: 50%; width: 7px; height: 7px; margin-left: -3.5px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff1b8, #c9a04f 60%, #8a6a2c);
}
.pcard .pt { font-size: 0.8rem; line-height: 1.35; }
.pcard .rar { margin-top: 0.15rem; padding: 0.08rem 0.45rem; border-radius: 3px; background: var(--ink2); color: var(--card); font-size: 0.62rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
@media (max-width: 759px) { /* one card per row on a phone, still in seat order */
  .seats { grid-template-columns: 1fr; gap: 0.55rem; }
  .pcard { grid-template-columns: 64px 1fr; grid-template-areas: "p b" "p t" "p r"; justify-items: start; text-align: left; column-gap: 0.85rem; row-gap: 0.15rem; }
  .pcard .pp { grid-area: p; align-self: center; }
  .pcard b { grid-area: b; border: 0; padding-top: 0; }
  .pcard b::before { display: none; }
  .pcard .pt { grid-area: t; }
  .pcard .rar { grid-area: r; margin-top: 0.25rem; }
}
/* a portrait: one cell of the sprite sheet, on its category's colour, scaled up with hard pixels */
.pp {
  display: block; flex: none; width: 64px; aspect-ratio: 1; border-radius: 3px;
  background: url("../img/portraits.png") var(--x, 0%) 0 / 1300% 100% no-repeat, var(--cat, transparent);
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.3);
}
.pp-hustler { --x: 0%; } .pp-benito { --x: 8.3333%; } .pp-mirror { --x: 16.6667%; } .pp-cameratwo { --x: 25%; }
.pp-nightowl { --x: 33.3333%; } .pp-glasscannon { --x: 41.6667%; } .pp-champion { --x: 50%; } .pp-grandmaster { --x: 58.3333%; }
.pp-espresso { --x: 66.6667%; } .pp-lemonade { --x: 75%; } .pp-housered { --x: 83.3333%; } .pp-luckycoin { --x: 91.6667%; } .pp-sugarcube { --x: 100%; }
.cat-chips { --cat: #1f3a66; } .cat-mult { --cat: #5a1f1a; } .cat-xmult { --cat: #3a2466; }
.cat-money { --cat: #4a3a12; } .cat-rule { --cat: #1f4e3a; } .cat-grow { --cat: #1f2a4a; } .cat-none { --cat: transparent; box-shadow: none; }

.pat-cols { display: grid; gap: 1.6rem; }
@media (min-width: 860px) { .pat-cols { grid-template-columns: 1fr 1fr 1.15fr; } }
.key-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; font-size: 0.9rem; }
.key-list li { position: relative; padding-left: 1.75rem; line-height: 1.4; }
.key-list b { margin-right: 0.2rem; }
.key-list .sw { position: absolute; left: 0; top: 0.08rem; }
.sw { flex: none; width: 18px; height: 18px; border-radius: 4px; background: var(--card, var(--cat)); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.order p { font-size: 0.92rem; }
.order-box { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-top: 0.8rem; }
.order-base { font-size: 0.85rem; color: var(--chalk-dim); }
.order-base b { font-size: 1.1rem; }
.order-seats { list-style: none; margin: 0; padding: 0; display: flex; gap: 0.5rem; }
.tok { padding: 0.32rem 0.7rem; border-radius: 6px; border-bottom: 4px solid; color: #fff; font-weight: 700; font-size: 0.92rem; white-space: nowrap; }
.tok.add { background: var(--mult); border-color: var(--mult-ink); }
.tok.x { background: #6a48b0; border-color: var(--r-legend, #3a2466); }
.order-seats.swapped .add { order: 2; }
.order-sum { margin-top: 0.7rem; font-variant-numeric: tabular-nums; }
.order-sum b { color: var(--brass); }
.tilebtn {
  margin-top: 0.8rem; padding: 0.42rem 1rem 0.38rem;
  border: 0; border-radius: 8px; border-bottom: 4px solid var(--paper-edge);
  background: linear-gradient(180deg, #fbf5e8, var(--paper)); color: var(--ink);
  font-weight: 700; font-size: 0.9rem; cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}
.tilebtn:hover { background: #fffaf0; }
.tilebtn:active { translate: 0 2px; border-bottom-width: 2px; margin-bottom: 2px; }

/* Matches: the receipt and interest */
.receipt { max-width: 24rem; padding: 0.85rem 1rem; border-radius: 4px; border: 1px dashed rgba(207, 214, 208, 0.25); background: #161c19; font-size: 0.92rem; }
.rc-h { display: block; margin-bottom: 0.35rem; font-family: var(--show); font-weight: 400; font-size: 1.05rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brass) !important; }
.receipt ul { list-style: none; margin: 0; padding: 0; }
.receipt li, .rc-total { display: flex; justify-content: space-between; gap: 1rem; padding: 0.18rem 0; }
.amt { display: inline-flex; align-items: center; gap: 0.25rem; font-weight: 700; color: var(--cream); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-total { margin-top: 0.35rem; padding-top: 0.45rem; border-top: 1px solid rgba(207, 214, 208, 0.25); color: var(--chalk-dim); }
.rc-total .amt { color: var(--brass); }
.interest label { display: flex; justify-content: space-between; font-weight: 700; color: var(--cream); }
.interest output { color: var(--brass); font-variant-numeric: tabular-nums; }
/* the game's slider: brass up to a domino */
.interest input[type="range"] {
  --p: 40%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 30px; margin: 0.35rem 0 0;
  background: transparent; cursor: pointer;
}
.interest input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brass) var(--p), #0c110f var(--p)); }
.interest input[type="range"]::-moz-range-track { height: 6px; border-radius: 3px; background: #0c110f; }
.interest input[type="range"]::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--brass); }
.interest input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 38px; height: 21px; margin-top: -7.5px; border: 0; border-radius: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 20'%3E%3Crect x='.5' y='.5' width='35' height='19' rx='3.5' fill='%23f6eedb' stroke='%23978a6e'/%3E%3Crect x='17.4' y='3' width='1.2' height='14' fill='%236e6453'/%3E%3Cg fill='%232f6fcc'%3E%3Ccircle cx='5.5' cy='5' r='1.7'/%3E%3Ccircle cx='12.5' cy='5' r='1.7'/%3E%3Ccircle cx='9' cy='10' r='1.7'/%3E%3Ccircle cx='5.5' cy='15' r='1.7'/%3E%3Ccircle cx='12.5' cy='15' r='1.7'/%3E%3C/g%3E%3Cg fill='%23bf3a30'%3E%3Ccircle cx='23.5' cy='5' r='1.7'/%3E%3Ccircle cx='30.5' cy='15' r='1.7'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
.interest input[type="range"]::-moz-range-thumb {
  width: 38px; height: 21px; border: 0; border-radius: 4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 36 20'%3E%3Crect x='.5' y='.5' width='35' height='19' rx='3.5' fill='%23f6eedb' stroke='%23978a6e'/%3E%3Crect x='17.4' y='3' width='1.2' height='14' fill='%236e6453'/%3E%3Cg fill='%232f6fcc'%3E%3Ccircle cx='5.5' cy='5' r='1.7'/%3E%3Ccircle cx='12.5' cy='5' r='1.7'/%3E%3Ccircle cx='9' cy='10' r='1.7'/%3E%3Ccircle cx='5.5' cy='15' r='1.7'/%3E%3Ccircle cx='12.5' cy='15' r='1.7'/%3E%3C/g%3E%3Cg fill='%23bf3a30'%3E%3Ccircle cx='23.5' cy='5' r='1.7'/%3E%3Ccircle cx='30.5' cy='15' r='1.7'/%3E%3C/g%3E%3C/svg%3E") center / 100% 100%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}
.sticks { display: flex; flex-wrap: wrap; gap: 0.45rem 0.7rem; min-height: 2.4rem; margin-top: 0.6rem; }
.bundle { display: flex; gap: 3px; padding: 0.25rem 0.35rem; border: 1px dashed transparent; border-radius: 4px; }
.bundle.full { border-color: rgba(233, 195, 106, 0.5); background: rgba(233, 195, 106, 0.08); }
.bundle.capped { border-color: rgba(207, 214, 208, 0.18); background: none; }
.bundle i { width: 4px; height: 26px; border-radius: 2px; background: linear-gradient(180deg, #d9412b 0 6px, #e7c58d 6px); }
.int-says { margin-top: 0.5rem; font-size: 0.95rem; }
.int-says b { color: var(--brass); }

/* The shop's stock, with price tags */
.stock { list-style: none; margin-bottom: 0; padding: 0; }
@media (min-width: 860px) { .stock { columns: 2; column-gap: 2.5rem; } .stock > li { break-inside: avoid; } }
.stock > li { display: grid; grid-template-columns: 4.8rem 1fr; grid-template-areas: "p n" "p t" "p x"; column-gap: 0.9rem; padding: 0.7rem 0; border-top: 1px dashed rgba(207, 214, 208, 0.18); }
.price {
  grid-area: p; align-self: start; justify-self: start;
  display: inline-flex; align-items: center; gap: 0.2rem;
  padding: 0.12rem 0.45rem; border-radius: 4px; border: 1px solid rgba(233, 195, 106, 0.35); background: #141a17;
  color: var(--brass); font-size: 0.85rem; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.stock > li > b { grid-area: n; }
.stock > li > span:not(.price) { grid-area: t; font-size: 0.92rem; }
.stock > li > details, .stock > li > ul { grid-area: x; margin-top: 0.55rem; }
details.more summary { width: fit-content; color: var(--brass); font-size: 0.9rem; cursor: pointer; }
.chalks { list-style: none; margin: 0.5rem 0 0; padding: 0; display: grid; gap: 0.25rem; font-size: 0.85rem; }
.chalks b { margin-right: 0.3rem; }
.drinks { list-style: none; padding: 0; display: grid; gap: 0.5rem; font-size: 0.86rem; line-height: 1.35; }
.drinks li { display: grid; grid-template-columns: 32px 1fr; align-items: center; column-gap: 0.65rem; }
.drinks .pp { width: 32px; }

/* House rules: the headliners' hanging signs */
.signs { list-style: none; margin-bottom: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 12.5rem), 1fr)); gap: 0.6rem; }
.signs li {
  padding: 0.6rem 0.75rem 0.65rem; border-radius: 4px;
  border: 1px solid #2a1c0e; background: linear-gradient(180deg, #5a3d24, #45301c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 4px 8px rgba(0, 0, 0, 0.35);
  color: #e8dcc3; font-size: 0.85rem; line-height: 1.4;
}
.signs b { display: block; margin-bottom: 0.15rem; font-family: var(--show); font-weight: 400; font-size: 0.98rem; letter-spacing: 0.03em; text-transform: uppercase; color: var(--brass); }
.signs .record-sign { border-color: var(--brass); background: linear-gradient(180deg, #2a2016, #1a140e); }

/* Boxes */
.boxes, .modes { list-style: none; margin-bottom: 0; padding: 0; }
.boxes li { display: grid; grid-template-columns: 44px 1fr; grid-template-areas: "i n" "i t"; align-content: start; column-gap: 0.85rem; padding: 0.55rem 0; border-top: 1px dashed rgba(207, 214, 208, 0.18); }
.boxes b { grid-area: n; }
.boxes span { grid-area: t; font-size: 0.9rem; }
.bx { --peek: #f3ead2; grid-area: i; position: relative; align-self: start; justify-self: center; width: 44px; height: 28px; margin-top: 0.55rem; border-radius: 4px; background: var(--bx); box-shadow: inset 0 -5px 0 rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.25), 0 3px 6px rgba(0, 0, 0, 0.4); }
.bx::before { content: ""; position: absolute; left: 0; right: 0; top: 8px; height: 2px; background: rgba(0, 0, 0, 0.25); }
.bx::after { content: ""; position: absolute; left: 50%; top: -8px; width: 9px; height: 13px; margin-left: -4.5px; border-radius: 2px; background: var(--peek); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.bx-sixes { --bx: linear-gradient(180deg, #a87648, #7d532f); }
.bx-brass { --bx: linear-gradient(180deg, #f1d07c, #b98a35); --peek: #e9c36a; }
.bx-blank { --bx: linear-gradient(180deg, #ece6d8, #c9c1ae); }
.bx-painted { --bx: linear-gradient(90deg, #d9412b 0 33%, #3b7dd8 33% 66%, #2e9d6b 66%); }
.bx-ebony { --bx: linear-gradient(180deg, #4a3a30, #241a16); --peek: #3a2d26; }
.bx-pocket { --bx: linear-gradient(180deg, #a87648, #7d532f); width: 30px; height: 22px; margin-top: 0.75rem; }
.box-cols { display: grid; gap: 1.5rem; }
@media (min-width: 860px) {
  .box-cols { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2.5rem; }
  .boxes { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; align-content: start; }
}
.modes { display: grid; gap: 0.5rem; font-size: 0.92rem; }
.modes li { padding-top: 0.5rem; border-top: 1px dashed rgba(207, 214, 208, 0.18); }
.modes b { margin-right: 0.35rem; }

/* ---------- The page's scrollbar: a domino on the game's slider (mouse and trackpad only) ---------- */
.dbar { display: none; }
@media (hover: hover) and (pointer: fine) {
  html.js { scrollbar-width: none; }
  html.js::-webkit-scrollbar { display: none; }
  .js .dbar { display: block; position: fixed; top: 0; right: 0; bottom: 0; z-index: 31; width: 20px; cursor: pointer; }
  .js .prog { display: none; } /* the brass under the bar would say the same thing twice */
  .js .menu-btn { margin-right: 0; } /* clear of the scrollbar */
}
.dbar-track { position: absolute; top: 10px; bottom: 10px; left: 50%; width: 5px; margin-left: -2.5px; border-radius: 3px; background: rgba(4, 6, 14, 0.8); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); overflow: hidden; }
.dbar-fill { position: absolute; inset: 0; background: var(--brass); transform-origin: 50% 0; transform: scaleY(0); }
.dbar-thumb { --tw: 16px; position: absolute; top: 10px; left: 50%; margin-left: -8px; cursor: grab; transform-origin: 50% 50%; touch-action: none; }
.dbar-thumb::after { left: 10%; right: 10%; }
.dbar-thumb .half { padding: 12%; }
.dbar:hover .dbar-thumb, .dbar.drag .dbar-thumb { box-shadow: inset 0 calc(var(--w) * -0.08) 0 #978a6e, 0 0 0 2px var(--brass), 0 3px 7px rgba(0, 0, 0, 0.5); }
.dbar.drag, .dbar.drag .dbar-thumb { cursor: grabbing; }
html.dragging { user-select: none; }

/* ---------- The night: eight hours, then the record ---------- */
.night { background: linear-gradient(180deg, var(--felt) 0, var(--night) 22%); padding: var(--sect) 0; text-align: center; }
.hours-wrap { --dot: clamp(9px, 1.5vw, 14px); position: relative; max-width: 60rem; margin-inline: auto; }
/* the track runs through the middle of the dots: below the 1.6rem time, half a dot down */
.track { position: absolute; left: 0; right: 0; top: calc(1.6rem + var(--dot) / 2 - 2px); height: 4px; border-radius: 2px; background: #243055; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--brass); transform-origin: 0 50%; }
.hours { position: relative; list-style: none; display: grid; grid-template-columns: repeat(8, 1fr); margin: 0; padding: 0; }
.hours li { font-size: clamp(0.85rem, 2.6vw, 1rem); font-variant-numeric: tabular-nums; color: var(--cream-dim); }
.hours time { display: block; height: 1.6rem; }
.trio { display: flex; justify-content: center; gap: clamp(3px, 0.6vw, 6px); }
.trio i, .key i { width: var(--dot, 12px); aspect-ratio: 1; border-radius: 50%; background: var(--brass); border: 2px solid var(--night); transition: background-color 0.2s, scale 0.2s; }
.trio i.hl, .key i.hl { background: var(--mult); }
.js:not(.still) .trio i { background: #243055; }
.js:not(.still) .trio i.lit { background: var(--brass); scale: 1.15; }
.js:not(.still) .trio i.hl.lit { background: var(--mult); }
@media (max-width: 559px) { .hours time span { display: none; } } /* 20, 21, 22 … on a phone */
.key { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.35rem 0.5rem; margin-top: 1.1rem; font-size: 0.9rem; color: var(--cream-dim); }
.key i { display: inline-block; width: 12px; border-width: 0; margin-left: 0.4rem; }
.key b { color: var(--mult-soft); font-weight: 700; }
.record { margin-top: clamp(2.5rem, 6vw, 3.5rem); }
.record b {
  display: block; margin-top: 0.7rem;
  font-size: clamp(2.8rem, 12vw, 6.5rem); line-height: 1;
  color: var(--brass); font-variant-numeric: tabular-nums;
  text-shadow: 0 6px 0 rgba(0, 0, 0, 0.35);
  contain: layout;
}
.record p { margin-top: 0.8rem; color: var(--cream); }

/* ---------- Screenshots: a reel you push sideways ---------- */
.gallery { padding: var(--sect) 0; container-type: inline-size; }
.reel {
  /* the first shot starts on the column's left edge; the reel itself runs to the screen's right edge */
  --pad: max(var(--gutter), calc((100% - var(--wrap)) / 2));
  list-style: none; margin: 0;
  display: flex; gap: clamp(1rem, 2.5vw, 1.5rem);
  padding: 0.5rem var(--pad) 1.25rem;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: var(--pad);
  scrollbar-color: var(--frame) var(--felt-deep);
}
.js .reel { scrollbar-width: none; }  /* with the script there are arrows and dots instead */
.js .reel::-webkit-scrollbar { display: none; }
.reel:focus-visible { outline-offset: -3px; }
.reel li { flex: none; width: 84cqw; scroll-snap-align: start; }
@media (min-width: 760px) {
  /* two shots across the column, the third peeking past its edge */
  .reel li { width: calc((min(100cqw - 2 * var(--gutter), var(--wrap)) - clamp(1rem, 2.5vw, 1.5rem)) / 2); }
}
.reel a { display: block; text-decoration: none; transition: translate 0.25s var(--ease-out); }
.reel a:hover { translate: 0 -6px; }
.reel .frame { box-shadow: 0 10px 22px rgba(0, 0, 0, 0.5); }
.reel span { display: block; margin-top: 0.75rem; color: var(--cream); }
.reel-nav { display: none; align-items: center; justify-content: center; gap: 1rem; margin-top: 0.75rem; }
.js .reel-nav { display: flex; }
.dots { display: flex; align-items: center; }
.dots button { display: grid; place-items: center; width: 22px; height: 30px; padding: 0; border: 0; background: none; cursor: pointer; }
.dots button::before { content: ""; width: 8px; height: 8px; border-radius: 4px; background: var(--line); transition: width 0.3s var(--ease-out), background-color 0.3s; }
.dots button[aria-current="true"] { width: 34px; }
.dots button[aria-current="true"]::before { width: 24px; background: var(--brass); }

/* ---------- About: key art and a taped paper note ---------- */
.about { padding: 0 0 var(--sect); }
.about-in { display: grid; gap: 2.5rem; justify-items: center; align-items: center; }
.poster { width: min(52vw, 210px); rotate: -2deg; }
.poster .frame { box-shadow: var(--shadow-felt); }
.note-paper {
  position: relative;
  max-width: 40rem;
  padding: clamp(1.6rem, 5vw, 2.6rem);
  color: var(--ink);
  background: var(--paper);
  border-radius: 3px;
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.45);
  rotate: -0.6deg;
}
.note-paper::before { /* the tape */
  content: "";
  position: absolute; top: -14px; left: 50%;
  width: 120px; height: 30px; margin-left: -60px;
  background: rgba(233, 195, 106, 0.85);
  rotate: 2deg;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}
.note-paper .show { font-size: clamp(1.7rem, 4.5vw, 2.3rem); color: var(--wood-ink); }
.note-paper p { margin-top: 0.9rem; }
@media (min-width: 760px) {
  .about-in { grid-template-columns: auto minmax(0, 40rem); justify-content: center; gap: clamp(2.5rem, 5vw, 4rem); }
  .poster { width: clamp(200px, 22vw, 260px); }
}

/* ---------- Footer ---------- */
.foot { background: var(--night); border-top: 6px solid var(--wood-dark); padding: 3rem 0 2rem; font-size: 0.95rem; color: var(--cream-dim); }
.foot-grid { display: grid; gap: 2rem; }
@media (min-width: 700px) { .foot-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
.foot h2 { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brass); margin-bottom: 0.6rem; }
.foot ul { list-style: none; margin: 0; padding: 0; }
.foot li { margin: 0.4rem 0; }
.foot a { color: var(--cream); text-underline-offset: 3px; }
.foot a:hover { color: var(--brass); }
.foot .logo-small { width: 170px; margin-bottom: 0.7rem; }
.legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; margin-top: 2.5rem; padding-top: 1.25rem; border-top: 1px solid #1d2747; font-size: 0.85rem; }
.legal .to-top { color: var(--brass); }

/* ---------- The screenshot viewer ---------- */
.lb {
  position: fixed; inset: 0;
  width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: transparent; color: var(--cream);
  overflow: hidden;
}
.lb::backdrop { background: rgba(4, 7, 16, 0.92); }
.lb[open] { animation: lb-in 0.25s ease both; }
.lb[open]::backdrop { animation: fade 0.25s ease both; }
@keyframes lb-in { from { opacity: 0; scale: 0.97; } }
@keyframes fade { from { opacity: 0; } }
.lb figure {
  height: 100%; margin: 0;
  display: grid; place-content: center; justify-items: center; gap: 0.9rem;
  padding: 4.25rem var(--gutter) 5.75rem;
}
.lb img {
  width: auto; height: auto;
  max-width: min(100%, 1600px);
  max-height: calc(100dvh - 12rem);
  border-radius: 6px;
  box-shadow: 0 0 0 6px #9a6b3f, 0 24px 60px rgba(0, 0, 0, 0.6);
  touch-action: pan-y;
  user-select: none;
}
.lb figcaption { max-width: 40em; text-align: center; color: var(--cream-dim); text-wrap: balance; }
.lb-bar {
  position: absolute; left: 0; right: 0; bottom: max(1rem, env(safe-area-inset-bottom));
  display: flex; align-items: center; justify-content: center; gap: 1.25rem;
}
.lb-count { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--cream-dim); }
.lb-x { position: absolute; top: max(0.9rem, env(safe-area-inset-top)); right: var(--gutter); }

/* ---------- Reduced motion: everything still, the count already made ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
