/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100vw;
  height: 100vh;
  background: #1a1a1a;
  font-family: Arial, sans-serif;
  overflow: hidden;
  color: white;
}
.foul-banner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: #ff4444;
    color: white;
    padding: 15px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    z-index: 1000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.foul-banner.show {
    transform: translateY(0);
}

#game-container {
  display: flex;
  width: 100vw;
  height: 100vh;
}

/* Canvas container - 80% of screen width */
#canvas-container {
  flex: 0 0 80vw;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #222;
  padding: 1vh;
}

/* Canvas styling - maintains aspect ratio */
#screen {
  width: 78vw;
  height: calc(78vw * 0.583); /* Maintains 1200:700 aspect ratio */
  max-height: 98vh;
  border-radius: 1vw;
  box-shadow: 0 0 2vw rgba(0, 0, 0, 0.5);
  background: #006600;
}

/* Scoreboard - 20% of screen width */
#scoreboard {
  flex: 0 0 20vw;
  background: #2d2d2d;
  padding: 2vh 1vw;
  overflow-y: auto;
  border-left: 3px solid #444;
  min-width: 200px;
}

#scoreboard h2 {
  text-align: center;
  margin: 0 0 3vh 0;
  font-size: 2.5vw;
  color: #fff;
  border-bottom: 2px solid #444;
  padding-bottom: 1vh;
}

/* Player sections */
.player-section {
  margin-bottom: 3vh;
  padding: 2vh 1vw;
  border-radius: 1vw;
  background: #383838;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.player-section.active {
  background: #3a5998;
  border-color: #4169e1;
  box-shadow: 0 0 1.5vw rgba(58, 89, 152, 0.6);
}

.player-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5vh;
}
.potted-ball {
  display: inline-block;
  vertical-align: middle;
  width: 28px;
  height: 28px;
  margin: 2px;
  border-radius: 50%;
  background: none;
  border: none;
  box-shadow: none;
}

/* Turn indicators */
.turn-indicator {
  width: 2vw;
  height: 2vw;
  min-width: 15px;
  min-height: 15px;
  border-radius: 50%;
  background: #666;
  margin-right: 1vw;
  transition: all 0.3s ease;
  border: 2px solid #999;
}

.turn-indicator.active {
  background: #4CAF50;
  border-color: #4CAF50;
  box-shadow: 0 0 1vw rgba(76, 175, 80, 0.8);
}

.player-name {
  font-size: 1.8vw;
  font-weight: bold;
  color: #fff;
}

/* Score display */
.score-display {
  font-size: 4vw;
  font-weight: bold;
  text-align: center;
  margin: 1vh 0;
  color: #4CAF50;
  text-shadow: 0 0 0.5vw rgba(76, 175, 80, 0.5);
}

/* Potted balls container */
.balls-potted {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5vw;
  min-height: 4vh;
  padding: 1vh;
  background: #1a1a1a;
  border-radius: 0.5vw;
  border: 1px solid #555;
}

.potted-ball {
  width: 2.5vw;
  height: 2.5vw;
  min-width: 20px;
  min-height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2vw;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}


#start-screen, #win-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 1);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  color: white;
}

#win-screen {
  display: none;
}

/* Start screen styling */
#start-screen h1 {
  font-size: 6vw;
  margin-bottom: 3vh;
  text-shadow: 0 0 2vw rgba(255, 255, 255, 0.5);
}

.instructions {
  max-width: 40vw;
  text-align: center;
  margin-bottom: 4vh;
  padding: 3vh;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 2vw;
  backdrop-filter: blur(10px);
}

.instructions h2 {
  font-size: 3vw;
  margin-bottom: 2vh;
  color: #4CAF50;
}

.instructions p {
  font-size: 1.8vw;
  margin: 1vh 0;
  line-height: 1.4;
}

/* Win screen with memes */
.win-meme-row {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: 3vw;
}

.win-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.win-center h1 {
  font-size: 5vw;
  margin-bottom: 2vh;
  text-shadow: 0 0 2vw rgba(255, 255, 255, 0.5);
}

.win-center p {
  font-size: 2.5vw;
  margin-bottom: 3vh;
}

.meme-img {
  width: 15vw;
  max-width: 200px;
  height: auto;
  border-radius: 1vw;
  box-shadow: 0 0 2vw rgba(255, 255, 255, 0.3);
  transition: transform 0.3s ease;
}

.meme-img:hover {
  transform: scale(1.05);
}

/* Buttons */
button {
  padding: 2vh 3vw;
  font-size: 2.2vw;
  margin: 1vh;
  cursor: pointer;
  background: linear-gradient(135deg, #4CAF50, #45a049);
  color: white;
  border: none;
  border-radius: 1vw;
  box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
  transition: all 0.3s ease;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

button:hover {
  background: linear-gradient(135deg, #45a049, #4CAF50);
  box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(76, 175, 80, 0.3);
}

/* Responsive design */
@media (max-width: 1200px) {
  #scoreboard h2 {
    font-size: 3vw;
  }
  
  .player-name {
    font-size: 2.2vw;
  }
  
  .score-display {
    font-size: 5vw;
  }
  
  button {
    font-size: 2.5vw;
  }
}

@media (max-width: 900px) {
  #game-container {
    flex-direction: column;
  }
  
  #canvas-container {
    flex: 0 0 70vh;
    width: 100vw;
  }
  
  #screen {
    width: 95vw;
    height: calc(95vw * 0.583);
    max-height: 65vh;
  }
  
  #scoreboard {
    flex: 0 0 30vh;
    width: 100vw;
    border-left: none;
    border-top: 3px solid #444;
    padding: 1vh 2vw;
  }
  
  .win-meme-row {
    flex-direction: column;
    gap: 2vh;
  }
  
  .meme-img {
    width: 25vw;
    max-width: 150px;
  }
  
  .instructions {
    max-width: 80vw;
  }
  
  .instructions h2 {
    font-size: 5vw;
  }
  
  .instructions p {
    font-size: 3vw;
  }
  
  button {
    font-size: 4vw;
    padding: 2vh 4vw;
  }
}

@media (max-width: 600px) {
  #start-screen h1 {
    font-size: 8vw;
  }
  
  .win-center h1 {
    font-size: 7vw;
  }
  
  .turn-indicator {
    width: 4vw;
    height: 4vw;
  }
  
  .player-name {
    font-size: 4vw;
  }
  
  .score-display {
    font-size: 8vw;
  }
  
  .potted-ball {
    width: 5vw;
    height: 5vw;
    font-size: 2.5vw;
  }
}

/* Animation for smooth transitions */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 1vw rgba(76, 175, 80, 0.5);
  }
  50% {
    box-shadow: 0 0 2vw rgba(76, 175, 80, 0.8);
  }
}

.turn-indicator.active {
  animation: glow 2s ease-in-out infinite;
}
    
