/* ============ Minefield game ============ */
.mine-game { display: flex; flex-direction: column; min-height: 0; min-width: 0; flex: 1; overflow-x: clip; }

/* ── Stage ── */
.mf-stage {
  position: relative; margin: 12px 14px 0; border-radius: var(--r);
  border: 1px solid var(--line); overflow: hidden;
  background:
    radial-gradient(95% 60% at 50% -10%, rgba(255,90,60,.1), transparent 62%),
    linear-gradient(180deg, #241318 0%, #181016 55%, #100a0e 100%);
  padding: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.mf-stage::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(1px 1px at 16% 22%, rgba(255,200,180,.4), transparent),
    radial-gradient(1px 1px at 78% 16%, rgba(255,200,180,.35), transparent),
    radial-gradient(1px 1px at 42% 70%, rgba(255,200,180,.25), transparent);
}
.mf-stage.shake { animation: mf-shake .42s ease; }
@keyframes mf-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-6px, 3px); } 40% { transform: translate(6px, -3px); }
  60% { transform: translate(-4px, -2px); } 80% { transform: translate(4px, 2px); }
}

/* readout: multiplier + potential cashout */
.mf-readout { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.mf-mult { font-size: clamp(30px, 8vw, 42px); font-weight: 900; color: #fff; font-variant-numeric: tabular-nums; letter-spacing: -1px; line-height: 1; text-shadow: 0 3px 12px rgba(0,0,0,.5); transition: color .15s ease; }
.mf-mult.win { color: var(--win); }
.mf-mult.lose { color: var(--lose); }
.mf-sub { font-size: 11px; color: var(--muted); letter-spacing: .4px; }
.mf-sub b { color: var(--win); font-variant-numeric: tabular-nums; }

/* ── Grid ── */
.mf-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(6px, 1.8vw, 9px);
  width: 100%; max-width: 360px;
}
.mf-tile {
  aspect-ratio: 1; border-radius: clamp(8px, 2.4vw, 11px);
  background: linear-gradient(180deg, #34404e, #232c38);
  border: 1px solid #44505f;
  box-shadow: inset 0 2px 3px rgba(255,255,255,.08), inset 0 -3px 6px rgba(0,0,0,.35), 0 2px 4px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: #6c7888;
  transition: transform .08s ease, background .15s ease, border-color .15s ease, box-shadow .2s ease;
}
.mf-tile .ic { width: 56%; height: 56%; }
.mf-tile:not(:disabled):hover { border-color: #5a6878; transform: translateY(-1px); }
.mf-tile:not(:disabled):active { transform: scale(.94); }
.mf-tile:disabled { cursor: default; }

/* dim unrevealed tiles when the field isn't armed */
.mf-grid.idle .mf-tile { opacity: .5; }

/* arming (real mode: waiting for the tick) */
.mf-tile.arming { animation: mf-arm .7s ease-in-out infinite; }
@keyframes mf-arm { 0%, 100% { box-shadow: inset 0 0 0 1px rgba(255,180,60,.4); } 50% { box-shadow: inset 0 0 10px rgba(255,180,60,.6); } }

/* revealed safe → gem */
.mf-tile.gem {
  background: linear-gradient(180deg, #143b32, #0c2a24);
  border-color: rgba(14,203,129,.55); color: #2fe39c;
  box-shadow: inset 0 0 14px rgba(14,203,129,.3), 0 0 14px rgba(14,203,129,.25);
  animation: mf-pop .26s ease;
}
@keyframes mf-pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* revealed bomb */
.mf-tile.bomb {
  background: radial-gradient(circle at 50% 45%, #ff6a4d, #c01616 70%);
  border-color: #ff8a6a; color: #fff;
  box-shadow: 0 0 22px rgba(255,80,40,.7);
  animation: mf-boom .4s ease;
}
@keyframes mf-boom { 0% { transform: scale(.5); } 50% { transform: scale(1.28); } 100% { transform: scale(1); } }
/* tiles left unrevealed after a bomb, dimmed */
.mf-tile.cold { opacity: .4; }

/* ── Controls ── */
.mf-controls {
  margin: 12px 14px calc(14px + env(safe-area-inset-bottom)); padding: 14px;
  background: linear-gradient(180deg, var(--panel), var(--bg-2)); border: 1px solid var(--line); border-radius: var(--r);
  display: flex; flex-direction: column; gap: 12px;
}

.mine-game .launch-btn {
  background: linear-gradient(180deg, #ff7a4d, #e23b1f); color: #fff; font-weight: 800;
  box-shadow: 0 6px 18px rgba(226,59,31,.32);
  transition: transform .07s ease, filter .15s ease, box-shadow .25s ease;
}
.mine-game .launch-btn:not(:disabled) { animation: mf-glow 2.4s ease-in-out infinite; }
.mine-game .launch-btn.cashout { background: linear-gradient(180deg, #16d98e, #07b977); color: #04130d; box-shadow: 0 6px 18px rgba(14,203,129,.34); }
.mine-game .launch-btn.waiting { background: var(--panel-2); color: var(--muted); box-shadow: none; animation: none; }
.mine-game .launch-btn:disabled { background: var(--panel-2); color: var(--muted); box-shadow: none; animation: none; }
.mine-game .launch-btn:active:not(:disabled) { transform: scale(.985); }
@keyframes mf-glow { 0%, 100% { box-shadow: 0 6px 18px rgba(226,59,31,.3); } 50% { box-shadow: 0 8px 28px rgba(226,59,31,.55); } }

/* history pills */
.mf-stage .history-strip { width: 100%; border-top: none; padding: 0; position: relative; z-index: 1; justify-content: center; }
.mf-pill.win  { border-color: rgba(14,203,129,.45); color: var(--win); }
.mf-pill.lose { border-color: rgba(246,70,93,.42); color: var(--lose); }

/* ── Mobile bottom nav ── */
@media (max-width: 879px) {
  .mine-game { padding-bottom: 74px; }
  .mine-game .mybets { display: none; }
  .mine-game.view-plays .mybets { display: block; min-height: 60vh; }
  .mine-game.view-plays .mf-stage,
  .mine-game.view-plays .mf-controls { display: none; }
}
