/* 扫雷 9×9 — 游戏专用样式 */

.hero-art-card {
  padding: 26px;
}

.mini-mines {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  padding: 12px;
  border-radius: 14px;
  background: #cbd5e1;
}

.mini-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  font-size: clamp(0.95rem, 4vw, 1.3rem);
  font-weight: 800;
}

.mini-hidden {
  border: 1px solid #94a3b8;
  background: linear-gradient(145deg, #f8fafc, #e2e8f0);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.mini-open {
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #1d4ed8;
}

.mini-open.mini-empty {
  background: #f8fafc;
}

.mini-flag {
  border: 1px solid #e2e8f0;
  background: #fff1f2;
  color: #b91c1c;
}

.mini-caption {
  margin: 16px 0 0;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-align: center;
}

.flag-toggle[aria-pressed="true"] {
  border-color: #0369a1;
  background: #0369a1;
  color: #ffffff;
}

.flag-toggle[aria-pressed="true"]:hover {
  border-color: #075985;
  background: #075985;
}

.mine-board-wrap {
  display: flex;
  justify-content: center;
  padding: 4px;
}

.mine-board {
  width: min(100%, 500px);
  display: grid;
  grid-template-columns: repeat(9, minmax(0, 1fr));
  gap: clamp(3px, 0.8vw, 5px);
  padding: clamp(6px, 1.6vw, 10px);
  border-radius: 12px;
  background: #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
  touch-action: manipulation;
  user-select: none;
}

.mine-cell {
  position: relative;
  aspect-ratio: 1;
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #94a3b8;
  border-radius: 5px;
  background: linear-gradient(145deg, #f8fafc, #e2e8f0);
  color: #0f172a;
  font-size: clamp(0.72rem, 3.3vw, 1.12rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  -webkit-tap-highlight-color: transparent;
}

.mine-cell:hover:not(.is-revealed) {
  border-color: #0369a1;
  background: linear-gradient(145deg, #ffffff, #dbeafe);
}

.mine-cell:focus-visible {
  z-index: 2;
  outline: 3px solid #0c4a6e;
  outline-offset: 1px;
}

.mine-cell.is-revealed {
  border-color: #e2e8f0;
  background: #ffffff;
  box-shadow: none;
  cursor: default;
}

.mine-cell.is-revealed.is-empty {
  background: #f8fafc;
}

.mine-cell.is-flagged {
  border-color: #fca5a5;
  background: #fff1f2;
  color: #b91c1c;
  font-size: clamp(0.9rem, 3.6vw, 1.25rem);
}

.mine-cell.is-mine {
  border-color: #fca5a5;
  background: #fee2e2;
}

.mine-cell.is-exploded {
  border-color: #991b1b;
  background: #fecaca;
  box-shadow: inset 0 0 0 2px #991b1b;
}

.mine-cell.is-wrong {
  border-color: #f59e0b;
  background: #fef3c7;
  color: #92400e;
}

.mine-cell.n1 { color: #1d4ed8; }
.mine-cell.n2 { color: #15803d; }
.mine-cell.n3 { color: #b91c1c; }
.mine-cell.n4 { color: #6d28d9; }
.mine-cell.n5 { color: #92400e; }
.mine-cell.n6 { color: #0f766e; }
.mine-cell.n7 { color: #111827; }
.mine-cell.n8 { color: #475569; }

.game-status.is-win {
  color: #075985;
  font-weight: 800;
}

.game-status.is-over {
  color: #b91c1c;
  font-weight: 800;
}

@media (max-width: 600px) {
  .hero-art {
    display: none;
  }

  .mine-board {
    width: 100%;
    gap: 3px;
    padding: 6px;
  }

  .mine-cell {
    border-radius: 4px;
    font-size: clamp(0.68rem, 3.8vw, 0.95rem);
  }
}

@media (forced-colors: active) {
  .mine-board,
  .mine-cell,
  .mini-cell {
    border: 1px solid ButtonText;
  }

  .mine-cell.is-revealed {
    background: Canvas;
    color: ButtonText;
  }
}
