  /* ---------- Blackjack dice (classic-21.md): the third game. Its pages and table wear the poker classes (poker.css, which loads first); this file holds only what is Blackjack's own ---------- */
  /* Pick a game: the third row's art panel, blue under two cream cards with two dark dice each (the rows are poker.css's) */
  .grow.bj { --gart: #1E4F7A; }
  /* Table setup: the Mode card's tiles, one per built mode, then the Dice tiles (pickers.css, the poker Mode card's spacing) */
  .bjmodes { margin-bottom: 12px; } .pkpage.hasdice .bjmodes { margin-bottom: 10px; }
  /* ---------- the Blackjack table (classic-21.md §5, frames 1 and 4): the poker table's screen, strip, felt, panel and action row, with the dealer's row and yours on the felt ---------- */
  .gtop .pkpill.bjpill { background: #FF8A3D; }
  .pkstrip .skilltag.dealer { background: #F5C93A; border: 2px solid var(--ink2); padding: 2px 7px; } /* (the gold DEALER tag beside "Computer") */
  /* the felt: the dealer's label and pill over its dice or cards at the top, your bet and the status line in the middle, your dice or cards over your label and pill at the bottom */
  .bjfeltmid { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 10px; width: 100%; flex: 1 1 auto; min-height: 0; --bjd: 50px; --cw: 60px; }
  .bjrow { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; flex: 0 0 auto; }
  .bjlbl { display: flex; align-items: center; justify-content: center; gap: 10px; font: 800 13px/1 var(--nunito); letter-spacing: .22em; text-transform: uppercase; color: rgba(214,242,224,.82); }
  .bjtot { display: inline-grid; place-items: center; min-width: 52px; height: 32px; padding: 0 12px; border-radius: 999px; background: #0A2A18; border: 3px solid var(--ink2); box-shadow: 0 2px 0 var(--ink2); color: #fff; font: 20px/1 var(--lilita); letter-spacing: .03em; white-space: nowrap; box-sizing: border-box; }
  .bjtot.mine { background: #FFD23F; color: var(--ink2); }
  .bjtot.gold { background: #FFD23F; color: var(--ink2); } .bjtot.bust { background: #E8505B; color: #fff; }
  .bjtot:empty { visibility: hidden; } /* (the row keeps its height before the deal) */
  .bjmid { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; }
  .bjmid .pkbetpill { order: 0; } /* (the middle never shrinks under its own content: a felt too short for it spills and the fit loop steps the dice and cards down, rather than the banner lying over them) */
  .bjmid .pkstatwrap { flex: 0 0 auto; margin-top: 0; padding: 2px 0; }
  .bjbet.down { animation: potdown .7s ease-in forwards; } .bjbet.up { animation: potup .7s ease-in forwards; } body.fast .bjbet.down, body.fast .bjbet.up { animation-duration: .35s; } /* (the chips slide to the winner: poker's pot slide) */
  /* a hand: flat dice (poker's .pdie at --bjd, 8 px apart, centred), wrapping past six into a second row (40 px when a third would be needed); cards are cream tiles with their two dice staggered and the total in the corner, fanned past three */
  .bjhand { display: flex; flex-wrap: wrap; justify-content: center; align-content: center; gap: 8px; max-width: calc(6 * var(--bjd) + 5 * 8px); min-height: var(--bjd); --pd: var(--bjd); }
  .bjhand.many { --bjd: 40px; max-width: calc(7 * 40px + 6 * 8px); }
  .bjhand .pdie.gold { box-shadow: 0 0 0 3px #FFD23F, 0 3px 0 3px var(--ink2); }
  .bjhole { display: inline-grid; place-items: center; width: var(--pd); height: var(--pd); flex: 0 0 auto; box-sizing: border-box; border: 3px solid var(--ink2); border-radius: 22%; box-shadow: 0 3px 0 var(--ink2), inset 0 0 0 3px rgba(255,255,255,.28); background: repeating-linear-gradient(135deg, #8F57EA 0 5px, #7B45D6 5px 10px); color: #fff; font: calc(var(--pd) * .52)/1 var(--lilita); text-shadow: 2px 2px 0 var(--ink2), -1px -1px 0 var(--ink2), 1px -1px 0 var(--ink2), -1px 1px 0 var(--ink2); }
  .bjhand.cards { flex-wrap: nowrap; max-width: none; min-height: calc(var(--cw) * 86 / 60); --pd: calc(var(--cw) / 2); } /* (the card itself, .bjcardt, is in cardface.css, loaded just before this file: Poker dice's Cards draw it too) */
  .bjhand > .bjpend .pdie { transform: none; } /* (a card landing: its dice in a line, centred, where the 3D dice land) */
  .bjhand.fan { gap: 0; } .bjhand.fan > * + * { margin-left: calc((var(--w, 3) * var(--cw) + (var(--w, 3) - 1) * 8px - var(--n) * var(--cw)) / (var(--n) - 1)); } /* (past three cards they overlap: the row stays three cards wide; a split hand's group, two) */
  /* a split: your two hands side by side, each its cards over its own pill; the one you're playing outlined in poker's turn yellow, a finished one dimmed while the other plays */
  .bjhand.bjsplit { flex-wrap: nowrap; max-width: none; align-items: flex-start; gap: calc(var(--cw) * .3); }
  .bjgroup { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 5px 6px 6px; border-radius: calc(var(--cw) * .22); box-shadow: inset 0 0 0 3px transparent; transition: opacity .2s, box-shadow .2s; }
  .bjgroup .bjgcards { flex-wrap: nowrap; max-width: none; min-height: calc(var(--cw) * 86 / 60); --pd: calc(var(--cw) / 2); }
  .bjgroup.cur { box-shadow: inset 0 0 0 3px #FFD23F; } /* (inside the group's padding: the outline never reaches the YOU label or the other hand, at any fit step) */
  .bjgroup.done { opacity: .6; }
  .bjrow.you.split .bjlbl .bjtot { display: none; } /* (each hand has its own pill: YOU stays the row's label, and the row gives back the pill's height) */
  .bjhand > .bjpend { opacity: 0; } /* (the item landing, in its place but unseen, the card's tile and every pip included (a pip's own visibility would show through visibility: hidden): the 3D dice tumble onto its flat dice, and the die or the whole card shows the moment they're down) */
  /* the deal of a face-down die or card, and the hole turning over */
  .bjhand > .deal { animation: pkdeal .3s cubic-bezier(.2, .9, .3, 1.15) both; } body.fast .bjhand > .deal { animation-duration: .16s; }
  .bjhand > .bjflip { animation: bjflipout calc(var(--flip, 400ms) / 2) ease-in forwards; } .bjhand > .bjflip.late { animation: bjflipin calc(var(--flip, 400ms) / 2) ease-out both; }
  @keyframes bjflipout { to { transform: rotateY(90deg); } } @keyframes bjflipin { from { transform: rotateY(90deg); } }
  .bjhand > .bjpeek { transform-origin: 50% 100%; animation: bjpeek var(--peek, 800ms) both; } /* (the dealer checks its hole once insurance is decided: the top edge lifts toward you, holds, settles back; the bottom edge stays on the felt) */
  @keyframes bjpeek { 0% { transform: perspective(480px) rotateX(0); filter: drop-shadow(0 0 0 rgba(27,18,6,0)); animation-timing-function: ease-out; } 30%, 70% { transform: perspective(480px) rotateX(-38deg); filter: drop-shadow(0 -4px 10px rgba(27,18,6,.35)); } 70% { animation-timing-function: ease-in; } 100% { transform: perspective(480px) rotateX(0); filter: drop-shadow(0 0 0 rgba(27,18,6,0)); } }
  /* the tumbling dice: poker's roll wrap; a card's two dice tumble together, stacked */
  .bjroll.pair { flex-direction: column; }
  .bjroll .face { padding: calc(var(--die, 76px) * .14); gap: calc(var(--die, 76px) * .03); } /* (the CSS fallback's faces, sized by the die like the flat dice: the craps table's fixed 10 px left a card's 30 px dice with dots for pips) */
  /* your panel: the hand card is YOUR HAND, the total big with the hint beside it, then WIN CHANCE (your dice or cards are on the felt) */
  .handcard.bjcard:not(.mini) { grid-template-columns: auto minmax(0, 1fr); gap: 4px 14px; }
  .handcard.bjcard .hlbl { grid-column: 1 / -1; }
  .handcard.bjcard .bjbig { position: relative; font: 46px/1 var(--lilita); font-weight: 400; min-width: 1.15em; text-align: left; white-space: nowrap; }
  .handcard.bjcard .bjbig small { display: inline-block; vertical-align: top; margin: .12em .16em 0 0; font-size: .36em; line-height: 1; letter-spacing: .04em; text-transform: uppercase; color: #6b5a2a; } /* ("Soft" beside the number, at its top: the total keeps its size and the card its height) */
  .handcard.bjcard .bjbig.two { font-size: 30px; align-self: center; } /* (after a split, once both hands are played: both totals) */
  .handcard.bjcard .hhint { align-self: center; min-height: 2.5em; display: flex; align-items: center; } /* (two lines' room: the card keeps its height from move to move) */
  .handcard.bjcard .strength { grid-column: 1 / -1; }
  .handcard.bjcard .strength .slbl { font-size: 12px; letter-spacing: .08em; } .handcard.bjcard .strength .segs { gap: 3px; } .handcard.bjcard .strength .sword { font-size: 18px; min-width: 3.6em; } /* ("Win chance" is longer than poker's "Strength": the label sits tighter and the word keeps just "Monster"'s room, so the ten segments keep their size) */
  .handcard.bjcard .bjbig .real, .handcard.bjcard .hhint .real { visibility: hidden; } .handcard.bjcard .bjbig .mask, .handcard.bjcard .hhint .mask { position: absolute; inset: 0; overflow: hidden; }
  .handcard.bjcard .hhint { position: relative; }
  /* the action row: Stand blue, Hit green, Double orange and narrow (poker's buttons) */
  .pkact .row .big.stand { background: #3FA9F5; } .pkact .row .big.hit { background: #3DBF7A; } .pkact .row .big.hit:disabled { opacity: .5; }
  .pkact .row .big.double { background: #FF8A3D; flex: 0 0 30%; } .pkact .row .big.double .sub, .pkact .row .big.split .sub { color: #fff; opacity: 1; text-shadow: 1px 1px 0 var(--ink2), -1px -1px 0 var(--ink2), 1px -1px 0 var(--ink2), -1px 1px 0 var(--ink2); }
  .pkact .row .big.split { background: #B57BFF; flex: 0 0 30%; } /* (Split purple and narrow) */
  .pkact .row.ins .big { flex: 1 1 0; } .pkact .row .big.insure { background: #FFD23F; color: var(--ink2); text-shadow: none; } .pkact .row .big.insure .sub { color: #fff; opacity: 1; text-shadow: 1px 1px 0 var(--ink2), -1px -1px 0 var(--ink2), 1px -1px 0 var(--ink2), -1px 1px 0 var(--ink2); } /* (an ace up: Insure gold with its price, No thanks grey, splitting the row) */
  body.lefty #bjActions .row { flex-direction: row-reverse; } /* Left-handed (Settings → Accessibility): every mode's row mirrored (Hit, Deal again, Insure on the left; a button a mode puts first ends up on the right) */
  .pkact .row.four .big.split, .pkact .row.four .big.double { flex: 0 0 23%; min-width: 0; padding-left: 4px; padding-right: 4px; } /* (a pair: Split and Double narrow, Stand and Hit share the rest, one row at 360 px) */
  /* How to play: the ranks sheet's rows, one rule each */
  .bjrules { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
  .rankrow.bjrule { grid-template-columns: 22px minmax(0, 1fr); gap: 4px 10px; padding: 7px 12px 7px 6px; border-width: 3px; border-radius: 16px; }
  .rankrow.bjrule .rn { grid-row: 1; font-size: 18px; } .rankrow.bjrule .rtxt { font: 15px/1.28 var(--lilita); color: #fff; } .rankrow.bjrule .rtxt b { color: #FFD23F; font-weight: 400; }
  .bjhow .tsnote { font-size: 15px; } .bjhow .ranknote { margin: 10px 0 12px; padding: 10px 14px; font-size: 15px; }
  /* phones: the dice sized so six fit a row of the felt; the fit loop (fitBj) steps them, the cards and the air down while anything spills */
  @media (max-width: 680px) {
    .bjfeltmid { --bjd: min(50px, calc((100cqw - 56px) / 6)); gap: clamp(4px, 2cqh, 10px); }
    .bjrow { gap: clamp(4px, 1.6cqh, 8px); }
    .bjtot { height: 28px; font-size: 18px; } .bjlbl { font-size: 12px; }
    .bjrow.you.split .bjlbl { padding-bottom: .2em; } /* (with the pill gone the label is only its line, and the font's text box runs .18em past a line-height of 1: the room under it keeps the text inside the label, where it ran 2 px past the felt's middle and the fit loop read that as a spill, so every split went to fit-3) */
    .handcard.bjcard .bjbig { font-size: 40px; }
  }
  @media (max-height: 760px) { .handcard.bjcard .bjbig { font-size: 36px; } .bjtot { height: 26px; min-width: 46px; font-size: 17px; } }
  @media (max-height: 700px) { .handcard.bjcard .bjbig { font-size: 32px; } .handcard.bjcard .hhint { min-height: 2.4em; } }
  .bjfelt.one .bjfeltmid { --cw: 80px; } .bjfelt.big-1 .bjfeltmid { --cw: 70px; } .bjfelt.big-2 .bjfeltmid { --cw: 60px; } /* (Cards with one hand each: the cards a third bigger, the fit loop's two first steps back to today's 60 px; big-* are only ever on with .one, and every rule here is as specific as fit-1 to fit-3 and before them, so a fit step always wins) */
  .bjfelt.fit-1 .bjfeltmid { --bjd: 40px; --cw: 48px; gap: 4px; } .bjfelt.fit-1 .bjrow { gap: 4px; } .bjfelt.fit-1 .bjtot { height: 24px; font-size: 16px; }
  .bjfelt.fit-2 .bjfeltmid { --bjd: 34px; --cw: 40px; } .bjfelt.fit-2 .pkstatus { font-size: 14px; } .bjfelt.fit-2 .pkreason { font-size: 14px; } .bjfelt.fit-2 .pkbanner { font-size: 26px; } .bjfelt.fit-2 .pkbetpill { min-height: 26px; font-size: 17px; } .bjfelt.fit-2 .pkchips .chip { width: 24px; height: 24px; font-size: .4rem; } .bjfelt.fit-2 .pkchips .chip + .chip { margin-left: -15px; } .bjfelt.fit-2 .bjlbl { font-size: 11px; }
  .bjfelt.fit-3 .bjfeltmid { --bjd: 28px; --cw: 34px; gap: 2px; } .bjfelt.fit-3 .bjrow { gap: 2px; } .bjfelt.fit-3 .bjtot { height: 22px; font-size: 14px; min-width: 40px; }
  /* Tip the dealer (Classic 21): a yellow pill with a chip in the dealer's strip, where its stack was; the chip that flies (talk's pop-over and bubbles: talk.css) */
  .bjstrip .bjtip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 5px 13px 5px 7px; background: #FFD23F; color: var(--ink2); border: 3px solid var(--ink2); border-radius: 999px; box-shadow: 0 3px 0 var(--ink2); font: 18px/1 var(--lilita); font-weight: 400; transition: none; }
  .bjstrip .bjtip svg { width: 22px; height: 22px; flex: 0 0 22px; display: block; }
  .bjstrip .bjtip:hover:not(:disabled) { filter: none; } .bjstrip .bjtip:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink2); }
  .bjstrip .bjtip:disabled { opacity: .5; }
  .chip.bjtipchip { position: fixed; z-index: 61; width: 34px; height: 34px; font-size: .55rem; pointer-events: none; box-shadow: -2px 1px 3px rgba(0,0,0,.45), inset 0 0 0 2px rgba(0,0,0,.15); }
  /* the rows the talk button (talk.css) crowds, measured at 360 px with it in place: a tighter gap and a 17 px label, the narrow buttons narrower still (their sums shrink to fit, fitSubs) */
  .pkact .row.four:has(> .talkbtn), .pkact .row.d21act.n4:has(> .talkbtn) { gap: 5px; }
  .pkact .row.four:has(> .talkbtn) .big, .pkact .row.d21act.n4:has(> .talkbtn) .big { font-size: 17px; padding-left: 3px; padding-right: 3px; }
  .pkact .row.four:has(> .talkbtn) .big.split { flex: 0 0 21%; } .pkact .row.four:has(> .talkbtn) .big.double { flex: 0 0 22%; } .pkact .row.four:has(> .talkbtn) .big.hit { flex: 0 0 15%; } /* (Stand takes the rest) */
  .pkact .row.d21act.n4:has(> .talkbtn) .big.fold { flex: 0 0 16%; } .pkact .row.d21act.n4:has(> .talkbtn) .big.hit { flex: 0 0 15%; }
  /* Reduce motion (body.rm): no slide in, no peek, an instant flip (the face is swapped at the flip's half-way timer, as ever), no float (the stagger stays as a still offset), the chips fade rather than slide */
  body.rm .bjhand > .deal, body.rm .bjhand > .bjflip, body.rm .bjhand > .bjflip.late, body.rm .bjcardt.bjfloat .pdie { animation: none; }
  body.rm .bjhand > .bjpeek { animation: none; } /* (no peek: the client skips it under Reduce motion too) */
  body.rm .bjbet.down, body.rm .bjbet.up { animation: rmfadeout .15s ease-out forwards; }
  /* ---------- Autoplay (autoplay-blackjack.md; the admin's for now): the ☰ menu's admin row, the pill on the felt's top edge, the Stop row, the settings sheet in craps' #apModal look ---------- */
  .bjadminrow { display: flex; gap: 10px; margin-top: 12px; } .bjadminrow .menurig, .bjadminrow .menuauto { margin-top: 0; flex: 1 1 0; min-width: 0; white-space: nowrap; padding-left: 6px; padding-right: 6px; } /* (Rig the dice and Autoplay side by side) */
  .bjadminrow .menuauto.red { background: #E8505B; color: #fff; }
  #bjFelt .bjappill { position: absolute; top: -5px; left: 50%; transform: translate(-50%, -50%); z-index: 6; background: var(--felt-dark, #0b3d26); border-width: 2px; pointer-events: none; } /* (craps' #apPill, centred on the rail's top edge; the felt's own colour behind it) */
  .pkact .row .big.apstop { background: #E8505B; } .pkact .row .big.apstop .sub { color: #fff; opacity: 1; text-shadow: 1px 1px 0 var(--ink2), -1px -1px 0 var(--ink2), 1px -1px 0 var(--ink2), -1px 1px 0 var(--ink2); }
  .pkact .row .big.apstop:disabled { opacity: .7; }
  #bjAutoModal .apseg { padding: 0; background: none; border-radius: 0; margin-top: 0; gap: 8px; } #bjAutoModal .apseg button { padding: 4px 6px; min-height: 42px; font-size: 17px; line-height: 1.05; border-radius: 14px; }
  #bjAutoModal .apseg button.active { background: #FFD23F; color: var(--ink2); } #bjAutoModal .apseg button { text-wrap: balance; }
  #bjAutoModal .tsnote#bjAutoIntro { margin-top: 2px; }
  #bjAutoModal .bjarow { display: flex; align-items: center; gap: 10px; margin-top: 10px; } #bjAutoModal .bjarow .apseg { flex: 1 1 auto; width: auto; }
  #bjAutoModal .bjalbl { flex: 0 0 auto; font: 800 12px/1.2 var(--nunito); letter-spacing: .1em; text-transform: uppercase; color: #9FD3B5; white-space: nowrap; }
  #bjAutoModal .tslbl { margin: 12px 0 6px; } #bjAutoModal .bjabet { margin-left: auto; font: 24px/1 var(--lilita); font-weight: 400; color: #fff; }
  #bjAutoModal .tsbox { margin-top: 10px; padding: 2px 12px 12px; }
  #bjAutoModal .bjasteps { display: flex; gap: 12px; margin-top: 10px; } #bjAutoModal .bjastep { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; } #bjAutoModal .bjastep .bjalbl { white-space: normal; } #bjAutoModal .bjastep .apstep { margin: 0; }
  #bjAutoModal .apstep { display: flex; align-items: center; gap: 8px; margin: 8px 0 0; padding: 0; background: none; border-radius: 0; font: 19px/1 var(--lilita); color: #fff; }
  #bjAutoModal .apstep .onoff { gap: 10px; flex: 1 1 auto; min-width: 0; white-space: nowrap; }
  #bjAutoModal .apstep .amt { gap: 6px; flex: 0 0 auto; display: flex; align-items: center; }
  #bjAutoModal .apstep .amt button { width: 36px; height: 36px; padding: 0; background: #5B6B7A; color: #fff; border: 3px solid var(--ink2); border-radius: 10px; box-shadow: 0 3px 0 var(--ink2); font: 22px/1 var(--lilita); }
  #bjAutoModal .apstep .amt button:disabled { opacity: .4; }
  #bjAutoModal .apstep .amt b { display: grid; place-items: center; min-width: 76px; height: 38px; padding: 0 8px; background: #fff; color: var(--ink2); border: 3px solid var(--ink2); border-radius: 12px; font: 22px/1 var(--lilita); font-weight: 400; }
  #bjAutoModal .bjasteps .apstep .amt b { min-width: 48px; }
  #bjAutoModal .apstep .amt b.loss { color: #C8323C; } #bjAutoModal .apstep .amt b.gain { color: #2E9A55; }
  #bjAutoModal .bjalimits > .tslbl:first-child { margin: 10px 0 0; }
  #bjAutoModal .bjaskills { padding-top: 6px; } /* (the skill tiles, pickers.css: room for the lifted tile and its ⓘ under the label) */
  #bjAutoModal #bjAutoD21 > .tslbl { margin-top: 12px; }
  #bjAutoModal .apsum { margin: 12px 0 8px; padding: 10px 14px; text-align: left; font-size: 15px; color: var(--ink2); }
  #bjAutoModal #bjAutoErr { margin: 10px 0 4px; min-height: 0; } #bjAutoModal #bjAutoErr:empty { display: none; }
  #bjAutoModal #bjAutoPlayNote { margin-top: 8px; }
  @media (max-width: 379px) { #bjAutoModal .apstep .amt b { min-width: 64px; font-size: 19px; } #bjAutoModal .apstep .amt button { width: 32px; } #bjAutoModal .apstep { font-size: 17px; } #bjAutoModal .apseg { gap: 6px; } #bjAutoModal .apseg button { font-size: 15px; padding: 4px 3px; } #bjAutoModal .bjabet { font-size: 21px; } #bjAutoModal .bjalbl { font-size: 11px; letter-spacing: .06em; } }
  @media (max-width: 379px) { .bjadminrow .menurig, .bjadminrow .menuauto { font-size: 18px; } }
