* { 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); }
.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 .dot { width:18px; height:18px; border-radius:50%; flex-shrink:0; }
.ply .dot.a { background:#e11d48; border:1px solid #fda4af; }
.ply .dot.b { background:#38bdf8; border:1px solid #bae6fd; }
.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; }

#boardWrap { background:#1e293b; border:1px solid #334155; border-radius:12px; padding:6px; }
#board { width:100%; display:block; }
#board .gridline { stroke:#94a3b8; stroke-width:1; opacity:.55; }
#board .hole { fill:#0f172a; stroke:#475569; stroke-width:1; }
#board .marble { stroke:#0b1220; stroke-width:1.5; }
#board .marble.a { fill:#e11d48; }
#board .marble.b { fill:#38bdf8; }
#board .marble.a:hover, #board .marble.b:hover { filter:brightness(1.15); }
#board .tgt { fill:rgba(34,197,94,.5); stroke:#34d399; stroke-width:1.5; }
#board .sel { stroke:#fbbf24; stroke-width:3; }

.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; }