/* receipt {"rows":["module/shedding.v1","module/stacks_screen.v1"],"source":"kasten/families/table_games/js/stacks.css","source_sha":"9d74c8857fdb","writer":"kasten/platform/factory.py","writer_sha":"1a878b7c75b6"} */
/* Table games: the stacks felt (stacks.mjs), phone first. Colours are the look rows' tokens; what every felt shares is felt.css. Fitted from
   the old stacks felt's look (its app.css: the stacks under each name, the deck and the pile in the middle, you at the foot). */
.stacked { flex: 1; display: grid; grid-template-rows: auto auto auto auto auto auto auto; gap: 10px; align-content: start; }
.stacked .others { gap: 8px 10px; }
.stacked .seat { display: grid; justify-items: center; gap: 2px; }
.stacked .seat .ready, .stacked .whose { font-size: 0.75rem; opacity: 0.85; }
.stacked .whose { display: block; text-align: center; }
/* a stack: a face-up piece ON its face-down one (CG-D-011), the back peeking under it; an empty place keeps its footprint */
.stacks { display: flex; gap: 5px; justify-content: center; flex-wrap: wrap; padding: 2px 4px 6px; }
.stacks .piece { --pw: calc(52px * var(--aa, 1)); width: var(--pw); height: calc(74px * var(--aa, 1)); --pp: 4px; --pp-x: 4px; padding: var(--pp) var(--pp-x); }
.stacks .piece .inner { font-size: var(--at-num-size, 1rem); }
.stacks .piece .symbol { font-size: 1.2rem; }
.stacks .piece .mid, .stacks .piece .art { display: none; }
.stacks .piece.on { box-shadow: 3px 4px 0 -1px var(--accent), 0 2px 4px rgba(0, 0, 0, 0.35); }
.stacks.small .piece { --pw: calc(var(--ow, 34px) * var(--aa, 1)); width: var(--pw); --sh: calc(var(--oh, 48px) * var(--aa, 1)); height: var(--sh); --pp: 2px; --pp-x: 3px; padding: var(--pp) var(--pp-x); --card-r: 6px; border-radius: var(--card-r); }
/* TIERS (card_game #10555, revising RULING A #10526): the other places' pieces take their size from how many sit at the table, one knob on
   the felt (stacks.mjs sets data-others). OLD CAR FIRST: the old stacks felt's density tiers (its app.js:611-614 by the whole table's count:
   2 bigger, 3-4 as is, 5-6 tighter, 7-8 small; the sizes app.css:742-746, 60/46/40/30px). Here by the OTHERS' count (1; 2-3; 4-5; 6-7), the
   SHAPE ported onto this felt's own 34px (46 -> 34, the others in proportion: 60 -> 44, 40 -> 30), the smallest held at 26px, not the old
   ratio's 22: under 26 the corner's value and symbol (0.8rem and 0.85rem) no longer sit inside the 2px 3px edge whole. Each tier is
   multiplied by Aa, never replaces it (the base rule above). Every face-up piece stays drawn at every count: the tiers shrink them,
   nothing hides them (Carl 2026-09-15, the old app.js:623-624: "I still get to see my 7 opponents' face up cards"). */
main.stacked[data-others="1"] { --ow: 44px; --oh: 62px; }
main.stacked:is([data-others="4"], [data-others="5"]) { --ow: 30px; --oh: 42px; }
main.stacked:is([data-others="6"], [data-others="7"]) { --ow: 26px; --oh: 36px; }
main.stacked:is([data-others="4"], [data-others="5"], [data-others="6"], [data-others="7"]) .stacks.small .piece { padding: 2px; }   /* the old n56/n78's tighter pad (app.css:745-746) */
/* W2-1 (card_game #10561): an extra's upright word (one letter a line, felt.css .piece.extra .word) is sized to the small piece it stands in,
   never past its edges onto a chip or a label: its letters share the piece's height less both corners' 4px (--wl letters at the word's 0.92
   line), never over the felt's own 0.62rem. OLD CAR FIRST: the old stacks felt sized the joker's word to the card, font-size .14 of the card's
   width with the same 0.92 line (its app.css:721-723), so at its small tiers (.n56/.n78, app.css:745-746, which also hid the deck number
   there, --odn: none) the word shrank with the card and stayed inside it. Here the share is of the height, which binds first (five letters). */
.stacks.small .piece.extra .word { font-size: min(0.62rem, calc((var(--sh, 48px) - 8px) / (var(--wl, 5) * 0.92))); }
.stacks.small .piece.extra .symbol.word { right: 2px; bottom: 2px; }
.stacks.small .piece .inner { font-size: var(--at-num-size, 0.8rem); }
.stacks.small .piece .symbol { font-size: 0.85rem; }
.stacks .piece.live { outline: var(--gold-rim) solid var(--accent); box-shadow: 0 0 var(--gold-glow) var(--accent), 0 2px 4px rgba(0, 0, 0, 0.35); }   /* the stock's gold (felt.css :root) */
.stacks .piece.dim { filter: brightness(.6) saturate(.4); }
.stacks .piece.picked { transform: translateY(-10px); outline: 3px solid var(--accent); }
.stacks button.piece.back { cursor: pointer; }
/* FIX BATCH 1 n022 (Carl's test round, card_game #14261 note 22: "Need tiny gap between the dotted lines for each card space"): the dashed line
   is drawn inside the place's box (outline-offset -2px), as the old car's was a border (its surface/app.css:730 .slot), so the row's gap
   between two places shows between their lines; drawn outside, 2px each side, it had closed the 3-4px gap to nothing. */
.piece.slot { background: none; box-shadow: none; outline: 2px dashed var(--felt_ink); outline-offset: -2px; opacity: 0.4; }
.piece.flip { animation: arrive .4s ease-out 1; }
/* the middle: what is left to draw, the pile (the piece it answers to big; a see-through piece small at its corner), the run */
.stacked .centre { display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap; }
.stacked .pile { position: relative; display: flex; align-items: center; }
.stacked .pile .piece.big { --pw: calc(80px * var(--aa, 1)); width: var(--pw); height: calc(114px * var(--aa, 1)); }
.stacked .pile .piece.slot.big { display: grid; place-items: center; opacity: 0.7; }
.stacked .pile .howto { font-size: 0.72rem; line-height: 1.2; padding: 4px; text-align: center; color: var(--felt_ink); }
.stacked .pile .over { position: absolute; right: -18px; bottom: -10px; }
.stacked .pile .piece.over { --pw: calc(46px * var(--aa, 1)); width: var(--pw); height: calc(66px * var(--aa, 1)); --pp: 3px; --pp-x: 3px; padding: var(--pp) var(--pp-x); }
.stacked .pile .run { position: absolute; top: -8px; right: -8px; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--card_ink); font-size: 0.8rem; }
.stacked .packs { font-size: 0.75rem; opacity: 0.7; flex-basis: 100%; text-align: center; }
.stacked .stock .n { font-size: 0.85rem; }
.stacked .me { display: grid; gap: 4px; justify-items: stretch; }
.stacked .hat { margin-right: 4px; }
.stacked .which { display: grid; gap: 6px; justify-items: center; }
.stacked .which p { margin: 0; }
.stacked .which .btns { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.stacked .which .choice { padding: 6px 12px; border-radius: 999px; border: 0; background: var(--card); color: var(--card_ink); font-size: 1rem; }
.stacked .which .choice.on { outline: 3px solid var(--accent); }
.stacked .say .last { margin: 0; text-align: center; font-size: 0.9rem; opacity: 0.8; }
.stacked > .feed { margin: 0; padding: 0; list-style: none; display: grid; gap: 2px; text-align: center; font-size: 0.8rem; opacity: 0.6; }
.stacked .banner .piece.flip { margin: 0 auto; }
.stacked .bar { flex-wrap: wrap; }
.stacked .bar button { padding: 12px 22px; }
.stacked .bar button.quiet, .stacked .bar .pass { background: none; color: var(--felt_ink); outline: 1px solid var(--felt_ink); }
.result .conceded { opacity: 0.8; }
/* robot (360x641): the seats' row is a scroll box elsewhere, and in this felt's grid a scroll box may shrink to nothing under the bar; here it
   keeps its whole height, every seat's name and its stacks in view (the old felt never hid a face-up piece, app.js:623-624, Carl 2026-09-15).
   NEED 12 (four-eyes #6289): it wins by SCOPE, `main.stacked` over the ring felts' `.ring > .others` (felt.css), never by load order, so no
   chip sits under the top bar. NEED 13: on a phone the other places sit side by side in ONE row that scrolls sideways when they do not fit,
   each place whole (its name, its stacks), never cut top or bottom and never smaller; the room a big hand needs comes from there, never from
   a piece */
main.stacked > .others { overflow: visible; min-height: min-content; }
/* THE BUTTONS STAY ABOVE SAFARI'S BAR (Carl 2026-12-05, iPhone Safari, large text: "the buttons go behind my safar[i] search bar thats at
   the bottom of the screen"; seat #15285). The others' row keeps its whole height (above), so at large text nothing in this column can give
   room and Swap / Ready / Play were pushed past the felt's 100dvh, under Safari's floating bar. Measured in real iOS Safari (iPhone 17
   simulator on the M4, 2026-12-05): with the felt its own scroll box and the bar pinned at its foot, the buttons sit above Safari's bar and
   the table scrolls under them; nothing shrinks and nothing hides. At normal text nothing overflows, so nothing moves. The bar stands over the
   hand's pieces (--z-words over --z-pieces) on the felt's plain colour, as every sticky foot in the car does (deal.css, screen.css .form). */
@media (max-width: 599.98px) {
  main.ring.stacked { overflow-y: auto; min-height: 0; }
  main.ring.stacked > .bar { position: sticky; bottom: 0; z-index: var(--z-words); background: var(--felt); padding-top: 6px; }
}
@media (max-width: 599.98px) {
  /* WRAP (the old car lane's ruling #10526, revising NEED 12's one sideways row, b61ef3f): a scroll with nothing saying there is more hid a
     place from the person (a 360 robot shot: the second of two others off the right edge). The places WRAP: side by side where they fit,
     else the next one under, every piece whole, no sideways scroll ("never smaller" revised by TIERS, #10555: smaller by the count, never hidden). OLD CAR FIRST: the old stacks felt put the others one
     row each on a phone (app.js:611-625) and in its room picked seats to a line by width (app.js:412-466). */
  main.stacked > .others { flex-direction: row; flex-wrap: wrap; align-items: flex-start; justify-content: safe center; gap: 4px 8px; container-type: inline-size; }
  /* TIERS (card_game #10555): a place is its chip over its stacks, in setup and in play (on one line, name beside stacks, five pieces ran
     348px in the 328 the felt has: the wrap2 robot at 360, three others, in play), and two places sit side by side from two others up, each
     half the row, so four others are two rows. OLD CAR FIRST: the old stacks felt's count coin row put the others side by side, its coin and
     name over its stacks, as many to a line as kept the block inside a quarter of the window (app.js:428-466). */
  main.stacked > .others > .seat { flex: none; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; --cols: 1; }
  main.stacked:not([data-others="1"]) > .others > .seat { flex: 0 0 calc((100% - 8px) / 2); --cols: 2; }
  /* fit to the room (the old stacks felt's stackFit, app.js:420-424: per(room) = floor((room - 5 * (t - 1)) / t)): each piece is the tier's
     size or the share of its place's half (or whole) row its t stacks leave, whichever is smaller; the row's own 3px gaps and 4px edges */
  main.stacked > .others .stacks.small { gap: 3px; padding: 2px 4px 4px; flex-wrap: nowrap; --fit: calc(((100cqw - 8px * (var(--cols, 1) - 1)) / var(--cols, 1) - 8px - 3px * (var(--t, 5) - 1)) / var(--t, 5)); }
  main.stacked > .others .stacks.small .piece { --pw: min(calc(var(--ow, 34px) * var(--aa, 1)), var(--fit)); width: var(--pw); --sh: min(calc(var(--oh, 48px) * var(--aa, 1)), calc(var(--fit) * 1.4)); height: var(--sh); flex: none; }
  /* SH1 (the old car lane's mule walk 2026-11-18, item 4): a place still choosing says whose pieces they are, and on one line those words pushed
     its stacks past the right edge, so they were never seen while it chose. OLD CAR FIRST: the old stacks felt drew them under the row
     label "<name>'s face-up cards · still choosing" (app.js:476-477, :503, :507). Here its parts stand one under another: the chip, the
     words, the pieces. */
  /* READYROW (card_game #10506, the cells4 after-shot n4): a READY place's row ran off the edge the same way, since its words are drawn too;
     so every seat in the setup stands this way, ready or choosing (the old car drew both under the row label). */
  main.stacked > .others > .seat.setting { flex-direction: column; gap: 2px; }
  /* the middle on two rows, not three: what is left to draw over the line saying what is in play, beside the pile */
  main.stacked > .centre { display: grid; grid-template-columns: auto auto; column-gap: 16px; justify-content: center; align-items: center; }
  main.stacked > .centre > .stock { grid-column: 1; grid-row: 1; }
  main.stacked > .centre > .pile { grid-column: 2; grid-row: 1 / span 2; }
  main.stacked > .centre > .packs { grid-column: 1; grid-row: 2; align-self: start; }
  main.stacked { gap: 4px; }
}
/* TIERS, a SHORT phone (card_game #10555): two or three others take the 4-5 tier's set. OLD CAR FIRST: the old stacks felt's short phone at
   its 3-4 tier took its 5-6 tier's 40px set, whole (app.css:1458; its short was 800px high or less, its app.js:20) */
@media (max-width: 599.98px) and (max-height: 800px) {
  main.stacked:is([data-others="2"], [data-others="3"]) { --ow: 30px; --oh: 42px; }
}
/* THE BEAT (four-eyes #6271 NEED 3): the turned piece the server already played or took for, held where it lay for the old car's 1.1 s
   (its app.js:226-234), then gone; paint only, no timer and no call */
.stacks .piece.turned { animation: turned 1.1s linear 1 both; }
@keyframes turned { 0%, 85% { opacity: 1; } 100% { opacity: 0; visibility: hidden; } }
/* L2 (four-eyes #6271): nothing covers a piece. On a phone the room's More tab sits over the right edge (menu.css .sidetab.more), so your
   own stacks and hand keep clear of it, as the old felt's hand did (its HAND_W, "clear of the room's More tab too", CG-D-665) */
@media (max-width: 767px) {
  body:has(.sidetab.more:not([hidden])) main.stacked > .me { margin-right: calc(44px - 16px); }   /* the tab's 44px less #app's own 16px edge */
  main.stacked > .me > .stacks { flex-wrap: nowrap; gap: 4px; }   /* your stacks stay one row, never wrapped under themselves (robot r2) */
  main.stacked > .me > .stacks > .piece { flex: 0 1 auto; min-width: 0; }
}
/* L3 (four-eyes #6271): the older lines' box may shrink on a short phone (the grid gives it the room left); it scrolls in itself and rests
   on the newest line (laid newest first, shown bottom up), so the last line always reads in full above the bar */
main.stacked > .feed { display: flex; flex-direction: column-reverse; overflow-y: auto; min-height: 1.3em; }
