html,
body {
  min-height: 100%;
}

.mines-page {
  width: 100%;
  min-height: calc(100vh - 90px);
  padding: 28px;
}

.mines-shell {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto;
  display: grid;
  gap: 18px;
}

.mines-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);
}

.mines-header h1 {
  color: #ffffff;
  font-size: clamp(42px, 6vw, 72px);
  line-height: 0.95;
  letter-spacing: -3px;
  margin-bottom: 10px;
}

.mines-header p {
  max-width: 760px;
  color: #cbd5e1;
  font-size: 16px;
  line-height: 1.6;
}

.mines-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);
}

.mines-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);
}

.mines-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;
}

.mines-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;
}

.mines-game-card > * {
  position: relative;
  z-index: 2;
}

.mines-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.active span {
  background: #38bdf8;
  box-shadow: 0 0 18px #38bdf8;
}

.round-status.won span {
  background: #22c55e;
  box-shadow: 0 0 18px #22c55e;
}

.round-status.lost 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;
}

.mines-arena {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  display: grid;
  grid-template-columns: minmax(310px, 540px) 1fr;
  align-items: center;
  gap: 22px;
  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;
}

.mines-glow {
  position: absolute;
  width: 260px;
  height: 260px;
  left: 38%;
  top: 50%;
  background: rgba(56, 189, 248, 0.14);
  border-radius: 999px;
  filter: blur(75px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.mines-board {
  position: relative;
  z-index: 4;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 11px;
}

.mine-tile {
  aspect-ratio: 1;
  min-height: 76px;
  border-radius: 18px;
  background:
    radial-gradient(circle at center, rgba(56, 189, 248, 0.13), transparent 60%),
    linear-gradient(135deg, #0f172a, #020617);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 14px 28px rgba(0, 0, 0, 0.26);
  cursor: pointer;
  transition: 0.18s ease;
}

.mine-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(56, 189, 248, 0.55);
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.18);
}

.mine-tile.revealed,
.mine-tile.mine {
  cursor: default;
  transform: none;
}

.mine-tile.revealed {
  background: rgba(34, 197, 94, 0.15);
  border-color: rgba(34, 197, 94, 0.42);
}

.mine-tile.mine {
  background: rgba(239, 68, 68, 0.16);
  border-color: rgba(239, 68, 68, 0.48);
}

.mine-tile img {
  width: 54%;
  height: 54%;
  object-fit: contain;
  pointer-events: none;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.28));
}

.mine-tile.mine img {
  filter: drop-shadow(0 0 14px rgba(239, 68, 68, 0.45));
}

.mines-side-stats {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 12px;
}

.mines-side-stats div,
.mine-preview div {
  background: rgba(2, 6, 23, 0.52);
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 18px;
  padding: 16px;
}

.mines-side-stats span,
.mine-preview span {
  display: block;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 6px;
}

.mines-side-stats strong,
.mine-preview strong {
  color: #38bdf8;
  font-size: 28px;
  font-weight: 950;
}

.mines-result-text {
  position: absolute;
  left: 50%;
  bottom: 22px;
  z-index: 5;
  transform: translateX(-50%);
  width: fit-content;
  max-width: min(720px, calc(100% - 44px));
  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;
  text-align: center;
}

.mines-controls {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  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;
}

.mine-count-box {
  display: block;
  margin-bottom: 14px;
}

.mine-preview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.add-bet-btn,
.clear-bet-btn,
.start-btn,
.cashout-btn,
.reset-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);
}

.action-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.add-bet-btn:hover,
.clear-bet-btn:hover,
.start-btn:hover,
.cashout-btn:hover,
.reset-btn:hover {
  transform: translateY(-2px);
}

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.win {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(34, 197, 94, 0.28);
}

.history-pill.loss {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.28);
}

@media (max-width: 950px) {
  .mines-header {
    flex-direction: column;
  }

  .mines-wallets {
    min-width: 0;
    width: 100%;
  }

  .mines-arena {
    grid-template-columns: 1fr;
    padding-bottom: 72px;
  }

  .mines-controls {
    grid-template-columns: 1fr;
  }

  .history-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .history-list {
    justify-content: flex-start;
  }
}

@media (max-width: 650px) {
  .mines-page {
    padding: 22px 16px 42px;
  }

  .mines-header,
  .mines-game-card,
  .mines-arena {
    border-radius: 22px;
  }

  .mines-header,
  .mines-game-card {
    padding: 18px;
  }

  .mines-wallets {
    grid-template-columns: 1fr;
  }

  .mines-top-row,
  .bet-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .current-bet-box,
  .currency-toggle-btn {
    width: 100%;
  }

  .mines-arena {
    min-height: auto;
    padding: 18px 18px 78px;
  }

  .mines-board {
    gap: 8px;
  }

  .mine-tile {
    min-height: 54px;
    border-radius: 14px;
  }

  .mines-side-stats {
    grid-template-columns: 1fr;
  }

  .custom-row {
    flex-direction: column;
  }

  .input-box,
  .add-bet-btn,
  .clear-bet-btn,
  .start-btn,
  .cashout-btn,
  .reset-btn {
    width: 100%;
  }

  .chip-row {
    justify-content: center;
  }
}