/* 复扫雷 · 网页版。窗口/菜单/对话框用经典灰调，客户区里的棋盘、计雷器、人脸全部由 canvas 贴图集绘制。 */
html, body {
  margin: 0;
  padding: 0;
  background: #008080;           /* 原生窗口后面那层桌面色，纯装饰 */
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", Tahoma, sans-serif;
  font-size: 12px;
  -webkit-user-select: none;
  user-select: none;
}
#stage {
  min-height: 100vh;             /* 窗口比视口矮时也把它撑满，窗口就停在顶部居中 */
  padding: 24px 0 48px;          /* 只留上下边距：左右不加，视口够宽时就不会横着溢出 */
  display: flex;
  align-items: center;           /* 窗口比视口矮时上下居中；矮了才需要滚，此时 safe 让它退回起点 */
  align-items: safe center;
  justify-content: center;
  /* 窗口比视口宽时不要卡在中间把左边截掉：safe 让它在溢出方向上退回起点（老浏览器忽略这行，仍是 center） */
  justify-content: safe center;
  box-sizing: border-box;
}
.window {
  background: #c0c0c0;
  border: 2px solid #dfdfdf;
  border-right-color: #808080;
  border-bottom-color: #808080;
  box-shadow: 1px 1px 0 0 #000;
  padding: 3px;
  display: inline-block;
}
.titlebar {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff;
  height: 26px;
  display: flex;
  align-items: center;
  padding: 0 3px 0 4px;
  gap: 6px;
}
.title-icon { width: 16px; height: 16px; image-rendering: pixelated; }
.title-text { flex: 1; font-weight: 700; font-size: 12px; white-space: nowrap; }
.menubar { display: flex; padding: 1px 0 2px; }
.menu { padding: 2px 8px; cursor: default; position: relative; }
.menu:hover, .menu.open { background: #000080; color: #fff; }
.client { display: inline-block; line-height: 0; }
#board { image-rendering: pixelated; display: block; }

/* 下拉菜单 */
.popup {
  position: absolute; z-index: 40;
  background: #c0c0c0;
  border: 2px solid #dfdfdf; border-right-color: #808080; border-bottom-color: #808080;
  box-shadow: 1px 1px 0 0 #000;
  padding: 2px;
  color: #000;
  min-width: 190px;
}
.menu-item {
  display: flex; align-items: center; gap: 16px;
  padding: 3px 18px 3px 22px;
  white-space: nowrap;
}
.menu-item:hover { background: #000080; color: #fff; }
.menu-item .accel { margin-left: auto; opacity: .75; }
.menu-sep { height: 1px; margin: 3px 2px; background: #808080; border-bottom: 1px solid #fff; }

/* 对话框 */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(0, 0, 0, .18);
  display: flex; align-items: center; justify-content: center;
}
.modal-mask[hidden] { display: none; }
.msgbox, .dlg {
  background: #c0c0c0;
  border: 2px solid #dfdfdf; border-right-color: #808080; border-bottom-color: #808080;
  box-shadow: 1px 1px 0 0 #000;
  padding: 3px;
  min-width: 320px;
}
.msg-title, .dlg-title {
  background: linear-gradient(90deg, #000080, #1084d0);
  color: #fff; font-weight: 700;
  padding: 3px 6px;
  margin-bottom: 8px;
}
.msg-body { display: flex; gap: 12px; padding: 4px 14px 10px; align-items: flex-start; }
.msg-icon { width: 32px; height: 32px; image-rendering: pixelated; }
.msg-text { margin: 0; font-family: inherit; font-size: 12px; white-space: pre-wrap; line-height: 1.6; }
.msg-actions, .dlg-actions { display: flex; justify-content: center; gap: 10px; padding: 4px 0 8px; }
.btn {
  min-width: 78px; height: 24px;
  font-family: inherit; font-size: 12px;
  background: #c0c0c0; color: #000;
  border: 2px solid #dfdfdf; border-right-color: #808080; border-bottom-color: #808080;
  cursor: default; padding: 0 10px;
}
.btn:active, .btn.default:active { border-color: #808080 #dfdfdf #dfdfdf #808080; }
.btn:focus { outline: 1px dotted #000; outline-offset: -4px; }

/* 自定义雷区：原生那边整块是白底 */
.dlg { background: #fff; }
.dlg-title { margin-bottom: 10px; }
.dlg-body { padding: 0 14px 4px; }
.dlg .row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.dlg label { width: 62px; }
.dlg .edit {
  width: 70px; height: 20px; box-sizing: border-box;
  border: 2px solid #808080; border-right-color: #dfdfdf; border-bottom-color: #dfdfdf;
  background: #fff; color: #000;
  font-family: inherit; font-size: 12px; padding: 0 4px;
}
.dlg .hint { color: #000; }
.dlg .grid4 {
  display: grid; grid-template-columns: 72px 84px 72px 84px;
  gap: 8px 6px; align-items: center; margin: 2px 0 8px;
}
.dlg .grid4 label { width: auto; }
.dlg .grid4 .edit { width: 62px; }
.dlg .err { color: #000; }
.dlg-actions { padding-bottom: 10px; }
