* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  background: #0d0f14;
  color: #e8e8e8;
  font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
  display: flex;
  justify-content: center;
  padding: 20px 10px;
}

.app-shell { display: flex; flex-direction: column; align-items: center; }

.title {
  margin: 0 0 12px;
  letter-spacing: 6px;
  color: #ffcc33;
  text-shadow: 2px 2px 0 #7a4a00;
}

.main-row { display: flex; gap: 18px; align-items: flex-start; }

.field-wrap {
  position: relative;
  width: 624px;
  height: 624px;
  border: 4px solid #444;
  box-shadow: 0 0 0 4px #111, 0 0 24px rgba(0,0,0,0.6);
  background: #000;
}

#field { display: block; width: 624px; height: 624px; }

.overlay {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(5, 8, 15, 0.86);
  text-align: center;
}

.overlay h2 { font-size: 30px; margin: 0 0 4px; color: #ffcc33; letter-spacing: 3px; }
.overlay h2.danger { color: #ff5c4d; }
.overlay h2.win { color: #7dff8e; }
.overlay .sub { margin: 0 0 6px; color: #ccc; }
.overlay .help { margin-top: 14px; font-size: 13px; color: #9aa0a6; line-height: 1.7; }

.menu-btn {
  font-size: 16px;
  padding: 10px 22px;
  background: #2b2f3a;
  color: #ffe066;
  border: 2px solid #ffcc33;
  border-radius: 4px;
  cursor: pointer;
  min-width: 180px;
}
.menu-btn:hover { background: #3b4150; }
.menu-btn.small { min-width: auto; font-size: 13px; padding: 6px 12px; margin-top: 4px; }

.hud {
  width: 190px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.hud-block {
  background: #1a1d24;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 10px 12px;
}
.hud-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 14px; }
.hud-row.p1 b { color: #ffd54a; }
.hud-row.p2 b { color: #8fd0ff; }
.legend { font-size: 13px; line-height: 1.9; color: #cfd3d8; }
.legend-title { color: #999; font-size: 12px; margin-bottom: 4px; }

/* ===== 手机端（viewport=设计宽度时生效）：去留白，游戏区尽量占满 ===== */
@media (max-width: 660px) {
  .app-shell { padding: 4px 2px; }
  .title { font-size: 18px; margin: 0 0 6px; letter-spacing: 4px; }
}
@media (max-width: 660px) {
  .main-row { flex-direction: column; align-items: center; gap: 8px; }
  .side-panel, .hud, .sidebar { width: 624px; max-width: 100%; }
}
