.page.mines-page {
  display: none;
}

.page.mines-page.active {
  display: flex;
  min-height: 100dvh;
  height: 100dvh;
}

.mines-page {
  background: #05070f;
  padding: 0;
  overflow: visible;
  height: 100dvh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.mines-page::before {
  display: none;
}

.mines-root {
  height: 100dvh;
  min-height: 100dvh;
  overflow: visible;
  background:
    radial-gradient(circle at top, rgba(43,124,255,0.28), transparent 28%),
    linear-gradient(#123da3, #07101f);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.mines-shell {
  width: min(100%, 390px);
  height: 100dvh;
  min-height: 100dvh;
  max-height: none;
  margin: 0 auto;
  padding: 10px 8px max(12px, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: visible;
  box-sizing: border-box;
}

.mines-topbar {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  position: relative;
  z-index: 60;
}

.mines-header-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.mines-wallet-pill {
  min-width: 146px;
  height: 38px;
  padding: 0 12px 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #1b2b87, #122061);
  border: 1px solid #7ca4ff;
  box-shadow: 0 0 20px rgba(0,0,0,0.35);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mines-wallet-coin {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #ffd767, #ff9f2f);
  color: #15225e;
  font-size: 16px;
  font-weight: 900;
}

.mines-wallet-pill strong {
  color: #fff;
  font-size: 22px;
  font-weight: 900;
}

.mines-round-button {
  width: 34px;
  height: 34px;
  border: 1px solid #3560ff;
  border-radius: 50%;
  background: #07134d;
  display: grid;
  place-items: center;
}

.mines-menu-wrap {
  position: relative;
  z-index: 80;
}

.mines-menu-button {
  padding: 0;
}

.mines-menu-button span {
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: #fff;
  display: block;
}

.mines-menu-button span + span {
  margin-top: 3px;
}

.mines-quick-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 10px;
  border-radius: 18px;
  background: rgba(10, 20, 58, 0.95);
  border: 1px solid rgba(92, 144, 255, 0.55);
  box-shadow: 0 18px 32px rgba(0,0,0,0.42);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 120;
}

.mines-quick-menu.hidden {
  display: none;
}

.mines-quick-icon-action {
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
}

.mines-quick-icon-action img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
}

.mines-quick-icon-action.is-blue {
  background: linear-gradient(180deg, #2279ff, #0a43a6);
  box-shadow: 0 0 16px rgba(34,121,255,0.34);
}

.mines-quick-icon-action.is-green {
  background: linear-gradient(180deg, #2fd35c, #0d8e33);
  box-shadow: 0 0 16px rgba(47,211,92,0.34);
}

.mines-quick-icon-action.is-gold {
  background: linear-gradient(180deg, #f4c442, #cc8b0b);
  box-shadow: 0 0 16px rgba(244,196,66,0.34);
}

.mines-top-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mines-count-chip,
.mines-next-chip {
  height: 40px;
  border-radius: 999px;
  border: 1px solid #40a8ff;
  background: rgba(0, 82, 170, 0.9);
  backdrop-filter: blur(4px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.24);
}

.mines-count-chip {
  flex: 1;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.92);
  font-size: 16px;
  font-weight: 700;
}

.mines-count-chip select {
  border: none;
  outline: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}

.mines-next-chip {
  min-width: 132px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #172614;
  font-size: 16px;
  font-weight: 900;
  background: linear-gradient(180deg, #7dea4f, #58bf2f);
}

.mines-progress {
  height: 4px;
  border-radius: 999px;
  background: #0f4d92;
  overflow: hidden;
}

.mines-progress-bar {
  width: 22%;
  height: 100%;
  background: #5dff6d;
  transition: width .26s ease, background .26s ease;
}

.mines-progress-bar.is-loss {
  background: #ff5858;
}

.mines-board-area {
  flex: 1;
  min-height: 340px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 28px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(0, 118, 226, 0.16), rgba(0, 54, 156, 0.22)),
    url("./assets/mines-bg.png") center center / cover no-repeat,
    #0162d9;
  border: 1px solid #2c86ff;
  box-shadow: 0 0 36px rgba(0,140,255,0.25);
  padding: 56px 24px 20px;
}

.mines-board-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 20% 10%, rgba(0,255,255,0.08), transparent 24%),
    radial-gradient(circle at 80% 80%, rgba(0,0,60,0.24), transparent 32%);
}

.mines-grid {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100%, 250px);
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 0 auto;
}

.mines-tile {
  aspect-ratio: 1;
  border: 1px solid #114f97;
  border-radius: 12px;
  background: linear-gradient(180deg, #09356d, #052851);
  box-shadow:
    inset 0 4px 8px rgba(255,255,255,0.08),
    0 6px 12px rgba(0,0,0,0.4);
  display: grid;
  place-items: center;
  padding: 0;
  color: transparent;
  font-size: 28px;
  font-weight: 900;
  transition: transform .18s ease, background .2s ease, box-shadow .2s ease;
  position: relative;
}

.mines-tile:active {
  transform: scale(.93);
}

.mines-tile::before {
  content: "";
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #5378d4;
  opacity: 0.7;
  transition: opacity .18s ease;
}

.mines-tile.safe {
  background: linear-gradient(180deg, #4cff00, #0f7d00);
  border-color: #a8ff85;
  box-shadow: 0 0 25px rgba(0,255,100,0.65);
}

.mines-tile.mine {
  background: linear-gradient(180deg, #ff4854, #d9112e);
  border-color: #ffb3b8;
  box-shadow: 0 0 25px rgba(255,0,0,0.8);
}

.mines-tile.safe::before,
.mines-tile.mine::before {
  opacity: 0;
}

.mines-tile-face {
  width: 100%;
  height: 100%;
  border-radius: inherit;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
}

.mines-tile-face.star {
  color: #fff2a6;
  text-shadow: 0 0 16px rgba(255, 233, 116, 0.95);
}

.mines-tile-face.mine {
  color: #ffe46f;
  text-shadow: 0 0 16px rgba(255, 206, 0, 0.95);
}

.mines-mid-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.mines-random-button {
  flex: 1;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #065b98;
  border: 1px solid #2e8fd8;
  color: #fff;
  font-size: 18px;
  font-weight: 900;
}

.mines-auto-toggle {
  width: 146px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #0c3f94;
  border: 1px solid #285fd5;
  color: #fff;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.mines-auto-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #124eb2;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.mines-auto-text {
  font-size: 13px;
  font-weight: 800;
}

.mines-auto-switch {
  width: 40px;
  height: 20px;
  border-radius: 999px;
  background: #2250a9;
  position: relative;
}

.mines-auto-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
}

.mines-auto-toggle.is-active .mines-auto-switch {
  background: #8de35f;
}

.mines-auto-toggle.is-active .mines-auto-knob {
  transform: translateX(20px);
}

.mines-bet-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mines-reset-button {
  width: 64px;
  height: 64px;
  border: 3px solid #08284f;
  border-radius: 50%;
  background: #045fc8;
  box-shadow: 0 0 20px rgba(0,174,255,0.55);
  color: #fff;
  font-size: 36px;
}

.mines-bet-button {
  flex: 1;
  height: 64px;
  border: 3px solid #072c0c;
  border-radius: 999px;
  background: linear-gradient(90deg, #177c0d, #58b000);
  box-shadow: 0 0 30px rgba(81,255,0,0.45);
  color: #fff;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: .5px;
}

.mines-bet-button.cashout {
  background: linear-gradient(90deg, #f7a82b, #d88208);
  border-color: #6e4200;
}

.mines-bet-button.disabled {
  background: linear-gradient(90deg, #355177, #2f4564);
  border-color: #1d2b3f;
}

.mines-bet-panel {
  background: rgba(0,129,216,0.4);
  border: 1px solid #2ca4ff;
  border-radius: 26px;
  padding: 10px 12px;
  backdrop-filter: blur(5px);
  box-shadow: 0 18px 28px rgba(0,0,0,0.25);
}

.mines-bet-label {
  text-align: center;
  font-size: 16px;
  margin-bottom: 6px;
}

.mines-bet-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px 48px 48px;
  gap: 8px;
}

.mines-amount-display,
.mines-bet-adjust {
  height: 48px;
  border: 1px solid #2c9fff;
  border-radius: 999px;
  background: #00558e;
  color: #fff;
}

.mines-amount-display {
  width: 100%;
  padding: 0 18px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: inset 0 0 14px rgba(0,0,0,0.24);
  text-align: center;
  outline: none;
}

.mines-amount-display::placeholder {
  color: rgba(255,255,255,0.45);
}

.mines-bet-adjust {
  display: grid;
  place-items: center;
  font-size: 24px;
  font-weight: 900;
}

.mines-rules-card {
  width: min(100%, 340px);
  padding: 0;
  border-radius: 24px;
  overflow: hidden;
  background: #161922;
  border: 1px solid #333f57;
  color: #fff;
  text-align: left;
}

.mines-rules-head {
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2b3242;
}

.mines-rules-head strong {
  font-size: 16px;
  font-weight: 900;
}

.mines-rules-head button {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: #2a3142;
  color: #fff;
  font-size: 26px;
}

.mines-rules-body {
  padding: 22px 22px 26px;
  display: grid;
  gap: 18px;
  justify-items: center;
}

.mines-rules-brand {
  font-size: 22px;
  font-weight: 500;
}

.mines-rules-demo {
  width: 210px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.mines-rules-demo span {
  aspect-ratio: 1;
  border-radius: 10px;
  background: #fff;
  display: grid;
  place-items: center;
  color: transparent;
}

.mines-rules-demo .is-star {
  background: #f8bc31;
  color: #fff;
}

.mines-rules-demo .is-mine {
  background: #ff2456;
  color: #ffe56e;
}

.mines-rules-body p {
  margin: 0;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}
