body { font-family: Arial, sans-serif; background: #f7f7f7; margin: 0; }
.container { max-width: 700px; margin: 40px auto; background: #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); padding: 24px; }
h1 { text-align: center; margin-bottom: 24px; }
#status, #game-status { text-align: center; margin: 12px 0; font-size: 1.1em; }

/* Gomoku board styling */
.board { 
  display: grid; 
  grid-template-columns: repeat(15, 30px); 
  grid-template-rows: repeat(15, 30px); 
  justify-content: center; 
  margin: 20px auto; 
  background: #dcb35c; 
  padding: 20px; 
  border-radius: 8px; 
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  position: relative;
  width: fit-content;
}

/* Intersection points */
.intersection { 
  width: 30px; 
  height: 30px; 
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* Grid lines */
.intersection::before,
.intersection::after {
  content: '';
  position: absolute;
  background: #000;
  pointer-events: none;
}

/* Horizontal line */
.intersection::before {
  width: 100%;
  height: 1px;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* Vertical line */
.intersection::after {
  height: 100%;
  width: 1px;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
}

/* Hide partial lines on edges */
.intersection[data-col="0"]::before { width: 50%; left: 50%; }
.intersection[data-col="14"]::before { width: 50%; left: 0; }
.intersection[data-row="0"]::after { height: 50%; top: 50%; }
.intersection[data-row="14"]::after { height: 50%; top: 0; }

/* Star points (traditional Gomoku board markings) - using a pseudo element on the parent grid */
.board::before {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
  top: calc(20px + 3 * 30px + 15px);
  left: calc(20px + 3 * 30px + 15px);
  transform: translate(-50%, -50%);
  box-shadow: 
    calc(8 * 30px) 0 0 #000,
    calc(4 * 30px) calc(4 * 30px) 0 #000,
    0 calc(8 * 30px) 0 #000,
    calc(8 * 30px) calc(8 * 30px) 0 #000;
}

/* Stones */
.stone {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  position: relative;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  pointer-events: none;
}

.stone.black {
  background: radial-gradient(circle at 30% 30%, #4a4a4a, #000);
  border: 1px solid #000;
}

.stone.white {
  background: radial-gradient(circle at 30% 30%, #fff, #e8e8e8);
  border: 1px solid #999;
}

.stone.preview {
  opacity: 0.5;
}

.intersection.hover {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

#restart { display: block; margin: 0 auto; padding: 8px 24px; font-size: 1em; border-radius: 6px; border: none; background: #0077cc; color: #fff; cursor: pointer; }
#restart:hover { background: #005fa3; }

/* Mobile responsive styles */
@media (max-width: 700px) {
  .container { 
    margin: 20px auto; 
    padding: 16px; 
    border-radius: 8px;
  }
  
  h1 { 
    font-size: 1.5em; 
    margin-bottom: 16px; 
  }
  
  .board { 
    grid-template-columns: repeat(15, 24px); 
    grid-template-rows: repeat(15, 24px); 
    padding: 16px; 
    margin: 12px auto;
  }
  
  .intersection { 
    width: 24px; 
    height: 24px; 
  }
  
  .stone {
    width: 20px;
    height: 20px;
  }
  
  #status, #game-status { 
    font-size: 1em; 
    margin: 8px 0; 
  }
  
  #player-names {
    font-size: 0.9em;
  }
  
  #player-names span {
    min-width: 80px !important;
  }
  
  #player-names img,
  #player-names div[style*="border-radius: 50%"] {
    width: 24px !important;
    height: 24px !important;
  }
}

@media (max-width: 500px) {
  .container { 
    margin: 10px; 
    padding: 12px; 
  }
  
  h1 { 
    font-size: 1.3em; 
  }
  
  .board { 
    grid-template-columns: repeat(15, 18px); 
    grid-template-rows: repeat(15, 18px); 
    padding: 12px; 
  }
  
  .intersection { 
    width: 18px; 
    height: 18px; 
  }
  
  .stone {
    width: 15px;
    height: 15px;
  }
  
  #player-names {
    font-size: 0.85em;
  }
  
  #player-names span {
    min-width: 60px !important;
    margin-left: 6px !important;
    margin-right: 6px !important;
  }
  
  #player-names img,
  #player-names div[style*="border-radius: 50%"] {
    width: 20px !important;
    height: 20px !important;
  }
  
  #timer-container {
    font-size: 0.9em;
  }
}
