:root {
  color-scheme: dark;
  --ink: #111612;
  --panel: #181e18;
  --line: #323b31;
  --line-soft: #283329;
  --text: #f6eee0;
  --muted: #acb2a5;
  --dim: #929c8e;
  --gold: #e4bb78;
  --gold-dark: #aa773d;
  --green: #76be93;
  --red: #eb9891;
  --sans: "DM Sans", system-ui, sans-serif;
  --serif: "Instrument Serif", Georgia, serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { min-width: 280px; }
body {
  margin: 0;
  min-height: 100svh;
  font: 14px/1.4 var(--sans);
  color: var(--text);
  background: radial-gradient(ellipse at 28% 12%, #1b241a 0%, transparent 55%), #101411;
}
button, input, select { font: inherit; }
button { color: inherit; touch-action: manipulation; }
button:focus-visible, select:focus-visible, input:focus-visible {
  outline: 2px solid #ffe2a5;
  outline-offset: 3px;
}
button:disabled { cursor: default; }
[hidden] { display: none !important; }
h1, h2, p, ol, dl, dd { margin: 0; }
h1, h2 { font-family: var(--serif); font-weight: 400; }
.topbar {
  border-bottom: 1px solid #343b2f;
  background: #111612;
}
.topbar-inner, .main { width: min(100% - 64px, 1320px); margin-inline: auto; }
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 76px;
  padding-block: 10px;
}
.brand, .top-actions, .wallet, .button, .eyebrow, .wheel-state {
  display: flex;
  align-items: center;
}
.brand { flex: none; gap: 10px; }
.brand img { display: block; }
.brand span { font: 21px var(--serif); letter-spacing: .22em; color: #f4dfb9; }
.top-actions { justify-content: flex-end; gap: 22px; min-width: 0; }
.wallet {
  justify-content: space-between;
  gap: 17px;
  min-width: 0;
  max-width: min(58vw, 480px);
  border: 1px solid #383f31;
  padding: 5px 6px 5px 13px;
  border-radius: 9px;
  background: #1a2119;
}
.wallet-amount { min-width: 0; }
.wallet-amount strong, .table-total strong {
  display: block;
  font-size: 15px;
  font-weight: 720;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}
.caption {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .105em;
  text-transform: uppercase;
  color: #bdc2b5;
}
.button {
  justify-content: center;
  gap: 7px;
  min-height: 40px;
  padding: 7px 12px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  font-weight: 650;
  cursor: pointer;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease, box-shadow .16s ease;
}
.button-plain { color: #d2d4c7; }
.button-wallet {
  flex: none;
  background: #342b1f;
  border-color: #644e32;
  color: #f5d599;
  white-space: nowrap;
}
.button-wallet span:first-child { font-size: 18px; line-height: 1; }
.info-icon {
  display: grid;
  width: 16px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font: 700 10px/1 var(--sans);
  opacity: .8;
}
.button-secondary { background: #222b22; border-color: #3b493b; color: #e2e6da; }
.button-gold {
  border-color: #ebc487;
  color: #21180c;
  background: linear-gradient(175deg, #f3d29a, #cd9955);
  box-shadow: inset 0 1px #fff0c888, 0 2px 7px #08080545;
}
.button-secondary:disabled { color: #929f90; background: #1d241d; border-color: #30392f; }
.button-gold:disabled { color: #e4d3ad; background: #50442e; border-color: #695637; box-shadow: none; }
@media (hover: hover) {
  .button-plain:hover { background: #293126; }
  .button-wallet:hover { background: #49351e; border-color: #a37b44; }
  .button-secondary:not(:disabled):hover { background: #2b382b; border-color: #687866; }
  .button-gold:not(:disabled):hover { background: linear-gradient(175deg, #ffe2ae, #e8af6a); }
}
.main { padding-block: 28px 0; }
.intro { display: flex; justify-content: space-between; align-items: end; gap: 14px; margin-bottom: 22px; }
.eyebrow {
  gap: 8px;
  width: max-content;
  color: #c3a97a;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.eyebrow i { width: 6px; height: 6px; border: 1px solid #e3bd83; rotate: 45deg; }
h1 { font-size: clamp(39px, 4.4vw, 65px); line-height: 1.04; margin-top: 5px; letter-spacing: -.045em; }
.currency { display: grid; gap: 3px; margin-bottom: 3px; }
.currency select {
  background: #1d261d;
  border: 1px solid #3b4737;
  min-height: 38px;
  padding: 4px 11px;
  border-radius: 7px;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}
.game { display: grid; grid-template-columns: minmax(0, .96fr) minmax(0, 1.12fr); gap: 18px; }
.panel {
  background: linear-gradient(155deg, #1d251d, #171d17 62%);
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: 0 12px 35px #080c091f, inset 0 1px #ebdaa109;
  min-width: 0;
}
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 40px; }
.panel-heading h2 { font-size: 25px; letter-spacing: -.025em; }
.wheel-panel { display: flex; flex-direction: column; padding: 16px 18px; position: relative; }
.wheel-stage {
  display: grid;
  align-items: center;
  margin: auto -7px;
  background: radial-gradient(ellipse at center, #54513a2c, transparent 66%);
}
#wheel { width: 100%; aspect-ratio: 640 / 562; display: block; }
.wheel-state {
  justify-content: flex-end;
  white-space: nowrap;
  gap: 6px;
  padding: 5px 9px;
  color: #cbd3c3;
  border: 1px solid #3a4738;
  border-radius: 5px;
  background: #202b20;
  font-size: 11px;
}
.wheel-state i { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 7px #86d29d63; }
.wheel-state[data-state="spinning"] i { background: var(--gold); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .4; } }
.result {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 10px 13px;
  min-height: 67px;
  border: 1px solid #414033;
  border-radius: 8px;
  background: linear-gradient(105deg, #282821, #1b231c);
}
.result-number {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 7px;
  font: 25px var(--serif);
  color: #f6e2b8;
  border: 1px solid #57503d;
  background: #27271e;
}
.result-number[data-color="red"], .history [data-color="red"] { background: #702c2a; border-color: #a6534a; }
.result-number[data-color="black"], .history [data-color="black"] { background: #161914; border-color: #64665a; }
.result-number[data-color="green"], .history [data-color="green"] { background: #1d5943; border-color: #46886c; }
.result-copy { min-width: 0; overflow-wrap: anywhere; }
.result-copy strong { display: block; font-size: 14px; color: #f3e4c5; }
.result-copy span { color: var(--muted); font-size: 12px; }
.result[data-outcome="win"] { border-color: #5b7856; }
.table-panel { display: flex; flex-direction: column; padding: 16px 18px; }
.table-total { text-align: end; min-width: 0; }
.table-total strong { color: var(--gold); }
.bet-modes { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 13px; margin-bottom: 9px; }
.mode-button {
  min-height: 32px;
  padding: 4px 11px;
  border-radius: 5px;
  border-color: #3a493a;
  color: #d3d9cd;
  background: #222c22;
  font-size: 12px;
}
.mode-button[aria-pressed="true"] { color: #f5d799; border-color: #947344; background: #363123; }
@media (hover: hover) { .mode-button:not(:disabled):hover { border-color: #bb995f; } }
.felt {
  border-radius: 9px;
  padding: 10px;
  border: 1px solid #41614c;
  box-shadow: inset 0 0 12px #070e0ac2, 0 3px 12px #060b0780;
  background:
    repeating-linear-gradient(122deg, #95977b0b 0 1px, transparent 1px 3px),
    radial-gradient(ellipse at 55% 20%, #236245, #163c2c);
}
.board {
  --target: 17px;
  --large-target: 31px;
  position: relative;
  aspect-ratio: 2.56;
  box-shadow: 0 0 0 1px #a29b68a8, 0 0 18px #0e281f8c;
  border-radius: 3px;
  isolation: isolate;
}
.board-cell, .board-target, .placed-chip { position: absolute; left: var(--left); top: var(--top); }
.board-cell {
  width: var(--width);
  height: var(--height);
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #bcae7a89;
  background: #206044b0;
  color: #f9f2d9;
  cursor: pointer;
  font-weight: 710;
  touch-action: manipulation;
  text-shadow: 0 1px 1px #060907c2;
  -webkit-tap-highlight-color: transparent;
}
.board-cell.straight { font-size: clamp(12px, 1.43vw, 20px); }
.board-cell.zero { border-radius: 3px 0 0 0; }
.board-cell.red { background: linear-gradient(155deg, #a2443b, #6e2a29 100%); }
.board-cell.black { background: linear-gradient(145deg, #272a23, #191e19); }
.board-cell.red-side::before, .board-cell.black-side::before {
  content: "";
  width: 14px;
  aspect-ratio: 1;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, #ad4e40, #762a23);
  box-shadow: 0 0 0 1px #edb99f8f;
}
.board-cell.black-side::before { background: #141a15; box-shadow: 0 0 0 1px #b1b7a280; }
.color-label { display: none; }
.board-cell.outside, .board-cell.column, .board-cell.dozen { font-size: clamp(9px, .94vw, 13px); }
.board-cell.dozen { background: #296249ab; }
.board-cell.column { font-variant-numeric: tabular-nums; }
.board-cell.has-stake > span:not(.color-label) {
  position: absolute;
  top: 3px;
  left: 3px;
  font-size: max(9px, .67em);
  line-height: 1;
}
.board-cell.has-stake:is(.red-side, .black-side)::before {
  position: absolute;
  top: 4px;
  left: 5px;
  width: 7px;
}
.board-cell.is-winning {
  z-index: 1;
  box-shadow: inset 0 0 0 2px #fff1a9, inset 0 0 14px #ffdf7275, 0 0 10px #ffe4a578;
  color: #fff9dc;
}
.board-cell.preview { z-index: 1; box-shadow: inset 0 0 0 2px #fff1a9aa, inset 0 0 11px #ffe2a65c; }
.board-cell:focus-visible { z-index: 5; outline-offset: -3px; }
.board-target {
  z-index: 2;
  width: var(--target);
  height: var(--target);
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.board-target::before { content: ""; width: 3px; height: 3px; border-radius: 50%; background: #e6d4a7; box-shadow: 0 0 2px 1px #2c3528a8; }
.board-target:is(.street, .sixline)::before { width: 6px; height: 3px; border-radius: 1px; }
.board[data-mode]:not([data-mode="all"]) .board-target {
  width: var(--large-target);
  height: var(--large-target);
}
.board[data-mode]:not([data-mode="all"]) .board-target::before {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: #c89c5c;
  border: 2px solid #f6d8a0;
  box-shadow: 0 0 0 2px #233a29;
}
.board-target:focus-visible, .board-target.preview { background: #ffd18b59; }
.board-target:disabled { opacity: .42; }
.board:active .board-target:not(:disabled):active { background: #ffd18b70; }
.placed-chip {
  z-index: 3;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  font-size: 9px;
  pointer-events: none;
}
.placed-chip.is-winning { filter: drop-shadow(0 0 5px #fff1af); }
.placed-chip.is-muted { opacity: .56; }
.placement {
  min-height: 35px;
  padding-block: 8px 5px;
  color: #b5c3b3;
  font-size: 12px;
}
.table-controls { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.chip-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
#selection { color: #d4b47c; font-size: 12px; text-align: end; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: clamp(7px, 1.15vw, 16px); margin-top: 9px; }
.chip {
  --chip-edge: #c7cebd;
  --chip-core: #e0e5d6;
  --chip-text: #242a1d;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #f5eacc84;
  color: var(--chip-text);
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  background: repeating-conic-gradient(from -11deg, #f5eac9 0deg 17deg, var(--chip-edge) 17deg 60deg);
  box-shadow: 0 3px #151912, 0 4px 4px #080b08a0, inset 0 0 0 1px #1d21154a;
}
.chip > span {
  width: 76%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  background: var(--chip-core);
  border: 1px dashed color-mix(in srgb, var(--chip-text) 42%, transparent);
  box-shadow: 0 0 0 1px #24251a89;
  border-radius: 50%;
}
button.chip { padding: 0; width: 48px; height: 48px; cursor: pointer; font-size: 13px; }
button.chip[aria-pressed="true"] { outline: 2px solid #e9bc72; outline-offset: 3px; }
button.chip:disabled { opacity: .62; }
button.chip:focus-visible { outline: 2px solid #fff2cf; outline-offset: 4px; }
@media (hover: hover) { button.chip:not(:disabled):hover { filter: brightness(1.14); } }
.chip[data-color="red"] { --chip-edge: #ac4c43; --chip-core: #8f3630; --chip-text: #ffe9de; }
.chip[data-color="green"] { --chip-edge: #397f62; --chip-core: #27664f; --chip-text: #e1f9e8; }
.chip[data-color="navy"] { --chip-edge: #62809b; --chip-core: #3b526d; --chip-text: #edf5ff; }
.chip[data-color="gold"] { --chip-edge: #e0aa62; --chip-core: #c88f43; --chip-text: #221b11; }
.chip[data-color="custom"] { --chip-edge: #726a53; --chip-core: #38372c; --chip-text: #f8e4b9; }
.chip[data-color="custom"] > span { font-size: 16px; }
.placed-chip[data-color="custom"] > span { font-size: inherit; }
.feedback { min-height: 34px; padding-block: 8px 7px; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.feedback[data-error="true"] { color: #ffa99d; }
.action-row { margin-top: auto; display: grid; grid-template-columns: auto auto minmax(85px, 1fr); gap: 8px; }
.action-row button { min-height: 44px; }
.repeat-icon { font-size: 18px; line-height: .8; }
.play-icon {
  width: 0; height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
}
.session {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  padding: 14px 18px;
  margin-top: 16px;
  gap: 18px;
}
.recent { min-width: 0; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.recent h2 { font-size: 18px; white-space: nowrap; }
.history { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 0; }
.history li {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid #737865;
  border-radius: 5px;
  color: #ffecc7;
  font-size: 11px;
  font-weight: 800;
}
.history li:first-child { box-shadow: 0 0 0 1px #e0bb7b; }
.history-empty { font-size: 12px; color: var(--muted); }
.stats { display: grid; grid-template-columns: .65fr .85fr 1.22fr 1.28fr; gap: 8px; }
.stats div { display: grid; align-content: center; padding-left: 10px; border-left: 1px solid var(--line); min-width: 0; }
.stats dt { color: var(--muted); font-size: 11px; }
.stats dd { font-size: 14px; font-weight: 760; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
#net[data-sign="positive"] { color: #a7deb3; }
#net[data-sign="negative"] { color: #f4a098; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 10px; padding: 14px 1px max(14px, env(safe-area-inset-bottom)); color: var(--dim); font-size: 11px; }
.mobile-views, .mobile-to-table { display: none; }
dialog {
  width: min(445px, calc(100% - 28px));
  max-height: calc(100% - 25px);
  padding: 20px;
  border: 1px solid #6b5d42;
  border-radius: 13px;
  color: var(--text);
  background: #1c251d;
  box-shadow: 0 20px 70px #000a;
  overscroll-behavior: contain;
}
dialog::backdrop { background: #080c09bb; backdrop-filter: blur(3px); }
.dialog-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.dialog-heading h2 { font-size: 28px; }
.close-button { width: 42px; height: 42px; padding: 0; font-size: 26px; color: var(--muted); border: 1px solid #425243; }
dialog label { display: block; margin-bottom: 6px; color: #d0d5c5; }
dialog label span { color: var(--gold); margin-left: 3px; }
dialog input {
  width: 100%;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #64745e;
  color: var(--text);
  background: #101710;
  font-size: 16px;
}
.quick-amounts { display: flex; gap: 7px; padding-top: 9px; }
.quick-amounts button { flex: 1; }
.submit-button { width: 100%; margin-top: 14px; }
dialog p { color: #d2d7c9; margin: 10px 0; }
.rules-table { width: 100%; border-collapse: collapse; margin-block: 10px; }
.rules-table :is(th, td) { padding: 5px; border-bottom: 1px solid #3a483a; text-align: start; }
.rules-table :is(th, td):last-child { text-align: end; white-space: nowrap; }

@media (max-width: 1080px) {
  .topbar-inner, .main { width: calc(100% - 40px); }
  .game { grid-template-columns: minmax(0, .87fr) minmax(0, 1.13fr); gap: 13px; }
  .wheel-panel, .table-panel { padding: 13px; }
  .board { --target: 15px; --large-target: 26px; }
}
@media (max-width: 820px) {
  .topbar-inner, .main { width: min(100% - 28px, 640px); }
  .main { padding-top: 18px; }
  .intro { margin-bottom: 13px; }
  .game { display: block; }
  .mobile-views {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin-bottom: 10px;
    padding: 4px;
    background: #161e16;
    border: 1px solid #303d2f;
    border-radius: 9px;
  }
  .view-button { min-height: 36px; color: #d0d7c8; }
  .view-button[aria-pressed="true"] { background: #2d352a; border-color: #4f553e; color: #f5d99d; }
  .game[data-view="wheel"] .table-panel, .game[data-view="table"] .wheel-panel { display: none; }
  .mobile-to-table { display: flex; width: 100%; margin-top: 10px; }
  .wheel-stage { width: min(calc(100% + 12px), 510px); margin: 0 auto; }
  .session { grid-template-columns: 1fr; gap: 10px; padding: 11px; margin-top: 10px; }
  .stats { border-top: 1px solid var(--line); padding-top: 9px; }
  .stats div:first-child { border: 0; padding-left: 0; }
  .board-cell.straight { font-size: 17px; }
  .board-cell.outside, .board-cell.dozen, .board-cell.column { font-size: 11px; }
}
@media (max-width: 620px) {
  .topbar-inner { min-height: 65px; gap: 6px; padding-block: 7px; }
  .brand { gap: 5px; }
  .brand img { width: 31px; height: 31px; }
  .brand span { font-size: 15px; letter-spacing: .12em; }
  .top-actions { gap: 3px; }
  .rules-button { font-size: 0; min-width: 37px; padding: 0; }
  .info-icon { width: 21px; font-size: 13px; }
  .wallet { gap: 6px; padding: 3px 3px 3px 6px; max-width: min(64vw, 240px); }
  .wallet .caption { font-size: 7.5px; letter-spacing: .04em; }
  .wallet-amount strong { font-size: 12px; }
  .button-wallet { min-height: 38px; gap: 3px; padding-inline: 5px; font-size: 11px; }
  .button-wallet span:first-child { font-size: 14px; }
  h1 { font-size: clamp(30px, 8.2vw, 46px); }
  .currency .caption { font-size: 8px; }
  .currency select { font-size: 16px; padding-inline: 4px; min-height: 35px; }
  .wheel-panel, .table-panel { padding: 10px 11px; }
  .panel-heading { min-height: 34px; }
  .panel-heading h2 { font-size: 23px; }
  .board {
    aspect-ratio: auto;
    height: clamp(480px, 124vw, 620px);
    --target: 20px;
    --large-target: 32px;
  }
  .board-cell, .board-target, .placed-chip { left: var(--mobile-left); top: var(--mobile-top); }
  .board-cell { width: var(--mobile-width); height: var(--mobile-height); }
  .board-cell.zero { border-radius: 0 3px 0 0; }
  .board-target:is(.street, .sixline)::before { width: 3px; height: 6px; }
  .bet-modes { gap: 4px; margin-top: 9px; }
  .mode-button { flex: 1; min-height: 38px; padding-inline: 4px; white-space: nowrap; }
  .felt { padding: 8px; }
  .placement { min-height: 34px; }
  .chip-heading { gap: 6px; }
  .chips { gap: 7px; }
  button.chip { width: 43px; height: 43px; }
  .action-row { gap: 5px; }
  .action-row button { padding-inline: 7px; }
  .action-extra { display: none; }
  .stats dt { font-size: 10px; }
  .stats dd { font-size: 13px; }
}
@media (max-width: 350px) {
  .topbar-inner, .main { width: calc(100% - 18px); }
  .chips { gap: 5px; }
  button.chip { width: 39px; height: 39px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

@media (max-width: 820px) {
  .topbar { position: sticky; top: 0; z-index: 20; }
  .mobile-views { scroll-margin-top: 84px; }
}
@media (max-width: 620px) {
  .mobile-views { scroll-margin-top: 73px; }
  .table-controls { order: 1; border-top: 0; padding-top: 10px; }
  .bet-modes { order: 2; margin-top: 3px; }
  .felt { order: 3; }
  .placement { order: 4; }
  .action-row {
    order: 5;
    position: sticky;
    z-index: 7;
    bottom: max(5px, env(safe-area-inset-bottom));
    padding: 5px;
    margin: 0 -5px -5px;
    background: #1b231b;
    border: 1px solid #394436;
    border-radius: 9px;
    box-shadow: 0 -3px 13px #10161173;
  }
}
