/* ==========================================================================
   Aviator UI — layout & components
   Values measured from the live game at 1920×1080.
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --header-h: 40px;
  --gap: 4px;
  --pad-s: 4px;
  --pad-m: 8px;
  --history-h: 32px;
  --nav-h: 32px;
  --total-win-h: 68px;
  --bet-panel-h: 184px;
  --sidebar-w: 410px;

  --c-page: #000;
  --c-app: #0e0e0e;
  --c-surface: #1b1c1d;
  --c-sunken: #141516;
  --c-row: #101112;
  --c-chip: #2c2d30;
  --c-border: #2a2b2e;

  --c-text: #fff;
  --c-text-strong: #ebebeb;
  --c-text-button: #fafafa;
  --c-text-soft: #ccc;
  --c-text-row: #bbbfc5;
  --c-text-muted: #a3a3a3;
  --c-text-dim: #7b7b7b;
  --c-text-faint: #525252;
  --c-currency: #9b9c9e;

  --c-brand: #e50539;
  --c-brand-hover: #d0021b;

  --c-green: #28a909;
  --c-green-hover: #36cb12;
  --c-green-border: #b2f2a3;
  --c-green-deep: #427f00;
  --c-orange: #d07206;
  --c-orange-hover: #f58708;
  --c-orange-border: #ffbd71;
  --c-red: #cb011a;
  --c-red-hover: #f7001f;
  --c-red-border: #ff7171;
  --c-blue: #1d7aca;
  --c-blue-hover: #0089ff;
  --c-blue-border: #46c0f2;
  --c-fun: #e59407;

  --c-x-low: #34b4ff;
  --c-x-mid: #913ef8;
  --c-x-high: #c017b4;

  --r-panel: 20px;
  --r-card: 14px;
  --r-pill: 32px;
  --r-round: 64px;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--c-text);
  background: var(--c-page);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  touch-action: manipulation;
}

button, input {
  font: inherit;
  color: inherit;
  margin: 0;
  outline: none;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

[hidden] { display: none !important; }

ul { margin: 0; padding: 0; list-style: none; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }

.scroll-hide { scrollbar-width: none; }
.scroll-hide::-webkit-scrollbar { display: none; }

/* ---------- App shell ---------- */
.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--c-app);
}

.game-container {
  flex: 1;
  min-height: 0;
  display: flex;
  gap: var(--gap);
  padding: var(--pad-s);
}

.game-play {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
  flex: 0 0 var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  padding: var(--pad-s);
  background: var(--c-surface);
  position: relative;
  z-index: 40; /* above .auth-gate so the menu opens over it */
}

.header__left {
  display: flex;
  align-items: center;
  height: 100%;
  margin-right: 8px;
}

.game-logo {
  display: flex;
  align-items: center;
  width: 84px;
  height: 100%;
  margin: 0 4px;
  color: var(--c-brand);
  font-size: 22px;
  font-weight: 800;
  font-style: italic;
  letter-spacing: -1px;
  line-height: 1;
  transform: skewX(-6deg);
}

.header__right {
  position: relative;
  display: flex;
  align-items: center;
  min-width: fit-content;
}

.menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  min-width: 200px;
  padding: 6px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6);
}

.menu__item {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--c-text-soft);
  font-size: 13px;
  text-align: left;
}

.menu__item:hover { background: var(--c-chip); color: #fff; }

.burger {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
}

/* ---------- Wallet (account balance) ---------- */
.wallet {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 10px;
}
.wallet[hidden], .wallet__login[hidden] { display: none; }

.wallet__balance {
  display: grid;
  justify-items: end;
  line-height: 1.1;
  font-variant-numeric: lining-nums tabular-nums;
}
.wallet__label { color: var(--c-text-dim); font-size: 10px; letter-spacing: .04em; text-transform: uppercase; }
.wallet__amount { color: var(--c-text-strong); font-size: 13px; font-weight: 700; white-space: nowrap; }

.wallet__deposit,
.wallet__login {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  background: var(--c-green);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.wallet__login { margin-right: 12px; background: var(--c-brand); }

@media (hover: hover) {
  .wallet__deposit:hover { background: var(--c-green-hover); }
  .wallet__login:hover { background: var(--c-brand-hover); }
}

/* ---------- Auth gate ---------- */
.auth-gate {
  position: fixed;
  inset: var(--header-h) 0 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 0, 0, .72);
  backdrop-filter: blur(3px);
}
.auth-gate[hidden] { display: none; }

.auth-gate__card {
  width: min(360px, 100%);
  padding: 24px 20px 18px;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-surface);
  text-align: center;
}
.auth-gate__title { margin: 0 0 6px; color: var(--c-text); font-size: 20px; font-weight: 800; }
.auth-gate__text { margin: 0 0 18px; color: var(--c-text-muted); font-size: 14px; }
.auth-gate__actions { display: grid; gap: 8px; }
.auth-gate__btn {
  height: 42px;
  border-radius: 21px;
  background: var(--c-chip);
  color: var(--c-text-button);
  font-size: 15px;
  font-weight: 700;
}
.auth-gate__btn--primary { background: var(--c-green); }
.auth-gate__back { display: inline-block; margin-top: 14px; color: var(--c-text-muted); font-size: 13px; text-decoration: underline; }

@media (hover: hover) {
  .auth-gate__btn:hover { background: #3a3b3f; }
  .auth-gate__btn--primary:hover { background: var(--c-green-hover); }
}

.bets-list__empty { padding: 16px 8px; color: var(--c-text-dim); font-size: 12px; text-align: center; list-style: none; }
.bet-btn:disabled { opacity: .75; cursor: progress; }

/* ---------- Provably fair dialog ---------- */
.fair-modal {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 1px solid var(--c-border);
  border-radius: 14px;
  background: var(--c-surface);
  color: var(--c-text-soft);
  overflow: auto;
}
.fair-modal::backdrop { background: rgba(0, 0, 0, .7); }
.fair-modal__card { position: relative; padding: 20px; font-size: 13px; line-height: 1.45; }
.fair-modal__close { position: absolute; top: 8px; right: 10px; width: 30px; height: 30px; color: var(--c-text-muted); font-size: 22px; }
.fair-modal__title { margin: 0 0 8px; color: var(--c-text); font-size: 18px; font-weight: 800; }
.fair-modal__text { margin: 0 0 8px; }
.fair-modal__steps { margin: 0 0 14px; padding-left: 18px; }
.fair-modal__label { margin: 12px 0 4px; color: var(--c-text-dim); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.fair-modal__hash, .fair-modal__rounds code {
  display: block;
  overflow-wrap: anywhere;
  color: var(--c-text-muted);
  font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.fair-modal__hash { padding: 8px 10px; border-radius: 8px; background: var(--c-sunken); }
.fair-modal__rounds { margin: 0; padding: 0; list-style: none; }
.fair-modal__rounds li {
  display: grid;
  grid-template-columns: 56px 64px 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--c-border);
}
.fair-modal__round { color: var(--c-text-dim); }

/* ==========================================================================
   Shared: navigation switcher (segmented control)
   ========================================================================== */
.nav-switcher {
  display: flex;
  width: 100%;
  max-width: 400px;
  height: var(--nav-h);
  margin: 0 auto;
  background: var(--c-sunken);
  border: 4px solid var(--c-sunken);
  border-radius: var(--r-round);
}

.nav-switcher--compact { width: 208px; flex-shrink: 0; }

.nav-switcher__tab {
  flex: 1 1 0;
  height: 100%;
  border-radius: var(--r-pill);
  color: var(--c-text-muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.18px;
  line-height: 1;
  transition: background-color .25s ease-in, color .25s ease-in;
}

.nav-switcher__tab.is-active {
  background: var(--c-chip);
  color: var(--c-text-strong);
  cursor: default;
}

@media (hover: hover) {
  .nav-switcher__tab:not(.is-active):hover { color: var(--c-brand-hover); }
}

/* ==========================================================================
   Shared: avatars
   Placeholder avatars are tinted by --h (hue). Swap the span for an <img>
   with the same class when real images are available.
   ========================================================================== */
.avatar {
  display: inline-block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  background:
    radial-gradient(circle at 50% 38%, hsl(var(--h, 0) 30% 85%) 0 22%, transparent 23%),
    radial-gradient(circle at 50% 110%, hsl(var(--h, 0) 30% 85%) 0 42%, transparent 43%),
    linear-gradient(135deg, hsl(var(--h, 0) 70% 48%), hsl(calc(var(--h, 0) + 40) 60% 28%));
}

.avatar--ringed { border: 1px solid #28a90a; }

.avatar-stack { display: flex; }
.avatar-stack .avatar:not(:first-child) { margin-left: -8px; }

/* ==========================================================================
   Shared: multiplier text colours
   ========================================================================== */
.mult {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: -0.18px;
  font-variant-numeric: lining-nums tabular-nums;
}
.mult--low  { color: var(--c-x-low); }
.mult--mid  { color: var(--c-x-mid); }
.mult--high { color: var(--c-x-high); }

/* ==========================================================================
   BetsSidebar
   ========================================================================== */
.bets-sidebar {
  flex: 0 0 var(--sidebar-w);
  width: var(--sidebar-w);
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: var(--pad-m) var(--pad-m) 0;
  background: var(--c-surface);
  border-radius: var(--r-panel);
}

/* ----- TotalWinWidget ----- */
.total-win {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: var(--total-win-h);
  margin-top: var(--pad-s);
  margin-bottom: var(--pad-s);
  padding: var(--pad-m);
  background: var(--c-sunken);
  border-radius: var(--r-card);
}

.total-win__header,
.total-win__stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.total-win__header { height: 20px; }
.total-win__stats { height: 16px; }

.total-win__value {
  color: var(--c-text-soft);
  font-size: 16px;
  font-weight: 600;
  line-height: 18px;
}

.total-win__bets { display: flex; align-items: center; }

.total-win__count {
  color: var(--c-text-soft);
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  font-variant-numeric: lining-nums tabular-nums;
}

.total-win__label {
  color: var(--c-text-dim);
  font-size: 12px;
  line-height: 1;
}
.total-win__bets .total-win__label { padding-left: 4px; }

.progress {
  display: flex;
  width: 100%;
  height: 8px;
  padding: 2px;
  overflow: hidden;
  background: rgba(43, 43, 43, .5);
  border-radius: var(--r-pill);
}

.progress__bar {
  height: 100%;
  background: var(--c-green-deep);
  border-radius: var(--r-pill);
  transition: width .3s;
}

/* ----- BetsList ----- */
.bets-list {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.bets-list__header,
.bet-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) repeat(3, minmax(0, 1fr));
  column-gap: 4px;
  align-items: center;
}

.bets-list__header {
  flex-shrink: 0;
  padding: 4px;
  color: var(--c-text-dim);
  font-size: 10px;
  font-weight: 500;
  line-height: 12px;
}

.bets-list__header span { padding: 0 4px; text-align: right; }
.bets-list__header span:first-child { text-align: left; }

.bets-list__rows {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  border-radius: 16px;
}

.bet-row {
  height: 32px;
  margin-top: 4px;
  padding: 4px;
  background: var(--c-row);
  border-radius: var(--r-pill);
  color: var(--c-text-row);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.bet-row.is-cashout {
  background:
    linear-gradient(rgba(66, 127, 0, .3), rgba(66, 127, 0, .3)),
    var(--c-row);
}

.bet-row__player {
  display: flex;
  align-items: center;
  min-width: 0;
}

.bet-row__player .avatar { margin-right: 4px; }

.bet-row__name {
  overflow: hidden;
  text-overflow: ellipsis;
}

.bet-row.is-own .bet-row__name {
  color: #fff;
  font-weight: 600;
}

.bet-row__name {
  min-width: 0;
  padding: 0 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.18px;
  font-variant-numeric: lining-nums tabular-nums;
}

.bet-row__col {
  padding: 0 4px;
  text-align: right;
  font-variant-numeric: lining-nums tabular-nums;
}

/* ----- Footer ----- */
.bets-footer {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 4px;
}

.provably-fair {
  display: flex;
  align-items: center;
  height: 12px;
  padding: 0 4px;
  color: var(--c-text-muted);
  font-size: 10px;
  font-weight: 500;
  line-height: 12px;
}

.provably-fair__icon { margin: 0 6px; }

.powered-by {
  padding: 0 4px;
  color: var(--c-text-faint);
  font-size: 10px;
  font-weight: 500;
  line-height: 12px;
}

.powered-by b {
  margin-left: 3px;
  color: #8a8a8a;
  font-weight: 800;
  letter-spacing: .2px;
}

/* ==========================================================================
   HistoryFeed
   ========================================================================== */
.history {
  flex: 0 0 var(--history-h);
  display: flex;
  align-items: center;
  margin-bottom: var(--gap);
  padding: 4px;
  border-radius: 16px;
  overflow: hidden;
}

.history__track {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 4px;
  overflow: hidden;
}

.history__item {
  flex-shrink: 0;
  margin-right: 4px;
  padding: 2px 4px;
  line-height: 18px;
  cursor: pointer;
}

.history__more {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  height: 16px;
  margin: 0 4px;
  padding: 0 4px;
  background: var(--c-chip);
  border-radius: var(--r-pill);
  box-shadow: -4px 0 10px 10px var(--c-app);
}

/* ==========================================================================
   GameCanvasContainer (stage) — structural part; visuals in effects.css
   ========================================================================== */
.stage {
  position: relative;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
  isolation: isolate;
  container-type: size;
  background: #000;
  border: 1px solid var(--c-border);
  border-radius: var(--r-panel);
}

.stage__center {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.multiplier {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
}

.multiplier__value {
  color: #fff;
  font-size: clamp(36px, min(7cqw, 15cqh), 130px);
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: lining-nums tabular-nums;
}

.multiplier__flew {
  display: none;
  margin-bottom: .4em;
  color: #fff;
  font-size: clamp(16px, min(2.6cqw, 5.5cqh), 40px);
  font-weight: 500;
  text-transform: uppercase;
}

.active-players {
  position: absolute;
  right: 8px;
  bottom: 8px;
  z-index: 5;
  display: flex;
  align-items: center;
  height: 32px;
  padding: 4px;
  background: rgba(41, 41, 41, .5);
  border-radius: 16px;
}

.active-players__count {
  min-width: 35px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
}

/* ==========================================================================
   BetPanel
   ========================================================================== */
.bet-controls {
  flex-shrink: 0;
  display: flex;
  gap: var(--gap);
  padding-top: var(--pad-s);
}

.bet-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: var(--bet-panel-h);
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--c-surface);
  border-radius: var(--r-panel);
}

.bet-panel__top {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 384px;
  padding: var(--pad-m);
}

.bet-panel__row {
  display: flex;
  width: 100%;
  margin-top: 20px;
}

.bet-panel[data-mode="auto"] .bet-panel__row { margin-top: 12px; }

.bet-panel__corner {
  position: absolute;
  top: 8px;
  right: 8px;
  display: none;
  place-items: center;
  width: 32px;
  height: 32px;
  background: var(--c-chip);
  border: 4px solid var(--c-sunken);
  border-radius: 50%;
}

.bet-controls:not(.is-single) .bet-panel__corner--remove,
.bet-controls.is-single .bet-panel__corner--add { display: grid; }

.bet-controls.is-single .bet-panel:nth-child(2) { display: none; }

.bet-panel.is-locked .bet-amount,
.bet-panel.is-locked .nav-switcher,
.bet-panel.is-locked .bet-panel__corner--remove {
  opacity: .5;
  pointer-events: none;
}

/* ----- Bet amount column ----- */
.bet-amount {
  flex: 0 0 140px;
  display: flex;
  flex-direction: column;
}

.stepper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 32px;
  padding: 4px;
  background: var(--c-sunken);
  border-radius: var(--r-pill);
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  transition: opacity .1s;
}

.stepper__input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-text-soft);
  font-weight: 600;
  text-align: center;
}

.stepper__btn {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  background: var(--c-chip);
  border-radius: 50%;
}

.stepper__btn::before,
.stepper__btn--plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 2px;
  background: #9b9c9e;
  border-radius: 1px;
  transform: translate(-50%, -50%);
}

.stepper__btn--plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.stepper__btn:active { transform: translateY(1px); }

.stepper--small {
  width: 80px;
  height: 24px;
  padding: 0;
  font-size: 12px;
  font-weight: 500;
}

.stepper__suffix {
  width: 20px;
  color: #fff;
  font-size: 12px;
  text-align: left;
}

.stepper.is-disabled .stepper__input,
.stepper.is-disabled .stepper__suffix { opacity: .5; }

.quick-bets {
  display: grid;
  grid-template-columns: repeat(2, 68px);
  gap: 4px;
  justify-content: center;
  margin-top: 4px;
}

.quick-bets__btn {
  height: 24px;
  background: var(--c-sunken);
  border-radius: var(--r-round);
  color: rgba(255, 255, 255, .5);
  font-size: 14px;
  line-height: 1;
  transition: color .15s;
}

@media (hover: hover) {
  .quick-bets__btn:hover { color: rgba(255, 255, 255, .8); }
}

/* ----- Main action button ----- */
.bet-btn-frame {
  flex: 1;
  min-width: 0;
  display: flex;
  margin-left: 7px;
  border: 4px solid var(--c-sunken);
  border-radius: 16px;
}

.bet-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 80px;
  padding: 8px;
  border: 1px solid;
  border-radius: 12px;
  color: var(--c-text-button);
  font-size: 22px;
  font-weight: 400;
  line-height: 27px;
  text-align: center;
  font-variant-numeric: lining-nums tabular-nums;
  transition: background-color .15s;
}

.bet-btn:active { transform: translateY(1px); }

.bet-btn__amount { letter-spacing: -0.33px; }

.bet-btn__amount small {
  margin-left: 4px;
  font-size: 18px;
}

.bet-btn__hint {
  margin-top: 2px;
  color: rgba(250, 250, 250, .8);
  font-size: 14px;
  font-weight: 600;
  line-height: normal;
  letter-spacing: -0.21px;
}

.bet-btn--bet     { background: var(--c-green);  border-color: var(--c-green-border); }
.bet-btn--cancel  { background: var(--c-red);    border-color: var(--c-red-border); }
.bet-btn--cashout { background: var(--c-orange); border-color: var(--c-orange-border); }

@media (hover: hover) and (pointer: fine) {
  .bet-btn--bet:hover     { background: var(--c-green-hover); }
  .bet-btn--cancel:hover  { background: var(--c-red-hover); }
  .bet-btn--cashout:hover { background: var(--c-orange-hover); }
}

/* ----- Auto mode row ----- */
.bet-panel__bottom {
  display: none;
  width: 100%;
  max-width: 384px;
}

.bet-panel[data-mode="auto"] .bet-panel__bottom { display: flex; }

.auto-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 39px;
  padding: 0 8px;
  color: var(--c-text-soft);
}

.auto-row > .toggle-field { margin-left: 5px; }

.auto-row__cashout {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 0 5px;
}

.toggle-field {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  cursor: pointer;
}

.switch {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  width: 36px;
  height: 24px;
  padding: 4px;
  background: var(--c-sunken);
  border-radius: var(--r-pill);
}

.switch__knob {
  width: 16px;
  height: 16px;
  background: var(--c-chip);
  border-radius: 50%;
}

.switch[aria-checked="true"] { justify-content: flex-end; }
.switch[aria-checked="true"] .switch__knob { background: var(--c-text-muted); }

.auto-play-btn {
  height: 24px;
  padding: 0 8px;
  background: var(--c-blue);
  border: 1px solid var(--c-blue-border);
  border-radius: 17px;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

@media (hover: hover) { .auto-play-btn:hover { background: var(--c-blue-hover); } }

/* ==========================================================================
   Responsive
   Breakpoints mirror the original: 1400 / 1200 / 992 / 768.
   ========================================================================== */
@media (max-width: 1399.98px) { :root { --sidebar-w: 370px; } }
@media (max-width: 1199.98px) { :root { --sidebar-w: 320px; } }

/* Tablet & mobile: single column, sidebar moves under the game */
@media (max-width: 991.98px) {
  body { overflow-y: auto; }

  .app { height: auto; min-height: 100dvh; }

  .game-container {
    flex-direction: column-reverse;
    gap: var(--gap);
  }

  .bets-sidebar {
    flex: none;
    width: 100%;
    height: 80vh;
  }

  .stage {
    flex: none;
    height: max(200px, calc(100dvh - var(--header-h) - var(--history-h) - var(--bet-panel-h) - 24px));
  }
}

/* Phones: stack the two bet panels */
@media (max-width: 767.98px) {
  .game-logo { width: 72px; font-size: 19px; }
  .wallet { gap: 6px; margin-right: 6px; }
  .wallet__label { display: none; }
  .wallet__deposit { padding: 0 8px; font-size: 11px; }

  .bet-controls { flex-direction: column; }

  .bet-panel { flex: none; min-height: 0; }

  .bet-panel__row { margin-top: 12px; }

  .stage { height: max(200px, 42vh); }

  .total-win { min-width: 0; }
}

@media (max-width: 380px) {
  .bet-amount { flex-basis: 128px; }
  .quick-bets { grid-template-columns: repeat(2, 62px); }
  .bet-btn { font-size: 18px; line-height: 22px; }
  .bet-btn__amount small { font-size: 14px; }
  .auto-row { padding: 0 4px; }
  .auto-row > .toggle-field { margin-left: 0; }
}
