* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #0f172a; color:#e2e8f0; min-height:100vh;
}
#app { max-width: 560px; margin: 0 auto; padding: 20px 16px 40px; }
header { text-align:center; margin-bottom:18px; }
header h1 { font-size: 26px; color:#fff; letter-spacing:1px; }
header .sub { font-size: 13px; color:#8fa7c4; margin-top:6px; }

.card {
  background:#1e293b; border-radius:14px; padding:20px 18px;
  border:1px solid #334155;
}
label { display:block; font-size:13px; color:#94a3b8; margin-bottom:8px; }
input[type=text] {
  width:100%; padding:12px 14px; font-size:16px; color:#fff;
  background:#0f172a; border:1px solid #334155; border-radius:10px; outline:none;
}
input[type=text]:focus { border-color:#3b82f6; }
.btn-row { display:flex; gap:10px; margin-top:14px; }
button {
  flex:1; padding:12px 10px; font-size:15px; border-radius:10px; cursor:pointer;
  border:1px solid #334155; background:#334155; color:#e2e8f0;
}
button.primary { background:#3b82f6; border-color:#3b82f6; color:#fff; font-weight:600; }
button:hover { filter:brightness(1.12); }
button:disabled { opacity:.4; cursor:not-allowed; }
.hint { font-size:12px; color:#64748b; margin-top:12px; text-align:center; }

.statusbar { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-bottom:12px; }
.ply { display:flex; align-items:center; gap:7px; background:#1e293b; border:1px solid #334155; border-radius:10px; padding:8px 12px; min-width:0; }
.ply b { font-size:15px; color:#fbbf24; }
.ply .dot { width:18px; height:18px; border-radius:50%; flex-shrink:0; }
.ply .dot.white { background:#f8fafc; border:1px solid #94a3b8; }
.ply .dot.black { background:#111827; border:1px solid #475569; }
.ply.active { border-color:#fbbf24; box-shadow:0 0 0 1px #fbbf24; }
.ply i { font-style:normal; font-size:13px; color:#cbd5e1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.turnind { font-size:13px; color:#8fa7c4; text-align:center; flex-shrink:0; }

#board {
  display:grid; grid-template-columns:repeat(19,1fr);
  background:#dcb35c; border:6px solid #b8860b; border-radius:8px;
  box-shadow:0 10px 30px rgba(0,0,0,.4);
  position:relative;
}
.cell { position:relative; aspect-ratio:1/1; display:flex; align-items:center; justify-content:center; }
/* 网格线 */
.cell::before, .cell::after { content:""; position:absolute; background:#7a5c10; }
.cell::before { width:100%; height:1px; }
.cell::after { width:1px; height:100%; }
.stone {
  width:88%; height:88%; border-radius:50%; position:relative; z-index:2;
  box-shadow: 0 2px 4px rgba(0,0,0,.45);
}
.stone.b { background:radial-gradient(circle at 35% 30%, #444, #111 70%); border:1px solid #000; }
.stone.w { background:radial-gradient(circle at 35% 30%, #fff, #d7d7d7 70%); border:1px solid #9ca3af; }
.cell.last { background:rgba(255,255,255,.25); }
.stone.lastb::after, .stone.lastw::after {
  content:""; position:absolute; top:50%; left:50%; width:22%; height:22%;
  transform:translate(-50%,-50%); border-radius:50%;
}
.stone.lastb::after { background:#fff; }
.stone.lastw::after { background:#111; }

.actions { display:flex; gap:10px; margin-top:14px; }
#toast {
  position:fixed; left:50%; bottom:30px; transform:translateX(-50%);
  background:rgba(15,23,42,.92); border:1px solid #334155; color:#fff;
  padding:10px 18px; border-radius:10px; font-size:14px; display:none; z-index:60;
}
#toast.show { display:block; }

.modal { position:fixed; inset:0; background:rgba(2,6,23,.7); display:flex; align-items:center; justify-content:center; z-index:50; }
.modal-card { background:#1e293b; border:1px solid #334155; border-radius:14px; padding:26px 24px; max-width:340px; width:90%; text-align:center; }
.modal-card h2 { color:#fff; margin-bottom:10px; }
.modal-card p { color:#94a3b8; font-size:14px; margin-bottom:8px; }
@media (min-width:600px){
  #board { max-width:520px; margin:0 auto; }
}