/* Kessel Sabacc web client: "Smoke and Brass".
   One stylesheet, no build step. A single dark look -- burgundy felt, brass
   rails, cream ink -- so there is no light variant to keep in step.

   Motion rule: anything that moves does so through transform, translate,
   rotate, scale or opacity only, so the browser can composite it without
   laying the page out again, at whatever rate the display refreshes. */

:root {
  --ground:     #0b0807;
  --brass:      #c39a49;
  --brass-hi:   #e9c680;
  --brass-lo:   #b78a35;
  --brass-deep: #a5763a;
  --ink:        #efe7d4;
  --ink-hi:     #f6ecd3;
  --ink-warm:   #e8d9b8;
  --dim:        #a8937a;
  --dim-2:      #8f785d;
  --faint:      #7d6a55;
  --good:       #93c476;
  --bad:        #d7524f;
  --bad-soft:   #e59087;
  --line:       rgba(195, 154, 73, 0.2);
  --line-hi:    rgba(195, 154, 73, 0.45);
  --panel:      linear-gradient(180deg, rgba(40, 25, 19, 0.92), rgba(18, 12, 10, 0.94));

  --serif: "Gambarino", Georgia, "Times New Roman", serif;
  --sans:  "Karla", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --ease-out:    cubic-bezier(0.22, 0.8, 0.26, 1);
  --ease-in-out: cubic-bezier(0.62, 0.04, 0.2, 1);
  --ease-spring: cubic-bezier(0.3, 1.45, 0.5, 1);

  --masthead: 58px;
  /* The round table and everything sized from it. On a wide screen the whole
     table screen fits the window, so nothing about a game needs scrolling. */
  --table:  clamp(300px, min(84vw, calc(100dvh - 286px)), 700px);
  --plate:  clamp(96px, calc(var(--table) * 0.233), 154px);
  --pile-w: calc(var(--table) * 0.1);
  --hand-w: clamp(84px, calc(var(--table) * 0.17), 112px);

  color-scheme: dark;
}

@supports (animation-timing-function: linear(0, 1)) {
  :root {
    --ease-spring: linear(0, 0.0646, 0.2143, 0.4012, 0.5892, 0.7556, 0.8892, 0.9864, 1.0494, 1.0834,
      1.0953, 1.0921, 1.0803, 1.0647, 1.049, 1.0351, 1.024, 1.0159, 1.0105, 1.0072, 1.0052, 1.0037, 1.0022, 1.0008, 1);
  }
}

* { box-sizing: border-box; }

/* Several elements below set an explicit display, which would otherwise win
   against the `hidden` attribute and leave them on screen. */
[hidden] { display: none !important; }

html { background: var(--ground); }

body {
  margin: 0;
  min-height: 100dvh;
  font: 15px/1.55 var(--sans);
  color: var(--ink);
  background:
    radial-gradient(90% 60% at 50% -8%, #40271a 0%, #1c1210 44%, transparent 100%) fixed,
    radial-gradient(70% 50% at 50% 112%, #24120f 0%, transparent 70%) fixed,
    var(--ground);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* A film of grain over everything, so the dark never bands or looks flat.
   Plain alpha, no blend mode: a blended full-screen layer would have to be
   recomposited against the whole page on every frame of every animation. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  background: url("../assets/textures/grain.svg");
  opacity: 0.055;
  pointer-events: none;
}

h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; color: var(--ink-hi); text-wrap: balance; }
code { font-family: var(--mono); font-size: 0.9em; color: var(--brass); }
em { font-style: normal; color: var(--ink-warm); }

.kicker {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brass-deep);
}

/* Shift tokens are drawn in grey; wherever one is live its glyph turns brass. */
.live svg .ink [fill]:not([fill="none"]) { fill: var(--brass-hi); }
.live svg .ink [stroke]:not([stroke="none"]) { stroke: var(--brass-hi); }

/* ---------- buttons ---------- */

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
button:disabled { cursor: default; }

:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 3px; }

.brass, .ghost, .pill {
  transition: scale 0.18s var(--ease-out), background-color 0.2s, border-color 0.2s, color 0.2s, box-shadow 0.25s;
}
.brass:active:not(:disabled), .ghost:active:not(:disabled), .pill:active { scale: 0.96; }

.brass {
  position: relative;
  padding: 13px 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid #f0d08c;
  border-radius: 3px;
  color: #1a1008;
  background: linear-gradient(180deg, #efcf8b 0%, var(--brass) 55%, #a87c2e 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45), inset 0 -1px 0 rgba(0, 0, 0, 0.25), 0 6px 18px rgba(0, 0, 0, 0.45);
}
.brass:hover:not(:disabled) {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(0, 0, 0, 0.25),
    0 8px 26px rgba(0, 0, 0, 0.5), 0 0 22px rgba(233, 198, 128, 0.35);
}
.brass[aria-pressed="true"] {
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.4), 0 0 0 2px rgba(233, 198, 128, 0.5), 0 0 24px rgba(233, 198, 128, 0.4);
}
.brass.wide { width: 100%; padding: 16px; font-size: 15px; letter-spacing: 0.18em; }

.ghost {
  padding: 12px 22px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid rgba(195, 154, 73, 0.4);
  border-radius: 3px;
  color: var(--brass-hi);
  background: rgba(195, 154, 73, 0.07);
}
.ghost:hover:not(:disabled) { border-color: var(--brass); background: rgba(195, 154, 73, 0.18); }
.ghost[aria-pressed="true"] { border-color: var(--brass-hi); background: rgba(195, 154, 73, 0.24); }

.pill {
  padding: 8px 15px;
  font-size: 11.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid rgba(195, 154, 73, 0.28);
  border-radius: 999px;
  color: var(--dim);
}
.pill:has(.pill-icon) { display: inline-flex; align-items: center; gap: 7px; }
.pill-icon { width: 14px; height: 14px; flex: none; }
/* A pill that is only its icon: a circle as tall as the pills beside it. */
.pill.icon-only { justify-content: center; padding: 0; width: 36px; height: 36px; }
.pill.icon-only .pill-icon { width: 15px; height: 15px; }
.pill:hover { color: var(--ink); border-color: var(--brass); }
.pill[aria-expanded="true"], .pill[aria-pressed="true"] { color: var(--ink-hi); border-color: var(--brass-hi); background: rgba(195, 154, 73, 0.16); }
.masthead-actions { display: flex; gap: 8px; }
/* Giving the seat up cannot be undone during a game, so it reads as a warning
   and takes a second click; the first only arms it. */
.pill.danger { color: var(--bad-soft); border-color: rgba(220, 110, 90, 0.35); }
.pill.danger:hover { color: #ffd9d5; border-color: var(--bad); }
.pill.danger.armed { color: #ffd9d5; border-color: var(--bad); background: rgba(160, 50, 40, 0.35); }

.link {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  border-bottom: 1px solid rgba(195, 154, 73, 0.35);
  transition: color 0.2s, border-color 0.2s;
}
.link:hover { color: var(--brass-hi); border-color: var(--brass-hi); }

/* ---------- masthead ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 18px;
  height: var(--masthead);
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(22, 14, 11, 0.94), rgba(13, 9, 8, 0.82));
  backdrop-filter: blur(10px);
}
.brand { display: flex; align-items: baseline; gap: 14px; flex: 1; min-width: 0; }
.wordmark {
  font-family: var(--serif);
  font-size: 22px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  white-space: nowrap;
  background: linear-gradient(180deg, #f6ecd3, #cfae6d);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.masthead-table { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--dim-2); }
.masthead-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dim-2);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); transition: background-color 0.3s, box-shadow 0.3s; }
.dot.live { background: var(--good); box-shadow: 0 0 10px rgba(147, 196, 118, 0.8); }
.dot.lost { background: var(--bad); animation: pulse 1s ease-in-out infinite; }

/* ---------- settings ---------- */

.settings {
  position: fixed;
  top: calc(var(--masthead) + 10px);
  right: 28px;
  z-index: 45;
  width: 290px;
  padding: 18px 18px 16px;
  border: 1px solid var(--line-hi);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(34, 21, 16, 0.98), rgba(14, 9, 8, 0.98));
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 236, 190, 0.07);
  animation: pop-in 0.22s var(--ease-out);
  transform-origin: 90% 0;
}
.settings .kicker { margin-bottom: 14px; }
.set-note { margin: 6px 0 16px; font-size: 12px; line-height: 1.45; color: var(--faint); }
/* Who this browser plays as. */
.set-player { margin: 4px 0 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.set-label { margin: 0 0 4px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim-2); }
.set-player-id { margin: 0; font-size: 14px; color: var(--ink); }
.set-player-id code { color: var(--brass-hi); }
.set-player-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -4px; }
.set-player-use { display: flex; gap: 8px; margin-top: 10px; }
.set-player-use input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-hi); border-radius: 4px; background: rgba(0, 0, 0, 0.35); color: var(--ink); font: 12px var(--mono); }
.ghost.small, .brass.small { padding: 6px 12px; font-size: 10.5px; }
/* How long a seat took, in the log and the standings. */
#log li.timing { color: var(--dim-2); font-size: 0.92em; }
.settings .picker legend { margin-bottom: 8px; }

/* A switch: a checkbox drawn as a track with a knob that slides across. */
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch-track {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(195, 154, 73, 0.4);
  background: rgba(0, 0, 0, 0.45);
  transition: background-color 0.25s, border-color 0.25s;
}
.switch-track::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--dim);
  transition: translate 0.3s var(--ease-spring), background-color 0.25s;
}
.switch input:checked + .switch-track { background: rgba(195, 154, 73, 0.3); border-color: var(--brass-hi); }
.switch input:checked + .switch-track::after { translate: 18px 0; background: var(--brass-hi); }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--brass-hi); outline-offset: 3px; }
.switch-text { font-size: 14px; color: var(--ink); }

.slider { display: block; margin-top: 4px; }
.slider-head { display: flex; justify-content: space-between; font-size: 13px; color: var(--dim); }
.slider output { font-family: var(--mono); color: var(--brass-hi); }
.slider input { width: 100%; margin: 8px 0 12px; accent-color: var(--brass); cursor: pointer; }

/* ---------- lobby ---------- */

/* Everything above the fold is sized from the window's height as well as its
   width, so the form to open a table is on screen without scrolling. */
.lobby { max-width: 1180px; margin: 0 auto; padding: clamp(16px, 2.6vh, 52px) 28px 72px; }
.lobby > * { animation: rise 0.6s var(--ease-out) backwards; }
.lobby > :nth-child(2) { animation-delay: 60ms; }
.lobby > :nth-child(3) { animation-delay: 120ms; }
.lobby > .hero { animation: none; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 36px;
  margin-bottom: clamp(14px, 2.4vh, 44px);
}
.headline {
  margin: 10px 0 10px;
  font-size: clamp(38px, min(6vw, 7.2vh), 84px);
  line-height: 0.96;
  letter-spacing: -0.01em;
}
/* Each line of the headline rises out from behind its own bottom edge. */
.headline .line { display: block; overflow: hidden; padding-bottom: 0.09em; }
.headline .line > span { display: inline-block; animation: line-up 0.95s var(--ease-out) backwards; }
.headline .line:nth-child(2) > span {
  animation-delay: 0.13s;
  background: linear-gradient(180deg, #f3d595 10%, var(--brass) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.lede { margin: 0; max-width: 44ch; font-size: 16.5px; color: var(--dim); animation: rise 0.7s 0.3s var(--ease-out) backwards; }

a.brass, a.ghost, a.pill { display: inline-flex; align-items: center; text-decoration: none; }
.ghost:hover { border-color: var(--brass-hi); background: rgba(195, 154, 73, 0.16); }

/* The game in four numbers, counted up as the page opens. */
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 30px; margin: clamp(14px, 2.8vh, 36px) 0 0; animation: rise 0.7s 0.45s var(--ease-out) backwards; }
.inline-link { color: var(--brass-hi); text-underline-offset: 3px; white-space: nowrap; }
.inline-link:hover { color: var(--ink-hi); }
.hero-facts div { display: flex; flex-direction: column-reverse; }
.hero-facts dt { font-family: var(--mono); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--faint); }
.hero-facts dd { margin: 0; font-family: var(--serif); font-size: clamp(28px, 4.6vh, 40px); line-height: 1; color: var(--ink-hi); font-variant-numeric: tabular-nums; }

/* A hand held up in the light. The two cards turn over every few seconds to
   show another hand, the caption says what it is, and the whole scene leans
   a little towards the pointer. */
.hero-scene { --scene-h: clamp(200px, 34vh, 380px); position: relative; height: var(--scene-h); perspective: 1100px; animation: fade 1.1s 0.15s ease backwards; }
.scene-tilt {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--py, 0) * -5deg)) rotateY(calc(var(--px, 0) * 7deg));
  transition: transform 0.6s var(--ease-out);
}
.scene-glow {
  position: absolute;
  left: 50%;
  top: 40%;
  width: calc(var(--scene-h) * 1.1);
  height: calc(var(--scene-h) * 1.1);
  translate: -50% -50%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(233, 198, 128, 0.22), rgba(233, 198, 128, 0.06) 55%, transparent);
  animation: breathe 5s ease-in-out infinite;
}
/* Each card turns in its own depth, so two turning side by side never pass
   through one another. */
.scene-hand { position: absolute; left: 50%; top: 4px; display: flex; translate: -50% 0; }
.scene-card { height: calc(var(--scene-h) - 82px); aspect-ratio: 2 / 3; perspective: 900px; animation: bob 5.5s ease-in-out infinite alternate; }
.scene-card:first-child { rotate: -9deg; margin-right: calc(var(--scene-h) * -0.06); }
.scene-card + .scene-card { rotate: 8deg; margin-top: 10px; animation-delay: -2.7s; }
.scene-flip { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.scene-face {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  filter: drop-shadow(0 26px 30px rgba(0, 0, 0, 0.7));
}
.scene-face.back { transform: rotateY(180deg); }
.scene-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  text-align: center;
  transition: opacity 0.35s, translate 0.45s var(--ease-out);
}
.scene-caption.away { opacity: 0; translate: 0 8px; }
.scene-name { display: block; font-family: var(--serif); font-size: 26px; line-height: 1.1; color: var(--brass-hi); text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9); }
.scene-note { display: block; font-size: 13.5px; color: var(--ink); text-shadow: 0 1px 10px rgba(0, 0, 0, 0.95); }
/* Dust in the lamplight. */
.mote {
  position: absolute;
  bottom: 12%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 224, 170, 0.75);
  opacity: 0;
  animation: mote var(--time, 9s) linear infinite;
  animation-delay: var(--wait, 0s);
}

.lobby-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: 22px;
  /* Both panels are the same height, whichever has more in it. */
  align-items: stretch;
}

/* Below the fold: how to hand a seat to an AI agent, in three steps. */
.agents-band { margin-top: 22px; padding: 28px 30px 24px; scroll-margin-top: calc(var(--masthead) + 16px); }
.agents-head { display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: 12px 40px; align-items: end; margin-bottom: 22px; }
.agents-head h2 { margin: 8px 0 0; font-size: clamp(28px, 3.4vw, 40px); }
.lede-links { white-space: nowrap; }
.agents-lede { margin: 0; max-width: 56ch; color: var(--dim); line-height: 1.6; }
.agents-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.agents-steps li { position: relative; padding: 18px 20px 20px; border: 1px solid var(--line); border-radius: 5px; background: rgba(0, 0, 0, 0.22); }
.agents-no { display: inline-grid; place-items: center; width: 28px; height: 28px; border: 1px solid var(--brass); border-radius: 50%; font-family: var(--mono); font-size: 12px; color: var(--brass-hi); }
.agents-steps h3 { margin: 12px 0 6px; font-size: 21px; }
.agents-steps p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--dim); }
.agents-code { display: flex; align-items: center; gap: 8px; margin-top: 12px; padding: 8px 8px 8px 12px; border: 1px solid var(--line-hi); border-radius: 4px; background: rgba(0, 0, 0, 0.4); }
.agents-code code { flex: 1; min-width: 0; overflow-wrap: break-word; font-size: 12px; line-height: 1.55; color: var(--ink-warm); }
.agents-code [data-origin] { color: var(--brass-hi); }
.agents-copy { flex: none; padding: 4px 9px; border: 1px solid var(--line-hi); border-radius: 3px; background: none; color: var(--dim); font: 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; }
.agents-copy:hover { color: var(--brass-hi); border-color: var(--brass); }
.agents-copy:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.agents-foot { margin: 18px 0 0; font-size: 13.5px; line-height: 1.7; color: var(--faint); }
@media (max-width: 860px) {
  .agents-head { grid-template-columns: minmax(0, 1fr); }
  .agents-steps { grid-template-columns: minmax(0, 1fr); }
  .agents-code { flex-direction: column; align-items: stretch; }
  .agents-copy { align-self: flex-end; }
}

.panel {
  position: relative;
  border: 1px solid rgba(195, 154, 73, 0.26);
  border-radius: 6px;
  background: var(--panel);
  padding: 28px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 236, 190, 0.06);
}
.panel h2, .running h2 { font-size: 30px; }
.open-table { padding: 24px 28px 26px; }
.open-table h2 { margin-bottom: 14px; }
.open-table .name-input { margin: 6px 0 16px; padding: 12px 14px; }
.open-table .pickers { margin-bottom: 20px; }
.running .note { margin: auto 0 0; padding-top: 6px; }

/* A seat the player stepped away from, offered again from the lobby. */
.resume { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--line-hi); border-radius: 5px; background: rgba(195, 154, 73, 0.08); }
.resume p { margin: 0; color: var(--ink); }
.resume-table { font-family: var(--mono); color: var(--brass-hi); }

.field-label, .picker legend {
  display: block;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--dim-2);
}
.name-input {
  width: 100%;
  margin: 8px 0 22px;
  padding: 14px;
  font: inherit;
  font-size: 17px;
  color: var(--ink-hi);
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-bottom: 1px solid rgba(195, 154, 73, 0.45);
  border-radius: 3px;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.name-input::placeholder { color: var(--faint); }
.name-input:focus { outline: none; background: rgba(0, 0, 0, 0.55); box-shadow: 0 1px 0 var(--brass-hi), 0 12px 26px -14px rgba(233, 198, 128, 0.6); }

.pickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.picker { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
/* A floated legend stops being the fieldset's special caption and lays out
   like any other flex item, which is what puts it on its own line. */
.picker legend { float: left; width: 100%; margin-bottom: 8px; padding: 0; }
.seg { position: relative; flex: 1; }
.seg input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.seg span {
  display: block;
  padding: 9px 0;
  text-align: center;
  font-size: 14px;
  border: 1px solid rgba(195, 154, 73, 0.22);
  border-radius: 3px;
  color: var(--dim);
  transition: border-color 0.2s, background-color 0.2s, color 0.2s;
}
.seg:hover input:not(:disabled) + span { border-color: var(--line-hi); color: var(--ink); }
.seg input:checked + span { border-color: var(--brass); background: rgba(195, 154, 73, 0.18); color: var(--ink-hi); }
.seg input:focus-visible + span { outline: 2px solid var(--brass-hi); outline-offset: 2px; }
.seg input:disabled { cursor: not-allowed; }
.seg input:disabled + span { opacity: 0.3; }

.note { margin: 20px 0 24px; font-size: 13px; line-height: 1.6; color: var(--faint); }

.running { display: flex; flex-direction: column; gap: 16px; padding: 24px 28px 26px; }
.running-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.stamp { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; color: var(--faint); }

.table-list { display: flex; flex-direction: column; gap: 12px; }
.table-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(195, 154, 73, 0.18);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.32);
  transition: border-color 0.2s, background-color 0.2s, translate 0.25s var(--ease-out);
  animation: rise 0.4s var(--ease-out) backwards;
}
.table-row:hover { border-color: rgba(195, 154, 73, 0.5); background: rgba(195, 154, 73, 0.08); translate: 3px 0; }
.row-id { font-family: var(--mono); font-size: 13px; color: var(--brass); }
.row-status { font-size: 13px; color: var(--dim-2); }
.dots { display: flex; gap: 5px; }
.dots span { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(195, 154, 73, 0.5); }
.dots span.taken { background: var(--brass); }
.row-cta {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-hi);
  padding: 6px 12px;
  border: 1px solid transparent;
  border-radius: 3px;
  transition: border-color 0.2s, background-color 0.2s;
}
button.row-cta:hover { border-color: var(--brass); background: rgba(195, 154, 73, 0.14); }
.row-cta.idle { color: var(--faint); font-weight: 400; }
.empty { margin: 0; font-size: 14px; color: var(--dim-2); }

/* ---------- table screen ---------- */

.table-screen { padding: 0 28px 132px; }

/* ---------- waiting room ---------- */

.waiting {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  max-width: 880px;
  margin: 56px auto 0;
  padding: 44px 40px 40px;
  text-align: center;
  animation: rise 0.6s var(--ease-out) backwards;
}
.waiting .note { margin: 6px 0 0; }
.waiting-title { margin: 14px 0 6px; font-size: clamp(28px, 5vw, 40px); }
/* Two small dice stand in for the trailing dots, taking turns to tumble. */
.waiting-dice { --size: 0.52em; display: inline-flex; gap: 0.18em; margin-left: 0.32em; vertical-align: 0.02em; }
.waiting-dice .die-spot { overflow: visible; }
.waiting-dice .die-shadow { bottom: -22%; opacity: 0.5; }
.waiting-dice .die { perspective: 200px; }
.waiting-dice .die-face { padding: 12%; }
.waiting-count { margin: 0; font: 12px var(--mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--dim); }

/* Who has sat down: a card per seat, the open ones breathing. */
.waiting-seats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin: 28px 0 34px;
  padding: 0;
  list-style: none;
}
.waiting-seat {
  display: grid;
  justify-items: center;
  gap: 6px;
  width: 118px;
  padding: 16px 10px 14px;
  border: 1px solid var(--line-hi);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.28);
  animation: pop-in 0.5s var(--ease-spring) backwards;
  animation-delay: calc(var(--i) * 90ms + 150ms);
}
.waiting-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font: 600 15px var(--mono);
  letter-spacing: 0.04em;
  color: #1a120c;
  background: linear-gradient(160deg, var(--brass-hi), var(--brass-deep));
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.waiting-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 14px; }
.waiting-kind { font: 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim-2); }
.waiting-seat.open { border-style: dashed; border-color: rgba(195, 154, 73, 0.35); }
.waiting-seat.open .waiting-badge {
  background: transparent;
  border: 1.5px dashed var(--brass);
  box-shadow: 0 0 0 0 rgba(233, 198, 128, 0.45);
  animation: waiting-open 2.4s var(--ease-in-out) infinite;
}
.waiting-seat.open .waiting-name { color: var(--dim); }
/* A seat that has just been taken turns over to show who sat down. */
.waiting-seat.arrived { animation: waiting-arrive 0.75s var(--ease-spring) backwards; }
.waiting-seat.arrived .waiting-badge { animation: waiting-flash 1.2s var(--ease-out); }

/* The two invites, side by side where there is room. */
.waiting-invites { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; text-align: left; }
.waiting-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 22px 22px 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
  animation: rise 0.6s var(--ease-out) backwards;
  animation-delay: 0.35s;
  transition: border-color 0.25s, transform 0.25s var(--ease-out), box-shadow 0.25s;
}
.waiting-card.agent { animation-delay: 0.45s; }
.waiting-card:hover { border-color: var(--line-hi); transform: translateY(-2px); box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35); }
.waiting-card h3 { margin: 10px 0 2px; font-family: var(--serif); font-size: 22px; font-weight: 400; color: var(--ink-hi); }
.waiting-card .note { color: var(--dim); line-height: 1.5; }
.waiting-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 9px; color: var(--brass-hi); background: rgba(195, 154, 73, 0.12); border: 1px solid var(--line); }
.waiting-icon svg { width: 20px; height: 20px; }
.waiting-card .invite-link { flex: 1; flex-direction: column; align-items: flex-start; gap: 0; margin: 14px 0 0; max-width: none; }
.waiting-card .invite-link input {
  flex: none;
  width: 100%;
  padding: 14px;
  font-size: 13px;
  color: var(--brass-hi);
  background: rgba(0, 0, 0, 0.4);
  border-color: var(--line);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.waiting-card .invite-link input:hover { border-color: var(--line-hi); box-shadow: 0 0 0 4px rgba(195, 154, 73, 0.08); }
.waiting-card .invite-link .brass { margin-top: auto; align-self: flex-start; }
.waiting-card .invite-link input { margin-bottom: 14px; }
.waiting-steps { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; font-size: 13px; color: var(--dim); }
.waiting-steps li { display: flex; align-items: center; gap: 10px; animation: rise 0.5s var(--ease-out) backwards; }
.waiting-steps li:nth-child(1) { animation-delay: 0.55s; }
.waiting-steps li:nth-child(2) { animation-delay: 0.65s; }
.waiting-steps li:nth-child(3) { animation-delay: 0.75s; }
.waiting-steps span { display: grid; place-items: center; flex: none; width: 20px; height: 20px; border: 1px solid var(--line-hi); border-radius: 50%; font: 10px var(--mono); color: var(--brass-hi); }
.prompt-preview {
  position: relative;
  margin: 14px 0 0;
  flex: none;
  max-height: 128px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--ink-warm);
  font: 11.5px/1.6 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
  mask-image: linear-gradient(180deg, #000 72%, transparent);
}
.prompt-preview:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; mask-image: none; }
.prompt-actions { display: flex; align-items: center; gap: 16px; margin-top: auto; padding-top: 14px; }
.prompt-actions .brass { position: relative; overflow: hidden; }
/* A sheen that runs across the button now and then, and a flash once copied. */
.prompt-actions .brass::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.45) 50%, transparent 65%);
  background-size: 250% 100%;
  animation: sheen 3.6s var(--ease-in-out) infinite 1.2s;
  pointer-events: none;
}
#copy-prompt.copied { animation: waiting-copied 0.5s var(--ease-spring); }
@media (max-width: 760px) {
  .waiting { padding: 34px 18px 24px; margin-top: 28px; }
  .waiting-invites { grid-template-columns: minmax(0, 1fr); }
  .waiting-seat { width: 96px; }
}

@keyframes waiting-open {
  0%, 100% { box-shadow: 0 0 0 0 rgba(233, 198, 128, 0.4); opacity: 0.75; }
  50% { box-shadow: 0 0 0 9px rgba(233, 198, 128, 0); opacity: 1; }
}
@keyframes waiting-arrive { from { opacity: 0; transform: perspective(500px) rotateY(-90deg) scale(0.9); } }
@keyframes waiting-flash { from { box-shadow: 0 0 0 0 rgba(233, 198, 128, 0.85), 0 6px 18px rgba(0, 0, 0, 0.45); } }
@keyframes waiting-copied { 40% { transform: scale(1.06); } }

/* The waiting room's invite: the link to send, and a button that copies it. */
.invite-link { display: flex; gap: 10px; margin: 14px auto 18px; max-width: 520px; }
.invite-link input { flex: 1; min-width: 0; padding: 10px 12px; border: 1px solid var(--line-hi); border-radius: 5px; background: rgba(0, 0, 0, 0.35); color: var(--ink); font: 13px var(--mono); }
.invite-link input:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
@media (max-width: 520px) { .invite-link { flex-direction: column; } }

/* Arriving from an invite: the form joins that table instead of opening one. */
.invite-note { margin: 4px 0 18px; padding: 12px 14px; border: 1px solid var(--line-hi); border-radius: 5px; background: rgba(195, 154, 73, 0.08); }
.invite-note p { margin: 0 0 6px; color: var(--ink); line-height: 1.5; }
.invite-id { font-family: var(--mono); font-size: 0.92em; color: var(--brass-hi); }
#invite-seats { color: var(--dim); }
.text-button { padding: 0; border: 0; background: none; color: var(--brass-hi); font: inherit; font-size: 13px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.text-button:hover { color: var(--ink-hi); }
.text-button:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

/* The stage is exactly the size of the table. Everything around it -- the
   round label, your hand, the move panel -- hangs off its edges, positioned
   against it, so the whole arrangement scales with the one --table size. */
.stage { position: relative; width: var(--table); margin: 92px auto 0; animation: stage-in 0.7s var(--ease-out) backwards; }
.table-wrap { position: relative; width: var(--table); aspect-ratio: 1; }

/* Beside the table at its top-left, level with the felt's top edge: clear of
   the header above and of the left-hand seat, which sits lower down. */
.round-label {
  position: absolute;
  right: 100%;
  top: 0;
  margin: 0 34px 0 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: max-content;
  max-width: 200px;
}
.round-title { margin: 0; font-family: var(--serif); font-size: 36px; line-height: 1; color: var(--ink-hi); white-space: nowrap; }
.round-turn {
  margin: 12px 0 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px 10px;
  white-space: nowrap;
}
.turn-pips { display: flex; gap: 5px; }
.turn-pips:empty { display: none; }
.pip {
  width: 24px;
  height: 7px;
  border-radius: 2px;
  background: rgba(195, 154, 73, 0.14);
  box-shadow: inset 0 0 0 1px rgba(195, 154, 73, 0.35);
}
.pip.done { background: rgba(195, 154, 73, 0.55); box-shadow: none; }
.pip.now { background: var(--brass-hi); box-shadow: 0 0 12px rgba(233, 198, 128, 0.8); animation: pulse 1.4s ease-in-out infinite; }
.turn-text {
  font-family: var(--mono);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass-hi);
}
.round-turn.final .turn-text { color: #ffb38a; }
.round-turn.final .pip.now { background: #ffb38a; box-shadow: 0 0 12px rgba(255, 150, 100, 0.8); }
/* The prize for the whole game, kept beside the round rather than on the felt. */
.prize { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--dim); }
.prize-number { font-family: var(--serif); font-size: 18px; color: var(--brass-hi); }
.modifiers { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.modifiers:empty { display: none; }
.modifier {
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 3px 7px;
  border: 1px solid rgba(195, 154, 73, 0.45);
  border-radius: 3px;
  color: var(--brass-hi);
  background: rgba(195, 154, 73, 0.08);
  cursor: help;
  animation: pop-in 0.4s var(--ease-spring) backwards;
}
.modifier.warn { border-color: rgba(215, 82, 79, 0.45); color: var(--bad-soft); background: rgba(215, 82, 79, 0.08); }
.round-label .link { margin-top: 12px; }

/* ---------- the felt ---------- */

.felt {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 30%, rgba(255, 214, 150, 0.13), transparent 52%),
    radial-gradient(circle at 50% 42%, #50232f 0%, #381823 42%, #1e0f12 76%, #130a0b 100%);
  box-shadow:
    0 0 0 9px #1c110d,
    0 0 0 13px #0d0806,
    0 0 0 21px #1a110d,
    0 0 0 22px rgba(195, 154, 73, 0.22),
    0 46px 100px rgba(0, 0, 0, 0.75),
    inset 0 0 0 1px rgba(0, 0, 0, 0.5),
    inset 0 0 130px rgba(0, 0, 0, 0.85);
}
/* The brass rail: a ring of brushed metal, light catching it in four places. */
.felt::before {
  content: "";
  position: absolute;
  inset: -13px;
  padding: 4px;
  border-radius: 50%;
  background: conic-gradient(from 35deg,
    #7a5720, #f0d290 7%, #a67b2f 16%, #6b4a1c 27%, #d9b260 36%, #8a6428 46%,
    #5c3f17 55%, #e9c680 64%, #9a722c 74%, #6b4a1c 84%, #caa052 93%, #7a5720);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  pointer-events: none;
}
/* The nap of the cloth. */
.felt::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: url("../assets/textures/grain.svg");
  opacity: 0.09;
  pointer-events: none;
}
.felt-rail { position: absolute; inset: 8.5%; border-radius: 50%; border: 1px solid rgba(195, 154, 73, 0.2); pointer-events: none; }
.felt-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 40%;
  height: 40%;
  translate: -50% -50%;
  border-radius: 50%;
  border: 1px solid rgba(195, 154, 73, 0.1);
  box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.12), inset 0 0 0 7px rgba(195, 154, 73, 0.06);
  pointer-events: none;
}

/* ---------- chips ---------- */

.chip-bar, .flyer-chip {
  display: block;
  border-radius: 2px;
  background: linear-gradient(180deg, #f6dc9f 0%, #d1a54e 45%, #86591a 100%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

/* ---------- the orbiting shoe ---------- */

/* How far round the table the shoe has travelled, as a real angle so it can
   be animated along with the swing. */
@property --shoe-angle { syntax: "<angle>"; inherits: true; initial-value: 0deg; }

/* Rotating a wrapper makes the shoe travel along the rim as an arc rather than
   cutting across the middle. The angle only ever increases, so the deal always
   moves clockwise. The row turns with the table rather than being counter-
   rotated upright, so the piles always lie facing the player about to act.
   The turn itself is driven from script, which waits for it to finish. */
.orbit { position: absolute; inset: 0; pointer-events: none; will-change: transform; }
.orbit-arm { position: absolute; left: 50%; top: 70%; translate: -50% -50%; }
/* A pool of light on the cloth under the shoe: where the game is, right now. */
.shoe-light {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 190%;
  height: 300%;
  translate: -50% -42%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 214, 150, 0.2), rgba(255, 214, 150, 0.07) 55%, transparent);
  pointer-events: none;
}
.shoe {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(10, 6, 6, 0.5), rgba(10, 6, 6, 0.3));
  box-shadow: inset 0 0 0 1px rgba(195, 154, 73, 0.16), inset 0 2px 10px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
}
.pile {
  display: block;
  width: var(--pile-w);
  height: calc(var(--pile-w) * 1.5);
  line-height: 0;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.65));
  transition: translate 0.3s var(--ease-spring), scale 0.3s var(--ease-spring);
}
/* A deck has an edge: a few cards' worth of thickness under the top one. */
.pile[data-key^="back"] {
  filter: drop-shadow(0 1.5px 0 #0c0706) drop-shadow(0 1.5px 0 #3a2618) drop-shadow(0 1.5px 0 #0c0706)
    drop-shadow(0 8px 12px rgba(0, 0, 0, 0.65));
}
.pile svg { width: 100%; height: 100%; display: block; }
.pile.live { cursor: pointer; }
.pile.live:hover { translate: 0 -5px; scale: 1.06; }
.pile.live:active { scale: 0.98; }
/* A pile that will take a click gets a bright border drawn on the card's own
   outline, so the highlight is the shape of the card and nothing else. */
.pile.armed svg > path:first-child,
.hand-card.pickable svg > path:first-child {
  stroke: #ffe3a3;
  stroke-width: 4.5;
  stroke-linejoin: round;
}
.pile.armed { filter: drop-shadow(0 0 7px rgba(233, 198, 128, 0.7)) drop-shadow(0 8px 12px rgba(0, 0, 0, 0.65)); }
.pile { position: relative; }

/* ---------- cards ---------- */

.card { line-height: 0; flex: none; }
.card svg { width: 100%; height: 100%; display: block; }
/* A card still in flight: its destination waits, empty-looking, until it lands. */
.incoming { opacity: 0 !important; }

/* ---------- seats on the rim ---------- */

.seat-ring { position: absolute; inset: 0; pointer-events: none; }

/* While cards are still in the air the table is behind the game: hold clicks
   until it has caught up, so nobody acts on a position that is already gone. */
.stage.busy .pile,
.stage.busy .move-buttons,
.stage.busy .hand-card,
.stage.busy .seat-target,
.stage.sending .pile,
.stage.sending .move-buttons,
.stage.sending .hand-card,
.stage.sending .seat-target { pointer-events: none; }

.seat {
  position: absolute;
  translate: -50% -50%;
  width: var(--plate);
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  z-index: 2;
  transition: opacity 0.5s;
}
.seat.out { opacity: 0.7; }

.plate {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 9px 12px 10px;
  border-radius: 6px;
  border: 1px solid rgba(195, 154, 73, 0.2);
  background: linear-gradient(180deg, rgba(36, 23, 18, 0.98), rgba(14, 9, 8, 0.98));
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 236, 190, 0.07);
  transition: border-color 0.35s, scale 0.45s var(--ease-spring);
}
/* The seat on move: its plate steps forward, edged in brass, inside a glow
   that breathes. The glow is its own layer so only its opacity animates. */
.plate::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(233, 198, 128, 0.6), 0 0 26px rgba(233, 198, 128, 0.5), 0 0 60px rgba(233, 198, 128, 0.22);
  opacity: 0;
  transition: opacity 0.35s;
  pointer-events: none;
}
.seat.active .plate { border-color: var(--brass-hi); scale: 1.06; }
.seat.active .plate::before { opacity: 1; animation: breathe 1.8s ease-in-out infinite; }
.seat.active .plate-name { color: #fff3d6; }
.seat.targetable .plate { border-color: var(--brass-hi); cursor: pointer; }
.seat.targetable .plate::before { opacity: 1; animation: breathe 1s ease-in-out infinite; }
.seat-target { position: absolute; inset: 0; z-index: 3; border-radius: inherit; }
.seat-target:hover { background: rgba(233, 198, 128, 0.12); }

/* The unused place at a three-handed table. */
.empty-seat .plate {
  background: transparent;
  border: 1px dashed rgba(195, 154, 73, 0.3);
  box-shadow: none;
  padding: 14px 10px;
  text-align: center;
}
.empty-seat .plate-name { color: var(--faint); font-size: 14px; }

.plate-head { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 22px; }
.plate-name {
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.1;
  color: var(--ink-hi);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.35s;
}
.seat.out .plate-name { color: #c2ae99; }
.kind-tag {
  flex: none;
  font-family: var(--mono);
  font-size: 7.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 2px 4px;
  border: 1px solid rgba(195, 154, 73, 0.35);
  border-radius: 2px;
  color: var(--brass-deep);
}
/* Two stacks on the plate: what the seat still holds, then what it has put
   into this round, set apart by a hairline and a cooler metal. */
.plate-chips { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 40px; margin-top: 6px; }
.chip-group { display: flex; align-items: center; gap: 6px; transition: opacity 0.3s; }
.chip-group.in-play { padding-left: 10px; border-left: 1px solid rgba(195, 154, 73, 0.22); }
.chip-group.in-play.empty { opacity: 0.5; }
.chip-stack { display: flex; flex-direction: column-reverse; gap: 2px; min-width: 22px; min-height: 5px; }
.chip-bar { width: 22px; height: 5px; border-radius: 1px; }
.in-play .chip-bar { background: linear-gradient(180deg, #f1b9a0 0%, #c8694a 45%, #7a2f1c 100%); }
.chip-count { margin: 0; width: max-content; font-family: var(--mono); font-size: 15px; line-height: 1; color: var(--brass-hi); font-variant-numeric: tabular-nums; }
.in-play .chip-count { color: #f0a88c; }
.plate-out {
  margin: 8px 0 0;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #d98a82;
}
.flags { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; margin-top: 8px; }
.flags:empty { display: none; }
.flag {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  color: #c0a684;
  animation: pop-in 0.35s var(--ease-spring) backwards;
}
.flag.accent { background: rgba(215, 82, 79, 0.2); color: #f2a29a; }

.to-act {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  scale: 0.6;
  opacity: 0;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.18em;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3d595, var(--brass));
  color: #180f08;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  transition: opacity 0.25s, scale 0.4s var(--ease-spring);
  pointer-events: none;
}
.seat.active .to-act { opacity: 1; scale: 1; }
.hand-above .to-act { bottom: -10px; }
.hand-below .to-act, .hand-none .to-act { top: -10px; }

/* What a seat just did, said in a small tag on its outer side. */
.bubble {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  z-index: 4;
  padding: 5px 11px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;
  color: #1a1008;
  background: linear-gradient(180deg, #f6ecd3, #dcc79a);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.hand-above .bubble, .hand-none .bubble { top: calc(100% + 20px); }
/* The far seat sits right under the header, so its tag goes beside the plate. */
.hand-below .bubble { left: calc(100% + 12px); top: 50%; translate: 0 -50%; }

/* An opponent's face-down hand and unknown tokens, on the side facing the
   middle of the table. */
.seat-hand {
  position: absolute;
  left: 50%;
  translate: -50% 0;
  display: flex;
  gap: 10px;
  z-index: 0;
}
.hand-above .seat-hand { bottom: 100%; margin-bottom: -14px; align-items: flex-end; }
.hand-below .seat-hand { top: 100%; margin-top: -14px; align-items: flex-start; }
.seat-tokens { display: flex; gap: 3px; }
.seat-token {
  width: calc(var(--pile-w) * 0.45);
  height: calc(var(--pile-w) * 0.72);
  line-height: 0;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.65));
}
/* The art is near-black, which is lost against the dark cloth, so it is
   lifted and given a thin brass edge. */
.seat-token svg { width: 100%; height: 100%; display: block; filter: brightness(1.6) drop-shadow(0 0 0.8px var(--brass-hi)); }
.seat-cards { display: flex; }
/* The fan is set with `rotate` and `translate`, leaving `transform` free for
   the turn-over at the reveal. */
.seat-card {
  width: var(--pile-w);
  height: calc(var(--pile-w) * 1.5);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.7));
  transition: translate 0.4s var(--ease-spring), rotate 0.4s var(--ease-spring);
}
.seat-card + .seat-card { margin-left: calc(var(--pile-w) * -0.52); }
.hand-above .seat-card { transform-origin: bottom center; translate: 0 4px; }
.hand-above .seat-card:first-child { rotate: -8deg; }
.hand-above .seat-card + .seat-card { rotate: 8deg; }
.hand-below .seat-card { transform-origin: top center; translate: 0 -4px; }
.hand-below .seat-card:first-child { rotate: 8deg; }
.hand-below .seat-card + .seat-card { rotate: -8deg; }
/* Turned up at the reveal, a hand spreads so both cards can be read. */
.seat-card.revealed + .seat-card.revealed { margin-left: calc(var(--pile-w) * -0.3); }
.hand-above .seat-card.revealed { translate: 0 -2px; }
.hand-below .seat-card.revealed { translate: 0 2px; }

/* ---------- your hand and tokens ---------- */

/* Anchored by its right edge, just left of your plate, with the hand first and
   the tokens after it. The drawn card is laid over the row rather than in it,
   so nothing here moves when a card comes or goes. */
.mine {
  position: absolute;
  right: calc(50% + var(--plate) / 2 + 26px);
  top: 100%;
  translate: 0 -36%;
  display: flex;
  align-items: flex-end;
  /* Room for the edge of a drawn Blood card, which lies mostly over the hand. */
  gap: calc(var(--hand-w) * 0.5);
  z-index: 3;
}
.my-tokens { display: flex; gap: 8px; align-self: flex-end; }
.my-token {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  transition: translate 0.3s var(--ease-spring), scale 0.3s var(--ease-spring);
  animation: rise 0.4s var(--ease-out) backwards;
}
.my-token .art {
  width: 52px;
  height: 83px;
  line-height: 0;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7));
  transition: filter 0.3s;
}
.my-token .art svg { width: 100%; height: 100%; display: block; }
.my-token .label { font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); white-space: nowrap; transition: color 0.3s; }
.my-token[aria-disabled="true"] { cursor: default; }
.my-token:not([aria-disabled="true"]):hover { translate: 0 -6px; scale: 1.05; }
.my-token:not([aria-disabled="true"]):active { scale: 0.97; }
.my-token:not([aria-disabled="true"]) .label { color: var(--brass-hi); }
.my-token:not([aria-disabled="true"]) .art { filter: drop-shadow(0 0 6px rgba(233, 198, 128, 0.35)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7)); }
.my-token[aria-pressed="true"] { translate: 0 -8px; }
.my-token[aria-pressed="true"] .art { filter: drop-shadow(0 0 10px rgba(233, 198, 128, 0.9)) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.7)); }

.my-hand { position: relative; display: flex; align-items: flex-end; }
/* As with the seats, the fan lives in `rotate` and `translate`. */
.hand-card {
  position: relative;
  width: var(--hand-w);
  height: calc(var(--hand-w) * 1.5);
  transform-origin: bottom center;
  transition: translate 0.38s var(--ease-spring), rotate 0.38s var(--ease-spring), opacity 0.3s;
  filter: drop-shadow(0 16px 22px rgba(0, 0, 0, 0.72));
}
.hand-card.left { rotate: -7deg; translate: 0 6px; z-index: 1; }
.hand-card.right { margin-left: calc(var(--hand-w) * -0.5); rotate: 7deg; translate: 0 6px; z-index: 2; }
.hand-card.left:hover { rotate: -11deg; translate: -14px -24px; }
.hand-card.right:hover { rotate: 11deg; translate: 14px -24px; }

/* A card just drawn sits on the outside of the card of its family, so the two
   that one must be burned from are side by side. */
.hand-card.drawn { position: absolute; bottom: 0; z-index: 3; }
.hand-card.drawn.at-left { right: 100%; margin-right: calc(var(--hand-w) * -0.35); rotate: -16deg; translate: 0 14px; }
.hand-card.drawn.at-right { left: 100%; margin-left: calc(var(--hand-w) * -0.6); rotate: 14deg; translate: 0 14px; }
.hand-card.drawn.at-left:hover { rotate: -20deg; translate: -14px -16px; }
.hand-card.drawn.at-right:hover { rotate: 20deg; translate: 14px -16px; }
.hand-card.drawn::after {
  content: "New";
  position: absolute;
  top: -24px;
  left: 50%;
  translate: -50% 0;
  padding: 2px 8px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #180f08;
  background: var(--brass-hi);
  border-radius: 999px;
  white-space: nowrap;
}
.hand-card.dim { opacity: 0.4; }
/* A card that can be burned gets the same bright border on its own outline. */
.hand-card.pickable { cursor: pointer; filter: drop-shadow(0 0 8px rgba(233, 198, 128, 0.6)) drop-shadow(0 16px 22px rgba(0, 0, 0, 0.72)); }
.hand-card.pickable:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 10px; }

/* ---------- the move panel ---------- */

.move-panel {
  position: absolute;
  left: 100%;
  top: 88%;
  translate: -6% -50%;
  display: flex;
  flex-direction: column;
  gap: 9px;
  width: 172px;
  z-index: 3;
}
.move-panel .kicker { font-size: 9.5px; letter-spacing: 0.22em; color: var(--brass-hi); transition: color 0.3s; }
.move-panel.idle .kicker { color: var(--faint); }
.move-buttons { display: flex; flex-direction: column; gap: 8px; }
.move-buttons:empty { display: none; }
.move-buttons .brass, .move-buttons .ghost { padding: 13px 0; animation: pop-in 0.35s var(--ease-spring) backwards; }
.move-buttons > :nth-child(2) { animation-delay: 50ms; }
.move-hint { margin: 0; font-size: 11.5px; line-height: 1.5; color: var(--faint); }
.move-panel.idle .move-hint { font-size: 12.5px; color: var(--dim); }
.chooser { display: flex; flex-direction: column; gap: 6px; }
.chooser .ghost { padding: 9px 10px; font-size: 11px; letter-spacing: 0.06em; text-transform: none; white-space: normal; animation: pop-in 0.3s var(--ease-spring) backwards; }
.error { margin: 0; font-size: 12px; color: var(--bad-soft); }

/* ---------- log ---------- */

/* Ids are case-sensitive; do not let an uppercase kicker change one. */
.as-typed { text-transform: none; letter-spacing: 0.12em; }

/* The log waits off the right edge and slides in over the table screen. */
.log-panel {
  position: fixed;
  top: var(--masthead);
  right: 0;
  bottom: 0;
  z-index: 35;
  width: min(340px, 88vw);
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--line-hi);
  background: linear-gradient(180deg, rgba(28, 18, 14, 0.97), rgba(12, 8, 7, 0.98));
  box-shadow: -30px 0 60px rgba(0, 0, 0, 0.55);
  translate: 105% 0;
  visibility: hidden;
  transition: translate 0.42s var(--ease-out), visibility 0s 0.42s;
}
.log-panel.open { translate: 0 0; visibility: visible; transition: translate 0.42s var(--ease-out), visibility 0s; }
.log-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 12px; border-bottom: 1px solid var(--line); }
.log {
  flex: 1;
  list-style: none;
  margin: 0;
  padding: 10px 18px 18px;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 13px;
  line-height: 1.5;
  color: var(--dim);
  scrollbar-width: thin;
  scrollbar-color: rgba(195, 154, 73, 0.35) transparent;
}
.log li { padding: 2px 0; }
.log li.highlight { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--brass-hi); }
.log li.bad { color: var(--bad-soft); }

/* ---------- overlays ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px 60px;
  overflow-y: auto;
  text-align: center;
  /* Opaque enough to need no backdrop blur, which would re-blur the whole
     table on every frame the game moves behind it. */
  background: radial-gradient(60% 50% at 50% 50%, rgba(40, 20, 12, 0.93), rgba(6, 4, 4, 0.97));
  animation: fade 0.3s ease-out;
}
.overlay > * { animation: rise 0.5s var(--ease-out) backwards; }
.overlay > :nth-child(2) { animation-delay: 50ms; }
.overlay > :nth-child(3) { animation-delay: 100ms; }
.overlay > :nth-child(n + 4) { animation-delay: 150ms; }
/* The dice are a move you have to make, so they sit above a reveal that is
   still open from the round before. */
#dice-overlay { z-index: 62; }

.overlay.reveal, .overlay.over {
  justify-content: flex-start;
  padding-top: 8vh;
  background: radial-gradient(70% 55% at 50% 42%, rgba(195, 154, 73, 0.14), transparent 70%), rgba(10, 6, 6, 0.975);
}
.overlay .kicker { letter-spacing: 0.4em; }
.overlay-title { margin: 12px 0 8px; font-size: 46px; line-height: 1; }
.overlay-note { margin: 0 0 32px; font-size: 15px; color: var(--dim); }
.overlay-hint { margin: 18px 0 0; font-size: 13px; color: var(--dim-2); }

.dice-box {
  width: min(640px, 100%);
  padding: 44px 40px 36px;
  border: 1px solid rgba(195, 154, 73, 0.4);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(44, 27, 20, 0.96), rgba(16, 10, 9, 0.98));
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 236, 190, 0.08);
}

/* Each die is a real cube: six faces around a centre, turned to show one.
   They are thrown onto a patch of the table's cloth and land there. */
.dice {
  --size: clamp(76px, 18vw, 104px);
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 76px;
  margin: 28px 0 0;
  padding: 46px 0 76px;
  border-radius: 16px;
  background:
    url("../assets/textures/grain.svg"),
    radial-gradient(120% 140% at 50% 30%, #55252f 0%, #3a1924 50%, #1f0f13 100%);
  background-blend-mode: soft-light, normal;
  box-shadow: inset 0 0 0 1px rgba(195, 154, 73, 0.28), inset 0 12px 40px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 236, 190, 0.06);
}
/* A die's place on the cloth, holding the die and the shadow it throws. */
.die-spot { position: relative; flex: none; width: var(--size); height: var(--size); }
.die-shadow {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: -26%;
  height: 34%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.35) 60%, transparent);
  opacity: 0.75;
  pointer-events: none;
  will-change: transform, opacity;
}
.die {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  perspective: 620px;
  border-radius: 16%;
  transition: scale 0.4s var(--ease-spring), opacity 0.3s;
  will-change: translate, transform;
}
#dice-overlay .overlay-note { margin-bottom: 0; }
/* Dice thrown onto the table itself land in the middle of the felt. */
.table-dice {
  --size: clamp(48px, calc(var(--table) * 0.115), 78px);
  position: absolute;
  left: 50%;
  top: 47%;
  translate: -50% -50%;
  z-index: 7;
  display: flex;
  gap: calc(var(--size) * 0.8);
  pointer-events: none;
}
.cube { position: absolute; inset: 0; display: block; transform-style: preserve-3d; will-change: transform; }
.die-face {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
  place-items: center;
  padding: 15%;
  border-radius: 14%;
  background: linear-gradient(145deg, #f8efd9 0%, #e6d6b2 60%, #cdb98d 100%);
  box-shadow: inset 0 0 0 1px rgba(60, 35, 10, 0.35), inset 0 0 14px rgba(120, 80, 20, 0.28);
  backface-visibility: hidden;
}
.face-1 { transform: translateZ(calc(var(--size) / 2)); }
.face-6 { transform: rotateY(180deg) translateZ(calc(var(--size) / 2)); }
.face-3 { transform: rotateY(90deg) translateZ(calc(var(--size) / 2)); }
.face-4 { transform: rotateY(-90deg) translateZ(calc(var(--size) / 2)); }
.face-2 { transform: rotateX(90deg) translateZ(calc(var(--size) / 2)); }
.face-5 { transform: rotateX(-90deg) translateZ(calc(var(--size) / 2)); }
/* Only the face that counts is lit: the two others the tilt shows are dimmed,
   so a die is never read off its top or side by mistake. */
.die-face.up { box-shadow: inset 0 0 0 1.5px var(--brass), inset 0 0 14px rgba(120, 80, 20, 0.28); }
.die-face:not(.up) { filter: brightness(0.62) saturate(0.5); }
.die-face:not(.up) .die-pip { opacity: 0.35; }
/* The value, written under the die once it has come to rest. */
.die-value {
  position: absolute;
  left: 50%;
  top: calc(100% + var(--size) * 0.3);
  translate: -50% 0;
  font: 600 calc(var(--size) * 0.3) / 1 var(--mono);
  letter-spacing: 0.04em;
  color: var(--brass-hi);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.7);
  pointer-events: none;
  animation: die-value-in 0.35s var(--ease-out) 1.45s backwards;
}
.waiting-dice .die-value { display: none; }
@keyframes die-value-in { from { opacity: 0; translate: -50% -6px; } }
.die-pip {
  width: 72%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #5a2a1c, #2a110b 70%);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.6);
}
.face-1 .die-pip { grid-area: 2 / 2; width: 92%; background: radial-gradient(circle at 35% 30%, #c0452f, #6d1d12 70%); }
.face-2 .die-pip:nth-child(1), .face-3 .die-pip:nth-child(1) { grid-area: 1 / 1; }
.face-2 .die-pip:nth-child(2), .face-3 .die-pip:nth-child(3) { grid-area: 3 / 3; }
.face-3 .die-pip:nth-child(2) { grid-area: 2 / 2; }
.face-4 .die-pip:nth-child(1), .face-5 .die-pip:nth-child(1), .face-6 .die-pip:nth-child(1) { grid-area: 1 / 1; }
.face-4 .die-pip:nth-child(2), .face-5 .die-pip:nth-child(2), .face-6 .die-pip:nth-child(2) { grid-area: 1 / 3; }
.face-4 .die-pip:nth-child(3), .face-5 .die-pip:nth-child(3), .face-6 .die-pip:nth-child(3) { grid-area: 3 / 1; }
.face-4 .die-pip:nth-child(4), .face-5 .die-pip:nth-child(4), .face-6 .die-pip:nth-child(4) { grid-area: 3 / 3; }
.face-5 .die-pip:nth-child(5) { grid-area: 2 / 2; }
.face-6 .die-pip:nth-child(5) { grid-area: 2 / 1; }
.face-6 .die-pip:nth-child(6) { grid-area: 2 / 3; }

.die:hover:not(:disabled):not(.passed) { scale: 1.07; }
.die:active:not(:disabled) { scale: 0.97; }
.die.picked { scale: 1.12; }
.die.picked::before {
  content: "";
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(233, 198, 128, 0.5), transparent);
  animation: breathe 1.4s ease-in-out infinite;
  pointer-events: none;
}
.die.passed { scale: 0.86; opacity: 0.35; }
.dice-pair { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 30px; }
.dice-pair .card { width: 66px; height: 99px; filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.6)); }
.dice-pair span { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--faint); }

.shimmer {
  /* The gradient fills only the element's box, and text clipped to it loses
     whatever hangs outside: the tail of a p or a y. The padding takes the box
     down past the descenders; the margin gives that space back. */
  margin: 14px 0 calc(4px - 0.16em);
  padding-bottom: 0.16em;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.05;
  background: linear-gradient(100deg, #f3e8ce 20%, #f9dc9a 42%, #f3e8ce 62%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  background-size: 240% 100%;
}
.overlay > .shimmer { animation: rise 0.5s var(--ease-out) 50ms backwards, sheen 2.8s ease-in-out 0.4s infinite; }
.shimmer.big { font-size: clamp(44px, 8vw, 88px); }

.reveal-hands { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; align-items: flex-start; }
.reveal-hand {
  --shown: 600ms;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 18px;
  border: 1px solid rgba(195, 154, 73, 0.2);
  border-radius: 6px;
  background: #100a09;
  animation: rise 0.5s var(--ease-out) backwards;
  transition: border-color 0.5s var(--shown), background-color 0.5s var(--shown), box-shadow 0.5s var(--shown);
}
.reveal-hand.won { animation: rise 0.5s var(--ease-out) backwards, crown 0.6s ease-out var(--shown) forwards; }
.reveal-hand.out { border-color: rgba(215, 82, 79, 0.3); background: #1a0c0b; }
.reveal-name { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--ink-hi); }
.reveal-hand.won .reveal-name { color: #f9dc9a; }
.reveal-hand.out .reveal-name { color: #9c8977; }
.reveal-cards { display: flex; gap: 8px; }
.reveal-cards .card { width: 92px; height: 138px; filter: drop-shadow(0 12px 20px rgba(0, 0, 0, 0.6)); }
/* The verdict waits until the hand it is about has turned over. */
.reveal-result, .reveal-delta, .reveal-left { animation: rise 0.45s var(--ease-out) var(--shown) backwards; }
.reveal-result { margin: 0; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim-2); }
.reveal-delta { margin: 0; font-family: var(--mono); font-size: 22px; }
.reveal-left { margin: -8px 0 0; font-family: var(--mono); font-size: 11px; color: var(--faint); }
.good { color: var(--good); }
.bad { color: var(--bad); }
.even { color: var(--dim); }

.move-chip {
  margin: 30px 0 0;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--brass);
  color: #180f08;
}
#reveal-close { margin-top: 32px; padding: 15px 40px; }

.standings {
  width: 100%;
  max-width: 720px;
  text-align: left;
  border: 1px solid rgba(195, 154, 73, 0.3);
  border-radius: 6px;
  background: rgba(16, 10, 9, 0.85);
  overflow: hidden;
}
.standings-head {
  display: flex;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(195, 154, 73, 0.2);
  background: rgba(195, 154, 73, 0.06);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass);
}
.standings-head span + span { color: var(--faint); letter-spacing: 0.16em; }
.standing {
  display: grid;
  grid-template-columns: 34px 1fr auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(195, 154, 73, 0.1);
  animation: rise 0.45s var(--ease-out) backwards;
}
.standing:nth-child(1) { animation-delay: 250ms; }
.standing:nth-child(2) { animation-delay: 340ms; }
.standing:nth-child(3) { animation-delay: 430ms; }
.standing:nth-child(4) { animation-delay: 520ms; }
.standing:last-child { border-bottom: none; }
.standing.winner { background: linear-gradient(90deg, rgba(195, 154, 73, 0.14), transparent 70%); }
.standing.out .standing-name, .standing.out .standing-chips { opacity: 0.75; }
.standing-place { font-family: var(--mono); font-size: 13px; color: var(--faint); }
.standing-name { margin: 0; font-family: var(--serif); font-size: 22px; color: var(--ink-hi); }
.standing.winner .standing-name { color: #f9dc9a; }
.standing-note { margin: 2px 0 0; font-size: 12px; color: var(--faint); }
.standing-tag {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 4px 9px;
  border: 1px solid rgba(215, 82, 79, 0.4);
  border-radius: 3px;
  color: var(--bad-soft);
}
.standing.winner .standing-tag { border-color: var(--brass); color: var(--brass-hi); }
.standing-chips { min-width: 56px; text-align: right; font-family: var(--mono); font-size: 17px; color: var(--dim-2); }
.standing.winner .standing-chips { color: var(--good); }
.over-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 38px; }
.over-actions .brass, .over-actions .ghost { padding: 15px 34px; }

/* ---------- flights ---------- */

/* Cards and chips in the air. Each is positioned by its centre with
   `translate`, lifted with `transform`, and turned and sized on an inner
   layer, so every part of a flight is a separate composited animation. */
.flyers { position: fixed; inset: 0; z-index: 55; overflow: hidden; pointer-events: none; }
.flyer { position: absolute; left: 0; top: 0; will-change: translate, transform; }
.flyer-body {
  width: 100%;
  height: 100%;
  will-change: rotate, scale;
  filter: drop-shadow(0 18px 20px rgba(0, 0, 0, 0.6));
}
.flyer-turn { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; }
.flyer-face { position: absolute; inset: 0; line-height: 0; backface-visibility: hidden; }
.flyer-face svg { width: 100%; height: 100%; display: block; }
.flyer-other { transform: rotateY(180deg); }
.flyer-chip {
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 8px;
  margin: -4px 0 0 -15px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.75), inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 6px 12px rgba(0, 0, 0, 0.5), 0 0 14px rgba(233, 198, 128, 0.45);
  will-change: translate, transform;
}

/* ---------- the 3D view ---------- */

/* The same table, seen from a seat at it instead of from above. The felt is
   tipped back from its near edge; what lies on it tips with it; plates and
   anything else that should be read stand up from it to face you. Three
   numbers come from the settings: --tilt, how far the table is tipped;
   --eye-above, how high the eye is over its near edge; and --rise, how far up
   the screen the far rim then reaches (the last two in table widths). */
.view-3d .table-wrap {
  aspect-ratio: auto;
  height: calc(var(--table) * var(--rise, 0.55));
  perspective: calc(var(--table) * 1.5);
  perspective-origin: 50% calc(var(--table) * (var(--rise, 0.55) - var(--eye-above, 0.72)));
}
.view-3d .felt {
  inset: auto 0 0;
  height: var(--table);
  transform-origin: 50% 100%;
  transform: rotateX(var(--tilt, 70deg));
  transform-style: preserve-3d;
}
.view-3d .seat-ring, .view-3d .seat { transform-style: preserve-3d; }
/* The other players sit across the table, so their plates are further off
   and look smaller; make them a little bigger to stay readable. */
.view-3d .seat:not(.hand-none), .view-3d .empty-seat { width: calc(var(--plate) * 1.22); }
.view-3d .empty-seat .plate { background: rgba(14, 9, 8, 0.92); }
/* Fading a whole seat would flatten it, so only its plate dims. */
.view-3d .seat.out { opacity: 1; }
.view-3d .seat.out .plate { opacity: 0.7; }

/* Standing up from the table, facing you. */
.view-3d .plate,
.view-3d .bubble,
.view-3d .announce {
  transform-origin: 50% 100%;
  transform: rotateX(calc(var(--tilt, 70deg) * -1));
}
.view-3d .announce { top: 40%; }

/* Dice do not stand up to face you: they are cubes lying on the cloth, read
   from their top face. Everything down to the faces keeps its depth. */
.view-3d .table-dice,
.view-3d .table-dice .die-spot,
.view-3d .table-dice .die { transform-style: preserve-3d; }
.view-3d .table-dice .die { perspective: none; }
.view-3d .table-dice .die-shadow { inset: -24%; height: auto; translate: 5% 9% 1px; }
/* Lit from above: the face that counts is bright, the sides are in shade. */
.view-3d .table-dice .die-face:not(.up) { filter: brightness(0.62) saturate(0.85); }

/* Each seat's cards and tokens lie in front of it the way yours would lie in
   front of you: side by side, tops towards the middle of the table. */
.view-3d .seat-hand {
  left: 50%;
  top: 50%;
  bottom: auto;
  margin: 0;
  translate: none;
  align-items: center;
  transform: translate(-50%, -50%) rotate(var(--seat-angle, 0deg)) translateY(calc(var(--table) * -0.17));
}
.view-3d .hand-below .seat-card { transform-origin: bottom center; translate: 0 4px; }
.view-3d .hand-below .seat-card:first-child { rotate: -8deg; }
.view-3d .hand-below .seat-card + .seat-card { rotate: 8deg; }
.view-3d .hand-below .bubble { left: 50%; top: calc(100% + 20px); translate: -50% 0; }
/* Nothing lies against a plate here, so the turn tag always rides its top
   edge, clear of whatever the seat says underneath. */
.view-3d .to-act { top: -10px; bottom: auto; }
.view-3d .hand-above .bubble { top: calc(100% + 26px); }

/* The piles are what has to be read on the table, and tipping it squashes
   them. They are drawn deeper than life along the line of sight, whichever
   way the shoe is turned, which gives back a little of what the tilt took. */
/* Being deeper, the row sits a little nearer the middle, clear of the hand
   lying in front of whoever it is turned to. */
.view-3d .orbit-arm { top: 65.5%; }
.view-3d .shoe {
  transform: rotate(calc(var(--shoe-angle) * -1)) scaleY(var(--pile-stretch, 1)) rotate(var(--shoe-angle));
}

/* Cards and chips in the air ride on the table's plane, a hair above it. */
.flyers-3d { display: none; position: absolute; inset: 0; transform: translateZ(1px); transform-style: preserve-3d; pointer-events: none; }
.view-3d .flyers-3d { display: block; }
.flyers-3d .flyer { transform-style: preserve-3d; }

/* Your own plate would stand between you and the table, so it hangs just
   below the near rim instead, still facing you. */
/* Not the empty place at a three-handed table, which shares the class: hung
   from a side rim it would drop through the table and be hidden by it. */
.view-3d .seat.hand-none:not(.empty-seat) .plate {
  transform: rotateX(calc(var(--tilt, 70deg) * -1)) translateY(96%);
}

/* On a wide screen the tipped table is the whole picture. It takes far less
   height than width, so it grows to nearly the width of the window; the round
   label moves to the corner of the window, the moves sit beside your plate
   under the near rim, and the table is centred in the height that is left. */
@media (min-width: 1101px) {
  :root.view-3d {
    --table: clamp(300px, min(calc(100vw - 260px), calc((100dvh - 320px) / var(--rise, 0.55))), 1400px);
    --plate: clamp(120px, calc(var(--table) * 0.14), 154px);
    --pile-w: clamp(68px, calc(var(--table) * 0.095), 116px);
    --hand-w: 112px;
  }
  .view-3d .stage {
    margin-top: max(96px, calc((100dvh - var(--masthead) - 170px - var(--table) * var(--rise, 0.55)) / 2));
  }
  .view-3d .round-label {
    position: fixed;
    left: 44px;
    right: auto;
    top: calc(var(--masthead) + 30px);
    margin: 0;
  }
  .view-3d .move-panel {
    left: calc(50% + var(--plate) / 2 + 34px);
    top: 100%;
    translate: none;
    margin-top: 14px;
    width: 300px;
  }
  .view-3d .move-buttons { flex-direction: row; }
  .view-3d .move-buttons > * { flex: 1; }
  .view-3d .mine { translate: 0 -22%; }
}

/* ---------- hover tips ---------- */

.tip {
  position: fixed;
  z-index: 80;
  max-width: 260px;
  padding: 8px 11px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink-hi);
  background: #1a110e;
  border: 1px solid rgba(195, 154, 73, 0.45);
  border-radius: 5px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  animation: tip-in 0.16s var(--ease-out);
}

/* ---------- a shift token played, held up for the table ---------- */

/* Placed with margins alone, so script can animate its `translate` and
   `scale` from the seat that played it. */
.announce {
  position: absolute;
  left: 0;
  right: 0;
  top: 25%;
  margin: 0 auto;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(86%, 380px);
  padding: 16px 18px;
  background: linear-gradient(180deg, rgba(34, 21, 16, 0.97), rgba(14, 9, 8, 0.97));
  border: 1px solid rgba(233, 198, 128, 0.65);
  border-radius: 10px;
  box-shadow: 0 0 40px rgba(233, 198, 128, 0.28), 0 22px 44px rgba(0, 0, 0, 0.7), inset 0 1px 0 rgba(255, 236, 190, 0.1);
  pointer-events: none;
}
.announce-art { flex: none; width: 58px; height: 92px; line-height: 0; filter: drop-shadow(0 0 10px rgba(233, 198, 128, 0.5)); }
.announce-art svg { width: 100%; height: 100%; display: block; }
.announce-text p { margin: 0; }
.announce-who { font-family: var(--mono); font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }
.announce-token { margin-top: 3px !important; font-family: var(--serif); font-size: 22px; line-height: 1.1; color: var(--brass-hi); }
.announce-effect { margin-top: 6px !important; font-size: 13px; line-height: 1.4; color: var(--ink); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  translate: -50% 0;
  z-index: 70;
  max-width: min(90vw, 480px);
  padding: 12px 18px;
  font-size: 14px;
  border: 1px solid rgba(195, 154, 73, 0.4);
  border-radius: 6px;
  background: #1a110e;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  animation: toast-in 0.4s var(--ease-spring);
}
.toast.bad { border-color: var(--bad); color: #ffd9d5; }

/* ---------- motion ---------- */

/* ---------- rules page ---------- */

.rules {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 60px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 28px 120px;
}
.rules-nav { position: sticky; top: calc(var(--masthead) + 32px); align-self: start; display: flex; flex-direction: column; }
.rules-nav a {
  padding: 9px 14px;
  border-left: 1px solid var(--line);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--dim-2);
  transition: color 0.2s, border-color 0.2s, padding 0.3s var(--ease-out);
}
.rules-nav a:hover { color: var(--ink); }
.rules-nav a.here { color: var(--brass-hi); border-color: var(--brass-hi); padding-left: 20px; }
/* Below the menu: the page as a Markdown file. */
.rules-nav .r-download { display: flex; align-items: center; gap: 8px; margin-top: 18px; border-left-color: transparent; font-size: 10.5px; color: var(--brass); }
.rules-nav .r-download svg { width: 14px; height: 14px; flex: none; }
.rules-nav .r-download:hover { color: var(--brass-hi); }

.rules-body { min-width: 0; }
.rules-body section { margin-bottom: 84px; scroll-margin-top: calc(var(--masthead) + 24px); }
.rules-body h1 { margin: 14px 0 18px; font-size: clamp(40px, 6vw, 72px); line-height: 0.98; }
.rules-body h2 { margin: 10px 0 18px; font-size: clamp(32px, 4vw, 46px); line-height: 1.05; }
.rules-body h3 { margin: 36px 0 12px; font-size: 25px; }
.rules-body p, .rules-body li { max-width: 66ch; color: var(--ink); }
.rules-body p { margin: 0 0 14px; }
.rules-body strong { font-weight: 600; color: var(--ink-hi); }
.r-lede { font-size: 18px; color: var(--ink-warm); }
.rules-body a:not(.brass):not(.ghost) { color: var(--brass-hi); text-underline-offset: 3px; }

/* Sections come up into place as they are scrolled to. Without script they
   are simply there. */
.js .unfold { opacity: 0; translate: 0 26px; transition: opacity 0.8s ease, translate 0.8s var(--ease-out); }
.js .unfold.in { opacity: 1; translate: none; }

.rules-body .r-family { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; margin: 36px 0 14px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.26em; text-transform: uppercase; color: var(--brass); }
.r-family span { font-family: var(--sans); font-size: 13.5px; letter-spacing: 0; text-transform: none; color: var(--dim-2); }
.r-cards { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 12px; }
.r-cards figure { margin: 0; text-align: center; }
.r-cards img { display: block; width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); transition: translate 0.35s var(--ease-spring), rotate 0.35s var(--ease-spring); }
.r-cards figure:hover img { translate: 0 -9px; rotate: -3deg; }
.r-cards figcaption { margin-top: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim-2); }

.r-box {
  border: 1px solid rgba(195, 154, 73, 0.22);
  border-radius: 6px;
  background: var(--panel);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 236, 190, 0.05);
}
.r-explain { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 24px; align-items: center; padding: 20px 24px; margin-top: 14px; }
.r-explain img { width: 100%; height: auto; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.6)); }
.r-explain h3 { margin: 0 0 6px; }
.r-explain p:last-child { margin-bottom: 0; }

.r-ranks { display: flex; flex-direction: column; gap: 14px; margin: 22px 0; }
.r-rank { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 22px; align-items: center; padding: 20px 24px; }
.r-rank-no { font-family: var(--serif); font-size: 46px; line-height: 1; color: var(--brass); }
.r-rank h3 { margin: 0 0 4px; }
.r-rank p { margin: 0; color: var(--dim); }
.r-hands { display: flex; align-items: center; gap: 12px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--faint); }
.r-pair { display: flex; }
.r-pair img { width: 50px; height: 75px; filter: drop-shadow(0 6px 9px rgba(0, 0, 0, 0.6)); }
.r-pair img:first-child { rotate: -6deg; }
.r-pair img + img { margin-left: -16px; rotate: 6deg; translate: 0 4px; }

.r-steps { counter-reset: step; list-style: none; margin: 18px 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.r-steps li { counter-increment: step; position: relative; min-height: 34px; padding-left: 52px; }
.r-steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -3px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--brass);
  border-radius: 50%;
  font-family: var(--serif);
  font-size: 19px;
  color: var(--brass-hi);
}
.r-moves { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.r-move { padding: 20px 24px; }
.r-move h3 { margin: 0 0 6px; }
.r-move p:last-child { margin-bottom: 0; }
.r-cost { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brass); }
.r-note { margin: 20px 0; padding: 14px 20px; border-left: 2px solid var(--brass); background: rgba(195, 154, 73, 0.07); border-radius: 0 4px 4px 0; }
.r-note p:last-child { margin-bottom: 0; }
.r-list { margin: 0 0 14px; padding-left: 20px; }
.r-list li { margin-bottom: 8px; }
.r-list li::marker { color: var(--brass); }

/* The help page's samples: commands and config to copy, each with a button. */
.r-code { position: relative; max-width: 74ch; margin: 12px 0 18px; }
.r-code pre { margin: 0; padding: 16px 84px 16px 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: rgba(0, 0, 0, 0.42); font-size: 13px; line-height: 1.65; }
.r-code code { color: var(--ink-warm); font-size: 1em; white-space: pre; }
.r-code [data-origin] { color: var(--brass-hi); }
.r-copy { position: absolute; top: 10px; right: 10px; padding: 5px 10px; border: 1px solid var(--line-hi); border-radius: 4px; background: rgba(20, 13, 10, 0.9); color: var(--dim); font: 10px var(--mono); letter-spacing: 0.16em; text-transform: uppercase; cursor: pointer; }
.r-copy:hover { color: var(--brass-hi); border-color: var(--brass); }
.r-copy:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.r-tools { list-style: none; padding: 0; }
.r-tools li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 10px 0; margin: 0; border-bottom: 1px solid var(--line); }
.r-tools li > code { color: var(--brass-hi); }
.r-tools li > span { color: var(--dim); }
@media (max-width: 700px) {
  .r-tools li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  /* Long one-line commands scroll sideways; keep the button out of their way. */
  .r-code pre { padding: 44px 16px 14px; }
}

.r-tokens { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.r-token { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px 20px; scroll-margin-top: calc(var(--masthead) + 24px); transition: border-color 0.3s, box-shadow 0.3s, translate 0.3s var(--ease-out); }
.r-token:hover { border-color: rgba(195, 154, 73, 0.5); translate: 0 -3px; }
.r-token:target { border-color: var(--brass-hi); box-shadow: 0 0 0 1px var(--brass-hi), 0 0 40px rgba(233, 198, 128, 0.25); }
.r-token-art { width: 58px; height: 93px; line-height: 0; }
.r-token-art img, .r-token-art svg { width: 100%; height: 100%; display: block; }
.r-token h4 { margin: 0 0 4px; font-family: var(--serif); font-weight: 400; font-size: 22px; color: var(--ink-hi); }
.r-token p { margin: 0; font-size: 14px; color: var(--dim); }
.r-tag { display: inline-block; margin-left: 8px; padding: 1px 6px; vertical-align: 3px; border: 1px solid rgba(220, 110, 90, 0.4); border-radius: 3px; font-family: var(--mono); font-size: 9px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--bad-soft); }
.r-end { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; padding: 28px; }
.r-end h2 { margin: 0; font-size: 32px; }


@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes stage-in { from { opacity: 0; transform: translateY(18px) scale(0.97); } }
@keyframes pop-in { from { opacity: 0; transform: scale(0.8); } }
@keyframes tip-in { from { opacity: 0; transform: translateY(4px); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(20px) scale(0.94); } }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
@keyframes pulse { 50% { opacity: 0.55; } }
@keyframes breathe { 50% { opacity: 0.5; } }
@keyframes crown {
  to { border-color: var(--brass); background-color: #241a10; box-shadow: 0 0 44px rgba(233, 198, 128, 0.22); }
}
@keyframes line-up { from { transform: translateY(105%); } }
@keyframes bob { from { translate: 0 -7px; } to { translate: 0 9px; } }
@keyframes mote {
  0% { opacity: 0; transform: translate(0, 0); }
  15% { opacity: 0.9; }
  100% { opacity: 0; transform: translate(var(--sway, 20px), -300px); }
}

/* The lobby and the table cross-fade into each other. */
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 0.32s; animation-timing-function: ease; }

/* ---------- narrower screens ---------- */

/* Below this the hand and the move panel no longer fit either side of the
   table, so they drop underneath it in the normal flow and the page scrolls. */
@media (max-width: 1100px) {
  :root {
    --table: clamp(280px, min(84vw, 70vh), 660px);
    --hand-w: 100px;
  }
  .table-screen { padding-bottom: 48px; }
  .stage {
    width: auto;
    margin: 20px auto 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 26px;
  }
  .round-label { position: static; margin: 0; align-items: center; text-align: center; max-width: none; }
  .table-wrap { margin: 64px 0 56px; }
  .mine, .move-panel { position: static; translate: none; }
  .mine { justify-content: center; margin-top: 12px; }
  .move-panel { width: min(420px, 100%); align-items: stretch; text-align: center; }
  .move-buttons { flex-direction: row; flex-wrap: wrap; justify-content: center; }
  .move-buttons > * { flex: 1 1 110px; }
}

@media (max-width: 860px) {
  .lobby-grid { grid-template-columns: minmax(0, 1fr); }
  .lobby { padding: 36px 16px 60px; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .hero-scene { --scene-h: 270px; order: -1; }
  .rules { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 28px 16px 80px; }
  .rules-nav { position: sticky; top: var(--masthead); z-index: 5; flex-direction: row; overflow-x: auto; margin: 0 -16px; padding: 8px 16px; background: rgba(13, 9, 8, 0.94); border-bottom: 1px solid var(--line); }
  .rules-nav a { border-left: 0; border-bottom: 1px solid transparent; white-space: nowrap; padding: 6px 10px; }
  .rules-nav .r-download { margin-top: 0; }
  .r-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .r-tokens { grid-template-columns: minmax(0, 1fr); }
  .r-rank { grid-template-columns: 34px minmax(0, 1fr); }
  .r-rank .r-hands { grid-column: 2; }
  .r-explain { grid-template-columns: 72px minmax(0, 1fr); }
  .masthead { padding: 0 16px; gap: 12px; }
  .wordmark { font-size: 18px; letter-spacing: 0.12em; }
  .table-screen { padding: 0 16px 40px; }
}

@media (max-width: 700px) {
  :root {
    --plate: 96px;
    /* Side seats hang half a plate past each edge of the table. */
    --table: max(236px, min(calc(100vw - 40px - var(--plate)), 70vh));
    --pile-w: calc(var(--table) * 0.11);
    --hand-w: 84px;
  }
  /* A phone-sized table has no room for ornament: the plates keep the count
     but drop the stack. */
  .plate { padding: 7px 8px 8px; }
  .plate-name { font-size: 15px; }
  /* The name needs the whole width of a narrow plate. */
  .kind-tag { display: none; }
  .chip-stack { display: none; }
  .plate-chips { margin-top: 4px; }
  .plate-out { font-size: 8.5px; letter-spacing: 0.1em; }
  .orbit-arm { top: 73%; }
  .masthead-table { display: none; }
  .flag { font-size: 8.5px; padding: 1px 4px; }
  .masthead-status span:last-child { display: none; }
  .pill { padding: 7px 11px; font-size: 10.5px; letter-spacing: 0.1em; }
  .pill.icon-only { width: 32px; height: 32px; }
  /* The name stacks onto two lines to leave the bar to the buttons. */
  .wordmark { font-size: 13px; letter-spacing: 0.1em; line-height: 1.05; }
  .wordmark > span { display: block; }
  /* At a table every button competes for the bar, so all of them become
     icons; the name stays for screen readers and in the tooltip. */
  .at-table .masthead-actions { gap: 6px; }
  .at-table .masthead-actions .pill { justify-content: center; gap: 0; padding: 0; width: 30px; height: 30px; font-size: 0; letter-spacing: 0; }
  .table-row { grid-template-columns: 1fr auto; gap: 8px 14px; }
  .row-status { grid-column: 1 / -1; grid-row: 2; }
  .pickers { grid-template-columns: minmax(0, 1fr); }
  .dice-box { padding: 32px 20px 28px; }
  .dice { gap: 44px; padding: 36px 0 44px; }
  .overlay-title { font-size: 36px; }
  .reveal-cards .card { width: 70px; height: 105px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- watching ---------- */
.row-cta.watch { color: var(--dim-2); }
.row-cta.watch:hover { color: var(--brass-hi); }
