:root {
  --cell-size: 36px;
  --font-size: 18px;
  --primary-bg: #1e293b;
  --cell-bg: #334155;
  --cell-hover: #475569;
  --text-color: #f8fafc;
  --accent: #3b82f6;
}
* { box-sizing: border-box; }
body {
  background-color: var(--primary-bg);
  color: var(--text-color);
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  min-height: 100vh;
  position: relative;
}
h1 {
  font-size: 2rem;
  margin-bottom: 10px;
  color: var(--accent);
}
button {
  background-color: var(--accent);
  color: white;
  border: none;
  padding: 6px 12px;
  font-size: 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: background-color 0.2s ease;
}
button:hover {
  background-color: #2563eb;
}
#barnsweeper {
  display: grid;
  gap: 2px;
  margin-top: 10px;
}
.cell {
  width: var(--cell-size);
  height: var(--cell-size);
  background-color: var(--cell-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size);
  cursor: pointer;
  user-select: none;
  border-radius: 4px;
  color: white;
}
.cell:hover {
  background-color: var(--cell-hover);
}
.revealed {
  background-color: #94a3b8;
  color: black;
  cursor: default;
}
.flagged {
  background-color: #facc15;
  color: black;
}
.mine {
  background-color: #dc2626;
  color: white;
}
#win-message {
  display: none;
  position: absolute;
  top: 40%;
  font-size: 2rem;
  background-color: rgba(0,0,0,0.8);
  padding: 20px;
  border-radius: 12px;
  color: #fff;
  z-index: 1000;
}
#confetti {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  z-index: 999;
  pointer-events: none;
}
@media (max-width: 600px) {
  :root {
    --cell-size: 28px;
    --font-size: 14px;
  }
}
.cell.revealed:hover {
  background-color: #94a3b8 !important;
  cursor: default;
}
