/* freeblackjack.fun: phone first. Navy room, blue felt, cyan accent. Animations use transform and opacity only. */
:root {
  --bg: #070b16; --bg2: #0e1424; --line: rgba(205, 225, 245, .12); --text: #e9f0f8; --dim: #95a3b8;
  --cyan: #00d4ff; --violet: #a78bfa; --win: #34d399; --lose: #ff5a6a; --push: #c9d4e2;
  --felt1: #1b3f78; --felt2: #0d2148; --felt3: #071330;
  --cw: clamp(62px, 19vw, 96px); --hdr: 52px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--cyan); }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; z-index: 99; background: #fff; color: #000; padding: 8px; }

/* header */
.hdr { position: sticky; top: 0; z-index: 30; background: var(--bg); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.hdr .wrap { display: flex; align-items: center; gap: 12px; height: var(--hdr); }
.logo { display: flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font: 800 18px/1 Inter, sans-serif; letter-spacing: -.02em; }
.logo i { font-style: normal; color: var(--cyan); }
.mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; color: #04121c; font: 700 17px/1 Georgia, serif;
  background: radial-gradient(circle at 50% 50%, #e8fbff 0 34%, var(--cyan) 35% 64%, #0a7fa6 65%); box-shadow: 0 0 0 2px rgba(0, 212, 255, .25); }
.nav { display: flex; gap: 2px; margin-left: auto; list-style: none; padding: 0; margin-block: 0; }
.nav a { display: block; padding: 8px 10px; border-radius: 999px; color: var(--dim); text-decoration: none; font: 600 14px/1 Inter, sans-serif; }
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav .hide-s { display: none; }

/* the game: fills the phone screen under the header */
.play { padding-top: 10px; }
.layout { display: grid; gap: 16px; }
.fb-game { position: relative; display: grid; grid-template-rows: auto 1fr auto; height: calc(100svh - var(--hdr) - 20px - env(safe-area-inset-top, 0px));
  min-height: 520px; max-height: 820px; border-radius: 22px; overflow: hidden; border: 1px solid var(--line);
  background: radial-gradient(120% 80% at 50% 35%, var(--felt1), var(--felt2) 60%, var(--felt3)); contain: layout paint; }
.fb-hud { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 14px 8px; background: linear-gradient(rgba(4, 9, 22, .55), rgba(4, 9, 22, 0)); }
.fb-money { display: flex; gap: 18px; align-items: baseline; }
.fb-money small { display: block; font: 700 10px/1 Inter, sans-serif; letter-spacing: .12em; color: var(--dim); margin-bottom: 4px; }
.fb-money b { font: 800 24px/1 Inter, sans-serif; color: var(--cyan); font-variant-numeric: tabular-nums; }
.fb-money .bet b { color: #fff; font-size: 18px; }
.fb-modes { display: flex; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 999px; padding: 3px; align-self: start; }
.fb-modes button { border: 0; background: none; padding: 8px 10px; white-space: nowrap; border-radius: 999px; font: 800 11px/1 Inter, sans-serif; letter-spacing: .06em; color: var(--dim); cursor: pointer; }
.fb-modes button.on { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #04121c; }
.fb-left { grid-column: 1 / -1; font-size: 12px; color: var(--dim); }
.fb-shoebar { position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--cyan), var(--violet)); transform-origin: left; transition: transform .4s; opacity: .8; }

.fb-felt { position: relative; display: grid; grid-template-rows: 1fr auto 1fr; align-items: center; justify-items: center; padding: 4px 10px; min-height: 0; }
.fb-mid { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.fb-print { text-align: center; pointer-events: none; opacity: .5; }
.fb-print b { display: block; font: 700 clamp(13px, 3.6vw, 20px)/1.2 Georgia, serif; letter-spacing: .14em; color: var(--cyan); }
.fb-print span { font: italic clamp(10px, 2.6vw, 13px)/1.4 Georgia, serif; color: #cfe0f2; letter-spacing: .06em; }
.fb-shoe { position: absolute; right: 12px; top: 6px; width: calc(var(--cw) * .62); aspect-ratio: 5 / 7; border-radius: 6px; transform: rotate(8deg);
  background: repeating-linear-gradient(45deg, #b8202f 0 5px, #9b1825 5px 10px); border: 3px solid #f4f6fa; box-shadow: 0 6px 14px rgba(0, 0, 0, .35); opacity: .9; }
.fb-shoe.shuf { animation: shuf .3s ease-in-out 3; }
@keyframes shuf { 50% { transform: rotate(8deg) translateY(-6px) scale(1.06); } }
.fb-zone { display: flex; flex-direction: column; align-items: center; gap: 6px; min-height: calc(var(--cw) * 1.4 + 26px); justify-content: center; width: 100%; }
.fb-dzone { align-self: start; padding-top: 6px; }
.fb-pzone { align-self: end; padding-bottom: 6px; }
.fb-total { min-width: 30px; padding: 3px 9px; border-radius: 999px; background: rgba(0, 0, 0, .45); font: 800 13px/1.2 Inter, sans-serif; text-align: center; }
.fb-row { display: flex; justify-content: center; }
.fb-row > .fb-card + .fb-card { margin-left: calc(var(--cw) * -.42); }
#fb-dealer { display: flex; justify-content: center; }
#fb-dealer > .fb-card + .fb-card { margin-left: calc(var(--cw) * -.42); }
.fb-hands { display: flex; justify-content: center; gap: 14px; width: 100%; }
.fb-hands.multi { --cw: clamp(42px, 11vw, 74px); gap: 8px; }
.fb-hands[data-n="4"] { --cw: clamp(36px, 9vw, 64px); }
.fb-hand { position: relative; display: flex; flex-direction: column-reverse; align-items: center; gap: 6px; padding: 6px; border-radius: 14px; border: 2px solid transparent; }
.fb-hand.on { border-color: rgba(0, 212, 255, .7); background: rgba(0, 212, 255, .06); }
.fb-tag { display: flex; gap: 6px; align-items: center; font: 800 13px/1 Inter, sans-serif; }
.fb-tag .t:empty, .fb-tag .b:empty { display: none; }
.fb-tag .t { padding: 4px 9px; border-radius: 999px; background: rgba(0, 0, 0, .45); }
.fb-tag .b { color: var(--cyan); }
.fb-res { position: absolute; left: 50%; top: 0; transform: translate(-50%, -40%); z-index: 2; white-space: nowrap; padding: 5px 10px; border-radius: 999px; font: 900 12px/1 Inter, sans-serif; letter-spacing: .06em; box-shadow: 0 4px 14px rgba(0, 0, 0, .4); }
.fb-res.win, .fb-res.bj { background: var(--win); color: #03140d; }
.fb-res.lose { background: var(--lose); color: #fff; }
.fb-res.push { background: var(--push); color: #0a0e1a; }

/* cards */
.fb-card { position: relative; flex: none; width: var(--cw); aspect-ratio: 5 / 7; border-radius: calc(var(--cw) * .09); background: #fdfdfb; color: #141821;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35); will-change: transform; }
.fb-card.red { color: #d0202f; }
.fb-card .i { position: absolute; left: 7%; top: 5%; display: flex; flex-direction: column; align-items: center; line-height: .95; }
.fb-card .i b { font: 800 calc(var(--cw) * .3)/1 Inter, sans-serif; letter-spacing: -.04em; }
.fb-card .i i { font-style: normal; font-size: calc(var(--cw) * .24); }
.fb-card .m { position: absolute; right: 9%; bottom: 6%; font-size: calc(var(--cw) * .5); line-height: 1; }
.fb-card.down { background: repeating-linear-gradient(45deg, #b8202f 0 5px, #9b1825 5px 10px); border: 3px solid #fdfdfb; }
.fb-card.down > * { display: none; }

/* messages */
.fb-msg { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; max-width: 86%; text-align: center; padding: 8px 14px; border-radius: 12px;
  background: rgba(4, 9, 22, .82); font: 700 14px/1.3 Inter, sans-serif; pointer-events: none; }
.fb-netpop { position: absolute; right: 14px; bottom: 8px; z-index: 3; font: 900 22px/1 Inter, sans-serif; animation: pop .35s ease-out; pointer-events: none; }
.fb-netpop.win { color: var(--win); } .fb-netpop.lose { color: var(--lose); } .fb-netpop.push { color: var(--push); font-size: 16px; }
@keyframes pop { from { transform: translateY(8px); opacity: 0; } }

/* controls: the thumb zone */
.fb-ctl { padding: 10px 12px calc(12px + env(safe-area-inset-bottom, 0px)); background: linear-gradient(rgba(4, 9, 22, 0), rgba(4, 9, 22, .6)); }
.fb-chips, .fb-acts, .fb-ins { display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.fb-chip { --c: var(--cyan); width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; font: 900 13px/1 Inter, sans-serif; color: #04121c;
  background: radial-gradient(circle, #fff 0 44%, transparent 45%), repeating-conic-gradient(var(--c) 0 30deg, #fff 30deg 45deg); box-shadow: 0 3px 8px rgba(0, 0, 0, .4), inset 0 0 0 3px rgba(0, 0, 0, .15); }
.fb-chip[data-v="500"] { --c: var(--violet); } .fb-chip[data-v="1000"] { --c: #10172a; } .fb-chip[data-v="5000"] { --c: #f0b429; }
.fb-chip:active { transform: scale(.94); }
.fb-chip:disabled { opacity: .35; cursor: default; }
.fb-btn { min-height: 52px; min-width: 76px; padding: 0 16px; border-radius: 14px; border: 1px solid rgba(205, 225, 245, .22); background: rgba(10, 18, 36, .85); color: #fff;
  font: 800 15px/1 Inter, sans-serif; letter-spacing: .04em; cursor: pointer; touch-action: manipulation; }
.fb-btn.go { background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #04121c; border: 0; }
.fb-btn:disabled { opacity: .4; cursor: default; }
.fb-btn:active:not(:disabled) { transform: scale(.97); }
.fb-acts .fb-btn { flex: 1 1 0; max-width: 140px; }
.fb-chips .fb-btn.go { flex: 1 1 100%; max-width: 360px; margin-top: 4px; }
.fb-clear { border: 0; background: none; color: var(--dim); font: 700 13px Inter, sans-serif; text-decoration: underline; cursor: pointer; padding: 8px; }

/* end of shoe */
.fb-over { position: absolute; inset: 0; z-index: 10; display: grid; place-items: center; background: rgba(4, 8, 18, .96); padding: 20px; }
.fb-over .box { width: min(100%, 360px); text-align: center; display: grid; gap: 10px; }
.fb-over .t { font: 400 13px/1.6 "Press Start 2P", monospace; color: var(--cyan); }
.fb-over .s { font: 700 11px/1 Inter, sans-serif; letter-spacing: .14em; color: var(--dim); }
.fb-over .v { font: 900 46px/1 Inter, sans-serif; }
.fb-init { display: grid; gap: 8px; }
.fb-init label { font: 700 12px/1.4 Inter, sans-serif; color: var(--cyan); letter-spacing: .06em; }
.fb-init .r { display: grid; grid-template-columns: 90px 1fr; gap: 8px; }
.fb-init input, .fb-init select { min-height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #0b1222; color: #fff; padding: 0 12px; font: 700 16px Inter, sans-serif; min-width: 0; }
.fb-init input { text-transform: uppercase; letter-spacing: .3em; text-align: center; font-family: "Press Start 2P", monospace; font-size: 14px; }
.fb-over-r { font-weight: 700; }
.fb-over .row2 { display: flex; gap: 8px; justify-content: center; }
.fb-over .row2 .fb-btn { flex: 1; }
.fb-ts { position: absolute; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 12; }

/* under the table */
.fb-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding-block: 12px 0; }
.pill { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg2); color: var(--text);
  font: 700 14px Inter, sans-serif; text-decoration: none; cursor: pointer; }
.pill svg { width: 18px; height: 18px; color: var(--cyan); }

.boards { background: var(--bg2); border: 1px solid var(--line); border-radius: 20px; padding: 16px; min-width: 0; align-self: start; }
.boards h2 { margin: 0 0 10px; font: 400 13px/1.6 "Press Start 2P", monospace; color: var(--cyan); }
.tabs { display: flex; gap: 4px; margin-bottom: 10px; }
.tabs button { flex: 1; border: 1px solid var(--line); background: none; border-radius: 10px; padding: 8px 4px; font: 700 12px/1 Inter, sans-serif; color: var(--dim); cursor: pointer; }
.tabs button[aria-selected="true"] { background: rgba(0, 212, 255, .12); border-color: rgba(0, 212, 255, .5); color: #fff; }
.board { list-style: none; margin: 0; padding: 0; font: 400 12px/1 "Press Start 2P", monospace; }
.board li { display: grid; grid-template-columns: 26px 28px 1fr auto; align-items: center; gap: 4px; padding: 8px 2px; border-bottom: 1px solid rgba(205, 225, 245, .06); }
.board li.wait { display: block; font: 500 13px/1.5 Inter, sans-serif; color: var(--dim); border: 0; padding: 10px 2px; }
.board .n { color: var(--dim); }
.board .ini { color: #7fdcff; }
.board .sc { font-variant-numeric: tabular-nums; }
.fl { font: 18px/1 system-ui, "Apple Color Emoji", "Segoe UI Emoji", sans-serif; }
.fl.code { font: 700 10px/1 Inter, sans-serif; padding: 3px 4px; border-radius: 4px; background: rgba(255, 255, 255, .1); letter-spacing: .04em; justify-self: start; }

.band { padding-block: 44px; border-top: 1px solid var(--line); margin-top: 32px; }
.band h2, .intro h1 { font: 900 clamp(26px, 6vw, 38px)/1.1 Fraunces, Georgia, serif; letter-spacing: -.01em; margin: 0 0 8px; text-wrap: balance; }
.intro { padding-block: 26px 0; }
.intro h1 em { font-style: normal; color: var(--cyan); }
.lead { color: var(--dim); max-width: 62ch; margin: 0 0 18px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; font: 700 11px/1 Inter, sans-serif; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.tags b { color: var(--cyan); }
.qa { display: grid; gap: 12px; }
.qa details { background: var(--bg2); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; }
.qa summary { cursor: pointer; font-weight: 800; }
.qa p { color: var(--dim); margin: 8px 0 0; }
.embed { display: grid; gap: 16px; }
.code { margin: 0; overflow-x: auto; background: #050810; border: 1px solid var(--line); border-radius: 14px; padding: 14px; font: 12.5px/1.6 ui-monospace, Menlo, monospace; color: #bfe9ff; }
.foot { padding-block: 28px calc(28px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); margin-top: 40px; color: var(--dim); font-size: 13px; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot a { color: var(--text); }
.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; background: #fff; color: #0a0e1a; padding: 10px 16px; border-radius: 12px; font: 700 14px Inter, sans-serif; box-shadow: 0 8px 30px rgba(0, 0, 0, .4); }

/* page text */
.doc { max-width: 720px; padding-block: 28px; }
.doc h1 { font: 900 clamp(28px, 6vw, 40px)/1.1 Fraunces, Georgia, serif; margin: 0 0 12px; }
.doc h2 { font: 800 20px/1.3 Inter, sans-serif; margin: 28px 0 8px; }
.doc p, .doc li { color: #c6d2e1; }

@media (min-width: 640px) {
  .nav .hide-s { display: block; }
  .fb-chip { width: 58px; height: 58px; }
}
@media (min-width: 980px) {
  :root { --cw: 92px; }
  .layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .fb-game { height: min(760px, calc(100vh - var(--hdr) - 40px)); }
  .boards { position: sticky; top: calc(var(--hdr) + 12px); }
  .embed { grid-template-columns: 1fr 1fr; align-items: center; }
}
@media (prefers-reduced-motion: reduce) { .fb-shoe.shuf, .fb-netpop { animation: none; } }

/* embedded on another site: the table only */
.is-embed body, body.embed { background: transparent; }
body.embed .fb-game { height: 100vh; max-height: none; min-height: 440px; border-radius: 0; border: 0; }
.embed-link { grid-column: 1 / -1; font: 800 12px Inter, sans-serif; color: var(--cyan); text-decoration: none; }

/* bet circle on the felt */
.fb-spot { position: relative; z-index: 2; width: 74px; height: 74px; border-radius: 50%; border: 2px dashed rgba(214, 236, 255, .45); background: rgba(0, 0, 0, .12);
  display: grid; place-items: center; cursor: pointer; padding: 0; }
.fb-spot.has { border-style: solid; border-color: rgba(0, 212, 255, .7); }
.fb-spot .stack { position: relative; width: 40px; height: 40px; }
.fb-spot .stack i { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 2px 3px rgba(0, 0, 0, .45);
  background: radial-gradient(circle, #fff 0 40%, transparent 41%), repeating-conic-gradient(var(--c) 0 30deg, #fff 30deg 45deg); }
.fb-spot .c100 { --c: var(--cyan); } .fb-spot .c500 { --c: var(--violet); } .fb-spot .c1000 { --c: #10172a; } .fb-spot .c5000 { --c: #f0b429; }
.fb-spot .amt { position: absolute; bottom: -24px; left: 50%; transform: translateX(-50%); font: 800 13px/1 Inter, sans-serif; white-space: nowrap; color: #fff; }
.fb-spot:not(.has) .amt { bottom: auto; top: 50%; transform: translate(-50%, -50%); color: rgba(214, 236, 255, .6); letter-spacing: .14em; font-size: 12px; }
.fb-game.live .fb-spot { width: 56px; height: 56px; }
.fb-game.live .fb-print { display: none; }
.fb-game.live .fb-spot .stack { width: 30px; height: 30px; }
/* today's #1, shown on the empty table */
.fb-beat { padding: 8px 14px; border-radius: 14px; background: rgba(4, 9, 22, .5); border: 1px solid rgba(0, 212, 255, .3); text-align: center; font: 700 13px/1.4 Inter, sans-serif; }
.fb-beat small { display: block; font: 400 9px/1.8 "Press Start 2P", monospace; color: var(--cyan); }
.fb-game.live .fb-beat { display: none; }
