:root {
  --bg: #08080f; --card: #0e0e19; --card2: #141424; --fg: #f2f2f8; --muted: #9d9db5;
  --pink: #ff4d9d; --cyan: #22d3ee; --gold: #ffc94d; --green: #34d399; --red: #ff4d6d;
  --line: rgba(255, 255, 255, 0.09); --felt: #0c3b2e; --felt2: #0f4a39;
  --radius: 14px;
  color-scheme: dark;
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 16px/1.65 var(--body); }
a { color: var(--cyan); }
a:hover { color: var(--pink); }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
.wrap { max-width: 980px; margin: 0 auto; padding-block: 0; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: clamp(28px, 6vw, 44px); }
h2 { font-size: clamp(21px, 4vw, 27px); margin-top: 28px; }
h3 { font-size: 18px; color: var(--cyan); margin-top: 20px; }
p { margin: 0 0 12px; }
.muted, .fine { color: var(--muted); }
.fine { font-size: 14px; }

/* header */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: rgba(8, 8, 15, 0.86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); text-decoration: none; font-family: var(--display); font-weight: 700; }
.brand small { display: block; color: var(--muted); font: 600 10px/1.2 var(--body); letter-spacing: .12em; text-transform: uppercase; }
.brand .mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: linear-gradient(135deg, var(--pink), var(--cyan)); color: #08080f; font-size: 18px; }
.top .spacer { flex: 1; }
.lang { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.lang select { background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font: inherit; max-width: 46vw; }
.lang-hint { background: var(--card2); border-bottom: 1px solid var(--line); font-size: 14px; }
.lang-hint .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 40px; }
.lang-hint-close { background: none; border: 0; color: var(--muted); font-size: 20px; cursor: pointer; }

/* hero and grid */
.hero { padding: 36px 0 12px; }
.hero p { color: var(--muted); font-size: 18px; max-width: 720px; }
.note { background: rgba(255, 201, 77, .06); border: 1px solid rgba(255, 201, 77, .28); border-radius: var(--radius); padding: 14px 16px; color: var(--muted); font-size: 15px; margin: 16px 0; }
.games { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; padding: 12px 0 32px; list-style: none; margin: 0; }
.games a { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; color: var(--fg); text-decoration: none; transition: border-color .2s, transform .2s; }
.games a:hover { border-color: rgba(255, 77, 157, .55); transform: translateY(-2px); }
.games .icon { font-size: 26px; line-height: 1; }
.games h2 { font-size: 19px; margin: 10px 0 6px; }
.games p { color: var(--muted); font-size: 14px; margin: 0 0 10px; }
.chipline { display: inline-block; font-size: 12px; font-weight: 600; color: var(--gold); background: rgba(255, 201, 77, .1); border: 1px solid rgba(255, 201, 77, .3); border-radius: 999px; padding: 2px 10px; }

/* game page */
.crumbs { padding-top: 18px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.gamehead { padding: 12px 0 4px; }
.gamehead .lede { color: var(--muted); font-size: 18px; }
.tabs { display: none; gap: 6px; border-bottom: 1px solid var(--line); margin: 14px 0 0; overflow-x: auto; scrollbar-width: none; }
.js .tabs { display: flex; }
.tabs button { flex: 0 0 auto; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); font: 600 15px var(--body); padding: 10px 12px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--pink); }
.tabs button.practice-tab { color: var(--gold); }
.panel { padding: 18px 0 8px; }
.panel ol, .panel ul { padding-inline-start: 22px; margin: 0 0 14px; }
.panel li { margin-bottom: 8px; }
.panel > h2:first-child { margin-top: 0; }
table.odds, table.paytable { border-collapse: collapse; width: 100%; margin: 10px 0 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; font-size: 15px; }
table.odds th, table.odds td, table.paytable td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line); }
table.odds th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
table.odds td.num, table.paytable td.num { text-align: end; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.paytable.small { max-width: 420px; font-size: 14px; }
table.paytable.small td { padding: 6px 10px; }
.chart-wrap { overflow-x: auto; margin: 8px 0 16px; }
table.chart { border-collapse: separate; border-spacing: 2px; font-size: 13px; font-variant-numeric: tabular-nums; }
table.chart th, table.chart td { width: 34px; height: 28px; text-align: center; border-radius: 5px; }
table.chart th { color: var(--muted); font-weight: 600; }
table.chart td.H { background: #233; color: #cfe; }
table.chart td.S { background: #3a2a10; color: #ffd98a; }
table.chart td.D, table.chart td.Ds { background: #14365a; color: #a8d8ff; }
table.chart td.P { background: #3b1838; color: #ffb3dd; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; list-style: none; padding: 0; }
.cta { display: inline-block; margin: 18px 0 6px; padding: 13px 22px; border-radius: 12px; color: #fff; font-weight: 700; text-decoration: none; background: linear-gradient(135deg, #ff4d9d, #b04dff); box-shadow: 0 6px 24px rgba(255, 77, 157, .25); }
.cta:hover { color: #fff; filter: brightness(1.08); }
.other { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 10px 0 30px; }
.other a { display: inline-block; padding: 7px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-size: 14px; }
.other a:hover { border-color: var(--cyan); }

/* practice table */
#practice-table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 6px 0 10px; }
.money-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.money { color: var(--gold); font-size: 20px; font-variant-numeric: tabular-nums; }
.net { display: block; color: var(--muted); font-size: 13px; min-height: 1.4em; }
.btn { font: 600 15px var(--body); color: var(--fg); background: var(--card2); border: 1px solid rgba(255, 255, 255, .16); border-radius: 11px; padding: 10px 16px; cursor: pointer; min-height: 44px; }
.btn:hover:not(:disabled) { border-color: var(--cyan); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.primary { background: linear-gradient(135deg, #ff4d9d, #b04dff); border-color: transparent; color: #fff; }
.btn.ghost { background: transparent; }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 14px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.chip-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.label { color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 8px; }
.chip { width: 46px; height: 46px; padding: 0; border-radius: 50%; border: 3px dashed rgba(255, 255, 255, .55); font-size: 14px; color: #08080f; }
.chip.c1 { background: #e9e9f2; } .chip.c5 { background: #ff6b8b; color: #fff; } .chip.c25 { background: #34d399; } .chip.c100 { background: #ffc94d; }
.chip[aria-pressed="true"] { outline: 3px solid var(--cyan); outline-offset: 2px; }
.stake { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0; }
.stake-amt { color: var(--fg); font-variant-numeric: tabular-nums; min-width: 3ch; }
.felt { background: radial-gradient(120% 90% at 50% 0%, var(--felt2), var(--felt)); border-radius: 12px; padding: 14px; margin: 10px 0; border: 1px solid rgba(255, 255, 255, .06); }
.who { color: rgba(255, 255, 255, .7); font-size: 13px; text-transform: uppercase; letter-spacing: .08em; margin: 4px 0 6px; }
.hand { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 66px; padding: 4px; border-radius: 10px; }
.hand.active { background: rgba(255, 255, 255, .07); }
.hand.center { justify-content: center; }
.total { font: 700 18px var(--display); margin-inline-start: 6px; color: #fff; }
.tag { font-size: 12px; color: var(--gold); border: 1px solid rgba(255, 201, 77, .4); border-radius: 999px; padding: 1px 8px; }
.card { width: 44px; height: 62px; border-radius: 7px; background: #fbfbfd; color: #111; display: inline-flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); font-family: var(--display); }
.card .r { font-size: 18px; font-weight: 700; } .card .s { font-size: 18px; }
.card.red { color: #d11a3b; }
.card.back { background: repeating-linear-gradient(45deg, #b04dff 0 6px, #7e2fd1 6px 12px); border: 3px solid #fff; }
.advice { color: var(--cyan); min-height: 1.6em; margin: 6px 0 0; }
.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; margin-top: 8px; cursor: pointer; }
.check input { width: 18px; height: 18px; }
.msg { min-height: 1.6em; margin: 10px 0 0; font-weight: 600; }
.msg.good { color: var(--green); } .msg.bad { color: var(--red); }
.spots { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin-top: 10px; }
.spot { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 6px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, .25); background: rgba(0, 0, 0, .18); color: #fff; font: 600 14px var(--body); cursor: pointer; text-align: center; }
.spot .sub { font-size: 11px; font-weight: 500; color: rgba(255, 255, 255, .7); }
.spot .amt { font-size: 12px; color: #08080f; background: var(--gold); border-radius: 999px; padding: 0 7px; min-height: 0; }
.spot .amt:empty { display: none; }
.spot.has { border-color: var(--gold); }
.spot.red { background: rgba(209, 26, 59, .55); } .spot.black { background: rgba(0, 0, 0, .55); }
.spot:disabled { opacity: .45; cursor: default; }
.totspot .name, .numspot .name { font-size: 13px; }
.dice-row { display: flex; gap: 10px; justify-content: center; min-height: 56px; }
.die { width: 52px; height: 52px; background: #fff; border-radius: 10px; display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr); padding: 7px; box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.die i { width: 9px; height: 9px; border-radius: 50%; background: #111; place-self: center; }
.die.d1 i { grid-area: 2 / 2; }
.die.d2 i:nth-child(1) { grid-area: 1 / 1; } .die.d2 i:nth-child(2) { grid-area: 3 / 3; }
.die.d3 i:nth-child(1) { grid-area: 1 / 1; } .die.d3 i:nth-child(2) { grid-area: 2 / 2; } .die.d3 i:nth-child(3) { grid-area: 3 / 3; }
.die.d4 i:nth-child(1) { grid-area: 1 / 1; } .die.d4 i:nth-child(2) { grid-area: 1 / 3; } .die.d4 i:nth-child(3) { grid-area: 3 / 1; } .die.d4 i:nth-child(4) { grid-area: 3 / 3; }
.die.d5 i:nth-child(1) { grid-area: 1 / 1; } .die.d5 i:nth-child(2) { grid-area: 1 / 3; } .die.d5 i:nth-child(3) { grid-area: 2 / 2; } .die.d5 i:nth-child(4) { grid-area: 3 / 1; } .die.d5 i:nth-child(5) { grid-area: 3 / 3; }
.die.d6 i:nth-child(1) { grid-area: 1 / 1; } .die.d6 i:nth-child(2) { grid-area: 2 / 1; } .die.d6 i:nth-child(3) { grid-area: 3 / 1; } .die.d6 i:nth-child(4) { grid-area: 1 / 3; } .die.d6 i:nth-child(5) { grid-area: 2 / 3; } .die.d6 i:nth-child(6) { grid-area: 3 / 3; }
.point { text-align: center; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
.roul { display: grid; gap: 4px; }
.roul .nums { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.roul .num { position: relative; min-height: 38px; border-radius: 7px; border: 1px solid rgba(255, 255, 255, .2); color: #fff; font: 700 15px var(--display); cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 4px; }
.roul .num.red { background: #b3172f; } .roul .num.black { background: #15151f; } .roul .num.green { background: #138a55; }
.roul .num .amt { font-size: 11px; color: #08080f; background: var(--gold); border-radius: 999px; padding: 0 5px; }
.roul .num .amt:empty { display: none; }
.roul .num.has { outline: 2px solid var(--gold); }
.ball-result { display: flex; justify-content: center; min-height: 54px; margin-bottom: 8px; }
.ballnum { width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; font: 700 20px var(--display); color: #fff; border: 3px solid #fff; }
.ballnum.red { background: #b3172f; } .ballnum.black { background: #15151f; } .ballnum.green { background: #138a55; }
.total-bet, .last { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.vp-cards { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; min-height: 100px; }
.vp-card { background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; color: #fff; }
.vp-card .card { width: 52px; height: 74px; }
.vp-card.held .card { outline: 3px solid var(--gold); outline-offset: 2px; }
.holdtag { font-size: 12px; color: rgba(255, 255, 255, .75); }
.vp-card.held .holdtag { color: var(--gold); font-weight: 700; }
.felt.slots { position: relative; }
.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.reel { display: grid; grid-template-rows: repeat(3, 44px); background: #fbfbfd; border-radius: 10px; overflow: hidden; }
.sym { display: grid; place-items: center; font: 800 26px var(--display); color: #111; }
.sym.dim { opacity: .35; font-size: 20px; }
.sym.bar { font-size: 18px; letter-spacing: .05em; } .sym.seven { color: #d11a3b; }
.payline { position: absolute; left: 10px; right: 10px; top: 50%; height: 2px; background: rgba(255, 77, 157, .8); pointer-events: none; }
.keno { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; margin: 8px 0; }
.kn { min-height: 34px; padding: 0; border-radius: 6px; border: 1px solid var(--line); background: var(--card2); color: var(--fg); font: 600 13px var(--body); cursor: pointer; }
.kn.picked { background: #3b1838; border-color: var(--pink); }
.kn.drawn { background: #123a4a; border-color: var(--cyan); }
.kn.hit { background: var(--gold); color: #08080f; border-color: var(--gold); }
.felt.crash { display: grid; place-items: center; min-height: 120px; }
.crash-num { font: 800 clamp(40px, 12vw, 64px) var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.crash-num.crashed { color: var(--red); } .crash-num.won { color: var(--green); }
.field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 15px; margin: 8px 0; }
.field input[type=number] { width: 90px; background: var(--card2); color: var(--fg); border: 1px solid var(--line); border-radius: 9px; padding: 8px; font: inherit; }
input[type=range] { width: 100%; accent-color: var(--pink); }
.dt { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; text-align: center; }
.dt .who { text-align: center; }

/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 24px; padding: 24px 0 40px; color: var(--muted); font-size: 14px; }
.foot p { margin-bottom: 8px; }
.foot h2 { font-size: 15px; color: var(--fg); margin: 18px 0 8px; }
.foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }

@media (max-width: 520px) {
  .card { width: 40px; height: 56px; }
  .card .r, .card .s { font-size: 16px; }
  .vp-card .card { width: 48px; height: 68px; }
  .keno { grid-template-columns: repeat(8, 1fr); }
  .spots { grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); }
  .brand small { display: none; }
  .games { grid-template-columns: 1fr 1fr; gap: 10px; }
  .games a { padding: 12px; }
  .games .icon { font-size: 22px; }
  .games h2 { font-size: 16px; margin: 8px 0 4px; }
  .games p { font-size: 13px; }
  .chipline { font-size: 11px; padding: 2px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
