* { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f6f7fb;
  margin: 0;
  padding: 12px;
  color: #1f2330;
}
.wrap { max-width: 480px; margin: 0 auto; text-align: center; }
.status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 600;
}
#newbtn {
  background: #4f46e5; color: white; border: 0; padding: 8px 14px;
  border-radius: 6px; cursor: pointer;
}
#newbtn:hover { background: #4338ca; }
.scores {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 8px;
  font-weight: 700;
}
.score-pill {
  padding: 4px 10px; border-radius: 999px; background: #e5e7eb;
}
.board {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  border: 4px solid #1f2937;
  border-radius: 6px;
  aspect-ratio: 1;
  user-select: none;
  background: #1f2937;
  gap: 1px;
}
.cell {
  position: relative;
  aspect-ratio: 1;
  background: #2e7d4f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  touch-action: manipulation;
}
.cell.legal::after {
  content: '';
  width: 22%; height: 22%;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
}
.piece {
  width: 78%;
  height: 78%;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.35);
}
.piece.black { background: #1f2937; }
.piece.white { background: #f9fafb; border-color: #6b7280; }
.result {
  margin-top: 12px;
  padding: 10px;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
}
.result.win { background: #d1fae5; color: #065f46; }
.result.lose { background: #fee2e2; color: #991b1b; }
.result.draw { background: #fef3c7; color: #92400e; }
.result.hidden { display: none; }
.difficulty { display: flex; gap: 4px; padding: 8px 0; justify-content: center; margin-bottom: 4px; }
.difficulty button {
  padding: 6px 14px; border-radius: 8px; border: 0;
  background: rgba(0,0,0,0.08); cursor: pointer; font-weight: 600;
  font-family: inherit; font-size: 14px; touch-action: manipulation;
}
.difficulty button.active { background: #6a4c93; color: white; }
.ai-thinking {
  text-align: center;
  padding: 6px 8px;
  margin-bottom: 8px;
  color: #6a4c93;
  font-weight: 600;
  font-size: 14px;
  animation: ai-pulse 1.2s ease-in-out infinite;
}
.ai-thinking[hidden] { display: none; }
@keyframes ai-pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
