:root {
  color-scheme: light;
  font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  background: #f5f7fb;
  color: #1a1f36;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 32px 20px 40px;
  background: radial-gradient(circle at top, #f8faff 0%, #eef2ff 40%, #e7ecff 100%);
}

.app {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
  gap: 20px;
}

.eyebrow {
  font-size: 14px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8a94b8;
  margin: 0 0 6px;
}

h1 {
  font-size: 34px;
  margin: 0;
}

.subtitle {
  margin: 8px 0 0;
  color: #5f6b91;
  line-height: 1.6;
}

.primary {
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  font-size: 16px;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(79, 70, 229, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 26px rgba(79, 70, 229, 0.35);
}

.panel {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: #ffffff;
  border-radius: 18px;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.08);
}

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 200px;
}

.control label {
  font-size: 14px;
  color: #6b7394;
}

.control select {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #d6def8;
  background: #f8f9ff;
  font-size: 15px;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}

.stats .label {
  font-size: 13px;
  color: #7a83a6;
  margin-right: 6px;
}

.stats .value {
  font-size: 20px;
  font-weight: 700;
}

.stats .unit {
  font-size: 13px;
  color: #7a83a6;
  margin-left: 4px;
}

.status {
  padding: 6px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3f49c9;
  font-weight: 600;
}

.board {
  padding: 22px;
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 16px 30px rgba(15, 23, 42, 0.1);
  overflow-x: auto;
}

.grid {
  --rows: 9;
  --cols: 9;
  display: grid;
  grid-template-columns: repeat(var(--cols), 34px);
  grid-template-rows: repeat(var(--rows), 34px);
  gap: 6px;
  justify-content: start;
}

.cell {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: #dfe7ff;
  color: #25316d;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, background 0.2s ease;
}

.cell:hover {
  transform: translateY(-1px);
}

.cell.revealed {
  background: #f5f7ff;
  cursor: default;
  box-shadow: inset 0 0 0 rgba(0, 0, 0, 0);
}

.cell.flagged {
  background: #fff3d6;
}

.cell.mine {
  background: #fee2e2;
  color: #b91c1c;
}

.cell[data-adjacent="1"] {
  color: #2563eb;
}

.cell[data-adjacent="2"] {
  color: #16a34a;
}

.cell[data-adjacent="3"] {
  color: #dc2626;
}

.cell[data-adjacent="4"] {
  color: #9333ea;
}

.cell[data-adjacent="5"] {
  color: #b45309;
}

.cell[data-adjacent="6"] {
  color: #0f766e;
}

.cell[data-adjacent="7"],
.cell[data-adjacent="8"] {
  color: #1f2937;
}

.tips {
  text-align: center;
  color: #6b7394;
  font-size: 14px;
}

@media (max-width: 720px) {
  body {
    padding: 20px 14px 30px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
  }

  .panel {
    flex-direction: column;
  }

  .primary {
    width: 100%;
    text-align: center;
  }
}
