html {
  overflow-x: hidden;
}

body {
  width: 100%;
  overflow-x: hidden;
}

.page {
  margin-inline: auto;
}

.nav {
  width: fit-content;
  max-width: min(100%, 980px);
  margin-inline: auto;
  padding: 8px;
  gap: 8px !important;
  border: 1px solid rgba(255, 211, 77, 0.16);
  border-radius: 999px;
  background: rgba(5, 8, 18, 0.34);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 9px 16px !important;
  line-height: 1;
  white-space: nowrap;
}

.layout {
  width: 100%;
  margin-inline: auto;
}

.table,
.slot-cabinet,
.hero,
.panel,
.cardbox,
.display-card,
.stat,
.card,
.achievement {
  min-width: 0;
}

.value,
.display-value,
.balance,
.bet-amount {
  max-width: 100%;
  line-height: 1.08;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.value,
.display-value {
  font-size: clamp(1.15rem, 2.8vw, 1.65rem) !important;
}

.challenge .balance {
  font-size: clamp(1.55rem, 5vw, 3rem) !important;
}

.display-bank,
.info,
.status-grid,
.stats {
  align-items: stretch;
}

.display-bank {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr)) !important;
}

.machine-top {
  grid-template-columns: minmax(0, 1fr) minmax(160px, 190px) !important;
}

.side-panel,
.sidebar {
  min-width: 0;
}

.number-board {
  overflow: hidden;
}

@media (max-width: 980px) {
  body {
    align-items: flex-start !important;
  }

  .page {
    max-width: 760px !important;
  }

  .layout,
  .wheel-wrap,
  .machine-top,
  .panel-row {
    grid-template-columns: 1fr !important;
  }

  .side-panel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    padding: 12px !important;
  }

  .nav {
    width: 100%;
    border-radius: 24px;
  }

  .nav a {
    flex: 1 1 calc(50% - 8px);
    min-width: 118px;
    padding-inline: 12px !important;
    font-size: 0.88rem;
    letter-spacing: 0.03rem !important;
  }

  .table,
  .slot-cabinet,
  .hero {
    border-width: 4px !important;
    border-radius: 24px !important;
    padding: 16px !important;
  }

  .header h1,
  h1 {
    font-size: clamp(2rem, 11vw, 3rem) !important;
    line-height: 1.05;
    text-wrap: balance;
  }

  .status-grid,
  .info,
  .stats,
  .side,
  .side-panel {
    grid-template-columns: 1fr !important;
  }

  .controls,
  .actions,
  .quick-buttons,
  .color-controls,
  .bet-controls {
    justify-content: center;
  }
}

@media (max-width: 460px) {
  .nav a {
    flex-basis: 100%;
  }

  .display-bank {
    grid-template-columns: 1fr !important;
  }

  .number-board {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
