.bars-body .bars-game-panel {
  display: grid;
  gap: 1rem;
  overflow: hidden;
}

.bet-stepper {
  display: grid;
  grid-template-columns: 3.2rem minmax(0, 1fr) 3.2rem;
  gap: 0.45rem;
}

.bet-stepper input {
  min-width: 0;
}

.step-button {
  min-height: 2.7rem;
  border: 1px solid #335368;
  border-radius: 0.45rem;
  background: #102b38;
  color: #dcecf4;
  font-weight: 950;
  cursor: pointer;
}

.step-button:hover,
.step-button:focus-visible {
  border-color: #73cfff;
  background: #173849;
}

.selection-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.bars-stage-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem);
  gap: 1rem;
  align-items: stretch;
}

.bars-board-shell {
  position: relative;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0.9rem;
  min-height: 35rem;
  padding: 1rem;
  overflow: hidden;
  border-radius: 0.45rem;
  background:
    radial-gradient(circle at 52% 12%, rgba(255, 207, 61, 0.18), transparent 13rem),
    radial-gradient(circle at 78% 84%, rgba(34, 255, 120, 0.08), transparent 15rem),
    linear-gradient(180deg, #071c27, #081721);
}

.bars-board-shell::before {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border-radius: 0.45rem;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 4rem 4rem;
  pointer-events: none;
}

.bars-board-header,
.bars-total-strip {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.45rem;
  background: #102d3a;
  color: #c5dce7;
}

.bars-board-header > div {
  min-width: 0;
}

.bars-board-header strong,
.bars-total-strip strong {
  display: block;
  color: #f8fcff;
  overflow-wrap: anywhere;
}

.bars-total-strip strong {
  color: #1fed73;
  font-size: clamp(1.25rem, 3.4vw, 2rem);
}

.bars-grid {
  position: relative;
  z-index: 2;
  align-self: center;
  justify-self: center;
  display: grid;
  grid-template-columns: repeat(5, minmax(3.6rem, 1fr));
  gap: 0.55rem;
  width: min(100%, 40rem);
}

.bar-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1.34;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.4rem;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 34%),
    linear-gradient(180deg, #243f4e, #182f3b);
  color: #b8ced8;
  font-size: clamp(0.78rem, 1.3vw, 1rem);
  font-weight: 950;
  line-height: 1;
  box-shadow:
    inset 0 -0.28rem 0 rgba(0, 0, 0, 0.16),
    0 0.4rem 0.7rem rgba(0, 0, 0, 0.18);
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, color 0.12s ease;
}

.bar-cell::before {
  content: "";
  position: absolute;
  inset: 0.42rem 0.55rem auto;
  height: 0.38rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.bar-cell:hover,
.bar-cell:focus-visible {
  border-color: #74d6ff;
  transform: translateY(-0.08rem);
  outline: none;
}

.bar-cell.selected {
  border-color: #ffd84a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.14), transparent 32%),
    linear-gradient(180deg, #815f13, #4c3710);
  color: #fff6cc;
}

.bar-cell.revealed {
  color: #d8e6ec;
}

.bar-cell.revealed.low {
  color: #bdcdd5;
}

.bar-cell.revealed.mid {
  color: #27f471;
}

.bar-cell.revealed.high {
  color: #fff0a6;
}

.bar-cell.revealed.rare {
  color: #ffb7d0;
}

.bar-cell.revealed.legendary {
  color: #ffffff;
}

.bar-cell.selected.revealed {
  border-color: #18ff4f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.2), transparent 30%),
    linear-gradient(180deg, #00e938, #079524);
  color: #042711;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.22);
  animation: bar-pop 0.22s ease both;
}

.bar-cell.selected.revealed.high,
.bar-cell.selected.revealed.rare,
.bar-cell.selected.revealed.legendary {
  box-shadow:
    0 0 0 0.18rem rgba(255, 218, 71, 0.55),
    0 0 1.4rem rgba(31, 226, 118, 0.46),
    inset 0 -0.28rem 0 rgba(0, 0, 0, 0.14);
}

.bar-cell.running {
  animation: bar-flash 0.18s linear infinite;
}

.bar-cell .bar-index {
  position: absolute;
  left: 0.35rem;
  bottom: 0.28rem;
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.62rem;
  font-weight: 850;
}

.bar-payout-card {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 0.7rem;
  min-height: 35rem;
  padding: 0.85rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.45rem;
  background: #183441;
}

.bar-payout-header {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  align-items: baseline;
}

.bar-payout-header span {
  color: #a8c8d8;
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.bar-payout-columns,
.bar-payout-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.5rem;
  align-items: center;
}

.bar-payout-columns {
  color: #a8c8d8;
  font-size: 0.72rem;
  font-weight: 950;
}

.bar-payout-list {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  max-height: 31rem;
  overflow-y: auto;
  padding-right: 0.25rem;
}

.bar-payout-row {
  min-height: 2.1rem;
  padding: 0.35rem 0.45rem;
  border-radius: 0.35rem;
  background: #102a36;
}

.bar-payout-row .swatch {
  display: inline-block;
  width: 0.88rem;
  height: 0.88rem;
  margin-right: 0.4rem;
  border: 0.12rem solid currentColor;
  border-radius: 0.18rem;
  vertical-align: -0.12rem;
  background: var(--swatch, #4bd7ff);
}

.bar-payout-row strong,
.bar-payout-row span:last-child {
  overflow-wrap: anywhere;
}

.bars-result-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.mapping-panel {
  margin-block: 0.9rem;
}

.mapping-panel summary {
  color: #dff5ff;
  font-weight: 950;
  cursor: pointer;
}

.mapping-wrap {
  max-height: 24rem;
  margin-top: 0.6rem;
}

.mapping-wrap table {
  min-width: 42rem;
}

@keyframes bar-pop {
  from {
    transform: scale(0.94);
  }

  to {
    transform: scale(1);
  }
}

@keyframes bar-flash {
  0%,
  100% {
    filter: brightness(1);
  }

  50% {
    filter: brightness(1.5);
  }
}

@media (max-width: 1050px) {
  .bars-stage-grid {
    grid-template-columns: 1fr;
  }

  .bar-payout-card {
    min-height: 18rem;
  }
}

@media (max-width: 720px) {
  .bars-board-shell {
    min-height: 31rem;
    padding: 0.8rem;
  }

  .bars-board-header {
    display: grid;
  }

  .bars-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.38rem;
  }

  .bar-cell {
    min-height: 3.65rem;
    font-size: 0.76rem;
  }

  .bars-result-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .bars-board-shell {
    padding-inline: 0.6rem;
  }

  .bar-cell {
    min-height: 3.15rem;
    font-size: 0.7rem;
  }

  .selection-actions {
    grid-template-columns: 1fr;
  }
}
