/* リセットとベーススタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Noto Sans JP', sans-serif;
  background: linear-gradient(135deg, #1e1e1e 0%, #2d2d2d 100%);
  color: #e0e0e0;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ヘッダー */
.header {
  background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
  padding: 1.5rem 2rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.title {
  font-size: 2rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.header-buttons {
  display: flex;
  gap: 1rem;
}

/* ボタン */
.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Noto Sans JP', sans-serif;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-primary {
  background: linear-gradient(135deg, #2196F3 0%, #1976D2 100%);
  color: white;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1976D2 0%, #1565C0 100%);
}

.btn-secondary {
  background: linear-gradient(135deg, #757575 0%, #616161 100%);
  color: white;
}

.btn-secondary:hover {
  background: linear-gradient(135deg, #616161 0%, #424242 100%);
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  width: 100%;
  margin-top: 1rem;
}

/* メインコンテナ */
.main-container {
  display: flex;
  gap: 2rem;
  padding: 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

/* サイドバー */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 300px;
  flex-shrink: 0;
}

/* パネル */
.panel {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.panel-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
  border-bottom: 2px solid #4CAF50;
  padding-bottom: 0.5rem;
}

/* スコアパネル */
.score-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.score-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 1rem;
  border-radius: 8px;
}

.piece {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.piece::after {
  content: '';
  position: absolute;
  top: 20%;
  left: 30%;
  width: 40%;
  height: 40%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.4), transparent);
  border-radius: 50%;
}

.piece-black {
  background: radial-gradient(circle at 30% 30%, #4a4a4a, #000);
}

.piece-white {
  background: radial-gradient(circle at 30% 30%, #fff, #d0d0d0);
}

.score-label {
  font-size: 1.125rem;
  font-weight: 500;
  flex: 1;
}

.score-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4CAF50;
}

/* 情報パネル */
.info-item {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.info-item:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 500;
  color: #b0b0b0;
}

.info-value {
  font-weight: 700;
  color: #fff;
}

/* 統計パネル */
.stats-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
}

.stat-item-full {
  grid-column: 1 / -1;
}

.stat-label {
  font-size: 0.875rem;
  color: #b0b0b0;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: #4CAF50;
}

/* ボードエリア */
.board-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

/* ターンインジケーター */
.turn-indicator {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 1rem 2rem;
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  text-align: center;
  min-width: 200px;
}

/* モーダル */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: linear-gradient(135deg, #2d2d2d 0%, #3a3a3a 100%);
  border-radius: 16px;
  padding: 2rem;
  max-width: 500px;
  width: 90%;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  color: #fff;
  text-align: center;
}

.setting-group {
  margin-bottom: 1.5rem;
}

.setting-label {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: #4CAF50;
}

.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.radio-option:hover {
  background: rgba(0, 0, 0, 0.5);
  border-color: #4CAF50;
}

.radio-option input[type="radio"] {
  margin-right: 0.75rem;
  margin-top: 0.25rem;
  cursor: pointer;
}

.radio-option input[type="radio"]:checked ~ .radio-label {
  color: #4CAF50;
}

.radio-label {
  font-weight: 600;
  font-size: 1rem;
  display: block;
  color: #fff;
  transition: color 0.3s ease;
}

.radio-description {
  display: block;
  font-size: 0.875rem;
  color: #b0b0b0;
  margin-top: 0.25rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.modal-buttons .btn {
  flex: 1;
}

/* ゲーム結果オーバーレイ */
.game-result-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.game-result-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.game-result-overlay.hidden {
  display: none;
}

.result-content {
  text-align: center;
  animation: resultPopIn 0.5s ease-out;
}

.result-emoji {
  font-size: 6rem;
  margin-bottom: 1rem;
  animation: bounce 1s ease infinite;
}

.result-text {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 1rem;
  text-shadow: 0 0 20px currentColor;
}

.result-text.win {
  color: #4CAF50;
}

.result-text.lose {
  color: #f44336;
}

.result-text.tie {
  color: #FFC107;
}

.result-score {
  font-size: 1.5rem;
  color: #e0e0e0;
}

@keyframes resultPopIn {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-20px);
  }
}
