/* Get In Line's table: the board, the teams, your hand and the dock, on the
   room's structure (games/room/room.css) and the card faces
   (games/cards/cards.css), from the tokens in get-in-line.css.

   Steadiness first: the board is the biggest square the window allows and
   never changes size; the hand and the dock never change size; everything
   that comes and goes (lit spaces, rings, banners) is drawn over what's
   there, so nothing you might be about to tap moves. */

/* ── the frame ───────────────────────────────────────────────────────── */
.felt.gil { position: relative; height: calc(100dvh - 2 * var(--frame)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.felt.gil.docked { grid-template-columns: minmax(0, 1fr) 320px; }
.gil .tablemain { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.gil .logdock { min-height: 0; display: flex; flex-direction: column; }
.gil .logdock:empty { display: none; }
.gil .logdock .gamelog { flex: 1; }
.gil .gamelog.drawer {
  position: absolute; z-index: 30; right: 14px; top: 64px; bottom: 230px; width: min(340px, calc(100% - 28px));
  box-shadow: -10px 10px 30px rgba(0, 0, 0, .35);
}
.gil .logbtn.on { background: var(--pick-tint); box-shadow: var(--pick-ring); }
.gil .bar .tools .stop.unseen { visibility: hidden; }
.gil .dock > .watchbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: var(--t-note); }

/* The stage: the board beside the rest on a wide (or sideways) window,
   above it on a tall one. */
.gil .stagebox { flex: 1; min-height: 0; min-width: 0; container-type: size; }
.gil .stage {
  --sidew: clamp(320px, 34vw, 470px);
  height: 100%; display: grid; gap: 16px;
  /* (the board as big as the height allows, the side beside it, the pair centered) */
  grid-template-columns: min(100cqh, calc(100cqw - var(--sidew) - 16px)) var(--sidew); justify-content: center;
}
.gil .side { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.gil .side .teams { flex: 0 1 auto; min-height: 0; overflow: auto; scrollbar-width: thin; }
.gil .side .handwrap { margin-top: auto; }
/* the log, beside the board on a computer: between the teams and your hand */
.gil .sidelog { flex: 1 1 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
.gil .sidelog:empty { display: none; }
.gil .sidelog .gamelog { flex: 1; min-height: 0; }
.gil .sidelog :is(.logpin, .logclose) { display: none; }
.felt.gil.sidelogged .bar .logbtn { display: none; }
@media (max-aspect-ratio: 6/5) {
  .gil .stage { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; gap: 8px; }
  .gil .side { display: contents; }
  .gil .side .teams { order: -1; overflow: visible; }
  .gil .side .handwrap { margin-top: 0; }
}

/* ── the board: walnut, brass, blue baize, and a card on every space ── */
.gil .boardwrap { container-type: size; min-height: 0; min-width: 0; position: relative; }
/* (the board centered in its room; on a small phone the zoom strip has a column of its own beside it, and zoomed the board scrolls in the rest: zoom.js) */
.gil .boardwrap.hasstrip { --strip: 52px; }
.gil .boardscroll { position: absolute; inset: 0 var(--strip, 0px) 0 0; display: flex; }
.gil .boardwrap.zoomed .boardscroll { overflow: auto; scrollbar-width: thin; overscroll-behavior: contain; }
.gil .boardframe {
  --frame-pad: clamp(6px, 2.2cqmin, 16px);
  container-type: inline-size; position: relative; flex: none; margin: auto;
  width: calc(min(100cqw - var(--strip, 0px), 100cqh) * var(--zoom, 1)); aspect-ratio: 1; padding: var(--frame-pad); border-radius: clamp(8px, 2cqmin, 16px);
  background:
    repeating-linear-gradient(97deg, rgba(0, 0, 0, .07) 0 2px, transparent 2px 9px, rgba(255, 255, 255, .035) 9px 11px, transparent 11px 19px),
    linear-gradient(160deg, var(--walnut-hi), var(--walnut) 45%, var(--walnut-lo));
  box-shadow: 0 0 0 1.5px var(--brass-lo), inset 0 0 0 1.5px rgba(255, 255, 255, .08), 0 18px 40px rgba(0, 0, 0, .5), 0 2px 0 rgba(0, 0, 0, .4);
}
.gil .board {
  /* one space, as the board's width allows */
  --cell: calc((100cqi - 2 * var(--frame-pad)) / 10);
  position: relative; width: 100%; height: 100%; display: grid; grid-template-columns: repeat(10, 1fr); grid-template-rows: repeat(10, 1fr);
  border-radius: 6px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, var(--baize), var(--baize-lo));
  box-shadow: inset 0 0 0 1.5px var(--brass), inset 0 2px 10px rgba(0, 0, 0, .55);
}
.gil .brow { display: contents; }
.gil .sp {
  all: unset; box-sizing: border-box; position: relative; display: grid; place-items: center; min-width: 0; min-height: 0;
  cursor: pointer; border-radius: 4px; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.gil .sp:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; z-index: 3; }
/* the card on each space: the card room's face, scaled to the space */
.gil .sp .card {
  --cw: calc(var(--cell) * .66);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .45); transition: filter var(--m-quick), transform var(--m-quick);
  pointer-events: none;
}
.gil .sp .card .ix { font-size: max(12px, calc(var(--cw) * .31)); }
/* a free corner: a brass medallion */
.gil .sp.corner { cursor: default; }
.gil .free {
  width: calc(var(--cell) * .74); aspect-ratio: 1; border-radius: 50%; display: grid; place-content: center; justify-items: center;
  background: radial-gradient(circle at 35% 30%, #f3dc9a, var(--brass) 55%, var(--brass-lo)); color: #3a2a0c;
  box-shadow: 0 2px 4px rgba(0, 0, 0, .5), inset 0 0 0 1.5px rgba(58, 42, 12, .45);
}
.gil .free .star { font-size: calc(var(--cell) * .26); line-height: 1; }
/* (as large as the medallion holds it: 12px once a space is 75px) */
.gil .free .freeword { font: 800 calc(var(--cell) * .16)/1 var(--ui-font); letter-spacing: .08em; text-transform: uppercase; }
/* small spaces (a phone's board): the card is the whole space, its index in
   the middle and as large as the card holds its two lines, so a 28px space
   still reads (zoom reads the rest) */
@container (max-width: 470px) {
  .gil .sp .card { --cw: calc(var(--cell) * .84); height: calc(var(--cell) * .86); border-radius: 3px; display: grid; place-items: center; }
  .gil .sp .card .ix { position: static; font-size: calc(var(--cell) * .4); line-height: .92; letter-spacing: -.05em; }
  .gil .sp .card .ix i { font-size: .95em; }
  .gil .sp .card .pip { display: none; }
  .gil .free .freeword { display: none; }
  .gil .free .star { font-size: calc(var(--cell) * .5); }
}

/* chips: a team's on a space, its shadow on the card under it */
.gil .chipslot { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; z-index: 1; }
.gil .chipslot .chipart { width: 76%; height: 76%; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }
.chipart { display: block; overflow: visible; }
.chipfly { position: fixed; z-index: 40; pointer-events: none; width: var(--size, 40px); height: var(--size, 40px); }
.chipfly .chipart { width: 100%; height: 100%; filter: drop-shadow(0 6px 6px rgba(0, 0, 0, .45)); }
.chipslot.drop { animation: chipdrop var(--m-pop) cubic-bezier(.3, 1.4, .5, 1); }
@keyframes chipdrop { from { transform: scale(1.35); opacity: .3; } to { transform: none; opacity: 1; } }
.chipslot.cheer { animation: cheer 600ms ease-out; }
@keyframes cheer { 40% { transform: scale(1.22); } }

/* lines: drawn through their chips, over them, a little see-through */
.gil .linesvg { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; overflow: visible; }
.gil .line line { stroke-linecap: round; fill: none; }
.gil .line .edge { stroke: rgba(0, 0, 0, .55); stroke-width: 30; }
.gil .line .ink { stroke-width: 18; opacity: .85; }
.gil .line.drawing line { stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: drawline 600ms var(--ease-out) forwards; }
@keyframes drawline { to { stroke-dashoffset: 0; } }
.gil .line.winning .ink { opacity: 1; }
/* a chip in a line is locked: a brass ring round it */
.gil .sp.locked .chipart { outline: none; }
.gil .sp.locked .chipslot::after { content: ''; position: absolute; width: 82%; height: 82%; border-radius: 50%; box-shadow: 0 0 0 2px var(--brass); }

/* the picked card's spaces: lit; the rest of the board steps back */
.gil .board.picking .sp:not(.lit, .take, .chosen, .corner, .has) .card { filter: brightness(.62) saturate(.7); }
.gil .board.picking .sp:not(.lit, .take, .chosen) .chipart { opacity: .8; }
.gil .sp.lit::after, .gil .sp.take::after, .gil .sp.chosen::after, .gil .sp.deadspot::after, .gil .sp.last::after, .gil .sp.gone::after {
  content: ''; position: absolute; inset: 1px; border-radius: 6px; pointer-events: none; z-index: 3;
}
.gil .sp.lit::after { box-shadow: 0 0 0 3px var(--turn), 0 0 14px 2px color-mix(in srgb, var(--turn) 70%, transparent); animation: litglow 1.4s ease-in-out infinite alternate; }
.gil .sp.lit .card { transform: translateY(-1px); }
.gil .board.wild .sp.lit::after { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--turn) 70%, transparent); animation: none; }
.gil .board.wild .sp.lit .card { transform: none; }
@keyframes litglow { from { opacity: .75; } to { opacity: 1; } }
.gil .sp.take::after { border-radius: 50%; inset: 8%; box-shadow: 0 0 0 3px var(--bad), 0 0 12px var(--bad); animation: litglow 1.4s ease-in-out infinite alternate; }
.gil .sp.chosen::after { box-shadow: 0 0 0 4px var(--turn), 0 0 0 7px var(--turn-ink), 0 0 20px 4px var(--turn); animation: none; }
.gil .sp.chosen.take::after { border-radius: 50%; box-shadow: 0 0 0 4px var(--bad), 0 0 0 7px var(--turn-ink), 0 0 20px 4px var(--bad); }
.gil .sp.chosen { z-index: 4; }
/* a dead card's two spaces: both taken, crossed */
.gil .sp.deadspot::after { border: 2.5px dashed var(--bad); }
/* the last move: a quiet brass ring round the chip; a chip taken off
   leaves a dashed ghost in its team's color */
.gil .sp.last::after { inset: 6%; border-radius: 50%; box-shadow: 0 0 0 2.5px var(--turn), 0 0 10px 1px color-mix(in srgb, var(--turn) 60%, transparent); }
.gil .sp.gone::after { inset: 14%; border-radius: 50%; border: 3px dashed var(--gone, var(--soft)); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .5); }
/* the helper: a space that would finish a line, ringed in that team's color */
.gil .fin { position: absolute; inset: 0; pointer-events: none; z-index: 1; display: grid; place-items: center; }
.gil .fin i { grid-area: 1 / 1; width: 62%; height: 62%; border-radius: 50%; border: 3px dashed var(--fin); box-shadow: 0 0 0 1.5px rgba(0, 0, 0, .55), inset 0 0 0 1.5px rgba(0, 0, 0, .55); background: color-mix(in srgb, var(--fin) 22%, transparent); }
.gil .fin i + i { width: 40%; height: 40%; }
.gil .sp.won .chipart { filter: drop-shadow(0 0 6px var(--turn)) drop-shadow(0 2px 2px rgba(0, 0, 0, .55)); }

/* the zoom strip, in the room beside a small phone's board (zoom.js): + − Fit,
   each a finger wide, in the column beside the board */
.gil .glzoom { position: absolute; right: 0; top: 50%; transform: translateY(-50%); z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.gil .glzoom[hidden] { display: none; }
.gil .zoom-btn {
  min-width: 44px; min-height: 44px; padding: 0 6px; border-radius: 12px; font: 800 20px/1 var(--ui-font); cursor: pointer;
  background: var(--panel); color: var(--ink); border: var(--panel-edge); box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.gil .zoom-btn.zoom-fit { font-size: 14px; }
.gil .zoom-btn[disabled] { opacity: .45; cursor: default; }
.gil .zoom-btn:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.gil .zoom-btn[hidden] { display: none; }

/* ── the teams ───────────────────────────────────────────────────────── */
.gil .teams { display: grid; grid-template-columns: repeat(var(--teams, 2), minmax(0, 1fr)); gap: 8px; align-content: start; }
.gil .tpanel { min-width: 0; display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border-radius: var(--panel-radius); background: var(--panel); border: var(--panel-edge); }
.gil .tpanel.mine { background: color-mix(in srgb, var(--ink) 7%, var(--panel)); }
.gil .tpanel.up { border-color: var(--ink); }
.gil .thead { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tchip { flex: none; width: 26px; height: 26px; display: block; }
.tchip .chipart { width: 100%; height: 100%; }
.gil .tname { font: var(--display-weight) 18px/1.15 var(--display); }
.gil .tyou { font-size: 12px; font-weight: 700; color: var(--soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.gil .tlines { flex: none; margin-left: auto; }
.gil .mems { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.gil .mem { display: flex; align-items: center; gap: 7px; min-width: 0; min-height: 26px; padding: 1px 4px 1px 2px; border-radius: 99px; font-size: 15px; }
.gil .mem .mark { flex: none; width: 22px; height: 22px; display: block; border-radius: 50%; }
.gil .mem .mark > svg { display: block; width: 100%; height: 100%; overflow: visible; }
.gil .mem.turn { background: color-mix(in srgb, var(--turn) 16%, transparent); box-shadow: inset 0 0 0 2px var(--turn); }
.gil .mem.turn .mname { font-weight: 800; }
.gil .mem.away .mname { color: var(--soft); }
.gil .mname { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gil .mtag { flex: none; font: 700 12px/1.2 var(--ui-font); letter-spacing: .03em; color: var(--soft); padding: 2px 6px; border-radius: 99px; border: 1px solid currentColor; }

/* three teams beside the board: one to a row, the players after the name */
@media (min-aspect-ratio: 6/5) and (min-height: 521px) {
  .gil .teams[data-n="3"] { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .gil .teams[data-n="3"] .tpanel { flex-direction: row; align-items: center; gap: 4px 10px; padding: 6px 10px; }
  .gil .teams[data-n="3"] .thead { flex: none; width: 10.5em; }
  .gil .teams[data-n="3"] .mems { flex: 1; min-width: 0; flex-direction: row; flex-wrap: wrap; gap: 2px 8px; }
  /* twelve seats in three teams of four: two players across, the plain bot tags dropped */
  .gil .teams[data-n="3"][data-big] .mems { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 8px; }
  .gil .teams[data-n="3"][data-big] .mem .isbot { display: none; }
  .gil .teams[data-n="3"][data-big] .thead { width: auto; }
  .gil .teams[data-n="3"][data-big] .tyou { display: none; }
}

/* ── your hand ───────────────────────────────────────────────────────── */
.gil .handwrap { flex: none; min-width: 0; }
.gil .hand { padding: 22px 8px 8px; min-height: calc(var(--cw) * 1.4 + 32px); border-radius: 12px; transition: box-shadow var(--m-quick), background-color var(--m-quick); }
.felt.gil.mineturn .hand.active { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--turn) 75%, transparent); background-color: color-mix(in srgb, var(--turn) 8%, transparent); }
/* the helper's tags: a dead card, and what each jack does */
.card.deadc { filter: saturate(.55) brightness(.86); }
.card:is(.deadc, .wild, .takes)::after {
  position: absolute; left: 6%; bottom: 6%; padding: 1px 5px; border-radius: 99px; pointer-events: none;
  font: 800 max(9px, calc(var(--cw) * .15))/1.3 var(--ui-font); letter-spacing: .04em;
}
.card.deadc::after { content: 'DEAD'; background: var(--bad); color: var(--confirm-ink); }
.card.wild::after { content: 'WILD'; background: var(--suit-s); color: var(--card); }
.card.takes::after { content: 'TAKE'; background: var(--suit-h); color: var(--card); }
/* (a "New" tag and these share the card: the new one sits above it) */

/* ── the dock: what to do, and your moves, always the same size ──────── */
.gil .dock {
  flex: none; display: flex; flex-direction: column; gap: 8px; padding: 8px 10px 10px; container-type: inline-size;
  border-radius: 14px; background: var(--panel); border: 2px solid transparent; transition: border-color .2s, background-color .2s;
}
.gil .dock.yours { border-color: var(--turn); background: color-mix(in srgb, var(--turn) 9%, var(--panel)); }
.gil .status { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.gil .sayline { min-height: 2.9em; display: flex; align-items: flex-start; gap: 10px; }
.gil .say { margin: 0; font-size: var(--t-body); line-height: 1.45; min-width: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.gil .say b { color: var(--turn); }
.gil .controls { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.gil .toolrow { display: flex; gap: 14px; align-items: center; min-width: 0; min-height: var(--tool-h); }
.gil .tgroup { display: flex; align-items: center; gap: var(--s2, 8px); }
.gil .sortlabel { font-size: var(--t-note); }
/* three places for moves: trade in, the one that plays, pass; a hidden one keeps its place */
.gil .actions { display: grid; grid-template-columns: repeat(3, auto); gap: 8px; margin-left: auto; justify-content: end; min-height: var(--btn-h); }
.gil .act { min-width: 0; padding-inline: 12px; }
.gil .act .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gil .btn.slot.act.confirm, .gil .btn.slot.act.confirm.alt { background: var(--btn2); color: var(--btn2-ink); border: 2.5px solid var(--confirm, var(--bad)); }
@container (max-width: 420px) {
  .gil .controls { flex-direction: column; align-items: stretch; gap: 6px; }
  .gil .actions { margin-left: 0; display: flex; gap: 6px; }
  .gil .actions .btn.slot { flex: 1 1 auto; padding-inline: 8px; font-size: 15px; }
  .gil .actions .btn.slot.hide { display: none; }
}

/* ── banners: the house's, over the board ────────────────────────────── */
.house-banner .glbanner { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.house-banner .bchip { width: 46px; height: 46px; display: block; }
.house-banner .bchip .chipart { width: 100%; height: 100%; }
.house-banner .splashtitle { font: var(--display-weight) 40px/1.05 var(--display); color: var(--turn); text-align: center; }
.house-banner .splashsub { font: var(--t-note)/1.35 var(--ui-font); color: var(--ink); white-space: normal; max-width: 24em; text-align: center; }
.house-banner.gl-win { border: 3px solid var(--turn); }
.house-banner.gl-win .splashtitle { font-size: 52px; }
.house-banner.gl-win .bchip { width: 64px; height: 64px; }

/* ── the result sheet ────────────────────────────────────────────────── */
.house-scrim-result .house-sheet.gl-result { --house-sheet-width: 560px; }
.house-result .glresult { align-self: stretch; text-align: left; min-width: 0; }
.house-result .house-post:empty { display: none; }
.glemblem { width: 76px; height: 76px; margin: 0 auto; }
.glemblem .chipart { width: 100%; height: 100%; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .5)); }
.glresult .rteams { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); gap: 8px; }
.glresult .rteam { padding: 8px 10px; border-radius: 12px; border: var(--panel-edge); background: var(--panel); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.glresult .rteam.won { border-color: var(--turn); background: color-mix(in srgb, var(--turn) 10%, var(--panel)); }
.glresult .rthead { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; }
.glresult .rthead b { font: var(--display-weight) 18px/1.15 var(--display); }
.glresult .rlines { margin-left: auto; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.glresult .rmems { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: var(--t-note); }
.glresult .rmem { display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.glresult .legend { font-size: var(--t-note); margin: 10px 0 0; }

/* ── the log: each line's chip, small ────────────────────────────────── */
.gamelog .logchip { display: inline-block; width: 14px; height: 14px; vertical-align: -2px; margin-right: 5px; }
.gamelog .logchip .chipart { width: 100%; height: 100%; }
.logcard { font-weight: 700; white-space: nowrap; }

/* ── How to play ─────────────────────────────────────────────────────── */
.rulesheet .teamsrow { display: flex; }
.rulesheet .rteams { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.rulesheet .rteam { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.rulesheet .rteam .chipart { width: 22px; height: 22px; }
.rulesheet ol { padding-left: 1.2em; }

/* ── the waiting room: the teams ─────────────────────────────────────── */
.teamsnote { display: flex; flex-direction: column; gap: var(--s2); margin-top: var(--s2); }
.teamsnote .setting { margin-bottom: var(--s1); }
.teamsnote .teamboxes { display: grid; grid-template-columns: repeat(var(--teams, 2), minmax(0, 1fr)); gap: var(--s2); }
.teamsnote .team { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: var(--panel-edge); border-radius: 10px; min-width: 0; }
.teamsnote .team.mine { border-color: var(--ink); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.teamsnote .tname { display: flex; align-items: center; gap: 6px; min-width: 0; }
.teamsnote .tname b { font: var(--display-weight) 17px/1.2 var(--display); }
.teamsnote .tchip { width: 22px; height: 22px; }
.teamsnote .tmembers { display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.teamsnote .pn { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.teamsnote .pn b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.teamsnote .pn .face { display: block; width: 22px; height: 22px; flex: none; }
.teamsnote .pn .face > .seatmark { display: block; width: 100%; height: 100%; }
.teamsnote .pfoot { margin: 0; font-size: var(--t-note); }

/* ── phones ──────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .felt.gil { height: 100dvh; gap: 0; }
  .gil .tablemain { gap: 6px; }
  .felt.gil .bar .tools { display: none; }
  .felt.gil .bar .more { display: inline-flex; min-width: 44px; min-height: 44px; }
  .gil .stage { gap: 6px; }
  .gil .boardframe { --frame-pad: 5px; border-radius: 9px; }
  .gil .say { font-size: 14px; }
  .gil .dock { padding: 6px 8px 8px; gap: 4px; }
  .gil .sayline { min-height: calc(2 * 1.45 * 14px); }
  .gil .hand { padding: 18px 2px 4px; min-height: calc(var(--cw) * 1.4 + 24px); }
  .teamsnote .teamboxes { grid-template-columns: 1fr; }
  .house-banner .splashtitle { font-size: 30px; }
  .house-banner.gl-win .splashtitle { font-size: 36px; }
}
/* (on a tall narrow screen, or a phone on its side, the teams are a strip:
   each team's chip, its lines and its players' marks, names on a tap) */
@media (max-aspect-ratio: 6/5), (max-height: 520px) {
  .gil .tpanel { flex-direction: row; align-items: center; gap: 8px; padding: 4px 8px; }
  .gil .tname, .gil .tyou { display: none; }
  .gil .thead { gap: 4px; flex: none; }
  .gil .tchip { width: 24px; height: 24px; }
  .gil .tlines { margin-left: 0; }
  .gil .mems { flex-direction: row; flex-wrap: wrap; gap: 3px; margin-left: auto; justify-content: flex-end; }
  .gil .mem { padding: 1px; min-height: 0; }
  .gil .mem .mname, .gil .mem .mtag { display: none; }
  .gil .mem.turn { box-shadow: 0 0 0 2.5px var(--turn); background: none; }
  .gil .mem.away .mark { opacity: .55; }
}
@media (max-width: 380px) {
  .gil .mem .mark { width: 18px; height: 18px; }
  /* (a team of four or six: its marks two across, not one to a row, so twelve
     seats don't push the board down to a postage stamp) */
  .gil .mems { display: grid; grid-template-columns: repeat(2, auto); gap: 2px 3px; align-content: center; }
  .gil .teams[data-n="2"] .mems { grid-template-columns: repeat(3, auto); }
  .gil .teams { gap: 4px; }
  .gil .tpanel { padding: 3px 5px; gap: 5px; }
}
/* short phones (an iPhone SE): the hand's a little smaller */
@media (max-width: 640px) and (max-height: 700px) {
  body { --cw: 40px; }
}
/* phones on their side: the board at the left as tall as the screen, and
   everything else beside it, one line high */
@media (max-height: 520px) {
  body { --cw: 40px; }
  #app { padding: 0; }
  .felt.gil { height: 100dvh; padding: 4px 8px; border: 0; border-radius: 0; gap: 0; }
  .gil .tablemain { gap: 3px; }
  .felt.gil .bar .tools { display: none; }
  .felt.gil .bar .more { display: inline-flex; min-height: 30px; }
  .gil .bar .title { font-size: 14px; }
  .gil .stage { gap: 8px; --sidew: clamp(260px, calc(100vw - 100vh), 470px); }
  .gil .boardframe { --frame-pad: 4px; }
  .gil .side { gap: 4px; }
  .gil .toolrow .sorters { display: none; }
  .gil .dock { padding: 3px 8px 4px; gap: 2px; }
  .gil .sayline { min-height: calc(2 * 1.4 * 13px); }
  .gil .say { font-size: 13px; line-height: 1.4; }
  .gil .hand { padding: 12px 4px 4px; min-height: calc(var(--cw) * 1.4 + 18px); }
  .gil .act { min-height: 34px; font-size: 13px; padding-block: 2px; }
  .gil .actions { min-height: 34px; }
  .gil .dock kbd { display: none; }
}
@media (pointer: coarse) {
  .gil .act, .gil .toolrow { min-height: 44px; }
  .felt.gil .bar .btn { min-height: 44px; }
}
/* (a short phone: the Sort row is its own height, not a button's, to give the board the room) */
@media (pointer: coarse) and (max-width: 640px) and (max-height: 700px) {
  .gil .toolrow { min-height: 32px; }
}
@media (pointer: coarse) and (max-height: 520px) {
  .gil .act, .gil .toolrow, .gil .actions { min-height: 36px; }
  .felt.gil .bar .btn { min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .gil .sp.lit::after, .gil .sp.take::after { animation: none; }
  .chipslot.drop, .chipslot.cheer { animation: none; }
  .gil .line.drawing line { animation: none; stroke-dashoffset: 0; }
  .gil .dock, .gil .hand, .gil .sp .card { transition: none; }
}

/* ── the front door: five table settings in two rows ─────────────────── */
@media (min-width: 900px) {
  .lobby:has(.choices) .choices { grid-template-columns: 2fr 1fr; }
}
/* (three two-way choices to a row, then the two longer ones, half a row each) */
.lobby .choice > .bots > .bots { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--s2) var(--s3); }
.lobby .choice > .bots > .bots > .setting { grid-column: span 2; }
.lobby .choice > .bots > .bots > .setting:nth-child(n + 4) { grid-column: span 3; }
.lobby .choice > .bots > .bots > .setting { flex-direction: column; align-items: stretch; gap: var(--s1); }
.lobby .choice > .bots > .bots > .setting > div:first-child { flex: none; }
.lobby .choice > .bots > .bots > .setting .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.lobby .choice > .bots > .bots > .setting .seg button { min-width: 0; min-height: 32px; padding-block: 3px; padding-inline: 4px; }
@media (pointer: coarse) { .lobby .choice > .bots > .bots > .setting .seg button { min-height: 44px; } }
/* (one to a row wherever the bots' panel is half a window: under 900px it shares the row with the friends', so three would be cramped) */
@media (max-width: 899px) {
  .lobby .choice > .bots > .bots { grid-template-columns: 1fr; }
  .lobby .choice > .bots > .bots > .setting, .lobby .choice > .bots > .bots > .setting:nth-child(n + 4) { grid-column: auto; }
}
