/* On a Roll's table (the mockups David approved, 2026-11-13). A laptop: the
   tray and the dock at the left, the shared score pad filling the rest. A
   phone: the players' chips, your card, then the tray and the dock under
   your thumb. Things stay put: the tray's five places and the dock's two
   buttons never move; the pad's rows share its height out evenly. Built on
   the room's structure (games/room/room.css), from on-a-roll.css's tokens. */

/* ── the frame ───────────────────────────────────────────────────────── */
.felt.oar { position: relative; height: calc(100dvh - 2 * var(--frame)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.felt.oar.docked { grid-template-columns: minmax(0, 1fr) 300px; }
.oar .logdock { min-height: 0; display: flex; flex-direction: column; }
.oar .logdock:empty { display: none; }
.oar .logdock .gamelog { flex: 1; }
.oar .tablemain { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.oar .gamelog.drawer { position: absolute; z-index: 30; right: 14px; top: 64px; bottom: 24px; width: min(360px, calc(100% - 28px)); box-shadow: -10px 10px 30px rgba(60, 35, 15, .3); }
.oar .logbtn.on { background: var(--pick-tint); box-shadow: var(--pick-ring); }
.oar .bar .more svg { display: block; }
.oar .bar .title { font: var(--display-weight) var(--t-bar, 18px)/1.2 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.oar .owhere { font: 500 var(--t-bar, 17px)/1.2 var(--ui-font); color: var(--soft); }

/* ── one layout, every step ─────────────────────────────────────────── */
.ostage { position: relative; flex: 1; min-height: 0; display: grid; gap: 18px; grid-template-columns: minmax(320px, 400px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr); grid-template-areas: "side pad"; align-items: start; }
.ochips { grid-area: chips; display: none; }
.opadcell { grid-area: pad; min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; }
.oside { grid-area: side; display: grid; gap: 12px; align-content: start; min-width: 0; }
.oseatslot:empty { display: none; }
.oseatslot > .seatbar { padding: 10px 14px; border-radius: var(--panel-radius); background: var(--panel); border: var(--panel-edge); }
.onote { margin: 0; font: 500 14px/1.4 var(--ui-font); color: #3a2a17; background: rgba(253, 248, 236, .6); border-radius: 10px; padding: 8px 12px; }
.onote:empty, .onote[hidden] { display: none; }

/* ── the tray: blue felt in a wooden rim, five fixed places ─────────── */
.otray { border-radius: 18px; padding: 12px; box-sizing: border-box; --die: 58px;
  background: linear-gradient(var(--rim), var(--rim-lo)); box-shadow: 0 10px 24px -12px rgba(50, 30, 10, .7), inset 0 1px 0 rgba(255, 255, 255, .25); }
.ofelt { border-radius: 10px; padding: 10px 12px 28px; display: grid; gap: 10px; overflow: hidden;
  background: radial-gradient(ellipse at 50% 30%, var(--felt-hi), var(--felt) 55%, var(--felt-lo)); box-shadow: inset 0 3px 10px rgba(0, 0, 0, .45); }
.owhose { margin: 0; min-height: 17px; font: 700 13px/1.3 var(--ui-font); color: var(--felt-ink); letter-spacing: .03em; text-align: center; opacity: .92; }
.oplaces { display: grid; grid-template-columns: repeat(5, var(--die)); justify-content: space-between; align-items: center; min-height: calc(var(--die) + 8px); }
/* (the dice kit sets --die on each die: here the tray's size is theirs, or a
   phone's tray laid out 36px columns under 54px dice, past its edge) */
.otray .house-die { --die: inherit; }
/* (a kept die lifts 10px, its ring 4px further: room for that under the label) */
.oplaces { margin-top: 8px; }
.oplaces .house-die.blank { opacity: 1; }
.oplaces .house-die.blank svg { opacity: .14; }

/* ── the dock: what to do, and the two buttons in fixed slots ────────── */
.odock { flex: none; display: grid; gap: 10px; }
.osay { display: flex; align-items: center; gap: 10px; min-height: 52px; box-sizing: border-box; padding: 8px 14px; border-radius: 12px; background: var(--panel); border: 2px solid var(--pad-edge); }
.odock.live .osay { border-color: var(--turn); }
.oline { margin: 0; flex: 1; min-width: 0; font: 500 15px/1.35 var(--ui-font); }
.oline b { font-weight: 700; }
.oleft { font: 700 13px/1 var(--ui-font); color: var(--soft); white-space: nowrap; }
.oleft:empty { display: none; }
.obtns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.obtns .btn { min-height: 48px; font-size: 17px; }
.obtns .btn.alt { background: rgba(253, 248, 236, .75); }
.obtns .btn.off { opacity: .38; }

/* ── your card (a phone, or a player's card from their chip) ─────────── */
.ocard { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.ohalves { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 10px; padding: 0 10px 4px; min-height: 0; }
.ohalf { display: grid; grid-template-rows: auto repeat(8, minmax(30px, 1fr)); min-height: 0; }
.ohalf .obox, .ohalf .osub { min-height: 0; }
.ocardsheet .ocard { box-shadow: none; }
.ocardsheet .ohalf { grid-template-rows: auto repeat(8, 38px); }

/* ── the shared score pad (a laptop): a row per box, a column per player ── */
.osheet { flex: 1; min-height: 0; display: grid; grid-template-rows: auto minmax(0, 1fr); padding-bottom: 6px; }
.ogrid { display: grid; grid-template-rows: 40px repeat(19, minmax(22px, 1fr)); min-height: 0; padding: 0 0 2px; }
.orow { display: grid; grid-template-columns: minmax(150px, 1.5fr) repeat(var(--n, 4), minmax(52px, 1fr)); align-items: stretch; border-bottom: 1px solid var(--pad-rule); min-height: 0; }
.olab { display: flex; align-items: center; gap: 6px; padding: 0 10px 0 12px; font: 600 14px/1.1 var(--ui-font); white-space: nowrap; overflow: hidden; min-width: 0; }
.olab small { font: 500 12px/1 var(--ui-font); color: var(--soft); overflow: hidden; text-overflow: ellipsis; }
.olab.osec { font: 700 11px/1 var(--ui-font); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.osecrow { border-bottom-color: transparent; }
.ohrow { border-bottom: 2px solid var(--ink); }
.ocol { display: flex; align-items: center; justify-content: center; gap: 5px; min-width: 0; font: 700 14px/1.1 var(--ui-font); padding: 0 4px; }
.ocol span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocol small { font: 700 13px/1 var(--ui-font); color: var(--good); }
.ocol.you { box-shadow: inset 0 -3px 0 var(--turn); }
.ocol.turn { background: color-mix(in srgb, var(--turn) 10%, transparent); }
.ocell { all: unset; box-sizing: border-box; display: flex; align-items: center; justify-content: center; min-width: 0; border-left: 1px solid var(--pad-rule);
  font: 700 19px/1 var(--hand); color: var(--pencil); font-variant-numeric: tabular-nums;
  padding: .22em 1px 0 0; /* (Kalam's figures sit high and lean right: this centers their ink) */ }
.ocell.you { background: rgba(255, 255, 255, .5); }
.ocell.zero { color: var(--pencil-soft); }
.ocell.shut { color: var(--pencil-soft); }
button.ocell { cursor: pointer; }
button.ocell:hover { background: var(--pick-tint); }
button.ocell:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.ocell.preview { box-shadow: inset 0 0 0 2px var(--ink); background: var(--pick-tint); }
.ocell.preview .ohint { font: 700 19px/1 var(--hand); color: var(--pencil); }
.ocell.fresh { background: var(--fresh); }
.ocell.glow { box-shadow: inset 0 0 0 2px #f5c518; background: rgba(255, 240, 180, .7); }
.ocell .ohint { min-width: 0; text-align: center; font-size: 15px; }
.ocell .ostamp { font-size: 15px; padding: 2px 5px; }
.ogo { font: 600 12px/1 var(--ui-font); color: var(--pencil-soft); white-space: nowrap; }
.osumrow { border-bottom: 2px solid var(--ink); }
.ototalrow { border-bottom: 0; border-top: 1px solid var(--ink); }
.olab.ototal { font: 400 18px/1 var(--display); }
.ocell.ototal { font-size: 25px; }

/* ── the final tally ─────────────────────────────────────────────────── */
.otally { flex: 1; min-height: 0; display: grid; grid-template-rows: auto 1fr; padding-bottom: 8px; }
.otgrid { display: grid; grid-template-rows: auto repeat(5, minmax(40px, auto)); align-content: start; padding: 0 10px; }
.otrow { display: grid; grid-template-columns: minmax(96px, 1.2fr) repeat(var(--n, 4), minmax(0, 1fr)); align-items: center; border-bottom: 1px solid var(--pad-rule); }
.otrow .olab { white-space: normal; flex-direction: column; align-items: flex-start; gap: 2px; padding: 6px 4px 6px 2px; }
.otnum { display: grid; justify-items: center; gap: 3px; font: 700 22px/1 var(--hand); color: var(--pencil); text-align: center; min-width: 0; }
.othead { border-bottom: 2px solid var(--ink); padding: 6px 0; }
.othead .otnum { font: 700 13px/1.1 var(--ui-font); color: var(--ink); }
.othead .otnum span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.otplus { color: var(--turn); }
.otrow.pending .otnum { color: var(--pencil-soft); opacity: .5; }
.otrow.ottot { border-bottom: 0; border-top: 2px solid var(--ink); min-height: 52px; }
.otrow.ottot .olab { font: 400 18px/1 var(--display); }
.otrow.ottot .otnum { font-size: 30px; }
.otnum.win { color: var(--turn); }

/* ── five of a kind's band (announce.js) ──────────────────────────────── */
/* (the words first, the five dice lined up under them: a phone's width can't take them side by side) */
.oarbanner .house-announce-band { flex-direction: column; gap: 12px; }
.oarbanner .house-announce-art { order: 2; }
.oarbanner .obanddice { display: flex; gap: 8px; justify-content: center; --die: 44px; }
.oarbanner .obanddice .house-die { --die: 44px; }

/* ── the result sheet ───────────────────────────────────────────────── */
.oresult { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.oresult li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 8px 4px; border-top: 1px solid #e4d6bf; }
.oresult li.won .orname { font-weight: 800; }
.orname { min-width: 0; font-weight: 600; text-align: left; }
.orname small { display: block; font-weight: 500; color: var(--soft); }
.oresult .ofig { font: 700 26px/1 var(--hand); font-variant-numeric: tabular-nums; }

/* ── a phone: the chips, your card, then the tray and the dock ───────── */
@media (max-width: 640px) {
  #app { padding: 0; }
  .felt.oar { height: 100dvh; gap: 0; }
  .oar .tablemain { gap: 6px; }
  .felt.oar .bar .tools { display: none; }
  .felt.oar .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  .oar .owhere { display: none; }
  .ostage { gap: 8px; padding: 0 10px 10px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: "chips" "pad" "side"; }
  .ochips { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 6px; }
  .oside { gap: 8px; }
  /* (five dice across the tray's own width, gaps and all) */
  .otray { padding: 8px; container-type: inline-size; --die: min(56px, calc((100cqi - 32px) / 5)); }
  .oplaces { margin-top: 14px; }
  /* (the card keeps its rows a finger's height; a short phone scrolls it in its own place:
     its middle row at least its rows, or they ran under the Total, playtest 3) */
  .opadcell { overflow-y: auto; overscroll-behavior: contain; display: block; }
  .ocard { height: 100%; min-height: max-content; grid-template-rows: auto minmax(min-content, 1fr) auto; }
  .ohalf { grid-template-rows: auto repeat(8, minmax(min-content, 1fr)); }
  .ohalf .obox { min-height: 44px; }
  .obox .on, .osub .on { white-space: normal; }
  .ofelt { padding: 4px 10px 26px; gap: 4px; }
  .ochip .obit { display: none; }
  .ostage { gap: 6px; }
  .opad .ohead { padding: 14px 10px 2px; }
  .ogrand { padding: 5px 8px; }
  .osay { min-height: 48px; padding: 6px 12px; }
  .oline { font-size: 15px; }
  .obtns .btn { min-height: 46px; }
  .many .ochip .obit { display: none; }
  .ohalves { gap: 0 8px; padding: 0 6px 4px; }
  .obox { padding: 0 4px 0 6px; gap: 4px; }
  .obox .on, .osub .on { font-size: 14px; line-height: 1.12; }
  .obox .on small, .osub .on small { font-size: 11.5px; }
  .ov { min-width: 30px; font-size: 21px; }
  .ohint { min-width: 30px; }
}
@media (max-width: 360px) {
  .obox .on, .osub .on { font-size: 13px; }
  .ov { font-size: 19px; }
}
@media (max-width: 640px) and (max-height: 700px) {
  .ochip .obit { display: none; }
  .ofelt { padding-bottom: 24px; }
}
/* a phone on its side: the laptop's two columns, the pad scrolling in its own place */
@media (max-height: 520px) and (min-width: 560px) {
  #app { padding: 0; }
  .felt.oar { height: 100dvh; border: 0; border-radius: 0; gap: 0; }
  .felt.oar .bar .tools { display: none; }
  .felt.oar .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 32px; }
  .ostage { grid-template-columns: minmax(280px, 340px) minmax(0, 1fr); gap: 10px; padding: 0 8px 8px; }
  .opadcell { overflow: auto; }
  .osheet, .ogrid { min-height: 620px; }
  .otray { --die: 46px; padding: 8px; }
  .onote { display: none; }
}
@media (pointer: coarse) {
  .felt.oar .bar .btn { min-height: 44px; }
}
