/* The board needs an explicit width. Without one it shrinks to fit its
   content while the grid inside asks for 100% of it, and the two
   collapse each other into a much smaller board than intended. */
.board {
  width: min(100%, min(72vh, 560px));
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  border-radius: var(--r-lg);
  background: var(--panel);
}

.board-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.board-head .rt { text-align: right; }
.board-head .label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--faint); }
.board-head b {
  font-size: clamp(20px, 2.8vw, 28px);
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.board-head b.gold { color: var(--green); }

/* ---------- the grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: clamp(6px, .9vw, 10px);
  width: 100%;
}

.tile {
  aspect-ratio: 1;
  border-radius: var(--r);
  display: grid;
  place-items: center;
  font-size: clamp(20px, 3.2vw, 30px);
  background: var(--panel-2);
  border-bottom: 4px solid #16242E;
  cursor: pointer;
  transition: transform .1s var(--ease), background .14s var(--ease);
}
.tile:hover:not(.done):not([disabled]) { background: var(--panel-3); transform: translateY(-2px); }
.tile:active:not(.done) { transform: translateY(1px); }
.tile[disabled] { cursor: default; }

.tile.gem {
  background: var(--green-dim);
  border-bottom-color: rgba(0,231,1,.35);
  animation: reveal .28s var(--ease);
}
.tile.bomb {
  background: var(--red-dim);
  border-bottom-color: rgba(237,65,99,.4);
  animation: boom .34s var(--ease);
}
.tile.shown { opacity: .42; }

@keyframes reveal {
  0%   { transform: scale(.76); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}
@keyframes boom {
  0%   { transform: scale(.7); }
  45%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* selected bomb count */
.mines-pick button.on { background: var(--panel-3); color: var(--text); }

#start, #cash { width: 100%; }

@media (max-width: 760px) {
  .grid { width: min(100%, 290px); }
  .board { gap: 12px; padding: 14px; }
}
