/* ==================== Fonts & Reset ==================== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #4F3FF0;
  --primary-dark: #3D2FD9;
  --primary-light: #6B5EFF;
  --secondary-color: #D5DEFF;
  --player1-color: #000000;
  --player2-color: #FFFFFF;
  --text-dark: #2D3436;
  --text-light: #636E72;
  --bg-light: #F8F9FA;
  --board-bg: #E7C27D;
  --cell-bg: #D5DEFF;
}

body {
  font-family: 'Poppins', sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

/* ==================== Game Header ==================== */
.game-header {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.game-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: white;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.2);
}

.title-icon {
  font-size: 2.5rem;
}

.game-subtitle {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0.5rem 0 0;
}

/* ==================== Main Container ==================== */
.main-container {
  flex: 1;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  padding: 2rem 1rem;
  max-width: 1400px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

/* ==================== Sidebar ==================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  position: sticky;
  top: 2rem;
}

.stats-section,
.info-section {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  text-align: center;
}

/* Player Statistics */
.player-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.player-stat {
  background: var(--bg-light);
  padding: 1rem;
  border-radius: 10px;
  text-align: center;
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.player-disc {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.1);
}

.disc-black {
  background: radial-gradient(circle at 30% 30%, #4A4A4A, #000000);
  border: 2px solid rgba(0, 0, 0, 0.3);
}

.disc-white {
  background: radial-gradient(circle at 30% 30%, #FFFFFF, #D0D0D0);
  border: 2px solid rgba(0, 0, 0, 0.2);
}

.player-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-dark);
}

.player-stat .stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.25rem;
}

.player-stat .stat-label {
  font-size: 0.8rem;
  color: var(--text-light);
}

/* General Stats */
.stat-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background: var(--bg-light);
  border-radius: 8px;
  margin-bottom: 0.5rem;
}

.stat-item:last-of-type {
  margin-bottom: 1rem;
/* Project: GameHub */
}

.stat-item .stat-label {
  font-size: 0.9rem;
  color: var(--text-light);
  font-weight: 500;
}

.stat-item .stat-value {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
}

/* Reset Stats Button */
.reset-stats-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: rgba(255, 107, 107, 0.1);
  color: #FF6B6B;
  border: 2px solid #FF6B6B;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.reset-stats-btn:hover {
  background: #FF6B6B;
  color: white;
  transform: translateX(3px);
}

.reset-stats-btn svg {
  width: 18px;
  height: 18px;
}

/* Info Section */
.info-list {
  list-style: none;
  padding: 0;
}

.info-list li {
  padding: 0.5rem 0;
  color: var(--text-light);
  font-size: 0.9rem;
  position: relative;
  padding-left: 1.5rem;
}

.info-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--player1-color);
  font-weight: bold;
}

/* ==================== Game Main Area ==================== */
.game-main {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  align-items: center;
}

/* Current Player Display */
.current-player {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 15px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 600px;
}

.player-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.current-disc {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.1);
  animation: pulse 1.5s ease-in-out infinite;
}

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

.player-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

/* Game Board */
.board-container {
  background: rgba(255, 255, 255, 0.95);
  padding: 1.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.game-board {
  background: linear-gradient(to right, #E7C27D 0%, #D4A862 100%);
  border: 3px solid #8B5A2B;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
  position: relative;
  width: 600px;
  height: 600px;
}

/* Grid lines using SVG - 15x15 complete grid */
.game-board::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 20px;
  right: 20px;
  bottom: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 560 560'%3E%3Cg stroke='%23000' stroke-width='1'%3E%3Cline x1='0' y1='0' x2='560' y2='0'/%3E%3Cline x1='0' y1='40' x2='560' y2='40'/%3E%3Cline x1='0' y1='80' x2='560' y2='80'/%3E%3Cline x1='0' y1='120' x2='560' y2='120'/%3E%3Cline x1='0' y1='160' x2='560' y2='160'/%3E%3Cline x1='0' y1='200' x2='560' y2='200'/%3E%3Cline x1='0' y1='240' x2='560' y2='240'/%3E%3Cline x1='0' y1='280' x2='560' y2='280'/%3E%3Cline x1='0' y1='320' x2='560' y2='320'/%3E%3Cline x1='0' y1='360' x2='560' y2='360'/%3E%3Cline x1='0' y1='400' x2='560' y2='400'/%3E%3Cline x1='0' y1='440' x2='560' y2='440'/%3E%3Cline x1='0' y1='480' x2='560' y2='480'/%3E%3Cline x1='0' y1='520' x2='560' y2='520'/%3E%3Cline x1='0' y1='560' x2='560' y2='560'/%3E%3Cline x1='0' y1='0' x2='0' y2='560'/%3E%3Cline x1='40' y1='0' x2='40' y2='560'/%3E%3Cline x1='80' y1='0' x2='80' y2='560'/%3E%3Cline x1='120' y1='0' x2='120' y2='560'/%3E%3Cline x1='160' y1='0' x2='160' y2='560'/%3E%3Cline x1='200' y1='0' x2='200' y2='560'/%3E%3Cline x1='240' y1='0' x2='240' y2='560'/%3E%3Cline x1='280' y1='0' x2='280' y2='560'/%3E%3Cline x1='320' y1='0' x2='320' y2='560'/%3E%3Cline x1='360' y1='0' x2='360' y2='560'/%3E%3Cline x1='400' y1='0' x2='400' y2='560'/%3E%3Cline x1='440' y1='0' x2='440' y2='560'/%3E%3Cline x1='480' y1='0' x2='480' y2='560'/%3E%3Cline x1='520' y1='0' x2='520' y2='560'/%3E%3Cline x1='560' y1='0' x2='560' y2='560'/%3E%3C/g%3E%3C/svg%3E");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 1;
}

.cell {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  /* Center point of cell will be at the intersection */
  transform: translate(-50%, -50%);
}

.cell:hover::after {
  content: '';
  position: absolute;
  width: 70%;
  height: 70%;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.1);
  pointer-events: none;
}

.cell.has-stone {
  cursor: not-allowed;
}

.cell.has-stone:hover::after {
  display: none;
}

/* Player Stones */
.stone {
  width: 75%;
  height: 75%;
  border-radius: 50%;
  position: relative;
  animation: placeStone 0.3s ease;
}

.stone-black {
  background: radial-gradient(circle at 30% 30%, #4A4A4A, #000000);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.3),
    inset -2px -2px 4px rgba(0, 0, 0, 0.5),
    inset 2px 2px 4px rgba(255, 255, 255, 0.1);
}

.stone-white {
  background: radial-gradient(circle at 30% 30%, #FFFFFF, #D0D0D0);
  box-shadow: 
    0 2px 4px rgba(0, 0, 0, 0.2),
    inset -2px -2px 4px rgba(0, 0, 0, 0.1),
    inset 2px 2px 4px rgba(255, 255, 255, 0.8);
}

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

/* Winning Stones */
.stone-winner {
  animation: winPulse 0.6s ease-in-out infinite alternate;
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.8) !important;
}

@keyframes winPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }
  100% {
    transform: scale(1.15);
    filter: brightness(1.3);
  }
}

/* Control Buttons */
.control-buttons {
  display: flex;
  gap: 1rem;
}

.control-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem 1.75rem;
  background: rgba(255, 255, 255, 0.95);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  font-family: 'Poppins', sans-serif;
}

.control-btn:hover {
  background: var(--primary-color);

/* Developer: SinceraXY from CUPB */

  color: white;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 63, 240, 0.4);
}

.control-btn svg {
  width: 20px;
  height: 20px;
}

/* ==================== Game Over Modal ==================== */
.game-over-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.game-over-modal.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: white;
  padding: 3rem 2.5rem;
  border-radius: 25px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  transform: scale(0.8);
  transition: transform 0.3s ease;
  max-width: 450px;
  width: 90%;
}

.game-over-modal.active .modal-content {
  transform: scale(1);
  animation: modalBounce 0.6s ease;
}

@keyframes modalBounce {
  0% {
    transform: scale(0.3) rotate(-5deg);
  }
  50% {
    transform: scale(1.05) rotate(2deg);
  }
  100% {
    transform: scale(1) rotate(0deg);
  }
}

.modal-icon {
  font-size: 6rem;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 2.5rem;
  font-weight: 800;
  margin: 0 0 1rem;
  color: var(--text-dark);
}

.modal-message {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0 0 2rem;
}

.modal-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
}

.modal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border: none;
  border-radius: 12px;
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: 'Poppins', sans-serif;
}

.play-again-btn {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  box-shadow: 0 4px 15px rgba(79, 63, 240, 0.4);
}

.play-again-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79, 63, 240, 0.5);
}

.modal-btn svg {
  width: 20px;
  height: 20px;
}

/* ==================== Responsive Design ==================== */
@media screen and (max-width: 1024px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar {
    position: static;
    flex-direction: row;
    gap: 1rem;
  }

  .stats-section,
  .info-section {
    flex: 1;
  }
}

@media screen and (max-width: 768px) {
  .game-title {
    font-size: 2rem;
  }

  .sidebar {
    flex-direction: column;
  }

  .game-board {
    width: 480px;
    height: 480px;
  }

  .current-disc {
    width: 32px;
    height: 32px;
  }

  .player-text {
    font-size: 1.25rem;
/* QQ: 2952671670 */
  }
}

@media screen and (max-width: 550px) {
  .game-header {
    padding: 1.5rem 1rem;
  }

  .game-title {
    font-size: 1.75rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .game-board {
    width: 380px;
    height: 380px;
    padding: 15px;
  }

  .player-stats {
    grid-template-columns: 1fr;
  }

  .modal-title {
    font-size: 2rem;
  }

  .modal-icon {
    font-size: 4rem;
  }
}

@media screen and (max-width: 450px) {
  .game-board {
    width: 320px;
    height: 320px;
    padding: 12px;
  }

  .current-player {
    padding: 1rem;
  }

  .player-text {
    font-size: 1.1rem;
  }

  .current-disc {
    width: 28px;
    height: 28px;
  }

  .control-btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
  }
}