/* Night-club lobby: ink-violet velvet, brass accents, left rail + stage */
:root {
  color-scheme: dark;
  --bg: #100c17;
  --bg-2: #15101e;
  --surface: #1c1628;
  --surface-2: #251d34;
  --surface-3: #2e2541;
  --line: #352b4a;
  --text: #f2edf9;
  --muted: #a094b8;
  --faint: #6f6587;
  --brass: #ebba4b;
  --brass-hi: #ffd479;
  --brass-lo: #b8862a;
  --brass-ink: #241804;
  --win: #43d98d;
  --win-bg: rgba(67, 217, 141, .12);
  --loss: #ff5d70;
  --loss-bg: rgba(255, 93, 112, .12);
  --rl-red: #d23a4a;
  --rl-black: #221b2e;
  --rl-green: #1f9d63;
  --felt: #173a2c;
  --felt-hi: #1f4a38;
  --card: #fbf8f2;
  --card-ink: #1b1622;
  --f-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --f-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --radius: 14px;
  --rail: 236px;
  --top: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 var(--f-body);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: rgba(16, 12, 23, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.logo {
  display: flex;
  align-items: baseline;
  gap: 8px;
  text-decoration: none;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 22px;
  letter-spacing: .02em;
  color: var(--brass);
}
.logo small {
  font-family: var(--f-body);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  color: var(--muted);
  text-transform: uppercase;
}
.topbar .spacer { flex: 1; }
.wallet {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}
.wallet .bal {
  padding: 8px 14px;
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: color .3s;
}
.wallet .bal.up { color: var(--win); }
.wallet .bal.down { color: var(--loss); }
.btn {
  border: 0;
  border-radius: 10px;
  padding: 10px 16px;
  font-weight: 800;
  font-size: 14px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform .08s, filter .15s, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-brass { background: linear-gradient(180deg, var(--brass-hi), var(--brass) 55%, var(--brass-lo)); color: var(--brass-ink); }
.btn-brass:hover:not(:disabled) { filter: brightness(1.07); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-win { background: var(--win); color: #062314; }
.btn-win:hover:not(:disabled) { filter: brightness(1.08); }
.wallet .btn { border-radius: 0; padding: 10px 14px; }
.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 14px;
  color: var(--brass);
  display: grid;
  place-items: center;
}
.menu {
  position: absolute;
  right: 16px;
  top: calc(var(--top) - 4px);
  min-width: 210px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .5);
  z-index: 60;
}
.menu .who { padding: 8px 12px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu .who b { display: block; }
.menu .who span { color: var(--muted); font-size: 12px; }
.menu a, .menu button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 9px 12px;
  border-radius: 8px;
  background: none;
  border: 0;
  text-decoration: none;
  font-weight: 600;
}
.menu a:hover, .menu button:hover { background: var(--surface-2); }

/* ---------- shell ---------- */
.shell {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  min-height: calc(100vh - var(--top));
}
.rail {
  position: sticky;
  top: var(--top);
  align-self: start;
  height: calc(100vh - var(--top));
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: var(--bg-2);
  padding: 18px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rail h6 {
  margin: 14px 10px 6px;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
}
.rail h6:first-child { margin-top: 0; }
.rail a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
  color: var(--muted);
}
.rail a:hover { background: var(--surface); color: var(--text); }
.rail a.on { background: var(--surface-2); color: var(--text); }
.rail a .ico {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  flex: none;
}
.rail a .ico svg { width: 20px; height: 20px; }
.rail .note {
  margin-top: auto;
  padding: 12px 10px 0;
  font-size: 12px;
  color: var(--faint);
  line-height: 1.45;
}
.chips-nav { display: none; }

main {
  min-width: 0;
  padding: 24px 28px 40px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* ---------- lobby ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 36px 36px 34px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(235, 186, 75, .22), transparent 55%),
    radial-gradient(90% 120% at 0% 100%, rgba(210, 58, 74, .22), transparent 60%),
    linear-gradient(135deg, #2a1d3f, #1a1326);
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
}
.hero h1 {
  font-family: var(--f-display);
  font-weight: 900;
  font-size: clamp(28px, 4.2vw, 46px);
  line-height: 1.05;
  margin: 0 0 12px;
  text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--brass); }
.hero p { margin: 0 0 22px; color: var(--muted); max-width: 46ch; font-size: 16px; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero .cta .btn { padding: 13px 22px; font-size: 15px; }
.hero-art { position: relative; height: 210px; }
.hero-art .chip3d {
  position: absolute;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 900;
  box-shadow: 0 16px 30px rgba(0, 0, 0, .45);
}
.facts {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 22px;
  font-size: 13px;
  color: var(--muted);
}
.facts b { color: var(--text); font-size: 18px; display: block; font-family: var(--f-display); font-weight: 700; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.section-head h2 {
  margin: 0;
  font-family: var(--f-display);
  font-weight: 700;
  font-size: 20px;
}
.section-head span { color: var(--muted); font-size: 13px; }

.tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  aspect-ratio: 5 / 4;
  max-width: 100%;
  padding: 16px;
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, .06);
  transition: transform .18s, box-shadow .18s;
}
.tile:hover { transform: translateY(-3px); box-shadow: 0 18px 36px rgba(0, 0, 0, .45); }
.tile .art {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding-bottom: 34px;
}
.tile .art svg { width: 46%; height: auto; filter: drop-shadow(0 12px 18px rgba(0, 0, 0, .35)); transition: transform .25s; }
.tile:hover .art svg { transform: scale(1.06) rotate(-3deg); }
.tile .name { position: relative; font-family: var(--f-display); font-weight: 700; font-size: 18px; }
.tile .meta { position: relative; font-size: 12px; font-weight: 700; opacity: .8; letter-spacing: .02em; }
.tile .badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: rgba(0, 0, 0, .35);
  padding: 4px 8px;
  border-radius: 6px;
}

/* ---------- feed table ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.table-wrap { overflow-x: auto; }
table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
table.data th {
  text-align: left;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 11px 16px;
  border-bottom: 1px solid rgba(53, 43, 74, .55);
  white-space: nowrap;
}
table.data tr:last-child td { border-bottom: 0; }
table.data .r { text-align: right; }
table.data .pos { color: var(--win); font-weight: 700; }
table.data .neg { color: var(--muted); }
table.data .game-cell { display: flex; align-items: center; gap: 8px; font-weight: 700; }
table.data .game-cell svg { width: 18px; height: 18px; }
tr.fresh td { animation: rowIn .6s ease; }
@keyframes rowIn { from { background: rgba(235, 186, 75, .14); } to { background: transparent; } }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

/* ---------- game layout ---------- */
.game-head { display: flex; align-items: center; gap: 14px; }
.game-head .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; }
.game-head .ico svg { width: 28px; height: 28px; }
.game-head h1 { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 24px; line-height: 1.1; }
.game-head p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.game {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: var(--surface);
}
.controls {
  padding: 18px;
  background: var(--bg-2);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.stage {
  position: relative;
  min-width: 0;
  min-height: 460px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  background:
    radial-gradient(80% 70% at 50% 40%, rgba(235, 186, 75, .07), transparent 70%),
    var(--surface);
}

.field label, .field .lbl {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
}
.field label span { color: var(--faint); font-weight: 600; }
.amount {
  display: flex;
  align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.amount:focus-within { border-color: var(--brass-lo); }
.amount input, .input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 11px 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.input { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; width: 100%; }
.input:focus { border-color: var(--brass-lo); }
.amount .cur { padding: 11px 10px 11px 0; color: var(--muted); font-weight: 700; }
.amount button {
  border: 0;
  border-left: 1px solid var(--line);
  background: var(--surface-3);
  padding: 0 12px;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
}
.amount button:hover { color: var(--text); background: #3a2f51; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 6px; }
.quick button {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.quick button:hover { color: var(--text); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { border: 0; background: none; border-radius: 8px; padding: 8px 0; font-weight: 800; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--surface-3); color: var(--text); }
.play { padding: 15px; font-size: 16px; border-radius: 12px; }
.readout { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.readout div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; }
.readout small { display: block; font-size: 11px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.readout b { font-variant-numeric: tabular-nums; }
.result-pop {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  animation: pop .35s ease;
  z-index: 5;
}
.result-pop.win { background: var(--win-bg); color: var(--win); border: 1px solid rgba(67, 217, 141, .4); }
.result-pop.loss { background: var(--loss-bg); color: var(--loss); border: 1px solid rgba(255, 93, 112, .35); }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -6px) scale(.9); } }
.fair-line { font-size: 12px; color: var(--faint); text-align: center; }
.fair-line a { color: var(--muted); }

.paytable { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; font-size: 13px; }
.paytable div { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.paytable .syms { display: flex; gap: 2px; }
.paytable .syms svg { width: 20px; height: 20px; }
.paytable b { color: var(--brass); font-variant-numeric: tabular-nums; }

/* ---------- slots ---------- */
.slot-cab {
  position: relative;
  padding: 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #3a2a10, #1e1508);
  border: 2px solid var(--brass-lo);
  box-shadow: 0 0 0 4px #120d07, 0 24px 50px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 212, 121, .4);
  width: min(100%, 420px);
}
.slot-cab .marquee {
  text-align: center;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: .18em;
  color: var(--brass-hi);
  margin: 0 0 10px;
  text-shadow: 0 0 14px rgba(255, 212, 121, .55);
}
.reels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 8px;
  background: #0d0905;
  border-radius: 14px;
}
.reel {
  position: relative;
  height: calc(var(--cell) * 3);
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, #e9e2d3, var(--card) 18%, var(--card) 82%, #e9e2d3);
  --cell: 96px;
}
.reel::before, .reel::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 26px;
  z-index: 2;
  pointer-events: none;
}
.reel::before { top: 0; background: linear-gradient(rgba(0, 0, 0, .28), transparent); }
.reel::after { bottom: 0; background: linear-gradient(transparent, rgba(0, 0, 0, .28)); }
.strip { will-change: transform; }
.sym { height: var(--cell); display: grid; place-items: center; }
.sym svg { width: 64%; height: 64%; }
.sym.hit { animation: symHit .9s ease infinite; }
@keyframes symHit { 50% { transform: scale(1.12); filter: drop-shadow(0 0 10px rgba(235, 186, 75, .9)); } }
.paylines { position: absolute; left: 8px; top: 8px; width: calc(100% - 16px); height: calc(100% - 16px); pointer-events: none; z-index: 3; overflow: visible; }
.paylines polyline { fill: none; stroke: var(--brass-hi); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; opacity: .9; filter: drop-shadow(0 0 6px rgba(255, 212, 121, .8)); }

/* ---------- roulette ---------- */
.wheel-box { position: relative; width: min(100%, 300px); aspect-ratio: 1; }
.wheel-box canvas { width: 100%; height: 100%; display: block; }
.wheel-rot { width: 100%; height: 100%; }
.wheel-pin {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid var(--brass-hi);
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6));
  z-index: 3;
}
.wheel-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.wheel-num span {
  width: 31%;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 900;
  font-size: 26px;
  color: #fff;
  border: 3px solid var(--brass);
}
.rl-history { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; min-height: 26px; }
.rl-history i {
  font-style: normal;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
}
.rl-felt {
  width: 100%;
  max-width: 640px;
  background: var(--felt);
  border-radius: 14px;
  padding: 10px;
  border: 2px solid #0f2a1f;
}
.rl-grid {
  display: grid;
  grid-template-columns: 44px repeat(12, minmax(0, 1fr)) 44px;
  grid-template-rows: repeat(3, 40px) 36px 36px;
  gap: 3px;
}
.rl-cell {
  grid-column: var(--hc);
  grid-row: var(--hr);
  position: relative;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
  color: #fff;
  background: transparent;
  padding: 0;
  transition: filter .12s, box-shadow .2s;
}
.rl-cell:hover { filter: brightness(1.25); }
.rl-cell.red { background: var(--rl-red); }
.rl-cell.black { background: var(--rl-black); }
.rl-cell.green { background: var(--rl-green); }
.rl-cell.out { background: rgba(255, 255, 255, .05); font-size: 12px; }
.rl-cell.won { box-shadow: 0 0 0 2px var(--brass-hi), 0 0 18px rgba(255, 212, 121, .7); z-index: 2; }
.rl-cell .stack {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  min-width: 28px;
  height: 28px;
  padding: 0 5px;
  border-radius: 14px;
  background: var(--brass);
  color: var(--brass-ink);
  border: 2px dashed rgba(36, 24, 4, .5);
  font-size: 10px;
  font-weight: 900;
  display: grid;
  place-items: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.chip-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.chip-pick button {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 3px dashed rgba(255, 255, 255, .45);
  font-size: 12px;
  font-weight: 900;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
  transition: transform .12s;
}
.chip-pick button.on { transform: translateY(-4px); box-shadow: 0 0 0 3px var(--brass-hi), 0 8px 16px rgba(0, 0, 0, .5); }

/* ---------- blackjack ---------- */
.bj-table {
  width: 100%;
  min-height: 420px;
  border-radius: 200px 200px 22px 22px / 120px 120px 22px 22px;
  background: radial-gradient(70% 60% at 50% 30%, var(--felt-hi), var(--felt));
  border: 10px solid #3a2410;
  box-shadow: inset 0 0 50px rgba(0, 0, 0, .45);
  padding: 34px 20px 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.bj-row { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.bj-label { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: rgba(255, 255, 255, .7); display: flex; gap: 8px; align-items: center; }
.bj-label .tot { background: rgba(0, 0, 0, .4); color: #fff; border-radius: 999px; padding: 2px 10px; letter-spacing: 0; font-size: 13px; }
.bj-cards { display: flex; min-height: 118px; }
.bj-cards .pcard + .pcard { margin-left: -34px; }
.bj-msg { font-family: var(--f-display); font-weight: 700; font-size: 18px; color: var(--brass-hi); min-height: 26px; text-align: center; }
.pcard {
  width: 80px;
  height: 116px;
  border-radius: 9px;
  background: var(--card);
  color: var(--card-ink);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .4);
  position: relative;
  font-weight: 800;
  animation: deal .35s ease both;
}
.pcard.red { color: #c62839; }
.pcard .c-tl { position: absolute; top: 6px; left: 8px; line-height: 1; font-size: 18px; text-align: center; }
.pcard .c-tl small { display: block; font-size: 15px; }
.pcard .c-mid { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; }
.pcard .c-br { position: absolute; bottom: 6px; right: 8px; line-height: 1; font-size: 18px; transform: rotate(180deg); text-align: center; }
.pcard .c-br small { display: block; font-size: 15px; }
.pcard.back {
  background:
    repeating-linear-gradient(45deg, #7a1f2c 0 6px, #8e2836 6px 12px);
  border: 4px solid var(--card);
}
@keyframes deal { from { opacity: 0; transform: translate(40px, -40px) rotate(8deg); } }
.bj-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bj-actions .btn { padding: 12px 0; }

/* ---------- mines ---------- */
.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 9px;
  width: min(100%, 440px);
}
.mtile {
  aspect-ratio: 1;
  max-width: 100%;
  border: 0;
  border-radius: 12px;
  background: var(--surface-3);
  box-shadow: inset 0 -5px 0 rgba(0, 0, 0, .28);
  display: grid;
  place-items: center;
  transition: transform .1s, background .15s;
  padding: 0;
}
.mtile:hover:not(:disabled) { background: #3d3156; transform: translateY(-2px); }
.mtile:disabled { cursor: default; }
.mtile svg { width: 62%; height: 62%; }
.mtile.gem { background: #1d3a33; box-shadow: inset 0 0 0 2px rgba(67, 217, 141, .5); animation: flip .3s ease; }
.mtile.bomb { background: #4a1822; box-shadow: inset 0 0 0 2px rgba(255, 93, 112, .6); animation: flip .3s ease; }
.mtile.ghost { opacity: .45; }
@keyframes flip { from { transform: rotateY(90deg); } }

/* ---------- dice ---------- */
.dice-big { font-family: var(--f-display); font-weight: 900; font-size: clamp(54px, 10vw, 92px); line-height: 1; font-variant-numeric: tabular-nums; }
.dice-big.win { color: var(--win); }
.dice-big.loss { color: var(--loss); }
.dice-track { width: min(100%, 560px); padding: 26px 0 8px; }
.track {
  position: relative;
  height: 14px;
  border-radius: 7px;
  background: var(--loss);
}
.track .zone { position: absolute; top: 0; bottom: 0; background: var(--win); }
.track .marker {
  position: absolute;
  top: -34px;
  transform: translateX(-50%);
  transition: left .5s cubic-bezier(.2, .8, .2, 1);
  background: var(--card);
  color: var(--card-ink);
  font-weight: 900;
  font-size: 13px;
  padding: 3px 8px;
  border-radius: 7px;
  white-space: nowrap;
}
.track .marker::after { content: ''; position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); border: 6px solid transparent; border-bottom: 0; border-top-color: var(--card); }
.dice-range { width: 100%; margin-top: 16px; accent-color: var(--brass); }
.ticks { display: flex; justify-content: space-between; font-size: 12px; color: var(--faint); margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- crash ---------- */
.crash-box { position: relative; width: 100%; max-width: 680px; aspect-ratio: 16 / 9; }
.crash-box canvas { width: 100%; height: 100%; display: block; }
.crash-mult {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  text-align: center;
}
.crash-mult b { display: block; font-family: var(--f-display); font-weight: 900; font-size: clamp(40px, 8vw, 74px); line-height: 1; font-variant-numeric: tabular-nums; }
.crash-mult small { display: block; font-weight: 800; margin-top: 6px; color: var(--muted); }
.crash-mult.busted b { color: var(--loss); }
.crash-mult.cashed b { color: var(--win); }
.crash-hist { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.crash-hist i { font-style: normal; font-size: 12px; font-weight: 800; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); font-variant-numeric: tabular-nums; }
.crash-hist i.hi { color: var(--win); }
.crash-hist i.lo { color: var(--loss); }

/* ---------- pages ---------- */
.page-title { margin: 0; font-family: var(--f-display); font-weight: 700; font-size: 26px; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 14px 16px; }
.stat small { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); font-weight: 700; }
.stat b { font-family: var(--f-display); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.prose { max-width: 70ch; color: var(--muted); }
.prose p { margin: 0 0 10px; }
.prose b { color: var(--text); }
.kv { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 10px 16px; padding: 18px; align-items: center; }
.kv dt { color: var(--muted); font-size: 13px; font-weight: 700; }
.kv dd { margin: 0; min-width: 0; }
.mono { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 13px; word-break: break-all; }
.verify { padding: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.verify .full { grid-column: 1 / -1; }
.verify-out { padding: 14px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); }

/* ---------- modal ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(6, 4, 10, .72);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
  animation: fade .15s ease;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(100%, 420px);
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  position: relative;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .6);
}
.modal h3 { margin: 0 0 4px; font-family: var(--f-display); font-weight: 700; font-size: 22px; }
.modal .sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.modal .x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 0;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 18px;
}
.form { display: flex; flex-direction: column; gap: 12px; }
.form .err { color: var(--loss); font-size: 13px; font-weight: 600; min-height: 18px; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; }
.tabs button { border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.tabs button.on { background: var(--surface-3); color: var(--text); }
.bonus-card {
  border-radius: 14px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(235, 186, 75, .18), rgba(235, 186, 75, .04));
  border: 1px solid rgba(235, 186, 75, .35);
  margin-bottom: 12px;
}
.bonus-card b { font-family: var(--f-display); font-size: 22px; color: var(--brass-hi); display: block; }
.small { font-size: 12px; color: var(--faint); }

/* ---------- toasts ---------- */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 120; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brass);
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .5);
  max-width: min(360px, calc(100vw - 32px));
  animation: pop2 .25s ease;
}
.toast.err { border-left-color: var(--loss); }
.toast.ok { border-left-color: var(--win); }
@keyframes pop2 { from { opacity: 0; transform: translateY(8px); } }

footer.foot {
  padding: 18px 28px 26px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 12px;
  display: flex;
  gap: 8px 18px;
  flex-wrap: wrap;
  align-items: center;
}
footer.foot .age { border: 1.5px solid var(--faint); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; font-weight: 900; font-size: 11px; color: var(--muted); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .game { grid-template-columns: 280px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { display: none; }
  .chips-nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--bg-2);
    scrollbar-width: none;
  }
  .chips-nav a {
    flex: none;
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    font-weight: 700;
    font-size: 13px;
    color: var(--muted);
  }
  .chips-nav a.on { color: var(--brass-ink); background: var(--brass); border-color: var(--brass); }
  main { padding: 18px 16px 32px; gap: 22px; }
  .hero { grid-template-columns: 1fr; padding: 26px 22px; }
  .hero-art { display: none; }
  .game { grid-template-columns: minmax(0, 1fr); }
  .controls { order: 2; border-right: 0; border-top: 1px solid var(--line); }
  .stage { min-height: 0; padding: 22px 14px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  footer.foot { padding: 16px; }
}
@media (max-width: 700px) {
  .rl-felt { max-width: 360px; }
  .rl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)) 48px 48px; grid-template-rows: repeat(14, 34px); }
  .rl-cell { grid-column: var(--vc); grid-row: var(--vr); }
  .rl-cell.out { font-size: 11px; }
}
@media (max-width: 560px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .logo small { display: none; }
  .wallet .bal { padding: 8px 10px; font-size: 14px; }
  .wallet .btn { padding: 10px 10px; }
  .wallet .btn .long { display: none; }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile { padding: 12px; }
  .tile .name { font-size: 15px; }
  .reel { --cell: 76px; }
  .pcard { width: 64px; height: 94px; }
  .pcard .c-mid { font-size: 30px; }
  .pcard .c-tl, .pcard .c-br { font-size: 15px; }
  .bj-cards { min-height: 96px; }
  .bj-cards .pcard + .pcard { margin-left: -26px; }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .kv dd { margin-bottom: 8px; }
  .verify { grid-template-columns: minmax(0, 1fr); }
  .rl-cell .stack { min-width: 22px; height: 22px; font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
