/* Hitme: a claret card table under a lamp, black padded rail, brass print, bone-white room. */
@font-face { font-family: 'Gravitas One'; src: url(/fonts/gravitas.woff2) format('woff2'); font-display: swap; }
@font-face { font-family: 'Pathway Extreme'; src: url(/fonts/pathway.woff2) format('woff2'); font-weight: 100 900; font-stretch: 75% 100%; font-display: swap; }
@font-face { font-family: 'Cousine'; src: url(/fonts/cousine.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Cousine'; src: url(/fonts/cousine-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bone: #efe6d6; --paper: #f8f2e6; --ink: #1b1315; --ink-2: #5d4f50; --line: #d9cdb8;
  --felt: #741528; --felt-hi: #93243a; --felt-lo: #470b17;
  --brass: #d4a548; --brass-hi: #f0cd7a; --brass-lo: #94691f;
  --rail: #1a1214; --rail-hi: #3b2b2e;
  --card-face: #fbf6ea; --card-edge: #d3c6ad; --court: #f3e5c6;
  --suit-red: #b5162c; --suit-black: #19141a;
  --win: #2b7a4c; --lose: #a8261d;
  --display: 'Gravitas One', 'Didot', Georgia, serif;
  --text: 'Pathway Extreme', 'Helvetica Neue', Arial, sans-serif;
  --mono: 'Cousine', 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%; }
body {
  margin: 0; min-height: 100vh; background: var(--bone); color: var(--ink); font: 400 17px/1.5 var(--text);
  font-variant-numeric: tabular-nums lining-nums; overflow-x: hidden;
  background-image: radial-gradient(1200px 520px at 50% 210px, #f7efe1 0%, transparent 70%), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .27 0 0 0 0 .2 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--brass-lo); outline-offset: 3px; }

/* ---------- the rail across the top ---------- */
.rail-top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--s5);
  padding: 14px max(20px, env(safe-area-inset-left)) 16px; color: #f3eadb;
  background: linear-gradient(#2c2023, #170f11 55%, #0f0a0b);
  box-shadow: inset 0 -1px 0 #000, 0 2px 0 rgba(0,0,0,.08), 0 10px 24px -14px rgba(0,0,0,.6);
}
.rail-top::after { content: ""; position: absolute; left: 14px; right: 14px; bottom: 6px; border-bottom: 1.5px dashed rgba(212,165,72,.45); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand svg { width: 42px; height: 42px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.45)); }
.brand span { font: 400 30px/1 var(--display); letter-spacing: .01em; color: #f6eedf; }
.rail-top nav { display: flex; gap: var(--s5); margin-left: var(--s5); }
.rail-top nav a { text-decoration: none; font-weight: 600; font-size: 16px; color: #d9cdb8; padding: 6px 0; border-bottom: 2px solid transparent; }
.rail-top nav a:hover, .rail-top nav a[aria-current] { color: #fff; border-color: var(--brass); }
.btn-wallet { margin-left: auto; }

/* ---------- buttons: casino push-buttons with a real edge ---------- */
.btn {
  --edge: #6f4d16; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px;
  border: 0; border-radius: 12px; font: 750 17px/1 var(--text); font-stretch: 88%; letter-spacing: .01em; cursor: pointer; text-decoration: none;
  box-shadow: 0 4px 0 var(--edge), 0 6px 14px -6px rgba(0,0,0,.45); transform: translateY(0); transition: transform .08s, box-shadow .08s, filter .15s;
  -webkit-tap-highlight-color: transparent; user-select: none;
}
.btn:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 var(--edge), 0 2px 6px -4px rgba(0,0,0,.4); }
.btn:disabled { cursor: not-allowed; filter: saturate(.3) opacity(.5); }
.btn-brass { background: linear-gradient(#f2d082, #d7a74a 55%, #c08f33); color: #231708; --edge: #8a6220; }
.btn-ivory { background: linear-gradient(#fffaf0, #efe4cf); color: var(--ink); --edge: #b7a886; }
.btn-claret { background: linear-gradient(#a42a40, #7a1629); color: #fbf1e3; --edge: #3e0710; }
.btn-ink { background: linear-gradient(#3a2d30, #1a1214); color: #f6eedf; --edge: #000; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 15px; border-radius: 10px; }
.btn kbd { font: 600 12px/1 var(--mono); opacity: .55; border: 1px solid currentColor; border-radius: 4px; padding: 3px 4px 2px; }

/* ---------- the table ---------- */
.table-wrap { padding: var(--s5) 20px 0; max-width: 1360px; margin: 0 auto; }
.table-rail {
  position: relative; padding: 18px 18px 26px; border-radius: 26px 26px 50% 50% / 26px 26px 34% 34%;
  background: radial-gradient(120% 140% at 50% 0%, #3e2c2f, #1b1214 45%, #0d0809);
  box-shadow: inset 0 2px 0 rgba(255,255,255,.08), inset 0 -10px 18px rgba(0,0,0,.6), 0 28px 50px -26px rgba(40,14,20,.65), 0 2px 0 #0a0607;
}
.table-rail::before { content: ""; position: absolute; inset: 8px 8px 12px; border-radius: inherit; border: 1.5px dashed rgba(212,165,72,.35); pointer-events: none; }
#felt {
  height: clamp(420px, calc(100vh - 350px), 620px); height: clamp(420px, calc(100svh - 350px), 620px); border-radius: 14px 14px 50% 50% / 14px 14px 32% 32%; container-type: inline-size;
  background:
    radial-gradient(62% 70% at 50% 34%, rgba(255,214,170,.20), transparent 70%),
    radial-gradient(130% 110% at 50% 20%, var(--felt-hi) 0%, var(--felt) 46%, var(--felt-lo) 100%);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.35), inset 0 18px 40px -20px rgba(0,0,0,.7), inset 0 -30px 60px -30px rgba(0,0,0,.6);
}
#felt::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: .5; mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='1.3' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E"); }
.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: 800 31px var(--text); font-stretch: 78%; letter-spacing: 5px; fill: var(--brass); opacity: .88; }
.print-small { font: 650 12.5px var(--text); font-stretch: 80%; letter-spacing: 2.2px; fill: var(--brass); opacity: .7; }
.print-narrow .print-big { font-size: 24px; letter-spacing: 3px; }
.print-narrow .print-small { font-size: 12px; letter-spacing: 2px; }
.felt .spot { border: 2.5px solid rgba(212,165,72,.75); box-shadow: inset 0 0 0 6px rgba(212,165,72,.08), 0 0 0 5px rgba(0,0,0,.08); }
.felt .spot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1px solid rgba(212,165,72,.35); }
.felt .card .face, .felt .card .back { box-shadow: 0 1px 0 rgba(0,0,0,.25), 0 6px 12px -6px rgba(0,0,0,.55); }
.felt .card.won .face { box-shadow: 0 0 0 2px var(--brass), 0 8px 16px -8px rgba(0,0,0,.6); }
.cx-rank { font: 900 21px var(--text); font-stretch: 75%; letter-spacing: -1px; }
.cx-court { font: 400 50px var(--display); }
.chip-label { font: 900 12.5px var(--text); font-stretch: 78%; }
.felt .total {
  font: 400 calc(var(--card-w) * .3) / 1 var(--display); color: #fbf1e3; text-shadow: 0 2px 0 rgba(0,0,0,.45); padding: 6px 12px 7px; border-radius: 10px;
  background: rgba(30,8,13,.55);
}
.felt .total.bust { color: #ffb4a6; background: rgba(60,6,10,.7); }
.felt .total.bj { color: #241707; background: linear-gradient(var(--brass-hi), var(--brass)); text-shadow: none; font-size: calc(var(--card-w) * .24); }
.felt .total.active { box-shadow: 0 0 0 2px var(--brass); }
.felt .discard.has::before { content: ""; position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(#7a1828, #5a0f1d); border: 3px solid #f2e9d8;
  box-shadow: 1px 1px 0 #e3d7c0, 2px 2px 0 #f2e9d8, 3px 3px 0 #d8ccb5, calc(var(--n,1) * 1px + 3px) calc(var(--n,1) * 1px + 3px) 0 #cbbea5, 0 10px 14px -8px rgba(0,0,0,.6); transform: rotate(-8deg); }
.felt .rack svg .rack-body { fill: #120c0d; }
.felt .rack svg .rack-lip { fill: #2c2023; }

/* the dealer talking, just under the table */
.talk { min-height: 64px; display: flex; align-items: center; justify-content: center; padding: var(--s3) var(--s4) 0; }
.talk .dealer-line { position: static; transform: none; font: italic 500 22px/1.3 var(--text); font-stretch: 92%; color: var(--ink); max-width: 46ch; text-align: center; }
.talk .dealer-line.in { animation: talk-in .45s ease-out; }
@keyframes talk-in { from { opacity: 0; transform: translateY(5px); } }

/* ---------- the player's rail: chips, bet, buttons ---------- */
.controls { max-width: 1100px; margin: 0 auto; padding: var(--s3) 20px 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 .12s; -webkit-tap-highlight-color: transparent; }
.chipbtn:hover:not(:disabled) { transform: translateY(-4px); }
.chipbtn:active:not(:disabled) { transform: translateY(1px) scale(.97); }
.chipbtn:disabled { opacity: .32; cursor: not-allowed; }
.betbox { display: flex; align-items: center; gap: var(--s3); justify-content: flex-end; flex-wrap: wrap; }
.betamt { font: 400 28px/1 var(--display); min-width: 4ch; text-align: right; }
.betamt small { font: 600 14px var(--text); color: var(--ink-2); margin-left: 4px; }
.acts { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); }
.acts .btn { min-height: 58px; font-size: 19px; }
.acts .btn small { font-weight: 600; opacity: .7; font-size: 13px; }
.under { max-width: 1100px; margin: 0 auto; padding: var(--s4) 20px 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); color: var(--ink-2); font-size: 14.5px; }
.under b { color: var(--ink); font-weight: 700; }
.under .mono, .mono { font-family: var(--mono); font-size: .92em; word-break: break-all; }
.under button.link, .link { background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; color: var(--ink); font-weight: 650; }
.testnote { color: var(--felt); font-weight: 650; }

/* ---------- sections under the table ---------- */
.sect { max-width: 1100px; margin: 0 auto; padding: var(--s8) 20px 0; }
.sect h2 { font: 400 clamp(30px, 4vw, 44px)/1.05 var(--display); margin: 0 0 var(--s5); letter-spacing: -.005em; }
.two { display: grid; grid-template-columns: 1.15fr .85fr; gap: var(--s7); align-items: start; }
.floor { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.floor th { text-align: left; font-weight: 650; color: var(--ink-2); font-size: 13.5px; padding: 0 8px 8px; border-bottom: 1.5px solid var(--ink); }
.floor td { padding: 10px 8px; 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.2s ease-out; }
@keyframes rowin { from { background: rgba(212,165,72,.35); } }
.empty { color: var(--ink-2); padding: var(--s4) 0; }
.placard { background: var(--paper); border: 1.5px solid var(--ink); border-radius: 14px; padding: var(--s5); box-shadow: 6px 6px 0 var(--felt); }
.placard h3 { font: 400 26px/1.1 var(--display); margin: 0 0 var(--s3); }
.placard ul { margin: 0; padding: 0; list-style: none; }
.placard li { padding: 7px 0; border-bottom: 1px dashed var(--line); display: flex; justify-content: space-between; gap: var(--s4); }
.placard li:last-child { border: 0; }
.placard li b { font-weight: 750; text-align: right; }
.edge { font: 400 64px/1 var(--display); color: var(--felt); margin: var(--s3) 0 var(--s2); }

/* ---------- inner pages ---------- */
.page { max-width: 980px; margin: 0 auto; padding: var(--s7) 20px 0; }
.page h1 { font: 400 clamp(40px, 6vw, 64px)/1 var(--display); margin: 0 0 var(--s5); }
.page h2 { font: 400 30px/1.1 var(--display); margin: var(--s7) 0 var(--s3); }
.page p, .page li { max-width: 68ch; }
.page .lead { font-size: 20px; }
.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: 650; min-width: 0; overflow-wrap: anywhere; }
.strategy { border-collapse: collapse; font: 700 13px var(--text); margin: var(--s3) 0; }
.strategy th, .strategy td { width: 34px; height: 28px; text-align: center; border: 1px solid var(--bone); }
.strategy th { color: var(--ink-2); font-weight: 650; }
.strategy td.H { background: #e9dcc5; } .strategy td.S { background: #d9a94a; } .strategy td.D { background: #2b7a4c; color: #fff; } .strategy td.P { background: #741528; color: #fff; }
.scroll-x { overflow-x: auto; max-width: 100%; }
.form { display: grid; gap: var(--s3); max-width: 640px; }
.form label { font-weight: 650; display: grid; gap: 6px; }
.form input { font: 500 16px var(--mono); padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 10px; background: #fffaf1; color: var(--ink); min-width: 0; }
.check { margin-top: var(--s4); padding: var(--s4); border-radius: 12px; background: var(--paper); border: 1.5px solid var(--ink); }
.check .ok { color: var(--win); font-weight: 750; }
.check .no { color: var(--lose); font-weight: 750; }
.minicards { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.minicards svg { width: 46px; height: auto; filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); }

.foot { max-width: 1100px; margin: var(--s8) auto 0; padding: var(--s5) 20px var(--s7); border-top: 1.5px solid var(--ink); color: var(--ink-2); font-size: 14.5px; }
.foot-links { display: flex; gap: var(--s5); flex-wrap: wrap; }
.castrip { background: var(--brass); color: #231708; text-align: center; padding: 8px 16px; font-weight: 700; }
.castrip span { overflow-wrap: anywhere; font-family: var(--mono); }

dialog { border: 1.5px solid var(--ink); border-radius: 16px; padding: 0; width: min(460px, calc(100vw - 32px)); background: var(--paper); color: var(--ink); box-shadow: 8px 8px 0 var(--felt); }
dialog::backdrop { background: rgba(26,18,20,.55); }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s4) var(--s5); border-bottom: 1.5px solid var(--ink); }
.dlg-head h2 { margin: 0; font: 400 24px/1 var(--display); }
.dlg-x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.dlg-body { padding: var(--s5); display: grid; gap: var(--s3); }
.wallets { display: grid; gap: var(--s2); }
.wallets button { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1.5px solid var(--ink); border-radius: 12px; background: #fffaf1; font-weight: 700; cursor: pointer; text-align: left; }
.wallets img { width: 28px; height: 28px; border-radius: 6px; }
.muted { color: var(--ink-2); font-size: 15px; margin: 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); visibility: hidden; background: var(--rail); color: #f6eedf; padding: 12px 18px; border-radius: 12px; font-weight: 600; transition: transform .25s; z-index: 50; max-width: calc(100vw - 32px); }
.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: 16px; }
  .rail-top { padding: 10px 14px 13px; gap: var(--s3); }
  .brand span { font-size: 25px; }
  .brand svg { width: 36px; height: 36px; }
  .btn-wallet { min-height: 40px; padding: 0 14px; font-size: 15px; }
  .table-wrap { padding: var(--s3) 8px 0; }
  .table-rail { padding: 10px 10px 16px; border-radius: 20px 20px 50% 50% / 20px 20px 16% 16%; }
  #felt { height: clamp(400px, calc(100vh - 290px), 540px); height: clamp(400px, calc(100svh - 290px), 540px); border-radius: 12px 12px 50% 50% / 12px 12px 14% 14%; }
  .talk { min-height: 56px; }
  .talk .dealer-line { font-size: 18px; }
  .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: 14px; }
  .sect { padding: var(--s7) 14px 0; }
  .floor .hide-s { display: none; }
  .page { padding: var(--s6) 14px 0; }
  .strategy th, .strategy td { width: 26px; height: 24px; font-size: 11.5px; }
}
