* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: #e8e8e8;
  padding: 20px;
}

.game {
  background: #c0c0c0;
  border: 3px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #c0c0c0;
  border: 2px solid;
  border-color: #808080 #fff #fff #808080;
  padding: 8px 12px;
  margin-bottom: 6px;
  gap: 12px;
}

.counter {
  background: #000;
  color: #ff0000;
  font-family: 'Courier New', monospace;
  font-size: 28px;
  font-weight: bold;
  padding: 2px 6px;
  min-width: 52px;
  text-align: center;
  letter-spacing: 2px;
  border: 1px solid #808080;
}

.face-btn {
  width: 40px;
  height: 40px;
  font-size: 22px;
  cursor: pointer;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}

.face-btn:active {
  border-color: #808080 #fff #fff #808080;
}

.board {
  display: grid;
  grid-template-columns: repeat(10, 28px);
  grid-template-rows: repeat(10, 28px);
  border: 3px solid;
  border-color: #808080 #fff #fff #808080;
}

.cell {
  width: 28px;
  height: 28px;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  background: #c0c0c0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  line-height: 1;
}

.cell.revealed {
  border: 1px solid #808080;
  cursor: default;
  background: #bdbdbd;
}

.cell.mine-hit {
  background: #ff4444;
}

.cell.flagged {
  background: #c0c0c0;
}

.cell .flag {
  color: #ff0000;
  font-size: 16px;
}

.cell .mine {
  font-size: 16px;
}

.n1 { color: #0000ff; }
.n2 { color: #008000; }
.n3 { color: #ff0000; }
.n4 { color: #000080; }
.n5 { color: #800000; }
.n6 { color: #008080; }
.n7 { color: #000000; }
.n8 { color: #808080; }

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.overlay.visible {
  display: flex;
}

.modal {
  background: #2d2d44;
  border: 2px solid #4a4a6a;
  border-radius: 12px;
  padding: 32px 40px;
  text-align: center;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.modal h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

.modal.win h2 { color: #4ade80; }
.modal.lose h2 { color: #f87171; }

.modal p {
  color: #a0a0b8;
  margin-bottom: 20px;
  font-size: 16px;
}

.modal button {
  background: #4a6cf7;
  color: #fff;
  border: none;
  padding: 10px 28px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
}

.modal button:hover {
  background: #3b5bdb;
}

.title {
  text-align: center;
  color: #a0a0b8;
  font-size: 13px;
  margin-top: 10px;
  letter-spacing: 1px;
}
