* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  background: #ff8a3d;
  color: #3a2416;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  overflow: hidden;
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
}
button { font-family: inherit; }
.stage {
  height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 14px 12px 16px;
  background:
    radial-gradient(circle at 20% 0%, #ffd7a8 0, transparent 42%),
    linear-gradient(180deg, #ffb067 0%, #ff8a3d 48%, #f97316 100%);
}
.hud {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.hud-box {
  min-width: 88px;
  background: rgba(255, 252, 246, 0.94);
  border-radius: 14px;
  padding: 8px 12px;
}
.hud-label { display: block; font-size: 12px; color: #8a5a32; }
.hud-box b { font-size: 22px; line-height: 1.1; color: #c2410c; }
.face {
  width: 56px;
  height: 56px;
  border: 0;
  border-radius: 16px;
  background: #fff7ed;
  color: #ea580c;
  display: flex;
  align-items: center;
  justify-content: center;
}
.face .mp-icon { font-size: 32px; }
.board-wrap {
  flex: 1;
  min-height: 0;
  margin-top: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.board {
  width: min(100%, 420px);
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  background: rgba(90, 42, 12, 0.28);
  border-radius: 16px;
  padding: 8px;
  touch-action: manipulation;
}
.cell {
  aspect-ratio: 1;
  border: 0;
  border-radius: 8px;
  background: #ffe4c4;
  color: #7c2d12;
  font-size: 16px;
  font-weight: 700;
  padding: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.cell.hidden { background: #ffb26b; box-shadow: inset 0 -3px 0 rgba(180, 70, 10, 0.35); }
.cell.open { background: #fffaf3; }
.cell.flag { background: #fb923c; color: #fff; }
.cell.boom { background: #ef4444; color: #fff; }
.cell.n1 { color: #2563eb; }
.cell.n2 { color: #16a34a; }
.cell.n3 { color: #dc2626; }
.cell.n4 { color: #7c3aed; }
.hint {
  margin: 10px 0 0;
  text-align: center;
  color: #fff7ed;
  font-size: 13px;
}
