html,
body {
  min-height: 100%;
}

.crash-page {
  width: 100%;
  min-height: calc(100vh - 90px);
  padding: 28px;
}

.crash-shell {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.crash-header {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(15, 23, 42, 0.86)),
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 38%);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 26px;
  padding: 24px;
  box-shadow:
    0 18px 60px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.crash-header h1 {
  color: #ffffff;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -3px;
  margin-bottom: 10px;
}

.crash-header p {
  max-width: 760px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.6;
}

.crash-wallets {
  min-width: 360px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.wallet-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 20px;
  padding: 18px;
}

.wallet-card span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 7px;
}

.wallet-card strong {
  color: #38bdf8;
  font-size: 28px;
  font-weight: 950;
  text-shadow: 0 0 26px rgba(56, 189, 248, 0.32);
}

.gems-wallet strong {
  color: #a78bfa;
  text-shadow: 0 0 26px rgba(167, 139, 250, 0.35);
}

.crash-game-card {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 16px;
  background:
    radial-gradient(circle at center, rgba(56, 189, 248, 0.12), transparent 34%),
    linear-gradient(135deg, rgba(17, 24, 39, 0.96), rgba(2, 6, 23, 0.92));
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 30px;
  padding: 18px;
  box-shadow:
    0 26px 90px rgba(0, 0, 0, 0.44),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.crash-game-card::before {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -160px;
  top: -170px;
  background: rgba(56, 189, 248, 0.18);
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

.crash-game-card::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  left: -160px;
  bottom: -170px;
  background: rgba(34, 197, 94, 0.11);
  border-radius: 999px;
  filter: blur(90px);
  pointer-events: none;
}

.crash-game-card > * {
  position: relative;
  z-index: 2;
}

.crash-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.round-status,
.current-bet-box,
.currency-toggle-btn {
  background: rgba(2, 6, 23, 0.48);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 16px;
  padding: 11px 14px;
}

.round-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  font-size: 14px;
}

.round-status span {
  width: 10px;
  height: 10px;
  background: #facc15;
  border-radius: 50%;
  box-shadow: 0 0 18px #facc15;
}

.round-status.running span {
  background: #38bdf8;
  box-shadow: 0 0 18px #38bdf8;
}

.round-status.won span {
  background: #22c55e;
  box-shadow: 0 0 18px #22c55e;
}

.round-status.crashed span {
  background: #ef4444;
  box-shadow: 0 0 18px #ef4444;
}

.bet-summary {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.currency-toggle-btn {
  color: #ffffff;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  transition: 0.2s ease;
  white-space: nowrap;
}

.currency-toggle-btn:hover {
  background: rgba(56, 189, 248, 0.14);
  transform: translateY(-2px);
}

.currency-toggle-btn.gems-active {
  background: rgba(167, 139, 250, 0.16);
  border-color: rgba(167, 139, 250, 0.45);
}

.current-bet-box {
  min-width: 165px;
}

.current-bet-box span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}

.current-bet-box strong {
  color: #38bdf8;
  font-size: 20px;
  font-weight: 950;
}

.current-bet-box.gems-mode strong {
  color: #a78bfa;
}

/* Arena */

.crash-arena {
  position: relative;
  overflow: hidden;
  min-height: 330px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(rgba(56, 189, 248, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.055) 1px, transparent 1px),
    radial-gradient(circle at center, rgba(56, 189, 248, 0.12), transparent 48%),
    rgba(2, 6, 23, 0.48);
  background-size: 46px 46px, 46px 46px, auto, auto;
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 24px;
  padding: 28px;
}

.arena-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  background: rgba(56, 189, 248, 0.14);
  border-radius: 999px;
  filter: blur(75px);
  pointer-events: none;
}

.multiplier-center {
  position: relative;
  z-index: 4;
  text-align: center;
}

.multiplier-label {
  color: #94a3b8;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.multiplier-display {
  color: #38bdf8;
  font-size: clamp(78px, 12vw, 140px);
  font-weight: 950;
  line-height: 0.95;
  letter-spacing: -6px;
  text-shadow: 0 0 42px rgba(56, 189, 248, 0.38);
  transition: color 0.2s ease, text-shadow 0.2s ease, transform 0.2s ease;
}

.multiplier-display.won {
  color: #22c55e;
  text-shadow: 0 0 42px rgba(34, 197, 94, 0.4);
  transform: scale(1.02);
}

.multiplier-display.crashed {
  color: #ef4444;
  text-shadow: 0 0 42px rgba(239, 68, 68, 0.42);
  transform: scale(1.02);
}

.crash-result-text {
  width: fit-content;
  max-width: min(620px, calc(100vw - 100px));
  margin: 18px auto 0;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.64);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: 999px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 850;
}

.progress-wrap {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 26px;
  height: 10px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.74);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 999px;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #38bdf8, #22c55e, #facc15);
  border-radius: inherit;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.38);
  transition: width 0.08s linear;
}

.progress-fill.won {
  background: linear-gradient(90deg, #22c55e, #86efac);
}

.progress-fill.crashed {
  background: linear-gradient(90deg, #ef4444, #f97316);
}

/* Controls */

.crash-controls {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 14px;
}

.control-panel,
.history-panel {
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(56, 189, 248, 0.16);
  border-radius: 22px;
  padding: 16px;
}

.panel-header {
  margin-bottom: 14px;
}

.panel-header h2,
.history-panel h2 {
  color: #ffffff;
  font-size: 22px;
  letter-spacing: -0.6px;
}

.chip-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

.chip-btn {
  min-width: 68px;
  height: 46px;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, rgba(56, 189, 248, 0.16), transparent 50%),
    linear-gradient(135deg, #0f172a, #020617);
  border: 1px solid rgba(56, 189, 248, 0.42);
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
  cursor: pointer;
  transition: 0.2s ease;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.chip-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.2);
}

.gem-chip {
  border-color: rgba(167, 139, 250, 0.55);
  background:
    radial-gradient(circle at center, rgba(167, 139, 250, 0.18), transparent 50%),
    linear-gradient(135deg, #0f172a, #020617);
}

.custom-row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.input-box {
  min-width: 190px;
  flex: 1;
  background: rgba(2, 6, 23, 0.5);
  border: 1px solid rgba(56, 189, 248, 0.24);
  border-radius: 16px;
  padding: 9px 12px;
}

.input-box span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 5px;
}

.input-box input {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 16px;
  font-weight: 900;
}

.add-bet-btn,
.clear-bet-btn,
.start-btn,
.cashout-btn,
.reset-btn,
.auto-toggle-btn {
  border-radius: 15px;
  padding: 0 17px;
  min-height: 54px;
  font-size: 13px;
  font-weight: 950;
  cursor: pointer;
  transition: 0.2s ease;
}

.add-bet-btn,
.start-btn {
  color: #031622;
  background: #38bdf8;
  border: 1px solid #38bdf8;
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.18);
}

.cashout-btn {
  color: #031622;
  background: #22c55e;
  border: 1px solid #22c55e;
  box-shadow: 0 0 24px rgba(34, 197, 94, 0.18);
}

.clear-bet-btn,
.reset-btn {
  color: #ffffff;
  background: rgba(2, 6, 23, 0.34);
  border: 1px solid rgba(56, 189, 248, 0.28);
}

.auto-toggle-btn {
  width: 100%;
  color: #ffffff;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.34);
  margin-bottom: 14px;
}

.auto-toggle-btn.active {
  color: #031622;
  background: #facc15;
  border-color: #facc15;
  box-shadow: 0 0 24px rgba(250, 204, 21, 0.2);
}

.add-bet-btn:hover,
.clear-bet-btn:hover,
.start-btn:hover,
.cashout-btn:hover,
.reset-btn:hover,
.auto-toggle-btn:hover {
  transform: translateY(-2px);
}

.action-panel {
  display: flex;
  flex-direction: column;
}

.auto-box {
  margin-bottom: 14px;
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: auto;
}

button:disabled,
input:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.history-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  flex-wrap: wrap;
}

.history-pill {
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 950;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.26);
  color: #38bdf8;
}

.history-pill.safe {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.28);
}

.history-pill.mid {
  color: #facc15;
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(250, 204, 21, 0.28);
}

.history-pill.hot {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
}

@media (max-width: 950px) {
  .crash-header {
    flex-direction: column;
  }

  .crash-wallets {
    min-width: 0;
    width: 100%;
  }

  .crash-controls {
    grid-template-columns: 1fr;
  }

  .history-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-list {
    justify-content: flex-start;
  }
}

@media (max-width: 650px) {
  .crash-page {
    padding: 22px 16px 42px;
  }

  .crash-header,
  .crash-game-card,
  .crash-arena {
    border-radius: 22px;
  }

  .crash-header,
  .crash-game-card {
    padding: 18px;
  }

  .crash-wallets {
    grid-template-columns: 1fr;
  }

  .crash-top-row,
  .bet-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .current-bet-box,
  .currency-toggle-btn {
    width: 100%;
  }

  .crash-arena {
    min-height: 290px;
    padding: 22px;
  }

  .multiplier-display {
    font-size: 70px;
    letter-spacing: -3px;
  }

  .crash-result-text {
    max-width: 100%;
    border-radius: 18px;
  }

  .custom-row {
    flex-direction: column;
  }

  .input-box,
  .add-bet-btn,
  .clear-bet-btn,
  .start-btn,
  .cashout-btn,
  .reset-btn,
  .auto-toggle-btn {
    width: 100%;
  }

  .chip-row {
    justify-content: center;
  }
}