/* the pyramid — one object, one screen, almost no chrome.
   One material (warm sandstone), mineral tints for signs, one accent for "you" and live cues.
   Measured contrast (light / dark):
     ink on paper 15.3 / 15.3, ink-2 6.9 / 8.3, ink-3 5.1 / 6.2, accent 4.9 / 6.4
     stone text on stone (lightest/darkest course) 11.0, 8.5 / 6.6, 10.0
     quiet labels (rows 4+) on stone 6.6, 5.1 / 5.0, 7.5
     white on clay 6.2 / 7.1, sage 5.5 / 6.6, lapis 7.5 / 8.7, rose 5.7 / 6.7; dark on ochre 6.7 / 6.0 */

:root {
  --paper: #f6f2ea;
  --ink: #1f1b16;
  --ink-2: #5a5248;
  --ink-3: #6e665b;
  --line: #e6dfd2;
  --line-2: #9c9384;
  --line-3: #d8cfbf;
  --accent: #c03a1d;
  --stone-hi: #e3d9c8;   /* top courses */
  --stone-lo: #cdbfa8;   /* base courses */
  --stone: #d8ccb8;
  --stone-text: #2a241c;
  --stone-text-2: #4f463a;
  --mortar: #f6f2ea;
  --c-red: #9a4a33;      /* clay */
  --c-yellow: #c49a4c;   /* ochre */
  --c-green: #56704f;    /* sage */
  --c-blue: #3c5677;     /* lapis */
  --c-pink: #97506a;     /* rose */
  --on-yellow: #21180a;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: ui-serif, "New York", "Iowan Old Style", "Palatino Linotype", Palatino, Charter, "Bitstream Charter", Georgia, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --tap: 44px;
  --dock-h: 72px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #14120f;
    --ink: #eee8dd;
    --ink-2: #b5ab9c;
    --ink-3: #9d9384;
    --line: #2a2620;
    --line-2: #6f665a;
    --line-3: #3a342c;
    --accent: #f0714f;
    --stone-hi: #5b5246;
    --stone-lo: #3f382f;
    --stone: #4d453b;
    --stone-text: #f4eee4;
    --stone-text-2: #d9cfc0;
    --mortar: #14120f;
    --c-red: #8c432e;
    --c-yellow: #b88d42;
    --c-green: #4b6345;
    --c-blue: #344d6b;
    --c-pink: #874860;
    --on-yellow: #1d1508;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.45 var(--sans);
  overflow: hidden;
}
[hidden] { display: none !important; }
.sr-only {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
a { color: inherit; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button, input { font: inherit; color: inherit; }

/* ---------- the one screen ---------- */
.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  grid-template-columns: minmax(0, 1fr);
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
.bar.top {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: var(--s3) var(--s4) 0;
}
.wordmark { margin: 0; font-family: var(--serif); font-size: 21px; font-weight: 600; letter-spacing: -0.015em; line-height: 1; white-space: nowrap; }
.net { margin: 0; font-size: 13px; color: var(--ink-3); }
button.icon {
  width: var(--tap); height: var(--tap); border-radius: 50%;
  border: 1px solid var(--line-3); background: transparent; color: var(--ink-2);
  font-family: var(--serif); font-style: italic; font-size: 19px; cursor: pointer;
}
button.icon:hover { border-color: var(--ink); }

.stage {
  position: relative;
  min-height: 0;
  display: flex; flex-direction: column;
  padding: 6px 16px 0;
}
.pyr { display: block; flex: 1 1 auto; min-height: 0; width: 100%; overflow: visible; }

/* blocks: one material, tonal steps by course and seat (--t set per seat from app.js) */
.blk { cursor: pointer; outline: none; }
.blk .shape {
  fill: var(--stone);
  fill: color-mix(in oklab, var(--stone-lo), var(--stone-hi) calc(var(--t, .5) * 100%));
  stroke: var(--mortar); stroke-width: 1; stroke-linejoin: round;
}
.blk .lbl { fill: var(--stone-text-2); font-family: var(--sans); font-weight: 450; text-anchor: middle; dominant-baseline: central; pointer-events: none; letter-spacing: .01em; }
.blk.away .lbl { fill-opacity: .9; }
.blk.empty .shape { fill: none; stroke: var(--line-3); stroke-width: 1; }
.blk.empty .lbl { fill: var(--ink-3); }
/* every owned seat is a tile: its colour fills the whole block (all rows); images sit on top */
.blk.c-red .shape { fill: var(--c-red); }
.blk.c-yellow .shape { fill: var(--c-yellow); }
.blk.c-green .shape { fill: var(--c-green); }
.blk.c-blue .shape { fill: var(--c-blue); }
.blk.c-pink .shape { fill: var(--c-pink); }
.blk.lo[class*=" c-"] .lbl { fill: #fff; font-weight: 500; }
.blk.lo.c-yellow .lbl { fill: var(--on-yellow); }
.blk .strip { fill: var(--stone); pointer-events: none; }
.blk.c-red .strip { fill: var(--c-red); }
.blk.c-yellow .strip { fill: var(--c-yellow); }
.blk.c-green .strip { fill: var(--c-green); }
.blk.c-blue .strip { fill: var(--c-blue); }
.blk.c-pink .strip { fill: var(--c-pink); }
.blk.stripped .lbl { font-weight: 500; }
.blk .veil { fill: var(--stone); fill-opacity: .08; pointer-events: none; transition: fill-opacity .2s ease; }
.blk:hover .veil, .blk.sel .veil, .blk:focus-visible .veil, .blk.me .veil { fill-opacity: 0; }
.blk .imgclip { image-rendering: auto; }
.blk:hover .lbl, .blk.sel .lbl, .blk:focus-visible .lbl, .blk.me .lbl { font-weight: 650; fill: var(--stone-text); }
.blk:hover .shape, .blk.sel .shape { stroke: var(--ink-2); stroke-width: 1.5; }
.blk:focus-visible .shape { stroke: var(--accent); stroke-width: 2.5; }
.blk .mine { fill: none; stroke: var(--accent); stroke-width: 2.5; pointer-events: none; }
.blk .imgclip { pointer-events: none; }
.blk .lk { fill: currentColor; }

/* ground under the base */
.ground { text-align: center; padding: 4px 0 6px; }
.ground p { margin: 0; font-size: 12.5px; color: var(--ink-2); }
.ground-me { color: var(--accent) !important; font-weight: 600; }
.ground-line a { color: var(--ink-2); }
.groundline { stroke: var(--line-2); stroke-width: 1; }

/* popover */
.pop {
  position: absolute; z-index: 5;
  width: min(280px, calc(100% - 32px));
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-3); border-radius: 14px;
  padding: 12px 14px;
}
.pop p { margin: 0; }
.pop-title { font-weight: 650; }
.pop-meta { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); margin-top: 2px !important; }
.pop-img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-top: 8px; background: var(--line); }
.pop-sign { margin-top: 8px !important; overflow-wrap: anywhere; }
.pop-sign:empty { display: none; }
.pop-link { display: inline-block; margin-top: 6px; font-size: 13px; overflow-wrap: anywhere; }

/* ---------- the dock: always visible, clock always racing ---------- */
.bar.bottom {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 14px; flex-wrap: wrap;
  padding: 8px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.me-line { min-width: 0; max-width: 100%; }
.me-line p { margin: 0; white-space: nowrap; }
.clockrow { display: flex; align-items: baseline; gap: 8px; }
.who { font-weight: 650; font-size: 14px; max-width: 9em; overflow: hidden; text-overflow: ellipsis; }
.who:empty { display: none; }
.clock { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; }
.app.paused .clock { color: var(--ink-3); }
.tag { font-family: var(--mono); font-size: 12px; color: var(--accent); font-weight: 600; }
.tag:empty { display: none; }
.posrow { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--ink-2); overflow: hidden; }
.posrow #pos b { color: var(--ink); font-family: var(--mono); font-weight: 600; }
.delta { font-family: var(--mono); color: var(--ink); font-weight: 600; }
.delta.down { color: var(--ink-2); }
.delta:empty, .step:empty, .pull:empty { display: none; }
.step { font-family: var(--mono); font-weight: 700; color: var(--accent); transition: opacity .9s ease; }
.step.fade { opacity: 0; }
.pull { overflow: hidden; text-overflow: ellipsis; }

.actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.act {
  min-height: 36px; padding: 6px 14px; border-radius: 999px;
  border: 1px solid var(--line-3); background: var(--paper); color: var(--ink);
  cursor: pointer; white-space: nowrap; position: relative;
}
.act::after { content: ""; position: absolute; inset: -4px 0; } /* 44px hit area */
.act:hover { border-color: var(--ink); }
.act.strong { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.act.strong:hover { background: var(--accent); border-color: var(--accent); }
.act.ready::before {
  content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 6px;
  border-radius: 50%; background: var(--accent); vertical-align: 1px;
}

/* ---------- sheets (modal dialogs that stop at the dock) ---------- */
dialog.sheet {
  position: fixed; inset: auto 0 calc(var(--dock-h) + 8px) 0; margin: 0 auto;
  width: min(520px, calc(100% - 20px));
  max-height: calc(100dvh - var(--dock-h) - 64px);
  overflow: auto;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-3); border-radius: 18px;
  padding: 20px 20px 18px;
}
dialog.sheet::backdrop { background: rgba(10, 10, 12, .28); bottom: var(--dock-h); }
dialog.sheet h2 { margin: 0 0 4px; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; padding-right: 40px; }
dialog.sheet h3 { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-transform: lowercase; letter-spacing: .04em; }
dialog.sheet p { margin: 6px 0; }
.x {
  position: absolute; top: 10px; right: 10px; width: var(--tap); height: var(--tap);
  border: 0; background: none; font-size: 24px; line-height: 1; cursor: pointer; color: var(--ink-2); border-radius: 50%;
}
.x:hover { color: var(--ink); }
.lede { color: var(--ink-2); }
.rules { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; }
.rules li { display: contents; }
.rules b { text-align: right; }
.rules span { color: var(--ink-2); }
.closing { color: var(--ink-3); font-size: 14px; margin-top: 12px !important; }
.fine { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13.5px; }
.fine li { margin: 2px 0; }
.fine-line { color: var(--ink-2); font-size: 13.5px; }
.links { font-size: 13.5px; color: var(--ink-2); margin-top: 16px !important; }
.links a { display: inline-flex; align-items: center; min-height: var(--tap); }

/* controls inside sheets */
input[type="text"] {
  background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  padding: 8px 2px; min-height: var(--tap); min-width: 0; font-size: 16px;
}
input[type="text"]:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.sheet button:not(.x):not(.ghost):not(.linkish):not(.back-btn):not(.game-btn), .row-form button:not(.ghost), .btns button:not(.ghost) {
  min-height: var(--tap); padding: 8px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); cursor: pointer; white-space: nowrap;
}
.sheet button:not(.x):not(.ghost):not(.linkish):not(.back-btn):not(.game-btn):hover { background: var(--accent); border-color: var(--accent); }
button.ghost {
  min-height: var(--tap); padding: 8px 18px; border-radius: 999px;
  background: transparent; color: var(--ink); border: 1px solid var(--line-2); cursor: pointer;
}
button.ghost:hover { border-color: var(--ink); }
button:disabled { opacity: .45; cursor: default; }
.row-form { display: flex; gap: 10px; align-items: flex-end; margin-top: 10px; }
.row-form input { flex: 1; font-family: var(--mono); }
.msg { min-height: 1.4em; font-size: 14px; }
.msg.bad, .bad { color: var(--accent); }
.msg.muted { color: var(--ink-2); }

/* tasks */
.tasks { list-style: none; margin: 8px 0 0; padding: 0; }
.ch { padding: 10px 0; border-top: 1px solid var(--line); }
.ch-row { display: flex; align-items: center; gap: 12px; }
.ch-text { flex: 1; min-width: 0; }
.ch-title { display: block; }
.ch-desc { display: block; font-size: 13.5px; color: var(--ink-2); }
.ch-meta { font-family: var(--mono); font-size: 13.5px; color: var(--ink-2); white-space: nowrap; }
.ch-row button { min-width: 84px; }
.ch-row button.wait { font-family: var(--mono); background: transparent !important; color: var(--ink-2) !important; border-color: var(--line-3) !important; opacity: 1; }
.ch-body { padding: 12px 0 2px; }
.ch-body .prompt { font-family: var(--mono); font-size: 18px; margin: 0 0 10px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.ch-body form { display: flex; gap: 10px; align-items: flex-end; }
.ch-body form input { flex: 1; font-family: var(--mono); }
.bar-p { height: 3px; background: var(--line); margin: 10px 0 0; overflow: hidden; border-radius: 2px; }
.bar-p > i { display: block; height: 100%; width: 100%; background: var(--ink); transform: scaleX(0); transform-origin: left; }
.hold-btn { width: 100%; min-height: 72px !important; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; touch-action: none; }
.hold-btn.on { background: var(--accent) !important; border-color: var(--accent) !important; }
.hold-count { margin: 6px 0 0; font-family: var(--mono); text-align: center; min-height: 1.4em; color: var(--ink-2); }
.still-count { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 40px; margin: 0; text-align: center; }
.center { text-align: center; }

/* sign editor */
.field { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.field input { flex: 1; }
.count { font-family: var(--mono); font-size: 13px; color: var(--ink-2); min-width: 56px; text-align: right; }
.count.over { color: var(--accent); }
.swatches { border: 0; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.sw { position: relative; width: var(--tap); height: var(--tap); border-radius: 50%; border: 1px solid var(--line-2); cursor: pointer; }
.sw input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.sw:has(input:checked) { outline: 3px solid var(--ink); outline-offset: 2px; }
.sw:has(input:checked)::after { content: ""; position: absolute; inset: 15px; border-radius: 50%; background: var(--paper); }
.sw:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.sw-none { background: var(--stone); }
.sw-red { background: var(--c-red); }
.sw-yellow { background: var(--c-yellow); }
.sw-green { background: var(--c-green); }
.sw-blue { background: var(--c-blue); }
.sw-pink { background: var(--c-pink); }
.img-row { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line-3); }
.filebtn { display: inline-flex; align-items: center; min-height: var(--tap); padding: 8px 18px; border-radius: 999px; border: 1px solid var(--line-2); cursor: pointer; }
.filebtn:hover { border-color: var(--ink); }
.filebtn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.filebtn.busy { opacity: .45; }
.preview { font-family: var(--mono); color: var(--ink); overflow-wrap: anywhere; }
.btns { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* recruit / back */
.tiers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.tiers button { flex: 1 1 130px; }
.tiers .mk { font-size: .7em; margin: 0 6px; }
.tiers .p { font-family: var(--mono); opacity: .8; }
.demo { font-size: 15px; }

@media (max-width: 560px) {
  .bar.bottom { padding-top: 6px; }
  .clock { font-size: 20px; }
  .actions { width: 100%; justify-content: flex-start; }
  .act { flex: 1 1 auto; padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* terms / privacy (scrollable documents) */
body.doc-page { overflow: auto; }
.doc { max-width: 640px; margin: 0 auto; padding: 32px 16px 48px; }
.doc .wordmark a { text-decoration: none; }
.doc h1 { font-size: 26px; margin: 24px 0 8px; }
.doc h2 { font-size: 16px; margin: 24px 0 4px; }
.doc p, .doc li { color: var(--ink-2); }
.doc .draft { color: var(--accent); }
.doc a { display: inline-flex; align-items: center; min-height: var(--tap); }
.blk .mine { transition: stroke-width .6s ease; }
.blk.rise .mine { stroke-width: 7; }

/* live: ticker, running blocks */
.ticker {
  flex: 1 1 auto; min-width: 0; margin: 0; text-align: center;
  font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums; transition: opacity .35s ease;
}
.ticker.swap { opacity: 0; }
.ticker b { color: var(--ink); font-weight: 600; font-family: var(--mono); }
.beat { fill: var(--accent); opacity: 0; pointer-events: none; }
.blk.run .beat { animation: beat 2.4s ease-in-out infinite; }
.blk.hi.c-yellow .beat { fill: var(--on-yellow); }
.blk.hi[class*=" c-"]:not(.c-yellow) .beat { fill: #fff; }
@keyframes beat { 0%, 100% { opacity: .15; } 50% { opacity: .85; } }
.blk { transform-box: view-box; }
.blk.flip { transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.blk.moved .shape { stroke: var(--accent); stroke-width: 2.5; }
@media (prefers-reduced-motion: reduce) {
  .blk.run .beat { animation: none; opacity: .6; }
  .blk.flip { transition: none; }
}
@media (max-width: 560px) {
  .wordmark { font-size: 15px; }
  .ticker { font-size: 12px; }
}
.pyr:focus { outline: none; }

/* text set directly in the svg (measured and wrapped in app.js) */
.blk .sgt, .blk .own { fill: var(--stone-text); font-family: var(--sans); text-anchor: middle; pointer-events: none; }
.blk .sgt { letter-spacing: -0.01em; }
.blk .own { font-weight: 500; font-variant-numeric: tabular-nums; fill: var(--stone-text-2); }
.blk .sgt.rent { font-family: var(--serif); font-style: italic; letter-spacing: 0; fill: var(--stone-text-2); }
.blk a.sl .sgt { pointer-events: auto; cursor: pointer; }
.blk a.sl:hover .sgt { text-decoration: underline; text-decoration-thickness: 1px; }
.blk .bandp { fill: var(--stone); pointer-events: none; }
.blk.empty .sgt, .blk.empty .own { fill: var(--ink-3); }
.blk.hi[class*=" c-"] .sgt, .blk.hi[class*=" c-"] .own { fill: #fff; }
.blk.hi.c-yellow .sgt, .blk.hi.c-yellow .own { fill: var(--on-yellow); }
.blk.c-red .bandp { fill: var(--c-red); }
.blk.c-yellow .bandp { fill: var(--c-yellow); }
.blk.c-green .bandp { fill: var(--c-green); }
.blk.c-blue .bandp { fill: var(--c-blue); }
.blk.c-pink .bandp { fill: var(--c-pink); }

/* short screens: clock and position share one line; the 'next thing' line yields first */
@media (max-height: 700px) {
  .me-line { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
  .posrow .pull { display: none; }
  .bar.top { padding-top: 6px; }
  .ground { padding: 2px 0 4px; }
}
@media (max-width: 360px) {
  .clock { font-size: 18px; }
  .act { min-height: 34px; }
}

/* ---------- art direction pass ---------- */
.ticker { font-size: 12px; letter-spacing: .04em; color: var(--ink-3); }
.ticker b { font-weight: 600; color: var(--ink-2); }
.ground { padding: var(--s2) 0 var(--s2); }
.ground p { font-size: 12px; letter-spacing: .03em; line-height: 1.6; }
.ground-me { font-weight: 600; }
.groundline { stroke: var(--line-3); stroke-width: 1; }
.bar.bottom { border-top-color: var(--line); padding-left: var(--s4); padding-right: var(--s4); }
.clock { letter-spacing: -0.01em; }
.who { font-family: var(--serif); font-size: 15px; font-weight: 600; }
.posrow { letter-spacing: .02em; }
.tag { letter-spacing: .03em; }
.act { border-color: var(--line-3); background: transparent; }
.act.strong { background: var(--ink); color: var(--paper); }

/* seat card */
.pop { border-radius: 16px; border-color: var(--line-3); padding: var(--s3) var(--s4) var(--s4); background: var(--paper); }
.pop-title { font-family: var(--serif); font-size: 17px; }
.pop-meta { letter-spacing: .02em; }
.pop-link {
  display: inline-flex; align-items: center; min-height: 36px; margin-top: var(--s2);
  padding: 4px 12px; border-radius: 999px; background: var(--ink); color: var(--paper) !important;
  text-decoration: none; font-weight: 600; font-size: 14px;
}
.pop-link:hover { background: var(--accent); }
.pop-img { border-radius: 10px; }
.pop-sign { line-height: 1.4; }

/* sheets */
dialog.sheet { border-radius: 20px; border-color: var(--line-3); padding: var(--s5) var(--s5) var(--s4); }
dialog.sheet::backdrop { background: rgba(20, 16, 10, .32); }
dialog.sheet h2 { font-family: var(--serif); font-size: 22px; font-weight: 600; }
dialog.sheet h3 { letter-spacing: .08em; }
.flabel { display: block; margin-top: var(--s3); font-size: 12px; letter-spacing: .08em; color: var(--ink-3); }
.flabel .opt { letter-spacing: .02em; opacity: .9; margin-left: 4px; }
.flabel + .field { margin-top: 0; }
.rules b { font-family: var(--serif); font-weight: 600; }
.sw-none { background: var(--stone); }

/* ---------- play: twelve games ---------- */
.games { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--s2); }
.game-btn {
  width: 100%; min-height: 58px; display: grid; grid-template-columns: 1fr auto; grid-template-areas: "t t" "m s";
  gap: 2px 8px; align-items: baseline; text-align: left;
  padding: 10px 12px !important; border-radius: 14px !important;
  background: transparent !important; color: var(--ink) !important; border: 1px solid var(--line-3) !important;
}
.game-btn:hover:not(:disabled) { border-color: var(--ink-2) !important; }
.game-btn:disabled { opacity: 1; cursor: default; }
.game-btn:disabled .g-title { color: var(--ink-2); }
.g-title { grid-area: t; font-weight: 600; font-size: 14.5px; }
.g-meta { grid-area: m; font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); }
.g-state { grid-area: s; font-size: 12px; letter-spacing: .04em; color: var(--ink-3); font-family: var(--mono); }
.game.ready .g-state { color: var(--accent); font-weight: 600; }
.game.ready .g-state::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-right: 5px; vertical-align: 1px; }
.cap { margin-top: var(--s2); }
.cap-bar { height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; margin-top: 4px; }
.cap-bar > i { display: block; height: 100%; width: 100%; background: var(--ink-2); transform: scaleX(0); transform-origin: left; }
.game-view { margin-top: var(--s2); }
.back-btn { background: none !important; color: var(--ink-2) !important; border: 0 !important; padding: 0 !important; min-height: var(--tap); cursor: pointer; font-size: 14px; }
.back-btn:hover { color: var(--ink) !important; }
.game-title { margin: 4px 0 0 !important; font-family: var(--serif); font-size: 19px !important; font-weight: 600; color: var(--ink) !important; letter-spacing: 0 !important; text-transform: none !important; }
.game-title:focus { outline: none; }
.game-body { margin-top: var(--s3); }
.game-body .fine-line { margin-top: var(--s2); }
.big-btn { width: 100%; min-height: 96px !important; font-size: 20px; font-weight: 650; border-radius: 18px !important; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.big-btn.react.wait { background: var(--stone) !important; color: var(--stone-text) !important; border-color: var(--stone) !important; }
.big-btn.react.go { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.big-btn.react.early { background: transparent !important; color: var(--accent) !important; border-color: var(--accent) !important; }
.big-count, .stopwatch { font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 34px; font-weight: 600; text-align: center; margin: 0 0 var(--s2) !important; }
.digits { font-family: var(--mono); font-size: 34px; letter-spacing: .08em; text-align: center; margin: var(--s3) 0 !important; }
.shapes { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto var(--s2); }
.shapes .shp { fill: var(--stone-lo); stroke: var(--ink-2); stroke-width: 1; }
.readout { font-family: var(--mono); font-size: 12.5px; }
.tiles { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin: var(--s2) 0 var(--s3) !important; }
.tile { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 44px; border-radius: 8px; background: var(--stone); color: var(--stone-text); font-family: var(--mono); font-size: 20px; font-weight: 600; }
.stack { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 40px; margin-bottom: var(--s3); }
.laid-brick { display: block; height: 10px; border-radius: 2px; background: var(--stone-lo); }
.tray { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brick { min-height: 30px !important; padding: 0 !important; border-radius: 6px !important; background: var(--stone) !important; border: 1px solid var(--stone-lo) !important; color: transparent !important; }
.brick:hover:not(:disabled) { border-color: var(--ink-2) !important; }
.brick.laid { visibility: hidden; }
.brick.wrong { border-color: var(--accent) !important; background: transparent !important; }
.odd-grid { display: grid; gap: 4px; max-width: 320px; margin: 0 auto; }
.odd-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.odd-cell { min-height: 48px !important; padding: 0 !important; border-radius: 8px !important; background: var(--stone) !important; color: var(--stone-text) !important; border: 1px solid transparent !important; font-family: var(--mono); font-size: 18px; }
.odd-cell:hover { border-color: var(--ink-2) !important; }
.odd-cell.picked { border-color: var(--accent) !important; }
.result { font-size: 18px; font-weight: 600; margin: var(--s2) 0 0 !important; }
.result.ok { color: var(--ink); }
.result.bad { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .big-btn, .brick { transition: none; } }

/* ---------- states: loading, offline, no script ---------- */
.silhouette { position: absolute; left: 16px; top: 6px; width: calc(100% - 32px); height: calc(100% - 62px); pointer-events: none; }
.silhouette path { fill: var(--stone); }
.silhouette path.c { fill: none; stroke: var(--mortar); stroke-width: .35; }
.noscript { margin: 0; font-size: 13px; color: var(--ink-2); }
.app.stale .pyr { opacity: .55; transition: opacity .4s ease; }
.net { color: var(--accent); font-size: 12.5px; text-align: center; flex: 1 1 auto; }
.net + .icon { margin-left: 0; }

/* ---------- strip ---------- */
.prompt-line {
  flex-basis: 100%; margin: 0 0 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  font-size: 13.5px; color: var(--ink);
}
.prompt-line .linkish { min-height: 32px; font-weight: 600; }
.prompt-line .linkish.quiet { font-weight: 400; color: var(--ink-3); }
button.who {
  background: none; border: 0; padding: 0 2px; min-height: 32px; cursor: pointer; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 3px;
}
button.who:hover { text-decoration-color: var(--ink-2); }
.clock .hs { font-size: .62em; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.unsaved { font-size: 11px; letter-spacing: .06em; color: var(--ink-3); border: 1px solid var(--line-3); border-radius: 999px; padding: 1px 7px; }
.pull.warn { color: var(--accent); font-weight: 600; }
.act.done::after { content: " ✓"; color: var(--ink-2); position: static; inset: auto; }
@media (max-width: 560px) { .act { min-height: 44px; } }

/* since you left */
.awaycard {
  position: absolute; left: 50%; bottom: 52px; transform: translateX(-50%); z-index: 4;
  width: min(420px, calc(100% - 32px)); display: flex; align-items: center; gap: 12px;
  background: var(--paper); border: 1px solid var(--line-3); border-radius: 14px; padding: 10px 12px 10px 16px;
}
.away-t { margin: 0; flex: 1; font-size: 13.5px; color: var(--ink); }
.ghost-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 6px 16px;
  border-radius: 999px; border: 1px solid var(--line-3); background: transparent; color: var(--ink); cursor: pointer; text-decoration: none; font: inherit;
}
.ghost-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.ghost-btn.small { min-height: 36px; padding: 4px 12px; font-size: 13px; }

/* seat card extras; phones get a bottom sheet */
.pop-rank { margin-top: 8px !important; font-size: 12.5px; color: var(--ink-3); letter-spacing: .02em; }
.pop-actions { display: flex; gap: 8px; margin-top: 10px; }
.pop-actions:not(:has(:not([hidden]))) { display: none; }
.report { margin-top: 10px; }
.report fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: 2px; }
.report legend { font-size: 13px; color: var(--ink-2); margin-bottom: 4px; }
.report label { display: flex; align-items: center; gap: 8px; min-height: 36px; font-size: 14px; }
.report input[type=text] { width: 100%; font-size: 15px; }
.pop.sheetish {
  position: fixed; left: 0; right: 0; bottom: var(--dock-h); top: auto !important; width: auto;
  border-radius: 18px 18px 0 0; padding: 16px 20px 20px; max-height: 70dvh; overflow: auto; z-index: 20;
}
.pop.sheetish .pop-link, .pop.sheetish .ghost-btn.small { min-height: var(--tap); }

/* lock-in */
.lock-time { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
.gbtn {
  display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; min-height: 44px; margin-top: 16px;
  padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid #747775; color: #1f1f1f;
  font-family: Roboto, "Helvetica Neue", Arial, system-ui, sans-serif; font-weight: 500; font-size: 15px; text-decoration: none;
}
.gbtn:hover { background: #f8f9fa; color: #1f1f1f; }
.gbtn .g { width: 20px; height: 20px; flex: 0 0 20px; }
.gbtn.busy { opacity: .7; pointer-events: none; }
@media (prefers-color-scheme: dark) {
  .gbtn { background: #131314; border-color: #8e918f; color: #e3e3e3; }
  .gbtn:hover { background: #1f1f20; color: #e3e3e3; }
}
.or { display: flex; align-items: center; gap: 10px; margin: 14px 0 2px; color: var(--ink-3); font-size: 12px; letter-spacing: .08em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.row-form.tight { margin-top: 0; }
input[type="email"] {
  background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0;
  padding: 8px 2px; min-height: var(--tap); min-width: 0; font-size: 16px; flex: 1; color: inherit; font-family: inherit;
}
input[type="email"]:focus-visible { outline: none; border-bottom-color: var(--accent); box-shadow: 0 1px 0 var(--accent); }
.turnstile { position: absolute; width: 0; height: 0; overflow: hidden; margin: 0; padding: 0; border: 0; } /* invisible; stays in the DOM */
.ts-note { font-size: 12px; color: var(--ink-3); margin-top: 6px !important; }
.ts-note a { color: var(--ink-3); }
.dev-form { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line-3); }
.cookie-path { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.cookie-path .linkish { padding-left: 0; color: var(--ink-2); }

/* account */
.facts { margin: 12px 0; display: grid; gap: 6px; }
.facts div { display: grid; grid-template-columns: 9em 1fr; gap: 8px; }
.facts dt { color: var(--ink-3); font-size: 13px; letter-spacing: .04em; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.danger { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 10px; }
.danger summary { cursor: pointer; color: var(--accent); min-height: var(--tap); display: flex; align-items: center; }
.danger-btn { background: var(--accent) !important; border-color: var(--accent) !important; color: #fff !important; }
.toggle { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: var(--tap); }
.toggle input { width: 20px; height: 20px; }
.toggle .fine-line { flex-basis: 100%; margin: 0; }

/* pause motion: everything decorative stops; clocks keep counting */
.motion-paused .blk.run .beat { animation: none; opacity: .6; }
.motion-paused .blk.flip, .motion-paused .ticker, .motion-paused .step, .motion-paused .blk .mine { transition: none; }
button.linkish {
  background: none; border: 0; padding: 0 4px; min-height: var(--tap); cursor: pointer; font: inherit; color: var(--ink);
  text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px;
}
button.linkish:hover { color: var(--accent); text-decoration-color: currentColor; }

/* 404 */
.lost { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px 16px; }
.lost-pyr { width: min(240px, 60vw); height: auto; margin-bottom: 16px; }
.lost-pyr .s { fill: none; stroke: var(--line-3); stroke-width: .8; stroke-dasharray: 2 1.5; }
.lost-pyr .v { fill: var(--stone); }
.lost h1 { font-family: var(--serif); font-size: 30px; margin: 0 0 8px; font-weight: 600; }
.lost p { color: var(--ink-2); margin: 4px 0; max-width: 34em; }
.app.stale .ticker { display: none; }
.app.stale .net { white-space: normal; }

/* magic-link confirm page (server html: <main class="verify">) */
body:has(main.verify) { overflow: auto; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 16px; }
main.verify {
  width: min(420px, 100%); display: flex; flex-direction: column; align-items: center;
  padding: 36px 28px 32px; text-align: center; background: var(--paper);
  border: 1px solid var(--line-3); border-radius: 20px;
}
main.verify h1 {
  margin: 0 0 20px; font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
}
main.verify h1::before {
  content: ""; display: block; width: 64px; height: 52px; margin: 0 auto 18px;
  background: var(--stone); clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
main.verify p { color: var(--ink-2); max-width: 32em; margin: 6px 0; }
main.verify form { margin: 0; }
main.verify button, main.verify a.btn {
  min-height: var(--tap); min-width: 200px; padding: 10px 28px; border-radius: 999px; cursor: pointer;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink); font: inherit; font-weight: 600; font-size: 16px; text-decoration: none;
}
main.verify button:hover, main.verify a.btn:hover { background: var(--accent); border-color: var(--accent); }
main.verify a { color: var(--ink-2); }
.devlink { font-weight: 600; }
.doc .muted-date { color: var(--ink-3); font-size: 13px; }
/* short phones: keep the ground and prompt to one line each so the pyramid keeps its room */
@media (max-height: 640px) {
  .ground p { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .prompt-line { flex-wrap: nowrap; white-space: nowrap; overflow: hidden; }
  .prompt-line #prompt-t { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}
.blk .veil { stroke: var(--mortar); stroke-width: 1; }

.blk.worded .lbl { text-anchor: start; font-weight: 500; }

/* sign editor: drop target, crop, tile previews */
.img-row.over { outline: 2px dashed var(--accent); outline-offset: 4px; border-radius: 10px; }
.drop-hint { margin: 0 !important; }
.crop { margin-top: 12px; }
.crop-canvas { display: block; width: 240px; height: 240px; max-width: 100%; border-radius: 12px; border: 1px solid var(--line-3); touch-action: none; cursor: grab; background: var(--stone); }
.crop-canvas:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#crop-zoom { width: 240px; max-width: 100%; }
.tiles-preview { display: flex; gap: 12px; align-items: flex-end; margin-top: 14px; flex-wrap: wrap; }
.tiles-preview figure { margin: 0; display: flex; flex-direction: column; gap: 4px; max-width: 150px; }
.tiles-preview figcaption { font-size: 11.5px; color: var(--ink-3); line-height: 1.3; }
.tp { display: flex; align-items: center; gap: 6px; overflow: hidden; background: var(--stone); color: var(--stone-text); border-radius: 3px; padding: 3px; font-size: 10px; font-weight: 600; }
.tp img { width: 22px; height: 22px; object-fit: cover; flex: 0 0 auto; }
.tp span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-low { width: 72px; height: 28px; }
.tp-mid { width: 120px; height: 46px; font-size: 11px; }
.tp-mid img { width: 36px; height: 36px; }
.tp-cap { width: 120px; height: 104px; clip-path: polygon(50% 0, 100% 100%, 0 100%); flex-direction: column; justify-content: flex-end; padding-bottom: 8px; font-size: 10px; }
.tp-cap img { width: 40px; height: 40px; }
.tp-cap span { white-space: normal; text-align: center; max-width: 70px; }
.tp.c-red { background: var(--c-red); color: #fff; } .tp.c-green { background: var(--c-green); color: #fff; }
.tp.c-blue { background: var(--c-blue); color: #fff; } .tp.c-pink { background: var(--c-pink); color: #fff; }
.tp.c-yellow { background: var(--c-yellow); color: var(--on-yellow); }
