:root {
  --text: #f6ecd6; --muted: #bfae8c; --gold: #e9c46a; --gold-hi: #fff1c1;
  --goldgrad: linear-gradient(135deg, #7a5310 0%, #e9c46a 22%, #fff3c9 38%, #c99a32 55%, #f7df95 72%, #8a6114 100%);
  --onyx: linear-gradient(160deg, rgba(34, 28, 38, .94), rgba(9, 8, 12, .97));
  --felt: linear-gradient(160deg, #164736, #0a2219 75%);
  --wine: linear-gradient(160deg, #7a1730, #2a0710 75%);
  --rose: #f0a3ad;
  --serif: "Cinzel", "Cormorant Garamond", Georgia, "Noto Serif", serif;
  --sans: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none;
  background: #07060a; color: var(--text); font-family: var(--sans);
  user-select: none; -webkit-user-select: none;
}
body { position: fixed; inset: 0; background: radial-gradient(120% 80% at 50% 0%, #2a1f2e, #07060a 70%); }
button { font-family: inherit; cursor: pointer; color: var(--text); }
.hidden { display: none !important; }
[hidden] { display: none !important; }

#bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
#bgv { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .9s; background: center / cover no-repeat; }
#bgv.on { opacity: 1; }
/* dark veil: light in the lobby, heavier at the tables so cards and chips stay readable */
#bgShade { position: absolute; inset: 0; transition: background-color .6s; background: radial-gradient(90% 60% at 50% 45%, rgba(7,6,10,.25), rgba(7,6,10,.6)), linear-gradient(180deg, rgba(7,6,10,.7), rgba(7,6,10,.3) 30%, rgba(7,6,10,.45) 70%, rgba(7,6,10,.88)); }
body:not([data-view="lobby"]) #bgShade { background-color: rgba(7,6,10,.3); }

#app {
  position: relative; z-index: 1; height: 100%;
  display: flex; flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 8px) 12px calc(env(safe-area-inset-bottom) + 10px);
  max-width: 560px; margin: 0 auto;
}

/* ---------- top bar ---------- */
#top { flex: none; display: flex; align-items: center; gap: 10px; height: 48px; }
.topbtn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1.5px solid transparent; background: var(--onyx) padding-box, var(--goldgrad) border-box; display: grid; place-items: center; color: var(--gold-hi); box-shadow: 0 4px 12px rgba(0,0,0,.5); }
.topbtn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.topbtn:active { transform: scale(.94); }
.topbtn.away { display: none; }
#title { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: 700 19px/1.2 var(--serif); letter-spacing: .08em; text-transform: uppercase; background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
body[data-view="lobby"] #title { font: 600 11px/1.3 var(--sans); letter-spacing: .24em; background: none; color: var(--muted); -webkit-text-fill-color: var(--muted); }
#bank {
  flex: none; display: flex; align-items: center; gap: 8px;
  padding: 6px 15px 6px 8px; border-radius: 99px; border: 1.5px solid transparent;
  background: linear-gradient(170deg, #1d1822, #0b090e) padding-box, var(--goldgrad) border-box;
  box-shadow: 0 6px 16px rgba(0,0,0,.55), inset 0 0 14px rgba(233,196,106,.08);
  font: 700 19px/1 var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--gold-hi);
  transition: transform .2s;
}
#bank.up { animation: bankUp .5s; } #bank.down { animation: bankDown .35s; }
@keyframes bankUp { 40% { transform: scale(1.1); box-shadow: 0 0 0 1px var(--gold-hi), 0 0 26px rgba(233,196,106,.75); } }
@keyframes bankDown { 40% { transform: scale(.95); } }
.coin {
  display: inline-block; width: 24px; height: 24px; border-radius: 50%; flex: none;
  background: url(media/chip-3.webp) center / contain no-repeat;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}

/* ---------- views ---------- */
.view { display: none; flex: 1; min-height: 0; flex-direction: column; overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; scrollbar-width: none; }
.view::-webkit-scrollbar { display: none; }
.view.show { display: flex; animation: viewIn .45s ease-out; }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }
.label { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }

/* ---------- lobby ---------- */
.titleArt { position: relative; flex: none; width: 100%; aspect-ratio: 16 / 7.4; border-radius: 18px; margin-top: 4px; background: #15121b url(media/title.webp) center 38% / cover no-repeat; box-shadow: 0 14px 40px rgba(0,0,0,.6); overflow: hidden; }
.titleArt::before, .game::before { content: ""; position: absolute; inset: 0; border-radius: inherit; padding: 1.5px; background: var(--goldgrad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); pointer-events: none; }
.titleArt::after, .game::after, .action.gold::after, .panel button.wide.gold::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background: linear-gradient(105deg, transparent 40%, rgba(255,245,215,.2) 50%, transparent 60%) no-repeat; background-size: 250% 100%; animation: sheen 7s ease-in-out infinite; }
@keyframes sheen { 0%, 60% { background-position: 150% 0; } 100% { background-position: -60% 0; } }
h1 { flex: none; margin: 14px 0 0; text-align: center; font: 700 36px/1.05 var(--serif); letter-spacing: .1em; text-transform: uppercase; background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 2px 0 rgba(0,0,0,.6)) drop-shadow(0 0 18px rgba(233,196,106,.25)); }
.tag { flex: none; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--muted); margin: 8px 0 14px; font-size: 11px; letter-spacing: .32em; text-transform: uppercase; }
.tag::before, .tag::after { content: ""; width: 34px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold)); }
.tag::after { transform: scaleX(-1); }
.runbox { flex: none; display: flex; justify-content: space-between; gap: 8px; padding: 10px 16px; border-radius: 14px; border: 1px solid rgba(233,196,106,.35); background: rgba(12,10,16,.72); }
.runbox div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.runbox div:nth-child(2) { align-items: center; } .runbox div:nth-child(3) { align-items: flex-end; }
.runbox .label { font-size: 11px; letter-spacing: .14em; white-space: nowrap; }
.runbox b { font: 700 15px var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--gold-hi); white-space: nowrap; }
.games { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0; }
.game {
  position: relative; border: 0; border-radius: 16px; padding: 10px 8px 12px;
  background: var(--onyx); box-shadow: 0 10px 24px rgba(0,0,0,.5);
  display: flex; flex-direction: column; align-items: center; gap: 2px; overflow: hidden;
  transition: transform .12s;
}
.game[data-go="slots"] { background: var(--wine); }
.game[data-go="bj"] { background: var(--felt); }
.game[data-go="roulette"] { background: linear-gradient(160deg, #3a2a12, #120c05 75%); }
.game:nth-child(2)::after { animation-delay: 1.2s; } .game:nth-child(3)::after { animation-delay: 2.4s; } .game:nth-child(4)::after { animation-delay: 3.6s; }
.game:active { transform: scale(.97); }
.game img { width: 50%; max-width: 104px; aspect-ratio: 1; object-fit: contain; filter: drop-shadow(0 6px 10px rgba(0,0,0,.6)); animation: bob 3.4s ease-in-out infinite; }
.game:nth-child(2) img { animation-delay: .5s; } .game:nth-child(3) img { animation-delay: 1s; } .game:nth-child(4) img { animation-delay: 1.5s; }
@keyframes bob { 50% { transform: translateY(-3px); } }
.game b { font: 700 16px var(--serif); letter-spacing: .06em; background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.game small { font-size: 11.5px; color: var(--muted); letter-spacing: .03em; }
.lobbybtns { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
button.mid { min-height: 48px; border-radius: 14px; padding: 10px 6px; border: 1px solid rgba(233,196,106,.35); background: rgba(12,10,16,.72); font: 600 13px var(--serif); letter-spacing: .06em; color: var(--gold-hi); }
button.mid:active { transform: scale(.97); }
button.mid small { display: block; font: 500 11px var(--sans); letter-spacing: .04em; color: var(--muted); margin-top: 3px; }
button.mid img.mi { width: 22px; height: 22px; object-fit: contain; vertical-align: -6px; margin-right: 6px; }
.toggles { flex: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 16px; margin: 12px 0 2px; font-size: 13px; color: var(--muted); letter-spacing: .03em; }
.toggles label { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; }
.toggles input { width: 18px; height: 18px; margin: 0; accent-color: #c99a32; }
.fine { flex: none; text-align: center; font-size: 11.5px; color: var(--muted); margin: 8px 0 4px; line-height: 1.6; letter-spacing: .03em; }
.fine b { display: inline-block; margin-bottom: 6px; padding: 5px 14px; border-radius: 14px; border: 1px solid rgba(233,196,106,.45); color: var(--gold-hi); font-weight: 600; }
.fine a { color: var(--gold); font-weight: 700; text-decoration: none; }

/* ---------- shared controls ---------- */
.round { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1.5px solid transparent; padding: 0; font: 700 24px/1 var(--sans); color: var(--gold-hi); background: radial-gradient(circle at 40% 30%, #2c2433, #0a080d) padding-box, var(--goldgrad) border-box; box-shadow: 0 5px 12px rgba(0,0,0,.55), inset 0 0 10px rgba(233,196,106,.12); }
.round.small { font-size: 22px; }
.round:active, .pill:active, .action:active { transform: scale(.95); }
.betbox { display: flex; align-items: center; gap: 6px; }
.betbox div { display: flex; flex-direction: column; align-items: center; min-width: 54px; }
.betbox b { font: 700 18px var(--serif); color: var(--gold-hi); font-variant-numeric: lining-nums tabular-nums; }
.pill { min-height: 44px; border-radius: 99px; padding: 6px 14px; border: 1px solid rgba(233,196,106,.45); background: rgba(12,10,16,.78); font: 700 11.5px var(--serif); letter-spacing: .1em; color: var(--gold-hi); }
.pill.on { border-color: transparent; background: var(--goldgrad); color: #2a1a05; box-shadow: 0 0 16px rgba(233,196,106,.55); }
.action {
  position: relative; overflow: hidden; flex: 1; min-height: 48px; border-radius: 13px; padding: 12px 6px;
  border: 1.5px solid transparent; background: var(--onyx) padding-box, var(--goldgrad) border-box;
  font: 700 15px var(--serif); letter-spacing: .1em; color: var(--gold-hi);
  box-shadow: 0 6px 16px rgba(0,0,0,.5); transition: opacity .2s, transform .1s;
}
.action.gold { border: 0; background: var(--goldgrad); color: #2a1a05; box-shadow: 0 6px 18px rgba(233,196,106,.28); }
.action:disabled { opacity: .35; }
.msg { flex: none; text-align: center; min-height: 30px; font: 700 17px/1.3 var(--serif); letter-spacing: .05em; color: var(--gold-hi); margin: 6px 0; text-shadow: 0 2px 10px rgba(0,0,0,.8); }
.msg.win { color: var(--gold); text-shadow: 0 2px 10px rgba(0,0,0,.8), 0 0 18px rgba(233,196,106,.5); animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.msg.lose { color: var(--rose); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.ctrl { flex: none; margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 8px; }
.ctrl .row, .rctrl .row { display: flex; gap: 8px; align-items: center; }
.chiprow { display: flex; justify-content: center; gap: 8px; }
.chipbtn { position: relative; width: 52px; height: 52px; border: 0; padding: 0; border-radius: 50%; background: center / contain no-repeat; filter: drop-shadow(0 4px 6px rgba(0,0,0,.6)); transition: transform .15s; }
.chipbtn span { position: absolute; inset: 0; display: grid; place-items: center; font: 800 13px var(--sans); color: #1c1024; text-shadow: 0 0 3px rgba(255,255,255,.8); }
.chipbtn.dark span { color: #fff; text-shadow: 0 0 3px #000, 0 1px 2px #000; }
.chipbtn.sel { transform: translateY(-6px) scale(1.08); filter: drop-shadow(0 0 10px rgba(255,241,193,.95)); }
.chipbtn:disabled { opacity: .35; }

/* ---------- slots ---------- */
#slots { justify-content: center; }
.machine {
  flex: none; margin: 4px auto 0; width: 100%; max-width: 420px;
  border-radius: 24px; padding: 12px 12px 14px; border: 2px solid transparent;
  background: linear-gradient(170deg, #241d29, #0b090e 60%, #17131b) padding-box, var(--goldgrad) border-box;
  box-shadow: inset 0 1px 0 rgba(255,241,193,.12), 0 18px 40px rgba(0,0,0,.7), 0 0 40px rgba(233,196,106,.14);
}
.marquee {
  position: relative; text-align: center; padding: 9px 0 10px; margin-bottom: 10px; border-radius: 14px;
  border: 1.5px solid transparent; background: linear-gradient(180deg, #7a1730, #2a0710) padding-box, var(--goldgrad) border-box;
  font: 700 22px var(--serif); letter-spacing: .16em;
}
.marquee span { background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 8px rgba(233,196,106,.55)); }
.marquee::before {
  content: ''; position: absolute; inset: 3px; border-radius: 10px; pointer-events: none;
  background: radial-gradient(circle, #fff1c1 0 1.6px, transparent 2.6px) 0 0 / 16px 16px;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% 5px no-repeat, linear-gradient(#000 0 0) bottom / 100% 5px no-repeat;
  mask: linear-gradient(#000 0 0) top / 100% 5px no-repeat, linear-gradient(#000 0 0) bottom / 100% 5px no-repeat;
  animation: bulbs .6s steps(2) infinite;
}
.machine.win .marquee::before { animation-duration: .15s; }
@keyframes bulbs { 50% { background-position: 8px 0; } }
.window { position: relative; border-radius: 14px; overflow: hidden; border: 2px solid transparent; background: linear-gradient(#15121b, #15121b) padding-box, var(--goldgrad) border-box; box-shadow: 0 0 0 1px rgba(0,0,0,.6), inset 0 8px 18px rgba(0,0,0,.35); }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; background: linear-gradient(180deg, #8a6114, #e9c46a 50%, #8a6114); }
.reel { position: relative; overflow: hidden; background: linear-gradient(180deg, #cfc3a6, #fbf5e6 18%, #fffdf6 50%, #fbf5e6 82%, #cfc3a6); }
.strip { position: absolute; left: 0; right: 0; top: 0; will-change: transform; }
.strip img { display: block; width: 100%; aspect-ratio: 1; padding: 10%; object-fit: contain; }
.strip.blur { filter: blur(1.6px); }
.reel img.hit { animation: symHit .5s ease-in-out 3; }
@keyframes symHit { 50% { transform: scale(1.18); filter: drop-shadow(0 0 10px rgba(201,154,50,.95)); } }
.glass { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(7,6,10,.4), transparent 18%, transparent 82%, rgba(7,6,10,.4)), linear-gradient(105deg, transparent 40%, rgba(255,255,255,.16) 48%, transparent 56%); }
.paylines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.paylines polyline { fill: none; stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 5px rgba(7,6,10,.7)); animation: lineFlash .5s ease-in-out infinite alternate; }
@keyframes lineFlash { from { opacity: .55; } to { opacity: 1; } }
.winline { margin-top: 10px; padding: 9px 8px; border-radius: 12px; text-align: center; border: 1px solid rgba(233,196,106,.35); background: #07060a; color: var(--gold-hi); font: 700 15px/1.3 var(--serif); letter-spacing: .08em; box-shadow: inset 0 2px 8px rgba(0,0,0,.8); text-shadow: 0 0 10px rgba(233,196,106,.55); min-height: 40px; }
.slotctrl { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 6px; margin: 16px auto 4px; width: 100%; max-width: 420px; }
.spin {
  width: 98px; height: 98px; flex: none; border-radius: 50%; border: 3px solid transparent;
  background: radial-gradient(circle at 40% 28%, #c93a58, #7a1730 55%, #2a0710) padding-box, var(--goldgrad) border-box;
  box-shadow: inset 0 2px 0 rgba(255,241,193,.35), inset 0 -8px 14px rgba(0,0,0,.4), 0 0 0 3px #0b090e, 0 0 0 4.5px rgba(233,196,106,.55), 0 10px 28px rgba(0,0,0,.7), 0 0 26px rgba(233,196,106,.18);
  font: 700 20px var(--serif); letter-spacing: .12em; color: var(--gold-hi); text-shadow: 0 2px 0 rgba(0,0,0,.5);
  transition: transform .1s, filter .2s;
}
.spin:active { transform: scale(.94); }
.spin:disabled { filter: grayscale(.6) brightness(.6); }
.spin.small { width: 84px; height: 84px; font-size: 17px; }
.slotctrl .side { display: flex; flex-direction: column; gap: 8px; }

/* ---------- cards & tables ---------- */
.paytable { flex: none; width: 100%; border-collapse: separate; border-spacing: 0; margin: 4px 0; border-radius: 14px; overflow: hidden; border: 1.5px solid transparent; background: linear-gradient(170deg, rgba(18,58,44,.95), rgba(7,24,18,.97)) padding-box, var(--goldgrad) border-box; font: 600 12.5px var(--sans); letter-spacing: .03em; }
.paytable td { padding: 3.5px 12px; color: var(--text); }
.paytable tr:first-child td { padding-top: 7px; } .paytable tr:last-child td { padding-bottom: 7px; }
.paytable td + td { text-align: right; font: 700 13px var(--serif); color: var(--gold-hi); font-variant-numeric: lining-nums tabular-nums; }
.paytable tr.hit td { background: var(--gold); color: #2a1a05; animation: pop .4s; }
.hand { flex: none; display: flex; justify-content: center; gap: 6px; margin: 16px 0 4px; }
.card { position: relative; width: 18%; max-width: 86px; aspect-ratio: 5 / 7; transition: transform .25s; }
.card img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 7%; box-shadow: 0 5px 12px rgba(0,0,0,.6); }
.card img.back { display: none; }
.card.down img:first-child { display: none; }
.card.down img.back { display: block; }
.card.flip { animation: flipX .3s ease-in-out; }
@keyframes flipX { 50% { transform: scaleX(0); } }
.card.held { transform: translateY(-10px); }
.card.held::after { content: 'HELD'; position: absolute; left: 50%; bottom: -24px; transform: translateX(-50%); font: 700 12px var(--serif); letter-spacing: .14em; color: var(--gold); text-shadow: 0 0 8px rgba(233,196,106,.7), 0 1px 3px #000; }
.card.deal { animation: dealIn .38s cubic-bezier(.2,.8,.3,1) both; }
@keyframes dealIn { from { transform: translate(140px, -260px) rotate(25deg) scale(.7); opacity: 0; } }
.card.glow img:first-child { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(233,196,106,.9); }
.hand .card { cursor: pointer; }

#bj .seat { flex: none; display: flex; flex-direction: column; align-items: center; min-height: 120px; }
.table-rules { flex: none; text-align: center; white-space: nowrap; font: 600 11px var(--sans); letter-spacing: .08em; text-transform: uppercase; color: rgba(233,196,106,.85); margin: 2px 0 6px; padding-bottom: 6px; background: linear-gradient(90deg, transparent, rgba(233,196,106,.5), transparent) bottom / 70% 1px no-repeat; }
.cards { display: flex; justify-content: center; }
.cards .card { width: 70px; max-width: none; margin: 0 -14px; }
.total { min-height: 24px; font: 700 14px/18px var(--serif); font-variant-numeric: lining-nums; color: var(--gold-hi); padding: 2px 12px; border-radius: 99px; border: 1px solid rgba(233,196,106,.5); background: rgba(7,6,10,.78); margin-bottom: 6px; }
.total:empty { visibility: hidden; }
.player { gap: 10px; flex-direction: row !important; justify-content: center; flex-wrap: wrap; }
.phand { display: flex; flex-direction: column; align-items: center; padding: 6px 10px 4px; border-radius: 16px; border: 1px solid transparent; transition: background .2s, border-color .2s; }
.phand.active { background: rgba(233,196,106,.1); border-color: rgba(233,196,106,.65); }
.phand .res { font: 700 13px var(--serif); letter-spacing: .04em; margin-top: 4px; min-height: 17px; color: var(--text); text-shadow: 0 1px 4px #000; }
.phand .res.w { color: var(--gold); } .phand .res.l { color: var(--rose); }
.betchips { flex: none; display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 40px; font: 700 17px var(--serif); font-variant-numeric: lining-nums; color: var(--gold-hi); }
.betchips img { width: 34px; margin-left: -18px; filter: drop-shadow(0 2px 3px rgba(0,0,0,.6)); animation: chipDrop .3s cubic-bezier(.3,1.6,.5,1) both; }
.betchips img:first-child { margin-left: 0; }
.betchips .hint { font: 500 13px var(--sans); color: var(--muted); letter-spacing: .03em; }
@keyframes chipDrop { from { transform: translateY(-40px); opacity: 0; } }
#bjPlayCtrl .action { font-size: 13px; letter-spacing: .06em; padding: 12px 2px; }
#bjBetCtrl .row .pill { min-height: 48px; padding: 6px 18px; }

/* ---------- roulette ---------- */
.rtop { flex: none; display: flex; align-items: center; gap: 10px; margin-top: 2px; }
#wheel { width: 54%; max-width: 230px; aspect-ratio: 1; filter: drop-shadow(0 10px 18px rgba(0,0,0,.7)); }
.rside { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.lastnum { width: 62px; height: 62px; border-radius: 50%; display: grid; place-items: center; font: 700 27px var(--serif); font-variant-numeric: lining-nums; color: var(--gold-hi); --c: #1a161f; border: 2.5px solid transparent; background: linear-gradient(var(--c), var(--c)) padding-box, var(--goldgrad) border-box; box-shadow: 0 5px 14px rgba(0,0,0,.6); }
.hist.red { background: #8e1a30; } .hist.black { background: #0e0c11; } .hist.green { background: #0f6a45; }
.lastnum.red { --c: #8e1a30; } .lastnum.black { --c: #0e0c11; } .lastnum.green { --c: #0f6a45; }
.lastnum.pop { animation: pop .5s cubic-bezier(.3,1.6,.5,1); }
.history { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; max-width: 140px; min-height: 24px; }
.hist { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--sans); color: var(--text); box-shadow: inset 0 0 0 1px rgba(233,196,106,.45); }
.rtable {
  flex: none; display: grid; margin: 8px auto 0; width: 100%; max-width: 380px;
  grid-template-columns: 1fr 1.6fr 1.6fr 1.6fr 1.3fr; grid-auto-rows: 27px; gap: 2px;
  padding: 6px; border-radius: 14px; border: 1.5px solid transparent;
  background: linear-gradient(170deg, #154636, #0b2a20) padding-box, var(--goldgrad) border-box; box-shadow: 0 10px 24px rgba(0,0,0,.55);
}
.rc { position: relative; border: 0; border-radius: 5px; padding: 0; font: 700 13px var(--serif); font-variant-numeric: lining-nums; color: var(--text); box-shadow: inset 0 0 0 1px rgba(233,196,106,.4); background: transparent; }
.rc.red { background: #8e1a30; } .rc.black { background: #0e0c11; } .rc.green { background: #0f6a45; }
.rc.out { background: rgba(7,6,10,.28); font-size: 11px; letter-spacing: .04em; color: var(--gold-hi); }
.rc.out.red { background: #8e1a30; font-size: 16px; } .rc.out.black { background: #0e0c11; font-size: 16px; }
.rc.win { animation: cellWin .45s ease-in-out 4 alternate; }
@keyframes cellWin { to { box-shadow: inset 0 0 0 3px #fff1c1, 0 0 16px #e9c46a; } }
.rc .stack { position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; transform: translate(-50%, -50%); background: center / contain no-repeat; z-index: 2; animation: chipDrop .25s cubic-bezier(.3,1.6,.5,1); filter: drop-shadow(0 2px 3px rgba(0,0,0,.7)); }
.rc .stack i { position: absolute; left: 50%; top: 100%; transform: translate(-50%, -7px); font: 800 11px/13px var(--sans); font-style: normal; background: rgba(7,6,10,.88); color: var(--gold-hi); padding: 0 4px; border-radius: 4px; white-space: nowrap; }
.rctrl { flex: none; display: flex; flex-direction: column; gap: 8px; margin-top: auto; padding-top: 8px; }
.rctrl .row { gap: 6px; }
.rctrl .pill { padding: 6px 11px; }
.onTable { margin-left: auto; text-align: right; font-size: 12px; color: var(--muted); letter-spacing: .03em; white-space: nowrap; }
.onTable b { font: 700 14px var(--serif); color: var(--gold-hi); font-variant-numeric: lining-nums; }

/* ---------- effects & overlays ---------- */
#fx { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 20; pointer-events: none; }
#banner { position: fixed; inset: 0; z-index: 25; display: none; align-items: center; justify-content: center; background: rgba(4,3,6,.66); }
#banner.show { display: flex; animation: fadeIn .3s; }
@keyframes fadeIn { from { opacity: 0; } }
.bannerInner {
  position: relative; width: 92%; max-width: 440px; aspect-ratio: 16 / 9; border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 2px solid transparent;
  background: linear-gradient(rgba(7,6,10,.35), rgba(7,6,10,.35)) padding-box, url(media/jackpot.webp) center / cover no-repeat padding-box, var(--goldgrad) border-box;
  box-shadow: 0 0 60px rgba(233,196,106,.5), 0 20px 60px rgba(0,0,0,.7);
  animation: bannerIn .6s cubic-bezier(.2,1.6,.4,1);
}
@keyframes bannerIn { from { transform: scale(.2) rotate(-8deg); } }
.bannerTitle { font: 800 42px/1 var(--serif); letter-spacing: .08em; background: linear-gradient(180deg, #fff, #fff1c1 40%, #e9c46a 70%, #c99a32); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #3a2608) drop-shadow(0 0 16px rgba(7,6,10,.9)); animation: pulse 0.8s ease-in-out infinite alternate; white-space: nowrap; }
@keyframes pulse { to { transform: scale(1.06); } }
.bannerAmt { margin-top: 10px; font: 700 38px var(--serif); color: #fff; text-shadow: 0 3px 0 #3a2608, 0 0 18px rgba(7,6,10,.95); font-variant-numeric: lining-nums tabular-nums; }
.bannerTap { margin-top: 10px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--gold-hi); text-shadow: 0 1px 4px #000; }

.overlay { position: fixed; inset: 0; z-index: 30; display: flex; align-items: center; justify-content: center; padding: calc(env(safe-area-inset-top) + 12px) 14px calc(env(safe-area-inset-bottom) + 12px); background: rgba(4,3,6,.72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); opacity: 0; pointer-events: none; transition: opacity .25s; }
.overlay.show { opacity: 1; pointer-events: auto; }
.panel { width: 100%; max-width: 400px; max-height: 100%; overflow-y: auto; padding: 22px 18px; border-radius: 22px; border: 1.5px solid transparent; background: linear-gradient(170deg, #1d1822, #0b090e) padding-box, var(--goldgrad) border-box; box-shadow: 0 24px 70px rgba(0,0,0,.75); text-align: center; overscroll-behavior: contain; scrollbar-width: none; }
.panel::-webkit-scrollbar { display: none; }
.panel h2 { margin: 4px 0; font: 700 24px var(--serif); letter-spacing: .08em; background: var(--goldgrad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.panel .art { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; margin: 0 0 12px; background: center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(233,196,106,.45); }
.panel .big { margin: 6px 0; font: 700 42px var(--serif); color: var(--gold-hi); font-variant-numeric: lining-nums tabular-nums; text-shadow: 0 0 22px rgba(233,196,106,.35); }
.panel p { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 6px 0; }
.panel p b { color: var(--gold-hi); }
.panel p.note { font-size: 11.5px; letter-spacing: .03em; }
.panel button.wide { position: relative; overflow: hidden; display: block; width: 100%; min-height: 48px; margin: 9px 0; padding: 13px; border-radius: 13px; border: 1px solid rgba(233,196,106,.4); background: rgba(255,240,200,.04); font: 700 14px var(--serif); letter-spacing: .08em; text-transform: uppercase; color: var(--gold-hi); }
.panel button.wide.gold { border: 0; background: var(--goldgrad); color: #2a1a05; box-shadow: 0 6px 18px rgba(233,196,106,.25); }
.head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; position: sticky; top: -22px; padding: 6px 0; background: #1a1620; box-shadow: 0 -22px 0 #1a1620; z-index: 1; }
.head h2 { flex: 1; }
.back { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid rgba(233,196,106,.45); background: none; color: var(--gold-hi); font-size: 26px; line-height: 1; padding: 0 0 4px; }
.headpad { width: 44px; font: 700 13px var(--serif); font-variant-numeric: lining-nums; color: var(--gold); }
table.list { width: 100%; border-collapse: collapse; font-size: 13.5px; text-align: left; }
table.list td { padding: 8px 4px; border-bottom: 1px solid rgba(233,196,106,.12); color: var(--muted); }
table.list td + td { text-align: right; font: 700 14px var(--serif); font-variant-numeric: lining-nums tabular-nums; color: var(--gold-hi); }
table.list img { width: 30px; vertical-align: middle; margin-right: 2px; }
.achlist { list-style: none; padding: 0; margin: 6px 0; text-align: left; }
.achlist li { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 12px; margin: 6px 0; border: 1px solid rgba(233,196,106,.14); opacity: .55; }
.achlist li.got { opacity: 1; border-color: rgba(233,196,106,.45); background: rgba(233,196,106,.06); }
.achlist img.ic { width: 30px; height: 30px; flex: none; object-fit: contain; filter: grayscale(1) brightness(.7); }
.achlist li.got img.ic { filter: drop-shadow(0 2px 5px rgba(0,0,0,.6)); }
.achlist b { display: block; font: 700 14px var(--serif); letter-spacing: .04em; color: var(--gold-hi); }
.achlist small { font-size: 12px; color: var(--muted); }
#toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 62px); transform: translate(-50%, calc(-100% - 90px)); opacity: 0; width: max-content; max-width: 90vw; padding: 10px 18px; border-radius: 14px; border: 1.5px solid transparent; background: linear-gradient(#17131b, #0b090e) padding-box, var(--goldgrad) border-box; color: var(--gold-hi); font: 700 13px var(--serif); letter-spacing: .05em; text-align: center; box-shadow: 0 12px 34px rgba(0,0,0,.6); transition: transform .35s cubic-bezier(.3,1.3,.5,1), opacity .2s; z-index: 40; pointer-events: none; }
#toast.show { transform: translate(-50%, 0); opacity: 1; }

#poker .hand { margin: 30px 0 10px; }
#poker .card { max-width: 100px; width: 19%; }
