:root {
  color-scheme: dark;
  --blue: #326bff;
  --muted: #95a4b8;
  --panel: #17212e;
  --line: #2b3848;
  color: #f6f8fd;
  background: #0b121c;
  font: 15px/1.35 Inter, "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin:0; min-height:100svh; }
button, input, a { font:inherit; color:inherit; -webkit-tap-highlight-color:transparent; }
button, a { cursor:pointer; touch-action:manipulation; }
a { text-decoration:none; }
button:disabled, input:disabled { cursor:default; opacity:.45; }
button:focus-visible, a:focus-visible, input:focus-visible { outline:2px solid #92b4ff; outline-offset:3px; }
[hidden] { display:none !important; }
button { border:0; }
#rail svg, #dock svg, .topbar svg, .crumb svg, .table-footer svg { width:19px; height:19px; display:block; }
#rail i, #dock i, .crumb i, .table-footer i { display:inline-flex; }
.topbar { height:74px; position:sticky; top:0; z-index:5; display:flex; align-items:center; justify-content:space-between; padding:0 30px 0 22px; border-bottom:1px solid var(--line); background:#121c28; }
.brand { display:flex; gap:8px; align-items:center; }
.brand-symbol { width:36px; height:36px; display:grid; place-items:center; transform:skew(-7deg); background:var(--blue); border-radius:8px; font:italic 800 28px Georgia,serif; }
.brand b { font:800 25px/1 "Bebeto Display",Impact,sans-serif; letter-spacing:.02em; }
.brand b small { margin-left:3px; color:#8293ab; font:700 10px/1 system-ui,sans-serif; }
.account-tools, .bank { display:flex; align-items:center; gap:10px; }
.bank, .head-tool { border:1px solid var(--line); background:#0d1621; border-radius:8px; }
.bank { padding:4px 13px; height:42px; gap:8px; }
.bank small { display:block; font-size:.6rem; font-weight:650; color:var(--muted); }
.bank strong { display:block; font-size:.94rem; font-variant-numeric:tabular-nums; }
.bank i, .unit-chip { width:17px; height:17px; border:2px dashed #f6d577; border-radius:50%; background:radial-gradient(circle,#f0c254 20%,#8c621e 23% 42%,#deb24e 44% 66%,#8a6328 68%); }
.head-tool, .crumb button { display:grid; place-items:center; width:39px; height:39px; color:#a3b2c7; }
.head-tool { border-radius:50%; background:#202d3d; }
@media(min-width:961px) {
  .topbar .bank { position:absolute; left:calc(50% + 115px); transform:translateX(-50%); }
  .topbar .brand { width:208px; height:100%; border-right:1px solid var(--line); }
}
#rail { position:fixed; z-index:2; top:74px; bottom:0; left:0; width:230px; overflow:auto; display:flex; flex-direction:column; align-items:stretch; gap:3px; background:var(--rail-bg,#131d29); border-right:1px solid var(--line); padding:21px 13px 12px; }
#rail a { display:flex; gap:12px; align-items:center; min-height:39px; border-radius:7px; padding:6px 13px; font-size:.91rem; font-weight:600; color:#c5cfe1; }
#rail a svg { color:#8d9db3; }
#rail a.selected, #rail a:hover { background:#20344d; color:#fff; }
#rail .selected svg { color:#76a5fc; }
#rail h2 { margin:17px 10px 4px; padding-top:14px; border-top:1px solid #283546; font:700 .68rem/1.4 system-ui; color:#8b9bb3; text-transform:uppercase; letter-spacing:.1em; }
#rail .rail-language { margin-top:auto; }
#dock { display:none; }
#blackjack-main { max-width:1650px; width:auto; margin:0 0 0 230px; padding:0 clamp(16px,2.3vw,42px) 38px; }
.crumb { height:63px; display:flex; align-items:center; justify-content:space-between; }
.crumb a { display:flex; align-items:center; gap:6px; font-size:.89rem; font-weight:650; color:#cbd6e6; min-height:42px; }
.crumb button { background:transparent; }
.cabinet { border:1px solid var(--line); border-radius:15px; background:#14202c; overflow:hidden; display:grid; grid-template-columns:minmax(245px,min(33%,335px)) minmax(0,1fr); grid-template-areas:"console felt" "foot foot"; box-shadow:0 5px 22px #050b111f; }
.felt { grid-area:felt; position:relative; isolation:isolate; overflow:hidden; margin:12px; min-width:0; min-height:410px; height:clamp(425px,54vw,600px); border-radius:10px; border:1px solid #33574c; background:repeating-linear-gradient(29deg,#afcaab03 0 1px,transparent 1px 3px),repeating-linear-gradient(119deg,#092e2208 0 1px,transparent 1px 3px),radial-gradient(ellipse at 50% 45%,#216c4a 0,#19563d 42%,#12452f 76%,#0c3527 100%); }
.deck { position:absolute; top:0; left:5%; width:clamp(34px,5.3vw,61px); aspect-ratio:.72; transform:translateY(-29%) rotate(-21deg); }
.deck i, .card.back-face { background:repeating-linear-gradient(48deg,transparent 0 3px,#ad956773 3px 4px,transparent 4px 8px),repeating-linear-gradient(-48deg,#27392d 0 3px,#bda57d64 3px 4px,#27392d 4px 8px); border:3px solid #e8e1ce; border-radius:5px; box-shadow:0 2px 4px #071a1470; }
.deck i { position:absolute; inset:0; display:grid; place-items:center; }
.deck i:nth-child(1) { transform:translate(2px,6px); }
.deck i:nth-child(2) { transform:translate(1px,3px); }
.deck b, .back-face b { display:grid; place-items:center; background:#304633; border:1px solid #b1a174; color:#ebddb2; border-radius:50%; font:italic bold 1.38rem Georgia; width:61%; aspect-ratio:1; }
.shoe { position:absolute; top:-5px; right:4.7%; width:clamp(35px,5vw,61px); height:clamp(62px,7vw,95px); transform:rotate(22deg); border-radius:5px 5px 9px 9px; border:2px solid #353c3d; border-bottom:6px solid #101615; background:linear-gradient(105deg,#515753,#1b2525 21%,#101918 70%,#35403a); box-shadow:4px 5px 6px #071b1566; }
.shoe i { position:absolute; bottom:1px; left:13%; width:74%; height:57%; background:linear-gradient(0deg,#c2beb0 0 6%,#454b43 7% 11%,#73766a 12% 16%,#141c1c 17% 90%); border:2px solid #2c3331; border-radius:3px; }
.inscription { width:75%; max-width:550px; height:auto; position:absolute; left:50%; top:49%; transform:translate(-50%,-50%); pointer-events:none; overflow:visible; }
.felt-line { fill:none; stroke:#c7ad684a; stroke-width:1.25; }
.inscription text { fill:#d5bd78; text-anchor:middle; font-weight:700; letter-spacing:2px; text-transform:uppercase; }
.arch-title { font-family:Georgia,serif; font-size:28px; }
.arch-rule { font-family:"Bebeto Display",system-ui,sans-serif; font-size:13px; }
.dealer-seat,.player-seats { position:absolute; display:flex; align-items:center; justify-content:center; left:4%; width:92%; }
.dealer-seat { top:12%; flex-direction:column; }
.player-seats { top:64%; gap:5px; }
.felt[data-phase=ready] .dealer-seat,.felt[data-phase=ready] .player-seats { visibility:hidden; }
.seat { display:flex; flex-direction:column; align-items:center; justify-content:center; min-width:0; max-width:100%; border:1px solid transparent; border-radius:7px; padding:3px; }
.split .seat { flex:1; max-width:42%; }
.split .current { border-color:#ddd38f; background:#0c36296b; }
.seat-label { display:flex; align-items:center; justify-content:center; gap:5px; min-height:19px; color:#e0eee4; font-size:.73rem; }
.seat-label output { border:1px solid #a4ae7566; color:#fff0c2; border-radius:4px; background:#0d3929; padding:0 4px; font-size:.72rem; font-weight:700; white-space:nowrap; }
.seat-label output:empty { display:none; }
.hand { --width:clamp(48px,5vw,72px); display:flex; justify-content:center; align-items:center; min-height:calc(var(--width)*1.39 + 5px); padding:2px 0; max-width:100%; }
.card { position:relative; display:grid; place-items:center; flex:0 0 var(--width); width:var(--width); height:calc(var(--width)*1.39); border:1px solid #e7e2d4; border-radius:5px; color:#202b30; background:linear-gradient(135deg,#fffef8,#f2eddf); box-shadow:0 2px 5px #071c1766; line-height:1; font-family:Georgia,serif; }
.card+.card { margin-left:calc(var(--width)*-.32); }
.hand.long,.split .hand { display:grid; width:100%; grid-template-columns:repeat(var(--steps),minmax(0,calc(var(--width)*.50))) var(--width); justify-content:center; }
.hand.long .card+.card,.split .hand .card+.card { margin-left:0; }
.hand.long .card,.split .hand .card { justify-self:start; }
.many .hand { --width:clamp(32px,4.8vw,55px); }
.many .seat-label { display:grid; gap:1px; justify-items:center; text-align:center; font-size:.65rem; }
.card.red { color:#a73738; }
.card .corner { position:absolute; left:4px; top:4px; font:700 clamp(.75rem,1.3vw,1rem)/.84 Georgia; display:grid; }
.corner small { font-size:.72em; line-height:1.05; }.corner.bottom { transform:rotate(180deg); left:auto; top:auto; right:4px; bottom:4px; }
.pip { font-size:calc(var(--width)*.53); }
.card .portrait { position:absolute; inset:17% 20%; background:url(../poker/court-atlas.webp) no-repeat; background-size:300% 100%; border:1px solid #aa85496b; }
.card.enter { animation:deal-in .23s ease-out both; }
@keyframes deal-in { from{transform:translate(14px,-19px) rotate(8deg);opacity:0} to{transform:none;opacity:1} }
.status { position:absolute; bottom:6%; left:3%; right:3%; text-align:center; font-weight:650; font-size:clamp(.78rem,1.12vw,1rem); color:#dbece1; }
.status small { color:#b3c7b8; font-size:.82em; margin-left:8px; }.status[data-tone=win] { color:#f8de87; }
.console { grid-area:console; padding:16px; border-right:1px solid #2a3744; background:#1b2634; }
.actions { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.actions button { min-height:46px; border-radius:7px; background:#344359; color:#f4f7ff; font-weight:750; font-size:.94rem; }
.actions button:only-child { grid-column:1/-1; }.actions button.primary { background:var(--blue); color:#fff; }.actions button:active:not(:disabled) { transform:translateY(1px); }
.actions button { text-transform:uppercase; letter-spacing:.025em; }
.stake-controls { margin-top:18px; }.stake-controls label { display:block; font-size:.81rem; font-weight:650; color:#c9d3e2; margin-bottom:6px; }
.stake-line { display:flex; align-items:center; gap:4px; border:1px solid #354357; background:#101924; border-radius:7px; padding:4px; min-height:43px; }
.stake-line .unit-chip { margin:0 2px 0 5px; flex:0 0 16px; width:16px; height:16px; }.stake-line input { min-width:0; flex:1; border:0; outline:0; background:transparent; padding:4px; font-weight:650; appearance:textfield; }.stake-line input::-webkit-inner-spin-button { appearance:none; }
.stake-line button { background:#29384b; border-radius:5px; min-width:37px; min-height:33px; font-size:.82rem; font-weight:700; }
.stake-controls>small { display:block; margin-top:8px; color:var(--muted); font-size:.7rem; }
.table-footer { grid-area:foot; display:grid; grid-template-columns:1fr auto 1fr; align-items:center; min-height:53px; padding:0 17px; border-top:1px solid #2c3947; background:#172330; }
.table-footer button { display:inline-flex; align-items:center; justify-self:start; gap:7px; color:#afbed0; background:none; padding:5px 2px; min-height:40px; font-size:.8rem; font-weight:600; }
.table-footer button:last-child { justify-self:end; }.table-footer h1 { margin:0; color:#c2ccd9; font:800 1rem/1 "Bebeto Display",Impact,sans-serif; letter-spacing:1.2px; text-transform:uppercase; }
dialog { width:min(430px,calc(100% - 24px)); padding:20px 23px; color:#f4f6fa; background:#1b2938; border:1px solid #4a5c70; border-radius:13px; box-shadow:0 17px 65px #0009; }
dialog::backdrop { background:#040b13b8; }.dialog-head { display:flex; justify-content:space-between; align-items:center; }.dialog-head h2 { margin:0; font-size:1.55rem; }.dialog-head button { width:38px; height:38px; border-radius:7px; font-size:1.35rem; background:#303f52; }dialog ul { padding-left:20px; color:#d4dfed; }dialog li+li { margin-top:7px; }
@media (max-width:960px) {
  #rail { display:none; }#blackjack-main { margin-left:0; padding-bottom:92px; }.topbar { padding:0 18px; }
  #dock { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); position:fixed; left:0; right:0; bottom:0; z-index:5; padding:5px 3px max(5px,env(safe-area-inset-bottom)); background:#121d2bf7; border-top:1px solid #354151; }
  #dock a { display:grid; place-items:center; align-content:center; gap:3px; min-width:0; min-height:45px; color:#a3b3ca; font-size:.63rem; font-weight:650; }
}
@media(min-width:1100px) { .cabinet{grid-template-columns:335px minmax(0,1fr);} }
@media (max-width:720px) {
  #blackjack-main { padding:0 22px 78px 12px; }.topbar { height:60px; padding:0 12px; }.brand b { font-size:22px; }.brand-symbol { width:31px; height:31px; font-size:24px; }.bank { height:36px; }.head-tool{width:35px;height:35px;}
  .crumb { height:60px; }.cabinet { display:flex; flex-direction:column; border-radius:14px; padding-top:12px; }
  .felt { flex:none; margin:0 11px; min-height:260px; height:clamp(260px,calc(100svh - 394px),396px); border-radius:9px; }
  .console { border:0; background:none; padding:12px 11px 13px; }.actions button { min-height:48px; }.stake-controls { margin-top:12px; }.table-footer { padding:0 12px; min-height:47px; }
  .inscription { width:92%; }.hand { --width:48px; }.deck { width:40px; }.shoe { width:39px; height:62px; }
}
@media(max-height:665px) and (max-width:720px) {
  .topbar { height:49px; }.crumb{height:39px;}.felt { min-height:207px; height:calc(100svh - 347px); }.hand { --width:36px; }.dealer-seat{top:4%;}.player-seats{top:57%;}.status{bottom:2%;}.stake-controls{margin-top:7px;}
}
@media(min-width:721px) and (max-height:550px) {
  .topbar{height:48px;}.crumb{height:37px;}.felt{min-height:208px;height:calc(100svh - 211px);}.dealer-seat{top:2%;}.player-seats{top:53%;}.hand{--width:35px;}.status{bottom:1%;}.inscription{width:68%;}.console{padding:10px;}.actions button{min-height:36px;}.table-footer{min-height:40px;}
}
@media(prefers-reduced-motion:reduce){.card.enter{animation:none}}
