.mines-body {
  background: #0d202b;
}

.mines-body .live-stats-drawer {
  padding: 1rem;
  min-width: 19rem;
}

.mines-body .live-stats-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.mines-body .live-stats-header h2 {
  display: flex;
  min-width: 0;
  font-size: 1.05rem;
  line-height: 1.2;
  white-space: nowrap;
}

.mines-body .live-stats-header h2 span {
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 0.7rem;
}

.mines-body .live-stats-header .icon-button,
.mines-body .stats-filter-row .icon-button {
  flex: 0 0 auto;
  min-width: 2rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  font-size: 1rem;
}

.mines-body .stats-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2rem;
  gap: 0.65rem;
  align-items: center;
  margin-bottom: 0.85rem;
}

.mines-body .stats-filter-row select {
  width: 100%;
  min-width: 0;
}

.mines-body .live-stats-metrics {
  gap: 0;
  padding: 0.85rem;
  margin-bottom: 0.85rem;
}

.mines-body .live-stats-metrics > div {
  min-width: 0;
  min-height: 3.5rem;
  padding: 0.2rem 0.7rem;
}

.mines-body .live-stats-metrics strong {
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.mines-body .credit-dot {
  display: inline-grid;
  place-items: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  font-size: 0.42rem;
  vertical-align: 0.12rem;
}

.mines-body .stats-chart {
  height: 13.75rem;
  padding: 0.8rem;
  margin-bottom: 0;
  overflow: hidden;
}

.mines-body .chart-fill {
  fill: rgba(20, 244, 106, 0.22);
}

.mines-body .chart-loss-fill {
  fill: rgba(255, 40, 84, 0.24);
}

.mines-stage {
  display: grid;
  gap: 0.9rem;
}

.mines-panel {
  display: grid;
  grid-template-columns: minmax(20rem, 28rem) minmax(10rem, 1fr);
  align-items: center;
  gap: 2rem;
  min-height: 33rem;
  padding: 2rem;
  background:
    radial-gradient(circle at 68% 20%, rgba(70, 117, 248, 0.14), transparent 30rem),
    #0b1c28;
  border: 0;
  box-shadow: none;
}

.mines-board {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-auto-rows: 1fr;
  gap: 0.7rem;
  width: min(28rem, 100%);
  aspect-ratio: 1;
  align-self: center;
}

.mine-tile {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  border: 0;
  border-radius: 0.55rem;
  background: #2f5265;
  color: #fff;
  overflow: hidden;
  box-shadow: inset 0 -0.35rem 0 rgba(0, 0, 0, 0.18), 0 8px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.16s ease, background 0.16s ease;
}

.mine-tile:not(:disabled):hover,
.mine-tile:not(:disabled):focus {
  transform: translateY(-0.12rem);
  background: #416b81;
}

.mine-tile.safe {
  background: #18d777;
  color: #092014;
}

.mine-tile.safe::before {
  content: "";
  width: 42%;
  height: 42%;
  border-radius: 45% 55% 52% 48%;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, 0.85) 0 12%, transparent 13%),
    linear-gradient(135deg, #dbfff0 0%, #51f4a0 44%, #0cae60 100%);
  border: 0.16rem solid rgba(0, 78, 43, 0.28);
  box-shadow: 0 0.35rem 0 rgba(0, 80, 48, 0.22);
  transform: rotate(45deg);
}

.mine-tile.auto-selected {
  background: #4f7790;
  outline: 3px solid #4ea1ff;
  outline-offset: -3px;
}

.mine-tile.auto-selected::after {
  content: "";
  width: 26%;
  height: 26%;
  border-radius: 999px;
  background: #4ea1ff;
  box-shadow: 0 0 0 4px rgba(78, 161, 255, 0.18);
}

.mine-tile.mine {
  background: #ff2854;
}

.mine-tile.mine::before {
  content: "";
  width: 42%;
  height: 42%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 255, 255, 0.65) 0 10%, transparent 11%),
    #17212b;
  box-shadow:
    0 -0.45rem 0 -0.22rem #ffb21d,
    0.42rem -0.42rem 0 -0.2rem #ffb21d,
    0 0.35rem 0 rgba(0, 0, 0, 0.22);
}

.mine-tile.mine::after {
  content: "";
  position: absolute;
  width: 18%;
  height: 0.16rem;
  background: #ffb21d;
  transform: translate(40%, -125%) rotate(-35deg);
  transform-origin: left center;
}

.mine-tile.revealed {
  transform: none;
}

.mines-status {
  display: grid;
  gap: 0.75rem;
}

.mines-status > div,
.mines-profit-row > div {
  min-height: 4rem;
  padding: 0.75rem;
  border-radius: 0.45rem;
  background: #18303d;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.mines-status strong,
.mines-profit-row strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 1.1rem;
}

.mines-actions {
  display: grid;
  gap: 0.55rem;
}

.mines-actions .button {
  width: 100%;
  min-height: 2.65rem;
}

.auto-selection-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.2rem 0.75rem;
  align-items: center;
  min-height: 3.2rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.45rem;
  background: #102633;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.auto-selection-summary .label {
  grid-column: 1 / 2;
}

.auto-selection-summary strong {
  grid-column: 1 / 2;
  color: #fff;
}

.auto-selection-summary .text-button {
  grid-column: 2 / 3;
  grid-row: 1 / 3;
}

.mines-stake-row,
.mines-profit-row {
  margin-top: 0.8rem;
}

.mines-game-layout.stats-open {
  grid-template-columns: 19rem 18rem minmax(0, 1fr);
}

@media (max-width: 980px) {
  .mines-panel {
    grid-template-columns: 1fr;
    min-height: auto;
    justify-items: center;
  }

  .mines-board {
    width: min(24rem, 100%);
  }
}

/* 8-decimal live stats layout fix */
.mines-body .live-stats-metrics {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.mines-body .live-stats-metrics > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 0.18rem;
  padding-right: 0.55rem;
  padding-left: 0.55rem;
}

.mines-body .live-stats-metrics > div:nth-child(1) {
  order: 1;
}

.mines-body .live-stats-metrics > div:nth-child(3) {
  order: 2;
}

.mines-body .live-stats-metrics > div:nth-child(2) {
  order: 3;
}

.mines-body .live-stats-metrics > div:nth-child(4) {
  order: 4;
}

.mines-body .live-stats-metrics > div:nth-child(1),
.mines-body .live-stats-metrics > div:nth-child(3) {
  grid-column: 1 / -1;
  border-right: 0;
}

.mines-body .live-stats-metrics > div:nth-child(1),
.mines-body .live-stats-metrics > div:nth-child(3) {
  border-bottom: 1px solid rgba(177, 186, 211, 0.22);
}

.mines-body .live-stats-metrics .label {
  grid-column: 1 / -1;
}

.mines-body .live-stats-metrics strong {
  grid-column: 1;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  white-space: nowrap;
  font-size: clamp(0.86rem, 3.1vw, 1.06rem);
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.mines-body .live-stats-metrics .credit-dot {
  grid-column: 2;
  align-self: center;
  justify-self: end;
  flex: 0 0 auto;
  width: 0.95rem;
  height: 0.95rem;
  margin-left: 0;
  font-size: 0.4rem;
  vertical-align: 0;
}
/* /8-decimal live stats layout fix */

/* Layout and reveal states checked against the supplied 24 October Mines recording. */
.originals-body.mines-body .mines-panel {
  --mines-stage-height: clamp(26rem, calc(100svh - 200px), 630px);
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  align-content: center;
  gap: 16px;
  height: var(--mines-stage-height);
  min-height: 0;
  padding: 16px;
  background: #0f212e;
}
.originals-body.mines-body .mines-board {
  position: relative;
  width: min(520px, 100%, calc((var(--mines-stage-height) - 92px) * 26 / 27));
  aspect-ratio: 26 / 27;
  gap: clamp(6px, .75vw, 12px);
}
.originals-body.mines-body .mine-tile {
  height: 100%; aspect-ratio: auto; border-radius: 7px;
  background: #2b414f; box-shadow: 0 4px 0 #213743;
}
.originals-body.mines-body .mine-tile:not(:disabled):hover { background: #537185; }
.originals-body.mines-body .mine-tile.manual-selected,
.originals-body.mines-body .mine-tile.auto-selected {
  background: #8400f3; box-shadow: 0 4px 0 #5800ac; outline: none;
}
.originals-body.mines-body .mine-tile.manual-selected:not(:disabled):hover,
.originals-body.mines-body .mine-tile.auto-selected:not(:disabled):hover { background: #9925ff; }
.originals-body.mines-body .mine-tile.auto-selected::after { content: none; }
.originals-body.mines-body .mine-tile:focus-visible { outline: 2px solid #b8e2ff; outline-offset: 3px; }
.originals-body.mines-body .mine-tile.safe,
.originals-body.mines-body .mine-tile.mine { background: #071722; box-shadow: none; transform: none; }
.originals-body.mines-body .mine-tile.safe::before,
.originals-body.mines-body .mine-tile.mine::before {
  width: 58%; height: 58%; border: 0; border-radius: 0; clip-path: none;
  background: url("../assets/mines/gem.svg?v=20261024m2") center / contain no-repeat;
  box-shadow: none; transform: none;
}
.originals-body.mines-body .mine-tile.mine::before {
  width: 60%; height: 60%; background-image: url("../assets/mines/mine.svg");
}
.originals-body.mines-body .mine-tile.safe:not(.unpicked)::before { filter: drop-shadow(0 0 3px #58ff5860); }
.originals-body.mines-body .mine-tile.mine::after { content: none; }
.originals-body.mines-body .mine-tile.unpicked { background: #071722; box-shadow: none; }
.originals-body.mines-body .mine-tile.unpicked::before { width: 48%; height: 48%; opacity: .25; }
.originals-body.mines-body .mine-tile.tile-reveal::before { animation: mines-reveal 180ms ease-out both; }
@keyframes mines-reveal {
  0% { transform: scale(.55); opacity: .25; }
  70% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.originals-body.mines-body .mines-board.instant .mine-tile { transition: none; }
.originals-body.mines-body .mines-board.instant .tile-reveal::before { animation: none; }
.mines-win-overlay {
  position: absolute; z-index: 2; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; gap: 12px; width: 29%; min-width: 112px; max-width: 160px;
  padding: 18px 12px; background: #182a37; border: 5px solid #00e701; border-radius: 10px;
  color: #00e701; text-align: center; pointer-events: none; box-shadow: 0 4px 20px #001b;
}
.mines-win-overlay strong { font-size: clamp(23px, 2.1vw, 32px); line-height: 1.1; }
.mines-win-overlay hr { width: 35px; height: 3px; margin: 0; border: 0; background: #2f4553; }
.mines-win-overlay span { font-size: 16px; font-weight: 700; overflow-wrap: anywhere; }
.mines-board-tools {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center; gap: 8px; width: 100%; min-height: 40px;
}
.mines-board-action {
  min-height: 36px; padding: 6px; border: 0; box-shadow: none; background: transparent;
  color: #b1c3d1; font-size: 13px; font-weight: 700; justify-self: start;
}
.mines-board-action:last-child { justify-self: end; }
.mines-board-action:disabled { opacity: .45; }
.mines-board-action:hover:not(:disabled) { color: white; background: #213743; }
.mines-multiplier-strip {
  grid-column: 2; display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px; padding: 8px 12px; border-radius: 5px; background: #071b26;
  color: #b1c3d1; font-size: 12px; font-variant-numeric: tabular-nums;
}
.mines-multiplier-strip strong { color: #fff; font-size: 13px; }
.originals-body.mines-body .mines-count-label { display: flex; justify-content: space-between; gap: 1rem; }
.originals-body.mines-body .mines-count-control {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; align-items: center;
  gap: 8px; min-height: 44px; padding: 4px 8px; border-radius: 6px; background: #0f212e;
}
.originals-body.mines-body .mines-count-control output { text-align: center; color: #fff; font-size: 14px; }
.originals-body.mines-body #mineCountInput { width: 100%; padding: 0; min-height: 32px; accent-color: #2087ec; border: 0; background: transparent; }
.mines-total-profit { display: grid; gap: 6px; margin-top: 8px; color: #b1c3d1; font-size: 13px; font-weight: 600; }
.mines-total-profit strong { font-size: inherit; }
.mines-total-profit output { display: block; min-height: 44px; padding: 10px; border: 2px solid #3c5464; border-radius: 6px; background: #0f212e; color: white; font-size: 14px; }
.mines-control-note { margin: 0 0 12px; color: #b1c3d1; font-size: 12px; line-height: 1.45; }
.originals-body.mines-body .custom-switch-row { position: relative; }
.originals-body.mines-body .custom-switch-row input {
  inset: 0 0 0 auto; z-index: 1; width: 44px; height: 100%; min-height: 0; margin: 0; padding: 0; cursor: pointer; pointer-events: auto;
}
.originals-body.mines-body .custom-switch-row input:focus-visible + .switch-control { outline: 2px solid #b8e2ff; outline-offset: 3px; }
.originals-body.mines-body .mines-status { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .5rem; }
.originals-body.mines-body .mines-status > div { min-height: 0; padding: .55rem .75rem; background: #172e3a; border: 0; }
.originals-body.mines-body .mines-status strong { font-size: .9rem; }
@media (max-width: 760px) {
  .originals-body.mines-body .mines-panel { height: auto; padding: 12px; gap: 12px; }
  .originals-body.mines-body .mines-board { width: min(520px, 100%); gap: 7px; }
  .mines-board-tools { gap: 2px; }
  .mines-board-action { padding: 5px 2px; font-size: 11px; }
  .mines-multiplier-strip { gap: 4px; padding: 8px 6px; font-size: 10px; }
  .mines-multiplier-strip strong { font-size: 11px; }
  .mines-win-overlay { gap: 8px; padding: 14px 8px; border-width: 4px; }
  .mines-win-overlay span { font-size: 14px; }
  .originals-body.mines-body .mines-status > div { padding: .4rem; }
  .originals-body.mines-body .mines-status .label { font-size: .65rem; }
}
