/* Catan — page chrome.
 *
 * Same hand as the exhibit next door, rearranged for a game rather than a
 * readout. theme.js publishes every color and every step of the type and
 * space ladders onto :root at load; the var() fallbacks here only carry the
 * one paint before the script runs.
 *
 * The rearrangement is the point. Watching four bots wants stats on every
 * side; playing wants the board large, your own hand and options across the
 * foot where your eye already is, and only the two readouts that actually
 * change a decision left in the rails.
 */

@font-face { font-family: 'Archia'; src: url('../assets/fonts/Archia-Light.woff')    format('woff'); font-weight: 300; font-display: swap; }
@font-face { font-family: 'Archia'; src: url('../assets/fonts/Archia-Regular.woff')  format('woff'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Archia'; src: url('../assets/fonts/Archia-Medium.woff')   format('woff'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Archia'; src: url('../assets/fonts/Archia-SemiBold.woff') format('woff'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Archia'; src: url('../assets/fonts/Archia-Bold.woff')     format('woff'); font-weight: 700; font-display: swap; }

:root {
  --ink: #f4f1e8;
  --gold: #f5c542;
  --felt: #124364;
  --sheet: rgba(7, 30, 46, 0.86);
  --sheet-solid: #071e2e;
  --hair: rgba(244, 241, 232, 0.16);
  --hair-strong: rgba(244, 241, 232, 0.32);
  --ink-2: rgba(244, 241, 232, 0.74);
  --ink-3: rgba(244, 241, 232, 0.5);
  --ink-4: rgba(244, 241, 232, 0.28);
  --radius-md: 8px;
  --radius-sm: 4px;
  /* The ladders, as far as this stylesheet reaches. theme.js publishes every
     rung of both from one anchor and one ratio; these literals are the same
     numbers, and they only carry the first paint. The setup sheet is the one
     thing on this site that is fully drawn before the script runs, so its
     rungs have to be here too. */
  --fs-7: 35.284px; --fs-6: 31.284px; --fs-5: 27.738px; --fs-4: 24.594px;
  --fs-3: 21.806px; --fs-2: 19.335px; --fs-1: 17.143px; --fs-0: 15.2px;
  --fs-n1: 13.477px; --fs-n2: 11.95px;
  --fs-n3: 10.595px; --fs-n4: 9.394px; --fs-n5: 8.329px; --fs-n6: 7.385px;
  --sp-n2: 4.944px; --sp-n1: 6.289px;
  --sp-0: 8px; --sp-1: 10.176px; --sp-2: 12.944px; --sp-3: 16.465px;
  --sp-4: 20.944px; --sp-5: 26.642px; --sp-6: 33.889px; --sp-7: 43.107px;
  --rail-l: clamp(236px, 19vw, 330px);
  --rail-r: clamp(214px, 17.5vw, 316px);
  --dock-h: 156px;
  --gap: var(--sp-1, 10px);

  /* What floats over the board: the game's name, the strip that says whose
     move it is, and the two controls that are not moves. Four things drawn in
     four places by four rules, each with its own hand-picked inset, height and
     padding — 10px here, 12px there, a 26px circle beside a 35px pill — which
     is four near-misses rather than a set.

     One set of numbers instead, and all of them rungs: the same gutter the
     rails are set in, a height that is one rung of the space ladder, a gap
     inside a group one rung tighter than the gutter, and a pill's side padding
     one rung wider. Change the anchor in theme.js and the whole corner moves
     together, which is the only reason a ladder is worth having. */
  --float-inset: var(--gap);
  --float-h: var(--sp-5);
  --float-gap: var(--sp-n1);
  --float-pad: var(--sp-2);
  /* The strip floats, so what it takes out of the bottom of the window is its
     own height plus the gutter under it. `chrome.js` measures the real figure
     and publishes it as --dock-actual; this is the floor used until it does,
     and by any browser without a ResizeObserver. */
  --dock-floor: calc(var(--dock-h) + var(--gap));
  /* One card size, and only one: the hand is the same size whoever's turn it
     is, and the column is sized to it rather than the other way round.

     In the proportions of a playing card, near enough: five of these in a row
     read as a hand held in front of you, where five squares read as five
     buttons. It is the shape the flying chips on the overlay take too. */
  --card-w: 54px;
  --card-h: 74px;

  /* The number chips are not cards and no longer pretend to be.
     They used to share the card's box, on the argument that two strips of
     tiles reading at two sizes is a difference the eye has to account for.
     That held while both were one row. Wrapping the numbers onto a second row
     sooner — which is what shortens the strip and lets the game log run to the
     bottom of the window — needs them shorter, or the strip grows by a card's
     height to save a card's width. Five to a row, and then they wrap. */
  --num-w: 46px;
  --num-h: 40px;
  --num-row: 5;
}

/* Nothing of the game until the lobby hands over.
   The sheet over it is a radial-gradient of two custom properties that
   theme.js publishes at boot, and a gradient with an undefined color in it is
   not a gradient at all: for the frame or two before the script ran, the sheet
   was transparent and the empty hand and the empty rails showed through it on
   every reload. Both halves of that are fixed here — the gradient has literal
   fallbacks, and what is underneath is not drawn at all until it is real. */
body.is-booting #app,
body.is-booting #dock,
body.is-booting #overlay { visibility: hidden; }

* { box-sizing: border-box; }

/* `hidden` is a browser rule, and any `display` written here beats it. Several
   things on this page are laid out with flex or grid and are also hidden some
   of the time — a pane, a resume offer, an unused opponent row — and every one
   of them would have stayed on screen. Said once, here, rather than remembered
   at each of them. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  overflow: hidden;
  background: var(--felt);
  color: var(--ink);
  font-family: 'Archia', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(120% 92% at 50% 34%, rgba(255, 255, 255, 0.09), transparent 62%),
    radial-gradient(150% 120% at 50% 50%, transparent 38%, rgba(0, 0, 0, 0.46) 100%);
  pointer-events: none;
}

button, input, select, label, a { font-family: inherit; font-weight: 500; }

/* No double-tap zoom, anywhere (still.js has the rest). Taps and scrolling
   are kept; only the browser's second-tap zoom and its wait for one go, so a
   trade stepped up twice, or a city double-pressed, is two presses and not a
   zoom. Elements that set `touch-action` of their own (the board, the
   wheels, the drawers) keep theirs. */
html, body, button, [role="button"], a, input, select, label { touch-action: manipulation; }

/* No flash of the browser's own tap highlight, a square-cornered blue (or
   gray) box that ignored every rounded corner here. Pressed states are
   drawn by the controls themselves. */
html, body { -webkit-tap-highlight-color: transparent; }

/* iOS zooms into any field under 16px when it is focused. */
@media (hover: none), (pointer: coarse) {
  input, select, textarea { font-size: max(16px, 1em); }
}

/* ================================================================ layout */

#app {
  position: fixed;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: var(--rail-l) minmax(0, 1fr) var(--rail-r);
  gap: var(--gap);
  padding: var(--gap);
}

/* The strip along the foot is only as wide as it needs to be and sits against
   the left, so the three columns above it do not all have to stop at the same
   line. The two that stand over it do; the right-hand rail stands beside it
   whenever the strip ends clear of that column, and runs to the bottom of the
   window instead — which is room the game log can use and nothing else can.
   `chrome.js` measures the strip and says whether that is the case.

   `--dock-h` is the floor the stylesheet asks for; `--dock-actual` is what the
   strip turned out to be once its buttons had wrapped. Without script the
   floor is used, which is exactly what this was before it was measured. */
#rail-left,
#stage-wrap {
  margin-bottom: var(--dock-actual, var(--dock-floor));
}

#rail-right {
  margin-bottom: var(--rail-drop, var(--dock-actual, var(--dock-floor)));
}

.rail {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  min-height: 0;
  overflow: hidden;
}

/* The two readouts at the top are sized to what is in them: a yield row is a
   row and a roll is a roll, and neither is improved by being stretched.

   The two histograms below them are twins, and they share everything the rail
   has left between them, evenly, down to the top of the strip. They are the
   same eleven columns measured two ways — how often each number came up, and
   what it paid when it did — so a difference in height between them would read
   as a difference in importance that is not there. */
#panel-yield { flex: none; }
#panel-roll { flex: none; }
#panel-rolls,
#panel-payout { flex: 1 1 0; min-height: 150px; }
#panel-log { flex: 1 1 auto; }
/* Castaway's pace (pace-rail.js, engine/css/pace.css) sits between
   your card and the log at its own height; the log has whatever is left. */
#panel-pace { flex: none; }
#panel-pace[hidden] { display: none; }

/* Four panels down the left, or three: `rails.js`'s `fitRailLeft` measures
   whether the roll histogram and paid-by-number can both meet their own
   floor and drops the second one the moment they cannot, the same either/or
   the height query in this file already makes at one fixed breakpoint. A
   scrollbar was the alternative to both and is not one worth having — a
   rail that cannot show everything clips rather than scrolls. */
#rail-left { overflow-y: hidden; }

/* A histogram panel is a chart with a heading and a footnote, and the chart
   takes what the other two do not. */
#panel-rolls .panel-body,
#panel-payout .panel-body { display: flex; flex-direction: column; }

#stage-wrap { position: relative; min-width: 0; min-height: 0; }
#stage { position: absolute; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* ============================================================ rail grips */

/* The gutter between a rail and the board is the only strip of this page that
   is not already something, so that is where the handle for resizing the rail
   goes. Inside the rail it would have sat over the log's scrollbar. */
.rail-grip {
  position: absolute;
  top: var(--gap);
  /* Level with the board on both sides, even where the rail beside it carries
     on down: the handle belongs beside the thing it resizes the view of. */
  bottom: calc(var(--dock-actual, var(--dock-floor)) + var(--gap));
  width: var(--gap);
  z-index: 3;
  cursor: col-resize;
  touch-action: none;
}

#grip-left { left: calc(var(--gap) + var(--rail-l)); }
#grip-right { right: calc(var(--gap) + var(--rail-r)); }

/* Invisible until it is looked for. A permanent divider down both sides of
   the board would be two more lines competing with the island. */
.rail-grip::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2px;
  height: 28px;
  border-radius: 999px;
  background: var(--hair);
  transition: background 140ms ease, height 140ms ease;
}

.rail-grip:hover::after,
.rail-grip.is-dragging::after { background: var(--gold); height: 56px; }

/* A drag that starts on the gutter should not become a drag of the camera if
   the pointer wanders over the board. */
body.is-resizing { cursor: col-resize; user-select: none; -webkit-user-select: none; }
body.is-resizing #stage canvas { pointer-events: none; }

#overlay { position: fixed; inset: 0; z-index: 4; pointer-events: none; }

/* =============================================================== palette */

/* Which felt, and which accent. In the corner of the board rather than in a
   rail, so it stays in the same corner of the same thing when the rails are
   dragged, and small enough to be ignored by anybody who does not want it. */
/* Positioned by the row it sits in; `#palette-pop` hangs off it, so it keeps
   a position of its own for that to be measured against. */

/* The two of them together, in the corner, because they are the same kind of
   thing: a small permanent affordance floating over the board rather than a
   control in a rail. They used to sit in opposite corners on the grounds that
   they could then never crowd each other, which is true of two things that
   have nothing to do with each other — and these two have the same shape, the
   same glass, and the same job of staying out of the way of a board. */
/* The row the three of them live in.
 *
 * They were placed by hand before — one pinned left, one pinned right, one
 * centred on the board — and three things pinned independently are three
 * things that collide as soon as the middle one has a long sentence in it and
 * the board is only four hundred pixels wide. The strip ran through the name
 * and into the controls.
 *
 * A row instead. The two ends take an equal share of whatever is spare, which
 * is what keeps the strip centred on the board rather than merely somewhere
 * in the middle, and the strip takes what it needs up to what is left. When
 * that is not enough the sentence ellipsises, which is the one of the three
 * that can lose a word without losing its meaning.
 *
 * The row itself is transparent to the pointer so the board can still be
 * dragged through the gaps; the controls in it take their clicks back. */
#board-top {
  position: absolute;
  top: var(--float-inset);
  left: var(--float-inset);
  right: var(--float-inset);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--float-inset);
  pointer-events: none;
}

#board-mark,
#board-tools {
  flex: 1 1 0;
  min-width: 0;
}

#board-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--float-gap);
  /* The one slot that may not be squeezed: a control that has been shrunk
     out of its own width is a control nobody can press. */
  min-width: max-content;
}

#board-tools > * { pointer-events: auto; }

/* While the palette is open its row goes over the board's other corner
   controls, which are later in the page at the same height and were drawn
   through the card on a phone. */
#board-top:has(#palette-pop:not([hidden])) { z-index: 6; }

/* In the row rather than in the corner: the row is in the corner now. */
#palette { position: relative; top: auto; right: auto; z-index: auto; }

/* A reference, so it reads as one: headings you can scan for and short lines
   under them rather than a wall. */
.rules { display: grid; gap: 14px; text-align: left; }
.rules .rule h4 {
  margin: 0 0 4px;
  font-size: var(--fs-n3);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold);
}
.rules .rule p {
  margin: 0 0 3px;
  font-size: var(--fs-n1);
  line-height: 1.45;
  color: var(--ink-2);
}

#palette-open {
  display: flex;
  gap: var(--sp-n2);
  align-items: center;
  height: var(--float-h);
  padding: 0 var(--float-gap);
  border-radius: 999px;
  background: var(--sheet-soft);
  border: 1px solid var(--hair);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

#palette-open i {
  display: block;
  width: var(--sp-0);
  height: 9px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

#palette-open:hover { border-color: var(--ink-3); background: var(--sheet-strong); }
#palette-open.is-open { border-color: var(--gold); }

#palette-pop {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  /* Wide enough for all seven grounds in one row: a wrapped seventh chip
     reads as an afterthought rather than as part of the set. */
  width: 196px;
  padding: var(--sp-1);
  border-radius: var(--radius-md);
  background: var(--sheet-strong);
  border: 1px solid var(--hair);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  /* Held above the dock by chrome.js's fitPop, and scrolled inside when the
     rows will not all fit there. */
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scrollbar-width: thin;
}

.pal-label {
  font-size: var(--fs-n5);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.pal-row { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: var(--sp-1); }
.pal-row:last-child { margin-bottom: 0; }

.pal-chip {
  width: 20px;
  height: 20px;
  padding: 0;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.pal-chip:hover { transform: translateY(-1px); }
.pal-chip.is-on { outline: 2px solid var(--gold); outline-offset: 2px; }

/* The grain switch. Same row rhythm as the swatches, but it is a word rather
   than a color, because "on" is not a shade of anything. */
.pal-toggle {
  flex: 1;
  justify-content: center;
  align-items: center;
  /* Letter spacing trails the last letter too, which sets a word left of
     center by that much; the same again on the left puts it back. */
  padding: 4px 0 4px 0.12em;
  font-size: var(--fs-n5);
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* A season in force is choosing the felt and the accent (chrome.js), so the
   two rows that choose them step back; a pick from them is kept for later. */
#palette-pop.is-seasonal .is-color { opacity: 0.4; }
#palette-pop.is-seasonal .pal-row.is-color { transition: opacity 0.2s ease; }

.pal-toggle.is-on {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-accent);
}

/* ================================================================ panels */

.panel {
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
  padding: var(--sp-1);
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.panel > h2 {
  margin: 0 0 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--hair);
  font-size: var(--fs-n3);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  flex: none;
}

/* The one note on this page that is about a piece taking things away. */
.panel > h2 .note.is-robber { color: var(--robber); font-weight: 700; }

.panel > h2 .note {
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: none;
  color: var(--ink-3);
  font-size: var(--fs-n4);
  white-space: nowrap;
}

.panel-body { min-height: 0; flex: 1; }

/* ============================================================ turn strip */

/* Whose move it is, and what the game is waiting for. Over the board rather
   than beside it, because that is where the eye already is. */
#turnstrip {
  /* Sized by the row it sits in. Its height is the shared one, and what it
     cannot have is whatever the name and the controls are already using. */
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  /* Both halves are set at the same size, so centring them and sitting them
     on a common baseline are the same picture — and centring is the one that
     also puts the pill itself on the rung. Left to its own padding it came
     out two pixels over, which is the border, and a height that is a rung
     plus a border is not a rung. */
  align-items: center;
  gap: var(--float-inset);
  height: var(--float-h);
  padding: 0 var(--float-pad);
  border-radius: 999px;
  background: var(--sheet-soft, rgba(7, 30, 46, 0.72));
  border: 1px solid var(--hair);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  white-space: nowrap;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 220ms ease;
}

/* The half that can be shortened without being misread: the name of whoever
   is moving stays whole, and what they are doing gives up its tail. */
#turnstrip .what {
  overflow: hidden;
  text-overflow: ellipsis;
}

#turnstrip .who {
  font-size: var(--fs-n2);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sc, var(--ink));
}

#turnstrip .what {
  font-size: var(--fs-n2);
  color: var(--ink-3);
  letter-spacing: 0.05em;
}

#turnstrip.is-yours { border-color: var(--gold); box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.28); }

/* A day's turn count, after a hairline, in the same quiet type as "what". */
#turnstrip .left {
  font-size: var(--fs-n2);
  color: var(--ink-2);
  letter-spacing: 0.05em;
  padding-left: var(--float-inset);
  border-left: 1px solid var(--hair);
  font-variant-numeric: tabular-nums;
}
#turnstrip .left[hidden] { display: none; }

/* ========================================================= opponent cards */

/* One card per seat, in four lines that answer the four questions you ask
   about somebody across a table: who they are, how close they are, how much
   they are holding, and what they have on the board.

   It was three lines with a large number floating in the corner. The number
   sat on the name's baseline, which left a card's worth of empty space above
   the name and made the count read as decoration rather than as the thing the
   card is about. */

#opponents {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  flex: none;
  /* What every size on a card is measured from: the rail's width, up to a
     point. Past it the cards stop growing and the rail's extra room goes to
     the log. A crowded table stops sooner, since eight cards that each grow
     are eight times the height. */
  --opp-w: min(var(--rail-r), var(--opp-grow, 420px));
}

/* ------------------------------------------------- a crowded table

   More than four seats, which only Megacatan has. `chrome.js` sets the
   attribute when the game is dealt. */
:root[data-crowd] {
  /* Wide enough for the roll to list eight seats in two columns. */
  --rail-l: clamp(300px, 24vw, 420px);
}

:root[data-crowd] #opponents { --opp-grow: 250px; }

/* However many seats, the log keeps room to be read. `rails.js` measures the
   right-hand rail and steps the cards down one level at a time until it does:
   first tighter, then without the row of backs, and last as a single line —
   name, count in hand and points — which is everything the robber needs to
   know and nothing it does not. */
#opponents.fit-1 { gap: 6px; }
#opponents.fit-1 .opp { padding: 6px 10px 7px; gap: 4px; }

#opponents.fit-2 { gap: 5px; }
#opponents.fit-2 .opp { padding: 5px 9px 6px; gap: 3px; }
#opponents.fit-2 .opp-track,
#opponents.fit-2 .opp-cards { display: none; }
#opponents.fit-2 .opp-hand { min-height: 0; position: absolute; right: 9px; bottom: 6px; }
#opponents.fit-2 .opp { position: relative; }
#opponents.fit-2 .opp-meta { padding-right: 2.4em; }

#opponents.fit-3 { gap: 4px; }
#opponents.fit-3 .opp {
  flex-direction: row;
  align-items: center;
  padding: 4px 9px;
  gap: 8px;
}
#opponents.fit-3 .opp-head { flex: 1; }
#opponents.fit-3 .opp-vp b { font-size: var(--fs-1); }
#opponents.fit-3 .opp-track,
#opponents.fit-3 .opp-cards,
#opponents.fit-3 .opp-meta { display: none; }
#opponents.fit-3 .opp-hand { min-height: 0; order: -1; position: static; }
#opponents.fit-3 .opp-head { order: -2; }

/* Without its row of backs, a count in hand is a bare number next to the
   points, so it says what it counts. */
#opponents.fit-2 .opp-held::after,
#opponents.fit-3 .opp-held::after {
  content: ' cards';
  font-size: var(--fs-n5);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink-4);
}
#opponents.fit-2 .opp-meta { padding-right: 4.6em; }

/* The seat's color, all the way round and faintly underneath. A stripe down
   one edge made one side of every card heavier than the other three, which
   reads as a stack of little flags rather than as a column of cards. Whose
   move it is is that outline getting heavier and picking up a haze off it, and
   the weight is a shadow rather than border width, so nothing shifts by two
   pixels when the turn passes. */
.opp {
  background:
    linear-gradient(var(--sc-soft, transparent), transparent 62%),
    var(--sheet);
  border: 1px solid var(--sc-line, var(--hair));
  border-radius: var(--radius-md);
  padding: 9px 11px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  transition: border-color 260ms ease, box-shadow 260ms ease, background 260ms ease;
}

/* Whose move it is, said by the border going from the seat's color at
   two-fifths to the seat's color, and by the wash behind it coming up. Not
   by the border getting thicker.

   It used to add `0 0 0 2px` of the seat color outside the border, which is a
   second ring with its own corner radius pressed against the first: at every
   corner the two curves disagree and the gap between them shows as a stray
   bracket of color. That is the artifact, and it was there because the ring
   was trying to be a thicker border without moving the layout. A color is
   enough. */
.opp.is-turn {
  border-color: var(--sc);
  background:
    linear-gradient(var(--sc-soft, transparent), transparent 78%),
    var(--sheet);
}

/* ------------------------------------------------------------- the head */

/* The name and the count on one line, centered against each other rather than
   sharing a baseline. A 30px numeral and a 10px name have nothing useful in
   common at the foot of their letters. */
.opp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.opp-name {
  font-size: clamp(var(--fs-n3), calc(var(--opp-w) * 0.048), var(--fs-0));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sc, var(--ink-2));
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* Your own seat, shown exactly as the others are shown, and tagged so it is
   never mistaken for somebody else's. Quiet: it is a note on a name, not a
   second name. */
.opp.is-you .opp-name::after {
  content: 'you';
  margin-left: 7px;
  font-size: var(--fs-n5);
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--ink-4);
}

/* Called "You" already (rails.js `selfLabel`), so the tag would say it twice. */
.opp.is-self .opp-name::after { content: none; }

/* The one number on this card that says who is winning, and it was set at the
   size of a caption before all this. Big, and on a line that is the right
   height for it. */
.opp-vp {
  display: flex;
  align-items: baseline;
  gap: 3px;
  flex: none;
  line-height: 1;
}

.opp-vp b {
  font-size: clamp(var(--fs-1), calc(var(--opp-w) * 0.088), 32px);
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* The game is over and some of this score was in a hand until now: the
   figure takes the gold the dock gives a point card nobody else can see. */
.has-unseen .opp-vp b { color: var(--gold); }

.opp-vp i {
  font-style: normal;
  font-size: clamp(var(--fs-n4), calc(var(--opp-w) * 0.036), var(--fs-n2));
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

/* --------------------------------------------------------- ten points */

/* How close, as a thing you see rather than a number you read. Public points
   only, so it says exactly what the table can see and nothing it cannot. */
.opp-track {
  height: 3px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.32);
  overflow: hidden;
}

.opp-track { display: flex; }

.opp-track i,
.opp-track b {
  display: block;
  flex: none;
  height: 100%;
  width: 0;
  background: var(--sc, var(--ink-3));
  transition: width 320ms cubic-bezier(0.4, 0, 0.2, 1);
}
.opp-track i { border-radius: 2px; }

/* ------------------------------------------------------------- the hand */

.opp-hand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(clamp(11px, calc(var(--opp-w) * 0.042), 17px) * 1.4);
}

.opp-cards {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

/* Cards face down: a count and that many backs, which is exactly what you can
   see across a real table. Drawn as backs rather than as hatched blocks — a
   hairline, an inset rule a pixel in, and a weave too fine to read as a
   pattern, which is what the back of a card looks like from a meter away. */
.opp-back {
  flex: none;
  width: clamp(11px, calc(var(--opp-w) * 0.042), 17px);
  height: calc(clamp(11px, calc(var(--opp-w) * 0.042), 17px) * 1.4);
  border-radius: 2px;
  background:
    repeating-linear-gradient(45deg,
      rgba(244, 241, 232, 0.16) 0 1.5px, rgba(244, 241, 232, 0.04) 1.5px 3px);
  border: 1px solid var(--hair-strong);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

/* A development card is the one thing in a hand worth telling apart at a
   glance, so it takes the accent and stands off the resources by a gap. */
.opp-back.is-dev {
  margin-left: 4px;
  background:
    repeating-linear-gradient(45deg,
      rgba(245, 197, 66, 0.42) 0 1.5px, rgba(245, 197, 66, 0.14) 1.5px 3px);
  border-color: var(--gold-line, rgba(245, 197, 66, 0.55));
}

.opp-back.is-dev + .opp-back.is-dev { margin-left: 0; }

.opp-cards.is-cut {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 16px), transparent);
}

.opp-cards.is-empty::before {
  content: 'nothing in hand';
  font-size: var(--fs-n4);
  letter-spacing: 0.05em;
  color: var(--ink-4);
}

/* The figure beside the backs, so nobody has to count to nine. Over the
   seven-card limit it takes the robber's red, because that is who the number
   is a warning about. */
.opp-held {
  flex: none;
  font-size: clamp(var(--fs-n3), calc(var(--opp-w) * 0.042), var(--fs-0));
  font-weight: 700;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  min-width: 1.2em;
  text-align: right;
}

.opp-held.is-over { color: var(--robber); }

/* ------------------------------------------------------------- the board */

/* What they have out there. The figures carry the ink and the words carry
   none, so the line reads as four numbers rather than as a sentence. */
.opp-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 5px;
  font-size: clamp(var(--fs-n4), calc(var(--opp-w) * 0.034), var(--fs-n2));
  color: var(--ink-4);
  letter-spacing: 0.05em;
}

.opp-meta b { color: var(--ink-2); font-weight: 700; margin-right: 2px; }
.opp-meta em { font-style: normal; color: var(--ink-4); opacity: 0.5; }

/* An award is a fact about the game rather than another count, so it is a
   chip in the accent rather than a third phrase in the same sentence. */
.opp-meta .lead {
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--gold-soft, rgba(245, 197, 66, 0.1));
  color: var(--gold);
  font-weight: 700;
  font-size: 0.92em;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ==================================================================== log */

.log {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  font-size: var(--fs-n3);
  line-height: 1.42;
}

/* A scrollbar drawn by the browser is the one piece of this page nobody chose:
   a light gray slab on a felt table, in whatever the operating system thinks a
   scrollbar looks like. Said twice because the two ways of saying it are not
   the same standard and neither is universal. Anything on this page that
   scrolls is listed here, so there is one answer rather than four. */
.log,
.chat-log,
#rail-left,
.numbers,
#lobby .sheet,
#modal-body {
  scrollbar-width: thin;
  scrollbar-color: var(--hair-strong) rgba(0, 0, 0, 0.24);
}

/* A dialog taller than the stage had no way to reach its own buttons:
   `#modal` centers its card, so a long offer builder lost the top and the
   bottom equally, and `.modal-actions` is the last child.

   The cap belongs to the dialog body and to nothing else. It was written into
   the list above, which is every part of this page that scrolls — and four of
   those five are not dialogs. `#lobby` is the setup sheet, fixed to all four
   edges and covering the game behind it, so capping it at three fifths of the
   window left the bottom two fifths of the front door showing open water. The
   sheet was still the right size and still scrolled; it simply stopped before
   the bottom of the screen. */
#modal-body {
  max-height: 60vh;
  overflow-y: auto;
}

.log::-webkit-scrollbar,
.chat-log::-webkit-scrollbar,
#rail-left::-webkit-scrollbar,
#lobby .sheet::-webkit-scrollbar,
#modal-body::-webkit-scrollbar { width: 8px; height: 8px; }

.log::-webkit-scrollbar-track,
.chat-log::-webkit-scrollbar-track,
#rail-left::-webkit-scrollbar-track,
#lobby .sheet::-webkit-scrollbar-track,
#modal-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.24);
  border-radius: 999px;
}

.log::-webkit-scrollbar-thumb,
.chat-log::-webkit-scrollbar-thumb,
#rail-left::-webkit-scrollbar-thumb,
#lobby .sheet::-webkit-scrollbar-thumb,
#modal-body::-webkit-scrollbar-thumb {
  background: var(--hair-strong);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

.log::-webkit-scrollbar-thumb:hover,
.chat-log::-webkit-scrollbar-thumb:hover,
#rail-left::-webkit-scrollbar-thumb:hover,
#lobby .sheet::-webkit-scrollbar-thumb:hover,
#modal-body::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }

.log .line { padding: 2px 0 2px 7px; border-left: 2px solid transparent; color: var(--ink-2); }
.log .line.plain { border-left-color: var(--hair); }
.log .line.faint { color: var(--ink-3); }
.log .line.warn { color: var(--robber-lit); border-left-color: var(--robber-line); }
.log .line.gold { color: var(--gold); border-left-color: rgba(245, 197, 66, 0.5); }
.log .line.accent { color: var(--ink); border-left-color: var(--hair-strong); }
.log .line.win { color: var(--gold); font-weight: 700; }
.log .line.you { background: rgba(245, 197, 66, 0.07); }

/* =================================================================== dock */

/* Your hand and your options. The one place the interface asks you for
   something, so it never moves and never has to be found. */
#dock {
  position: fixed;
  left: var(--gap);
  bottom: var(--gap);
  /* Exactly as wide as what is in it, against the left. Whatever the window
     has over that is left alone at the right-hand end, where the game log can
     have it. */
  width: fit-content;
  max-width: calc(100% - var(--gap) * 2);
  /* As tall as what is in it, and never shorter than this. The height used to
     be a number guessed per breakpoint, and the guess was wrong wherever the
     option buttons wrapped one row further than expected — which depends on
     how wide the options column is, which now depends on how many numbers you
     hold. Rather than guess again at every combination, it is measured. */
  min-height: var(--dock-h);
  z-index: 5;
  display: grid;
  /* One row, five segments. The options no longer need half the strip: their
     buttons come in two kinds and go on two lines, which halves the width they
     ask for and leaves room for a segment that had nowhere to be.

     Your hand and your numbers are sized to what is in them, so neither ever
     changes width for a reason that has nothing to do with your hand.

     Every one of them is a content width and the gaps between them are the
     page's ordinary gap. Spare window width is not shared out along the strip:
     an even spread of it puts a hand's five cards a thumb apart, which reads as
     five things in a line rather than as a hand. It goes to the right of the
     strip instead, where it is worth something to the log.

     And because the contents are now the same whoever's turn it is, none of
     this moves during a game. */
  grid-template-columns:
    max-content                 /* your hand, sized to its cards */
    fit-content(440px)          /* your numbers, sized to them */
    minmax(min-content, auto)   /* your turn, two lines of buttons */
    max-content                 /* what is left in the box */
    max-content;                /* victory points */
  gap: var(--gap);
  padding: var(--gap);
  background: linear-gradient(to top, var(--sheet-strong), var(--sheet-soft));
  /* A thing on the table, not a bar bolted to the window.
     It used to run into the bottom and left edges of the screen and stop, with
     one corner rounded, which made it read as part of the browser rather than
     part of the game — and no other panel on this page touches an edge. It
     floats now, in the same gutter everything else floats in, and it is the
     same rounded rectangle everything else is. */
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  transition: border-color 420ms ease, box-shadow 420ms ease;
}

/* Watching is most of a game, and for all of it there is nothing on the strip
   to press. The buttons stay where they are and fade almost out — the same
   tell a build you cannot afford carries, taken further and applied to all of
   them at once. On top of the buttons' own graying that is about a sixth of
   full strength: legible as a shape, plainly not an offer.

   Nothing moves at all when the turn changes. Every card, every chip, every
   count and every button is where it was and the size it was, because a turn
   changing has nothing to do with how big a card of wood is. */
#dock.is-watching .actions {
  opacity: 0.5;
  pointer-events: none;
}


/* Your turn, said once, all the way round.
   A hairline of accent along the top edge was doing this before, and an edge
   is a poor place to put a signal: half of it was off the side of the window
   and the rest was a millimeter of color under the board. The whole outline
   lights instead, with a haze off it, which is a thing you notice in the
   corner of your eye while you are looking at the island. The opponent cards
   say it the same way, in the seat's own color rather than the accent. */
#dock:not(.is-watching) {
  border-color: var(--gold-line);
  box-shadow: 0 0 0 1px var(--gold-line), 0 0 26px var(--gold-glow);
}

#dock > div {
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  padding: 8px 10px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Every heading on this strip is written out of the width contest.
   A heading is a label for a box, and it was setting the box: "your hand
   12 cards" is wider than five cards and their names, so the hand's segment
   was as wide as its own caption and the last card sat with a finger's width
   of nothing to its right. Nothing to contribute across, full width once
   there is a width to fill — the trick the prompt has always used, now said
   once for all five. */
#dock .dock-label {
  width: 0;
  min-width: 100%;
}

/* Except over the box, whose three fractions are narrower than its three
   words: there the heading sets the width, on one line, rather than folding
   in two to fit the numbers under it. */
#dock #dock-box .dock-label {
  width: auto;
  white-space: nowrap;
}

.dock-label {
  font-size: var(--fs-n4);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.dock-label span { font-weight: 500; letter-spacing: 0.05em; text-transform: none; }

/* The prompt wears the heading's type and not its layout. Every other heading
   on this strip is a label at one end and a note at the other, which is what
   `space-between` is for; the prompt is one sentence, and a sentence that
   colors two of its words is several nodes rather than one. Spread apart,
   "your turn, and a knight in hand" arrived as three phrases pinned to three
   different places. */
#dock-prompt {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------------------------------------------------------------- hand */

/* The five resources and then the development cards, on one row, centered in
   whatever height the dock turned out to be. */
.hand-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 1;
  min-height: 0;
  min-width: 0;
}

.hand { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }

/* Big enough to read without leaning in. These are the five numbers a player
   checks more often than anything else on the page, and they were previously
   the smallest type on it.

   One fixed size, and the same one whoever's turn it is. Cards that grew into
   whatever room the dock happened to have made the whole strip resize every
   time the turn changed, which is a lot of movement to pay for a little less
   empty space. The column is sized to them instead. */
.card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 0 0 var(--card-w);
  /* Every card in the hand the same width, whatever is written on it. */
  width: var(--card-w);
  min-width: 0;
  min-height: var(--card-h);
  padding: 5px 4px;
  border-radius: var(--radius-sm);
  background: var(--rc, var(--hair));
  border: 1px solid rgba(0, 0, 0, 0.35);
  color: var(--on-accent, #08202f);
  line-height: 1;
}

.card .n { font-size: var(--fs-3); font-weight: 700; font-variant-numeric: tabular-nums; }
.card .r {
  font-size: var(--fs-n5);
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  opacity: 0.72;
  white-space: nowrap;
}
.card.is-empty { background: transparent; border-color: var(--hair); color: var(--ink-4); }
.card.is-empty .r { opacity: 1; }

/* A card being counted out for a discard, or spent on a build. */
.card.is-pick { outline: 2px solid var(--gold); outline-offset: 1px; }
.card.is-short { outline: 2px solid var(--robber-lit); outline-offset: 1px; }

/* What each card in your hand trades at (dock.js `rateLine`): a segment a
   card the trade takes, filled as far as the hand goes, gold at one more
   than a trade takes. Inside the card's foot, so the hand keeps its height. */
#hand-res .card[data-res] { position: relative; }
.rate-line {
  position: absolute;
  left: 5px;
  right: 5px;
  bottom: 3px;
  display: flex;
  gap: 2px;
  height: 3px;
  pointer-events: none;
}
.rate-line i {
  flex: 1 1 0;
  border-radius: 1px;
  background: rgba(8, 32, 47, 0.28);
}
.card.is-empty .rate-line i { background: var(--hair); }
.rate-line i.is-held { background: rgba(8, 32, 47, 0.7); }
.rate-line.is-ready i { background: var(--gold); box-shadow: 0 0 0 1px rgba(8, 32, 47, 0.55); }

/* Dragging one card of your hand onto another trades it with the bank at the
   best rate you have (hand-trade.js). The card is held still for a pointer or
   a finger, so the press is a drag rather than a scroll or a text selection. */
#hand-res .card[data-res] {
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
#hand-res .card[data-res]:not(.is-empty) { cursor: grab; }
#hand-res.is-trading .card[data-res] { cursor: grabbing; }
#hand-res .card.is-trade-from { opacity: 0.4; }
#hand-res .card.is-trade-to { outline: 1px dashed var(--hair-strong); outline-offset: 2px; }
#hand-res .card.is-trade-over {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  transform: translateY(-3px);
}
#hand-res .card.is-trade-short { animation: trade-short 0.3s ease; }
@keyframes trade-short {
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}
.card.trade-ghost {
  position: fixed;
  z-index: 60;
  margin: 0;
  pointer-events: none;
  /* Above the pointer, so a finger does not cover the card it is aiming at. */
  transform: translate(-50%, calc(-100% - 12px)) rotate(-4deg);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
}
.trade-ghost-rate {
  position: absolute;
  top: -9px;
  right: -12px;
  padding: 2px 5px;
  border-radius: 8px;
  background: var(--sheet-solid);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-size: var(--fs-n4);
  font-weight: 700;
  line-height: 1;
}
@media (prefers-reduced-motion: reduce) {
  #hand-res .card.is-trade-short { animation: none; }
  #hand-res .card.is-trade-over { transform: none; }
}

/* Over seven, and a seven costs you half of them. The count carries the
   robber's own red because the robber is who it is warning you about, and it
   is the only thing in the hand's heading that ever changes color. */
#hand-count.is-over { color: var(--robber); font-weight: 700; }

/* Development cards sit to the right of the ore, on the same row and at the
   same height, separated by a rule rather than by being somewhere else. There
   are rarely more than two, and each is as wide as the word on it. */
.hand.devs { gap: 6px; flex-wrap: nowrap; align-items: center; }

.hand.devs:not(:empty) {
  padding-left: var(--sp-2);
  border-left: 1px solid var(--hair);
}

/* Playable right now: clicking it plays it. Marked the way an armed build
   button is marked, because it is the same kind of offer. */
.hand.devs .card.is-playable {
  cursor: pointer;
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(245, 197, 66, 0.35);
}

.hand.devs .card.is-playable:hover { background: rgba(245, 197, 66, 0.28); }
.hand.devs .card.is-playable:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.hand.devs .card {
  /* Exactly the size of a resource card. Being shorter made them read as a
     lesser kind of thing on the same shelf, and being as wide as the word on
     them made monopoly the widest card in the hand. The faces are short enough
     to fit; anything longer is cut rather than allowed to stretch the card. */
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  min-width: 0;
  overflow: hidden;
  min-height: var(--card-h);
  background: rgba(245, 197, 66, 0.16);
  border-color: rgba(245, 197, 66, 0.42);
  color: var(--gold);
}

.hand .card .r { max-width: 100%; overflow: hidden; text-overflow: clip; }
.hand.devs .card .r { letter-spacing: 0.04em; }

.hand .none { font-size: var(--fs-n3); color: var(--ink-4); letter-spacing: 0.05em; }

/* ------------------------------------------------------------- numbers */

/* The rolls that pay you. One chip per number, and a swatch for every card it
   puts in your hand, so a city reads as two of something rather than as one
   corner that is somehow worth more. */
/* Capped at five to a row, then it wraps.
   Left to run, eleven numbers made this the widest thing on the strip by a
   long way, and the strip's width is what decides whether the game log gets to
   run to the bottom of the window. Two short rows cost about forty pixels of
   height, which the hand was already asking for, and save two hundred and
   fifty of width, which nothing else was going to give back. */
.numbers {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  justify-content: flex-start;
  max-width: calc(var(--num-w) * var(--num-row) + 5px * (var(--num-row) - 1));
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.numbers .none { font-size: var(--fs-n3); color: var(--ink-4); letter-spacing: 0.05em; }

/* A chip, not a card. Same corner radius and the same vocabulary of colors,
   and deliberately shorter and narrower: a card is a thing you hold and a
   number is a thing the board does, and once the numbers wrap onto two rows
   the difference has to be visible or the strip reads as ten cards.

   Always one size. What a roll pays is a bar under the numeral rather than a
   swatch a card, so a number that pays thirty is no bigger than one that pays
   one (dock.js, `numberChip`), and the strip's height is set by how many
   numbers you are on and never by how much is on each. */
.num {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 4px;
  flex: 0 0 var(--num-w);
  width: var(--num-w);
  min-width: 0;
  height: var(--num-h);
  padding: 4px 5px;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(244, 241, 232, 0.06);
  border: 1px solid var(--hair);
  transition: border-color 200ms ease, background 200ms ease;
}

/* The numeral, and once the cards are too many to count off the bar, the
   count beside it in the strip's quieter ink. */
.num-head {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}

.num-n {
  font-size: var(--fs-1);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.num-count {
  font-size: var(--fs-n4);
  font-weight: 700;
  line-height: 1;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.num-count::before { content: '×'; font-weight: 500; }

/* The bar: a segment a card, or past six a segment a resource sized by its
   share (its flex-grow, set in dock.js). One height whatever is in it. */
.num-pays {
  display: flex;
  gap: 1px;
  height: 6px;
  width: 100%;
  border-radius: 1px;
  overflow: hidden;
}

.num-pays i { display: block; flex: 1 1 0; min-width: 1px; height: 100%; }

/* A card the robber is holding, hatched as the expected-yield bars hatch
   the part of a seat's ground under it, so the two panels draw one bite one
   way. Six and eight are set like any other number, which leaves red on this
   strip meaning the robber and nothing else. */
.num-pays i.is-held {
  background: repeating-linear-gradient(135deg, var(--robber) 0 1.5px, transparent 1.5px 3.5px);
}

/* Every tile of it under the robber: the number pays nothing at all, which is
   the reason to go and move the thing. */
.num.is-dead {
  border-color: var(--robber-line);
  border-style: dashed;
  background: var(--robber-soft);
}
.num.is-dead .num-n { color: var(--robber); text-decoration: line-through; }

/* -------------------------------------------------------------- actions */

/* Two lines: what you can buy, and what you can do. Centered as a block, so
   the seam between them lands on the middle of the strip and the buttons sit
   either side of it rather than drifting up and down as their number changes. */
.actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  flex: 1;
  min-height: 0;
  /* Only ever between the two states of a turn, and slow enough to read as a
     change of mode rather than as a flicker. */
  transition: opacity 420ms ease;
}

/* Both lines are present whether or not they have anything in them, and they
   split the height evenly, so the seam between them sits exactly on the middle
   of the strip and stays on that pixel when a knight leaves your hand. */
/* The two lines are the same width as each other, always.
   They are set by whichever of them is wider — the price list, usually, which
   carries four costs — and the other spreads its buttons across that width
   rather than leaving a ragged end. Nothing is stretched and no button changes
   size; only the air between them moves, and `gap` is still the floor, so a
   line that genuinely needs the room simply wraps as it did. */
/* Packed from the left, not spread to the edges.

   This was `space-between`, which spends every spare pixel of the row on the
   gaps between the buttons. On a narrow dock there are no spare pixels and it
   looks deliberate; give the strip a wide window and the same four buttons
   drift apart into a row of islands, with the gap changing every time a label
   does. A gap that is a leftover is not a measurement, and this row has a
   measurement already: the same one every other gap on the page uses. */
.action-line {
  justify-content: flex-start;
  display: flex;
  /* Grown from their own content rather than from nothing, so a line that has
     to wrap makes the dock taller instead of overflowing it. Both lines are a
     single row of buttons at any width worth having, and equal, so the seam
     lands on the middle; where one has to wrap, a correct height beats an
     exactly centered seam. */
  flex: 1 1 auto;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
  min-height: 30px;
}

/* The eight buttons are a fixed vocabulary, but not every screen spells them
   the same: before the roll, "roll the dice" stands where "end turn" stands
   after it, and that pair of words is a couple of dozen pixels wider. Left to
   itself the column would breathe in and out twice a turn, which is the one
   piece of movement the rest of this strip no longer has. A floor as wide as
   the widest spelling settles it — and only where there is width to spare,
   since below this the buttons already have a row to themselves. */
@media (min-width: 861px) {
  #action-row { min-width: 366px; }
}

/* The end of the game is the one screen with a single thing to press on it,
   and that one thing takes the middle of the box rather than the left of it.
   A line with one button in it is spread by nothing, so it is centered by
   hand rather than left against the edge. */
.actions > .action-line:only-child { justify-content: center; }
.action-line:has(> button:only-child) { justify-content: center; }

/* The buy line reads down from the seam and the do line up to it, so the two
   sit against the middle rather than against the edges. */
.action-line.is-buy { align-items: flex-end; }
.action-line.is-do { align-items: flex-start; }

/* The price list. Its buttons carry a cost under the name rather than beside
   it, which is what lets four of them sit on one line in a column a third the
   width the old single row needed. */
.action-line.is-buy button {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 5px 10px;
}

.action-line.is-buy button .cost { margin-left: 0; }

button {
  appearance: none;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair-strong);
  background: rgba(244, 241, 232, 0.06);
  color: var(--ink);
  font-size: var(--fs-n3);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 11px;
  transition:
    background 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
    border-color 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
    color 180ms cubic-bezier(0.22, 0.61, 0.36, 1),
    opacity 220ms ease,
    transform 180ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* This strip changes what it is offering several times a turn, and every one
   of those changes used to arrive instantly. A button lifting a pixel under
   the pointer and settling back, and an armed one settling into its color
   rather than snapping to it, is the difference between an interface that
   responds and one that flickers. */
/* Hover only where there is a pointer to hover with. On a touchscreen the
   browser leaves :hover on whatever was tapped last, so a card or a button
   stayed lifted and darkened after the finger had gone. */
@media (hover: hover) {
  button:hover:not(:disabled):not([aria-disabled="true"]) { transform: translateY(-1px); }
}
button:active:not(:disabled):not([aria-disabled="true"]) { transform: translateY(0); }

@media (hover: hover) {
  button:hover:not(:disabled):not([aria-disabled="true"]) { background: rgba(244, 241, 232, 0.13); border-color: var(--ink-3); }
}
/* Said, not shown. A live region for the board, which is a canvas and
   therefore has nothing a screen reader can read on its own. Not
   `display: none`, which would stop it being announced at all. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

/* The board takes focus now, so it has to show it. Inset rather than outside,
   because the canvas is flush to its wrapper and an outline drawn outward gets
   clipped by the rails. */
#stage canvas:focus { outline: none; }
#stage canvas:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -2px;
}

/* Where the keyboard is. The lobby has had this since it was written; the
   rest of the game was leaving it to whatever ring the browser draws, which
   against this chrome is a thin gray line on a dark blue panel. One rule,
   everywhere, in the accent that already means "this is the thing". */
:where(button, [role="button"], input, select, textarea, a[href], [tabindex]):focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* Unless the last thing to move was a pointer rather than the keyboard
   (chrome.js): holding H, or a dialog moving focus by itself, is not
   somebody steering, and the ring it drew read as stray outlines. */
html.is-pointing :focus-visible,
html.is-pointing #stage canvas:focus-visible { outline: none; }

/* An action the rules refuse is marked rather than removed, so it keeps its
   place in the tab order and can still be asked why. `game.js` writes the
   reason and `dock.js` puts it on the line under the strip on hover or
   focus; a `disabled` button answers neither a keyboard nor a fingertip. */
button:disabled,
button[aria-disabled="true"] { opacity: 0.32; cursor: not-allowed; }
button.primary { background: var(--gold); border-color: var(--gold); color: var(--on-accent, #08202f); }
button.primary:hover:not(:disabled):not([aria-disabled="true"]) { background: #ffd764; border-color: #ffd764; }
button.is-armed { background: var(--gold); border-color: var(--gold); color: var(--on-accent, #08202f); }
/* Castaway auto-trade: not affordable as the hand stands, but a trade or two
   away, and pressing it makes them. The green is the legality layer's, the
   one the board uses for "you can build here". */
button.is-procure:not(.is-armed) {
  border-color: rgba(91, 229, 138, 0.55);
  box-shadow: 0 0 6px rgba(91, 229, 138, 0.18);
}
button.ghost { border-color: var(--hair); color: var(--ink-3); }

button .label { white-space: nowrap; }

/* What a thing costs, in the colors the rest of the dock uses for resources.
   Written out in words this was the widest thing on the strip, and it was what
   stopped the four things you can buy sitting on one line. */
button .cost {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-transform: none;
  letter-spacing: 0;
}

.cost-bit { display: inline-flex; align-items: center; gap: 2px; }

.cost-bit i {
  display: block;
  width: 9px;
  height: 10px;
  border-radius: 1px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.cost-bit b {
  font-size: var(--fs-n5);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  opacity: 0.85;
}

.hint {
  font-size: var(--fs-n4);
  color: var(--ink-3);
  letter-spacing: 0.05em;
  min-height: 1em;
}

/* The heading and the reason sit in a box whose width is set by its buttons,
   and neither gets a say in it. A sentence measured on one line is wider than
   the eight buttons it is explaining, so left to contribute they would size
   the column — and the strip would then shift by however long the sentence, or
   somebody's name, happened to be. Nothing to contribute across, full width
   once there is a width to fill. */
#dock-prompt,
#dock-actions .hint {
  width: 0;
  min-width: 100%;
}

/* One line, always. Pointing at a button borrows this line for the button's
   reason, and the reasons on refused buttons are long enough to wrap in a
   column this narrow. A second line made the strip taller, which lifted the
   button out from under the pointer, which gave the line back, which dropped
   the strip again — a loop that ran every frame with the pointer between two
   buttons, and resized the board every time round. What is cut off here is
   on the button's tooltip and on this line's own. */
#dock-actions .hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  /* And one line's height whether or not there is a line in it: empty, the
     box fell back to its 1em floor, a pixel and a half shorter than a line
     of text, so even a button with no reason moved the strip on the way
     in and out. */
  line-height: 1.25;
  height: 1.25em;
  min-height: 0;
}

/* The game's name over the board, in the corner the rules button left.
   Set in the face the door sets its title in, at the size the panel headings
   use, because it is a label on a screen rather than a masthead: the board is
   what somebody is looking at and this only has to say what they are looking
   at. The possessive carries the weight and the game carries the ink, which
   is the same arrangement the door's title has. */
#board-mark {
  /* Given the height rather than left to its line box, so its middle lands on
     the middle of the two controls across from it rather than near them. */
  display: flex;
  align-items: center;
  height: var(--float-h);
  font-size: var(--fs-n2);
  white-space: nowrap;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink-2);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
  pointer-events: none;
  user-select: none;
}

#board-mark b { font-weight: 700; color: var(--ink); }

.hint.is-bad { color: var(--robber-lit); }

/* A line that has just changed is worth a glance and a line that has not
   should not ask for one, so the animation is fired by the script only when
   the words are actually different. */
@keyframes dock-say {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

#dock-prompt.is-fresh,
#dock-actions .hint.is-fresh { animation: dock-say 260ms ease both; }

/* Two nouns in this game are also two colors.
   The robber is the piece that takes things away and the knight is the card
   that moves it, and they are the only words down here that a player reacts to
   rather than reads. Wherever a prompt or a hint names one, it is set in the
   color that thing is drawn in everywhere else. */
#dock em.w-robber,
#dock em.w-knight { font-style: normal; font-weight: 700; }
#dock em.w-robber { color: var(--robber); }
#dock em.w-knight { color: var(--gold); }

/* ------------------------------------------------------------------ you */

/* ---------------------------------------------------------- left in the box */

/* Roads, settlements and cities still unbuilt — drawn as the pieces they are,
   in your color, rather than as three numerals. A supply is something you
   look at rather than a figure you read: eleven little bars is "plenty" at a
   glance and three is "careful now", and no arithmetic happened either time.

   Every piece is drawn whether or not you still have it, and a spent one is
   left as a ghost of itself, so the strip never changes width as you build and
   what you have spent stays as legible as what is left. */
/* Three shelves, stacked.
   Side by side, the tallest thing in this box was one row of pieces about
   fifteen pixels high in a strip a hundred and fifty tall: the panel was
   mostly the room over and under a single line, with the three counts written
   out in words underneath to fill it. Stacked, the supplies use the height
   they were given, each count sits on the line of the pieces it counts, and
   the whole segment is a third narrower — which is width the strip gives back
   to the game log. */
.pieces {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 7px;
  flex: 1;
  min-height: 0;
}

/* A piece, then how many are left out of how many. The piece column is as
   wide as the widest piece, so the three fractions line up and read down in
   one movement. */
.pile {
  display: grid;
  grid-template-columns: 18px max-content;
  align-items: center;
  gap: 9px;
}

.pile .pip { justify-self: center; }

.pile-frac {
  font-size: var(--fs-n1);
  line-height: 1;
  color: var(--ink-4);
  font-variant-numeric: tabular-nums;
}
.pile-frac b { font-weight: 700; color: var(--ink-2); }

/* None left is a rule you have just run into, so it is colored like one. */
.pile.is-out .pile-frac b { color: var(--robber); }

/* Three silhouettes, cut out of a colored block: a length of road, a house,
   and a house with a second hall on it. One of each beside its count, and the
   one under the pointer while you carry it. */
.pip {
  display: block;
  /* A piece is a fixed size or it is not a piece. Left to the flex default
     these shrank to fit whatever the row was given, and fifteen roads came out
     as fifteen hairlines. */
  flex: none;
  background: var(--pc, var(--ink-3));
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.pip.is-road { width: 4px; height: 15px; border-radius: 1px; }

.pip.is-settlement {
  width: 13px;
  height: 14px;
  clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
}

.pip.is-city {
  width: 17px;
  height: 16px;
  clip-path: polygon(0 100%, 0 46%, 42% 46%, 42% 18%, 71% 0, 100% 18%, 100% 100%);
}
/* The metropolis's own outline (pieces.js METRO_PROFILE): a spire between
   a gabled wing and a flat-roofed hall. */
.pip.is-metropolis {
  width: 19px;
  height: 22px;
  clip-path: polygon(0 100%, 100% 100%, 100% 66.7%, 72.7% 66.7%, 72.7% 22.2%, 56.8% 0,
    40.9% 22.2%, 40.9% 51.9%, 20.5% 33.3%, 0 51.9%);
}

/* Spent: the same silhouette, all but gone. The shape is the point — it says
   what was there — so it keeps its outline rather than its ink. */
.pip.is-spent { background: var(--pc, var(--ink-3)); opacity: 0.17; box-shadow: none; }

/* Out of the box and in your hand: the gap it left. Not the spent treatment,
   which means "you have built this" — this one is coming back if you change
   your mind, so it is dimmed rather than emptied. */
.pip.is-carried { opacity: 0.3; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.2); }

/* ------------------------------------------------------------ in your hand */

/* The piece you are carrying, which is also the cursor while you carry it.

   Above the dock it flew out of and below a dialog, which on this stack is
   z-index 5 and the last child of the body: there is no integer between the
   dock's 5 and the modal's 6, so the tie is broken by document order, which is
   defined and is why this is appended where it is.

   `transform` does all of it — position and size in one property, so the
   flight out of the box is one transition rather than two that can disagree —
   and the duration is set per move from script, because following a pointer
   wants none and crossing the board under an arrow key wants a little. */
#carry {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 5;
  pointer-events: none;
  transition-property: transform;
  transition-timing-function: cubic-bezier(0.22, 0.9, 0.3, 1);
  transition-duration: 0ms;
  will-change: transform;
  /* Scaled about the point it is placed at. Left at the default, the box
     grew about its own middle, which is half a piece away from the pointer,
     and a settlement carried at nearly three times its size was drawn a
     dozen pixels left of and above the spot that was actually being tested
     against the board. Aiming the piece at a corner then meant aiming low
     and to the right of it. */
  transform-origin: 0 0;
}

/* A building stands on the point it is given, its base on the pointer's tip:
   a piece held over a corner stands on that corner rather than covering it,
   and the place it stands is the place a click builds. A road is centered,
   because a road slot is a stretch of edge rather than a point. */
#carry .pip {
  transform: translate(-50%, -100%);
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.45));
}

#carry .pip.is-road { transform: translate(-50%, -50%); }

@media (prefers-reduced-motion: reduce) {
  #carry { transition-duration: 0ms !important; }
}

/* ------------------------------------------------------------------ you */

/* The count, and nothing competing with it. It is the only number on this
   strip that says whether you are winning, so it is the biggest thing on it. */
/* The heading sits at the top left of the box, as every heading on this strip
   does; the number and its footnote take the middle of what is left, which the
   two auto margins between them do without a wrapper.

   A set width, because the footnote under the number is a sentence that grows
   a clause every time you take a city or the longest road — and sized to its
   longest line, this box would have shunted the whole strip sideways twice a
   game. Written past `#dock > div`, which is a type selector on an id and
   quietly out-weighs a bare one. */
#dock #dock-you {
  align-items: flex-start;
  width: 158px;
}

/* Two numbers, not one: what the table can see, and what is in your hand on
   top of it. Adding them together on screen would hide the only lead that is
   worth having. */
.vp-big { display: flex; align-items: baseline; gap: 5px; line-height: 0.86; margin-top: auto; }
.vp-pub { font-size: 54px; font-weight: 700; color: var(--gold); }
.vp-op { font-size: var(--fs-1); font-weight: 500; color: var(--ink-3); }
.vp-hid { font-size: 26px; font-weight: 700; color: var(--ink-2); }

/* The breakdown is a footnote to the number, not a paragraph beside it. */
.vp-break {
  font-size: var(--fs-n5);
  color: var(--ink-3);
  letter-spacing: 0.05em;
  line-height: 1.45;
  margin-bottom: auto;
}

.vp-break b { color: var(--ink-2); font-weight: 600; }
.vp-secret { display: block; margin-top: 2px; color: var(--gold); }

/* ======================================================== the phone drawer */

/* stats-drawer.js moves your points and the box into the top of the drawer at
   the widths where the strip lets them go, side by side in a row of their
   own, each dressed as a panel there rather than as a segment of the strip. */
#drawer-you { display: flex; gap: var(--gap); flex: none; }
#drawer-you:empty { display: none; }
#drawer-you > div {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-1);
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
}
#drawer-you #dock-you { width: auto; align-items: flex-start; }
#drawer-you .vp-pub { font-size: 40px; }
#drawer-you .vp-big { margin-top: 2px; }
#drawer-you .vp-break { margin-bottom: 0; }

/* The table as a list (table-panel.js): only in the phone's drawer, where the
   cards across the top have no room for anybody's hand. */
#panel-table { display: none; }
@media (max-width: 820px) {
  #rail-left #panel-table { display: flex; flex: none; }
  #rail-left #panel-table.is-alone { display: none; }
}
#table-body { display: flex; flex-direction: column; gap: 3px; }
.table-row {
  display: grid;
  /* In pixels, not ems: the header row is set smaller than the rows under
     it, and columns measured in its own em came out narrower, so every label
     sat left of its number. */
  grid-template-columns: minmax(0, 1fr) repeat(5, var(--table-col, 34px));
  align-items: baseline;
  gap: 0 4px;
  padding: 3px 0;
  border-top: 1px solid var(--hair);
  font-variant-numeric: tabular-nums;
}
.table-row.is-head {
  border-top: 0;
  padding-top: 0;
  font-size: var(--fs-n6);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.table-name {
  font-size: var(--fs-n4);
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sc, var(--ink-2));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-row.is-you { background: rgba(255, 255, 255, 0.04); }
.table-n { text-align: right; font-weight: 700; font-size: var(--fs-n1); }
.table-row.is-head .table-n { font-size: inherit; font-weight: 700; }
.table-n.is-zero { color: var(--ink-4); font-weight: 500; }
.table-n.is-over { color: var(--gold); }
.table-awards {
  grid-column: 1 / -1;
  font-size: var(--fs-n5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ================================================================= modal */

/* Over the board, and on a small screen over everything.

   A dialog belongs to the board it interrupts, so it is drawn inside the
   stage and the dock stays where it is. That holds while the stage is the
   biggest thing on screen. On a phone it is not: the rails and the strip take
   what they need and the board can be left with a hundred pixels, which is
   shorter than any card that has to hold a question — so the card centred
   itself in that hundred pixels and hung out of both ends of it, and the
   button that dismisses it was off the bottom of the screen.

   `position: fixed` in that case, which centres the card in the window and
   puts the veil over the dock as well. Nothing else changes: the card is the
   same card, and `#modal-body` still stops at three fifths of the window and
   scrolls. Escape always closed these, which is the only reason this was
   survivable rather than a trap. */
#modal {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  background: var(--sheet-veil, rgba(4, 18, 28, 0.55));
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#modal[hidden] { display: none !important; }

/* Short of room, or narrow: the card takes the window rather than the board.
   Keyed off height as well as width, because a laptop in a short window has
   exactly the same problem as a phone and none of its width. */
@media (max-width: 560px), (max-height: 620px) {
  #modal { position: fixed; }
}

/* Except on a phone, where the board's box is now the whole of the screen
   between the cards across the top and the dock, and fixed to the window
   the card was centered over the dock and drawn under it: the dock is
   outside `#app` and over everything in it, so the buttons at the foot of a
   trade were behind it. In the board's box instead, as tall as that box at
   most, with the middle of the card scrolling and its head and its buttons
   always on screen. */
@media (max-width: 560px) {
  #modal { position: absolute; padding: 8px; }
  #modal .modal-card {
    width: 100%;
    max-width: 460px;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  #modal-body {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overscroll-behavior: contain;
  }
  #modal .modal-card > :not(#modal-body) { flex: none; }
  /* The body scrolls as a whole now; a list scrolling inside it was a
     scroller in a scroller. */
  .replies { max-height: none; overflow: visible; }
}

/* A phone's board is four hundred pixels wide, and the three floating things
   want about five hundred of it: the strip is centred and as long as the
   sentence in it, so it ran straight through the name on its left and into
   the controls on its right.

   The name goes first, because it is the one that says nothing a player needs
   mid-game — the tab already carries it, and it is marked `aria-hidden`
   precisely because it is decoration. What is left is capped short of the
   controls by two rungs of the ladder, which clears them with room to spare,
   and the sentence ellipsises rather than pushing. */
/* A phone's board is four hundred pixels wide and the row wants more than
   that, so the name goes: it is the one thing up there that says nothing a
   player needs mid-game, the tab already carries it, and it is marked
   `aria-hidden` precisely because it is decoration. */
@media (max-width: 560px) {
  /* Hidden rather than removed: the slot is what the strip is centred
     against, so taking the box away as well as the ink walks the strip
     sixty-five pixels to the left of the board it belongs to. The slot is
     flexible and holds no width of its own — it only has to exist. */
  #board-mark { visibility: hidden; }
}

/* The clock on a question that answers itself when nobody does. */
.modal-clock {
  position: relative;
  display: flex;
  justify-content: flex-end;
  margin-bottom: -4px;
  font-size: var(--fs-n4);
  letter-spacing: 0.09em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.modal-clock[hidden] { display: none; }
.modal-clock i {
  position: absolute;
  left: 0;
  right: 2.6em;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: var(--gold);
  transform-origin: left center;
  transition: transform 0.25s linear;
}
.modal-clock.is-low { color: var(--robber-lit); }
.modal-clock.is-low i { background: var(--robber-lit); }
@media (prefers-reduced-motion: reduce) { .modal-clock i { transition: none; } }

.modal-card {
  width: min(460px, 88vw);
  background: var(--sheet-solid);
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-md);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.5);
  padding: var(--sp-2);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-card h3 {
  margin: 0;
  font-size: var(--fs-n1);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

/* An offer is two columns of steppers side by side, which needs more width
   than one column of anything. */
.modal-card.is-wide { width: min(620px, 92vw); }

.modal-sub { margin: 0; font-size: var(--fs-n3); color: var(--ink-3); line-height: 1.45; }
.modal-actions { display: flex; gap: 7px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------------------------------------------------------------- offers */

.offer-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--sp-2);
}

.offer-col { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* A resource claimed by the other side of the offer. Dimmed rather than
   removed, so the column keeps its shape and the reason is visible: a card
   cannot be on both sides of a trade. */
.stepper.is-out { opacity: 0.34; border-style: dashed; }

/* An offer put to you, read rather than edited. */
.bundle { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.bundle-cards { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.bundle-cards .card { flex: 0 0 auto; max-width: none; }
.bundle-cards .none { font-size: var(--fs-n3); color: var(--ink-4); letter-spacing: 0.05em; }

@media (max-width: 560px) {
  .offer-cols { grid-template-columns: minmax(0, 1fr); }
}

/* What the table said to your offer: one row a seat, edged in that seat's
   color. A yes or a counter carries its cards and a button; a no carries its
   reason and is dimmed, since there is nothing in it to press. Scrolls rather
   than growing past the screen, because a counter row is tall. */
.replies {
  display: flex;
  flex-direction: column;
  gap: var(--sp-0);
  /* The card lives over the board, not the whole screen, and on a phone the
     board is half the height: past about four tenths of it, the buttons under
     the list end up behind the dock. */
  max-height: min(38vh, 460px);
  overflow-y: auto;
}

.reply {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-0);
  border: 1px solid var(--hair);
  border-left: 3px solid var(--pc);
  border-radius: var(--radius-sm);
}

.reply.is-decline { opacity: 0.62; }
.reply button { align-self: flex-end; }

.reply-head { display: flex; align-items: baseline; gap: 8px; }
.reply-name { font-size: var(--fs-n2); font-weight: 700; color: var(--ink-2); }
.reply-kind {
  font-size: var(--fs-n4);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.reply.is-accept .reply-kind,
.reply.is-counter .reply-kind { color: var(--gold); }
.reply-why { font-size: var(--fs-n3); color: var(--ink-3); }

/* A row of steppers: give this, take that. */
.stepper-row { display: flex; flex-direction: column; gap: 5px; }

.stepper {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  align-items: center;
  gap: 7px;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
}

.stepper .name {
  font-size: var(--fs-n3);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  align-items: center;
  gap: 7px;
}

.stepper .swatch { width: 10px; height: 10px; border-radius: 2px; background: var(--rc); }
.stepper .held { font-size: var(--fs-n4); color: var(--ink-4); }
.stepper .n { font-size: var(--fs-n1); font-weight: 700; min-width: 18px; text-align: center; }
.stepper button { padding: 2px 8px; font-size: var(--fs-n2); letter-spacing: 0; }

.choice-row { display: flex; gap: 6px; flex-wrap: wrap; }

/* The five resources, one column each, on every width. */
.choice-row.is-five { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.choice-row.is-five .choice { min-width: 0; padding: 9px 4px; overflow-wrap: anywhere; }

/* A real button, because it is one: these are how you choose who to rob, which
   two cards the bank owes you, and what a year of plenty brings. As divs with
   click handlers they could not be tabbed to, could not be pressed by a
   keyboard, and were announced as nothing at all — so the question opened and
   there was no way to answer it. The three declarations below undo the parts of
   the base button rule that would restack the label and its subtitle. */
.choice {
  display: block;
  width: 100%;
  font-weight: inherit;
  flex: 1 1 auto;
  padding: 9px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hair);
  background: rgba(244, 241, 232, 0.05);
  cursor: pointer;
  text-align: center;
  font-size: var(--fs-n3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.choice:hover { border-color: var(--ink-3); background: rgba(244, 241, 232, 0.1); }
.choice.is-on { border-color: var(--gold); background: rgba(245, 197, 66, 0.16); color: var(--gold); }
.choice .sub { display: block; font-size: var(--fs-n5); letter-spacing: 0.05em; text-transform: none; color: var(--ink-3); margin-top: 3px; }

/* ================================================================ banner */

#banner {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  place-content: center;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 320ms ease;
  /* The board dimmed behind the result, the way a trade's veil dims it
     (#modal), but lighter: the island is still worth looking at, and still
     answers the pointer. */
  background: rgba(4, 18, 28, 0.3);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
}

#banner.is-on { opacity: 1; }

#banner .who {
  font-size: clamp(30px, 5vw, 62px);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--sc, var(--gold));
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

#banner .what {
  font-size: var(--fs-n1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 6px;
}

/* Where a ranked game stands, once the server has played it again. */
#banner .rank {
  font-size: var(--fs-n1);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--sc, var(--gold));
  margin-top: 10px;
  min-height: 1.4em;
  opacity: 0;
  transition: opacity 320ms ease;
}

#banner .rank.is-on { opacity: 1; }
#banner .rank.is-faint { color: var(--ink-2); opacity: 0.7; }

/* ============================================================== the front door */

/* Three screens in one frame, centered in the window.
 *
 * The page before this one was a document, and it was the right idea one step
 * too far: a landing page for a game had four paragraphs, five fields, a
 * picture and eight cards on it, for a decision that is really "on my own, or
 * with a friend". Everything here is the same grammar with almost all of the
 * furniture taken out.
 *
 * What stayed, because it was working: the flat ground with the hex lattice
 * behind it, the slim rule across the top saying where this is, sentence case
 * throughout, the two ladders theme.js publishes, hairlines rather than boxes,
 * and the accent spent once per screen.
 *
 * What is new is the middle of the door, which is a game of Catan going on.
 * That is the answer to what this thing is, and it is a better one than three
 * paragraphs about it.
 */

#lobby {
  position: fixed;
  inset: 0;
  z-index: 9;
  /* The sheet scrolls, not this: a scroller's gutter is outside everything
     in it, so with the scrolling here the site bar stopped a gutter short of
     the right edge of the window. */
  overflow: hidden;
  display: grid;
  /* One row for the rule at the top and one for everything else, so the
     content centers in what is left rather than in the whole window. */
  grid-template-rows: auto minmax(0, 1fr);
  /* Opaque from the first paint and opaque before any script has run. This
     was a radial-gradient of two custom properties theme.js publishes, and a
     gradient with an undefined color in it is not a gradient at all: for the
     frame or two before the script ran there was no sheet here and the empty
     game showed through it. Flat, with the printed value as the fallback. */
  background-color: var(--sheet-solid, #071e2e);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='110.85' height='192.00' viewBox='0 0 110.85 192.00'%3E%3Cg fill='none' stroke='%23f4f1e8' stroke-opacity='0.03' stroke-width='1'%3E%3Cpath d='M0.0 -64.0 L55.4 -32.0 L55.4 32.0 L0.0 64.0 L-55.4 32.0 L-55.4 -32.0Z'/%3E%3Cpath d='M110.9 -64.0 L166.3 -32.0 L166.3 32.0 L110.9 64.0 L55.4 32.0 L55.4 -32.0Z'/%3E%3Cpath d='M-55.4 32.0 L-0.0 64.0 L-0.0 128.0 L-55.4 160.0 L-110.9 128.0 L-110.9 64.0Z'/%3E%3Cpath d='M55.4 32.0 L110.9 64.0 L110.9 128.0 L55.4 160.0 L-0.0 128.0 L-0.0 64.0Z'/%3E%3Cpath d='M166.3 32.0 L221.7 64.0 L221.7 128.0 L166.3 160.0 L110.9 128.0 L110.9 64.0Z'/%3E%3Cpath d='M-0.0 128.0 L55.4 160.0 L55.4 224.0 L-0.0 256.0 L-55.4 224.0 L-55.4 160.0Z'/%3E%3Cpath d='M110.9 128.0 L166.3 160.0 L166.3 224.0 L110.9 256.0 L55.4 224.0 L55.4 160.0Z'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 110.85px 192px;
  background-position: 50% 0;
  transition: opacity 380ms ease;
}

#lobby.is-gone { opacity: 0; pointer-events: none; }

/* On the way to a game: the sheet stops taking presses the moment one has been
   accepted, so a second click cannot deal a second table. */
#lobby.is-going { pointer-events: none; }

/* ------------------------------------------------------------- the site bar */

/* The portfolio's header, value for value: /styles.css section 3 (header,
   nav, .hamburger) and its breakpoints at 1200, 1067, 600 and 480, in the
   site's dark theme, which is the only theme this page has. The colors are
   the ones the site actually paints rather than the ones in its sheet:
   /js/shared/background-topo.js replaces the dark tokens on every page with
   a palette drawn from one hue, and these are that palette, on whatever hue
   the visitor last chose there.
   Written out here
   rather than linked because that sheet styles bare elements (header, nav,
   main, h1, a) all over this page; the classes are this page's own and the
   numbers are the site's.

   Sticky rather than fixed: the sheet scrolls under it, and its own height
   is kept in the grid row above the sheet, so nothing has to be padded clear
   of it. `--bar-h` on .sheet is this bar's height at each breakpoint.

   One departure, asked for: it is slimmer than the site's. The padding, the
   name and the links' own padding are cut down so the bar is about 45px
   rather than 71, over a game that wants the height more than a page of
   prose does. Everything else — the colors, the order, the links, the
   hamburger and where it takes over — is the site's. */
.site-bar {
  /* The portfolio's accent hue, which a visitor can change there; sitebar.js
     reads it from the site's saved settings and sets it here. 211 is the
     site's own default. */
  --site-hue: 211;
  --site-bg: hsl(var(--site-hue), 6%, 15%);          /* --bg-secondary */
  --site-border: hsl(var(--site-hue), 8%, 25%);      /* --border-primary */
  --site-text: hsl(var(--site-hue), 8%, 88%);        /* --text-primary */
  --site-link: hsl(var(--site-hue), 90%, 65%);       /* --link-color */
  --site-link-hover: hsl(var(--site-hue), 90%, 75%); /* --link-hover */
  --site-shadow: rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 100;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  padding: 6px 20px;
  background: var(--site-bg);
  border-bottom: 1px solid var(--site-border);
  box-shadow: 0 2px 4px var(--site-shadow);
  font-family: 'Archia', sans-serif;
  line-height: 1.6;
}

.site-bar-logo {
  display: block;
  flex-shrink: 1;
  min-width: 0;
  text-decoration: none;
}

.site-bar-name {
  display: block;
  font-size: 24px;
  /* The site's name sits in a button, which does not inherit the page's
     line-height and takes the font's own; so does this, or the bar is 11px
     taller than every other page's. */
  line-height: normal;
  font-weight: 700;
  color: var(--site-text);
  white-space: nowrap;
  text-align: left;
  transition: opacity 0.3s ease;
}

.site-bar-logo:hover .site-bar-name { opacity: 0.8; }

.site-bar-nav {
  margin: 0;
  display: flex;
  gap: 20px;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}

.site-bar-nav a {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 4px;            /* --radius-sm */
  font-size: 15.2px;             /* 0.95rem */
  color: var(--site-link);
  white-space: nowrap;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  transition: color 0.3s ease, text-decoration-color 0.25s ease;
}

.site-bar-nav a:hover {
  color: var(--site-link-hover);
  text-decoration-color: currentColor;
}

/* With the lobby's id in front, because `#lobby button` and the page's
   own button styles would otherwise dress it as one of the lobby's. */
#lobby .site-bar-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-width: 36px;
  min-height: 36px;
  padding: 6px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  position: relative;
  z-index: 1;
  cursor: pointer;
}

.site-bar-burger span {
  display: block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: var(--site-text);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.site-bar-burger.active span:nth-child(1) { transform: rotate(45deg) translate(10px, 10px); }
.site-bar-burger.active span:nth-child(2) { opacity: 0; }
.site-bar-burger.active span:nth-child(3) { transform: rotate(-45deg) translate(7px, -7px); }

@media (max-width: 1200px) {
  #lobby .sheet { --bar-h: 45px; }
  .site-bar { padding: 6px 15px; gap: 15px; }
  .site-bar-name { font-size: 22px; }
  .site-bar-nav { gap: 12px; }
  .site-bar-nav a { padding: 4px 12px; font-size: 14.4px; }
}

/* Hamburger mode, at the site's own width. */
@media (max-width: 1067px) {
  #lobby .sheet { --bar-h: 49px; }
  .site-bar { padding: 6px 15px; justify-content: space-between; }
  .site-bar-logo { flex: 1; }
  .site-bar-name { font-size: 21px; }
  #lobby .site-bar-burger { display: flex; }

  .site-bar-nav {
    --nav-top: 49px;           /* flush under the bar */
    position: fixed;
    top: var(--nav-top);
    left: 0;
    width: 100%;
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    background: var(--site-bg);
    transition: max-height 0.3s ease;
    z-index: 99;
  }

  .site-bar-nav.active {
    max-height: min(500px, calc(100vh - var(--nav-top)));
    overflow-y: auto;
    border-bottom: 1px solid var(--site-border);
    box-shadow: 0 4px 8px var(--site-shadow);
  }

  .site-bar-nav a {
    display: block;
    padding: 14px 20px;
    border-bottom: 1px solid var(--site-border);
    border-radius: 0;
    font-size: 15.2px;
    white-space: normal;
  }

  .site-bar-nav a:last-child { border-bottom: none; }

  /* No bar to see, asked for: on a phone it was a strip of gray over the
     game's own sky holding nothing but the hamburger. The bar keeps its
     height, so the title and every screen under it stay exactly where they
     were (taking that height away lifted the whole lobby up under the
     hamburger); only its ground, its line and the name go, and the
     hamburger is left in the corner. The links slide in from the right. */
  .site-bar {
    justify-content: flex-end;
    background: none;
    border-bottom-color: transparent;
    box-shadow: none;
  }
  .site-bar-logo { visibility: hidden; }
  #lobby .site-bar-burger {
    z-index: 101;
    border-radius: 10px;
    background: rgba(2, 10, 16, 0.35);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
  }
  .site-bar-nav,
  .site-bar-nav.active {
    top: 0;
    left: auto;
    right: 0;
    width: min(300px, 82vw);
    max-height: none;
    padding-top: 56px;
    border-left: 1px solid var(--site-border);
    border-bottom: 1px solid var(--site-border);
    border-radius: 0 0 0 12px;
    box-shadow: -6px 6px 20px var(--site-shadow);
    transform: translateX(calc(100% + 24px));
    transition: transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  .site-bar-nav.active { transform: none; overflow-y: auto; }
}

@media (max-width: 600px) {
  .site-bar { padding: 6px 15px; }
  .site-bar-name { font-size: 19px; }
  .site-bar-nav { --nav-top: 49px; }
}

@media (max-width: 480px) {
  .site-bar { padding: 5px 12px; }
  .site-bar-name { font-size: 17px; }
  .site-bar-nav { --nav-top: 47px; }
}

/* ------------------------------------------------------------------ the frame */

/* One frame, whichever screen is in it, so going from the door to the table is
   the content changing rather than the page moving. */
.sheet {
  display: grid;
  /* Hung from the top rather than centered. Centered, a line appearing at the
     bottom of a screen — a game to carry on, the robbers' row — lifted
     everything above it by half its height. From the top, the title and
     everything under it stay exactly where they are and new things are only
     ever added below. */
  justify-items: center;
  align-content: start;
  gap: var(--sp-3);
  /* Every screen hangs from the line that centers the tallest one in the
     window: the room with a code open on the big island, title to last row,
     measured at 847px on a desktop-width window. So the room sits centered,
     the shorter screens start where it starts, and the title is in one place
     on all of them. A window too short for that tallest screen gets the
     least top room there is and scrolls. Re-measure if the room changes. */
  --tallest: 847px;
  --bar-h: 46px;            /* the site bar above the sheet, border included */
  /* And then all of it a step lower than centered: a column hung exactly
     in the middle read as sitting high under the bar. One number to tune. */
  --drop: 48px;
  padding: calc(max(var(--sp-4), (100vh - var(--bar-h) - var(--tallest)) / 2) + var(--drop)) var(--sp-4) var(--sp-6);
  padding-top: calc(max(var(--sp-4), (100dvh - var(--bar-h) - var(--tallest)) / 2) + var(--drop));
  min-height: 0;
}

/* The lobby's sheet is what scrolls, under the bar rather than beside it.
   Its scrollbar's room is kept whether or not one is showing. Without it a
   screen too tall for the window (the room, on a laptop) brought a scrollbar
   in as it opened, and the whole sheet, title and hexes and all, lurched
   sideways in the middle of rising into place. */
#lobby .sheet {
  overflow-y: auto;
  /* Never sideways. The door's island overhangs its box on purpose (see
     .door-stage canvas), and on a phone that overhang ran past the window,
     so the sheet could be dragged a few dozen pixels left and right. */
  overflow-x: hidden;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}

.screen {
  width: 100%;
  max-width: 460px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-3);
  text-align: center;
}

/* Arriving rather than appearing. The door is drawn once at load; the two
   screens behind it come up each time they are opened. */
.screen.is-on { animation: screen-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both; }

@keyframes screen-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* -------------------------------------------------------------------- the door */

/* Sentence case, and the possessive rather than the bare noun: this is one
   person's version of a board game, and saying so is both more honest and
   less like a product. */
.lobby-title {
  margin: 0;
  font-size: clamp(var(--fs-4), 4.4vw, var(--fs-6));
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  color: var(--ink);
  text-align: center;
  white-space: nowrap;
}

/* MEGA, in red, opening in front of Catan when the game being set up is on
   the big island: the exhibit's title, here. It is unfolded rather than
   faded on: the word widens from nothing, so the centered title makes room
   for it instead of jumping, and the letters rise into place as it opens. */
.title-mega,
.mark-mega {
  display: inline-block;
  vertical-align: top;
  max-width: 0;
  overflow: hidden;
  opacity: 0;
  transform: translateY(-0.5em);
  color: #FF4A3A;
  transition:
    max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease,
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
#lobby.is-mega .title-mega,
#board-mark.is-mega .mark-mega {
  max-width: 5em;
  opacity: 1;
  transform: none;
  transition:
    max-width 0.6s cubic-bezier(0.4, 0, 0.2, 1),
    opacity 0.4s ease 0.15s,
    transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s;
}
/* Over the board it is simply there: nobody is choosing anything. */
#board-mark .mark-mega,
#board-mark.is-mega .mark-mega { transition: none; font-weight: 700; }

@media (prefers-reduced-motion: reduce) {
  .title-mega, #lobby.is-mega .title-mega { transition: opacity 0.2s linear; transform: none; }
}

/* The island, in a box the shape the island actually is.
   A board seen at this tilt is foreshortened to about four fifths of its
   width, so a square box leaves a strip of empty water at the top and bottom
   and pushes the title away from the thing it belongs to. The height is tied
   to the window rather than the column, because on a short screen height is
   what runs out first. */
.door-stage {
  position: relative;
  width: min(100%, calc(52vh * 1.22));
  aspect-ratio: 1.22 / 1;
  margin: 0 auto;
}

/* The canvas overhangs its box on every side.
   The island turns, and a hex disc seen at a tilt is not the same height at
   every angle: framed to fit the box it would meet the bottom edge on some
   part of every revolution and be sliced off there. Overhanging moves the
   only edge that can cut it well outside the picture, and costs nothing,
   because what overhangs is transparent and the room it takes is room the
   page already had spare. */
.door-stage canvas {
  position: absolute;
  /* More room above than below, because the camera looks down at the board and
     the near shore projects further from the center than the far one does. Hung
     level, the island sat low in its box and left a hole under the buttons. */
  top: -22%;
  left: -16%;
  /* Said as a size rather than as four insets. A canvas is replaced content,
     so `left` and `right` with `width: auto` leave it at its intrinsic 300 by
     150 and quietly ignore one of them. */
  width: 132%;
  height: 132%;
  display: block;
  pointer-events: none;
}

/* Reduced motion, or no WebGL to be had: the island standing still rather
   than turning. A real screenshot of it (`tools/snapshot-door.js`) for the
   default look nobody has changed, which is the common case; the flat
   top-down diagram the old setup sheet used for its preview (`island.js`)
   for anybody who picked a custom felt or accent, since that one reads the
   live theme and a shipped picture cannot. */
/* The still fallback is a picture rather than a moving thing, so it has no
   swing to allow for and sits in its box. */
.door-stage.is-still { display: grid; place-items: center; }
.door-stage .door-still {
  position: static;
  width: 100%;
  height: auto;
  aspect-ratio: 9.5 / 8.8;
  object-fit: contain;
}

.door-do {
  /* Six of them now: two rows of three, each the size the single row gave
     them (a word and a little more), the three columns equal so the rows
     line up. */
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 1fr;     /* the filled one is taller; both rows take its height */
  gap: var(--sp-1);
  width: min(100%, 420px);
  margin: 0 auto;
  justify-content: center;
}

#lobby .door-do button { min-width: 118px; justify-content: center; }

/* A game already in progress, and only ever on screen when there is one. It is
   a footnote rather than a banner: whoever left it running knows it is there,
   and whoever did not should not have to dismiss a stranger's game. */
.door-resume {
  /* Clear of the canvas above it. That canvas overhangs its box by a tenth of
     its own height at the bottom, so a line sitting on the column's gap alone
     is a line the near shore can swing across. A rung of the space ladder on
     top of the gap puts it out of reach at every window size, and a rung is
     about as little as it could be moved and still be moved. */
  /* Well below the island: a footnote to the page rather than a caption
     to the picture. */
  margin: var(--sp-7) 0 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 9px;
  font-size: var(--fs-n3);
  color: var(--ink-4);
}

/* What it is, before what can be done with it. */
.resume-lead { color: var(--ink-3); }

/* Three links at the foot of the door, set like the footnote above them: a
   place to be found from, not a thing to look at. */
.door-foot {
  margin: var(--sp-5) 0 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px var(--sp-3);
  font-size: var(--fs-n3);
}
.door-foot a {
  color: var(--ink-4);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.door-foot a:hover,
.door-foot a:focus-visible { color: var(--ink-2); border-bottom-color: var(--ink-4); }

/* ------------------------------------------------------------------ the lab */

/* A form, plainly: the settings grid the castaway screen uses, with the
   browser's own selects and number fields dressed like the lobby's inputs.
   Nobody is sold anything here. */
.lab { max-width: 560px; }
.lab-settings { grid-template-columns: auto minmax(0, 1fr); width: 100%; }
.lab-settings .field-name { justify-self: end; }
.lab-settings input,
.lab-settings select {
  width: 100%;
  max-width: 320px;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--fs-n1);
  padding: 7px 10px;
}
.lab-settings select { cursor: pointer; }
/* A row the kind has no use for is gone, not blank: this form is long
   enough already. */
.lab-settings .setting.is-off > * { display: none; }
.lab-settings input[type="number"] { max-width: 120px; }
.lab-settings input:focus,
.lab-settings select:focus { outline: none; border-color: var(--gold-line, rgba(245, 197, 66, 0.55)); }
.lab-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.lab-row input { flex: 1 1 160px; }
.lab-row .field-note { flex-basis: 100%; overflow-wrap: anywhere; }
.lab-brief {
  margin: var(--sp-1) auto;
  max-width: 52ch;
  font-size: var(--fs-n2);
  line-height: 1.6;
  color: var(--ink-2);
}
.lab-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--sp-1); }
#lobby .lab-actions button { min-width: 0; }
.lab-log { text-align: left; }
.lab-log a { color: var(--ink-2); text-decoration: none; }
.lab-log a:hover { color: var(--gold); }

/* ------------------------------------------------------- the table and the room */

.screen-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 100%;
}

.screen-head h2 {
  margin: 0;
  font-size: var(--fs-2);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

.screen-head p {
  margin: 0;
  max-width: 46ch;
  font-size: var(--fs-n2);
  line-height: 1.6;
  color: var(--ink-2);
}

/* The way back sits at the left edge of the column rather than over the
   middle of the title, which is where a breadcrumb would go and this is not
   one. */
#lobby .back { align-self: flex-start; margin-bottom: 2px; }

.screen-do {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
}

.screen-do button { min-width: 190px; justify-content: center; }

.screen-say {
  margin: 0;
  min-height: 1.5em;
  font-size: var(--fs-n3);
  line-height: 1.5;
  color: var(--ink-3);
}

.screen-say.is-bad { color: var(--robber-lit, #ff9b7a); }

#screen-door { max-width: 560px; }

/* The table screen wants more than a door's width: eight cards two across. */
#screen-solo { max-width: 520px; }
#screen-alone { max-width: 520px; }
#screen-tour { max-width: 520px; }

/* ------------------------------------------------------------- the tutorials */

/* One card a tutorial, a name and a line, like a leaning: a whole button,
   so the list works from the keyboard. The one still to come is shown and
   cannot be pressed. */
.tour-picks {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

#lobby .tour-pick {
  position: relative;
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  text-align: left;
  letter-spacing: normal;
  text-transform: none;
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
  transition:
    border-color 200ms ease,
    background 200ms ease,
    transform 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

#lobby .tour-pick:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--gold);
  background: rgba(0, 0, 0, 0.24);
}

#lobby .tour-pick:disabled { cursor: default; opacity: 0.5; }

.tour-pick-name {
  font-size: var(--fs-n1);
  font-weight: 700;
  color: var(--ink);
  padding-right: 48px;
}

.tour-pick-says {
  font-size: var(--fs-n3);
  line-height: 1.45;
  color: var(--ink-3);
}

/* Seen to the end. */
.tour-pick-mark {
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: var(--fs-n3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
}

/* ------------------------------------------------------------------ the roster */

.roster {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  width: 100%;
}

/* A leaning, in a name and a line. `ai.js` has the paragraph and the README
   has the argument; what somebody choosing an opponent before their first
   game needs is how hard it is and what it is going to do to them.

   A button rather than a div, so the whole roster works from the keyboard. */
.leaning {
  --pc: var(--hair-strong);
  position: relative;
  appearance: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
  padding: 9px 11px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
  letter-spacing: normal;
  text-transform: none;
  transition:
    border-color 200ms ease,
    background 200ms ease,
    transform 200ms cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* `#lobby button` below is an id and a type and so outranks a class, and its
   `align-items: center` is the cross axis of a column: it would center both
   lines of all eight cards. Said again at a weight that can win. */
#lobby .leaning { align-items: flex-start; text-align: left; }

@media (hover: hover) {
  #lobby .leaning:hover:not(:disabled) {
    transform: translateY(-2px);
    border-color: var(--ink-4);
    background: rgba(0, 0, 0, 0.24);
  }
}
/* A picked card keeps its seat's wash under the pointer too, rather than
   the hover's darker one: picked should look picked while it is pointed at. */
#lobby .leaning.is-seated:hover:not(:disabled) { background: var(--pc-soft); border-color: var(--pc); }

/* Picked, in the color of the seat it is taking. Gold would have done and
   would have been the second gold thing on the screen; the seat color says
   the same thing and also answers which of them is the red one on the board.

   One border, all the way round, and nothing else. There was a two-pixel bar
   inset down the left edge as well, and an inset bar inside a rounded corner
   is drawn square against a curve: the corners showed a stub of color
   crossing the border, which is the artifact. A border that changes color
   needs no help. */
.leaning.is-seated {
  border-color: var(--pc);
  background: var(--pc-soft);
}

/* The name and the strength bars share a line, and the line leaves room at
   its right end for the seat number that appears when the card is picked. */
.leaning-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding-right: 14px;
}

.leaning-name {
  font-size: var(--fs-n1);
  font-weight: 700;
  letter-spacing: 0;
  color: var(--ink);
}

/* How hard a leaning is: four settlements, as many built as the level.

   The same silhouette the dock cuts for a piece in the box — this site draws
   one house and it should draw it once — at the size a name can stand beside.
   The ones above the level are left standing in outline rather than taken
   away, on the dock's own reasoning about a spent piece: the shape is what
   says how many there could have been, and a row that shortens as it goes
   gentler is a row you have to measure against its neighbour.

   Built in the ink, and in the seat color once the card is picked, which is
   the trick the name beside them plays. */
.leaning-level {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
  height: 11px;
}

.leaning-level i {
  width: 9px;
  height: 10px;
  flex: none;
  background: var(--ink-4);
  clip-path: polygon(50% 0, 100% 42%, 100% 100%, 0 100%, 0 42%);
  opacity: 0.3;
}

.leaning-level i.is-built {
  background: var(--ink-2);
  opacity: 1;
}

.leaning.is-seated .leaning-level i.is-built { background: var(--pc); }

.leaning.is-seated .leaning-name { color: var(--pc); }

.leaning-brief {
  font-size: var(--fs-n3);
  font-weight: 400;
  line-height: 1.4;
  color: var(--ink-3);
}

/* Which seat it took, small and in the seat's color: a fact about the table
   rather than a badge. */
.leaning-seat {
  position: absolute;
  top: 7px;
  right: 9px;
  font-size: var(--fs-n4);
  font-weight: 700;
  color: var(--pc);
  opacity: 0;
  transition: opacity 200ms ease;
}

.leaning.is-seated .leaning-seat { opacity: 1; }

/* -------------------------------------------------------------------- the room */

#screen-net { max-width: 520px; }

.net-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-2) var(--sp-3);
  width: 100%;
  text-align: left;
}

/* Two ways into the same room, told apart by a hairline between them rather
   than by a box around each. */
.net-side {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}

.net-side + .net-side {
  padding-left: var(--sp-3);
  border-left: 1px solid var(--hair);
}

#lobby .net-side button { width: 100%; justify-content: center; }

/* Above the two ways in rather than below them, because it is the thing you
   fill in before you press either. */
.net-name { width: 100%; max-width: 260px; text-align: left; }

/* The seats left over, under the two ways in rather than inside either of
   them: it is one answer that applies to the left-hand column, and a roster
   of eight squeezed into a 260-pixel half is eight cards nobody can read. */
.net-bots {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: var(--sp-2);
  border-top: 1px solid var(--hair);
  text-align: left;
}

/* ------------------------------------------------------- who is in the room */

/* Four rows, always, because the number of seats still open is the thing being
   watched and a list that grows as people arrive makes you count instead of
   look. Each name carries the color of the seat it is going to hold, so the
   room and the board agree before the board exists. */
.roomlist {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.roomer {
  --pc: var(--hair-strong);
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 5px 8px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.16);
  font-size: var(--fs-n2);
  color: var(--ink);
  min-width: 0;
}

.roomer-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--pc);
}

.roomer-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.roomer-note {
  flex: none;
  font-size: var(--fs-n4);
  font-weight: 400;
  color: var(--ink-4);
}

/* A seat nobody has taken. Dashed, because the difference between "empty" and
   "somebody quiet" is worth being able to see at a glance. */
.roomer.is-empty {
  border-style: dashed;
  background: none;
  color: var(--ink-4);
}

.roomer.is-empty .roomer-dot { background: none; box-shadow: inset 0 0 0 1px var(--hair-strong); }
.roomer.is-empty .roomer-name { font-weight: 400; }

/* Megacatan's eight seats, as two columns of four read down. The notes go
   when a column is this narrow (they stay on the row's tooltip): the colored
   dot already says whose seat it is, and the name is the thing worth the
   room. */
.roomlist.is-wide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  grid-auto-flow: column;
  gap: 3px;
}
.roomlist.is-wide .roomer { padding: 5px 6px; gap: 5px; }
.roomlist.is-wide .roomer-note { display: none; }

/* The joiner's own screen, which is the same list with nothing to press. */
.wait-room {
  width: 100%;
  max-width: 300px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  text-align: left;
}

/* Nothing left to offer: every seat has a person in it. The cards stay on the
   page, because eight leanings are worth reading whether or not one of them is
   about to sit down, but they stop pretending to be a control. */
.net-bots.is-full .roster { opacity: 0.4; pointer-events: none; }
.net-bots.is-full #net-random { display: none; }

/* The label at one end and the shuffle at the other. */
.net-bots-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
}

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

/* Sentence case, at the size of a caption, in the second tier of ink. The
   label of a field is a caption on it. */
.field-name {
  font-size: var(--fs-n2);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}

.field-note {
  font-weight: 400;
  font-size: var(--fs-n3);
  letter-spacing: 0.01em;
  color: var(--ink-4);
}

.field-name .field-note::before { content: '\00a0\00b7\00a0'; }

#lobby input {
  width: 100%;
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid var(--hair);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: var(--fs-n1);
  letter-spacing: 0.02em;
  padding: 9px 10px;
  transition: border-color 180ms ease;
}

#lobby input::placeholder { color: var(--ink-4); }
#lobby input:hover { border-color: var(--hair-strong); }
#lobby input:focus { outline: none; border-color: var(--gold-line, rgba(245, 197, 66, 0.55)); }
#lobby input:focus-visible { outline: 2px solid var(--gold-line, rgba(245, 197, 66, 0.55)); outline-offset: 1px; }

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

/* The page speaks in sentences, and its buttons are part of the sentence. The
   dock's buttons are labels on an instrument and keep their capitals; these
   are not. */
#lobby button {
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: var(--fs-n2);
  font-weight: 600;
  align-items: center;
  padding: 9px 14px;
}

#lobby button.primary {
  padding: 11px 20px;
  font-size: var(--fs-n1);
  font-weight: 700;
}

#lobby button:focus-visible {
  outline: 2px solid var(--gold-line, rgba(245, 197, 66, 0.55));
  outline-offset: 2px;
}

/* A press that is a piece of prose rather than a control: back out of a
   screen, carry on with a game, forget one.
   The rule under it arrives on hover and grows from the left rather than
   being there all along. A permanent underline on a word that is not a link
   to another page is a decoration; one that appears when you reach for it is
   an answer. */
#lobby button.linky {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-3);
  font-size: var(--fs-n3);
  font-weight: 600;
  text-decoration: none;
}

#lobby button.linky::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -3px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

#lobby button.linky:hover:not(:disabled) {
  background: none;
  transform: none;
  color: var(--ink);
}

#lobby button.linky:hover:not(:disabled)::after,
#lobby button.linky:focus-visible::after { transform: scaleX(1); }

#lobby button.linky.is-quiet { color: var(--ink-4); font-weight: 400; }

/* ============================================================ small print */

/* One row of five segments is a lot to ask of a narrow window, so they leave
   in the order of what they are worth, widest query first so that the narrower
   ones override them.

   The buttons are what suffer first when the row is short — squeezed, they
   wrap and the dock grows to hold them — so each thing that goes gives its
   width to the options. */

/* The box count goes — but only once the strip actually has nowhere else to
   put it. It is the slowest-moving thing on the strip (a piece count changes
   a handful of times in a game, so its absence costs least), which is an
   argument for it going *last* among the five, not first: it used to be a
   flat width query, picked at one hand's worth of cards and guessed wrong for
   every other. `chrome.js`'s `dockBox()` measures the strip instead, the same
   way it already measures the strip's height, and adds `.is-cramped` only
   when the box genuinely will not fit beside everything else. */
#dock.is-cramped #dock-box { display: none; }
#dock.is-cramped {
  grid-template-columns:
    max-content fit-content(440px) minmax(min-content, auto) max-content;
}

/* Small enough that a full-size hand and the numbers stop leaving the options
   a usable share. A smaller card keeps them on one row a while longer. */
@media (max-width: 1240px) {
  :root {
    --card-w: 46px; --card-h: 64px;
    --num-w: 42px; --num-h: 37px;
  }
  button { padding: 6px 9px; letter-spacing: 0.07em; }
  .action-line.is-buy button { padding: 5px 8px; }
  button .cost { gap: 4px; }
  .vp-pub { font-size: 46px; }
}

/* And the victory count. It is the one thing down here that the turn strip
   already says. */
@media (max-width: 1150px) {
  :root {
    --card-w: 44px; --card-h: 60px;
    --num-w: 40px; --num-h: 35px;
    /* One fewer to a row: what is left of the strip at this width is the hand,
       the numbers and eight buttons, and the buttons are what suffer first. */
    --num-row: 4;
  }
  /* Written past `#dock > div`, which is a type selector on an id and was
     quietly out-weighing a bare id. */
  #dock #dock-you { display: none; }
  #dock {
    grid-template-columns: max-content fit-content(360px) minmax(min-content, auto);
  }
}

/* Under about 1100px the left rail stops earning its width. The board and the
   dock are the game, and the readouts go into a drawer off the left edge
   (stats-drawer.js), out over a darkened table from a square in the board's
   lower right and away again on a tap anywhere off it. */
@media (max-width: 1100px) {
  #app { grid-template-columns: minmax(0, 1fr) var(--rail-r); }
  #grip-left { display: none; }

  #rail-left {
    position: fixed;
    z-index: 31;
    top: var(--gap);
    bottom: var(--gap);
    left: 0;
    width: min(320px, calc(100vw - 56px));
    margin: 0;
    padding: var(--gap) var(--gap) var(--gap) var(--gap);
    /* Scrolled rather than fitted: in a drawer there is no board beside it
       to keep in view, so every panel is shown and the drawer scrolls. */
    overflow-y: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    background: var(--sheet-solid, #071e2e);
    border: 1px solid var(--hair);
    border-left: 0;
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    /* All the way off while put away, shadow and all. */
    transform: translateX(calc(-100% - 40px));
    transition: transform 320ms cubic-bezier(0.22, 0.61, 0.36, 1);
  }
  body.is-stats-open #rail-left {
    transform: none;
    overflow-y: auto;
    box-shadow: 0 0 34px rgba(0, 0, 0, 0.55);
  }
  /* Every panel, whatever the window's height would have dropped. */
  #rail-left #panel-payout,
  #rail-left.is-tight #panel-payout { display: flex; }
  #rail-left > .panel { flex: none; }
  #rail-left #panel-rolls,
  #rail-left #panel-payout { min-height: 170px; }

  #stats-scrim {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: rgba(2, 10, 16, 0.6);
    opacity: 0;
    pointer-events: none;
    touch-action: none;
    transition: opacity 320ms ease;
  }
  body.is-stats-open #stats-scrim { opacity: 1; pointer-events: auto; }

  /* The drawer and its scrim are inside `#app`, so while it is out the whole
     of `#app` is lifted over the dock, and the scrim darkens that too. Put
     back only once the drawer has finished sliding away, or it would slide
     the last of the way under the dock. */
  #app { transition: z-index 0s linear 320ms; }
  body.is-stats-open #app { z-index: 40; transition-delay: 0s; }
}

/* The phone strip's climb is the phone strip's alone. */
#pace-mini { display: none; }

/* The dice on your card, likewise (rails.js paintDice): only in the phone
   strip, alone, where the climb beside the card leaves it room. */
.opp-dice { display: none; }

/* Wide enough for the rail: the drawer's two helpers have nothing to do. */
@media (min-width: 1101px) {
  #board-keys > #stats-key,
  #stats-scrim { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  #rail-left, #stats-scrim { transition: none; }
}

@media (max-width: 820px) {
  /* The right rail stops being a column and becomes a strip across the top.
     It used to be deleted outright, and with it went every opponent's score —
     which is the win condition, not a readout. A phone could take turns and
     could not tell that somebody was on nine points, and the grip that might
     have brought it back was hidden by the same rule.

     The log does go, because it is a record of what already happened and the
     board is the thing you are playing. The scores stay, laid along one line
     that scrolls if four of them will not fit. */
  #app {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
  }
  /* Nothing under it: the strip is at the top, and the room it kept for the
     dock beside it was being added to the top row, which pushed the board
     down into a band a few dozen pixels high. */
  #rail-right { grid-row: 1; grid-column: 1; margin-bottom: 0; }
  #stage-wrap { grid-row: 2; grid-column: 1; }
  #grip-right { display: none; }
  /* Across the top there is room for the cards and nothing under them, so
     the log and castaway's pace move into the stats drawer instead
     (stats-drawer.js). Anything still in the strip is hidden. */
  #rail-right #panel-log,
  #rail-right #panel-pace { display: none; }

  /* Castaway's climb in the room an opponent would have had (pace-rail.js):
     the pace panel in small, on the same sheet as the card beside it, with
     its bar, its chart and its dots and none of its words. The numbers are a
     tap away, in the drawer. */
  #rail-right #pace-mini:not([hidden]) {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 120px;
    align-self: stretch;
    padding: 9px 10px 8px;
    background: var(--sheet);
    border: 1px solid var(--hair);
    border-radius: var(--radius-md);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.26);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
  }
  #pace-mini .climb-track { flex: none; height: 6px; }
  #pace-mini .climb-plot { flex: 1 1 auto; min-height: 0; margin-top: 0; }
  #pace-mini .climb-chart { height: 100%; }
  #pace-mini .climb-dots { height: 100%; }
  #pace-mini .climb-dots i { width: 4px; height: 4px; margin: -2px 0 0 -2px; }

  /* Your card is as tall as the climb beside it, which is taller than its
     two lines: the room under them shows what the dice have rolled, each
     total over a faint column of what it should have rolled, the last one
     lit. */
  #rail-right:has(#pace-mini:not([hidden])) .opp.is-you .opp-dice {
    display: flex;
    flex: 1 1 auto;
    min-height: 26px;
    gap: 2px;
    align-items: stretch;
    margin-top: 2px;
  }
  .opp-die {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 10px;
  }
  .opp-die-odds,
  .opp-die-hits {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 10px;
    max-height: calc(100% - 10px);
    border-radius: 2px 2px 0 0;
    transition: height 0.35s var(--ease, ease);
  }
  .opp-die-odds { background: var(--hair); }
  .opp-die-hits { background: var(--ink-3); }
  .opp-die.is-last .opp-die-hits { background: var(--gold); }
  .opp-die em {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    font-style: normal;
    font-size: 8px;
    line-height: 9px;
    text-align: center;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
  }
  .opp-die.is-last em { color: var(--gold); font-weight: 700; }
  #rail-left #panel-log { display: flex; height: 260px; }

  /* The turn strip and the palette, under the cards rather than over the
     board: one band across the top for everything about the table, and the
     board's own box starting below it, so the island is fitted to the room
     it can actually be seen in (main.js measures `#stage-wrap`). The game's
     name gives its share of the row to the strip; the window says it. */
  #stage-wrap { margin-top: calc(var(--float-h) + var(--gap)); }
  #board-top { top: calc(-1 * (var(--float-h) + var(--gap))); left: 0; right: 0; }
  #board-mark { display: none; }
  #turnstrip { flex: 1 1 auto; }
  #board-tools { flex: none; }

  #rail-right {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    /* Scrolled sideways rather than allowed to grow: the board is what the
       rest of the screen is for. */
    scrollbar-width: none;
    /* Out to the glass on the right. The strip is meant to run off the edge
       so the next card says there are more, and `#app`'s gutter was stopping
       it a gap short of where the screen actually ends. The same again as a
       spacer keeps the last card off the edge once it is scrolled to: as
       padding, Safari leaves it out of what a sideways flex row scrolls. */
    margin-right: calc(-1 * (var(--gap) + env(safe-area-inset-right, 0px)));
  }
  #rail-right::after {
    content: '';
    flex: 0 0 calc(var(--gap) + env(safe-area-inset-right, 0px));
    align-self: stretch;
  }
  #rail-right::-webkit-scrollbar { display: none; }

  #opponents { flex-direction: row; gap: 6px; }
  .opp {
    min-width: 132px;
    padding: 6px 8px 7px;
    gap: 4px;
  }
  /* The hand goes whole, backs and count both: across the top a card is who,
     how many points, and what they have built. How much somebody is holding
     is the robber's question, and the robber's own dialog answers it. */
  .opp .opp-hand { display: none; }
  /* The bar stays: what somebody's points are made of — settlements, cities,
     metropolises, awards — is a glance across the top of a phone too. */

  /* Across the window again, still floating in its own gutter. The strip stops
     short of the right-hand edge so the game log can have what is left, and at
     this width there is no log beside it to give anything to. */
  #dock {
    right: var(--gap);
    width: auto;
    max-width: none;
  }

  /* The options take a row of their own: two lines of buttons never fitted
     beside two strips of tiles on a phone. */
  /* `.is-cramped` (chrome.js) is an id and a class, and was out-weighing
     this with its own four-column template. */
  #dock,
  #dock.is-cramped { grid-template-columns: max-content minmax(0, 1fr); }
  #dock-hand    { grid-column: 1; grid-row: 1; }
  #dock-numbers { grid-column: 2; grid-row: 1; }
  #dock-actions { grid-column: 1 / -1; grid-row: 2; }
  #dock-numbers .numbers { justify-content: center; margin: 0 auto; }
}

/* Narrower than the five cards and their labels can sit beside anything. */
@media (max-width: 560px) {
  #dock,
  #dock.is-cramped { grid-template-columns: minmax(0, 1fr); }
  #dock-numbers { grid-column: 1; grid-row: 2; }
  #dock-actions { grid-column: 1; grid-row: 3; }
  #dock-hand .hand-row { overflow-x: auto; }
  /* One row across the phone rather than a five-wide block with a ragged end:
     there is no other segment beside it competing for the width. */
  #dock-numbers .numbers {
    justify-content: flex-start;
    max-width: none;
    margin: 0;
    flex-wrap: nowrap;
    overflow-x: auto;
  }
  .action-line { justify-content: flex-start; }

  /* The strip on a phone: the same three boxes, everything in them a size
     smaller, so the board gets the height back. "Left in the box" is the
     segment small screens give up (as on a short laptop), so it is gone here
     outright rather than left to the measurement. */
  :root {
    /* Five across beside their label on any phone: the window less the
       gutters, the strip's and the segment's padding, and the label. */
    --card-w: min(46px, calc((100vw - 138px) / 5));
    --card-h: 50px;
    --num-w: 34px; --num-h: 30px;
  }
  #dock { min-height: 0; gap: 6px; padding: 6px; }
  #dock > div { padding: 6px 8px; gap: 5px; }
  #dock #dock-box { display: none; }
  .card { gap: 2px; padding: 3px; }
  .card .n { font-size: var(--fs-2); }
  .num { padding: 3px 4px; gap: 3px; }
  .num-n { font-size: var(--fs-0); }
  .num-pays { height: 5px; }

  /* Your hand and your numbers, labelled from the left rather than from
     above: each is one row high, and a heading over it was a second. */
  #dock #dock-hand,
  #dock #dock-numbers { flex-direction: row; align-items: center; gap: 8px; }
  #dock #dock-hand .dock-label,
  #dock #dock-numbers .dock-label {
    flex: none;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    width: 5.6em;
    min-width: 0;
    line-height: 1.3;
    letter-spacing: 0.1em;
  }
  #dock #dock-hand .dock-label span,
  #dock #dock-numbers .dock-label span { white-space: nowrap; }
  #dock-numbers .dock-label span:empty { display: none; }

  /* The buttons a step smaller, and each line filled edge to edge, so the
     four buys sit on one row and the four moves on another. */
  .actions { gap: 5px; }
  .action-line { gap: 5px; min-height: 0; }
  .action-line > button { flex: 1 1 auto; justify-content: center; }
  #dock-actions button {
    padding: 5px 6px;
    font-size: var(--fs-n4);
    letter-spacing: 0.06em;
  }
  .action-line.is-buy button { align-items: center; padding: 4px 6px; }

  /* Squatter still. The adviser is a playtesting aid with a key of its own
     (A), and the line of explanation under the buttons is mostly a hover
     reason, which a touchscreen never shows; the prompt over the buttons
     still says what is being asked. */
  #dock-actions [data-act="auto"] { display: none; }
  #dock-actions .hint { display: none; }
  #dock-actions { gap: 4px; }

  /* A hand of development cards, and a long row of numbers, run on past the
     edge and are swiped along; the card cut off at the edge says so, and a
     scrollbar under them said it again in gray. */
  #dock-hand .hand-row,
  #dock-numbers .numbers { scrollbar-width: none; }
  #dock-hand .hand-row::-webkit-scrollbar,
  #dock-numbers .numbers::-webkit-scrollbar { display: none; }

  /* The cards across the top at one width, two and a bit to the screen,
     rather than each as wide as its line of pieces: yours, with an award
     on it, was the whole strip. The line wraps instead. */
  .opp { flex: none; width: min(172px, 46vw); }
}

/* A short window — a laptop's native height minus the browser chrome and a
   bookmarks bar, which between them can eat a tenth of it — needs its own
   axis. Width already has somewhere for everything to go; height had nowhere,
   so the left rail fell back to scrolling and the right rail never gave up
   anything at all.

   These two go first because they are the least essential readouts on their
   own rails: the roll histogram above them is the one players actually
   argue about, and the opponent cards below the log are the win condition.
   A number that already paid out and a line already spoken are both already
   known; a scrollbar or a cropped player card are not a way to keep knowing
   them, just a worse one. */
@media (max-height: 760px) {
  #panel-payout { display: none; }
  #panel-log { display: none; }
  /* Except in the phone drawer, which scrolls (the 820px block above). */
  #rail-left #panel-log { display: flex; }
}

/* A window just tall enough to clear the query above, but not tall enough for
   the roll histogram and paid-by-number to both meet their own floor, used to
   show both anyway and let `#rail-left`'s `overflow-y: auto` turn into a
   scrollbar instead. `rails.js`'s `fitRailLeft` measures the actual room left
   once expected yield and the roll have taken theirs, and adds this class the
   moment the two floors would not both fit — the same either/or the query
   above already makes, asked by measurement instead of one more guessed
   breakpoint, since what is left over depends on the seat count and the
   window both. */
#rail-left.is-tight #panel-payout { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ========================================================= expected yield */

/* One grid for the whole panel rather than one per row.
   Three separate grids can only agree on a column width by being told the same
   number, which is how the names came to be cut to four letters in script: a
   thirty pixel column, decided before anybody was named. Here the rows are
   `display: contents` and the panel owns the tracks, so every name is measured
   against the same column and the column is measured against the panel.

   The name column takes a third of whatever the rail has been dragged to, and
   stops at the width of the longest name plus a little air. Drag the rail out
   and the names spell themselves out; drag it in and they ellipsise. The
   longest name cannot be known in CSS, so `rails.js` measures it once, when a
   seat is named, and publishes it. */
#yield-body {
  display: grid;
  grid-template-columns:
    max(2.4em, min(34%, var(--yield-name-max, 3em)))
    minmax(0, 1fr)
    3.1em;
  align-items: center;
  gap: 4px 7px;
}

.yield-row { display: contents; }

.yield-name {
  font-size: var(--fs-n4);
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--sc, var(--ink-2));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.yield-track {
  display: flex;
  height: 9px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.26);
  overflow: hidden;
}

.yield-track i { display: block; height: 100%; width: 0; transition: width 260ms ease; }

.yield-total {
  font-size: var(--fs-n3);
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* The key to the bars, under the bars.
   It sat under the whole panel before, which put the green square that stands
   for wood a name's width to the left of the wood segment it is a key to. It
   starts in the bar column now, so the two greens are on the same pixel. */
.yield-legend {
  grid-column: 2 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 3px 9px;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid var(--hair);
  font-size: var(--fs-n5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.yield-legend span { display: inline-flex; align-items: center; gap: 4px; }
.yield-legend b { width: 7px; height: 7px; border-radius: 1px; }

/* =============================================================== histogram */

/* =============================================================== the roll */

/* What the last roll paid, and to whom. This is where the production lines
   went when the game log stopped carrying them. */
#panel-roll { flex: none; }

/* Four and three make seven, written as that.
   It used to be a large sum with "4 + 3" beside it in small gray type, which
   is a number and a footnote about the number rather than the sentence the
   dice actually said. The two dice are now the same size as the total, because
   they are the same kind of thing; they carry less ink instead, because they
   are the given and the total is the answer. */
.roll-head {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--hair);
}

.roll-n,
.roll-d {
  font-size: var(--fs-3);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.roll-d { font-weight: 500; color: var(--ink-3); min-width: 0.62em; text-align: center; }
.roll-n { font-weight: 700; min-width: 1.25em; }

.roll-op {
  font-size: var(--fs-0);
  font-weight: 500;
  color: var(--ink-4);
  padding: 0 1px;
}

/* Six and eight take the ink a printed token prints them in; seven takes the
   robber's, which is a different red on purpose. The dice that made the number
   follow it, a shade back, so the whole equation changes color together. */
.roll-head.is-hot .roll-n { color: var(--token-lit); }
.roll-head.is-hot .roll-d { color: var(--token-line); }
.roll-head.is-seven .roll-n { color: var(--robber); }
.roll-head.is-seven .roll-d { color: var(--robber-line); }
.roll-head.is-seven .roll-op { color: var(--robber-line); }

.roll-list { display: flex; flex-direction: column; gap: 2px; }

/* A crowded table's roll is eight lines, which is most of the rail. Where the
   panel is wide enough — and a crowded table starts the rail wide enough —
   they go in two columns, seats down the first and on down the second, so a
   seat keeps its place in the order whichever way it is read. */
#roll-body { container: roll / inline-size; }

/* Past rolls, to the right of the current one, on their way off the panel.
   The body reaches out to the panel's border so a card goes behind the edge
   rather than stopping short of it at the padding. */
#roll-body {
  overflow: hidden;
  margin-right: calc(-1 * var(--sp-1));
}

.roll-strip {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.roll-card {
  position: relative;
  flex: 0 0 min(176px, 100%);
  min-width: 0;
}

/* A past roll is the sum and the payouts, as narrow as they are. The rows
   keep their seat's color down the left, which is the name said in ink. */
.roll-card.is-past { flex: 0 0 auto; }
.roll-card.is-past .roll-d,
.roll-card.is-past .roll-op,
.roll-card.is-past .roll-who { display: none; }
.roll-card.is-past .roll-row { grid-template-columns: minmax(0, 1fr); }
.roll-card.is-past .roll-none { font-size: 0; }
.roll-card.is-past .roll-none::after { content: '\2013'; font-size: var(--fs-n4); }

.roll-card.is-dim { opacity: 0.62; }
.roll-card.is-new { opacity: 0; }

/* A hairline between one roll and the one before, in the middle of the gap. */
.roll-card.is-past::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 2px;
  bottom: 2px;
  border-left: 1px solid var(--hair);
}

.roll-strip.is-sliding > .roll-card {
  transition: transform 520ms cubic-bezier(0.22, 0.7, 0.25, 1), opacity 360ms ease;
}

@media (prefers-reduced-motion: reduce) {
  .roll-strip.is-sliding > .roll-card { transition: none; }
}

@container roll (min-width: 280px) {
  :root[data-crowd] .roll-list {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(var(--roll-rows, 4), auto);
    grid-auto-columns: minmax(0, 1fr);
    column-gap: 10px;
  }
  :root[data-crowd] .roll-row { grid-template-columns: 48px minmax(0, 1fr); gap: 5px; }
  :root[data-crowd] .roll-got { gap: 5px; }
  /* The two columns are drawn in rather than spread across the panel, so the
     rolls before have the rest of it. A wider rail shows more of them. */
  :root[data-crowd] .roll-card:not(.is-past) { flex-basis: min(228px, 100%); }
  :root[data-crowd] .roll-card.is-past .roll-list { grid-auto-columns: max-content; column-gap: 6px; }
  :root[data-crowd] .roll-card.is-past .roll-row { grid-template-columns: minmax(0, 1fr); }
}

.roll-row {
  display: grid;
  /* Four letters and an ellipsis (rails.js's clipName), and not a pixel
     more: the rest goes to what the seat was paid. */
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  padding: 2px 0 2px 6px;
  border-left: 2px solid var(--sc, var(--hair));
}

/* A seat that got nothing still gets a line. Who went without is half of what
   a roll means, and a panel listing only the winners makes you count the
   missing names yourself. */
.roll-row.is-empty { opacity: 0.48; }

.roll-who {
  font-size: var(--fs-n4);
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sc, var(--ink-2));
  overflow: hidden;
  text-overflow: ellipsis;
}

.roll-got { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }

.roll-gain { display: inline-flex; align-items: center; gap: 3px; }
.roll-gain i { display: block; width: 7px; height: 8px; border-radius: 1px; }

.roll-gain b {
  font-size: var(--fs-n3);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.roll-none { font-size: var(--fs-n4); color: var(--ink-4); letter-spacing: 0.05em; }

/* Eleven columns, twice.
   The chart takes whatever the panel has left rather than a written height,
   because the two of them now split the foot of the rail between them and a
   fixed number would have had to be right for every window. */
.hist {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  gap: 2px;
  align-items: end;
  flex: 1 1 auto;
  min-height: 72px;
}

.hist-col { display: flex; flex-direction: column; min-height: 0; height: 100%; }

.hist-track {
  position: relative;
  flex: 1;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px 2px 0 0;
  min-height: 0;
}

/* Shaded down the column rather than filled flat, which is how the exhibit
   next door draws the same chart: a solid reads as a thing standing up, a flat
   block of color reads as a swatch. */
.hist-track i {
  display: block;
  width: 100%;
  height: 0;
  background: linear-gradient(180deg, var(--hair-strong), rgba(244, 241, 232, 0.14));
  border-radius: 2px 2px 0 0;
  transition: height 240ms ease;
}

/* The 36-outcome expectation, as a dashed line across each column. */
.hist-track u {
  position: absolute;
  left: 0;
  right: 0;
  height: 0;
  border-top: 1px dashed var(--gold);
  opacity: 0.65;
  transition: bottom 240ms ease;
}

.hist-col.is-last .hist-track i {
  background: linear-gradient(180deg, var(--gold), var(--gold-soft));
}
.hist-col.is-last .hist-label { color: var(--gold); }

/* The numbers along the foot are the whole key to both charts, and they were
   the smallest type on the page. One rung up the ladder, and a shade less
   faint with it. */
.hist-label {
  font-size: var(--fs-n3);
  font-weight: 600;
  text-align: center;
  color: var(--ink-3);
  padding-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- paid by number */

/* The twin chart, stacked in resource colors. One column is everything the
   island has paid the table on that number, in the order the rest of this
   interface lists resources in, building up from the floor. */
/* Full height, and the segments measured against it.
   A stack sized by its own contents cannot give those contents a percentage
   height to be sized by, which is a circle the browser resolves by drawing
   nothing. It fills the track instead and packs its segments against the
   floor, so each one is a plain percentage of the chart. */
.hist-stack {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-start;
  width: 100%;
  height: 100%;
  border-radius: 2px 2px 0 0;
  overflow: hidden;
}

.hist-stack i {
  display: block;
  width: 100%;
  height: 0;
  flex: none;
  transition: height 240ms ease;
}

/* The number that has just come up is marked by its label and by the floor it
   stands on, since the column itself is already carrying five colors and has
   none left to spare. An outline round the whole column would have drawn a
   tall empty box over a short bar. */
.hist.is-stacked .hist-col.is-last .hist-label { color: var(--gold); }

/* Its own layer rather than an inset shadow, which the stack standing on it
   would paint straight over. */
.hist.is-stacked .hist-col.is-last .hist-track::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--gold);
}

/* ====================================================== lobby, three ways in */

.row { display: flex; gap: 7px; }
.row button { flex: 1; }

/* The room code is going to be read off a screen and typed into a chat
   window, so it is set large, spaced, and in the one accent color. It is the
   one string on this page that has earned tracking. */
.code {
  font-size: clamp(var(--fs-3), 4.4vw, var(--fs-5));
  font-weight: 700;
  letter-spacing: 0.22em;
  color: var(--gold);
  text-align: center;
  padding: 10px 6px;
  border: 1px dashed rgba(245, 197, 66, 0.45);
  border-radius: var(--radius-md);
  background: rgba(245, 197, 66, 0.07);
  user-select: all;
}

#lobby #join-code {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: var(--fs-2);
  font-weight: 700;
  text-align: center;
}

.netstatus {
  margin: 0;
  min-height: 1.3em;
  font-size: var(--fs-n4);
  letter-spacing: 0.05em;
  color: var(--ink-3);
  line-height: 1.5;
}

.netstatus.is-bad { color: #ff9b7a; }

#host-room { display: flex; flex-direction: column; gap: var(--sp-1); }

/* The door barely narrows: it is a title, a square and two buttons, and those
   are the same shape on a phone, only moved down into the middle. What has to
   give is the room, whose two ways in stack, and the roster, which keeps its
   two columns by losing its prose. */
@media (max-width: 560px) {
  /* Room at the foot for the house-rules gear, which floats over the lower
     right corner: the last of anything scrolls up clear of it. */
  .sheet { padding: var(--sp-3) var(--sp-2) 76px; }
  .net-grid { grid-template-columns: minmax(0, 1fr); }
  .net-side + .net-side {
    padding-left: 0;
    padding-top: var(--sp-2);
    border-left: 0;
    border-top: 1px solid var(--hair);
  }
  .net-name { max-width: none; }

  /* The door, on a phone. The title stays at the top, where it is on every
     screen, and the two ways in and the island hang in the middle of what is
     left under it: hung from the top, they sat under the title with half a
     screen of empty water below them. The sheet's height is the window's, so
     a second row that takes the rest of it is a box to center them in. */
  /* Asked for since: the ways in and the island close under the title, and
     the water below them, rather than centered in what is left. */
  .sheet:has(> #screen-door:not([hidden])) { grid-template-rows: auto minmax(min-content, 1fr); }
  #screen-door { justify-content: flex-start; position: relative; }
  /* The island's overhang (.door-stage canvas) is cut at the window's edge,
     so it never makes the door wider than the phone: clipped at the door's
     own box and let out again by the sheet's side padding, which puts the
     cut on the glass. Clip, not hidden, so the door does not become a
     scroller of its own. */
  #screen-door { overflow-x: clip; overflow-clip-margin: var(--sp-2); }
  /* Close under the title, but not crowding it. */
  #screen-door { padding-top: 22px; }

  /* The game to carry on, out of the middle. Centered with the buttons and
     the island, its arriving lifted both by half its height and its going
     dropped them back. Pinned to the foot of the door instead, where
     nothing above it can feel it come and go, and set as two lines: what
     the game is, then the two things to do with it, rather than a sentence
     that broke wherever the width ran out. */
  #screen-door .door-resume {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
  }
  .door-resume .resume-lead { order: 1; }
  .door-resume #resume-what { order: 2; }
  .door-resume::after { content: ''; order: 3; flex-basis: 100%; height: 0; }
  .door-resume #resume-go { order: 4; }
  .door-resume #resume-drop { order: 5; }
  /* Side by side and their own size, as on a desktop, rather than two bars
     the width of the phone. */
  /* Four, two by two: four across a phone is a word too many for any of
     them. */
  #lobby .door-do { gap: 6px; display: grid; grid-template-columns: 1fr 1fr; width: min(100%, 340px); margin: 0 auto; }
  #lobby .door-do button { width: 100%; }
  /* The tutorial offer is a lead and two buttons, in that order, whatever
     the resume line above does with its own. */
  #screen-door .door-offer > * { order: 0; }
  #screen-door .door-offer::after { display: none; }
  #lobby .door-do button { min-width: 0; flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
  /* Three across a phone: the filled one keeps its color and weight, and
     gives up the larger type, so its word has the room the other two have. */
  #lobby .door-do button.primary { font-size: var(--fs-n2); }
  .door-stage { width: min(88%, calc(52vh * 1.22)); }

  /* Centered at a width of their own rather than edge to edge, which is also
     what keeps the last one clear of the house-rules gear in the corner. */
  #lobby .screen-do button { min-width: 220px; }

  /* Eight bots two across, as on a desktop, at a name and a strength each.
     The line saying what each one does is what goes: one across, with it,
     the roster was the whole screen and the settings were under the fold. */
  .leaning { padding: 8px 10px; }
  .leaning-brief { display: none; }
  .leaning-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
  }
}

/* Short and wide, which is a laptop in a browser with three toolbars. The
   island is what gives, because it is the only thing here that can. */
@media (max-height: 620px) {
  .door-stage { width: min(100%, calc(42vh * 1.22)); }
  .screen { gap: var(--sp-2); }
}
/* What kind of game: the island, what wins it, and how many robbers.
   A label column and a control column, so the controls start on one line
   and the labels read down one edge. Every row is there on both islands, so
   choosing the big one changes numbers rather than moving anything. */
.settings {
  --mega: #FF4A3A;              /* the exhibit's MEGA red (infautcatan) */
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 8px var(--sp-2);
  width: fit-content;
  max-width: 100%;
  margin: 2px auto var(--sp-1);
  text-align: left;
}

/* A row is its label and its control, placed straight into the grid. */
.setting { display: contents; }
.setting .field-name { justify-self: end; white-space: nowrap; }

.setting > * { transition: opacity 260ms ease, visibility 0s; }
.setting.is-off > * {
  visibility: hidden;
  opacity: 0;
  transition: opacity 260ms ease, visibility 0s 260ms;
}

/* A line about the big island, under everything and with its room kept
   whether there is anything in it or not. */
.island-note {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.5em;
  text-align: center;
}

/* The board at this table (lobby.js paintBoards). Its room is kept too, so
   the answer arriving does not nudge the buttons under it. */
.board-note {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 1.5em;
  text-align: center;
  color: var(--ink-3, var(--ink-4));
}

#net-bots .settings { margin-top: var(--sp-1); }

/* Which island: two words in a pill, the chosen one filled. Mega is in the
   red the title opens in, chosen or not, so the word reads as the big island
   before anybody presses it. */
.island-opts { display: inline-flex; gap: 6px; }

#lobby .island-pick .island-opt {
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: var(--fs-n2);
  letter-spacing: 0;
}

#lobby .island-pick .island-opt[aria-pressed="true"] {
  background: var(--gold-soft, rgba(245, 197, 66, 0.16));
  border-color: var(--gold);
  color: var(--ink);
}

#lobby .island-pick .island-opt.is-mega { color: var(--mega); font-weight: 700; }
#lobby .island-pick .island-opt.is-mega[aria-pressed="true"] {
  background: rgba(255, 74, 58, 0.14);
  border-color: var(--mega);
  color: var(--mega);
}

/* The wheel: a strip of numbers scrolled sideways and snapped one to a stop,
   the chosen one in the middle and full size, the rest smaller and fainter
   with distance (wheel.js sets those per frame). The edges fade out rather
   than end, so it reads as numbers going round a drum. */
.wheel {
  --cell: 34px;
  position: relative;
  /* Seven numbers across: the chosen one and three either side. */
  width: min(calc(var(--cell) * 7), 62vw);
  height: 30px;
  border-radius: var(--radius-sm, 6px);
  outline: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 14%, #000 86%, transparent);
  cursor: grab;
  touch-action: pan-x;
  user-select: none;
  -webkit-user-select: none;
}
.wheel.is-dragging { cursor: grabbing; }
.wheel:focus-visible { outline: 2px solid var(--gold-line, rgba(245, 197, 66, 0.55)); outline-offset: 2px; }

/* The window the chosen number sits in, drawn under the strip. */
.wheel::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: var(--cell);
  transform: translateX(-50%);
  border-radius: 8px;
  background: var(--gold-soft, rgba(245, 197, 66, 0.16));
  box-shadow: inset 0 0 0 1px var(--gold-line, rgba(245, 197, 66, 0.55));
  pointer-events: none;
}

.wheel-track {
  position: relative;
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
/* Half the strip less half a cell either side, so the first and the last
   numbers can both reach the middle. Cells (wheel.js), not padding: Safari
   does not scroll into a flex row's end padding. */
.wheel-pad { flex: 0 0 calc(50% - var(--cell) / 2); }
.wheel-track::-webkit-scrollbar { display: none; }
.wheel.is-dragging .wheel-track { scroll-snap-type: none; }

.wheel-n {
  flex: 0 0 var(--cell);
  display: grid;
  place-items: center;
  scroll-snap-align: center;
  font-size: var(--fs-0);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  transition: color 160ms ease;
  will-change: transform, opacity;
}
.wheel-n.is-on { color: var(--ink); }

/* Set by a house rule (lobby.js `showTarget`): it shows the number the game
   will be played to, and is not turned until the rule comes off. */
.wheel.is-forced { pointer-events: none; opacity: 0.6; }
.wheel.is-forced::before { box-shadow: inset 0 0 0 1px var(--ink-3); background: transparent; }

/* ============================================================ house rules */

/* The secret panel (house-panel.js): Shift+S on the singleplayer screen.
   A card over a dimmed sheet rather than anything in the page's flow, so
   opening it moves nothing under it; it scrolls inside itself when the
   rules outgrow the window. */
.house-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  background: rgba(2, 10, 16, 0.62);
  animation: house-in 200ms ease both;
}
.house-panel[hidden] { display: none; }

@keyframes house-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.house-card {
  width: min(600px, 100%);
  max-height: min(820px, calc(100dvh - 2 * var(--sp-4)));
  display: flex;
  flex-direction: column;
  background: var(--sheet-solid, #071e2e);
  border: 1px solid var(--hair-strong);
  border-radius: 12px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: left;
  overflow: hidden;
}

/* The head: what this is and who it is for on the left; on the right, how
   much is changed and the two ways out, on one line with the title. */
.house-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--hair);
}
.house-titles { min-width: 0; }
.house-titles h2 {
  margin: 0;
  font-size: var(--fs-2);
  font-weight: 700;
  line-height: 1.15;
  color: var(--ink);
}
.house-titles p {
  margin: 4px 0 0;
  max-width: 44ch;
  font-size: var(--fs-n2);
  line-height: 1.45;
  color: var(--ink-3);
}
.house-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.house-count {
  padding: 2px 9px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: var(--fs-n3);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  white-space: nowrap;
}

/* One small label in capitals names each part of the card: the presets
   here, and every group of rules below. */
.house-presets::before,
.house-group h3 {
  font-size: var(--fs-n3);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Ready-made sets of rules, above the boxes they fill in, on a band a shade
   darker than the rules so they read as a place to start rather than as one
   more rule. The chosen one is lit, and the line under them says what it
   does. */
.house-presets {
  padding: 13px var(--sp-4);
  border-bottom: 1px solid var(--hair);
  background: rgba(0, 0, 0, 0.14);
}
.house-presets::before {
  content: 'Presets';
  display: block;
  margin-bottom: 8px;
}
.house-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
#lobby .house-panel .house-preset {
  width: auto;
  min-width: 0;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: var(--fs-n2);
  letter-spacing: 0;
}
#lobby .house-panel .house-preset.is-chaos { border-style: dashed; }
/* Held still when pressed: the row scrolls sideways on a phone, which clips
   it top and bottom too, and the press's one-pixel lift cut the top border
   off. */
#lobby .house-panel .house-preset,
#lobby .house-panel .house-preset:hover,
#lobby .house-panel .house-preset:active { transform: none; }
#lobby .house-panel .house-preset[aria-pressed="true"] {
  background: var(--gold-soft, rgba(245, 197, 66, 0.16));
  border-color: var(--gold);
  color: var(--gold, #f5c542);
}
.house-preset-say {
  margin: 8px 0 0;
  min-height: 1.5em;
  font-size: var(--fs-n2);
  line-height: 1.5;
  color: var(--ink-3);
}

/* The rules scroll inside the card, under a scrollbar drawn in the page's
   own hair rather than the operating system's light slab. */
.house-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 var(--sp-4) var(--sp-4);
}
/* Firefox draws its own from these two. Chrome and Safari would too, arrows
   and all, so they are left to the WebKit rules below instead. */
@supports not selector(::-webkit-scrollbar) {
  .house-body {
    scrollbar-width: thin;
    scrollbar-color: var(--hair-strong) transparent;
  }
}
.house-body::-webkit-scrollbar { width: 10px; }
.house-body::-webkit-scrollbar-track { background: transparent; }
.house-body::-webkit-scrollbar-thumb {
  background: var(--hair-strong);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: content-box;
}
.house-body::-webkit-scrollbar-thumb:hover { background: var(--ink-3); background-clip: content-box; }

/* A group's name stays pinned at the top while its rules scroll under it,
   and a hairline runs from it to the edge, so where one group ends and the
   next begins is never in doubt. */
.house-group h3 {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
  margin: 0;
  padding: var(--sp-3) 0 6px;
  background: var(--sheet-solid, #071e2e);
}
.house-group h3::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--hair);
}

/* A rule: its name, and under it in small type what the number means; the
   box on the right, in one column for the whole card, so the eye runs down
   the names on one side and the values on the other. */
.house-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  grid-template-areas: 'label box' 'note box';
  align-items: center;
  column-gap: var(--sp-3);
  row-gap: 1px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(244, 241, 232, 0.06);
}
.house-row:last-child { border-bottom: 0; }
.house-row > .house-label { grid-area: label; }
.house-row > .house-note { grid-area: note; }
.house-row > .house-note:empty { display: none; }
/* With nothing to say under it, a rule is one line, its name level with its box. */
.house-row:has(> .house-note:empty) { grid-template-areas: 'label box'; }
#lobby .house-panel .house-row > .house-n,
#lobby .house-panel .house-row > .house-toggle { grid-area: box; }

.house-label {
  font-size: var(--fs-n1);
  font-weight: 600;
  color: var(--ink);
}
.house-note {
  font-size: var(--fs-n3);
  line-height: 1.4;
  color: var(--ink-4);
}
/* A table's note is part of its label: under it, like any other rule's. */
.house-label .house-note {
  display: block;
  margin-top: 1px;
  font-weight: 400;
}

#lobby .house-panel input.house-n {
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  font-size: var(--fs-n1);
  font-variant-numeric: tabular-nums;
  text-align: center;
  -moz-appearance: textfield;
}
#lobby .house-panel input.house-n::-webkit-outer-spin-button,
#lobby .house-panel input.house-n::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#lobby .house-panel input.house-n::placeholder { color: var(--ink-4); opacity: 0.8; }

/* A box holding a house rule, and one holding something that is not a
   number in range (kept out of the rules until it is). */
#lobby .house-panel input.house-n.is-set {
  border-color: var(--gold-line, rgba(245, 197, 66, 0.55));
  color: var(--gold, #f5c542);
  font-weight: 700;
}
#lobby .house-panel input.house-n.is-bad { border-color: var(--robber, #ff4a3a); }

#lobby .house-panel .house-toggle {
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  justify-content: center;
}
#lobby .house-panel .house-toggle.is-set {
  border-color: var(--gold-line, rgba(245, 197, 66, 0.55));
  color: var(--gold, #f5c542);
}

/* The tables: costs, a starting hand, the deck. Each is set in a well of
   its own under its name, the columns named across the top. */
.house-row.is-table {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'label' 'grid';
  row-gap: 8px;
}
.house-row.is-table > .house-grid { grid-area: grid; }
.house-grid {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 8px 10px 10px;
  border: 1px solid rgba(244, 241, 232, 0.06);
  border-radius: var(--radius-md);
  background: rgba(0, 0, 0, 0.16);
}
.house-grid-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  align-items: center;
}
.house-grid-row:has(.house-grid-label) {
  grid-template-columns: 76px repeat(5, minmax(0, 1fr));
}
.house-grid-row.is-head .house-grid-col {
  font-size: var(--fs-n4);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-3);
}
.house-grid-label {
  font-size: var(--fs-n2);
  color: var(--ink-2);
}

/* Where the singleplayer screen says house rules are on: over the corner of
   its heading, so appearing moves nothing. In the room it sits in line, in
   the roster's heading beside "Surprise me". */
#screen-solo .screen-head,
#screen-alone .screen-head { position: relative; }
/* The way into the house rules: a row among the settings (house-panel.js),
   a pill that says what is in force and offers to change it. A book rather
   than a gear, since what it opens is the rules of the game and not the
   settings of the app; quiet on the printed game, lit in the accent the
   moment anything is changed. */
#lobby .house-open {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  min-width: 0;
  min-height: 0;
  padding: 3px 6px 3px 10px;
  border-radius: 999px;
  font-size: var(--fs-n2);
  letter-spacing: 0;
  color: var(--ink-2);
}
#lobby .house-open svg { flex: none; display: block; opacity: 0.8; }
#lobby .house-open .house-says { white-space: nowrap; }
#lobby .house-open .house-go {
  padding: 1px 8px;
  border-radius: 999px;
  font-size: var(--fs-n4);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  background: rgba(255, 255, 255, 0.07);
}
#lobby .house-open:hover .house-go { color: var(--ink); }
#lobby .house-open.is-set {
  color: var(--gold, #f5c542);
  background: var(--gold-soft, rgba(245, 197, 66, 0.16));
  border-color: var(--gold-line, rgba(245, 197, 66, 0.55));
}
#lobby .house-open.is-set .house-go { color: var(--gold, #f5c542); }
/* A phone has the width for what is in force and not for the offer too; a
   chevron says the rest. */
@media (max-width: 560px) {
  /* Past the phone rule that makes every button in a screen's footer at
     least the play button's width. */
  #lobby .screen-do .house-open { min-width: 0; padding-right: 10px; }
  #lobby .house-open .house-go { display: none; }
  #lobby .house-open::after {
    content: '';
    width: 6px;
    height: 6px;
    margin: 0 2px 0 -1px;
    border-top: 1.6px solid currentColor;
    border-right: 1.6px solid currentColor;
    transform: rotate(45deg);
    opacity: 0.7;
  }
}

/* On a phone the rules are what the card is for, so everything above them is
   folded to as little as it can be: the head to the title, the way out and
   the count, and the presets to one row that scrolls sideways under its
   label. Wrapped, the fourteen of them were six rows on their own, and with
   the head they took half the card before the first rule. */
@media (max-width: 560px) {
  .house-panel { padding: var(--sp-2); }
  .house-card { max-height: calc(100dvh - 2 * var(--sp-2)); }

  .house-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas: 'title reset done' 'count count count';
    align-items: center;
    gap: 4px 10px;
    padding: 10px var(--sp-3);
  }
  .house-titles { grid-area: title; }
  .house-titles h2 { font-size: var(--fs-1); }
  /* Who it is for is said on the screen that opened it. */
  .house-titles p { display: none; }
  .house-tools { display: contents; }
  .house-count { grid-area: count; justify-self: start; }
  .house-tools .linky { grid-area: reset; }
  .house-tools .primary { grid-area: done; }

  .house-presets { padding: 9px var(--sp-3) 10px; }
  .house-presets::before { margin-bottom: 6px; }
  .house-preset-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    /* Out to the card's edges, so a chip scrolls away under the edge rather
       than being cut at the padding, and fading there, so a row that goes on
       past the edge looks like one. */
    margin: -3px calc(-1 * var(--sp-3));
    padding: 3px var(--sp-3);
    scroll-padding: 0 var(--sp-3);
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 var(--sp-3), #000 calc(100% - var(--sp-3)), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 var(--sp-3), #000 calc(100% - var(--sp-3)), transparent);
  }
  .house-preset-row::-webkit-scrollbar { display: none; }
  #lobby .house-panel .house-preset { flex: none; padding: 4px 11px; }
  .house-preset-say { margin-top: 6px; font-size: var(--fs-n3); }

  .house-body { padding: 0 var(--sp-3) var(--sp-3); }
  .house-row { grid-template-columns: minmax(0, 1fr) 64px; }
  .house-grid { padding: 6px; }
  .house-grid-row:has(.house-grid-label) { grid-template-columns: 58px repeat(5, minmax(0, 1fr)); }
  /* The card fills the phone, and the gear in the corner would sit on top
     of its last rule. Done is the way out. */
}

/* =============================================================== the lenses */

/* Which lens is up and what the others are called: a small sheet in the
   board's lower left, set by heat-legend.js in the panels' own type. Every key
   is named; the one up is lit in its color. Everything on it is centered, on
   both axes: it is a row of keys, not a paragraph. */
.heat-legend {
  position: fixed;
  z-index: 40;
  pointer-events: none;
  max-width: min(440px, calc(100vw - 32px));
  padding: var(--sp-n1) var(--sp-0);
  border-radius: var(--radius-md);
  background: var(--sheet);
  border: 1px solid var(--hair);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  color: var(--ink-2);
  font-size: var(--fs-n2);
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.heat-legend[hidden] { display: none; }

/* Where the readout goes while nothing is held: a key and what it does, as
   quiet as the board's own name over the top of it. Only where there is a
   keyboard to hold it on. */
.heat-hint {
  position: fixed;
  z-index: 3;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--fs-n3);
  letter-spacing: 0.04em;
  color: var(--ink-3);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
  user-select: none;
}
.heat-hint kbd {
  display: inline-grid;
  place-items: center;
  min-width: 1.7em;
  height: 1.7em;
  padding: 0 4px;
  border-radius: 4px;
  font: inherit;
  font-weight: 700;
  color: var(--ink-2);
  background: var(--sheet-soft);
  border: 1px solid var(--hair);
}
.heat-hint[hidden] { display: none; }
@media (hover: none), (pointer: coarse) {
  .heat-hint { display: none; }
}

/* What one press of back says during a game (main.js): a second one leaves.
   A pill across the top of the board, in the turn strip's glass. */
#back-note {
  position: absolute;
  z-index: 7;
  top: var(--float-inset);
  left: 50%;
  transform: translate(-50%, -4px);
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--sheet-strong, rgba(7, 30, 46, 0.92));
  border: 1px solid var(--hair-strong);
  font-size: var(--fs-n2);
  letter-spacing: 0.04em;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
}
#back-note.is-on { opacity: 1; transform: translate(-50%, 0); }

/* The squares in the board's lower right, one over the other: the stats
   (stats-drawer.js) and, under it, the heatmap (main.js).
   Each is the size of a card, with no outline and no glyph, a few shades
   under the felt, so they are places on the table rather than more controls
   on it, each with a small picture of what it opens. Darker again while
   the heatmap is up. Each shows only where it has a job: the stats where the left rail
   has folded into its drawer, the heatmap everywhere. */
#board-keys {
  position: absolute;
  z-index: 5;
  right: var(--float-inset);
  bottom: var(--float-inset);
  display: flex;
  flex-direction: column;
  gap: var(--float-gap);
  pointer-events: none;
}
#board-keys > button {
  pointer-events: auto;
  width: var(--card-w);
  height: var(--card-w);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  -webkit-tap-highlight-color: transparent;
}
#board-keys > button:hover:not(:disabled) { transform: none; }

#stats-key,
#stats-key:hover:not(:disabled),
#heat-key,
#heat-key:hover:not(:disabled) { background: rgba(0, 0, 0, 0.22); }
/* A small picture of what each one opens, rather than a word. */
#board-keys > button { display: grid; place-items: center; }
#board-keys > button svg { display: block; width: 72%; height: 72%; }
#heat-key[aria-pressed="true"],
#heat-key[aria-pressed="true"]:hover:not(:disabled) { background: rgba(0, 0, 0, 0.38); }

/* The heatmap square is on every screen. It was touch-only, until a laptop
   that reported itself as touch showed it to a playtester, who took it for
   a feature and used it as one: a square you can see beats a key you have
   to be told about, and H is still there to hold. The stats square shows
   wherever the left rail has folded away, mouse or finger: it used to be
   touch-only, which left a narrow window with a mouse holding a drawer it
   had no way to open. */
#board-keys > #stats-key { display: none; }
@media (max-width: 1100px) {
  #board-keys > #stats-key { display: grid; }
}
@media (hover: none), (pointer: coarse) {
  /* The lens keys are a choice made with the number keys or the wheel, and
     on a touchscreen they were one more box over a small board to read
     past. The square shows whichever lens the moment calls for. */
  .heat-legend { display: none !important; }
}

.heat-legend-keys {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px;
}

.heat-key {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 2px 7px 2px 3px;
  line-height: 1;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: var(--fs-n3);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.heat-key kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 15px;
  height: 15px;
  padding: 0 3px;
  border-radius: 3px;
  background: rgba(244, 241, 232, 0.08);
  font: inherit;
  letter-spacing: 0;
  text-align: center;
}

.heat-key.is-on {
  color: var(--lc);
  border-color: color-mix(in srgb, var(--lc) 45%, transparent);
  background: color-mix(in srgb, var(--lc) 12%, transparent);
}

.heat-key.is-on kbd { background: var(--lc); color: var(--sheet-solid); }

/* A lens key that is a button: the readout lets the pointer through to its
   keys and nowhere else, so a click on the rest of it still falls through. */
button.heat-key {
  pointer-events: auto;
  cursor: pointer;
  font-family: inherit;
  background: transparent;
  margin: 0;
}
button.heat-key:hover:not(.is-on) { color: var(--ink); border-color: var(--hair); }


.heat-legend-note { margin: 0; }
.heat-legend-note[hidden] { display: none; }

.heat-legend-note { color: var(--gold); }

/* The exact figure under the pointer. */
.heat-tip {
  position: fixed;
  z-index: 41;
  pointer-events: none;
  max-width: 320px;
  padding: 5px 9px;
  border-radius: 7px;
  background: rgba(6, 14, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--ink-1, #fff);
  font-size: var(--fs-n3);
  line-height: 1.35;
}

/* ================================================================ taunts */

/* In the name's row, between the name and the points, and quiet until it is
   wanted. Pulled into the row's height rather than adding to it, so a card
   with a button is the same height as one without. */
.taunt-open {
  flex: none;
  width: 22px;
  height: 22px;
  margin: -4px 6px -4px auto;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
  line-height: 1;
  border-radius: 999px;
  background: var(--sheet-soft);
  border: 1px solid var(--hair);
  opacity: 0.55;
  filter: grayscale(0.6);
  transition: opacity 140ms ease, filter 140ms ease, transform 140ms ease;
}
.taunt-open:hover,
.taunt-open:focus-visible,
.taunt-open[aria-expanded="true"] { opacity: 1; filter: none; transform: scale(1.08); }
.taunt-open[aria-disabled="true"] { opacity: 0.2; filter: grayscale(1); cursor: default; transform: none; }

/* Rows of seven: the faces will not fit along one line on a phone, and the
   list is kept a multiple of seven (test/taunt.js) so no row ends short. */
.taunt-pick {
  position: fixed;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(7, auto);
  gap: 4px;
  padding: 6px;
  border-radius: var(--radius-md);
  background: var(--sheet);
  border: 1px solid var(--hair);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.taunt-choice {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  border-radius: 999px;
  background: transparent;
  border: 1px solid transparent;
  transition: transform 120ms ease, background 120ms ease;
}
.taunt-choice:hover,
.taunt-choice:focus-visible { transform: scale(1.18); background: var(--sheet-soft); border-color: var(--hair); }
/* The number key a face is on (taunt.js `KEYS`), small in its corner. */
.taunt-choice { position: relative; }
.taunt-key {
  position: absolute;
  right: -1px;
  bottom: -2px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-2);
  padding: 1px 3px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
/* Keys mean nothing on a phone. */
@media (hover: none) { .taunt-key { display: none; } }

/* What the rest of the table sees: the face, hanging off the left edge of
   the card it was aimed at. Pulled onto that edge by its margins, since the
   keyframes own its transform. */
.taunt-badge {
  position: fixed;
  z-index: 45;
  margin: -16px 0 0 -20px;
  font-size: 28px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
  animation: taunt-badge 3200ms ease both;
}
@keyframes taunt-badge {
  0%   { transform: scale(0.2) rotate(-20deg); opacity: 0; }
  10%  { transform: scale(1.25) rotate(8deg); opacity: 1; }
  18%  { transform: scale(1) rotate(0); }
  85%  { opacity: 1; }
  100% { opacity: 0; }
}

/* What the person it was aimed at sees: the face, large, over the board, and
   who sent it. Never in the way of a click. */
.taunt-pop {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  transform: translate(-50%, -50%);
}
.taunt-glyph {
  font-size: clamp(88px, 14vmin, 160px);
  line-height: 1;
  filter: drop-shadow(0 10px 18px rgba(0, 0, 0, 0.5));
}
.taunt-from {
  font-size: var(--fs-0);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.7);
}
.taunt-pop.is-still { animation: taunt-still 2400ms ease both; }
@keyframes taunt-still {
  0%, 100% { opacity: 0; }
  12%, 80% { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .taunt-badge { animation: taunt-still 3200ms ease both; }
}

/* ================================================================== chat */

/* chat.js. A square among the board's keys, drawn like them (two bubbles in
   the table's colors, not an emoji); a sheet that stands over the board just
   above the dock, so the hand stays in view while somebody types; and a line
   under the turn strip for whatever arrives while it is shut. Its `top` is
   measured from the strip as it shows (chat.js); the one here is for before.
   On a wide screen, where the rails stand either side of the board, the sheet
   is moved beside its key instead (chat.js `placeSheet`), so it covers a
   corner of the board rather than the opponents and the log. */
#chat-key,
#chat-key:hover:not(:disabled) {
  position: relative;
  background: rgba(0, 0, 0, 0.22);
}
#chat-key[hidden] { display: none; }
#chat-key[aria-expanded="true"] { background: rgba(0, 0, 0, 0.38); }
#chat-key.has-unread::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.5);
}

.chat-sheet {
  position: fixed;
  z-index: 45;
  right: var(--gap);
  bottom: calc(var(--dock-actual, var(--dock-floor)) + var(--gap));
  width: min(360px, calc(100vw - 2 * var(--gap)));
  max-height: min(420px, 60vh, 60dvh);
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: var(--sp-1);
  background: var(--sheet-solid, #071e2e);
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.chat-sheet[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; }
.chat-head h2 { margin: 0; font-size: 0.95rem; color: var(--ink-2); }
/* The cross is drawn (chat.js), not a × in the font, whose glyph sits high
   and to one side of its own box. */
.chat-shut {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  line-height: 0;
  color: var(--ink-2);
  background: transparent;
  border: 0;
}
.chat-shut:hover { color: var(--ink); }
.chat-shut svg { width: 14px; height: 14px; display: block; }

.chat-log {
  flex: 1 1 auto;
  min-height: 60px;
  margin: 0;
  padding: 0 4px 0 0;
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-size: 0.9rem;
  line-height: 1.35;
}
.chat-line { padding: 2px 0; color: var(--ink); overflow-wrap: anywhere; }
.chat-line.is-note { color: var(--ink-3); font-style: italic; }
.chat-who { font-weight: 700; }

.chat-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.chat-chip {
  padding: 5px 10px;
  font-size: 0.82rem;
  border-radius: 999px;
}

.chat-form { display: flex; gap: 6px; }
/* 16px, or iOS zooms the page in when the box is tapped. */
.chat-field {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  padding: 7px 10px;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
}
.chat-send { flex: none; }

.chat-toast {
  position: fixed;
  z-index: 44;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  left: 50%;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 2 * var(--gap)));
  padding: 7px 12px;
  font-size: 0.9rem;
  color: var(--ink);
  background: var(--sheet-solid, #071e2e);
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow-wrap: anywhere;
  cursor: pointer;
}
.chat-toast[hidden] { display: none; }
.chat-toast .is-note { color: var(--ink-3); font-style: italic; }

/* ================================================================= blitz */

/* The clock row's "tune" sits in line with the presets, quieter than them. */
#lobby .clock-opts { flex-wrap: wrap; align-items: center; }
#lobby .clock-opts .clock-tune-open { margin-left: 4px; font-size: var(--fs-n3); }

/* A preset is its name over its time, so the choice reads as a clock. */
#lobby .island-pick .clock-opt {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 12px 5px;
  border-radius: var(--radius-md);
  line-height: 1.15;
}
.clock-opt-name { font-weight: 700; }
.clock-opt-time {
  font-size: var(--fs-n3);
  font-variant-numeric: tabular-nums;
  color: var(--ink-4);
}
#lobby .clock-opt[aria-pressed="true"] .clock-opt-time { color: var(--ink-2, var(--ink)); }

/* What the chosen clock means at the table, under the row that chose it. */
.clock-says {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  text-align: center;
  /* Wraps to the grid rather than sizing it: as long as it liked, a longer
     line for one preset widened the columns and moved every row above. */
  contain: inline-size;
}

/* Every number behind the chosen preset, across both columns of the settings
   grid, under the row that chose it. */
.clock-tune {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--sheet-soft);
  border: 1px solid var(--hair);
}
.clock-tune[hidden] { display: none; }
.clock-tune-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: var(--fs-n2);
  font-weight: 700;
  color: var(--ink);
}
.clock-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px 12px;
}
.clock-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 4px;
  font-size: var(--fs-n3);
  color: var(--ink-3);
}
.clock-field-name { grid-column: 1 / -1; white-space: nowrap; }
.clock-field input {
  width: 100%;
  min-width: 0;
  padding: 3px 6px;
  font: inherit;
  font-size: var(--fs-n2);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--sheet);
  border: 1px solid var(--hair);
  border-radius: 6px;
}
.clock-field-unit { color: var(--ink-4); }
@media (max-width: 560px) {
  .clock-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.wait-clock { text-align: center; margin: 0 0 4px; }

/* A clock on every person's card, in the name's row ahead of the points.
   Tabular, so the digits do not shuffle sideways as they count down. */
.blitz-clock {
  flex: none;
  margin-left: auto;
  padding: 1px 6px;
  border-radius: 5px;
  font-size: var(--fs-n3);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--ink-3);
  background: var(--sheet-soft);
  border: 1px solid var(--hair);
}
.blitz-clock + .taunt-open, .taunt-open + .blitz-clock { margin-left: 0; }
.blitz-clock.is-running { color: var(--ink); border-color: var(--sc-line, var(--ink-3)); background: var(--sheet-strong); }
.blitz-clock.is-low { color: var(--robber-lit); }
.blitz-clock.is-low.is-running { animation: blitz-low 1s ease-in-out infinite; }
.blitz-clock.is-out { color: var(--robber-lit); border-color: var(--robber-line); border-style: dashed; }
@keyframes blitz-low {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 3px var(--robber-line); }
}
@media (prefers-reduced-motion: reduce) {
  .blitz-clock.is-low.is-running { animation: none; }
}

/* Your own, larger, beside whose move it is. */
#turnstrip .blitz-clock.is-mine {
  margin-left: 10px;
  font-size: var(--fs-n1);
  padding: 2px 8px;
}

/* ============================================================ your color */

/* The square beside the button that starts a game, and the colors that
   button turns into (swatch.js). The two share one cell of a grid, so the
   colors open exactly where the button was and the row never changes size. */
#lobby .swatch-row {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 8px;
  max-width: 100%;
}

#lobby .swatch-row .swatch-btn {
  flex: none;
  align-self: stretch;
  width: 44px;            /* made the button's height by swatch.js */
  min-width: 34px;
  min-height: 0;
  padding: 0;
  border-radius: var(--radius-sm, 6px);
  /* A real outline, not a hairline: at one pixel on a dark ground it all
     but vanished, and came and went as the page scaled. */
  border: 1.5px solid rgba(244, 241, 232, 0.32);
  background: var(--sheet-soft, rgba(255, 255, 255, 0.06));
  display: grid;
  place-items: center;
}
#lobby .swatch-row .swatch-btn { position: relative; }
#lobby .swatch-row .swatch-btn .swatch-dot {
  position: absolute;
  inset: 5px;
  display: block;
  border-radius: 4px;
  background: var(--sw);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.35);
  transition: background 200ms ease, transform 200ms ease;
}
#lobby .swatch-row .swatch-btn:hover .swatch-dot { transform: scale(1.08); }
#lobby .swatch-row.is-picking .swatch-btn { border-color: var(--gold); }

#lobby .swatch-stage {
  position: relative;
  display: grid;
  min-width: 0;
}
#lobby .swatch-stage > * { grid-area: 1 / 1; }
#lobby .swatch-stage > :first-child {
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1);
}
#lobby .swatch-row.is-picking .swatch-stage > :first-child {
  opacity: 0;
  pointer-events: none;
}

/* The colors, folded away to the left edge until asked for and unfolding
   across the button's own outline. */
#lobby .swatch-strip {
  /* Over the button rather than beside it in the layout: the button keeps
     its own size and shape, and the colors, two rows of seven, may stand a
     little proud of it above and below. */
  /* Placed on a whole pixel by swatch.js. Centered with a -50% transform
     it landed on a half pixel whenever its height was odd, and every chip
     in it was drawn smeared across two rows of pixels. */
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  min-height: 100%;
  z-index: 2;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: repeat(7, 22px);
  align-content: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  border-radius: var(--radius-sm, 6px);
  border: 1.5px solid var(--gold, #f5c542);
  background: var(--sheet-solid, #071e2e);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  /* Unfolded by a clip that stops short of the right edge and opens past
     every edge, so it never trims the outline or the shadow on the way. */
  clip-path: inset(-12px 100% -24px -12px);
  opacity: 0;
  pointer-events: none;
  transition: clip-path 320ms cubic-bezier(0.22, 0.61, 0.36, 1), opacity 160ms ease;
}
#lobby .swatch-row.is-picking .swatch-strip {
  clip-path: inset(-12px -12px -24px -12px);
  opacity: 1;
  pointer-events: auto;
}

#lobby .swatch-row .swatch-chip {
  flex: none;
  width: 22px;
  height: 22px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border-radius: 5px;
  border: 0;
  background: var(--sw);
  /* The edge drawn inside the chip, where it cannot be lost to rounding
     between two of them: dark against the light colors, light against
     the dark ground. */
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.16);
  /* Faded in, one after another, without moving: a chip in motion is
     redrawn off the pixel grid, and fourteen of them moving at once read
     as a blur. */
  opacity: 0;
  transition: opacity 200ms ease;
  transition-delay: calc(var(--i, 0) * 14ms);
}
#lobby .swatch-row.is-picking .swatch-chip { opacity: 1; }
#lobby .swatch-row .swatch-chip:hover:not(.is-taken) { filter: brightness(1.12); }
#lobby .swatch-row .swatch-chip.is-on {
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.35), 0 0 0 2px var(--sheet-solid, #071e2e), 0 0 0 4px var(--ink);
}

/* Somebody else is wearing it: the robber's stripes, as on a number he is
   sitting on in the expected yield, with the color still showing between. */
#lobby .swatch-row .swatch-chip.is-taken {
  background:
    repeating-linear-gradient(135deg, var(--robber, #e0413a) 0 2px, rgba(0, 0, 0, 0.72) 2px 4.5px),
    var(--sw);
  cursor: not-allowed;
}
#lobby .swatch-row .swatch-chip.is-refused { animation: swatch-no 320ms ease; }
@keyframes swatch-no {
  20%, 60% { transform: translateX(-3px); }
  40%, 80% { transform: translateX(3px); }
}

/* "Sorry", under the row, gone again on its own. */
#lobby .swatch-row::after {
  content: attr(data-says);
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  text-align: center;
  font-size: var(--fs-n3);
  color: var(--robber, #e0413a);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}
#lobby .swatch-row.is-saying::after { opacity: 1; }

/* Under a screen's own buttons the square hangs off the left of the button
   rather than standing in the row, so the button stays centered exactly
   where it always was, in line with any button under it. Only the accented
   button wears one; the other's square, and a hidden button's row, go. */
#lobby .screen-do .swatch-row { position: relative; }
#lobby .screen-do .swatch-row .swatch-btn {
  position: absolute;
  top: 0;
  bottom: 0;
  right: calc(100% + 8px);
}
#lobby .screen-do .swatch-row:has(.swatch-stage > button:not(.primary)) .swatch-btn { display: none; }
#lobby .screen-do .swatch-row:has(.swatch-stage > [hidden]) { display: none; }

/* In the room the host's button keeps its column's width with the square
   beside it, rather than growing past it. */
#lobby .net-side .swatch-row { width: 100%; }
#lobby .net-side .swatch-stage { flex: 1 1 auto; }
/* Room under it for "sorry", rather than over the room code. */
#lobby .net-side .swatch-row,
#lobby .wait-room .swatch-row { transition: margin-bottom 200ms ease; }
#lobby .net-side .swatch-row.is-saying,
#lobby .wait-room .swatch-row.is-saying { margin-bottom: 1.6em; }
#lobby .wait-room .swatch-row { margin-top: var(--sp-1); }

@media (prefers-reduced-motion: reduce) {
  #lobby .swatch-stage > :first-child,
  #lobby .swatch-strip,
  #lobby .swatch-row .swatch-chip { transition: none; }
}

/* ================================================================ accounts */

/* Who you are, in the corner of the lobby (account-panel.js). Taken out of
   the lobby's grid, which has a row for the bar and a row for the sheet and
   none to spare. Left, because a phone's right corner is the hamburger's. */
#lobby .account {
  position: absolute;
  top: 8px;
  left: 12px;
  z-index: 101;
}

#lobby .account-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 0;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--hair-strong);
  background: rgba(7, 30, 46, 0.72);
  color: var(--ink-2);
  font-size: var(--fs-n2);
  font-weight: 600;
}

#lobby .account-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--hair-strong);
  box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.35);
}

#lobby .account-chip.is-claimed { color: var(--ink); }

#lobby .account-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 240px;
  padding: 6px;
  display: grid;
  gap: 2px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-md);
  background: var(--sheet-solid);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

#lobby .account-menu[hidden] { display: none; }

#lobby .account-who {
  margin: 4px 10px 6px;
  font-size: var(--fs-n3);
  color: var(--ink-3);
}

#lobby .account-item {
  display: grid;
  justify-items: start;
  gap: 2px;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  text-align: left;
  color: var(--ink);
}

@media (hover: hover) {
  #lobby .account-item:hover { background: rgba(244, 241, 232, 0.07); transform: none; }
}

#lobby .account-item-note { font-size: var(--fs-n3); font-weight: 400; color: var(--ink-3); }
#lobby .account-item.is-quiet { color: var(--ink-2); }
#lobby .account-item.is-danger { color: #ff8a7a; }
#lobby .account-item.is-danger.is-armed { background: rgba(255, 74, 58, 0.16); }

/* The dialog: a name, or how a sign-in went. Its own small card, centred,
   over whatever is on screen — the lobby, or a game that has just ended. */
.account-dialog {
  width: min(400px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-md);
  background: var(--sheet-solid);
  color: var(--ink);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

.account-dialog::backdrop { background: rgba(3, 12, 20, 0.6); }

.account-dialog-card {
  display: grid;
  gap: var(--sp-2);
  padding: var(--sp-4);
  margin: 0;
}

.account-dialog h2 {
  margin: 0;
  font-size: var(--fs-2);
  font-weight: 700;
}

.account-dialog-text {
  margin: 0;
  font-size: var(--fs-n1);
  line-height: 1.5;
  color: var(--ink-2);
}

.account-name { display: grid; gap: 6px; }
.account-name[hidden] { display: none; }

.account-name label {
  font-size: var(--fs-n2);
  font-weight: 600;
  color: var(--ink-2);
}

.account-name input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.26);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* under 16px, iOS zooms the page to type */
}

.account-name input:focus { outline: 2px solid rgba(245, 197, 66, 0.55); outline-offset: 1px; }

.account-name-say {
  margin: 0;
  min-height: 1.4em;
  font-size: var(--fs-n2);
  color: var(--ink-3);
}

.account-name-say.is-good { color: #8fdc8f; }
.account-name-say.is-bad { color: #ff8a7a; }

/* The ways in: a button per provider, then an email and its code. */
.account-ways { display: grid; gap: 8px; }
.account-ways[hidden] { display: none; }

.account-way {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.account-way:hover:not(:disabled) { background: rgba(255, 255, 255, 0.11); }
.account-way:disabled { opacity: 0.55; cursor: default; }
.account-way.is-discord { background: #5865f2; border-color: #5865f2; color: #fff; }
.account-way.is-discord:hover:not(:disabled) { background: #4752c4; }
.account-way.is-email { width: auto; white-space: nowrap; }

.account-or {
  margin: 2px 0;
  text-align: center;
  font-size: var(--fs-n2);
  color: var(--ink-3);
}

.account-field-label {
  font-size: var(--fs-n2);
  font-weight: 600;
  color: var(--ink-2);
}

.account-field-row { display: flex; gap: 8px; min-width: 0; }

.account-ways input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.26);
  color: var(--ink);
  font: inherit;
  font-size: 16px;   /* under 16px, iOS zooms the page to type */
}

.account-ways input:focus { outline: 2px solid rgba(245, 197, 66, 0.55); outline-offset: 1px; }
.account-ways input.account-code { letter-spacing: 0.3em; font-variant-numeric: tabular-nums; }

.account-ways-say {
  margin: 0;
  min-height: 1.4em;
  font-size: var(--fs-n2);
  color: var(--ink-3);
}

.account-ways-say.is-bad { color: #ff8a7a; }
.account-ways .linky { justify-self: start; }

.account-dialog-do {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.account-dialog-do button {
  padding: 9px 16px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: rgba(244, 241, 232, 0.06);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-n1);
  font-weight: 600;
  cursor: pointer;
}

.account-dialog-do button.primary {
  border-color: var(--gold);
  background: var(--gold);
  color: #1a1206;
  font-weight: 700;
}

.account-dialog-do button:disabled { opacity: 0.6; cursor: default; }

/* ============================================================ leaderboards */

#lobby .door-do .door-boards { color: var(--ink-2); }

/* The lobby's line, once it has a board to open. */
#lobby .board-note.is-link { cursor: pointer; }
@media (hover: hover) {
  #lobby .board-note.is-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
}
#lobby .board-note:focus-visible { outline: 2px solid rgba(245, 197, 66, 0.55); outline-offset: 2px; border-radius: 2px; }

#lobby .boards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
  width: min(560px, 100%);
  min-width: 0;
  margin: 0 auto;
  justify-items: center;
}

#lobby #screen-boards { min-width: 0; max-width: min(560px, 100%); }

/* Which board: the lobby's settings card (.settings), a label down one edge
   and a row of pills beside each. The rules wrap rather than run off a
   phone. */
/* The big island's red, said wherever "Mega" is (the lobby's .settings). */
#lobby #screen-boards { --mega: #FF4A3A; }

#lobby .boards-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--sp-0);
  width: 100%;
}
#lobby .boards-bar .island-opts { flex-wrap: nowrap; min-width: 0; }

/* The game and the view: rounded rectangles (the design system's 4px for
   chips and segmented controls), the chosen one lit in gold. */
#lobby .boards-bar .island-opt {
  width: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 4px 11px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.22);
  color: var(--ink-2);
  font: inherit;
  font-size: var(--fs-n2);
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.3;
  white-space: nowrap;
  cursor: pointer;
}
#lobby .boards-bar .island-opt { padding: 5px 13px; }
#lobby .boards-bar .island-opt[aria-pressed="true"] {
  background: var(--gold-soft, rgba(245, 197, 66, 0.16));
  border-color: var(--gold);
  color: var(--ink);
}
@media (hover: hover) {
  #lobby .boards-bar .island-opt:hover { border-color: var(--ink-3); color: var(--ink); }
}

/* The board's choices: a quiet label down one edge and a row of options
   beside it, each row one line where it fits and wrapping where not. */
#lobby .boards-filters { width: 100%; }
#lobby .boards-choices { display: grid; gap: 7px; width: 100%; }
#lobby .boards-field { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px; }
#lobby .boards-field[hidden] { display: none; }
#lobby .boards-label {
  font-size: var(--fs-n3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  text-align: right;
}
#lobby .boards-opts { display: flex; flex-wrap: wrap; gap: 5px; min-width: 0; }

/* Which board this is, over the list. */
#lobby .boards-head { display: grid; gap: 4px; width: 100%; text-align: center; }
#lobby .boards-title { margin: 0; font-size: var(--fs-1); font-weight: 700; color: var(--ink); }

#lobby .boards-blurb {
  margin: 2px auto 0;
  max-width: 46ch;
  font-size: var(--fs-n2);
  line-height: 1.45;
  color: var(--ink-3);
}

#lobby .boards-blurb[hidden] { display: none; }

/* A go at the board on show: its table set up on the screen it is dealt
   from (lobby.js playBoard), with Play the next press. */
#lobby .boards-play { justify-self: center; width: auto; margin-top: var(--sp-0); padding-inline: var(--sp-4); }
#lobby .boards-play[hidden] { display: none; }

#lobby .boards-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  border-top: 1px solid var(--hair);
}

#lobby .boards-row {
  display: grid;
  grid-template-columns: 3.2em 12px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-bottom: 1px solid var(--hair);
  font-size: var(--fs-n1);
}

#lobby .boards-row.is-me { background: rgba(245, 197, 66, 0.08); }
#lobby .boards-rank { color: var(--ink-3); font-variant-numeric: tabular-nums; }
#lobby .boards-swatch { width: 12px; height: 12px; border-radius: 3px; box-shadow: inset 0 0 0 1.5px rgba(0, 0, 0, 0.35); }
#lobby .boards-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; text-align: left; }
#lobby .boards-rank { text-align: left; }
#lobby .boards-score { text-align: right; }
#lobby .boards-score { font-variant-numeric: tabular-nums; font-weight: 700; }
#lobby .boards-when { color: var(--ink-4); font-size: var(--fs-n3); min-width: 5.5em; text-align: right; }

/* The list's headings: the row's own columns, small and quiet. */
#lobby .boards-cols {
  padding-top: 6px;
  padding-bottom: 6px;
  font-size: var(--fs-n3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
#lobby .boards-cols .boards-name,
#lobby .boards-cols .boards-score { font-weight: 600; }
#lobby .boards-cols .boards-when { color: var(--ink-3); }

#lobby .boards-empty,
#lobby .boards-gap {
  padding: 14px 6px;
  text-align: center;
  color: var(--ink-3);
  font-size: var(--fs-n1);
  border-bottom: 1px solid var(--hair);
}

#lobby .boards-gap { padding: 2px; border-bottom: 0; }

#lobby .boards-note {
  margin: 0;
  min-height: 1.5em;
  text-align: center;
  font-size: var(--fs-n2);
  color: var(--ink-3);
}

#lobby .boards-note .linky { font-size: var(--fs-n2); color: var(--gold); }

/* The tree: every board's first place at once (board-tree-view.js). It
   takes the screen's width, and the board-picking rows step aside. */
#lobby #screen-boards.is-tree { width: 100%; max-width: min(1180px, 100%); }
#lobby #screen-boards.is-tree .boards { width: 100%; }
#lobby .boards-tree { width: 100%; display: grid; gap: var(--sp-0); }
#lobby .bt-frame {
  position: relative;
  width: 100%;
  height: clamp(360px, calc(100vh - 300px), 760px);
  overflow: hidden;
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  background:
    radial-gradient(circle at 50% 50%, rgba(245, 197, 66, 0.07), transparent 60%),
    rgba(0, 0, 0, 0.18);
}
#lobby .bt-svg {
  display: block;
  width: 100%;
  height: 100%;
  font-family: inherit;
  touch-action: none;
  user-select: none;
  cursor: grab;
}
#lobby .bt-svg:active { cursor: grabbing; }
#lobby .bt-link { fill: none; stroke: var(--hair-strong); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
#lobby .bt-link.depth-0 { stroke: rgba(245, 197, 66, 0.45); stroke-width: 2; }
#lobby .bt-node { cursor: pointer; outline: none; }
/* Words over lines: each letter has a rim of the sheet's own colour. */
#lobby .bt-node text {
  paint-order: stroke;
  stroke: var(--sheet-solid);
  stroke-width: 3.5px;
  stroke-linejoin: round;
}
#lobby .bt-who { font-size: 13px; font-weight: 700; fill: var(--ink); }
#lobby .bt-what { font-size: 10.5px; fill: var(--ink-2); }
#lobby .bt-score { font-size: 10.5px; fill: var(--ink-3); font-variant-numeric: tabular-nums; }
#lobby .bt-leaf .bt-dot { stroke: rgba(0, 0, 0, 0.45); stroke-width: 1.5; }
#lobby .bt-mine { fill: none; stroke: var(--gold); stroke-width: 2; }
#lobby .bt-leaf.is-me .bt-who { fill: var(--gold); }
#lobby .bt-branch .bt-dot { fill: var(--sheet-solid); stroke: var(--hair-strong); stroke-width: 1.5; }
#lobby .bt-branch.depth-1 .bt-dot { stroke: var(--gold); }
#lobby .bt-branch.is-folded .bt-dot { fill: rgba(245, 197, 66, 0.12); stroke: var(--gold); stroke-dasharray: 3 2; }
#lobby .bt-label { font-size: 11px; fill: var(--ink-2); }
#lobby .bt-label.is-game { font-size: 13px; font-weight: 700; fill: var(--gold); letter-spacing: 0.02em; }
/* "Mega" in the big island's red wherever the tree says it, and its branch
   ringed in it. */
#lobby .bt-mega { fill: var(--mega); font-weight: 700; }
#lobby .bt-branch.is-mega .bt-dot { stroke: var(--mega); }
#lobby .bt-branch.is-mega .bt-label { font-size: 12px; }
#lobby .bt-root .bt-dot { fill: rgba(245, 197, 66, 0.16); stroke: var(--gold); stroke-width: 2; }
#lobby .bt-root .bt-root-count { font-size: 15px; font-weight: 700; fill: var(--ink); stroke-width: 0; }
#lobby .bt-root .bt-root-unit { font-size: 8px; fill: var(--ink-2); stroke-width: 0; letter-spacing: 0.04em; }
#lobby .bt-node:focus-visible .bt-dot { stroke: var(--gold); stroke-width: 3; }
@media (hover: hover) {
  #lobby .bt-node:hover .bt-dot { stroke: var(--ink); }
  #lobby .bt-leaf:hover .bt-who { text-decoration: underline; }
}
#lobby .bt-tools { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
#lobby .bt-tool {
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
#lobby .bt-tool:focus-visible { outline: 2px solid rgba(245, 197, 66, 0.55); outline-offset: 2px; }
#lobby .bt-note { margin: 0; text-align: center; font-size: var(--fs-n2); color: var(--ink-3); }

/* ----------------------------------------------------------- daily catanle */

/* The day's screen (daily-screen.js): the puzzle at the top, one press,
   and once the day is played, the score, the curve and the ranking. */
#screen-daily { max-width: 520px; }

#lobby .daily {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
}

#lobby .daily-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding-bottom: var(--sp-1);
  border-bottom: 1px solid var(--hair);
}

#lobby .daily-number {
  margin: 0;
  font-size: var(--fs-n3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}

#lobby .daily-title {
  margin: 0;
  font-size: var(--fs-1);
  font-weight: 700;
  color: var(--ink);
}

#lobby .daily-brief {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-1);
  width: 100%;
  max-width: 44ch;
  margin-top: var(--sp-n1);
}

/* A day's puzzle laid out (daily-card.js), on the daily screen and on the
   card its game opens on: how it is played as bullets, and a rule set's
   changes as chips. Rounded rectangles at the small radius, the pills' shape
   without their press, since a chip is something to read and not a button. */
.dc-rules {
  margin: 0;
  padding: 0 0 0 1.1em;
  font-size: var(--fs-n1);
  line-height: 1.5;
  color: var(--ink-2);
  text-align: left;
  align-self: stretch;
}
.dc-rules li { margin: 0 0 3px; }
.dc-rules li::marker { color: var(--gold); }

.dc-mods {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: stretch;
  text-align: left;
}
.dc-mods-name {
  margin: 0;
  font-size: var(--fs-n3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.dc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.dc-chip {
  padding: 3px 9px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-sm);
  background: rgba(244, 241, 232, 0.05);
  font-size: var(--fs-n2);
  line-height: 1.45;
  color: var(--ink);
}

/* On the game's opening card the layout sits under the line about everyone
   getting the same dice. */
#modal-body .dc-rules { margin-bottom: var(--sp-1); }

#lobby .daily-result {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

#lobby .daily-score {
  margin: 0;
  font-size: var(--fs-3);
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

#lobby .daily-standing {
  margin: 0;
  font-size: var(--fs-n1);
  color: var(--ink-2);
  text-align: center;
}

#lobby .daily-curve {
  display: block;
  width: 100%;
  height: 110px;
  margin-top: 4px;
  overflow: visible;
}

#lobby .daily-curve .curve-base { stroke: var(--hair-strong); stroke-width: 1; }
#lobby .daily-curve .curve-bar { fill: rgba(244, 241, 232, 0.14); }
#lobby .daily-curve .curve-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; stroke-linejoin: round; }
#lobby .daily-curve .curve-dot { fill: var(--ink-2); }
#lobby .daily-curve .curve-me { stroke: var(--gold); stroke-width: 1.5; stroke-dasharray: 3 3; }
#lobby .daily-curve .curve-me-label { fill: var(--gold); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
#lobby .daily-curve .curve-end { fill: var(--ink-4); font-size: 9px; letter-spacing: 0.06em; }

#lobby .daily-curve-note {
  margin: 0;
  font-size: var(--fs-n3);
  color: var(--ink-3);
}

#lobby .daily-actions { display: flex; gap: 8px; margin: 4px 0 var(--sp-1); }

#lobby .daily-top { max-width: 460px; }
#lobby .daily-top .boards-row { grid-template-columns: 3.2em 12px minmax(0, 1fr) auto; }

#lobby .daily-streak,
#lobby .daily-next {
  margin: 0;
  font-size: var(--fs-n2);
  color: var(--ink-3);
  text-align: center;
}

@media (max-width: 820px) {
  /* Six on the door now, three rows of two; the boards no longer need a
     row to themselves. */
  #lobby .door-do .door-boards { grid-column: auto; }
  #lobby .boards-row { grid-template-columns: 2.6em 10px minmax(0, 1fr) auto; }
  #lobby .boards-when { display: none; }
}

/* ------------------------------------------------------------ Escape's menu
 * (pause.js): the game dimmed and softened behind, and a small frosted card
 * with a short list on it. Sentence case and no borders, unlike the game's
 * own buttons, so it reads as being above the game rather than part of it. */
.pause-menu {
  width: min(280px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);   /* the panels' corner */
  background: rgba(7, 30, 46, 0.93);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 24px 60px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  animation: pause-in 140ms ease-out;
}

.pause-menu::backdrop {
  background: rgba(2, 10, 16, 0.5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

@keyframes pause-in {
  from { opacity: 0; transform: translateY(6px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pause-menu { animation: none; }
}

.pause-card {
  display: grid;
  gap: 10px;
  padding: 16px 12px 12px;
}

/* Ruled off from the choices with the panels' own hairline. */
.pause-head {
  display: grid;
  gap: 3px;
  margin: 0 4px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--hair);
}

.pause-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0;
}

.pause-say {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-3);
}

.pause-do { display: grid; gap: 2px; }

.pause-do button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  text-align: left;
  cursor: pointer;
}

.pause-do button:hover,
.pause-do button:focus-visible { background: rgba(255, 255, 255, 0.07); outline: none; }

.pause-do button.primary {
  margin-bottom: 6px;
  background: var(--gold);
  color: #1b1404;
  font-weight: 600;
}

.pause-do button.primary:hover,
.pause-do button.primary:focus-visible { background: var(--gold); filter: brightness(1.07); }

.pause-key {
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.14);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  opacity: 0.75;
}

/* The ways out of a game on a narrow screen (stats-drawer.js): two quiet
 * buttons side by side as the last row of the stats drawer, found when
 * looked for and not hit by a thumb that is playing. Wide screens have
 * Escape and no drawer. */
#drawer-exit { display: none; }

@media (max-width: 1100px) {
  #drawer-exit {
    display: flex;
    flex: none;
    gap: var(--sp-1);
    margin-top: var(--sp-1);
  }

  #drawer-exit button {
    display: block;   /* not the buttons' inline-flex, so a long name ellipses */
    flex: 1 1 0;
    min-width: 0;
    padding: 11px 12px;
    border: 1px solid var(--hair);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.04);
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* The way back names a mode, so it gets the room. */
  #drawer-exit [data-leave="mode"] { flex-grow: 1.7; }
}

/* No Escape key on a touchscreen, so no hint for one. */
@media (hover: none) and (pointer: coarse) {
  .pause-key { display: none; }
}

/* ------------------------------------------------------------ on a home
 * screen (install.js): a small card along the bottom of the front page,
 * in the panels' look, sliding up once and out of the way of the buttons. */
.install-card {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 60;
  width: min(420px, calc(100vw - 24px));
  padding: 12px 12px 12px 14px;
  border: 1px solid var(--hair-strong);
  border-radius: var(--radius-md);
  background: rgba(7, 30, 46, 0.96);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  color: var(--ink);
  transform: translate(-50%, 140%);
  transition: transform 220ms ease-out;
}

.install-card.is-in { transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .install-card { transition: none; }
}

.install-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.install-app {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 9px;
}

.install-words { display: grid; gap: 2px; flex: 1; min-width: 0; }
.install-title { font-size: 15px; font-weight: 600; }
.install-why { font-size: 13px; line-height: 1.4; color: var(--ink-2); }

.install-x {
  flex: none;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  margin: -4px -4px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-3);
  font-size: 20px;
  letter-spacing: 0;
}

.install-steps {
  margin: 10px 0 0;
  padding: 10px 0 0 22px;
  border-top: 1px solid var(--hair);
  display: grid;
  gap: 6px;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink);
}

.install-steps li::marker { color: var(--ink-3); font-weight: 600; }

.install-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  margin: 0 2px;
  padding: 0 3px;
  vertical-align: -6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--gold);
}

.install-glyph { font-size: 15px; font-weight: 700; line-height: 1; }

.install-do {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--hair);
}

.install-do button { padding: 9px 16px; }

/* ---------------------------------------------------------------- dropdowns
   dropdown.js: a button that says the choice and a list in the lobby's own
   sheet, styled all the way down. 4px controls, an 8px panel. */
#lobby .boards-bar { width: min(560px, 100%); margin: 0 auto; }
#lobby .boards-modes.is-away { visibility: hidden; }
#lobby .boards-choices { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 10px; }
#lobby .boards-field { display: grid; grid-template-columns: none; gap: 3px; flex: 1 1 120px; max-width: 220px; }
#lobby .boards-label { text-align: left; padding-left: 2px; }
#lobby .boards-opts { display: block; }
#lobby .dd { position: relative; min-width: 0; }
#lobby .dd-button {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; min-width: 0; min-height: 0; margin: 0; padding: 6px 10px;
  border: 1px solid var(--hair-strong); border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.26); color: var(--ink);
  font: inherit; font-size: var(--fs-n2); font-weight: 600; text-align: left; cursor: pointer;
}
#lobby .dd-value { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#lobby .dd-value.is-mega, #lobby .dd-option.is-mega { color: var(--mega); font-weight: 700; }
#lobby .dd-chevron {
  flex: none; width: 7px; height: 7px; margin-top: -3px;
  border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg);
}
#lobby .dd.is-open .dd-button { border-color: var(--gold); }
#lobby .dd.is-open .dd-chevron { transform: rotate(-135deg); margin-top: 3px; }
#lobby .dd.is-single .dd-chevron { display: none; }
#lobby .dd-button:disabled { cursor: default; opacity: 1; color: var(--ink-2); }
@media (hover: hover) { #lobby .dd-button:not(:disabled):hover { border-color: var(--ink-3); } }
#lobby .dd-button:focus-visible { outline: 2px solid rgba(245, 197, 66, 0.55); outline-offset: 2px; }
#lobby .dd-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0;
  min-width: 100%; max-width: calc(100vw - 32px); max-height: 280px; overflow: auto; margin: 0; padding: 4px;
  list-style: none; text-align: left;
  background: var(--sheet-solid); border: 1px solid var(--hair-strong); border-radius: var(--radius-md);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45); outline: none;
}
#lobby .dd.opens-up .dd-list { top: auto; bottom: calc(100% + 4px); }
#lobby .dd-option {
  padding: 6px 10px; border-radius: var(--radius-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-size: var(--fs-n2); color: var(--ink-2); cursor: pointer;
}
#lobby .dd-option.is-active { background: rgba(244, 241, 232, 0.08); color: var(--ink); }
#lobby .dd-option[aria-selected="true"] { color: var(--gold); font-weight: 700; }
#lobby .dd-option.has-divider { margin-bottom: 4px; border-bottom: 1px solid var(--hair); border-radius: var(--radius-sm) var(--radius-sm) 0 0; }

/* ---------------------------------------------------------- public rooms */

/* Who a room is for, and whether it may be watched: two rows of the same
   pills the island is chosen with, over the button that opens the room. */
#lobby .net-side .room-pick { width: 100%; justify-content: space-between; }
#lobby .net-side .room-pick .island-opt { width: auto; }

/* Everybody's public rooms (rooms.js), under the two columns. A row says
   whose it is, what the table is and how full, and offers a seat or a
   place to watch. */
#lobby .rooms {
  display: grid;
  gap: var(--sp-0);
  width: 100%;
  margin-top: var(--sp-3);
  padding-top: var(--sp-2);
  border-top: 1px solid var(--hair);
}
#lobby .rooms-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-1); }
#lobby .rooms-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
#lobby .rooms-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-1);
  padding: 8px 10px;
  border: 1px solid var(--hair);
  border-radius: var(--radius-md);
  background: rgba(244, 241, 232, 0.03);
}
#lobby .rooms-row.is-mine { border-color: var(--gold); }
#lobby .rooms-says { display: grid; gap: 1px; min-width: 0; text-align: left; }
#lobby .rooms-name { font-size: var(--fs-n1); font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
#lobby .rooms-table,
#lobby .rooms-state { font-size: var(--fs-n2); color: var(--ink-2); }
#lobby .rooms-state { color: var(--ink-3); }
#lobby .rooms-mega { color: var(--mega, #ff6b5e); font-weight: 700; }
#lobby .rooms-does { display: flex; gap: 6px; flex: 0 0 auto; }
#lobby .rooms-go { width: auto; min-width: 0; min-height: 0; padding: 6px 14px; font-size: var(--fs-n2); }
#lobby .rooms-empty { font-size: var(--fs-n2); color: var(--ink-3); text-align: center; padding: var(--sp-1) 0; }

/* Watching a game from outside it (main.js): there is no hand, no numbers,
   no box of pieces and no score of your own, so the strip is the line that
   says whose turn it is and the way out. */
body.is-spectating #dock-hand,
body.is-spectating #dock-numbers,
body.is-spectating #dock-box,
body.is-spectating #dock-you { display: none; }
body.is-spectating #dock { grid-template-columns: minmax(min-content, auto); }
/* The strip says it is not their turn, as it does for anybody waiting, and
   the one button on it is still theirs to press. */
body.is-spectating #dock.is-watching .actions { opacity: 1; pointer-events: auto; }
