/* Wall to Wall's table (mockups v3, David's calls of 2026-11-12 and 13): the
   others in a strip at the left, the displays in a ring on a wooden
   turntable with the center truly in its middle, and your board taking the
   rest; on a phone, the others, the ring and your board, top to bottom.
   Things stay put: the sizes (--tile, --ring, --dt, --ct, --mini, --side)
   are set once for the pane by table.js fit(), never during a turn, and
   the dock keeps one height with its buttons in fixed places. Built on the
   room's structure (games/room/room.css), from wall-to-wall.css's tokens. */

/* ── the frame ───────────────────────────────────────────────────────── */
.felt.wtw { position: relative; height: calc(100dvh - 2 * var(--frame)); min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.felt.wtw.docked { grid-template-columns: minmax(0, 1fr) 320px; }
/* a studio shelf along the top of the wall behind the table */
.felt.wtw::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 10px; pointer-events: none; border-radius: var(--frame-radius, 0) var(--frame-radius, 0) 0 0;
  background: linear-gradient(#b48a57, #8f6a3e); box-shadow: inset 0 -2px 3px rgba(60, 35, 15, .25); }
.wtw .logdock { min-height: 0; display: flex; flex-direction: column; }
.wtw .logdock:empty { display: none; }
.wtw .logdock .gamelog { flex: 1; }
.wtw .tablemain { display: flex; flex-direction: column; gap: 8px; min-height: 0; min-width: 0; }
.wtw .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); }
.wtw .logbtn.on { background: var(--pick-tint); box-shadow: var(--pick-ring); }
.wtw .bar .more svg { display: block; }
.wtw .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; }
.wtw .wwhere { font: 500 var(--t-bar, 17px)/1.2 var(--ui-font); color: var(--soft); }

/* ── one layout, every step: its places never change ────────────────── */
.wstage { position: relative; flex: 1; min-height: 0; display: grid; gap: 18px; grid-template-columns: var(--side, 216px) var(--ring, 440px) minmax(0, 1fr); grid-template-areas: "others ring board"; align-items: center; }
.wtw.phone .wstage { gap: 8px; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto auto 1fr; grid-template-areas: "others" "ring" "board" "."; align-items: start; }
.wothers { grid-area: others; display: grid; gap: 10px; align-content: center; min-width: 0; }
.wtw.phone .wothers { grid-template-columns: repeat(var(--others, 2), minmax(0, 1fr)); gap: 8px; }
.wringcell { grid-area: ring; display: grid; place-items: center; min-width: 0; position: relative; }
.wboardcell { grid-area: board; display: grid; place-items: center; min-width: 0; }

/* ── the displays: kiln shelves in a ring, the center in the middle ──── */
.wring { position: relative; width: var(--ring); height: var(--ring); flex: none; }
/* (the turntable under the ring, its grain in rings) */
.wring::before { content: ""; position: absolute; inset: 4%; border-radius: 50%;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(90, 55, 25, .07) 0 2px, transparent 2px 9px), radial-gradient(circle, #d2ad78, #b68a52 70%, #9c7240);
  box-shadow: inset 0 0 0 6px rgba(80, 45, 15, .18), inset 0 -10px 24px rgba(60, 30, 5, .25); }
.wpos { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%) rotate(var(--a)) translateY(calc(var(--ring) * var(--dr, -.355))) rotate(calc(var(--a) * -1)); }
.wd { width: calc(var(--dt) * 2 + var(--dpad, 30px)); height: calc(var(--dt) * 2 + var(--dpad, 30px)); border-radius: 50%; box-sizing: border-box; display: grid; grid-template-columns: repeat(2, var(--dt)); grid-auto-rows: var(--dt); gap: var(--dgap, 10px); place-content: center;
  /* cordierite, speckled with kiln wash, its rim catching the light */
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 40%),
    radial-gradient(circle at 40% 60%, rgba(120, 100, 80, .16) 0 1px, transparent 1.6px) 0 0 / 6px 6px,
    radial-gradient(circle at 70% 30%, rgba(255, 255, 255, .5) 0 1px, transparent 1.6px) 0 0 / 9px 9px,
    radial-gradient(circle, #e9e3d8, #cfc6b8 70%, #b9ae9d);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, .45), inset 0 -4px 8px rgba(0, 0, 0, .12); }
.wd.empty { opacity: .5; }
/* a touch screen: the shelf and the center are what you tap (two taps: here, then a color in the dock) */
button.wd, button.wcenter { appearance: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; cursor: pointer; }
button.wd:focus-visible, button.wcenter:focus-visible { outline: 3px solid var(--focus); outline-offset: -6px; }
.wd.open, .wcenter.open { box-shadow: inset 0 0 0 3px var(--turn), inset 0 0 0 6px rgba(255, 255, 255, .6), inset 0 -4px 8px rgba(0, 0, 0, .12); }
.wcenter { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: calc(var(--ring) * .40); height: calc(var(--ring) * .40); border-radius: 50%; box-sizing: border-box;
  display: grid; place-content: center; justify-items: center; gap: 4px;
  background: radial-gradient(circle at 35% 30%, #f3ede3, #ddd3c4 70%, #c9bca8); box-shadow: inset 0 0 0 4px rgba(255, 255, 255, .5), inset 0 -6px 12px rgba(0, 0, 0, .12); }
/* (a small ring: the center's name gives its room to its tiles; the disc still says it to a screen reader) */
.wtw.small .wcenter .wcap { display: none; }
.wcenter .wcap { font: 700 max(11px, calc(var(--ct) * .38))/1 var(--ui-font); letter-spacing: .12em; text-transform: uppercase; color: var(--soft); }
.wcenter .wstacks { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: calc(var(--ct) * 4 + 30px); --dt: var(--ct); }
/* the final bonuses, in the center (the game's last moment) */
.wbonus { display: grid; gap: 6px; color: #2b1c10; min-width: calc(var(--ring) * .26); }
.wbonus .wbl { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; font: 600 max(14px, calc(var(--ct) * .5))/1.3 var(--ui-font); }
.wbonus .wbl b { font: 400 max(18px, calc(var(--ct) * .7))/1 var(--display); font-variant-numeric: tabular-nums; }
.wbonus .wbl.on { color: var(--good); }

/* ── a stack: every tile of one color, its count on a badge ──────────── */
.wstack { all: unset; position: relative; box-sizing: border-box; width: var(--dt); height: var(--dt); flex: none; display: block; --tile: var(--dt); }
@media (prefers-reduced-motion: no-preference) { .wstack { transition: transform .2s; } }
button.wstack { cursor: pointer; }
button.wstack:focus-visible .wt { box-shadow: inset 0 0 0 3px var(--focus), inset 0 0 0 5px #fff; }
.wstack .wt { position: absolute; inset: 0; width: 100%; height: 100%; }
.wstack.n2 .wt { box-shadow: 2px 2px 0 var(--lo), inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .35); }
.wstack.n3 .wt, .wstack.n4 .wt { box-shadow: 2px 2px 0 var(--lo), 4px 4px 0 color-mix(in srgb, var(--lo) 80%, #000), inset 0 0 0 1px rgba(0, 0, 0, .2), inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .35); }
.wbadge { position: absolute; right: -8px; top: -9px; z-index: 2; min-width: 18px; height: 18px; padding: 0 4px; box-sizing: border-box; border-radius: 9px; background: var(--ink); color: var(--cream);
  font: 800 12px/18px var(--ui-font); text-align: center; box-shadow: 0 0 0 2px var(--cream); pointer-events: none; }
.wtw.big .wbadge { min-width: 22px; height: 22px; font-size: 14px; line-height: 21px; padding-top: 1px; border-radius: 11px; }
/* the stack you've picked up: lifted, ringed inside its own edge */
.wstack.lift { transform: translateY(-5px); }
.wstack.lift .wt { box-shadow: inset 0 0 0 2.5px var(--turn), inset 0 -3px 0 rgba(0, 0, 0, .22), inset 0 2px 0 rgba(255, 255, 255, .35); }
/* (and a cream lip under it on the shelf, where it lifted from) */
.wstack.lift::after { content: ""; position: absolute; left: 10%; right: 10%; bottom: -7px; height: 3px; border-radius: 2px; background: var(--turn); opacity: .8; }
.wstack[disabled] { cursor: default; }

/* ── your board, in its cell ────────────────────────────────────────── */
.wboardcell .wb { max-width: 100%; }
/* (where a tiling's points count up: beside the wall) */
.wboardcell .wgain { right: -10px; }

/* ── the others: a small board each, in a fixed strip ───────────────── */
.wmini { all: unset; box-sizing: border-box; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 8px; align-items: center; padding: 6px 8px; border-radius: 12px; background: var(--chip); border: var(--chip-edge); min-width: 0; cursor: pointer; position: relative; }
.wmini:focus-visible { box-shadow: inset 0 0 0 3px var(--focus); }
.wmini .wwho { grid-column: 1 / -1; display: flex; gap: 6px; align-items: center; font: 700 var(--mini-name, 14px)/1.2 var(--ui-font); min-width: 0; white-space: nowrap; }
.wmini .wwho .wn { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wmini .wwho .wsc { font: 400 var(--mini-score, 18px)/1 var(--display); margin-left: auto; font-variant-numeric: lining-nums tabular-nums; padding: 3px 0 0 6px; }
.wmini .wbits { font: 600 var(--mini-note, 12px)/1.3 var(--ui-font); color: var(--soft); min-width: 0; }
.wmini .wbits b { color: var(--ink); }
.wmini .wbits .wl { color: var(--bad); }
.wmini .wbits .wg { color: var(--good); }
/* whose turn it is: ringed inside the card */
.wmini.turn { box-shadow: inset 0 0 0 2.5px var(--turn); }
.wmini .wbot { font: 600 12px/1 var(--ui-font); color: var(--soft); }
/* (a narrow strip: the bot's level gives its room to the name) */
.wtw.narrow .wmini .wbot { display: none; }
/* a laptop and up: the others' boards a little larger, their names and points larger still (David, v3) */
.wtw:not(.phone) .wmini { --mini-name: 16px; --mini-score: 26px; --mini-note: 14px; padding: 8px 10px; gap: 6px 10px; }
.wtw.big .wmini { --mini-name: 19px; --mini-score: 34px; --mini-note: 16px; padding: 12px 14px; gap: 8px 12px; border-radius: 14px; }
.wtw.big .wmini .wwall.mini { padding: 3px; gap: 2px; }
.wtw.phone .wmini .wbits { display: none; }
.wtw.phone .wmini { grid-template-columns: auto; justify-items: start; }
.wtw.phone .wmini .wwho { gap: 4px; }

/* ── the dock: always the same height, its buttons in the same places ── */
.wseatslot:empty { display: none; }
.wseatslot > .seatbar { padding: 10px 14px; border-radius: var(--panel-radius); background: var(--panel); border: var(--panel-edge); }
.wdock { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 76px; box-sizing: border-box; padding: 10px 14px; border-radius: 14px; background: var(--panel); border: 2px solid #d8c6aa; }
.wdock.live { border-color: var(--turn); }
.wdock .wsay { min-width: 0; }
.wdock .wline { margin: 0; font: 500 15px/1.35 var(--ui-font); min-width: 0; }
.wdock .wline[hidden], .wchoose[hidden] { display: none; }
/* a touch screen: the display's colors in the dock, each a finger's size */
.wchoose { display: flex; align-items: center; gap: 12px; min-width: 0; flex-wrap: nowrap; }
.wchoose .wwhere2 { font: 700 14px/1.2 var(--ui-font); white-space: nowrap; }
.wchoose .wstack.wbig { --dt: 44px; width: 44px; height: 44px; flex: none; }
.wchoose .wstack.wbig .wbadge { right: -6px; top: -7px; }
.wdock .wline b { color: var(--turn); }
.wdock .wline .wover { color: var(--bad); font-weight: 700; }
.wdock .wline .wgood { color: var(--good); font-weight: 700; }
.wdock .wbtns { display: flex; gap: 8px; }
.wdock .wbtns .btn { min-width: 92px; }
.wdock .wbtns .btn.off { visibility: hidden; }
.wtw.big .wdock { height: 88px; }
.wtw.big .wdock .wline { font-size: 18px; }
.wtw.phone .wdock { height: 96px; padding: 10px 12px; gap: 8px; }
/* (a phone: an unused button gives its room to the words; the dock keeps its height) */
.wtw.phone .wdock .wbtns .btn.off { display: none; }
.wtw.phone .wdock .wbtns .btn { min-width: 0; padding-inline: 14px; }
.wtw.phone .wdock .wline { font-size: 14px; }
.wtw.phone .wlong { display: none; }

/* the stage (announce.js) over the ring: a band, never moving anything */
.wtwbanner .house-announce-art .wt { --tile: 40px; }
.wtwbanner .wbandtiles { display: flex; gap: 6px; }

/* ── a player's board, opened from their card ───────────────────────── */
.wsheetboard { display: grid; place-items: center; --tile: 30px; }
@media (max-width: 400px) { .wsheetboard { --tile: 24px; } }

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

/* ── a phone ────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  #app { padding: 0; }
  .felt.wtw { height: 100dvh; gap: 0; }
  .felt.wtw::before { border-radius: 0; }
  .wtw .tablemain { gap: 6px; }
  .felt.wtw .bar .tools { display: none; }
  .felt.wtw .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; }
  /* (the round is in the dock's words and the log: the title keeps one line) */
  .wtw .wwhere { display: none; }
}
/* a phone on its side: the bar's tools fold away too */
@media (max-height: 520px) and (min-width: 560px) {
  #app { padding: 0; }
  .felt.wtw { height: 100dvh; border: 0; border-radius: 0; gap: 0; }
  .felt.wtw .bar .tools { display: none; }
  .felt.wtw .bar .more { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 32px; }
  .wdock { height: 64px; padding: 6px 10px; }
}
@media (pointer: coarse) {
  .felt.wtw .bar .btn { min-height: 44px; }
}
