:root {
  --sait: var(--discord-safe-area-inset-top, env(safe-area-inset-top, 0px));
  --saib: var(--discord-safe-area-inset-bottom, env(safe-area-inset-bottom, 0px));
  --sail: var(--discord-safe-area-inset-left, env(safe-area-inset-left, 0px));
  --sair: var(--discord-safe-area-inset-right, env(safe-area-inset-right, 0px));
  --bg: #0b101b;
  --panel: #151c2c;
  --panel-2: #1c2538;
  --line: rgba(255, 255, 255, 0.09);
  --text: #eef1f8;
  --muted: rgba(238, 241, 248, 0.6);
  --gold: #ffdd82;
  --green: #2e9e4f;
  --red: #e5484d;
  --blue: #3a6ea5;
  --radius: 14px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: radial-gradient(1200px 700px at 50% -10%, #1a2540 0%, var(--bg) 60%);
  color: var(--text);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 1080px;
  margin: 0 auto;
  padding: max(14px, var(--sait)) max(16px, var(--sair)) max(28px, var(--saib)) max(16px, var(--sail));
}

/* Бързото натискане на телефон не бива да приближава страницата или да маркира текст. */
button,
.input,
select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button {
  user-select: none;
  -webkit-user-select: none;
}

.splash {
  display: grid;
  place-items: center;
  min-height: 70vh;
  text-align: center;
  gap: 4px;
}

.splash h1 {
  margin: 0;
  font-size: 28px;
  color: var(--gold);
}

.splash p {
  margin: 0;
  color: var(--muted);
}

.banner {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: #5b3a10;
  color: #ffe2a6;
  text-align: center;
  font-size: 14px;
}

.banner[hidden] {
  display: none;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--gold);
}

.who {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.avatar {
  border-radius: 50%;
}

.who .name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.balance {
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.game-menu {
  position: relative;
  margin-bottom: 12px;
}

.menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid rgba(255, 221, 130, 0.45);
  border-radius: 12px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.menu-title {
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(255, 221, 130, 0.18);
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.12em;
}

.menu-current {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-arrow {
  color: var(--gold);
  transition: transform 0.15s;
}

.game-menu.open .menu-arrow {
  transform: rotate(180deg);
}

.menu-list {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 6px;
  max-height: min(70vh, 420px);
  overflow-y: auto;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.5);
}

.menu-list[hidden] {
  display: none;
}

.menu-item {
  padding: 12px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}

.menu-item:hover,
.menu-item:focus-visible {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.menu-item.active {
  background: rgba(255, 221, 130, 0.14);
  color: var(--gold);
}

.game {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
}

.crash {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-areas:
    'stage side'
    'controls side';
  align-items: start;
}

.crash .stage {
  grid-area: stage;
}

.crash .controls {
  grid-area: controls;
}

.crash .side {
  grid-area: side;
}

.plinko {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  align-items: start;
}

.race {
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  grid-template-areas:
    'stage side'
    'controls side';
  align-items: start;
}

.race .stage {
  grid-area: stage;
}

.race .controls {
  grid-area: controls;
}

.race .side {
  grid-area: side;
}

.bj {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: start;
}

.stage.felt {
  background: radial-gradient(120% 90% at 50% 0%, #1f7a4d 0%, #0e4a30 60%, #0a3322 100%);
  border-color: rgba(255, 221, 130, 0.35);
  min-height: 330px;
}

.dealer {
  display: grid;
  gap: 6px;
  justify-items: center;
  margin-bottom: 16px;
}

.seats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.seat {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.seat.me {
  border-color: rgba(255, 221, 130, 0.6);
}

.seat.active {
  box-shadow: 0 0 0 2px var(--gold);
}

.seat.won {
  background: rgba(46, 158, 79, 0.28);
}

.seat.lost {
  background: rgba(229, 72, 77, 0.2);
}

.seat-head,
.seat-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
}

.seat-head .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.seat-head .total {
  min-width: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--gold);
  font-weight: 800;
  text-align: center;
}

.seat-head .total:empty {
  display: none;
}

.seat-foot {
  color: var(--muted);
}

.badge {
  color: var(--text);
  font-weight: 700;
}

.hand {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 62px;
}

.dealer .hand {
  justify-content: center;
}

.card {
  display: grid;
  align-content: center;
  justify-items: center;
  width: 42px;
  height: 60px;
  border-radius: 7px;
  background: #fbfbf7;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  font-weight: 800;
  line-height: 1.05;
}

.card.red {
  color: #c62828;
}

.card.black {
  color: #1b1b1f;
}

.card .rank {
  font-size: 17px;
}

.card .suit {
  font-size: 16px;
}

.card.back {
  background: repeating-linear-gradient(45deg, #7a1f2b 0 5px, #5c1520 5px 10px);
  border: 3px solid #fbfbf7;
}

.play-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.play-row[hidden],
.action[hidden] {
  display: none;
}

.play-row .action {
  padding: 12px 4px;
  font-size: 15px;
}

.action.secondary {
  background: linear-gradient(180deg, #8a93a6, #656e82);
}

.timer {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
}

.timer-track {
  height: 5px;
  margin-top: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.timer-bar {
  height: 100%;
  background: var(--gold);
  transition: width 0.2s linear;
}

.slots {
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr);
  align-items: start;
}

.slots-canvas {
  display: block;
  width: 100%;
  border-radius: 10px;
}

.jackpot-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.jackpot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 2px solid var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.35);
  font-size: 12px;
}

.jackpot .j-name {
  font-weight: 800;
  opacity: 0.9;
}

.jackpot .j-amount {
  font-weight: 800;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.jackpot.mega {
  grid-column: 1 / -1;
  border-color: #7df9ff;
  background: linear-gradient(90deg, rgba(125, 249, 255, 0.18), rgba(224, 64, 251, 0.18));
}

.jackpot.won {
  background: var(--gold);
  color: #1b1b1f;
}

.stake-row {
  align-items: stretch;
}

.stake-label {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  font-weight: 700;
  font-size: 14px;
  text-align: center;
}

.segments.wrap {
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.segments.wrap .seg {
  flex: 1 1 28%;
}

.free-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px;
  border: 1px solid rgba(255, 221, 130, 0.5);
  border-radius: 10px;
  background: rgba(201, 154, 46, 0.18);
  font-size: 13px;
}

.free-box[hidden] {
  display: none;
}

.expand-badge {
  width: 36px;
  height: 36px;
}

.slots-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
}

.rules {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.rules summary {
  cursor: pointer;
  color: var(--text);
  font-weight: 600;
}

.rules p {
  margin: 6px 0 0;
  line-height: 1.4;
}

.race-canvas {
  display: block;
  width: 100%;
  height: 300px;
}

.runner-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.runner-pick {
  display: grid;
  gap: 2px;
  justify-items: center;
  padding: 8px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.runner-pick .emoji {
  font-size: 24px;
  line-height: 1.1;
}

.runner-pick .runner-name {
  font-size: 11px;
  color: var(--muted);
}

.runner-pick .runner-odds {
  font-size: 13px;
  font-weight: 800;
  color: var(--gold);
}

.runner-pick.active {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px var(--gold);
}

.runner-pick:disabled {
  opacity: 0.7;
  cursor: default;
}

.stage,
.controls,
.side {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.crash-canvas,
.plinko-canvas {
  display: block;
  width: 100%;
}

.crash-canvas {
  height: 300px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 8px;
}

.chip {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.chip.high {
  background: rgba(46, 158, 79, 0.2);
  color: #7be0a0;
}

.chip.low {
  background: rgba(229, 72, 77, 0.18);
  color: #ff9a9d;
}

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
}

.input-row {
  display: flex;
  gap: 6px;
}

.input {
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.input:focus-visible,
.action:focus-visible,
.mini:focus-visible,
.seg:focus-visible,
.menu-toggle:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.mini {
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.segments {
  display: flex;
  gap: 6px;
}

.seg {
  flex: 1;
  padding: 9px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--muted);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.seg.active {
  color: #1b1b1f;
  background: var(--gold);
  border-color: var(--gold);
}

.action {
  width: 100%;
  padding: 14px 12px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #4a87d4, #3a6ea5);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.action.cash {
  background: linear-gradient(180deg, #3bbf64, #2e9e4f);
  animation: pulse 0.9s ease-in-out infinite;
}

.action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  animation: none;
}

@keyframes pulse {
  50% {
    transform: scale(1.015);
  }
}

.hint {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.side h3 {
  margin: 0 0 10px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}

.players {
  display: grid;
  gap: 6px;
  max-height: 420px;
  overflow: auto;
}

.player {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--panel-2);
  font-size: 14px;
}

.player.me {
  border: 1px solid rgba(255, 221, 130, 0.45);
}

.player.won .result {
  color: #7be0a0;
}

.player.lost .result {
  color: #ff9a9d;
}

.player .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.player .result {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.toasts {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 10;
  display: grid;
  gap: 8px;
  max-width: min(360px, calc(100vw - 28px));
}

.toast {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  font-size: 14px;
  animation: rise 0.2s ease-out;
}

.toast.win {
  border-color: rgba(255, 221, 130, 0.6);
  color: var(--gold);
}

.toast.error {
  border-color: rgba(229, 72, 77, 0.6);
  color: #ffb0b3;
}

@keyframes rise {
  from {
    transform: translateY(8px);
    opacity: 0;
  }
}

@media (max-width: 820px) {
  .crash,
  .plinko,
  .race,
  .bj,
  .slots {
    grid-template-columns: 1fr;
  }

  .race {
    grid-template-areas:
      'stage'
      'controls'
      'side';
  }

  .race-canvas {
    height: 270px;
  }

  .crash {
    grid-template-areas:
      'stage'
      'controls'
      'side';
  }

  .crash-canvas {
    height: 240px;
  }

  .who .name {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .action.cash,
  .toast {
    animation: none;
  }
}

/* ───────── Casino Hold'em ───────── */

.holdem .stage {
  position: relative;
  display: grid;
  gap: 14px;
  justify-items: center;
  align-content: center;
}

.holdem .hand {
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  min-height: 84px;
}

.holdem .card {
  width: 56px;
  height: 80px;
  border-radius: 9px;
  transform-origin: center;
}

.holdem .card .rank {
  font-size: 22px;
}

.holdem .card .suit {
  font-size: 21px;
}

.holdem .card.slot {
  background: rgba(0, 0, 0, 0.18);
  border: 2px dashed rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.holdem-board {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 10px 14px 12px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 221, 130, 0.25);
}

.holdem-caption {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.holdem .card.deal {
  animation: card-deal 0.38s cubic-bezier(0.2, 0.8, 0.2, 1) backwards;
}

.holdem .card.flip {
  animation: card-flip 0.42s ease-out;
}

@keyframes card-deal {
  from {
    opacity: 0;
    transform: translateY(-46px) rotate(-8deg) scale(0.8);
  }
}

@keyframes card-flip {
  0% {
    transform: perspective(500px) rotateY(90deg) scale(1.08);
  }
  100% {
    transform: perspective(500px) rotateY(0) scale(1);
  }
}

.holdem-result {
  max-width: 100%;
  padding: 12px 20px;
  border: 2px solid var(--gold);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.82);
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  animation: result-pop 0.35s cubic-bezier(0.2, 1.2, 0.3, 1);
}

.holdem-result[hidden] {
  display: block;
  visibility: hidden;
}

.field[hidden] {
  display: none;
}

.holdem-result.lose {
  border-color: var(--red);
  color: #ff9a9d;
}

.holdem-result.push {
  border-color: #8a93a6;
  color: var(--text);
}

@keyframes result-pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
}

.play-row.two {
  grid-template-columns: 1.4fr 1fr;
}

@media (max-width: 520px) {
  .holdem .card {
    width: 46px;
    height: 66px;
  }

  .holdem .card .rank {
    font-size: 18px;
  }

  .holdem .card .suit {
    font-size: 17px;
  }

  .holdem .hand {
    min-height: 70px;
    gap: 5px;
  }

  .holdem-result {
    font-size: 15px;
  }
}

/* ───────── Последни залози ───────── */

.bet-history {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.bet-history h3 {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 700;
}

.bet-history-list {
  display: grid;
  gap: 3px;
}

.bet-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: 10px;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 13px;
  background: rgba(255, 255, 255, 0.03);
}

.bet-time {
  color: var(--muted);
}

.bet-net {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.bet-row.win .bet-net {
  color: #5fd68a;
}

.bet-row.lose .bet-net {
  color: #ff7a7e;
}

.bet-row.even .bet-net {
  color: var(--muted);
}

.bet-empty {
  color: var(--muted);
  font-size: 13px;
}

/* ───────── Рулетка ───────── */

.roulette {
  grid-template-columns: 1fr;
  align-items: start;
}

.rl-top {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.rl-wheel-card,
.rl-side,
.rl-board > * {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.rl-board {
  display: grid;
  gap: 12px;
  background: none;
  border: 0;
  padding: 0;
}

.rl-board > .rl-table-wrap {
  padding: 8px;
  background: linear-gradient(180deg, #2b1a0d, #1a0f07);
  border-color: rgba(255, 221, 130, 0.35);
}

.rl-wheel-card {
  display: grid;
  gap: 8px;
  justify-items: center;
  background: radial-gradient(120% 90% at 50% 0%, #1d2a44 0%, var(--panel) 70%);
}

.rl-wheel {
  display: block;
  width: 100%;
  max-width: 416px;
  aspect-ratio: 1;
  height: auto;
}

.rl-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.rl-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.rl-pill.betting {
  background: rgba(46, 158, 79, 0.22);
  color: #7be0a0;
}

.rl-pill.spinning {
  background: rgba(255, 221, 130, 0.16);
  color: var(--gold);
}

.rl-timer {
  color: var(--gold);
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.rl-bar {
  width: 100%;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.rl-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #2e9e4f, #8be0a6);
  transition: width 0.12s linear;
}

.rl-bar i.spinning {
  background: linear-gradient(90deg, #d89a1f, #ffdd82);
}

.rl-bar i.results {
  background: linear-gradient(90deg, #3a6ea5, #8fb8e8);
}

.rl-outcome {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 92px;
  width: 100%;
  padding: 8px;
  border-radius: 12px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s;
}

.rl-outcome.show {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.rl-outcome.won {
  background: rgba(46, 158, 79, 0.2);
  box-shadow: 0 0 0 1px rgba(46, 158, 79, 0.5), 0 0 22px rgba(255, 221, 130, 0.25);
}

.rl-outcome.lost {
  background: rgba(229, 72, 77, 0.12);
}

.rl-result-number {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
}

.rl-facts {
  color: var(--muted);
  font-size: 13px;
}

.rl-net {
  font-size: 18px;
  font-weight: 800;
}

.rl-outcome.won .rl-net {
  color: #7be0a0;
}

.rl-outcome.lost .rl-net {
  color: #ff9a9d;
}

.rl-num {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.rl-num.small {
  min-width: 26px;
  height: 26px;
  font-size: 12px;
}

.rl-num.red {
  background: #c9302c;
}

.rl-num.black {
  background: #17191f;
}

.rl-num.green {
  background: #1b8a4b;
}

.rl-num.latest {
  box-shadow: 0 0 0 3px rgba(255, 221, 130, 0.65);
}

.rl-history {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.rl-stats {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.rl-stat-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.rl-label {
  min-width: 82px;
  color: var(--muted);
  font-size: 13px;
}

.rl-split {
  display: flex;
  overflow: hidden;
  height: 20px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  font-style: normal;
}

.rl-split i {
  display: grid;
  place-items: center;
  font-style: normal;
}

.rl-split .red {
  background: #c9302c;
}

.rl-split .black {
  background: #17191f;
}

.rl-split .green {
  background: #1b8a4b;
}

.rl-table,
.rl-race {
  display: block;
  width: 100%;
  touch-action: manipulation;
}

.rl-controls {
  display: grid;
  gap: 10px;
}

.rl-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rl-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 4px dashed rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  background: var(--chip);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.45), inset 0 0 0 3px rgba(255, 255, 255, 0.18);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s;
}

.rl-chip:hover:not(:disabled) {
  transform: translateY(-2px);
}

.rl-chip.active {
  transform: translateY(-5px) scale(1.08);
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.45), 0 0 0 3px var(--gold), 0 0 18px rgba(255, 221, 130, 0.55);
}

.rl-chip:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.rl-chip.dim:not(.active) {
  opacity: 0.7;
}

.rl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini.wide {
  min-height: 38px;
}

.mini:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.mini.active,
.mini.toggle.active {
  background: rgba(255, 221, 130, 0.18);
  border-color: var(--gold);
  color: var(--gold);
}

.rl-totals {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.rl-race-box h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.rl-neighbors {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 6px;
}

.rl-neighbors .mini {
  min-width: 38px;
  min-height: 34px;
  padding: 0 8px;
}

.rl-specials {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.rl-special {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.rl-special:hover:not(:disabled),
.rl-special:focus-visible {
  border-color: var(--gold);
  background: rgba(255, 221, 130, 0.1);
}

.rl-special span {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 820px) {
  /* На телефон масата е веднага под колелото, а статистиката и играчите — след нея. */
  .rl-top {
    display: contents;
  }

  .rl-wheel-card {
    order: 1;
  }

  .rl-board {
    order: 2;
  }

  .rl-side {
    order: 3;
  }

  .roulette > .bet-history {
    order: 4;
  }

  .rl-outcome {
    min-height: 76px;
  }

  .rl-chip {
    width: 46px;
    height: 46px;
    font-size: 12px;
  }
}

@media (max-width: 520px) {
  .rl-chips {
    gap: 6px;
  }

  .rl-chip {
    width: 40px;
    height: 40px;
    border-width: 3px;
    font-size: 11px;
  }

  .rl-actions .mini.wide {
    flex: 1 1 calc(33% - 6px);
    padding: 0 6px;
    font-size: 13px;
  }
}

/* ───────── Кристален каскад ───────── */

.cascade {
  grid-template-columns: 1fr;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
}

.cs-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(155, 107, 255, 0.45);
  border-radius: var(--radius);
  background: #0c0626;
  box-shadow: 0 0 30px rgba(120, 70, 220, 0.25);
}

.cascade.free-mode .cs-stage {
  border-color: rgba(255, 184, 74, 0.7);
  box-shadow: 0 0 34px rgba(255, 150, 40, 0.35);
}

.cs-canvas {
  display: block;
  width: 100%;
  touch-action: manipulation;
}

.cs-win {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%) scale(0.9);
  padding: 6px 18px;
  border-radius: 999px;
  background: rgba(10, 5, 30, 0.82);
  border: 1px solid rgba(255, 221, 130, 0.5);
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
}

.cs-win:not(:empty) {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.cs-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.cs-bet {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.cs-bet-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.cs-bet-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cs-bet-row .mini {
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 20px;
}

.cs-stake-value {
  min-width: 82px;
  color: var(--gold);
  font-size: 18px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.cs-spin {
  display: grid;
  place-items: center;
  gap: 0;
  width: 112px;
  height: 112px;
  border: 4px solid #ffe08a;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b98cff 0%, #6a3ee0 55%, #3b1c99 100%);
  box-shadow: 0 6px 0 #25106a, 0 0 26px rgba(140, 90, 255, 0.6);
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.cs-spin:hover:not(:disabled) {
  transform: translateY(-2px);
}

.cs-spin:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #25106a, 0 0 18px rgba(140, 90, 255, 0.6);
}

.cs-spin.free {
  background: radial-gradient(circle at 35% 30%, #ffd98a 0%, #f08a1f 55%, #a14400 100%);
  box-shadow: 0 6px 0 #5e2a00, 0 0 26px rgba(255, 150, 40, 0.65);
}

.cs-spin.busy {
  filter: saturate(0.7);
}

.cs-spin-icon {
  font-size: 40px;
  line-height: 0.9;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.cs-spin.busy .cs-spin-icon {
  animation: cs-turn 0.9s linear infinite;
}

.cs-spin-text {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

@keyframes cs-turn {
  to {
    transform: rotate(360deg);
  }
}

.cs-side-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.cs-side-buttons .mini,
.cs-auto {
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
}

.cs-auto {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.cs-info {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow-y: auto;
  padding: 16px;
  background: rgba(8, 4, 24, 0.96);
}

.cs-info[hidden] {
  display: none;
}

.cs-info h3 {
  margin: 0 0 8px;
  color: var(--gold);
}

.cs-info ul {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.cs-pay {
  display: grid;
  gap: 4px;
  margin-bottom: 10px;
}

.cs-pay-row {
  display: grid;
  grid-template-columns: 40px minmax(90px, 1fr) repeat(3, auto);
  align-items: center;
  gap: 10px;
  padding: 3px 8px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.cs-pay-row.scatter {
  margin-bottom: 12px;
  background: rgba(255, 210, 74, 0.1);
}

@media (max-width: 520px) {
  .cs-controls {
    grid-template-columns: 1fr auto;
  }

  .cs-side-buttons {
    grid-column: 1 / -1;
    justify-content: center;
  }

  .cs-spin {
    width: 96px;
    height: 96px;
  }

  .cs-pay-row {
    grid-template-columns: 34px 1fr;
  }

  .cs-pay-row span {
    grid-column: 2;
    font-size: 12px;
  }

  .cs-win {
    font-size: 16px;
  }
}

/* ───────── Слотове с линии: джакпоти, гейбъл, карти ───────── */

.lineslot .cs-stage {
  border-color: rgba(255, 190, 90, 0.5);
}

.jp-ladder {
  display: grid;
  gap: 6px;
}

.jp-mega {
  padding: 5px 10px;
  border: 1px solid rgba(120, 200, 255, 0.5);
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(40, 90, 200, 0.35), rgba(120, 60, 220, 0.35));
  color: #cfe9ff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.jp-mega[hidden] {
  display: none;
}

.jp-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.jp-tile {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  font-variant-numeric: tabular-nums;
}

.jp-tile strong {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 14px;
}

.jp-name {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.jp-suit {
  font-size: 18px;
  line-height: 1;
}

.jp-suit.red,
.gb-front.red,
.jc-front.red,
.gb-mini.red,
.jc-count.red {
  color: #ff4a5a;
}

.jp-suit.black,
.gb-front.black,
.jc-front.black,
.gb-mini.black,
.jc-count.black {
  color: #e8e6f0;
}

.jp-grand {
  border-color: rgba(255, 90, 90, 0.6);
}

.jp-major {
  border-color: rgba(255, 150, 60, 0.55);
}

.jp-minor {
  border-color: rgba(170, 110, 255, 0.55);
}

.jp-mini {
  border-color: rgba(90, 180, 255, 0.55);
}

.jp-tile.hit {
  animation: jp-hit 0.5s ease-in-out infinite alternate;
}

@keyframes jp-hit {
  from {
    box-shadow: 0 0 0 rgba(255, 221, 130, 0);
    background: var(--panel);
  }

  to {
    box-shadow: 0 0 22px rgba(255, 221, 130, 0.9);
    background: rgba(255, 221, 130, 0.22);
  }
}

.gb-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(255, 221, 130, 0.5);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #2a0f14, #14090c);
}

.gb-panel[hidden] {
  display: none;
}

.gb-info {
  color: var(--gold);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.gb-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.gb-card {
  width: 84px;
  height: 120px;
  perspective: 700px;
}

.gb-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.7s;
}

.gb-card.flipped .gb-inner {
  transform: rotateY(180deg);
}

.gb-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 10px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: 46px;
}

.gb-back {
  background: repeating-linear-gradient(45deg, #8a1c1c 0 8px, #c93a3a 8px 16px);
  color: rgba(255, 255, 255, 0.85);
  font-size: 18px;
}

.gb-front {
  background: #fff;
  transform: rotateY(180deg);
}

.gb-card.win .gb-inner {
  filter: drop-shadow(0 0 14px rgba(80, 255, 140, 0.9));
}

.gb-card.lose .gb-inner {
  filter: drop-shadow(0 0 14px rgba(255, 70, 70, 0.9));
}

.gb-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.gb-button {
  min-width: 112px;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  border-radius: 12px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.gb-button.red {
  background: linear-gradient(180deg, #ff5a6a, #b01427);
}

.gb-button.black {
  background: linear-gradient(180deg, #4a4a58, #14141c);
}

.gb-button.take {
  background: linear-gradient(180deg, #4cc88a, #1b7a4c);
}

.gb-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

.gb-note {
  color: var(--muted);
  font-size: 13px;
}

.gb-history {
  display: flex;
  gap: 6px;
}

.gb-mini {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: #fff3;
  font-size: 16px;
}

.jc-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  background: radial-gradient(circle at 50% 30%, #3a1850, #0a0412);
  animation: rise 0.3s ease-out;
  transition: opacity 0.4s;
}

.jc-overlay.out {
  opacity: 0;
}

.jc-overlay h3 {
  margin: 0;
  color: var(--gold);
  text-align: center;
  letter-spacing: 0.06em;
}

.jc-bar {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 15px;
  font-weight: 800;
}

.jc-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.jc-card {
  aspect-ratio: 0.72;
  padding: 0;
  border: 0;
  background: none;
  perspective: 600px;
  cursor: pointer;
}

.jc-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s;
}

.jc-card.open .jc-inner {
  transform: rotateY(180deg);
}

.jc-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 2px solid #ffdd82;
  border-radius: 8px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  font-size: 34px;
}

.jc-back {
  background: repeating-linear-gradient(45deg, #5a1a8a 0 7px, #8a3ad0 7px 14px);
  color: #ffdd82;
}

.jc-front {
  background: #fff;
  transform: rotateY(180deg);
}

.jc-status {
  min-height: 28px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.jc-overlay.won .jc-status {
  color: var(--gold);
  font-size: 22px;
  animation: jp-hit 0.5s ease-in-out infinite alternate;
}

/* ───────── 20 Super Hot и Flaming Hot Bell Link (подредба като в оригиналните автомати) ───────── */

.egt {
  gap: 8px;
  max-width: 820px;
  margin: 0 auto;
  width: 100%;
}

.egt-jp-wrap {
  display: grid;
  gap: 6px;
}

.egt-jp {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.egt-jp.suits {
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(0, 1.5fr) repeat(2, minmax(0, 1fr));
}

.egt-jp-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px;
  border: 2px solid #b8862e;
  border-radius: 8px;
  background: linear-gradient(180deg, #1a1218, #07050a);
  box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.8);
  font-variant-numeric: tabular-nums;
}

.egt-jp.names .egt-jp-box {
  flex-direction: column;
  gap: 0;
  padding: 3px 8px 5px;
}

.egt-jp-box strong {
  color: #fff;
  font-size: 15px;
  letter-spacing: 0.02em;
}

.egt-jp-box .jp-name {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.egt-jp-box .jp-grand {
  color: #ff4a4a;
}

.egt-jp-box .jp-major {
  color: #3fdc5a;
}

.egt-jp-box .jp-minor {
  color: #4aa8ff;
}

.egt-jp-box .jp-mini {
  color: #c06bff;
}

.egt-jp-box .jp-suit {
  font-size: 22px;
  line-height: 1;
}

.egt-jp-box.jp-box-grand {
  border-color: #c03030;
}

.egt-jp-box.jp-box-major {
  border-color: #2c9c46;
}

.egt-jp-box.jp-box-minor {
  border-color: #2f78c8;
}

.egt-jp-box.jp-box-mini {
  border-color: #8a46c8;
}

.egt-jp-box.hit {
  animation: jp-hit 0.5s ease-in-out infinite alternate;
}

.egt-title {
  display: grid;
  place-items: center;
  color: #ffd24a;
  font-size: clamp(14px, 3.4vw, 26px);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-align: center;
  text-shadow: 0 2px 0 #7a0a0a, 0 0 12px rgba(255, 70, 40, 0.8);
}

.egt-stage {
  position: relative;
  overflow: hidden;
  border: 3px solid #5a1010;
  border-radius: 10px;
  background: #160307;
  box-shadow: 0 0 0 2px #b8862e, 0 8px 28px rgba(0, 0, 0, 0.6);
}

.egt-stage canvas {
  display: block;
  width: 100%;
  touch-action: manipulation;
}

.egt-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  padding: 3px 7px;
  border: 1px solid #b8862e;
  border-radius: 6px;
  background: rgba(10, 24, 80, 0.9);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  pointer-events: none;
}

.egt-bell .egt-badge {
  background: rgba(70, 20, 6, 0.92);
}

.egt-bar {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 2px solid #5a1010;
  border-radius: 10px;
  background: linear-gradient(180deg, #1c0a0c, #090304);
}

.egt-meter {
  display: grid;
  gap: 2px;
  min-width: 78px;
  text-align: center;
}

.egt-meter span {
  color: #ffd24a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.egt-meter strong {
  color: #fff;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.egt-meter.lit strong {
  color: #ffe58a;
  text-shadow: 0 0 10px rgba(255, 210, 74, 0.9);
}

.egt-bets {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
}

.egt-bet {
  display: grid;
  gap: 0;
  min-width: 58px;
  padding: 4px 8px;
  border: 1px solid #5a5a68;
  border-radius: 6px;
  background: linear-gradient(180deg, #4a4a56, #1c1c24);
  color: #fff;
  font: inherit;
  cursor: pointer;
}

.egt-bet small {
  color: #aaa;
  font-size: 8px;
  letter-spacing: 0.1em;
}

.egt-bet b {
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.egt-bet.active {
  border-color: #8aff8a;
  background: linear-gradient(180deg, #5cc24a, #2a7a22);
  box-shadow: 0 0 10px rgba(110, 255, 110, 0.5);
}

.egt-bet:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.egt-bet[hidden] {
  display: none;
}

.egt-spin-box {
  display: grid;
  justify-items: center;
  gap: 2px;
}

.egt-spin {
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  padding: 0;
  border: 4px solid #e8c36a;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #3a3a46, #0c0c12);
  box-shadow: 0 4px 0 #3a2a08, 0 0 18px rgba(255, 210, 90, 0.35);
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s;
}

.egt-spin:hover {
  transform: translateY(-2px);
}

.egt-spin:active {
  transform: translateY(2px);
}

.egt-spin.busy svg {
  animation: cs-turn 0.9s linear infinite;
}

.egt-spin-caption {
  color: #ffd24a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.egt-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}

.egt-gamble {
  margin-right: auto;
  padding: 10px 22px;
  border: 2px solid #fff3b0;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffd24a, #d98a00);
  color: #3a1800;
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.08em;
  cursor: pointer;
  animation: jp-hit 0.6s ease-in-out infinite alternate;
}

.egt-gamble[hidden] {
  display: none;
}

/* Екранът на гейбъла: карта върху подиум под прожектори, като в оригинала. */
.gs-screen {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  justify-items: center;
  gap: 6px;
  padding: 10px;
  background: radial-gradient(ellipse at 20% 0%, rgba(255, 190, 90, 0.5), transparent 45%), radial-gradient(ellipse at 80% 0%, rgba(255, 190, 90, 0.5), transparent 45%), radial-gradient(ellipse at 50% 100%, #7a3a08, #240e04 70%);
}

.gs-screen[hidden] {
  display: none;
}

.gs-title {
  color: #ffd24a;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.gs-history {
  display: flex;
  gap: 6px;
}

.gs-mini {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 40px;
  border: 1px solid #fff;
  border-radius: 4px;
  background: #fff;
  font-size: 20px;
}

.gs-mini.empty {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.gs-mini.red,
.gs-front.red {
  color: #d41a2a;
}

.gs-mini.black,
.gs-front.black {
  color: #14141c;
}

.gs-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 190px;
}

.gs-card {
  position: relative;
  z-index: 2;
  width: 118px;
  height: 168px;
  perspective: 900px;
}

.gs-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.85s;
}

.gs-card.flipped .gs-inner {
  transform: rotateY(180deg);
}

.gs-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 12px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.gs-back {
  background: repeating-linear-gradient(45deg, #8a1010 0 9px, #c42a2a 9px 18px);
  color: rgba(255, 255, 255, 0.85);
  font-size: 40px;
}

.gs-front {
  background: #fff;
  transform: rotateY(180deg);
}

.gs-center {
  font-size: 84px;
  line-height: 1;
}

.gs-corner {
  position: absolute;
  font-size: 24px;
  line-height: 1;
}

.gs-corner.top {
  left: 8px;
  top: 6px;
}

.gs-corner.bottom {
  right: 8px;
  bottom: 6px;
  transform: rotate(180deg);
}

.gs-card.win {
  filter: drop-shadow(0 0 18px rgba(255, 230, 120, 0.95));
}

.gs-card.lose {
  filter: drop-shadow(0 0 14px rgba(255, 60, 60, 0.9)) grayscale(0.4);
}

.gs-podium {
  position: absolute;
  bottom: 4px;
  width: 210px;
  height: 46px;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 30%, #ffe08a, #b8741a 60%, #5a3208);
  box-shadow: 0 8px 0 #3a1e04, 0 0 24px rgba(255, 190, 80, 0.7);
}

.gs-banner {
  position: absolute;
  z-index: 3;
  bottom: 2px;
  color: #ffd24a;
  font-size: 40px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-shadow: 0 3px 0 #7a3a00, 0 0 18px rgba(255, 200, 60, 0.95);
  opacity: 0;
  transform: scale(0.4);
  pointer-events: none;
}

.gs-banner.show {
  animation: gs-pop 0.5s ease-out forwards;
}

.gs-banner.lose {
  color: #ff6a6a;
  text-shadow: 0 3px 0 #5a0a0a, 0 0 18px rgba(255, 60, 60, 0.9);
}

@keyframes gs-pop {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gs-info {
  display: flex;
  gap: 22px;
  color: #ffe9b8;
  text-align: center;
}

.gs-info div {
  display: grid;
  gap: 1px;
}

.gs-info strong {
  color: #fff;
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.gs-info span {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.gs-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.gs-button {
  min-width: 118px;
  padding: 12px 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 900;
  cursor: pointer;
}

.gs-button.red {
  background: linear-gradient(180deg, #ff5a6a, #a01022);
}

.gs-button.black {
  background: linear-gradient(180deg, #55556a, #14141c);
}

.gs-button.take {
  background: linear-gradient(180deg, #5cc24a, #2a7a22);
}

.gs-button:disabled {
  opacity: 0.5;
  cursor: wait;
}

@media (max-width: 560px) {
  .egt-bar {
    grid-template-columns: 1fr auto;
  }

  .egt-bar .egt-bets {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .egt-meter {
    min-width: 0;
  }

  .egt-spin {
    width: 66px;
    height: 66px;
  }

  .egt-jp-box strong {
    font-size: 12px;
  }

  .egt-jp.suits {
    grid-template-columns: repeat(2, minmax(0, 1fr)) repeat(2, minmax(0, 1fr));
  }

  .egt-jp.suits .egt-title {
    display: none;
  }
}

/* Простото меню за залози и линиите */
.egt-betbox {
  display: grid;
  gap: 3px;
  justify-items: center;
}

.egt-cap {
  color: #ffd24a;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.egt-stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.egt-stepper b {
  min-width: 82px;
  padding: 6px 8px;
  border: 1px solid #5a5a68;
  border-radius: 8px;
  background: #07050a;
  color: #fff;
  font-size: 17px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.egt-step {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 2px solid #e8c36a;
  border-radius: 50%;
  background: linear-gradient(180deg, #4a4a56, #1c1c24);
  color: #fff;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.egt-step:disabled,
.egt-max:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.egt-max {
  padding: 8px 10px;
  border: 2px solid #e8c36a;
  border-radius: 8px;
  background: linear-gradient(180deg, #d98a00, #8a5200);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.egt-betbox small {
  color: rgba(255, 233, 184, 0.75);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.egt-winline {
  min-height: 22px;
  color: #ffe9b8;
  font-size: 14px;
  font-weight: 800;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.egt-winline.on {
  color: #ffd24a;
  text-shadow: 0 0 10px rgba(255, 190, 60, 0.7);
}

.egt-diagrams {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.egt-diagram {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.egt-diagram b {
  min-width: 18px;
  color: #ffd24a;
  font-size: 12px;
  text-align: center;
}

.egt-diagram-note {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 560px) {
  .egt-stepper b {
    min-width: 70px;
    font-size: 15px;
  }
}

/* ───────── Neon 20 ───────── */
.egt-neon .egt-stage {
  border-color: #3a0f7a;
  background: #08011f;
  box-shadow: 0 0 0 2px #ff4fd8, 0 0 28px rgba(255, 79, 216, 0.45), 0 8px 28px rgba(0, 0, 0, 0.6);
}

.egt-neon .egt-badge {
  border-color: #ff4fd8;
  background: rgba(30, 6, 80, 0.92);
  color: #ffd2f6;
}

.egt-neon .egt-bar {
  border-color: #4a1a9a;
  background: linear-gradient(180deg, #1c0a4a, #0a0222);
  box-shadow: 0 0 18px rgba(120, 60, 255, 0.35);
}

.egt-neon .egt-jp-box {
  border-color: #6a3ae0;
  background: linear-gradient(180deg, #1a0a48, #0a0226);
}

.egt-neon .egt-meter span,
.egt-neon .egt-cap,
.egt-neon .egt-spin-caption {
  color: #ff9bec;
}

.egt-neon .egt-spin {
  border-color: #ff4fd8;
  background: radial-gradient(circle at 35% 30%, #a43ae0, #3a0f7a);
  box-shadow: 0 4px 0 #1a0640, 0 0 22px rgba(255, 79, 216, 0.6);
}

.egt-neon .egt-step,
.egt-neon .egt-max {
  border-color: #ff4fd8;
}

.egt-neon .egt-max {
  background: linear-gradient(180deg, #d83ac8, #7a1a9a);
}

.egt-neon .egt-stepper b {
  border-color: #6a3ae0;
  background: #0a0226;
}

.egt-neon .egt-winline.on {
  color: #ff9bec;
  text-shadow: 0 0 10px rgba(255, 79, 216, 0.8);
}


/* Гейбъл: прозорец върху цялата страница, червеното е отляво на картата, черното — отдясно. */
.gs-screen {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  grid-template-rows: none;
  align-content: center;
  padding: 12px;
  background: rgba(4, 2, 12, 0.82);
  overflow-y: auto;
}

.gs-panel {
  display: grid;
  gap: 12px;
  justify-items: center;
  width: min(100%, 560px);
  padding: 14px 12px 16px;
  border: 2px solid #e8c36a;
  border-radius: 16px;
  background: radial-gradient(ellipse at 50% 0%, #7a3a08, #240e04 70%);
  box-shadow: 0 0 40px rgba(255, 170, 60, 0.35);
}

.gs-table {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  width: 100%;
}

.gs-card {
  width: min(34vw, 150px);
  height: calc(min(34vw, 150px) * 1.42);
}

.gs-pick {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  min-height: 150px;
  padding: 10px 6px;
  border: 3px solid rgba(255, 255, 255, 0.7);
  border-radius: 16px;
  color: #fff;
  font: inherit;
  cursor: pointer;
  transition: transform 0.1s, filter 0.1s;
}

.gs-pick:hover:not(:disabled) {
  transform: translateY(-3px);
  filter: brightness(1.15);
}

.gs-pick.red {
  background: linear-gradient(180deg, #ff5a6a, #a01022);
}

.gs-pick.black {
  background: linear-gradient(180deg, #55556a, #14141c);
}

.gs-pick:disabled {
  opacity: 0.55;
  cursor: wait;
}

.gs-pick-suits {
  font-size: clamp(26px, 8vw, 40px);
  line-height: 1;
}

.gs-pick b {
  font-size: clamp(12px, 3.4vw, 16px);
  letter-spacing: 0.06em;
}

.gs-button.take {
  min-width: 200px;
}
