/* ===== CANOPY MINES — CSS DOM 5x5 GRID ===== */

/* The grid lives inside #game-container (styled by retro.css). Override the
   dice canvas aspect ratio so the square grid sits nicely. */
#game-container {
  aspect-ratio: auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  grid-template-rows: repeat(5, 1fr);
  gap: 8px;
  width: 100%;
  max-width: 440px;
  aspect-ratio: 1 / 1;
}

.mines-multiplier-overlay {
  position: absolute;
  top: 10px;
  right: 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  pointer-events: none;
}

.mines-multiplier-value {
  font-family: var(--font-family);
  font-size: 20px;
  color: var(--accent);
  text-shadow: 0 0 10px var(--accent-glow);
}

/* ===== TILES ===== */
.mines-tile {
  position: relative;
  background: var(--bg-input);
  border: 2px solid var(--primary-dim);
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-family);
  font-size: 11px;
  color: var(--primary);
  user-select: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  overflow: hidden;
}

.mines-tile:hover.tile-hidden {
  border-color: var(--primary);
  box-shadow: 0 0 10px var(--primary-glow);
  transform: translateY(-2px);
}

.mines-tile:disabled,
.mines-tile.tile-disabled {
  cursor: default;
}

/* hidden (unrevealed) */
.tile-hidden {
  background: var(--bg-input);
  color: transparent;
}

/* per-reveal one-shot flip animation */
@keyframes mines-flip {
  0%   { transform: rotateY(0deg)   scale(1);    }
  50%  { transform: rotateY(90deg)  scale(1.08); }
  100% { transform: rotateY(0deg)   scale(1);    }
}

.tile-flip {
  animation: mines-flip 0.32s ease;
}

/* revealed safe */
.tile-safe {
  background: var(--bg-dark);
  border-color: var(--primary);
  color: var(--primary);
  box-shadow: inset 0 0 12px var(--primary-glow);
  text-shadow: 0 0 6px var(--primary-glow);
  cursor: default;
}

/* revealed mine — the one that was hit */
.tile-mine {
  background: var(--bad);
  border-color: var(--bad);
  color: #fff;
  box-shadow: 0 0 18px var(--bad-glow);
  cursor: default;
}

.tile-mine::after {
  content: '✸';
  font-size: 18px;
}

/* mines auto-revealed on loss (all the OTHER mines) */
.tile-auto-revealed,
.tile-mine-revealed {
  background: var(--bg-dark);
  border-color: var(--bad-glow);
  color: var(--bad);
  opacity: 0.5;
  cursor: default;
}

.tile-auto-revealed::after,
.tile-mine-revealed::after {
  content: '✸';
  font-size: 16px;
}

/* ===== AUTOPLAY PANEL ===== */
.mines-autoplay {
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 12px;
  margin-bottom: 12px;
  background: rgba(0, 0, 0, 0.2);
}

/* ===== STATS PANEL ===== */
.mines-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-family: var(--font-family);
  font-size: 9px;
  color: var(--text-dim);
}

.mines-stats .stats-item {
  color: var(--text-dim);
}

.mines-stats span span {
  color: var(--primary);
}
