/* Arkanoid Game Styling */

/* Background Selector Styling */
#background-selector {
  text-align: center;
  margin: 20px 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
}

#background-selector label {
  margin-right: 10px;
  font-weight: bold;
  color: #333;
}

#bg-select {
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid #333;
  border-radius: 5px;
  background-color: #fff;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

#bg-select:hover {
  border-color: #666;
}

#bg-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 5px rgba(0, 123, 255, 0.3);
}

:root {
  --width: 1000px;
  --height: 650px;
}

#main {
  position: relative;
  width: 1000px;
  margin: 0 auto;
  width: var(--width);
  height: var(--height);
  font-size: 32px;
  font-family: Arial, Helvetica, sans-serif;
}

canvas {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 10;
  border-top: 1px solid grey;
  border-left: 1px solid grey;
  border-right: 1px solid grey;
  margin-bottom: 40px;
}

#display {
  position: absolute;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  width: var(--width);
}

#score,
#info {
  width: 200px;
}

/* Speech Bubble Styling */
.speech-bubble {
  position: absolute;
  z-index: 5;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.3s ease-in-out;
  pointer-events: none;
}

.speech-bubble.show {
  opacity: 1;
  transform: scale(1);
  animation: bounce 0.5s ease-out;
}

.speech-bubble.hidden {
  display: none;
}

.bubble-content {
  background: #ffffff;
  border: 3px solid #333;
  border-radius: 20px;
  padding: 10px 15px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  max-width: 200px;
  font-size: 14px;
  font-weight: bold;
  color: #333;
  text-align: center;
}

.bubble-tail {
  position: absolute;
  width: 0;
  height: 0;
}

/* Left side bubbles */
.left-side {
  left: -220px;
  top: 50%;
  transform: translateY(-50%);
}

.left-side .bubble-tail {
  right: -15px;
  top: 50%;
  transform: translateY(-50%);
  border-left: 15px solid #333;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.left-side .bubble-tail::after {
  content: '';
  position: absolute;
  right: 3px;
  top: -8px;
  border-left: 12px solid #ffffff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Right side bubbles */
.right-side {
  right: -220px;
  top: 50%;
  transform: translateY(-50%);
}

.right-side .bubble-tail {
  left: -15px;
  top: 50%;
  transform: translateY(-50%);
  border-right: 15px solid #333;
  border-top: 10px solid transparent;
  border-bottom: 10px solid transparent;
}

.right-side .bubble-tail::after {
  content: '';
  position: absolute;
  left: 3px;
  top: -8px;
  border-right: 12px solid #ffffff;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
}

/* Bottom side bubbles */
.bottom-side {
  bottom: -100px;
  left: 50%;
  transform: translateX(-50%);
}

.bottom-side .bubble-tail {
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  border-bottom: 15px solid #333;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
}

.bottom-side .bubble-tail::after {
  content: '';
  position: absolute;
  top: 3px;
  left: -8px;
  border-bottom: 12px solid #ffffff;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
}

@keyframes bounce {
  0% { transform: scale(0.8) translateY(10px); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .left-side { left: -200px; }
  .right-side { right: -200px; }
}
