.mines-layout {
  display: flex;
  flex-direction: column-reverse;
  gap: 12px;
}
.mines-panel,
.mines-about,
.mines-board-card {
  background: #171b28;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 28px rgba(16, 22, 40, 0.18);
  max-width: 100%;
  overflow: hidden;
}
.mines-panel { padding: 14px; }
.mines-side { display: grid; gap: 12px; min-width: 0; }

.demo-balance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.demo-balance span {
  display: block;
  color: #8b97b8;
  font-size: 13px;
  font-weight: 700;
}
.demo-balance b {
  display: block;
  margin-top: 2px;
  font-size: 28px;
  line-height: 1;
}
.demo-balance button,
.bet-ops button,
.chip-row button,
.mine-row button,
.mine-current {
  background: #252b3f;
  color: #fff;
  border-radius: 10px;
  font-weight: 700;
}
.demo-balance button {
  height: 40px;
  padding: 0 14px;
  background: #1f6aed;
}

.mines-label {
  display: block;
  margin: 12px 0 8px;
  color: #7a86ae;
  font-size: 16px;
  font-weight: 700;
}
.bet-field { position: relative; }
.bet-field .coin {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 20px;
  height: 18px;
  margin-top: -9px;
  color: #ff8a3d;
}
.bet-field input,
.mine-current input {
  width: 100%;
  height: 56px;
  border: 0;
  border-radius: 10px;
  background: #252b3f;
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}
.bet-field input {
  padding: 0 148px 0 44px;
}
.bet-ops {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  grid-template-columns: repeat(3, 44px);
  gap: 4px;
}
.bet-ops button {
  height: 44px;
  background: #393e51;
  font-size: 14px;
}
.chip-row,
.mine-row {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}
.chip-row { grid-template-columns: repeat(5, 1fr); }
.mine-row { grid-template-columns: repeat(4, 1fr); }
.chip-row button,
.mine-row button,
.mine-current {
  height: 42px;
  font-size: 16px;
}
.mine-row button,
.mine-current {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.mine-row img { width: 16px; height: 16px; object-fit: contain; }
.mine-row button.is-on,
.mine-current.is-on {
  box-shadow: inset 0 0 0 2px #6d8cff;
  background: #30395a;
}
.mine-current input {
  width: 36px;
  height: 42px;
  padding: 0;
  text-align: center;
  background: transparent;
}
.mine-current.is-on input { background: transparent; }

.play {
  width: 100%;
  height: 48px;
  margin-top: 14px;
  border-radius: 10px;
  background: #1f6aed;
  color: #fff;
  font-size: 17px;
  font-weight: 700;
}
.play:disabled { opacity: 0.45; }
.play.cash { background: linear-gradient(180deg, #3ddc7a, #18a84a); }
.mines-status {
  margin: 10px 0 0;
  color: #8b97b8;
  font-size: 13px;
}

.mines-about { padding: 14px; }
.about-head { display: flex; gap: 12px; align-items: flex-start; }
.about-head img {
  width: 64px;
  height: 78px;
  object-fit: contain;
  padding: 8px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 117, 52, 0.35), rgba(255, 112, 46, 0.08));
}
.about-head h1 { margin: 0 0 6px; font-size: 26px; }
.about-head p { margin: 0; color: #9aa6c3; font-size: 14px; }
.hist-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 14px 0 10px;
  padding: 4px;
  border-radius: 12px;
  background: #121722;
}
.hist-switch button {
  height: 40px;
  border-radius: 10px;
  color: #c5cde2;
  font-weight: 800;
}
.hist-switch button.is-on { background: #2a3148; color: #fff; }
.hist-title { font-weight: 800; margin-bottom: 8px; }
.hist-head,
.hist-row {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr 0.7fr 0.8fr;
  gap: 6px;
  align-items: center;
}
.hist-head {
  color: #8b97b8;
  font-size: 12px;
  padding: 0 10px 6px;
}
.hist-row {
  background: #121722;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 14px;
}
.hist-row span:last-child { text-align: right; }
.hist-empty { color: #8b97b8; margin: 8px 0 0; }

.mines-board-card { padding: 10px; }
.board-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 8px;
  min-width: 0;
}
.fair {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  min-width: 0;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
}
.fair::before {
  content: "";
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: #20c997;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}
.board-pills { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.pill-stat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: #121722;
  font-weight: 800;
  font-size: 12px;
}
.pill-stat img { width: 16px; height: 16px; object-fit: contain; }
.fair-note {
  margin: 0 0 10px;
  color: #c5cde2;
  font-size: 13px;
}
.mults {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 auto 8px;
  padding-bottom: 2px;
  width: min(100%, 300px);
}
.mults::-webkit-scrollbar { display: none; }
.mults button {
  flex: 0 0 auto;
  min-width: 46px;
  height: 36px;
  border-radius: 8px;
  background: #121722;
  color: #9aa6c3;
  font-weight: 800;
  font-size: 11px;
}
.mults button b { display: block; color: #fff; font-size: 12px; }
.mults button.is-on { background: #1f6aed; color: #d6e4ff; }
.mults button.is-on b { color: #fff; }

.board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  width: min(100%, 300px);
  margin: 0 auto;
}
.cell {
  aspect-ratio: 1;
  border-radius: 10px;
  background: linear-gradient(180deg, #282f46, #353d55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), inset 0 -8px 12px rgba(0, 0, 0, 0.18);
  display: grid;
  place-items: center;
}
.cell img { width: 22px; height: auto; }
.cell:disabled { cursor: default; }
.cell.gem {
  background: linear-gradient(180deg, #243652, #1d4d86);
}
.cell.bomb {
  background: linear-gradient(180deg, #6a2430, #3a1c28);
}
.cell.dim { opacity: 0.55; }
.cell.live { cursor: pointer; }
.cell.live:active { transform: scale(0.97); }

@media (max-width: 420px) {
  .bet-field input { padding-right: 138px; }
  .bet-ops { grid-template-columns: repeat(3, 40px); }
  .chip-row button,
  .mine-row button { font-size: 14px; padding: 0; }
}
@media (min-width: 900px) {
  .mines-layout { flex-direction: row; align-items: flex-start; }
  .mines-side { width: 340px; flex: 0 0 340px; }
  .mines-board-card { flex: 1; }
  .board { width: min(100%, 380px); }
  .cell img { width: 26px; }
}
