body {
  font-family: Arial, sans-serif;
  background: #222;
  color: #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
}

h1 {
  margin-bottom: 10px;
}

#controls {
  margin-bottom: 10px;
}

#board {
  display: grid;
  border: 2px solid #555;
  background: #333;
  user-select: none;
}

.cell {
  width: 30px;
  height: 30px;
  border: 1px solid #555;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  background: #444;
  color: #eee;
}

.cell.revealed {
  background: #222;
  cursor: default;
}

.cell.mine {
  background: #b00;
}

.cell.flagged {
  background: #444;
  color: #ff0;
}

.cell.revealed.num-1 { color: #00f; }
.cell.revealed.num-2 { color: #0a0; }
.cell.revealed.num-3 { color: #f00; }
.cell.revealed.num-4 { color: #00a; }
.cell.revealed.num-5 { color: #800; }
.cell.revealed.num-6 { color: #088; }
.cell.revealed.num-7 { color: #000; }
.cell.revealed.num-8 { color: #888; }

#status {
  margin-top: 10px;
  min-height: 20px;
}

button {
  padding: 5px 10px;
  margin: 0 5px;
  cursor: pointer;
}

input {
  width: 50px;
  margin: 0 3px;
  text-align: center;
}

.menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(20, 20, 20, 0.95);
  display: flex;              /* always flex */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: #eee;
  z-index: 10;
  opacity: 0;                 /* start transparent */
  pointer-events: none;       /* ignore clicks when hidden */
  transition: opacity 0.3s ease;
}

.menu.show {
  opacity: 1;                 /* fade in */
  pointer-events: auto;       /* clickable when shown */
}


.menu button {
  padding: 10px 20px;
  font-size: 18px;
  cursor: pointer;
  margin-top: 10px;
}

#menuMessage {
  margin-top: 15px;
  font-size: 20px;
  color: #ff0;
}

.sizeBtn {
  padding: 12px 25px;
  font-size: 18px;
  margin: 8px;
  cursor: pointer;
}

/* ===== CELL REVEAL POP ===== */
.cell.revealed {
  animation: revealPop 0.15s ease-out forwards;
}

@keyframes revealPop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== EXPLOSION ===== */
.cell.mine {
  animation: explode 0.3s ease-out;
}

@keyframes explode {
  0% { transform: scale(1); background: #b00; }
  50% { transform: scale(1.4); background: #f33; }
  100% { transform: scale(1); background: #900; }
}

/* ===== FLAG DROP ===== */
.cell.flagged {
  animation: flagDrop 0.2s ease-out;
}

@keyframes flagDrop {
  0% { transform: translateY(-10px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}


/* ===== HOVER GLOW ===== */
.cell:not(.revealed):hover {
  background: #555;
  box-shadow: 0 0 6px #888;
}

#hud {
  margin-top: 10px;
  display: flex;
  gap: 20px;
  font-size: 20px;
}
