:root {
  --bg-start: #0f172a;
  --bg-end: #1b2036;
  --card: #0b1224;
  --card-hover: #111936;
  --text: #e6eaff;
  --muted: #b8c0ff;
  --accent: #7c3aed;
  --accent-2: #22d3ee;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: radial-gradient(1000px 600px at 10% 10%, #0a1022 10%, var(--bg-end) 50%), linear-gradient(160deg, var(--bg-start), var(--bg-end));
}

.site-header {
  padding: 24px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}
.logo {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 28px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(34,211,238,0.25));
  box-shadow: 0 8px 24px rgba(124,58,237,0.35), inset 0 0 20px rgba(34,211,238,0.25);
}
.titles h1 {
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.titles .subtitle {
  margin: 2px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.container { max-width: 1024px; margin: 0 auto; padding: 32px 24px; }
.hero h2 { font-size: 28px; margin: 0 0 8px; }
.hero-desc { color: var(--muted); margin: 0 0 24px; }

.modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 20px;
}
.mode-card {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 20px;
  padding: 20px;
  text-decoration: none;
  color: var(--text);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(34,211,238,0.08)), var(--card);
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 6px 20px rgba(12,17,34,0.5);
  transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.mode-card:hover { transform: translateY(-2px); background: var(--card-hover); box-shadow: 0 12px 28px rgba(12,17,34,0.65); }
.mode-icon {
  width: 72px; height: 72px; display: grid; place-items: center; font-size: 28px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(34,211,238,0.2));
}
.mode-content h3 { margin: 4px 0 6px; font-size: 20px; }
.mode-content p { margin: 0 0 10px; color: var(--muted); }
.cta { display: inline-block; color: #c9a8ff; font-weight: 700; }

.tips { margin-top: 24px; }
.tips ul { margin: 0; padding-left: 20px; color: var(--muted); }

.site-footer { text-align: center; padding: 24px; color: var(--muted); }

@media (max-width: 768px) {
  .modes { grid-template-columns: 1fr; }
}

/* --- Gomoku (Single Player) styles --- */
.controls { display: flex; align-items: center; gap: 12px; margin: 8px 0 16px; }
.control-item { color: var(--muted); font-weight: 700; }
.btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(124,58,237,0.18);
  color: var(--text);
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border: none; }
.status { margin: 10px 0 16px; color: var(--muted); font-weight: 700; }
.select { padding: 6px 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.12); background: rgba(255,255,255,0.06); color: var(--text); }
.skill-controls { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.reverse-controls { display: flex; align-items: center; gap: 10px; }

.board-section { margin-top: 8px; }
.board {
  width: min(720px, 94vw);
  height: min(720px, 94vw);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  grid-template-rows: repeat(15, 1fr);
  background: #d1a671;
  border: 8px solid #5f4324;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 10px 26px rgba(0,0,0,0.4);
}
.cell {
  position: relative;
  border: 1px solid rgba(0,0,0,0.25);
  display: grid;
  place-items: center;
}
.cell:hover { background: rgba(255,255,255,0.06); }
.stone {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  border-radius: 50%;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
}
.stone.black { background: radial-gradient(circle at 30% 30%, #444 0%, #111 70%, #000 100%); }
.stone.white { background: radial-gradient(circle at 30% 30%, #fff 0%, #eaeaea 70%, #cfcfcf 100%); box-shadow: inset 0 2px 8px rgba(0,0,0,0.25); }
.stone.fake { background: radial-gradient(circle at 30% 30%, #8e44ad 0%, #6c3483 70%, #4a235a 100%); opacity: 0.8; box-shadow: 0 0 10px rgba(142,68,173,0.7), inset 0 4px 10px rgba(0,0,0,0.45); }
.preview { outline: 3px solid rgba(124,58,237,0.85); border-radius: 50%; }
.actions { display: flex; gap: 12px; justify-content: center; margin-top: 12px; }
.skill-target { outline: 3px solid rgba(34,211,238,0.95); outline-offset: -3px; }
.seal-block {
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  background-image: url('../SXC.png');
  background-size: cover;
  background-position: center;
  border-radius: 6px;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.45);
}

/* 地动山摇动画层 */
.quake-layer { position: absolute; inset: 0; pointer-events: none; }
.quake-piece {
  position: absolute;
  width: calc(100% / var(--size) - 6px);
  height: calc(100% / var(--size) - 6px);
  border-radius: 50%;
  box-shadow: inset 0 4px 10px rgba(0,0,0,0.5);
}
.quake-piece.black { background: radial-gradient(circle at 30% 30%, #444 0%, #111 70%, #000 100%); }
.quake-piece.white { background: radial-gradient(circle at 30% 30%, #fff 0%, #eaeaea 70%, #cfcfcf 100%); box-shadow: inset 0 2px 8px rgba(0,0,0,0.25); }

@media (max-width: 520px) {
  .board { width: 92vw; height: 92vw; }
}