/* Last One Standing's table: your tray of cards, the players, the questions
   so far, the question box and the dock, on the room's structure
   (games/room/room.css), from the tokens in last-one-standing.css.

   Steadiness first: the tray is as big as the window allows and its cards
   never change size during a game (table.js fitTray sizes them to the
   room); the dock never changes size; banners are drawn over the tray. The
   side column scrolls inside itself, never the page. */

/* ── the frame ───────────────────────────────────────────────────────── */
.felt.lstand { position: relative; height: calc(100dvh - 2 * var(--frame)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.lstand .tablemain { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.felt.lstand.docked { grid-template-columns: minmax(0, 1fr) 300px; }
.lstand .logdock { min-height: 0; display: flex; flex-direction: column; }
.lstand .logdock:empty { display: none; }
.lstand .logdock .gamelog { flex: 1; }
.lstand .gamelog.drawer {
  position: absolute; z-index: 30; right: 14px; top: 64px; bottom: 230px; width: min(360px, calc(100% - 28px));
  box-shadow: -10px 10px 30px rgba(0, 0, 0, .45);
}
.lstand .logbtn.on { background: var(--pick-tint); box-shadow: var(--pick-ring); }
.lstand .bar .tools .stop.unseen { visibility: hidden; }
.lstand .gamelog .who svg { vertical-align: -1px; margin-right: 3px; }

/* The stage: the tray beside the side column on a wide window, above it on
   a tall one. */
.lstand .stagebox { flex: 1; min-height: 0; min-width: 0; }
.lstand .stage { height: 100%; display: grid; gap: 16px; grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr) clamp(320px, 32%, 420px); }
.lstand .traycol { position: relative; min-height: 0; min-width: 0; display: flex; }
/* (with the log pinned beside the table, the side column keeps the room its moves need: the tray gives way) */
.felt.lstand.docked .stage { grid-template-columns: minmax(0, 1fr) 400px; }
.lstand .side { display: flex; flex-direction: column; gap: 10px; min-height: 0; min-width: 0; }
.lstand .sidescroll { overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lstand .players, .lstand .sidescroll, .lstand .askbox { padding: 10px 12px 12px; border-radius: var(--panel-radius); background: var(--panel); border: var(--panel-edge); }
.lstand .players { flex: none; }
.lstand .sidescroll { flex: 1 1 0; min-height: 110px; }
.lstand .panelhead { margin: 0 0 6px; font: var(--display-weight) var(--t-heading)/1.15 var(--display); color: var(--ink); }
.lstand .panelhead .qcount { color: var(--soft); }

/* ── the tray ────────────────────────────────────────────────────────── */
.lstand .traywrap { position: relative; flex: 1; min-width: 0; min-height: 0; display: grid; place-items: center; }
.lstand .tray {
  --cw: 96px; --gap: 10px; --cols: 6; --pad: calc(var(--cw) * .14);
  display: grid; grid-template-columns: repeat(var(--cols), var(--cw)); gap: var(--gap); padding: var(--pad);
  border-radius: calc(var(--cw) * .2);
  background: linear-gradient(180deg, var(--tray-hi), var(--tray) 22%, var(--tray) 78%, var(--tray-lo));
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, .28), inset 0 -3px 0 rgba(0, 0, 0, .22), 0 14px 30px rgba(0, 0, 0, .45);
}
/* each card sits in its window: a darker well molded into the tray */
.lstand .tray > .lcard { --cw: inherit; }
.lstand .tray > .lcard::before {
  content: ''; position: absolute; inset: -3px; border-radius: calc(var(--cw) * .11);
  background: var(--tray-lo); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .35);
}
.lstand .traywrap.watching .lcard { cursor: default; }
/* the smallest phones: the tray at a size you can read, scrolling inside itself */
.lstand .traywrap.tight { place-items: start center; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }

/* the room's seat bar over the tray's foot */
.lstand .seatslot { position: absolute; z-index: 8; left: 50%; bottom: 8px; translate: -50% 0; width: calc(100% - 24px); display: flex; justify-content: center; pointer-events: none; }
.lstand .seatslot:empty { display: none; }
.lstand .seatslot > .seatbar {
  pointer-events: auto; max-width: 100%; display: flex; flex-direction: column; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--sheet) 95%, transparent); color: var(--ink);
  border: 1.5px solid color-mix(in srgb, var(--ink) 25%, transparent); box-shadow: 0 10px 26px rgba(0, 0, 0, .5);
}

/* banners: the house's, over the tray (an answer to your question carries the question under it) */
.losbanner { display: grid; justify-items: center; gap: 6px; text-align: center; }
.losbanner .splashtitle { font: var(--display-weight) 40px/1 var(--display); }
.losbanner .bannersub { display: block; width: min(26ch, 60vw); white-space: normal; text-wrap: balance; font: 600 15px/1.3 var(--ui-font); color: var(--soft); }

/* ── the players ─────────────────────────────────────────────────────── */
.lstand .players { display: flex; align-items: center; gap: 12px; }
.lstand .yourcard { all: unset; box-sizing: border-box; position: relative; flex: none; display: grid; justify-items: center; gap: 4px; cursor: zoom-in; border-radius: 8px; -webkit-tap-highlight-color: transparent; }
.lstand .yourcard:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.lstand .yourcard .yclabel { font: 700 12px/1 var(--ui-font); letter-spacing: .06em; text-transform: uppercase; color: var(--soft); }
.lstand .prows { flex: 1; min-width: 0; display: grid; gap: 6px; }
.lstand .prow { min-width: 0; }
.lstand .prow {
  display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "mark name" "pips pips"; align-items: center; gap: 4px 8px;
  padding: 6px 8px; border-radius: 10px; border: 2px solid transparent; background: rgba(0, 0, 0, .16);
}
.lstand .prow > svg { grid-area: mark; }
.lstand .prow .pname { grid-area: name; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
.lstand .prow .pname b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lstand .prow .pcount { flex: none; display: inline-flex; align-items: baseline; }
.lstand .prow.turn { border-color: var(--turn); background: color-mix(in srgb, var(--turn) 10%, rgba(0, 0, 0, .16)); }
/* how many each has standing: 24 little windows, the standing ones lit */
.lstand .pips { grid-area: pips; display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; }
.lstand .pips i { display: block; height: 7px; border-radius: 2px; background: rgba(0, 0, 0, .3); }
.lstand .prow.me .pips i.up { background: var(--tray-hi); }
.lstand .prow.them .pips i.up { background: var(--their-hi); }
.lstand .players.spectating .prow:first-child .pips i.up { background: var(--tray-hi); }

/* ── the questions so far ────────────────────────────────────────────── */
.lstand .qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lstand .qrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: 8px; padding: 5px 6px; border-radius: 8px; font-size: 15px; line-height: 1.3; }
.lstand .qrow > svg { margin-top: 1px; }
.lstand .qrow.mine { background: rgba(255, 255, 255, .05); }
.lstand .qrow .readas { color: var(--soft); font-size: 13px; }
.lstand .ans { flex: none; min-width: 3.4em; padding: 1px 8px; border-radius: 999px; text-align: center; font: 800 13px/1.5 var(--ui-font); }
.lstand .ans.yes { background: var(--good); color: #10321a; }
.lstand .ans.no { background: var(--bad); color: #3a0d06; }
.lstand .ans.unsure, .lstand .ans.pending { background: rgba(255, 255, 255, .14); color: var(--ink); }
.lstand .qnone { margin: 0; font-size: var(--t-note); }

/* ── the question box ────────────────────────────────────────────────── */
.lstand .askbox { position: relative; display: flex; flex-direction: column; gap: 8px; flex: none; }
.lstand .askbox[hidden] { display: none; }
.lstand .askform { display: flex; gap: 8px; }
.lstand .askinput {
  flex: 1; min-width: 0; min-height: 44px; box-sizing: border-box; padding: 8px 12px; border-radius: 10px;
  font: 500 16px/1.2 var(--ui-font); color: var(--ink); background: rgba(0, 0, 0, .25); border: var(--field-edge);
}
.lstand .askinput::placeholder { color: var(--soft); }
.lstand .askinput:disabled { border-style: dashed; }
/* the list that rises over the box as you type (table.js search): the
   board's questions it finds, best nearest the box, over whatever's above */
.lstand .qpop {
  position: absolute; z-index: 25; left: 0; right: 0; bottom: calc(100% + 6px); box-sizing: border-box;
  display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 8px; overflow: hidden;
  border-radius: var(--panel-radius); background: var(--sheet); border: 1.5px solid color-mix(in srgb, var(--ink) 24%, transparent);
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .45);
}
.lstand .qpop[hidden] { display: none; }
.lstand .qfound { flex: 0 1 auto; min-height: 0; display: flex; flex-direction: column-reverse; gap: 4px; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.lstand .qfound:empty { display: none; }
.lstand .qopt {
  all: unset; box-sizing: border-box; flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 10px; cursor: pointer;
  font: 600 15px/1.3 var(--ui-font); color: var(--ink); background: var(--chip); border: var(--chip-edge);
}
.lstand .qopt .qtext { flex: 1; min-width: 0; }
.lstand .qopt .qtext b { color: var(--turn); font-weight: 800; }
.lstand .qopt.active { border-color: var(--turn); background: color-mix(in srgb, var(--turn) 16%, var(--chip)); }
@media (hover: hover) { .lstand .qopt:not(:disabled):hover { border-color: var(--turn); } }
.lstand .qopt:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.lstand .qopt:disabled { cursor: default; color: var(--soft); border-style: dashed; }
.lstand .qopt:disabled .qtext b { color: inherit; }
.lstand .qopt .qwhy { flex: none; font-size: 13px; }
.lstand .qopt.guessopt { background: transparent; }
.lstand .qnote { margin: 0; padding: 0 4px; font-size: var(--t-note); line-height: 1.35; color: var(--soft); }
.lstand .qnote[hidden] { display: none; }
.lstand .askbox .kicker { margin: 0; font: 700 12px/1 var(--ui-font); letter-spacing: .08em; text-transform: uppercase; color: var(--soft); }
.lstand .askbox .typed { margin: 0; font: 700 20px/1.3 var(--display); color: var(--ink); overflow-wrap: anywhere; }
.lstand .askbox.reply { border-color: var(--turn); }
.lstand .replyhint { margin: 0; font-size: var(--t-note); }

/* ── the dock ────────────────────────────────────────────────────────── */
.lstand .dock { flex: none; }
.lstand .act { min-width: 0; padding-inline: 12px; }
.lstand .act .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lstand .actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; width: 100%; }
.lstand .actions .btn.slot { width: 100%; }
.lstand .dock.replying .actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lstand .dock.replying .act { padding-inline: 6px; }

/* ── a guess, checked ────────────────────────────────────────────────── */
.guesscheck { display: flex; align-items: center; gap: 16px; }
.guesscheck p { margin: 0; }

/* ── a card, bigger (held, right-clicked or Z: table.js zoom) ────────── */
.loszoom { display: grid; justify-items: center; gap: 14px; }
.loszoom .zoomline { margin: 0; max-width: 34ch; text-align: center; color: var(--soft); text-wrap: pretty; }

/* ── the result ──────────────────────────────────────────────────────── */
/* (wide enough for its foot on one line: Back to Last One Standing, Share result, Play again) */
.house-scrim-result .house-sheet.los-result { --house-sheet-width: 560px; }
.losresult .rcards { display: flex; justify-content: center; gap: 28px; margin: 4px 0 16px; }
.losresult .rcard { margin: 0; display: grid; justify-items: center; gap: 10px; }
.losresult .rcard figcaption { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.losresult .rcard.found .lcard .face { box-shadow: inset 0 0 0 1px var(--card-edge), 0 0 0 4px var(--turn), var(--card-shadow); }
.losresult .rline { margin: 4px 0; text-align: center; }
.losresult .rline .who svg { margin-right: 4px; vertical-align: -2px; }
/* the questions in a sheet of their own (a phone's) */
.lstand .allq { display: none; }
.qsheet .qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }

/* ── tall windows and phones: the tray above the rest ────────────────── */
@media (max-aspect-ratio: 6/5) {
  .lstand .stage { display: flex; flex-direction: column; gap: 8px; }
  .lstand .traycol { flex: 1 1 0; min-height: 0; }
  .lstand .side { flex: none; }
  .lstand .sidescroll { flex: none; height: 96px; min-height: 0; }
  .lstand .players .yourcard .lcard { --cw: 56px !important; }
}
@media (max-width: 640px) {
  .felt.lstand { height: 100dvh; gap: 0; }
  .lstand .tablemain { gap: 6px; }
  .felt.lstand .bar .tools { display: none; }
  .felt.lstand .bar .more { display: inline-flex; min-width: 44px; min-height: 44px; }
  .lstand .stage { gap: 6px; }
  .lstand .askbox .typed { font-size: 17px; }
  .lstand .say { font-size: 14px; }
  .lstand .dock { padding: 6px 8px 8px; gap: 4px; }
  .lstand .sayline { min-height: calc(2 * 1.45 * 14px); }
  .losbanner .splashtitle { font-size: 30px; }
  .losresult .rcards { gap: 16px; }
}
/* a phone, either way up: the side made compact. Who's who in one band
   (each player a line, "You 24 standing" over "Ada 7 standing", beside your
   card, a thumbnail you tap to see bigger), the questions so far in a sheet
   (Q&A), the question box one line. The count and its noun are the glance
   and never hide (docs/design-language.md, "The glance"); the 24 little
   windows only repeat the count in a picture, so they go. */
@media (max-width: 640px), (max-height: 520px) {
  .lstand .side { gap: 6px; }
  /* (the box is the panel: no frame round it, so the tray has the room) */
  .lstand .askbox.ask { padding: 0; background: none; border: 0; }
  .lstand .askbox:not(.ask) { padding: 8px 10px; }
  .lstand .sidescroll { display: none; }
  .lstand .players { gap: 6px; padding: 6px 8px; }
  .lstand .players .yourcard .yclabel { display: none; }
  .lstand .players .yourcard .lcard { --cw: 36px !important; height: 36px; }
  .lstand .players .yourcard .lcard .plate { display: none; }
  .lstand .players .yourcard .lcard .pic { flex: 1; }
  .lstand .prows { gap: 3px; display: flex; flex-direction: column; }
  .lstand .prow { padding: 0 6px; gap: 0 6px; }
  .lstand .prow > svg { width: 20px; height: 20px; }
  .lstand .prow .pname { flex-direction: row; align-items: baseline; gap: 6px; }
  .lstand .prow .pips { display: none; }
  .lstand .allq { display: inline-flex; flex: none; min-height: 44px; padding-inline: 6px; }
}
/* the smallest phones: tighter round the names, so they keep the room beside your card and Q&A */
@media (max-width: 359px) {
  .lstand .act { padding-inline: 8px; font-size: 15px; }
  .lstand .players { gap: 4px; padding: 5px 6px; }
  .lstand .prow { padding: 0 5px; gap: 0 4px; }
  .lstand .prow > svg { width: 18px; height: 18px; }
  .lstand .prow .pname { gap: 4px; font-size: 15px; }
  .lstand .allq { padding-inline: 4px; }
}
/* phones on their side: the tray at the left, as tall as the screen */
@media (max-height: 520px) {
  #app { padding: 0; }
  .felt.lstand { height: 100dvh; padding: 4px 8px; border: 0; border-radius: 0; gap: 0; }
  .felt.lstand .bar .tools { display: none; }
  .felt.lstand .bar .more { display: inline-flex; min-height: 30px; }
  .lstand .stage { display: grid; grid-template-columns: minmax(0, 1fr) minmax(264px, 34%); }
  /* (who's who, tighter, so both names show beside your card and Q&A) */
  .lstand .players { gap: 4px; padding: 5px 6px; }
  .lstand .prow { padding: 0 5px; gap: 0 4px; }
  .lstand .prow > svg { display: none; }
  .lstand .prow .pname { gap: 4px; font-size: 14px; }
  .lstand .act { padding-inline: 8px; }
  .lstand .allq { padding-inline: 4px; }
  .lstand .side { max-height: none; }
  .lstand .dock { padding: 3px 8px 4px; gap: 2px; }
  .lstand .sayline { min-height: calc(2 * 1.4 * 13px); }
  .lstand .say { font-size: 13px; line-height: 1.4; }
  .lstand .act { min-height: 34px; font-size: 13px; padding-block: 2px; }
  .lstand .actions { min-height: 34px; }
  .lstand .dock kbd { display: none; }
}
@media (pointer: coarse) {
  .lstand .act { min-height: 44px; }
  .felt.lstand .bar .btn { min-height: 44px; }
}
@media (pointer: coarse) and (max-height: 520px) {
  .lstand .act, .lstand .actions { min-height: 36px; }
  .felt.lstand .bar .btn { min-height: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .lstand .qrow.pulse, .lstand .pips.pulse { animation: none; }
}
