* { margin:0; padding:0; box-sizing:border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #111; color: #eee;
  min-height: 100vh;
  display: flex; justify-content: center; align-items: center;
}
#app {
  display: flex; flex-direction: column; align-items: center;
  gap: 12px; padding: 20px;
}
header { text-align: center; }
header h1 { font-size: 1.8em; color: #4CAF50; letter-spacing: 1px; }
.subtitle { color: #777; font-size: 0.85em; margin-top: 2px; }
#status-bar {
  display: flex; gap: 12px; align-items: center;
  background: #1a1a2e; padding: 6px 16px; border-radius: 20px; font-size: 0.85em;
}
#status-text { color: #aaa; }
#scoreboard { display: flex; align-items: center; gap: 16px; }
.player-side {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 8px; background: #1a1a2e;
  transition: background 0.2s; min-width: 120px;
}
.player-side.active { background: #1a3a1a; outline: 1px solid #4CAF50; }
.vs { color: #555; font-weight: 700; font-size: 0.9em; }
.stone {
  display: inline-block; width: 18px; height: 18px; border-radius: 50%; flex-shrink: 0;
}
.stone.black { background: radial-gradient(circle at 35% 35%, #666, #111); }
.stone.white { background: radial-gradient(circle at 35% 35%, #fff, #bbb); }
.score { font-size: 1.2em; font-weight: 700; }
#board {
  border-radius: 6px; cursor: pointer; box-shadow: 0 2px 16px rgba(0,0,0,0.6);
  max-width: 90vw; max-height: 90vw; width: 480px; height: 480px;
}
.ai-thinking #board { cursor: wait; }
#controls { display: flex; gap: 8px; }
.btn {
  padding: 7px 18px; border: 1px solid #333; border-radius: 6px;
  background: #222; color: #ccc; font-size: 0.85em; cursor: pointer;
  transition: all 0.15s;
}
.btn:hover { background: #333; }
.btn.primary { background: #4CAF50; color: #fff; border-color: #4CAF50; }
.btn.primary:hover { background: #3d9140; }
#move-history { width: 100%; max-width: 480px; font-size: 0.8em; color: #888; }
#move-history summary { cursor: pointer; padding: 4px 0; }
#history-list {
  max-height: 180px; overflow-y: auto; display: grid;
  grid-template-columns: 1fr 1fr; gap: 2px 16px; padding: 4px 8px;
  background: #161616; border-radius: 6px;
}
.history-empty { grid-column: 1 / -1; text-align: center; color: #555; padding: 12px; }
.history-item { display: flex; justify-content: space-between; padding: 2px 4px; }
.history-item.human { color: #8d8; }
.history-item.ai { color: #d88; }
dialog {
  background: #1a1a2e; color: #eee; border: 1px solid #333;
  border-radius: 12px; padding: 28px 32px; min-width: 300px;
  max-width: 90vw; text-align: center; inset: 0; margin: auto;
}
dialog::backdrop { background: rgba(0,0,0,0.7); }
dialog h2 { color: #4CAF50; margin-bottom: 8px; font-size: 1.2em; }
dialog p { color: #999; font-size: 0.9em; margin-bottom: 18px; }
.dialog-actions { display: flex; gap: 10px; justify-content: center; }
.dialog-actions .btn { display: flex; align-items: center; gap: 6px; padding: 10px 22px; font-size: 0.95em; }
#result-score { display: flex; justify-content: center; gap: 20px; margin: 16px 0; font-size: 1.1em; }
#result-score span { padding: 6px 14px; background: #111; border-radius: 6px; }
