/* 五子棋对战 v1.0.0 */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f7f4;
  color: #1f2937;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.hidden { display: none !important; }
.page { flex: 1; width: 100%; max-width: 520px; margin: 0 auto; padding: 20px 16px 12px; }

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 26px 0 18px; }
.hero-icon { font-size: 44px; line-height: 1; }
.hero h1 { font-size: 28px; margin-top: 10px; color: #065f46; }
.hero-sub { font-size: 14px; color: #6b7280; margin-top: 6px; }
.sec-title { font-size: 16px; color: #374151; margin: 18px 0 10px; }
.mode-list { display: flex; flex-direction: column; gap: 10px; }
.mode-card {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 14px;
  padding: 14px 16px; cursor: pointer; transition: transform .12s, box-shadow .12s;
  text-align: left; width: 100%; font-family: inherit;
}
.mode-card:active { transform: scale(.98); }
.mode-card:hover { box-shadow: 0 6px 18px rgba(16,185,129,.16); }
.mode-emoji { font-size: 28px; }
.mode-info { flex: 1; }
.mode-name { font-size: 16px; font-weight: 600; color: #111827; }
.mode-desc { font-size: 12.5px; color: #6b7280; margin-top: 2px; display: block; }
.tip-list { background: #ecfdf5; border-radius: 14px; padding: 14px 16px 14px 32px; }
.tip-list li { font-size: 13.5px; color: #4b5563; line-height: 1.9; }

/* ---------- 对局页 ---------- */
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.game-title { font-size: 16px; font-weight: 700; color: #065f46; }
.ghost-btn {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 7px 12px; font-size: 13px; color: #4b5563; cursor: pointer; font-family: inherit;
}
.game-meta {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 10px 0 12px; font-size: 13.5px; color: #4b5563;
}
.board-wrap { position: relative; margin: 0 auto; width: min(100%, 440px); }
#board {
  display: block; width: 100%; height: auto;
  background: #e8c88f; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(120, 83, 34, .25);
  touch-action: manipulation;
}
.board-mask {
  position: absolute; inset: 0; border-radius: 12px;
  background: rgba(6, 78, 59, .45);
  display: flex; align-items: center; justify-content: center;
}
.mask-card { text-align: center; color: #fff; }
.mask-emoji { font-size: 40px; }
.mask-title { font-size: 17px; margin-top: 8px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 23, 42, .6);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 18px; max-width: 340px; width: 100%;
  padding: 28px 24px; text-align: center;
}
.win-emoji { font-size: 44px; }
.modal-card h3 { font-size: 20px; color: #111827; margin: 10px 0 6px; }
.modal-card p { font-size: 14px; color: #6b7280; line-height: 1.7; }
.modal-btns { display: flex; flex-direction: column; gap: 8px; margin-top: 18px; }
.primary-btn, .secondary-btn {
  display: block; width: 100%; padding: 12px; border-radius: 12px;
  font-size: 15px; font-weight: 600; cursor: pointer; font-family: inherit;
  text-decoration: none; border: 0; text-align: center; box-sizing: border-box;
}
.primary-btn { background: #10b981; color: #fff; }
.secondary-btn { background: #f3f4f6; color: #374151; }

/* ---------- 页脚 ---------- */
.footer {
  text-align: center; padding: 16px 12px 22px;
  font-size: 12px; color: #9ca3af;
}
.footer a { color: #6b7280; text-decoration: none; }
.footer .dot { margin: 0 6px; }
