/* Bjack: the main cabin of a Mississippi side-wheeler at dusk. Cream cabin panelling with gilt pinstripes, a scroll-sawn
   gingerbread band under the header, arched windows onto the river (low sun, the far shore, a steamboat on the horizon,
   the paddle wheel turning under its fan-shaped box), a baize table in a polished oak rail with brass tacks.
   Type: Elsie Black (Victorian display) + Lora (text) + Chivo Mono (seeds, hashes); Diplomata SC only for the felt print.
   Art: wall.svg, fret.svg, deck.svg, window-wide.svg, window-tall.svg (scratch/bjack/art.mjs). */
@font-face { font-family: 'Elsie'; src: url(/fonts/elsie-900.woff2) format('woff2'); font-weight: 900; font-display: swap; }
@font-face { font-family: 'Diplomata SC'; src: url(/fonts/diplomata-sc.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Lora'; src: url(/fonts/lora.woff2) format('woff2'); font-weight: 400 700; font-display: swap; }
@font-face { font-family: 'Chivo Mono'; src: url(/fonts/chivo-mono.woff2) format('woff2'); font-weight: 400 500; font-display: swap; }

:root {
  --cream: #f3e8d2; --cream-2: #e9d9bb; --ivory: #fbf5e8; --paper: #f8f0de;
  --oak: #b07a3e; --oak-hi: #d39d5c; --oak-lo: #7a4f24;
  --brass: #c69a45; --brass-hi: #ecd08a; --brass-lo: #8a6524;
  --ox: #6b1e1b; --ox-hi: #8c2a25; --ox-lo: #4a1311;
  --baize: #335c3e; --baize-hi: #3f7049; --baize-lo: #1f3d28;
  --dusk: #6f5a86; --river: #4e3a52;
  --ink: #2a1b14; --ink-2: #6a5243; --line: rgba(42,27,20,.16);
  --card-face: #fffaf0; --card-edge: #d6c7a8; --court: #f6ead6;
  --suit-red: #9b2621; --suit-black: #2a1b14;
  --win: #2f6a3c; --lose: #8c2a25;
  --display: 'Elsie', 'Didot', Georgia, serif;
  --letter: 'Diplomata SC', 'Elsie', Georgia, serif;
  --text: 'Lora', Georgia, 'Times New Roman', serif;
  --mono: 'Chivo Mono', ui-monospace, Menlo, monospace;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--cream); }
body {
  margin: 0; min-height: 100vh; color: var(--ink); font: 500 18px/1.55 var(--text); overflow-x: hidden;
  font-variant-numeric: lining-nums;
  background: url(wall.svg) 0 0 / 180px 300px, var(--cream);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ox); outline-offset: 3px; }

/* ---------- header: an ivory texas-deck rail with the gingerbread band hanging under it ---------- */
.rail-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s5);
  padding: 12px max(24px, env(safe-area-inset-left)) 10px; color: var(--ink);
  background: linear-gradient(var(--ivory), #f1e5cc); box-shadow: inset 0 -2px 0 var(--brass);
}
.rail-top::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none;
  background: url(fret.svg) 0 0 / 50px 43px repeat-x; filter: drop-shadow(0 5px 4px rgba(42,27,20,.28)); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ox); }
.brand svg { width: 50px; height: 50px; filter: drop-shadow(0 3px 3px rgba(42,27,20,.3)); }
.brand span { font: 900 36px/1 var(--display); letter-spacing: .005em; }
.rail-top nav { display: flex; gap: var(--s5); margin-left: var(--s4); }
.rail-top nav a { text-decoration: none; font-weight: 600; font-size: 17px; color: var(--ink); padding: 6px 0 3px; border-bottom: 2px solid transparent; }
.rail-top nav a:hover, .rail-top nav a[aria-current] { border-color: var(--ox); }
.btn-wallet { margin-left: auto; }

/* ---------- buttons: oxblood leather with a brass inlay, cream enamel, baize green; a hard lower edge ---------- */
.btn {
  --edge: #2e0b0a; --inlay: rgba(236,208,138,.7); position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 24px;
  border: 0; border-radius: 6px; font: 700 17px/1 var(--text); letter-spacing: .02em; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 0 var(--edge), 0 10px 16px -10px rgba(42,27,20,.75);
  transform: translateY(0); transition: transform .08s, box-shadow .08s, filter .15s; -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn::after { content: ""; position: absolute; inset: 4px; border: 1px solid var(--inlay); border-radius: 3px; pointer-events: none; }
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 3px 6px -4px rgba(42,27,20,.5); }
.btn:disabled { cursor: not-allowed; filter: saturate(.25) opacity(.5); }
.btn-brass { background: linear-gradient(#8c2a25, var(--ox) 60%, #561614); color: var(--ivory); --edge: #2e0b0a; }
.btn-ivory { background: linear-gradient(#fffaf0, var(--cream-2)); color: var(--ink); --edge: #b3a07c; --inlay: rgba(198,154,69,.8); }
.btn-claret { background: linear-gradient(var(--baize-hi), var(--baize) 60%, #284a31); color: var(--ivory); --edge: #142a1b; }
.btn-ink { background: linear-gradient(#4a3326, var(--ink)); color: var(--ivory); --edge: #120b08; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn kbd { font: 400 12px/1 var(--mono); opacity: .7; border: 1px solid currentColor; border-radius: 4px; padding: 3px 4px 2px; }

/* ---------- the cabin wall behind the table: arched windows onto the river at dusk (two tall ones on wide screens) ---------- */
.table-wrap { --win-w: min(760px, calc(100vw - 48px)); --win-h: calc(var(--win-w) * .2);
  position: relative; isolation: isolate; padding: calc(var(--win-h) + 82px) 24px 0; max-width: 1220px; margin: 0 auto; }
.table-wrap::before { content: ""; position: absolute; z-index: -1; top: 60px; left: 50%; width: var(--win-w); margin-left: calc(var(--win-w) / -2); height: var(--win-h); pointer-events: none;
  background: url(window-wide.svg) 0 0 / 100% 100% no-repeat; filter: drop-shadow(0 8px 8px rgba(80,50,20,.35)); }
.table-wrap::after { content: ""; position: absolute; z-index: -1; top: calc(60px + var(--win-h)); left: 50%; width: calc(var(--win-w) + 30px); margin-left: calc(var(--win-w) / -2 - 15px); height: 10px; pointer-events: none;
  background: linear-gradient(var(--oak-hi), var(--oak-lo)); border-radius: 2px; box-shadow: 0 6px 8px -4px rgba(80,50,20,.5); }
@media (min-width: 1320px) {
  .table-wrap { max-width: 1080px; padding-top: 76px; --tw: min(220px, calc(50vw - 540px - 40px)); }
  .table-wrap::before { top: 100px; left: 0; margin-left: calc(540px - 50vw); width: 100vw; height: calc(var(--tw) * 1.75);
    background: url(window-tall.svg) calc((50vw - 540px - var(--tw)) / 2 + 4px) 0 / var(--tw) calc(var(--tw) * 1.75) no-repeat, url(window-tall.svg) calc(100vw - (50vw - 540px + var(--tw)) / 2 - 4px) 0 / var(--tw) calc(var(--tw) * 1.75) no-repeat; }
  .table-wrap::after { top: calc(100px + var(--tw) * 1.75); left: 0; margin-left: calc(540px - 50vw); width: 100vw; box-shadow: none; height: 12px;
    background: linear-gradient(var(--oak-hi), var(--oak-lo)) calc((50vw - 540px - var(--tw)) / 2 - 10px) 0 / calc(var(--tw) + 28px) 12px no-repeat, linear-gradient(var(--oak-hi), var(--oak-lo)) calc(100vw - (50vw - 540px + var(--tw)) / 2 + 10px) 0 / calc(var(--tw) + 28px) 12px no-repeat; }
}
/* polished oak rail with a brass rim and a ring of brass tacks */
.table-rail {
  position: relative; padding: 18px; border: 3px solid var(--brass-lo);
  border-radius: 38px 38px 200px 200px / 38px 38px 128px 128px;
  background:
    repeating-linear-gradient(91deg, rgba(122,79,36,0) 0 18px, rgba(122,79,36,.2) 18px 19px, rgba(122,79,36,0) 19px 37px, rgba(255,240,210,.18) 37px 38px),
    linear-gradient(180deg, #d9a466, var(--oak) 45%, #7f5226);
  box-shadow: inset 0 0 0 2px var(--brass), inset 0 3px 0 rgba(255,240,210,.4), inset 0 -6px 10px -4px rgba(60,35,10,.55), 0 34px 50px -30px rgba(50,25,10,.85);
}
.table-rail::before { content: ""; position: absolute; inset: 7px; border-radius: 32px 32px 192px 192px / 32px 32px 122px 122px; border: 4px dotted var(--brass-hi); opacity: .9; pointer-events: none; }
#felt {
  height: clamp(420px, calc(100vh - 400px), 620px); height: clamp(420px, calc(100svh - 400px), 620px);
  border-radius: 24px 24px 182px 182px / 24px 24px 112px 112px; container-type: inline-size;
  background: radial-gradient(80% 70% at 50% 24%, var(--baize-hi), var(--baize) 58%, var(--baize-lo));
  box-shadow: inset 0 0 0 1px rgba(10,25,14,.6), inset 0 14px 22px -14px rgba(10,20,12,.75), inset 0 -18px 30px -20px rgba(10,20,12,.6);
}
#felt::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .55; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)'/%3E%3C/svg%3E"); }
/* a thin cream inlay line and the warm river light from the windows across the baize */
#felt::after { content: ""; position: absolute; inset: 12px; border-radius: 16px 16px 172px 172px / 16px 16px 104px 104px; pointer-events: none; border: 1.5px solid rgba(243,232,210,.42);
  background: linear-gradient(165deg, rgba(239,159,92,.16), rgba(239,159,92,0) 42%); }
.felt .print { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.felt .print-narrow { display: none; }
@container (max-width: 640px) { .felt .print-wide { display: none; } .felt .print-narrow { display: block; } }
.print-big { font: 400 27px var(--letter); letter-spacing: 1px; fill: var(--cream); opacity: .8; }
.print-small { font: 600 12.5px var(--text); letter-spacing: 3.4px; fill: var(--cream); opacity: .66; }
.print-fan path, .print-arc { stroke: var(--cream); stroke-width: 2; fill: none; opacity: .38; }
.print-rule { stroke: var(--brass-hi); stroke-width: 1.4; fill: none; opacity: .6; }
.print-dia { fill: var(--brass-hi); opacity: .75; }
.print-narrow .print-big { font-size: 19px; letter-spacing: .5px; }
.print-narrow .print-small { font-size: 10.5px; letter-spacing: 2.2px; }
.felt .spot { border: 2px solid rgba(236,208,138,.75); box-shadow: 0 0 0 5px rgba(10,25,14,.12); }
.felt .spot::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 1px dashed rgba(243,232,210,.4); }
.felt .card .face, .felt .card .back { box-shadow: 0 1px 0 rgba(42,27,20,.3), 0 10px 14px -6px rgba(8,20,10,.7); }
.felt .card.won .face { box-shadow: 0 0 0 3px var(--ivory), 0 0 0 5px var(--brass), 0 10px 16px -8px rgba(8,20,10,.6); }
.felt .card.dead .card-inner { filter: saturate(.4) brightness(.78); }
.cardface > rect:first-child { stroke-width: 1.2; }
.cx-rank { font: 900 20px var(--display); }
.cx-court { font: 900 42px var(--display); }
.chip-label { font: 700 15px var(--text); }
.felt .total {
  font: 900 calc(var(--card-w) * .25) / 1 var(--display); color: var(--ink); padding: 6px 11px 5px; border-radius: 4px;
  background: var(--ivory); box-shadow: inset 0 0 0 1.5px var(--brass-lo), inset 0 0 0 4px var(--ivory), inset 0 0 0 5px rgba(198,154,69,.7), 0 4px 0 rgba(8,20,10,.45);
}
.felt .total.bust { color: var(--ivory); background: var(--ox); box-shadow: inset 0 0 0 3px var(--ox), inset 0 0 0 4.5px rgba(236,208,138,.6), 0 4px 0 #2e0b0a; }
.felt .total.bj { color: var(--ink); background: var(--brass-hi); box-shadow: inset 0 0 0 3px var(--brass-hi), inset 0 0 0 4.5px var(--brass-lo), 0 4px 0 var(--brass-lo); }
.felt .total.active { box-shadow: inset 0 0 0 1.5px var(--brass-lo), 0 0 0 4px var(--brass-hi), 0 4px 0 rgba(8,20,10,.45); }
.felt .discard.has::before { content: ""; position: absolute; inset: 0; border-radius: 7px; background: var(--ox); border: 3px solid var(--card-face);
  box-shadow: 1px 1px 0 #d6c7a8, 2px 2px 0 var(--card-face), 3px 3px 0 #c4b391, calc(var(--n,1) * 1px + 3px) calc(var(--n,1) * 1px + 3px) 0 #b09f7c, 0 10px 14px -8px rgba(8,20,10,.6); transform: rotate(-6deg); }
.felt .rack svg .rack-body { fill: var(--oak); }
.felt .rack svg .rack-lip { fill: var(--brass-lo); }
.felt .rack { filter: drop-shadow(0 6px 6px rgba(8,20,10,.5)); }
.felt .shoe { filter: drop-shadow(0 10px 10px rgba(8,20,10,.5)); }

/* the table's line under the felt */
.talk { min-height: 66px; display: flex; align-items: center; justify-content: center; padding: var(--s3) var(--s4) 0; }
.talk .dealer-line { position: static; transform: none; font: 900 24px/1.3 var(--display); color: var(--ink); max-width: 46ch; text-align: center; }
.talk .dealer-line.in { animation: line-in .5s ease-out; }
@keyframes line-in { from { opacity: 0; transform: translateY(4px); } }

/* ---------- the player's side ---------- */
.controls { max-width: 1100px; margin: 0 auto; padding: var(--s3) 24px 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4) var(--s6); align-items: center; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chipbtn { width: 66px; padding: 0; border: 0; background: none; cursor: pointer; transition: transform .15s cubic-bezier(.3,1.5,.5,1); -webkit-tap-highlight-color: transparent; filter: drop-shadow(0 5px 3px rgba(60,35,10,.4)); }
.chipbtn:hover:not(:disabled) { transform: translateY(-5px); }
.chipbtn:active:not(:disabled) { transform: translateY(1px) scale(.96); }
.chipbtn:disabled { opacity: .35; cursor: not-allowed; }
.betbox { display: flex; align-items: center; gap: var(--s3); justify-content: flex-end; flex-wrap: wrap; }
.betamt { font: 900 34px/1 var(--display); min-width: 4ch; text-align: right; color: var(--ink); }
.betamt small { font: 600 15px var(--text); color: var(--ink-2); margin-left: 6px; }
.acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.acts .btn { min-height: 60px; font-size: 19px; }
.under { max-width: 1100px; margin: 0 auto; padding: var(--s4) 24px 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); color: var(--ink-2); font-size: 16px; }
.under b { color: var(--ink); font-weight: 700; }
.under .mono, .mono { font-family: var(--mono); font-size: .86em; word-break: break-all; }
.under button.link, .link { background: none; border: 0; padding: 0; text-decoration: underline; text-decoration-thickness: 2px; text-decoration-color: var(--brass); text-underline-offset: 3px; cursor: pointer; color: var(--ink); font-weight: 700; }
.testnote { color: var(--baize); font-weight: 700; }

/* ---------- under the table ---------- */
.sect { max-width: 1100px; margin: 0 auto; padding: var(--s8) 24px 0; }
.sect h2 { font: 900 clamp(30px, 3.6vw, 42px)/1.05 var(--display); margin: 0 0 var(--s5); color: var(--ox); }
.two { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s7); align-items: start; }
.floor { width: 100%; border-collapse: collapse; font-size: 17px; background: rgba(251,245,232,.92); box-shadow: 0 0 0 1.5px rgba(42,27,20,.18); }
.floor th { text-align: left; font-weight: 700; color: var(--ivory); font-size: 13px; letter-spacing: .12em; text-transform: uppercase; padding: 11px 10px 9px; background: var(--ox); box-shadow: inset 0 -2px 0 var(--brass); }
.floor td { padding: 11px 10px 9px; border-bottom: 1px solid var(--line); }
.floor td.n, .floor th.n { text-align: right; }
.floor .up { color: var(--win); font-weight: 700; }
.floor .down { color: var(--lose); font-weight: 700; }
.floor tr.new td { animation: rowin 1.3s ease-out; }
@keyframes rowin { from { background: rgba(239,159,92,.35); } }
.empty { color: var(--ink-2); padding: var(--s4) 10px; font-style: italic; }
/* the house rules as a printed notice in a brass-cornered oak frame, like the rules posted in a steamboat cabin */
.placard { position: relative; color: var(--ink); border-radius: 3px; padding: 40px 34px 34px; text-align: left;
  background: linear-gradient(rgba(255,252,243,.6), rgba(255,252,243,0)), var(--paper);
  box-shadow: inset 0 0 0 10px var(--oak), inset 0 0 0 12px var(--brass), inset 0 0 0 13px var(--oak-lo), 0 26px 40px -26px rgba(50,25,10,.85); }
.placard::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 10px 10px, var(--brass-hi) 0 3px, var(--brass) 3.5px 7px, transparent 7.5px) 0 0 / 100% 100% no-repeat,
    radial-gradient(circle at calc(100% - 10px) 10px, var(--brass-hi) 0 3px, var(--brass) 3.5px 7px, transparent 7.5px),
    radial-gradient(circle at 10px calc(100% - 10px), var(--brass-hi) 0 3px, var(--brass) 3.5px 7px, transparent 7.5px),
    radial-gradient(circle at calc(100% - 10px) calc(100% - 10px), var(--brass-hi) 0 3px, var(--brass) 3.5px 7px, transparent 7.5px); }
.placard::after { content: ""; position: absolute; left: 24px; right: 24px; top: 24px; bottom: 24px; border: 1px solid rgba(107,30,27,.45); outline: 1px solid rgba(107,30,27,.25); outline-offset: 3px; pointer-events: none; }
.placard h3 { font: 900 30px/1.1 var(--display); margin: 0 0 var(--s3); text-align: center; color: var(--ox); }
.placard ul { margin: 0; padding: 0 8px; list-style: none; }
.placard li { padding: 7px 0 5px; display: flex; align-items: baseline; gap: 0; border-bottom: 1px dotted rgba(42,27,20,.35); }
.placard li:last-child { border-bottom: 0; }
.placard li::after { content: ""; order: 1; flex: 1 1 18px; min-width: 18px; }
.placard li b { order: 2; font-weight: 700; text-align: right; max-width: 62%; }
.placard .muted { color: var(--ink-2); padding: 0 8px 8px; }
.placard a { color: var(--ink); text-decoration-color: var(--brass); }
.edge { font: 900 64px/1 var(--display); color: var(--ox); margin: var(--s4) 0 var(--s2); text-align: center; }

/* ---------- inner pages ---------- */
.page { max-width: 1020px; margin: calc(var(--s7) + 30px) auto 0; padding: var(--s7) 44px var(--s7); background: rgba(250,243,228,.95); border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(198,154,69,.7), inset 0 0 0 5px rgba(250,243,228,.95), inset 0 0 0 6px rgba(198,154,69,.45), 0 24px 40px -28px rgba(50,25,10,.7); }
.page h1 { font: 900 clamp(40px, 6vw, 64px)/1 var(--display); margin: 0 0 var(--s5); color: var(--ox); }
.page h2 { font: 900 28px/1.15 var(--display); margin: var(--s7) 0 var(--s3); }
.page p, .page li { max-width: 68ch; }
.page .lead { font-size: 21px; }
.kv { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 24px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; font-weight: 700; min-width: 0; overflow-wrap: anywhere; }
.strategy { border-collapse: separate; border-spacing: 2px; font: 700 13px var(--text); margin: var(--s3) 0; }
.strategy th, .strategy td { width: 34px; height: 28px; text-align: center; border-radius: 3px; }
.strategy th { color: var(--ink-2); font-weight: 600; }
.strategy td.H { background: var(--ivory); } .strategy td.S { background: #e8d2a8; } .strategy td.D { background: var(--ox); color: var(--ivory); } .strategy td.P { background: var(--baize); color: var(--ivory); }
.scroll-x { overflow-x: auto; max-width: 100%; }
.form { display: grid; gap: var(--s3); max-width: 640px; }
.form label { font-weight: 700; display: grid; gap: 6px; }
.form input { font: 400 16px var(--mono); padding: 12px 14px; border: 2px solid var(--ink); border-radius: 4px; background: var(--ivory); color: var(--ink); min-width: 0; }
.check { margin-top: var(--s4); padding: var(--s4) var(--s5); border-radius: 4px; background: var(--paper); box-shadow: inset 0 0 0 2px var(--baize), 0 3px 0 rgba(42,27,20,.25); }
.check .ok { color: var(--win); font-weight: 700; }
.check .no { color: var(--lose); font-weight: 700; }
.minicards { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.minicards svg { width: 46px; height: auto; filter: drop-shadow(0 2px 2px rgba(42,27,20,.35)); }

/* the footer stands on the oak deck */
.foot { max-width: none; margin: var(--s8) 0 0; padding: calc(var(--s6) + 22px) max(24px, calc(50vw - 526px)) var(--s7); position: relative; color: var(--ivory); font-size: 16px;
  background: linear-gradient(rgba(42,27,20,.3), rgba(42,27,20,.45)), url(deck.svg) 0 0 / 480px 96px; }
.foot::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 12px; background: linear-gradient(var(--brass-hi), var(--brass) 50%, var(--brass-lo)); }
.foot .risk { margin: 0 0 var(--s3); max-width: 70ch; }
.foot-links { display: flex; gap: var(--s5); flex-wrap: wrap; font-weight: 700; margin: 0; }
.castrip { background: var(--ox); color: var(--ivory); text-align: center; padding: 50px 16px 8px; font-weight: 700; }
.castrip span { overflow-wrap: anywhere; font-family: var(--mono); }

dialog { border: 0; border-radius: 4px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--paper); color: var(--ink);
  box-shadow: inset 0 0 0 6px var(--oak), inset 0 0 0 8px var(--brass), 0 30px 60px -20px rgba(42,27,20,.75); }
dialog::backdrop { background: rgba(42,27,20,.5); }
dialog .muted { color: var(--ink-2); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s5) var(--s5) var(--s3); border-bottom: 1px solid rgba(107,30,27,.35); margin: 0 14px; }
.dlg-head h2 { margin: 0; font: 900 26px/1 var(--display); color: var(--ox); }
.dlg-x { border: 0; background: none; font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px; color: var(--ink); }
.dlg-body { padding: var(--s5) calc(var(--s5) + 6px) calc(var(--s5) + 6px); display: grid; gap: var(--s3); }
.dlg-body a { color: var(--ink); }
.wallets { display: grid; gap: var(--s2); }
.wallets button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 2px solid var(--ink); border-radius: 6px; background: var(--ivory); color: var(--ink); font-weight: 700; cursor: pointer; text-align: left; box-shadow: 0 3px 0 var(--ink); }
.wallets button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
.wallets img { width: 28px; height: 28px; border-radius: 6px; }
.muted { color: var(--ink-2); font-size: 16px; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); visibility: hidden; background: var(--ink); color: var(--ivory); padding: 13px 18px 11px; border-radius: 6px; font-weight: 600; transition: transform .25s; z-index: 50; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px -10px rgba(42,27,20,.8); }
.toast.on { transform: translate(-50%, 0); visibility: visible; }

@media (max-width: 900px) {
  .rail-top nav { display: none; }
  .two { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  body { font-size: 17px; }
  .rail-top { padding: 9px 14px 9px; gap: var(--s3); }
  .rail-top::after { height: 30px; background-size: 37px 32px; }
  .brand span { font-size: 30px; }
  .brand svg { width: 42px; height: 42px; }
  .btn-wallet { min-height: 42px; padding: 0 14px; font-size: 14.5px; }
  .table-wrap { --win-w: calc(100vw - 32px); padding: calc(var(--win-h) + 62px) 8px 0; }
  .table-wrap::before { top: 44px; }
  .table-wrap::after { top: calc(44px + var(--win-h)); width: calc(var(--win-w) + 16px); margin-left: calc(var(--win-w) / -2 - 8px); }
  .table-rail { padding: 12px; border-width: 2px; border-radius: 24px 24px 80px 80px / 24px 24px 64px 64px; }
  .table-rail::before { inset: 4px; border-width: 3px; border-radius: 20px 20px 76px 76px / 20px 20px 60px 60px; }
  #felt { height: clamp(400px, calc(100vh - 320px), 540px); height: clamp(400px, calc(100svh - 320px), 540px); border-radius: 16px 16px 72px 72px / 16px 16px 56px 56px; }
  #felt::after { inset: 7px; border-radius: 10px 10px 66px 66px / 10px 10px 50px 50px; }
  .talk { min-height: 58px; }
  .talk .dealer-line { font-size: 20px; }
  .controls { grid-template-columns: minmax(0, 1fr); padding: var(--s2) 14px 0; }
  .chips { justify-content: center; gap: 6px; }
  .chipbtn { width: 52px; }
  .betbox { justify-content: center; }
  .acts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acts .btn { min-height: 56px; }
  .under { padding: var(--s4) 14px 0; font-size: 15px; }
  .sect { padding: var(--s7) 14px 0; }
  .floor .hide-s { display: none; }
  .page { margin: calc(var(--s7) + 14px) 10px 0; padding: var(--s6) 18px var(--s6); }
  .strategy th, .strategy td { width: 26px; height: 24px; font-size: 11.5px; }
  .placard { padding: 36px 24px 30px; }
  .placard::after { left: 18px; right: 18px; top: 18px; bottom: 18px; }
  .foot { padding: calc(var(--s6) + 14px) 14px var(--s6); }
}
