/* Modal Arcade. Every color is a semantic token from modal-tokens.css; nothing here names a hex value. */
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; display: flex; flex-direction: column; font-size: var(--text-sm); line-height: var(--leading-sm); }
.ic16 { width: 16px; height: 16px; flex: none; }
.ic12 { width: 12px; height: 12px; flex: none; }
[hidden] { display: none !important; }

.topbar { flex: none; height: 52px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; border-bottom: 1px solid var(--semantic-border-divider); }
.topbar__title { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; font-size: var(--text-base); color: var(--semantic-text-primary); text-decoration: none; }
.topbar__title svg { color: var(--semantic-icon-accent); }
.topbar__right { display: flex; align-items: center; gap: 8px; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; }

/* ---- system components (recipes from the Modal design system) */
.md-button { --md-btn-bg: var(--semantic-background-primary); --md-btn-bg-hover: var(--semantic-background-primary-hover); --md-btn-bg-active: var(--semantic-background-primary-active); --md-btn-text: var(--semantic-text-primary); --md-btn-border: var(--semantic-border-primary); --md-btn-icon: var(--semantic-icon-primary); --md-btn-ring: var(--semantic-border-primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; padding: 6px 8px; border-radius: var(--radius-md);
  font-family: var(--font-sans); font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 500; color: var(--md-btn-text); background: var(--md-btn-bg); border: 1px solid var(--md-btn-border); cursor: pointer; text-decoration: none; transition: color 150ms, background-color 150ms, border-color 150ms; }
.md-button__icon { width: 16px; height: 16px; flex: none; color: var(--md-btn-icon); }
.md-button--accent { --md-btn-bg: var(--semantic-background-accent); --md-btn-bg-hover: var(--semantic-background-accent-hover); --md-btn-bg-active: var(--semantic-background-accent-active); --md-btn-text: var(--semantic-text-accent); --md-btn-border: var(--semantic-border-accent); --md-btn-icon: var(--semantic-icon-accent); --md-btn-ring: var(--semantic-border-accent); }
.md-button--danger { --md-btn-bg: var(--semantic-background-danger); --md-btn-bg-hover: var(--semantic-background-danger-hover); --md-btn-bg-active: var(--semantic-background-danger-active); --md-btn-text: var(--semantic-text-danger); --md-btn-border: var(--semantic-border-danger); --md-btn-icon: var(--semantic-icon-danger); --md-btn-ring: var(--semantic-border-danger); }
.md-button--secondary { background: transparent; border-color: transparent; }
.md-button:hover:not(:disabled) { background: var(--md-btn-bg-hover); }
.md-button:active:not(:disabled) { background: var(--md-btn-bg-active); }
.md-button:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--md-btn-ring) 80%, transparent); }
.md-button:disabled { opacity: .5; cursor: not-allowed; }
.md-button--icon-only { min-height: 34px; min-width: 34px; }

.md-chip { --md-chip-bg: var(--semantic-background-secondary); --md-chip-text: var(--semantic-text-secondary); display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; padding: 2px 8px; border-radius: var(--radius-full); font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--md-chip-text); background: var(--md-chip-bg); }
.md-chip--primary { --md-chip-bg: var(--semantic-background-success); --md-chip-text: var(--semantic-text-success); }
.md-chip--error { --md-chip-bg: var(--semantic-background-danger); --md-chip-text: var(--semantic-text-danger); }
.md-chip--warning { --md-chip-bg: var(--semantic-background-warning); --md-chip-text: var(--semantic-text-warning); }
.md-chip--accent-blue { --md-chip-bg: var(--semantic-background-informational); --md-chip-text: var(--semantic-text-informational); }
.md-chip--accent-pink { --md-chip-bg: var(--semantic-background-running); --md-chip-text: var(--semantic-text-running); }

.md-tag { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; flex-shrink: 0; min-height: 20px; padding: 0 6px; border-radius: var(--radius-sm); font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-secondary); background: var(--semantic-background-secondary); }

.md-avatar { --md-avatar-size: 32px; display: inline-flex; flex-shrink: 0; width: var(--md-avatar-size); height: var(--md-avatar-size); }
.md-avatar__fallback { width: 100%; height: 100%; border-radius: var(--radius-full); border: 1px solid var(--semantic-border-secondary); display: inline-flex; align-items: center; justify-content: center; font-weight: 500; text-transform: uppercase; line-height: 1; font-size: calc((var(--md-avatar-size) - 2px) / 2.2); background: var(--semantic-background-secondary); color: var(--semantic-text-primary); }
.md-avatar--you .md-avatar__fallback { background: var(--semantic-background-accent); border-color: var(--semantic-border-accent); color: var(--semantic-text-accent); }

.md-live { --md-live-size: 8px; --md-live-color: var(--semantic-background-accent-bold); position: relative; display: inline-block; flex: none; width: var(--md-live-size); height: var(--md-live-size); border-radius: var(--radius-full); background: var(--md-live-color); }
.md-live::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--md-live-color); animation: md-live-ring 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite; }
@keyframes md-live-ring { from { transform: scale(1); opacity: .6; } to { transform: scale(2.2); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .md-live::before { animation: none; } }

.md-field { display: flex; flex-direction: column; }
.md-field__label { font-size: var(--text-sm); margin-bottom: 6px; color: var(--semantic-text-primary); }
.md-input { width: 100%; margin: 0; padding: 6px 12px; font: inherit; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--semantic-text-primary); background: var(--semantic-background-primary); border: 1px solid var(--semantic-border-primary); border-radius: var(--radius-lg); outline: none; }
.md-input::placeholder { color: var(--semantic-text-tertiary); }
.md-input:hover { border-color: var(--semantic-border-primary-hover); }
.md-input:focus { border-color: var(--semantic-border-primary-focus); }

.md-seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: var(--radius-lg); background: var(--semantic-background-recessed); border: 1px solid var(--semantic-border-divider); }
.md-seg button { font: inherit; font-size: var(--text-sm); font-weight: 500; padding: 4px 10px; border-radius: var(--radius-md); border: 0; background: transparent; color: var(--semantic-text-secondary); cursor: pointer; }
.md-seg button:hover { color: var(--semantic-text-primary); }
.md-seg button[aria-pressed="true"] { background: var(--semantic-background-elevated); color: var(--semantic-text-primary); box-shadow: 0 0 0 1px var(--semantic-border-secondary); }
.md-seg button:focus-visible { outline: 2px solid var(--semantic-border-accent-focus); outline-offset: 1px; }

.md-card { background: var(--semantic-background-elevated); border: 1px solid var(--semantic-border-elevated); border-radius: var(--radius-lg); padding: 16px; }
.md-banner { display: flex; gap: 8px; align-items: flex-start; padding: 8px 12px; border-radius: var(--radius-lg); font-size: var(--text-sm); background: var(--semantic-background-danger); color: var(--semantic-text-danger); border: 1px solid var(--semantic-border-danger); }

/* ---- lobby */
.lobby { width: 100%; max-width: 1040px; margin: 0 auto; padding: 32px 16px 64px; display: flex; flex-direction: column; gap: 32px; overflow-y: auto; }
.lobby__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.lobby h1 { font-size: var(--text-2xl); line-height: 32px; font-weight: 500; margin: 0 0 4px; }
.lobby h2 { font-size: var(--text-lg); line-height: 28px; font-weight: 500; margin: 0; }
.sub { color: var(--semantic-text-secondary); margin: 0; max-width: 70ch; }
.tables { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.table-card { display: flex; flex-direction: column; gap: 12px; }
.table-card h2 { display: flex; align-items: center; gap: 8px; }
.table-card h2 svg { color: var(--semantic-icon-primary); }
.table-card ul { margin: 0; padding-left: 18px; color: var(--semantic-text-secondary); display: flex; flex-direction: column; gap: 2px; }
.table-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.cast-head { display: flex; flex-direction: column; gap: 4px; }
.cast { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.cast-card { text-align: left; font: inherit; color: inherit; cursor: pointer; display: flex; flex-direction: column; gap: 8px; }
.cast-card:hover { border-color: var(--semantic-border-primary-hover); }
.cast-card[aria-pressed="true"] { background: var(--semantic-background-primary-selected); border-color: var(--semantic-border-accent-selected); }
.cast-card:focus-visible { outline: 2px solid var(--semantic-border-accent-focus); outline-offset: 2px; }
.cast-card:disabled { opacity: .5; cursor: not-allowed; }
.cast-card__top { display: flex; align-items: center; gap: 10px; }
.cast-card__name { font-weight: 500; }
.cast-card__lab { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-tertiary); }
.cast-card__blurb { color: var(--semantic-text-secondary); }
.name-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.name-row .md-field { width: 220px; }

/* ---- game: the table on the left, your controls under it, the transcript on the right */
.game { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 320px; grid-template-rows: minmax(0, 1fr) auto; }
.stage { grid-column: 1; grid-row: 1; position: relative; min-height: 0; overflow: hidden; background: var(--semantic-background-recessed); color: var(--semantic-text-primary); }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; image-rendering: pixelated; } /* the table is drawn at the alley's coarse grain and scaled up */
.stage__tube { pointer-events: none; }
.stage--flat::before { content: "This browser cannot draw the 3D table. The game still plays in the transcript."; position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--semantic-text-secondary); }
.overlay, .hud { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.plate, .bubble, .emote { position: absolute; left: 0; top: 0; will-change: transform; }
.plate { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px; border-radius: var(--radius-full); background: var(--semantic-background-floating); border: 1px solid var(--semantic-border-secondary); font-size: var(--text-xs); line-height: var(--leading-xs); white-space: nowrap; }
.plate__name { font-weight: 500; font-size: var(--text-sm); line-height: var(--leading-sm); }
.plate__dot { width: 8px; height: 8px; border-radius: var(--radius-full); flex: none; background: var(--semantic-background-accent-bold); }
.plate[data-tone="mafia"] { border-color: var(--semantic-border-danger); }
.plate[data-tone="mafia"] .plate__extra { color: var(--semantic-text-danger); }
.plate[data-tone="power"] .plate__extra { color: var(--semantic-text-informational); }
.plate__extra { color: var(--semantic-text-secondary); }
.plate__extra:empty { display: none; }
.plate--gone { opacity: .55; }
.plate--you { padding: 4px 12px; border: 2px solid #7fee64; background: #12301c; box-shadow: 0 0 0 3px rgba(127, 238, 100, .22); } /* yours: the one seat with no figure in it */
.plate--you .plate__name { font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #b9ffab; }
.plate--you::after { content: ""; position: absolute; left: -9px; top: 50%; transform: translateY(-50%); border: 5px solid transparent; border-right: 7px solid #7fee64; border-left: 0; } /* pointing at your place at the table */
.plate--stack { display: inline-grid; grid-template-columns: auto auto auto; justify-content: start; column-gap: 6px; row-gap: 0; padding: 3px 10px 4px 8px; border-radius: 12px; } /* a crowded table: the name and what it carries on one line, the model under it */
.plate--stack .plate__model { grid-row: 2; grid-column: 1 / -1; justify-self: start; }
.bubble { max-width: min(320px, 70%); padding: 8px 12px; border-radius: var(--radius-lg); background: var(--semantic-background-elevated); border: 1px solid var(--semantic-border-accent); color: var(--semantic-text-primary-hover); font-size: var(--text-sm); line-height: var(--leading-sm); box-shadow: 0 8px 24px rgba(0, 0, 0, .14); z-index: 2; }
.emote { padding: 1px 8px; border-radius: var(--radius-full); background: var(--semantic-background-caution); color: var(--semantic-text-caution); font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: 500; z-index: 1; }
.hud { display: flex; justify-content: center; align-items: flex-start; padding: 12px; }
.banner { padding: 6px 14px; border-radius: var(--radius-full); background: var(--semantic-background-floating); border: 1px solid var(--semantic-border-secondary); font-weight: 500; font-size: var(--text-sm); line-height: var(--leading-sm); max-width: 90%; text-align: center; }
.banner--good { background: var(--semantic-background-success); color: var(--semantic-text-success); border-color: var(--semantic-border-accent); }
.banner--bad { background: var(--semantic-background-danger); color: var(--semantic-text-danger); border-color: var(--semantic-border-danger); }

.caption { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); width: min(720px, calc(100% - 32px)); padding: 12px 16px 14px; border-radius: var(--radius-lg); background: var(--semantic-background-floating); border: 1px solid var(--semantic-border-secondary); display: flex; flex-direction: column; gap: 6px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); pointer-events: none; }
.echo { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); z-index: 6; max-width: min(560px, calc(100% - 32px)); padding: 5px 14px; border-radius: var(--radius-full); background: var(--semantic-background-accent-bold); color: #0b1f08; font-size: var(--text-sm); line-height: var(--leading-sm); box-shadow: 0 6px 18px rgba(0, 0, 0, .25); pointer-events: none; animation: echo-in 180ms ease-out; } /* what you just said, shown at once */
.echo[hidden] { display: none; }
.echo b { font-weight: 600; }
.echo--them { display: flex; align-items: center; gap: 10px; max-width: min(640px, calc(100% - 32px)); padding: 6px 16px 6px 8px; border-radius: 22px; background: var(--semantic-background-floating, #151a17); color: var(--semantic-text-primary-active, #f3f6f2); border: 1px solid var(--tint, #7fee64); font-size: var(--text-base, 15px); line-height: 21px; } /* a character's answer to you, shown the moment it arrives */
.echo--them[hidden] { display: none; }
.echo--them b { margin-right: 6px; color: var(--tint, #7fee64); }
.echo__face { flex: none; width: 34px; height: 34px; border-radius: 50%; image-rendering: pixelated; background: rgba(255, 255, 255, .08); }
.echo__model { margin-right: 8px; font-family: var(--font-mono, ui-monospace, monospace); font-size: 11px; color: var(--semantic-text-secondary, #9aa39c); }
.echo__line { display: block; }
.caption { transition: bottom 160ms ease-out; }
.stage:not(.stage--poker):has(.echo--them:not([hidden])) .caption { bottom: 86px; } /* the line being played moves up to leave the answer room under it */
.stage--poker .echo { left: 14px; bottom: 14px; transform: none; max-width: min(330px, 36%); animation-name: echo-in-corner; } /* at the card table the foot is your own two cards: talk goes in the corner beside them */
.stage--poker .echo:not(.echo--them) { border-radius: 16px; }
@keyframes echo-in-corner { from { transform: translateY(8px); opacity: 0; } }
@keyframes echo-in { from { transform: translate(-50%, 8px); opacity: 0; } }
.caption__who { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--text-sm); line-height: var(--leading-sm); }
.caption__who b { font-weight: 500; color: var(--semantic-text-primary-hover); }
.caption__act { color: var(--semantic-text-secondary); }
.caption__line { font-size: var(--text-xl); line-height: 28px; color: var(--semantic-text-primary-active); text-wrap: balance; }
.caption__thought { font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--semantic-text-secondary); font-style: italic; }
.caption__clock { height: 2px; border-radius: var(--radius-full); background: var(--semantic-border-divider); overflow: hidden; }
.caption__clock i { display: block; height: 100%; width: 100%; background: var(--semantic-background-accent-bold); }
.board { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 12px 16px; display: flex; flex-direction: column; gap: 2px; }
.row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-md); }
.row--gone { opacity: .5; }
.row__main { min-width: 0; flex: 1; }
.row__name { font-weight: 500; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.row__model { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-tertiary); }
.row__stat { flex: none; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 8px; height: 8px; border-radius: 2px; background: var(--semantic-icon-primary); }
.clock { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; color: var(--semantic-text-secondary); font-variant-numeric: tabular-nums; }
.clock__time { min-width: 28px; font-weight: 500; }
.clock__bar { width: 120px; height: 4px; border-radius: var(--radius-full); background: var(--semantic-border-divider); overflow: hidden; }
.clock__bar i { display: block; height: 100%; background: var(--semantic-background-accent-bold); transition: width 200ms linear; }
.clock--short .clock__bar i { background: var(--semantic-background-warning-bold); }

.side { grid-column: 2; grid-row: 1 / span 2; min-height: 0; border-left: 1px solid var(--semantic-border-divider); display: flex; flex-direction: column; }
.side__head { flex: none; padding: 12px 16px; border-bottom: 1px solid var(--semantic-border-divider); display: flex; flex-direction: column; gap: 10px; }
/* what runs on Modal: a line under the game's name, the model on every seat and caption, and a tab of its own */
.side__modal { display: inline-flex; align-items: center; gap: 7px; align-self: flex-start; padding: 0; border: 0; background: none; font: inherit; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-accent); cursor: pointer; text-align: left; }
.side__modal:hover { text-decoration: underline; }
/* open-face: what the other tables say with a model's name, this one says with how its bot was made */
.made { align-self: stretch; display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: var(--radius-lg); border: 1px solid color-mix(in srgb, #7fee64 45%, transparent); background: color-mix(in srgb, #7fee64 7%, transparent); }
.made__title { display: flex; align-items: center; gap: 7px; font-size: var(--text-sm); font-weight: 500; color: var(--semantic-text-primary-hover); }
.made__title::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #7fee64; box-shadow: 0 0 6px #7fee64; }
.made__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.made__nums div { display: flex; flex-direction: column; }
.made__nums b { font-size: var(--text-xl); line-height: 26px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--semantic-text-primary-active); }
.made__nums span { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-secondary); }
.made p { margin: 0; font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-secondary); }
.ofc__made { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; border-radius: var(--radius-full); background: rgba(22, 26, 34, .82); color: #b9ffab; font-size: clamp(10px, calc(var(--u) * .19), 12px); line-height: 1.5; font-weight: 500; white-space: nowrap; }
.ofc__made::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #7fee64; box-shadow: 0 0 6px #7fee64; }
.side .md-seg { align-self: stretch; }
.side .md-seg button { flex: 1 1 auto; padding: 4px 7px; white-space: nowrap; }
.plate__model { font-size: 11px; line-height: 14px; }
.caption__model { margin-left: auto; font-size: var(--text-xs); }
.onmodal { display: flex; flex-direction: column; gap: 14px; font-size: var(--text-sm); line-height: var(--leading-sm); min-width: 0; align-self: stretch; }
.onmodal__seats { display: flex; flex-direction: column; gap: 10px; }
.onmodal__seat { display: flex; align-items: center; gap: 10px; }
.onmodal__seat > div { display: flex; flex-direction: column; min-width: 0; }
.onmodal__seat b { font-weight: 500; color: var(--semantic-text-primary-hover); }
.onmodal__seat span { color: var(--semantic-text-secondary); font-size: var(--text-xs); line-height: var(--leading-xs); }
.onmodal__seat .onmodal__pace { color: var(--semantic-text-accent); }
.onmodal__face { flex: none; width: 40px; height: 40px; image-rendering: pixelated; border-radius: var(--radius-md); background: var(--semantic-background-recessed); }
.onmodal dl { margin: 0; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid var(--semantic-border-divider); }
.onmodal dt { font-weight: 500; color: var(--semantic-text-primary-hover); margin-top: 6px; }
.onmodal dd { margin: 0; color: var(--semantic-text-secondary); }
.onmodal code { font-family: var(--font-mono, ui-monospace, monospace); font-size: .92em; color: var(--semantic-text-primary); }
.side__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.side__title h2 { font-size: var(--text-lg); line-height: 28px; font-weight: 500; margin: 0; }
.side__leave { margin-left: auto; }
.role-card { font-size: var(--text-sm); }
.role-card b { font-weight: 500; }
.players { display: flex; gap: 6px; flex-wrap: wrap; }
.pchip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-full); background: var(--semantic-background-secondary); color: var(--semantic-text-secondary); font-size: var(--text-xs); line-height: var(--leading-xs); font-variant-numeric: tabular-nums; }
.pchip b { font-weight: 500; color: var(--semantic-text-primary); }
.pchip--gone { opacity: .55; }
.pchip .md-chip { padding: 0 6px; }

.feed { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 16px; display: flex; flex-direction: column; gap: 12px; }
/* how a game is played: a tab of the side panel, and a fold under each game in the plain lobby.
   Each step is a small pixel picture (144 by 68, shown at twice that) over its title and a line. */
.how { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 16px 16px; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.how[hidden] { display: none; }
.howto { display: flex; flex-direction: column; gap: 12px; font-size: var(--text-sm); line-height: var(--leading-sm); min-width: 0; }
.howto p, .howto ol, .howto dl { margin: 0; }
.howto b, .howto dt { font-weight: 500; color: var(--semantic-text-primary-hover); }
.howto__steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 288px)); gap: 16px; }
.howstep { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.howstep__pic { display: block; width: 288px; max-width: 100%; height: auto; aspect-ratio: 144 / 68; image-rendering: pixelated; border-radius: var(--radius-md); outline: 1px solid var(--semantic-border-secondary); outline-offset: -1px; background: #11463a; } /* an outline, not a border: a border would make the picture two pixels short of twice its size */
.howstep__says { display: flex; flex-direction: column; gap: 2px; }
.howstep__says span { color: var(--semantic-text-secondary); }
.howto__tip { color: var(--semantic-text-secondary); }
.howto dl { display: flex; flex-direction: column; gap: 6px; padding-top: 10px; border-top: 1px solid var(--semantic-border-divider); }
.howto dd { margin: 0; color: var(--semantic-text-secondary); }
.howto-fold { font-size: var(--text-sm); }
.howto-fold summary { cursor: pointer; font-weight: 500; color: var(--semantic-text-accent); width: fit-content; }
.howto-fold .howto { padding-top: 8px; }
.sys { display: flex; align-items: center; gap: 12px; color: var(--semantic-text-secondary); font-size: var(--text-xs); line-height: var(--leading-xs); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; margin-top: 8px; }
.sys::before, .sys::after { content: ""; flex: 1; height: 1px; background: var(--semantic-border-divider); }
.note { color: var(--semantic-text-secondary); display: flex; gap: 8px; align-items: flex-start; }
.note svg { margin-top: 2px; color: var(--semantic-icon-secondary); }
.note--private { color: var(--semantic-text-informational); }
.note--private svg { color: var(--semantic-text-informational); }
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg .md-avatar { --md-avatar-size: 26px; margin-top: 2px; }
.msg__body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.msg__head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.msg__name { font-weight: 500; }
.msg__act { color: var(--semantic-text-secondary); display: inline-flex; align-items: center; gap: 6px; }
.msg__text { overflow-wrap: anywhere; }
.msg__thought { color: var(--semantic-text-tertiary); font-style: italic; overflow-wrap: anywhere; }
.bid { display: inline-flex; align-items: center; gap: 6px; font-weight: 500; color: var(--semantic-text-primary); font-variant-numeric: tabular-nums; }
.memlist { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--semantic-text-secondary); }
.memlist b { color: var(--semantic-text-primary); font-weight: 500; }
.memories { display: flex; flex-direction: column; gap: 12px; }
.memories:empty { display: none; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

.tablewrap { overflow-x: auto; border: 1px solid var(--semantic-border-secondary); border-radius: var(--radius-sm); }
.md-table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); line-height: var(--leading-sm); }
.md-table th { text-align: left; font-weight: 500; color: var(--semantic-text-secondary); background: var(--semantic-background-recessed); padding: 8px 16px; white-space: nowrap; border-bottom: 1px solid var(--semantic-border-divider); }
.md-table td { padding: 8px 16px; border-bottom: 1px solid var(--semantic-border-divider); white-space: nowrap; color: var(--semantic-text-secondary); }
.md-table tr:last-child td { border-bottom: 0; }
.md-table td.primary { color: var(--semantic-text-primary); font-weight: 500; }
.md-table .numcol { text-align: right; font-variant-numeric: tabular-nums; }

.die { --s: 22px; width: var(--s); height: var(--s); flex: none; display: inline-grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); padding: 3px; gap: 1px; border-radius: var(--radius-sm); border: 1px solid var(--semantic-border-primary); background: var(--semantic-background-primary); }
.die i { border-radius: var(--radius-full); }
.die i.on { background: var(--semantic-text-primary); }
.die--hit { border-color: var(--semantic-border-accent-selected); background: var(--semantic-background-accent); }
.die--hit i.on { background: var(--semantic-text-accent); }
.die--lg { --s: 30px; padding: 4px; }
.dice-row { display: inline-flex; gap: 4px; flex-wrap: wrap; }

.reveal { display: flex; flex-direction: column; gap: 12px; }
.reveal__title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 500; }
.reveal__hands { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 8px 16px; }
.reveal__hand { display: flex; flex-direction: column; gap: 4px; }
.reveal__who { color: var(--semantic-text-secondary); font-size: var(--text-xs); line-height: var(--leading-xs); }
.reveal details summary { cursor: pointer; color: var(--semantic-text-secondary); }
.reveal details ul { margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.reveal details li { color: var(--semantic-text-secondary); }
.reveal details li b { color: var(--semantic-text-primary); font-weight: 500; }

.action { grid-column: 1; grid-row: 2; border-top: 1px solid var(--semantic-border-divider); background: var(--semantic-background-elevated); padding: 12px 24px 16px; display: flex; flex-direction: column; gap: 10px; }
.action__row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.action__label { color: var(--semantic-text-secondary); }
.action__keys { opacity: .75; white-space: nowrap; }
@media (max-width: 860px) { .action__keys { display: none; } }
.action__prompt { font-weight: 500; }
.action__error { color: var(--semantic-text-danger); }
.stepper { display: inline-flex; align-items: center; gap: 4px; }
.stepper output { min-width: 28px; text-align: center; font-weight: 500; font-variant-numeric: tabular-nums; }
.faces { display: inline-flex; gap: 4px; }
.faces button { padding: 3px; border-radius: var(--radius-md); border: 1px solid transparent; background: transparent; cursor: pointer; display: inline-flex; }
.faces button:hover { background: var(--semantic-background-primary-hover); }
.faces button[aria-pressed="true"] { border-color: var(--semantic-border-accent-selected); background: var(--semantic-background-primary-selected); }
.faces button:focus-visible, .opt:focus-visible { outline: 2px solid var(--semantic-border-accent-focus); outline-offset: 1px; }
.opts { display: flex; gap: 8px; flex-wrap: wrap; }
.opt { font: inherit; font-size: var(--text-sm); font-weight: 500; height: 32px; padding: 0 12px; border-radius: var(--radius-full); border: 1px solid var(--semantic-border-primary); background: var(--semantic-background-primary); color: var(--semantic-text-primary); cursor: pointer; }
.opt:hover { background: var(--semantic-background-primary-hover); border-color: var(--semantic-border-primary-hover); }
.opt[aria-pressed="true"] { background: var(--semantic-background-primary-selected); border-color: var(--semantic-border-accent-selected); }
.grow { flex: 1; min-width: 200px; }
.gate { max-width: 420px; margin: 64px auto; padding: 0 16px; display: flex; flex-direction: column; gap: 12px; width: 100%; }

@media (max-width: 860px) {
  .game { grid-template-columns: minmax(0, 1fr); grid-template-rows: 40vh auto minmax(0, 1fr); }
  .stage { grid-column: 1; grid-row: 1; }
  .action { grid-column: 1; grid-row: 2; padding: 8px 12px 10px; }
  .side { grid-column: 1; grid-row: 3; border-left: 0; border-top: 1px solid var(--semantic-border-divider); }
  .plate .md-tag, .plate .plate__model { display: none; } /* no room over the heads on a phone: the models are in the side panel */
  .bubble { max-width: 78%; }
  /* a phone: smaller name plates, what is said kept to the foot of the picture, and tighter controls */
  .plate { padding: 1px 6px; gap: 4px; font-size: 10px; line-height: 14px; }
  .plate__name { font-size: var(--text-xs); line-height: var(--leading-xs); }
  .plate__dot { width: 6px; height: 6px; }
  .caption { bottom: 6px; width: calc(100% - 16px); padding: 6px 10px 8px; gap: 3px; }
  .tally { bottom: 6px; width: calc(100% - 16px); padding: 6px 8px 8px; gap: 4px; }
  .tally__cols { gap: 3px; } .tally__col { flex-basis: 60px; padding: 4px 2px; }
  .tally--count .tally__col { flex-basis: 70px; } .tally--count .tally__face { display: none; } .count__dice .die { --s: 13px; padding: 1px; gap: 0; } .count__sum { margin-left: 0; } .count__head i { display: none; }
  .count__verdict { padding: 4px 8px; } .count__verdict b { font-size: var(--text-base); line-height: 20px; } .count__verdict span { font-size: var(--text-sm); }
  .plate--you { padding: 1px 8px; border-width: 1px; }
  .tally__face, .tally__face--skip { width: 30px; } .tally__face--skip { height: 30px; } .tally__voter { width: 16px; } .tally__count { font-size: var(--text-base); line-height: 20px; }
  .tile { min-width: 58px; padding: 6px 6px 3px; } .tile__face { width: 34px; } .tile__face--none { height: 34px; }
  .caption__line { font-size: var(--text-base); line-height: 21px; }
  .caption__who { font-size: var(--text-xs); line-height: var(--leading-xs); }
  .banner { padding: 3px 10px; font-size: var(--text-xs); line-height: var(--leading-xs); }
  .action { gap: 8px; }
  .action__row { gap: 8px; }
  .clock__bar { width: 72px; }
}

/* the private read handed in with a vote */
/* Mafia: who to point at is a row of faces; your private read is a box of its own under it, drawn
   smaller and dashed so the two cannot be taken for each other. */
.ballot { gap: 8px; }
.ballot-row { align-items: center; gap: 14px; }
.ballot-row .ballot { flex: 0 1 auto; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; height: auto; min-width: 78px; padding: 6px 10px 3px; border-radius: 12px; transition: transform 120ms, box-shadow 120ms, border-color 120ms; }
.tile__face { width: 40px; height: auto; image-rendering: pixelated; border-radius: 10px; background: color-mix(in srgb, var(--tint, #9aa39c) 32%, #fff); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.tile__face--none { display: grid; place-items: center; height: 40px; border: 2px dashed var(--semantic-border-primary); box-shadow: none; background: none; color: var(--semantic-text-secondary); font-size: 20px; box-sizing: border-box; }
.tile__name { margin-top: 4px; font-weight: 500; }
.tile__note { min-height: 14px; font-size: 11px; line-height: 14px; font-weight: 400; color: var(--semantic-text-secondary); }
.tile:hover:not(:disabled) { transform: translateY(-2px); border-color: var(--tint, var(--semantic-border-primary-hover)); }
.tile[aria-pressed="true"] { transform: translateY(-3px); border-color: var(--tint, var(--semantic-border-accent-selected)); box-shadow: 0 0 0 2px var(--tint, var(--semantic-border-accent-selected)), 0 6px 14px rgba(0, 0, 0, .25); }
.tile[aria-pressed="true"]::after { content: "\2713"; position: absolute; right: 5px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--tint, #7fee64); color: #10160f; font-size: 11px; line-height: 16px; font-weight: 700; text-align: center; }
.tile:disabled { opacity: .5; cursor: default; }
.stage--ballot .plate[data-seat] { pointer-events: auto; cursor: pointer; }
.stage--ballot .plate[data-seat]:hover { border-color: var(--semantic-border-accent-selected); }
.read { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 5px 10px; border: 1px dashed var(--semantic-border-primary); border-radius: 10px; }
.read .opts { gap: 6px; }
@media (min-width: 861px) { .read__why { display: none; } } /* on a wide bar the read is one row; what it is for is in its tooltip and under How to play */
.read__head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: var(--text-sm); color: var(--semantic-text-secondary); }
.read__head b { color: var(--semantic-text-primary); font-weight: 500; }
.read__head svg { width: 14px; height: 14px; }
.opt--read { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px 0 4px; border-style: dashed; }
.opt--read[aria-pressed="true"] { border-style: solid; }
.opt__face { width: 20px; height: auto; image-rendering: pixelated; border-radius: 6px; background: rgba(255, 255, 255, .7); }
/* liar's dice: the count after a call, on the same board */
.tally.tally--count { gap: 6px; padding: 7px 12px 8px; bottom: 8px; }
.tally--count .tally__head i { flex-basis: auto; }
.tally--count .tally__col { padding: 4px 4px 3px; }
.tally--count .tally__face { width: 26px; border-radius: 7px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .7); }
.tally--count .tally__name { margin-top: 0; }
.count__who { display: flex; align-items: center; gap: 6px; max-width: 100%; }
.count__foot { display: flex; align-items: center; gap: 6px; }
.count__head { align-items: center; }
.count__bid { display: inline-flex; align-items: center; }
.count__sum { margin-left: auto; padding: 1px 10px; border-radius: var(--radius-full); background: var(--semantic-background-recessed); white-space: nowrap; }
.count__sum b { font-size: var(--text-lg); font-variant-numeric: tabular-nums; }
.count__sum--made { background: color-mix(in srgb, #7fee64 22%, transparent); }
.tally--count .tally__col { flex-basis: 140px; gap: 3px; border-color: var(--semantic-border-secondary); }
.count__role { flex: none; padding: 0 5px; border-radius: var(--radius-full); background: var(--semantic-background-recessed); color: var(--semantic-text-secondary); font-size: 10px; line-height: 15px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.tally--count .count__col--you { border-color: #7fee64; background: color-mix(in srgb, #7fee64 8%, transparent); }
.count__col--new { animation: count-in 320ms ease-out; }
@keyframes count-in { from { transform: translateY(8px); opacity: .3; } }
.count__dice { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 22px; }
.count__dice .die { --s: 20px; padding: 2px; }
.count__dice .die:not(.die--hit):not(.die--down) { opacity: .38; }
.die--down { background: var(--semantic-background-recessed); border-style: dashed; }
.count__hits { font-size: var(--text-sm); line-height: var(--leading-sm); font-variant-numeric: tabular-nums; color: var(--semantic-text-accent); }
.tally--count .count__col--loser { border-color: #ff5a6a; background: color-mix(in srgb, #ff5a6a 12%, transparent); }
.count__col--loser::after { content: "LOSES A DIE"; position: absolute; left: 50%; top: -9px; transform: translateX(-50%) rotate(-8deg); padding: 1px 6px; border: 2px solid #ff5a6a; border-radius: 4px; background: rgba(24, 10, 12, .9); color: #ff7c88; font-size: 11px; line-height: 15px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; animation: tally-stamp 320ms ease-out; }
.count__verdict { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 10px; padding: 5px 12px; border-radius: 10px; background: var(--semantic-background-recessed); text-align: center; }
.count__verdict b { font-size: var(--text-lg); line-height: 24px; color: var(--semantic-text-primary-active); }
.count__verdict span { font-size: var(--text-base); color: var(--semantic-text-primary); }
.count__verdict--bad { background: color-mix(in srgb, #ff5a6a 20%, transparent); }
@media (prefers-reduced-motion: reduce) { .count__col--new, .count__col--loser::after { animation: none; } }
/* the count of the vote, where the caption usually is */
.tally { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); z-index: 5; width: min(720px, calc(100% - 32px)); box-sizing: border-box; padding: 10px 14px 12px; border-radius: var(--radius-lg); background: var(--semantic-background-floating); border: 1px solid var(--semantic-border-secondary); display: flex; flex-direction: column; gap: 8px; transition: bottom 160ms ease-out; }
.tally[hidden] { display: none; }
.tally__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: var(--text-sm); line-height: var(--leading-sm); color: var(--semantic-text-secondary); }
.tally__head b { color: var(--semantic-text-primary-hover); font-weight: 500; }
.tally__head span { color: var(--semantic-text-primary); }
.tally__head i { flex-basis: 100%; }
.tally__cols { display: flex; justify-content: center; gap: 8px; }
.tally__col { position: relative; flex: 0 1 104px; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px 5px; border-radius: 10px; border: 1px solid transparent; transition: opacity 300ms, background 200ms; }
.tally__col--lead { background: color-mix(in srgb, var(--tint, #7fee64) 14%, transparent); border-color: var(--tint, #7fee64); }
.tally__col--safe { opacity: .4; }
.tally__face { width: 44px; height: auto; image-rendering: pixelated; border-radius: 10px; background: color-mix(in srgb, var(--tint, #9aa39c) 32%, #fff); box-shadow: 0 0 0 2px rgba(255, 255, 255, .85); }
.tally__face--skip { display: grid; place-items: center; height: 44px; box-sizing: border-box; border: 2px dashed var(--semantic-border-primary); background: none; box-shadow: none; color: var(--semantic-text-secondary); font-size: 20px; }
.tally__name { max-width: 100%; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--text-sm); line-height: var(--leading-sm); font-weight: 500; }
.tally__count { font-size: var(--text-xl); line-height: 24px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--semantic-text-primary-active); }
.tally__voters { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; min-height: 22px; }
.tally__voter { width: 22px; height: auto; image-rendering: pixelated; border-radius: 6px; background: color-mix(in srgb, var(--tint, #9aa39c) 40%, #fff); }
.tally__voter--new { animation: tally-drop 460ms cubic-bezier(.2, 1.5, .4, 1); }
@keyframes tally-drop { from { transform: translateY(-30px) scale(.3); opacity: 0; } }
.tally__col--out::after { content: "VOTED OUT"; position: absolute; left: 50%; top: 16px; transform: translateX(-50%) rotate(-9deg); padding: 1px 6px; border: 2px solid #ff5a6a; border-radius: 4px; background: rgba(24, 10, 12, .88); color: #ff7c88; font-size: 11px; line-height: 15px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; animation: tally-stamp 320ms ease-out; }
@keyframes tally-stamp { from { transform: translateX(-50%) rotate(-9deg) scale(2.2); opacity: 0; } }
.stage:has(.echo--them:not([hidden])) .tally { bottom: 86px; }
/* a plain result on the same board: Mafia's dawn and ending, the winner of a dice game */
.tally--verdict { gap: 8px; }
.verdict__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 2px 10px; padding: 6px 12px; border-radius: 10px; background: var(--semantic-background-recessed); text-align: center; }
.verdict__head b { font-size: var(--text-lg); line-height: 24px; color: var(--semantic-text-primary-active); }
.verdict__head span { font-size: var(--text-base); color: var(--semantic-text-primary); }
.verdict__head--bad { background: color-mix(in srgb, #ff5a6a 20%, transparent); }
.verdict__head--good { background: color-mix(in srgb, #7fee64 18%, transparent); }
.verdict__col { flex-basis: 92px; }
.verdict__col--bad { border-color: #ff5a6a; background: color-mix(in srgb, #ff5a6a 12%, transparent); }
.verdict__label { font-size: var(--text-xs); line-height: var(--leading-xs); color: var(--semantic-text-secondary); text-transform: capitalize; }
.verdict__col--bad .verdict__label { color: #ff7c88; font-weight: 600; }
.verdict__stamp { position: absolute; left: 50%; top: 14px; transform: translateX(-50%) rotate(-9deg); padding: 1px 6px; border: 2px solid #ff5a6a; border-radius: 4px; background: rgba(24, 10, 12, .88); color: #ff7c88; font-size: 11px; line-height: 15px; font-weight: 800; letter-spacing: .06em; white-space: nowrap; animation: tally-stamp 320ms ease-out; }
@media (prefers-reduced-motion: reduce) { .tally__voter--new, .tally__col--out::after { animation: none; } .tile { transition: none; } }

/* the room is a shade darker at its very edges, under the name plates */
.overlay { box-shadow: inset 0 0 90px 0 rgba(20, 30, 50, .16); }

/* poker: cards in the page, the table summary, the raise controls */
.pcards { display: inline-flex; gap: 4px; vertical-align: middle; }
.pcard { display: inline-flex; align-items: baseline; gap: 1px; padding: 1px 5px; min-width: 30px; justify-content: center; border-radius: var(--radius-sm); background: #f6f1e6; color: #1b1a18; border: 1px solid rgba(0, 0, 0, .35); font-family: var(--font-mono, ui-monospace, monospace); font-size: var(--text-sm); line-height: 20px; }
.pcard b { font-weight: 600; }
.pcard i { font-style: normal; }
.pcard--red { color: #c0262d; }
.pcard--lg { min-width: 40px; padding: 4px 7px; font-size: var(--text-lg); line-height: 26px; border-radius: var(--radius-md); }
.pk-table { display: flex; flex-direction: column; gap: 6px; }
.chips { font-variant-numeric: tabular-nums; font-weight: 500; color: var(--semantic-text-primary-hover); }
.pk-slider { flex: 1 1 140px; min-width: 110px; accent-color: var(--semantic-background-accent-bold); }
.pk-amount { width: 96px; flex: none; font-variant-numeric: tabular-nums; }
.reveal__hand .sub { margin-left: 6px; }

/* ---- the alley (lobby.js): fills the window, drawn at a few hundred lines and scaled up in whole pixels */
#arcade3d { position: fixed; inset: 0; z-index: 30; overflow: hidden; background: black; transition: opacity 240ms; }
#arcade3d.arcade--out { opacity: 0; pointer-events: none; }
.arcade__view, .arcade__hud { position: absolute; left: 0; top: 0; display: block; image-rendering: pixelated; outline: none; touch-action: none; }
.arcade__hud, .arcade__veil { pointer-events: none; }
.arcade__veil { position: absolute; inset: 0; opacity: 0; }
.arcade__bar { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; gap: 8px; opacity: .72; }
.arcade__bar:hover, .arcade__bar:focus-within { opacity: 1; }
.arcade__name { position: absolute; left: 0; bottom: 0; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none; }
body.at-arcade .topbar { visibility: hidden; }

/* at a table: no top bar; its controls sit at the head of the side panel */
body.in-game .topbar { display: none; }
.side > .topbar__right { flex: none; justify-content: flex-end; flex-wrap: wrap; gap: 4px; padding: 8px 12px 0; }

/* open-face Chinese poker (ofc.js): a felt, the bot's board above yours, your dealt cards under
   them. Every card is sized from --u, the width of one of your cards, which is whatever lets the
   two boards and the dealt row fit the stage. */
.stage--ofc { background: radial-gradient(rgba(255, 255, 255, .08) 1.5px, transparent 2.5px) 0 0 / 24px 24px, radial-gradient(120% 95% at 50% 40%, #46c797 0%, #32ab80 55%, #218a67 100%); color: #fff; }
.stage--ofc .overlay, .stage--ofc .hud, .stage--ofc .caption { display: none; }
.stage--ofc::after, .stage--poker::after { content: ""; position: absolute; inset: 5px; border-radius: 18px; box-shadow: 0 0 0 24px #0d0e12, inset 0 0 0 2px rgba(255, 255, 255, .14), inset 0 0 70px rgba(0, 40, 30, .28); pointer-events: none; } /* the same rounded screen the other games sit behind */
.ofc { position: absolute; inset: 0; container-type: size; overflow: hidden; }
.ofc__table { --rows: 8.62; --fixed: 132px; --side: 380px;
  --u: clamp(16px, min(calc((100cqh - var(--fixed)) / var(--rows)), calc((100cqw - var(--side)) / 5.4)), 92px); --gap: max(3px, calc(var(--u) * .085));
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 16px; }
.ofc__table--fl { --rows: 10.1; }
.ofc__seat { position: relative; }
.ofc__seat--bot { --cw: calc(var(--u) * .72); }
.ofc__seat--you, .ofc__tray { --cw: var(--u); }
.ofc__board { position: relative; display: flex; flex-direction: column; gap: var(--gap); }
.ofc__row, .ofc__tray { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 16px; }
.ofc__cards { grid-column: 2; display: flex; justify-content: center; gap: var(--gap); min-width: calc(5 * var(--cw) + 4 * var(--gap)); }
.ofc__says { grid-column: 3; justify-self: start; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px 8px; font-size: clamp(12px, calc(var(--u) * .2), 16px); line-height: 1.2; font-weight: 500; color: rgba(255, 255, 255, .92); text-shadow: 0 1px 0 rgba(0, 0, 0, .25); }
.ofc__pay, .ofc__won { flex: none; padding: 1px 8px; border-radius: var(--radius-full); font-weight: 700; text-shadow: none; }
.ofc__pay { background: #ffd84d; color: #3d2f00; }
.ofc__won { background: #fff; color: #1b6e50; }
.ofc__row--open { cursor: pointer; }
.ofc__row--lost .kard { filter: brightness(.82) saturate(.8); }
.ofc__row--won .kard { box-shadow: 0 0 0 2px #ffd84d, 0 calc(var(--cw) * .06) calc(var(--cw) * .16) rgba(0, 0, 0, .25); }
.ofc__slot { flex: none; box-sizing: border-box; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); border: 2px dashed rgba(255, 255, 255, .34); background: rgba(0, 60, 40, .16); }
.ofc__slot--next { border-style: solid; border-color: rgba(255, 255, 255, .8); background: rgba(255, 255, 255, .14); animation: ofc-next 1.4s ease-in-out infinite; }
.ofc__row--open:hover .ofc__slot--next { background: rgba(255, 255, 255, .34); border-color: #fff; }
@keyframes ofc-next { 50% { background: rgba(255, 255, 255, .26); } }

/* who sits there: beside the board when there is room, over it when there is not */
.ofc__head { position: absolute; top: 50%; right: calc(50% + 2.5 * var(--cw) + 2 * var(--gap) + 20px); transform: translateY(-50%); display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; max-width: calc(50% - 2.5 * var(--cw) - 2 * var(--gap) - 24px); }
.ofc__face { width: clamp(40px, calc(var(--u) * .9), 64px); height: auto; image-rendering: pixelated; border-radius: var(--radius-lg); background: rgba(255, 255, 255, .22); box-shadow: 0 0 0 2px rgba(255, 255, 255, .5); }
.ofc__id { display: flex; align-items: baseline; gap: 8px; font-size: clamp(14px, calc(var(--u) * .26), 20px); line-height: 1.2; }
.ofc__id b { font-weight: 600; }
.ofc__total { padding: 0 10px; border-radius: var(--radius-full); background: rgba(0, 40, 28, .42); font-weight: 700; font-variant-numeric: tabular-nums; }
.ofc__total--up { background: #fff; color: #1b6e50; }
.ofc__total--down { background: rgba(60, 0, 10, .5); color: #ffc9cf; }
.ofc__tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ofc__tag { padding: 1px 9px; border-radius: var(--radius-full); background: rgba(0, 40, 28, .42); font-size: 12px; line-height: 18px; white-space: nowrap; }
.ofc__tag--fl { background: #ff7ac3; color: #40002a; font-weight: 600; }
.ofc__tag--bad { background: #ff5a6a; color: #fff; font-weight: 600; }
.ofc__seat--foul .kard { filter: grayscale(.7) brightness(.78); }
.ofc__seat--foul .ofc__board::after { content: "FOULED"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(-7deg); padding: .1em .55em; border: 3px solid #ff5a6a; border-radius: var(--radius-lg); background: rgba(40, 8, 14, .82); color: #ff8490; font-size: calc(var(--cw) * .44); font-weight: 800; letter-spacing: .14em; }
.ofc__mid { flex: none; min-height: 36px; display: flex; align-items: center; justify-content: center; }
.ofc__mid .banner { padding: 6px 18px; border: 0; background: rgba(0, 40, 28, .5); color: #fff; font-size: var(--text-base, 15px); font-weight: 600; }
.ofc__mid .banner--good { background: #fff; color: #1b6e50; }
.ofc__mid .banner--bad { background: #ff5a6a; color: #fff; }
.ofc__tray { min-height: calc(var(--cw) * 1.4); margin-top: 6px; }
.ofc__tray .ofc__cards { flex-wrap: wrap; row-gap: var(--gap); max-width: calc(7 * var(--cw) + 6 * var(--gap)); } /* a Fantasyland deal is 14 cards: two rows of seven */
.ofc__tray .ofc__says { color: rgba(255, 255, 255, .8); font-weight: 400; }

/* the cards */
.kard { position: relative; flex: none; display: block; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); background: linear-gradient(#fffefb, #f1ede4); color: #23252d; box-shadow: 0 calc(var(--cw) * .03) 0 rgba(0, 0, 0, .2), 0 calc(var(--cw) * .06) calc(var(--cw) * .16) rgba(0, 0, 0, .25); user-select: none; -webkit-user-select: none; }
.kard--red { color: #e23850; }
.kard b { position: absolute; left: 10%; top: 5%; font: 700 calc(var(--cw) * .46) / 1 var(--font-sans, ui-sans-serif, system-ui, sans-serif); letter-spacing: -.06em; }
.kard i, .kard em { position: absolute; display: block; }
.kard i { left: 10%; top: 40%; width: 28%; }
.kard em { right: 8%; bottom: 6%; width: 50%; }
.kard svg { display: block; width: 100%; height: auto; fill: currentColor; }
.kard--back { background: repeating-linear-gradient(45deg, rgba(255, 255, 255, .16) 0 4px, transparent 4px 8px), repeating-linear-gradient(-45deg, rgba(255, 255, 255, .16) 0 4px, transparent 4px 8px), #4f6df5; box-shadow: inset 0 0 0 calc(var(--cw) * .07) #fff, 0 calc(var(--cw) * .03) 0 rgba(0, 0, 0, .2), 0 calc(var(--cw) * .06) calc(var(--cw) * .16) rgba(0, 0, 0, .25); }
.kard--in { animation: kard-in 200ms cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes kard-in { from { transform: translateY(-14%) scale(.86); opacity: 0; } }
.kard--mine { cursor: pointer; box-shadow: 0 0 0 3px #ffd84d, 0 calc(var(--cw) * .06) calc(var(--cw) * .16) rgba(0, 0, 0, .25); }
.kard--pick { cursor: grab; transition: transform 120ms, opacity 120ms; }
.kard--pick:hover { transform: translateY(-5%); }
.kard--on, .kard--on:hover { transform: translateY(-12%); box-shadow: 0 0 0 3px #ffd84d, 0 calc(var(--cw) * .16) calc(var(--cw) * .2) rgba(0, 0, 0, .3); }
.kard--out, .kard--out:hover { opacity: .5; transform: rotate(5deg) scale(.94); filter: grayscale(.5); }
@media (prefers-reduced-motion: reduce) { .kard--in, .ofc__slot--next { animation: none; } }

/* Fantasyland. While you are in it the felt turns violet under a sky of stars; whoever is in it
   has a glow round their face; the row that earns it glows too; and earning it throws the word
   across the table in a burst of stars. */
.stage--ofc::before { content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity 900ms; pointer-events: none; background: radial-gradient(rgba(255, 255, 255, .1) 1.5px, transparent 2.5px) 0 0 / 24px 24px, radial-gradient(120% 95% at 50% 40%, #b884f7 0%, #8259e8 50%, #4d35b8 100%); }
.stage--fl::before { opacity: 1; }
.stage--fl .ofc__slot { background: rgba(40, 0, 90, .2); }
.stage--fl .ofc__total:not(.ofc__total--up), .stage--fl .ofc__tag:not(.ofc__tag--fl):not(.ofc__tag--bad), .stage--fl .ofc__mid .banner:not(.banner--good):not(.banner--bad) { background: rgba(30, 0, 70, .5); }
.ofc__stars { position: absolute; inset: 0; opacity: 0; transition: opacity 900ms; pointer-events: none; }
.stage--fl .ofc__stars { opacity: 1; }
.ofc__stars i, .ofc__fx i { position: absolute; aspect-ratio: 1; clip-path: polygon(50% 0, 62% 36%, 100% 38%, 70% 60%, 80% 96%, 50% 75%, 20% 96%, 30% 60%, 0 38%, 38% 36%); }
.ofc__stars i { width: calc(var(--s) * 14px); background: #fff6b0; animation: fl-twinkle 2.6s ease-in-out infinite alternate; animation-delay: var(--d); }
@keyframes fl-twinkle { from { opacity: .15; transform: scale(.7) rotate(-10deg); } to { opacity: .9; transform: scale(1.1) rotate(10deg); } }
.ofc__seat--fl .ofc__face { box-shadow: 0 0 0 2px #ff7ac3, 0 0 18px 4px rgba(255, 122, 195, .75); animation: fl-aura 1.5s ease-in-out infinite alternate; }
@keyframes fl-aura { to { box-shadow: 0 0 0 3px #ffd84d, 0 0 26px 8px rgba(255, 216, 77, .7); } }
.ofc__row--fl .kard { box-shadow: 0 0 0 3px #ff7ac3, 0 0 calc(var(--cw) * .3) calc(var(--cw) * .05) rgba(255, 122, 195, .85); }
.ofc__flq { flex: none; padding: 1px 9px; border-radius: var(--radius-full); background: linear-gradient(90deg, #ff7ac3, #ffd84d); color: #40002a; font-weight: 700; text-shadow: none; animation: fl-chip 1.1s ease-in-out infinite alternate; }
@keyframes fl-chip { to { transform: scale(1.07); } }
.ofc__fx { position: absolute; inset: 0; z-index: 5; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1.6cqmin; pointer-events: none; background: radial-gradient(70% 55% at 50% 50%, rgba(70, 24, 130, .82), rgba(70, 24, 130, 0) 100%); animation: fx-veil 3s both; }
.ofc__fxword { display: flex; font: 900 clamp(30px, 10.5cqw, 128px) / 1 var(--font-sans, ui-sans-serif, system-ui, sans-serif); letter-spacing: .02em; }
.ofc__fxword span { display: inline-block; background: linear-gradient(#fffbd0, #ffd84d 48%, #ff7ac3); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 .05em 0 #6a1b86) drop-shadow(0 .1em .1em rgba(0, 0, 0, .35)); animation: fx-letter 3s both; animation-delay: calc(var(--i) * 45ms); }
@keyframes fx-letter { 0% { transform: translateY(70%) scale(.2) rotate(-14deg); opacity: 0; } 13% { transform: translateY(-14%) scale(1.16) rotate(3deg); opacity: 1; } 20% { transform: none; } 45% { transform: translateY(-7%); } 58% { transform: none; } 84% { transform: none; opacity: 1; } 100% { transform: translateY(-34%) scale(1.08); opacity: 0; } }
.ofc__fxsub { padding: 0 16px; text-align: center; font-size: clamp(14px, 2.5cqw, 24px); font-weight: 600; color: #fff; text-shadow: 0 2px 8px rgba(40, 0, 80, .7); animation: fx-sub 3s both; }
@keyframes fx-sub { 0%, 18% { opacity: 0; transform: translateY(40%); } 30%, 84% { opacity: 1; transform: none; } 100% { opacity: 0; } }
.ofc__fx i { left: 50%; top: 50%; width: calc(var(--s) * 2.6cqmin); background: var(--c); animation: fx-star 2s cubic-bezier(.15, .7, .3, 1) both; animation-delay: calc(180ms + var(--d)); }
@keyframes fx-star { 0% { transform: translate(-50%, -50%) scale(0); opacity: 1; } 65% { opacity: 1; } 100% { transform: translate(calc(-50% + var(--x)), calc(-50% + var(--y))) scale(1) rotate(220deg); opacity: 0; } }
@keyframes fx-veil { 0% { opacity: 0; } 8% { opacity: 1; } 86% { opacity: 1; } 100% { opacity: 0; } }
.ofc__fx--bot .ofc__fxword { font-size: clamp(24px, 7cqw, 84px); }
.ofc__fx--bot .ofc__fxword span { background-image: linear-gradient(#e9f6ff, #9fd8ff 48%, #b78bff); }
/* cards being dealt come up one after another; a face-down board turns over a card at a time */
.ofc__tray .kard--in { animation: kard-deal 360ms cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i, 0) * 45ms); }
@keyframes kard-deal { from { transform: translateY(70%) rotate(9deg) scale(.8); opacity: 0; } }
.kard--flip { animation: kard-flip 420ms cubic-bezier(.2, 1.2, .4, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }
@keyframes kard-flip { from { transform: perspective(400px) rotateY(88deg) scale(.92); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .ofc__fxword span, .ofc__fx i, .ofc__stars i, .ofc__flq, .ofc__seat--fl .ofc__face, .ofc__tray .kard--in, .kard--flip { animation: none; } .ofc__fx i { display: none; } }

.ofc__logcard { display: inline-flex; align-items: center; gap: 3px; margin-right: 6px; }
.ofc-sum { display: flex; flex-direction: column; gap: 2px; }

/* a narrow stage (a phone): names over the boards, and what a row makes written across its foot */
@container (max-height: 480px) { /* a short stage: the bot's name, its label and its tags stack up beside its board, so each is drawn a little smaller */
  .ofc__head { gap: 2px; }
  .ofc__face { width: 32px; }
  .ofc__made { font-size: 10px; line-height: 1.35; }
}
@container (max-width: 700px) and (max-height: 480px) { /* a phone on its side: the wide layout, drawn small, since there is no height for names above the boards */
  .ofc__table { --side: 290px; padding: 8px 10px; gap: 4px; }
  .ofc__face { width: 30px; }
  .ofc__says { font-size: 11px; gap: 2px 5px; }
  .ofc__flq { flex: 0 1 auto; max-width: 100%; text-align: center; line-height: 1.15; } /* the long chip may take two lines here */
}
@container (max-width: 700px) and (min-height: 481px) { /* a phone held upright: names above the boards, what a row makes on its foot */
  .ofc__table { --fixed: 190px; --side: 28px; padding: 12px 10px; gap: 6px; }
  .ofc__head { position: static; transform: none; max-width: none; flex-direction: row; align-items: center; justify-content: center; gap: 8px; margin-bottom: 4px; text-align: left; }
  .ofc__face { width: 26px; }
  .ofc__tags { flex-direction: row; }
  .ofc__row, .ofc__tray { position: relative; display: flex; justify-content: center; }
  .ofc__cards { min-width: 0; }
  .ofc__row .ofc__says { position: absolute; left: 50%; bottom: -3px; transform: translateX(-50%); padding: 0 8px; border-radius: var(--radius-full); background: rgba(0, 40, 28, .8); font-size: 11px; line-height: 16px; white-space: nowrap; text-shadow: none; z-index: 1; }
  .ofc__row .ofc__says:empty { display: none; }
  .ofc__tray { flex-direction: column; align-items: center; gap: 2px; }
  .ofc__tray .ofc__says { font-size: 11px; min-height: 14px; }
}
.game--ofc .action { min-height: 96px; box-sizing: border-box; }
/* The other games' bars keep one height too, the height of their tallest state, on a screen with
   room for it: a bar that grew for your turn and shrank after it resized the table each time. */
@media (min-width: 861px) and (min-height: 640px) {
  .game--dice .action { min-height: 181px; box-sizing: border-box; }
  .game--poker .action { min-height: 139px; box-sizing: border-box; }
  .game--mafia .action { min-height: 200px; box-sizing: border-box; }
} /* the same height whoever's turn it is, so the cards do not change size */
@media (max-width: 860px) and (orientation: portrait) { .game--ofc, .game--poker { grid-template-rows: 62vh auto minmax(0, 1fr); } } /* two boards need more of a phone's height than a round table does */

/* poker (poker.js): an oval felt on a rug, a face and a name for each player round it, the shared
   cards and the pot in the middle, your own two cards at the foot. Like open-face, every size
   comes from --u, the width of one of your cards. */
.stage--poker { background: radial-gradient(rgba(255, 255, 255, .08) 1.5px, transparent 2.5px) 0 0 / 24px 24px, radial-gradient(120% 95% at 50% 46%, #46c797 0%, #32ab80 55%, #218a67 100%); color: #fff; } /* the same felt as open-face: the two card tables are one family */
.stage--poker .overlay, .stage--poker .hud { display: none; }
.stage--poker .caption { top: 12px; bottom: auto; z-index: 4; padding: 8px 14px 10px; gap: 4px; } /* what is said reads at the head of the table, clear of the cards */
.stage--poker .caption__line { font-size: var(--text-lg); line-height: 24px; }
.pk { position: absolute; inset: 0; container-type: size; overflow: hidden; }
.pk__felt { position: absolute; left: 19%; right: 19%; top: 37%; bottom: 27%; border-radius: 999px; background: rgba(255, 255, 255, .08); box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .38), 0 0 0 max(10px, 2cqmin) rgba(0, 50, 36, .14); } /* the table, marked on the felt as an oval line */
.pk__table { --u: clamp(22px, min(11cqh, 7cqw), 84px); --gap: max(3px, calc(var(--u) * .08)); position: absolute; left: 0; right: 0; top: 20%; bottom: 10px; }
.pk__seat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 4px; --cw: calc(var(--u) * .5); }
.pk__seat--you { transform: translate(-50%, -100%); flex-direction: column-reverse; --cw: var(--u); }
.pk__who { position: relative; display: flex; align-items: center; gap: 6px; }
.pk__face { flex: none; width: clamp(30px, calc(var(--u) * .7), 48px); height: auto; image-rendering: pixelated; border-radius: var(--radius-lg); background: color-mix(in srgb, var(--tint, #7fee64) 30%, #fff); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(0, 0, 0, .25); transition: box-shadow 150ms; }
.pk__plate { display: grid; grid-template-columns: auto auto; column-gap: 10px; align-items: baseline; padding: 3px 10px; border-radius: var(--radius-lg); background: rgba(22, 26, 34, .9); line-height: 1.25; font-size: clamp(11px, calc(var(--u) * .21), 14px); white-space: nowrap; }
.pk__plate b { font-weight: 600; }
.pk__stack { justify-self: end; color: #ffd84d; font-weight: 600; font-variant-numeric: tabular-nums; }
.pk__stack:empty { display: none; }
.pk__model, .plate__model { display: inline-flex; align-items: center; gap: 5px; color: #b9ffab; font-size: .84em; font-weight: 500; } /* the model in this seat, with Modal's green beside it */
.pk__model { grid-column: 1 / -1; }
.pk__model::before, .plate__model::before, .side__modal::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: #7fee64; box-shadow: 0 0 6px #7fee64; }
.pk__hand { display: flex; align-items: center; gap: 6px; } /* the cards, and the bet beside them on the side nearer the middle of the table */
.pk__seat--right .pk__hand { flex-direction: row-reverse; }
.pk__cards { display: flex; gap: var(--gap); min-height: calc(var(--cw) * 1.4); }
.pk__dealer { position: absolute; left: -7px; bottom: -6px; width: 17px; height: 17px; border-radius: 50%; background: #fff; color: #1b1a18; font-size: 10px; line-height: 17px; font-weight: 700; text-align: center; box-shadow: 0 1px 3px rgba(0, 0, 0, .35); } /* the dealer's button, on the corner of the face */
.pk .kard--in { animation-delay: calc(var(--i, 0) * 80ms); }
.pk__tags { display: flex; gap: 4px; }
.pk__tag { padding: 0 8px; border-radius: var(--radius-full); background: rgba(22, 26, 34, .85); font-size: 11px; line-height: 17px; white-space: nowrap; }
.pk__tag--allin { background: #ff5a6a; font-weight: 600; }
.pk__tag--hand { background: #ffd84d; color: #3d2f00; font-weight: 600; } /* the kind of hand shown down: "two pair" */
.pk__bet { display: inline-flex; align-items: center; gap: 5px; padding: 0 9px 0 4px; border-radius: var(--radius-full); background: rgba(22, 26, 34, .85); font-size: 12px; line-height: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pk__bet i, .pk__pot i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: #e8505b; box-shadow: inset 0 0 0 2px #fff, 0 1px 0 rgba(0, 0, 0, .3); }
.pk__seat--folded .pk__cards { opacity: .35; }
.pk__seat--folded .pk__face { filter: grayscale(.7); opacity: .85; }
.pk__seat--out { opacity: .45; filter: grayscale(1); }
.pk__seat--on .pk__face { box-shadow: 0 0 0 3px #ffd84d, 0 0 16px 4px rgba(255, 216, 77, .85); }
/* who took the pot: a gold ring and what they won at their seat, and the hands that lost dimmed */
.pk__seat--won .pk__face { box-shadow: 0 0 0 3px #ffd84d, 0 0 22px 8px rgba(255, 216, 77, .95); animation: pk-won 700ms ease-in-out infinite alternate; }
.pk__seat--won .pk__plate { box-shadow: 0 0 0 2px #ffd84d; }
.pk__seat--won .kard { box-shadow: 0 0 0 2px #ffd84d, 0 2px 6px rgba(0, 0, 0, .3); }
.pk__won { position: absolute; left: 50%; top: -24px; transform: translateX(-50%); padding: 0 10px; border-radius: var(--radius-full); background: #ffd84d; color: #3d2f00; font-size: 13px; line-height: 21px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; z-index: 3; box-shadow: 0 2px 8px rgba(0, 0, 0, .3); animation: pk-won-in 420ms cubic-bezier(.2, 1.5, .4, 1); }
.pk__seat--lost .pk__cards, .pk__seat--lost .pk__face { opacity: .5; filter: saturate(.6); }
@keyframes pk-won { to { transform: scale(1.06); } }
@keyframes pk-won-in { from { transform: translate(-50%, 14px) scale(.5); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pk__seat--won .pk__face, .pk__won { animation: none; } }
.pk__seat--talk .pk__face { animation: pk-talk 420ms ease-in-out infinite alternate; }
@keyframes pk-talk { to { transform: translateY(-3px) scale(1.06); } }
.pk__dots { position: absolute; left: 4px; top: -13px; display: inline-flex; gap: 3px; padding: 4px 6px; border-radius: var(--radius-full); background: #fff; }
.pk__dots i { width: 4px; height: 4px; border-radius: 50%; background: #55606e; animation: pk-dot 900ms ease-in-out infinite; }
.pk__dots i:nth-child(2) { animation-delay: 150ms; } .pk__dots i:nth-child(3) { animation-delay: 300ms; }
@keyframes pk-dot { 30% { transform: translateY(-3px); } 60% { transform: none; } }
.pk__emote { position: absolute; left: 100%; top: -9px; margin-left: 4px; padding: 0 8px; border-radius: var(--radius-full); background: #fff3c4; color: #5a4300; font-size: 11px; line-height: 18px; font-weight: 600; white-space: nowrap; z-index: 2; }
.pk__mid { position: absolute; left: 50%; top: 41%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 6px; --cw: calc(var(--u) * .86); }
.pk__pot { display: inline-flex; align-items: center; padding: 1px 12px 1px 6px; border-radius: var(--radius-full); background: rgba(0, 40, 28, .5); font-size: clamp(12px, calc(var(--u) * .24), 16px); line-height: 1.5; }
.pk__pot b { margin-left: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pk__pot i + i { margin-left: -6px; background: #4fb3ff; } .pk__pot i + i + i { background: #ffd24a; }
.pk__pot--empty { opacity: .65; } .pk__pot--empty i { display: none; } .pk__pot--empty b { margin-left: 6px; }
.pk__board { display: flex; gap: var(--gap); }
.pk__slot { flex: none; box-sizing: border-box; width: var(--cw); height: calc(var(--cw) * 1.4); border-radius: calc(var(--cw) * .1); border: 2px dashed rgba(255, 255, 255, .32); background: rgba(0, 60, 40, .16); }
.pk__say { position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-50%); width: max-content; max-width: 56cqw; display: flex; align-items: flex-start; justify-content: center; } /* hung under the shared cards, so a result of two lines grows down and does not push the pot up into a seat */
.pk__say .banner { max-width: 56cqw; padding: 4px 16px; border: 0; background: rgba(0, 40, 28, .55); color: #fff; font-weight: 600; text-align: center; text-wrap: balance; } /* a long result takes two lines inside the oval instead of running off the felt */
.pk__say .banner--good { background: #fff; color: #1b6e50; }
.pk__say .banner--bad { background: #ff5a6a; color: #fff; }
@container (max-width: 640px) { /* a phone: the seats come in from the edges and say less */
  .pk__table { left: 9%; right: 9%; }
  .pk__felt { left: 12%; right: 12%; }
  .pk__plate { padding: 1px 7px; }
  .pk__say .banner { white-space: normal; font-size: var(--text-xs); }
}
@container (max-width: 619px) { /* held upright, or on its side with the controls beside the table: the stack goes under the name, so a seat is narrow enough to stand beside the shared cards */
  .pk__table { top: 27%; } /* below the line being spoken, which takes two rows of text here */
  .pk__plate { grid-template-columns: auto; }
  .pk__stack { justify-self: start; }
  .pk__say { max-width: 33cqw; text-align: center; }
  .pk__say .banner { padding: 3px 10px; }
}
@media (prefers-reduced-motion: reduce) { .pk__seat--talk .pk__face, .pk__dots i { animation: none; } }
.pk__seat--right .pk__emote { left: auto; right: 100%; margin: 0 4px 0 0; } /* a seat on the right reacts toward the table, not off the edge of it */
.stage--poker .caption__thought { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
@media (max-width: 620px) { .stage--poker .caption__thought { -webkit-line-clamp: 1; } .stage--poker .caption__line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; } } /* on a phone the caption keeps to the head of the table: the whole thought is in the log */ /* a long private thought must not grow the caption down over the far seats */
@container (max-height: 540px) and (min-width: 620px) { .pk__table { top: 17%; } }
@container (max-height: 470px) { .pk__say .banner { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 2px 10px; } } /* a phone on its side: the result keeps to two lines, winner first */
@container (max-height: 540px) { /* a short stage (a small laptop, a phone): every seat says less */
  .pk__model { display: none; }
  .pk__seat { gap: 2px; }
  .pk__say { min-height: 0; }
  .pk__tags { margin-top: calc(var(--cw) * -.5); z-index: 1; } /* the label sits on the foot of the two cards, whose corners are what is read */
  .pk__seat--you .pk__tags { margin: 0; position: absolute; left: calc(100% + 6px); bottom: 3px; } /* yours goes beside your name: your cards are the ones that must stay whole */
}

/* A phone on its side: there is no height for the table above the controls, so the table takes
   the left at full height and the controls and the panel go beside it. */
@media (max-height: 500px) and (orientation: landscape) {
  .game { grid-template-columns: minmax(0, 1fr) minmax(250px, 38%); grid-template-rows: auto minmax(0, 1fr); }
  .stage { grid-column: 1; grid-row: 1 / span 2; }
  .action { grid-column: 2; grid-row: 1; padding: 8px 12px 10px; max-height: calc(100vh - 52px); overflow-y: auto; border-left: 1px solid var(--semantic-border-divider); border-top: 0; }
  .side { grid-column: 2; grid-row: 2; border-left: 1px solid var(--semantic-border-divider); border-top: 1px solid var(--semantic-border-divider); }
  .game--ofc .action { min-height: 0; }
  /* Mafia's faces to choose from need room: while they are up the controls take more of the width, and everything in them is drawn smaller */
  .game:has(#action .ballot) { grid-template-columns: minmax(0, 1fr) minmax(250px, 56%); }
  .ballot { gap: 5px; } .ballot-row { gap: 8px; }
  .tile { min-width: 50px; padding: 4px 5px 2px; } .tile__face { width: 28px; } .tile__face--none { height: 28px; font-size: 14px; } .tile__name { margin-top: 2px; font-size: 12px; line-height: 15px; } .tile__note { display: none; }
  .read { padding: 5px 8px; gap: 4px; } .read__why { display: none; } .opt--read { height: 24px; font-size: 12px; }
}
