:root {
  --cell: 96px;
  --gold: #f5c542;
  --gold-dark: #b8860b;
  --bg: #12051f;
  --panel: #1f0b35;
  --panel-2: #2b1150;
  --text: #f3eaff;
  --muted: #b9a6d6;
  --win: #4ade80;
  --err: #f87171;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #3a1466 0%, var(--bg) 60%) fixed;
  color: var(--text);
  font-family: "Segoe UI", system-ui, sans-serif;
}

.hidden { display: none !important; }

.label {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}

.muted { color: var(--muted); font-size: 0.85rem; line-height: 1.5; }

button, .ghost, .cta {
  font: inherit;
  cursor: pointer;
  border: none;
  color: inherit;
  text-decoration: none;
}

button:disabled { opacity: 0.45; cursor: not-allowed; }

.ghost {
  display: inline-block;
  padding: 8px 14px;
  border-radius: 10px;
  background: transparent;
  border: 2px solid var(--gold-dark);
  color: var(--gold);
  font-weight: 700;
}

.ghost.small { padding: 6px 12px; font-size: 0.85rem; }

.cta, .spin {
  padding: 14px 26px;
  border-radius: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  color: #2a1600;
  background: linear-gradient(180deg, #ffe27a, var(--gold) 50%, var(--gold-dark));
  box-shadow: 0 4px 0 #6b4a00;
}

.cta:active:not(:disabled), .spin:active:not(:disabled) { transform: translateY(3px); box-shadow: 0 1px 0 #6b4a00; }
.cta.small, .spin.small { padding: 10px 20px; letter-spacing: 1px; }

.foot {
  margin: 14px auto;
  max-width: 520px;
  font-size: 0.72rem;
  color: var(--muted);
  text-align: center;
  line-height: 1.4;
  padding: 0 12px;
}

/* ---------- lobby ---------- */

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 18px;
  background: rgba(0, 0, 0, 0.35);
  border-bottom: 2px solid var(--gold-dark);
}

.brand {
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(245, 197, 66, 0.6);
}

.brand span { font-size: 0.7rem; letter-spacing: 3px; margin-left: 6px; color: var(--muted); text-shadow: none; }

.user-box { display: flex; align-items: center; gap: 12px; }
.wallet { text-align: right; }
.coins { font-size: 1.15rem; font-weight: 800; color: var(--gold); display: inline-flex; align-items: center; gap: 6px; }

.coin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff3b0, var(--gold) 45%, var(--gold-dark));
  box-shadow: 0 0 6px rgba(245, 197, 66, 0.7);
}

.wrap { max-width: 920px; margin: 0 auto; padding: 22px 14px; }

.panel {
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 2px solid var(--gold-dark);
  border-radius: 16px;
  padding: 18px;
}

.auth { max-width: 440px; margin: 20px auto; text-align: center; }
.auth h1 { font-size: 1.4rem; margin: 0 0 8px; }
.auth h1 em { color: var(--gold); font-style: normal; }
.auth .cta { width: 100%; font-size: 1.1rem; margin-top: 8px; }

.tab { padding: 8px; border-radius: 8px; background: rgba(0, 0, 0, 0.3); color: var(--muted); font-weight: 700; }
.tab.on { background: var(--panel-2); color: var(--gold); border: 1px solid var(--gold-dark); }

.form { display: grid; gap: 8px; }
.form input {
  font: inherit;
  padding: 11px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(0, 0, 0, 0.35);
  color: var(--text);
}
.form input:focus { outline: 2px solid var(--gold-dark); }

.form-msg { min-height: 1.3em; margin: 10px 0 0; font-size: 0.85rem; text-align: center; }
.form-msg.err { color: var(--err); }
.form-msg.ok { color: var(--win); }

.section-title { color: var(--gold); letter-spacing: 2px; font-size: 1.1rem; margin: 0 0 12px; }

/* ---------- dashboard ---------- */

.dash .wrap { max-width: 1200px; }
.dash .user-box .label { margin-right: 4px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 14px; }
.kpi { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; }
.kpi b { font-size: 1.9rem; color: var(--gold); }
.kpi small { color: var(--muted); font-size: 0.78rem; }
.kpi.live b { color: var(--win); }

.range-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.range-tabs .tab { padding: 6px 14px; }

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); white-space: nowrap; }
table.data th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); }
table.data th:not(:first-child) { text-align: right; }
table.data td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.strong { color: var(--gold); font-weight: 800; }
table.data td.name { font-weight: 700; }
table.data tr.soon { opacity: 0.55; }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; margin-top: 14px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 200px; padding-top: 18px; }
.bar-col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; min-width: 0; }
.bar { width: 100%; min-height: 2px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, var(--gold), var(--gold-dark)); }
.bar-val { font-size: 0.65rem; color: var(--text); margin-bottom: 2px; }
.bar-label { font-size: 0.62rem; color: var(--muted); margin-top: 4px; }
.note { margin-top: 14px; }

@media (max-width: 520px) {
  .charts { grid-template-columns: 1fr; }
}

/* ---------- slot ---------- */

.slot-page { display: flex; justify-content: center; align-items: flex-start; padding: 24px 12px; }

.machine {
  width: 100%;
  max-width: 480px;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 3px solid var(--gold-dark);
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 0 40px rgba(245, 197, 66, 0.25), inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.head-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; }

.head-bar h1 {
  margin: 0;
  font-size: 1.5rem;
  letter-spacing: 3px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(245, 197, 66, 0.6);
}

.value { font-size: 1.3rem; font-weight: 700; }

.balance-bar { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }

.stat, .bet-box { background: rgba(0, 0, 0, 0.35); border-radius: 10px; padding: 8px 12px; }

#lastWin.won { color: var(--win); }

.reels-wrap {
  position: relative;
  background: #0b0214;
  border: 3px solid var(--gold);
  border-radius: 14px;
  padding: 8px;
}

.reels { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }

.reel {
  height: calc(var(--cell) * 3);
  overflow: hidden;
  background: linear-gradient(180deg, #ddd 0%, #fff 30%, #fff 70%, #ddd 100%);
  border-radius: 8px;
  position: relative;
}

.reel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0,0,0,0.25) 0%, transparent 25%, transparent 75%, rgba(0,0,0,0.25) 100%);
}

.strip { will-change: transform; }

.cell {
  height: var(--cell);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: calc(var(--cell) * 0.6);
  user-select: none;
  transition: background 0.2s;
}

.cell.hit { background: rgba(74, 222, 128, 0.35); animation: pop 0.45s ease-in-out 3; }

@keyframes pop { 50% { transform: scale(1.12); } }

.lines { position: absolute; inset: 8px; width: calc(100% - 16px); height: calc(100% - 16px); pointer-events: none; }
.lines polyline { fill: none; stroke: var(--win); stroke-width: 4; stroke-linecap: round; opacity: 0; vector-effect: non-scaling-stroke; }
.lines polyline.on { opacity: 0.9; filter: drop-shadow(0 0 4px var(--win)); }

.message { text-align: center; min-height: 1.6em; margin: 12px 0; font-weight: 600; color: var(--muted); }
.message.win { color: var(--win); font-size: 1.15rem; }
.message.err { color: var(--err); }

.controls { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; }
.bet { display: flex; align-items: center; gap: 6px; }
.bet-box { flex: 1; text-align: center; }

.round {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 2px solid var(--gold-dark);
  font-size: 1.3rem;
  font-weight: 700;
}

.auto.on { background: var(--gold); color: #2a1600; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-top: 14px; text-align: center; font-size: 0.9rem; font-weight: 600; }
.stats > div { background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 6px 4px; }

.history { margin-top: 12px; }
.history ol { list-style: none; padding: 0; margin: 6px 0 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.history li { font-size: 0.78rem; padding: 3px 2px; border-radius: 6px; background: rgba(0, 0, 0, 0.35); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history li.w { color: var(--win); }

/* ---------- table games ---------- */

.machine.wide { max-width: 780px; }

.felt {
  position: relative;
  background: radial-gradient(ellipse at center, #1f7a4a 0%, #0f4d2e 70%, #0a3520 100%);
  border: 3px solid var(--gold);
  border-radius: 18px;
  padding: 14px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.55);
}

.felt .label { color: #cfe9d9; }

.spot {
  position: relative;
  padding: 8px 4px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 46px;
  transition: background 0.15s, box-shadow 0.15s, opacity 0.2s;
}

.spot:hover { background: rgba(255, 255, 255, 0.12); }
.spot b { font-size: 0.95rem; letter-spacing: 1px; }
.spot small { font-size: 0.66rem; color: #ffe9a8; }
.spot.win { box-shadow: 0 0 0 2px var(--win), 0 0 16px var(--win); background: rgba(74, 222, 128, 0.25); }
.spot.lose { opacity: 0.5; }
.locked .spot { cursor: default; }

.stake {
  position: absolute;
  top: -7px;
  right: -5px;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 10px;
  background: var(--gold);
  color: #2a1600;
  font-size: 0.66rem;
  font-weight: 800;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  z-index: 2;
}

.chips { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 4px 0 12px; }

.chip {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-weight: 800;
  font-size: 0.75rem;
  color: #fff;
  border: 4px dashed rgba(255, 255, 255, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45);
  transition: transform 0.15s;
}

.chip[data-v="100"] { background: #2563eb; }
.chip[data-v="500"] { background: #16a34a; }
.chip[data-v="1000"] { background: #dc2626; }
.chip[data-v="5000"] { background: #9333ea; }
.chip[data-v="10000"] { background: #111; border-color: var(--gold); color: var(--gold); }
.chip.on { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--gold), 0 6px 10px rgba(0, 0, 0, 0.5); }

.bet-actions { display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center; }
.bet-actions .bet-box { text-align: center; }

.info-table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.85rem; }
.info-table th, .info-table td { padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); text-align: left; }
.info-table th { font-size: 0.72rem; color: var(--muted); font-weight: 600; }
.info-table td.mult { color: var(--gold); font-weight: 700; white-space: nowrap; }

/* cards */

.cards { display: flex; gap: 5px; justify-content: center; min-height: 78px; flex-wrap: wrap; }

.card {
  position: relative;
  width: 54px;
  height: 78px;
  border-radius: 7px;
  background: linear-gradient(180deg, #fff, #f1f1f1);
  color: #111;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  user-select: none;
  flex: none;
}

.card .c-corner { position: absolute; top: 4px; left: 5px; font-size: 0.85rem; font-weight: 800; line-height: 1; }
.card .c-mid { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 1.9rem; padding-top: 10px; }
.card.red { color: #d01d2a; }
.card.back { background: repeating-linear-gradient(45deg, #6d1b8f 0 6px, #2b1150 6px 12px); border: 2px solid var(--gold-dark); }
.card.sm { width: 40px; height: 58px; }
.card.sm .c-corner { font-size: 0.7rem; }
.card.sm .c-mid { font-size: 1.35rem; }
.card.deal { animation: deal 0.35s ease-out both; }
.card.flip { animation: flip 0.4s ease-out both; }
.card.dim { opacity: 0.45; }

@keyframes deal { from { transform: translateY(-50px) scale(0.6); opacity: 0; } }
@keyframes flip { from { transform: rotateY(90deg); } }

.result-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
}

.result-tag.win { background: var(--win); color: #062b14; }
.result-tag.lose { background: #7f1d1d; }
.result-tag.tie { background: #a16207; }

/* dadu */

.dice-bowl { text-align: center; margin-bottom: 12px; }
.dice { display: flex; justify-content: center; gap: 14px; min-height: 64px; }
.dice.shake .die { animation: shake 0.18s linear infinite; }

@keyframes shake {
  25% { transform: translate(-3px, 2px) rotate(-8deg); }
  75% { transform: translate(3px, -2px) rotate(8deg); }
}

.die {
  width: 60px;
  height: 60px;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(145deg, #fff, #dcdcdc);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5), inset 0 -3px 0 rgba(0, 0, 0, 0.12);
  display: grid;
  grid-template: repeat(3, 1fr) / repeat(3, 1fr);
}

.die span.on { margin: auto; width: 70%; height: 70%; border-radius: 50%; background: #b91c1c; }
.die.sm { width: 22px; height: 22px; padding: 3px; border-radius: 5px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.5); }
.die.sm span.on { background: #111; }
.die-group { display: inline-flex; gap: 2px; }
.dice-sum { margin-top: 8px; font-weight: 800; color: var(--gold); letter-spacing: 1px; min-height: 1.2em; }

.dadu-board { display: grid; gap: 6px; }
.dadu-board .row { display: grid; gap: 6px; }
.dadu-board .main-bets { grid-template-columns: repeat(5, 1fr); }
.dadu-board .main-bets .spot { min-height: 58px; }
.dadu-board .totals { grid-template-columns: repeat(7, 1fr); }
.dadu-board .faces { grid-template-columns: repeat(6, 1fr); }
.dadu-board .spot { min-width: 0; }

/* seats shared by card games */

.seat { text-align: center; }
.seat-name, .pname { display: block; font-weight: 800; letter-spacing: 1px; color: #fff; font-size: 0.8rem; margin-bottom: 4px; }
.seat.bandar .seat-name { color: var(--gold); font-size: 0.95rem; }
.hand-label { margin-top: 6px; font-weight: 700; color: #fff; font-size: 0.85rem; min-height: 1.6em; }
.winner { box-shadow: 0 0 0 2px var(--win), 0 0 18px rgba(74, 222, 128, 0.6); }
.acting { box-shadow: 0 0 0 2px var(--gold), 0 0 14px rgba(245, 197, 66, 0.6); }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
}

.badge.fold { background: #7f1d1d; }
.badge.raise, .badge.bet, .badge.allin { background: #b45309; }
.badge.call, .badge.check { background: #1e40af; }
.badge.pass { background: #7f1d1d; }

/* sakong */

.sakong-felt { display: grid; gap: 14px; }
.seats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seat.bot, .seat.me { border-radius: 12px; padding: 8px 4px; background: rgba(0, 0, 0, 0.2); }
.seat.me { background: rgba(245, 197, 66, 0.12); border: 1px solid var(--gold-dark); }
.seats .card { width: 40px; height: 58px; }
.seats .card .c-corner { font-size: 0.7rem; }
.seats .card .c-mid { font-size: 1.35rem; }
.seats .cards { min-height: 58px; gap: 3px; }
.controls.single { grid-template-columns: 1fr; }

/* poker */

.poker-felt {
  display: grid;
  grid-template-areas: ". top ." "left center right" ". bottom .";
  grid-template-columns: 1fr 1.6fr 1fr;
  gap: 8px;
  align-items: center;
  border-radius: 140px / 110px;
  padding: 16px 12px;
}

.pseat { text-align: center; border-radius: 12px; padding: 6px 4px; background: rgba(0, 0, 0, 0.25); min-width: 0; }
.pseat.top { grid-area: top; }
.pseat.left { grid-area: left; }
.pseat.right { grid-area: right; }
.pseat.bottom { grid-area: bottom; background: rgba(245, 197, 66, 0.12); border: 1px solid var(--gold-dark); }
.pseat.folded { opacity: 0.55; }
.pseat .cards { min-height: 58px; gap: 3px; }
.pstack { font-size: 0.8rem; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.pmeta { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; margin-top: 4px; min-height: 1.4em; }
.pbet { font-size: 0.7rem; font-weight: 800; padding: 2px 7px; border-radius: 8px; background: var(--gold); color: #2a1600; }
.phand { font-size: 0.7rem; font-weight: 700; color: #fff; }

.dealer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  border-radius: 50%;
  background: #fff;
  color: #111;
  font-size: 0.65rem;
  font-weight: 900;
  vertical-align: middle;
}

.pcenter { grid-area: center; text-align: center; }
.board { gap: 4px; }
.card-slot { width: 54px; height: 78px; border-radius: 7px; border: 2px dashed rgba(255, 255, 255, 0.25); flex: none; }
.pot { margin-top: 8px; }
.pot b { color: var(--gold); font-size: 1.1rem; }

.poker-actions { display: grid; gap: 8px; }
.raise-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: center; }
.raise-row input[type="range"] { flex: 1; min-width: 140px; accent-color: var(--gold); }
.raise-value { min-width: 70px; text-align: right; font-weight: 800; color: var(--gold); }
.move-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.move-row .hidden + * { grid-column: auto; }

/* gaple */

.gaple-felt {
  display: grid;
  grid-template-areas: ". top ." "left center right" "bottom bottom bottom";
  grid-template-columns: 0.8fr 2.4fr 0.8fr;
  gap: 10px;
  align-items: center;
}

.gseat { text-align: center; border-radius: 12px; padding: 6px 4px; background: rgba(0, 0, 0, 0.25); min-width: 0; }
.gseat.top { grid-area: top; }
.gseat.left { grid-area: left; }
.gseat.right { grid-area: right; }
.gseat.bottom { grid-area: bottom; background: rgba(245, 197, 66, 0.12); border: 1px solid var(--gold-dark); }
.gcenter { grid-area: center; text-align: center; min-width: 0; }
.chain { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; min-height: 34px; padding: 6px; border-radius: 10px; background: rgba(0, 0, 0, 0.18); }
.ends { margin-top: 6px; font-size: 0.75rem; color: #cfe9d9; }
.bot-tiles { display: flex; flex-wrap: wrap; gap: 2px; justify-content: center; }
.hand-tiles { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; padding: 4px; }

.tile {
  display: inline-flex;
  flex: none;
  background: #fafaf5;
  border-radius: 5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  padding: 2px;
  gap: 2px;
}

.tile .half { display: grid; grid-template: repeat(3, 1fr) / repeat(3, 1fr); width: 22px; height: 22px; padding: 1px; }
.tile .half + .half { border-left: 1px solid #999; }
.tile .half i.on { margin: auto; width: 70%; height: 70%; border-radius: 50%; background: #111; }
.tile.double .half i.on { background: #b91c1c; }
.tile.v { flex-direction: column; }
.tile.v .half + .half { border-left: none; border-top: 1px solid #999; }
.tile.back { width: 12px; height: 22px; padding: 0; background: repeating-linear-gradient(45deg, #6d1b8f 0 4px, #2b1150 4px 8px); border: 1px solid var(--gold-dark); }
.hand-tiles .tile .half { width: 30px; height: 30px; }
.hand-tiles .tile.back { width: 34px; height: 66px; }
.hand-tiles .tile.playable { cursor: pointer; box-shadow: 0 0 0 2px var(--gold), 0 0 12px rgba(245, 197, 66, 0.7); transform: translateY(-4px); }
.hand-tiles .tile.dim { opacity: 0.5; }
.gseat .bot-tiles .tile.v .half { width: 14px; height: 14px; }

.side-picker { display: flex; gap: 8px; justify-content: center; align-items: center; margin-bottom: 10px; color: var(--gold); font-weight: 700; }

/* roulette */

.roulette-felt { display: grid; gap: 12px; justify-items: center; }
.wheel-wrap { position: relative; width: 270px; height: 270px; }
.wheel {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 6px solid var(--gold-dark);
  box-shadow: 0 0 0 3px var(--gold), 0 6px 18px rgba(0, 0, 0, 0.6);
}

.wnum {
  position: absolute;
  left: calc(50% - 10px);
  top: calc(50% - 8px);
  width: 20px;
  text-align: center;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
}

.hub { position: absolute; inset: 32%; border-radius: 50%; background: radial-gradient(circle, #ffe27a, var(--gold-dark)); box-shadow: 0 0 10px rgba(0, 0, 0, 0.6); }
.wheel-pointer {
  position: absolute;
  top: -6px;
  left: calc(50% - 10px);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 20px solid #fff;
  z-index: 3;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

.result-ball {
  position: absolute;
  left: calc(50% - 26px);
  top: calc(50% - 26px);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 900;
  color: #2a1600;
  z-index: 2;
}

.result-ball.red { background: #b91c1c; color: #fff; }
.result-ball.black { background: #111; color: #fff; }
.result-ball.green { background: #15803d; color: #fff; }

.roulette-board { width: 100%; overflow-x: auto; }
.rgrid { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 3px; }
.rgrid .spot { min-height: 36px; padding: 4px 0; }
.rgrid .spot.num.red { background: rgba(185, 28, 28, 0.85); }
.rgrid .spot.num.black { background: rgba(17, 17, 17, 0.85); }
.rgrid .spot.num.green, .rgrid .spot.green { background: rgba(21, 128, 61, 0.9); }
.rgrid .spot.outside.red { background: rgba(185, 28, 28, 0.85); }
.rgrid .spot.outside.black { background: rgba(17, 17, 17, 0.85); }
.rgrid .spot b { font-size: 0.78rem; }

.recent, .beads { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; min-height: 26px; }
.rchip, .bead {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
  color: #fff;
}

.rchip.red { background: #b91c1c; }
.rchip.black { background: #111; border: 1px solid #555; }
.rchip.green { background: #15803d; }

/* baccarat */

.baccarat-felt { display: grid; gap: 14px; }
.bac-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bac-hand { text-align: center; padding: 10px 6px; border-radius: 12px; background: rgba(0, 0, 0, 0.22); }
.bac-hand.player .seat-name { color: #93c5fd; }
.bac-hand.banker .seat-name { color: #fca5a5; }
.bac-total { margin-top: 6px; font-size: 1.6rem; font-weight: 900; color: var(--gold); min-height: 1.3em; }
.bac-board { display: grid; grid-template-columns: 1fr 1.4fr 1fr 1.4fr 1fr; gap: 6px; }
.bac-board .spot { min-height: 64px; }
.bac-board .spot.player { background: rgba(37, 99, 235, 0.45); }
.bac-board .spot.banker { background: rgba(185, 28, 28, 0.45); }
.bac-board .spot.tie { background: rgba(21, 128, 61, 0.55); }
.bead.player { background: #2563eb; }
.bead.banker { background: #b91c1c; }
.bead.tie { background: #15803d; }

@media (max-width: 640px) {
  .machine { padding: 12px; }
  .felt { padding: 8px; }
  .spot { padding: 6px 2px; min-height: 40px; }
  .spot b { font-size: 0.78rem; letter-spacing: 0; }
  .spot small { font-size: 0.56rem; }
  .dadu-board .faces { grid-template-columns: repeat(3, 1fr); }
  .die { width: 50px; height: 50px; padding: 6px; }
  .chip { width: 42px; height: 42px; font-size: 0.68rem; }
  .bet-actions { grid-template-columns: repeat(3, 1fr); }
  .bet-actions .bet-box { grid-column: 1 / -1; }
  .card { width: 44px; height: 64px; }
  .card .c-mid { font-size: 1.5rem; }
  .card-slot { width: 34px; height: 50px; }
  .board .card { width: 34px; height: 50px; }
  .board .card .c-mid { font-size: 1.1rem; }
  .board .card .c-corner { font-size: 0.6rem; }
  .board { flex-wrap: nowrap; gap: 3px; }
  .poker-felt { grid-template-columns: 0.75fr 2fr 0.75fr; padding: 10px 6px; border-radius: 48px; }
  .pseat .card.sm, .seats .card { width: 32px; height: 46px; }
  .pseat .card.sm .c-mid, .seats .card .c-mid { font-size: 1rem; }
  .pseat .card.sm .c-corner, .seats .card .c-corner { font-size: 0.6rem; }
  .move-row { grid-template-columns: repeat(2, 1fr); }
  .gaple-felt { grid-template-columns: 0.7fr 2fr 0.7fr; gap: 6px; }
  .hand-tiles .tile .half { width: 24px; height: 24px; }
  .tile .half { width: 16px; height: 16px; }
  .bac-board .spot { min-height: 54px; }
  .rgrid { gap: 2px; }
  .rgrid .spot { min-height: 32px; }
  .rgrid .spot b { font-size: 0.62rem; }
}

/* ---------- modal ---------- */

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.modal-card {
  background: var(--panel);
  border: 2px solid var(--gold-dark);
  border-radius: 16px;
  padding: 20px;
  max-width: 420px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  text-align: center;
}

.modal-card h2 { margin-top: 0; color: var(--gold); }

#paytable { width: 100%; border-collapse: collapse; margin: 10px 0; }
#paytable th, #paytable td { padding: 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
#paytable th { font-size: 0.75rem; color: var(--muted); font-weight: 600; }
#paytable td.sym { font-size: 1.4rem; letter-spacing: 2px; }
#paytable td.mult { color: var(--gold); font-weight: 700; }

.rtp-box { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin: 10px 0; }
.rtp-box > div { background: rgba(0, 0, 0, 0.3); border-radius: 8px; padding: 8px 4px; }

@media (max-width: 420px) {
  :root { --cell: 72px; }
  .head-bar h1 { font-size: 1.15rem; }
  .controls { grid-template-columns: 1fr 1fr; }
  .bet { grid-column: 1 / -1; }
  .brand { font-size: 1.25rem; }
}
