*,
*::before,
*::after {
  box-sizing: border-box;
  user-select: none !important;
}

body {
  background: radial-gradient(circle at center, #1b1b1b 0%, #000 100%);
  color: #fff;
  font-family: "Roboto", sans-serif;
  text-align: center;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.container {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

h1 {
  margin-bottom: 10px;
  font-size: 32px;
  font-weight: 700;
  color: #ff4757;
}

#credits-container {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 20px;
  font-weight: bold;
  color: #f39c12;
}

#info-button {
  margin-left: 8px;
  cursor: pointer;
  font-weight: bold;
  font-size: 20px;
  user-select: none;
  background: transparent;
  border: 2px solid #ffd700; /* Golden border */
  border-radius: 50%;
  color: #ffd700; /* Golden text color */
  width: 32px;
  height: 32px;
  line-height: 25px;
  text-align: center;
  box-shadow: 0 0 6px #ffd700, 0 0 12px #ffd700, 0 0 18px #ffd700; /* Golden glow */
  transition: all 0.2s ease;
}

#info-button:hover {
  color: #ffcc00; /* Slightly lighter golden color for hover */
  border-color: #ffcc00; /* Lighter golden border on hover */
  box-shadow: 0 0 8px #ffcc00, 0 0 16px #ffcc00, 0 0 24px #ffcc00; /* Lighter golden glow */
  transform: scale(1.05);
  cursor: pointer;
}

#info-button:disabled {
  color: #fff;
  background: #7f8c8d;
  box-shadow: none;
  border-color: transparent;
  cursor: not-allowed;
  animation: none;
  transform: none;
}

#logo-container {
  position: absolute;
  top: 20px;
  left: 20px;
  display: flex;
  align-items: center;
  z-index: 100; /* on top */
}

.game-logo-small {
  height: 90px; /* smaller size to fit top left */
  width: auto;
  user-select: none;
  pointer-events: none;
}

.jackpot-title {
  margin-top: 90px;
}

#game {
  position: relative;
  width: 100%;
  max-width: 400px;
  min-width: 360px;
  height: 400px;
  margin: 10px auto;
  padding: 0;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(10px);
  border-radius: 8px;
  box-shadow: 0 0 20px rgba(255, 255, 0, 0.5), 0 0 40px rgba(0, 255, 0, 0.3),
    0 0 60px rgba(0, 0, 255, 0.2);
  animation: led-border 5s linear infinite;
}

@keyframes led-border {
  0% {
    box-shadow: 0 0 20px #ff0, 0 0 40px #0f0, 0 0 60px #00f;
  }
  33% {
    box-shadow: 0 0 20px #0f0, 0 0 40px #00f, 0 0 60px #f00;
  }
  66% {
    box-shadow: 0 0 20px #00f, 0 0 40px #f00, 0 0 60px #0f0;
  }
  100% {
    box-shadow: 0 0 20px #f00, 0 0 40px #ff0, 0 0 60px #00f;
  }
}

.circle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
}

#outer-circle {
  width: 100%;
  height: 100%;
}

#inner-circle {
  width: 63%;
  height: 63%;
}

.segment {
  position: absolute;
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(5px);
  border-radius: 8px;
  text-align: center;
  line-height: 50px;
  font-weight: bold;
  color: #fff;
  transition: transform 0.2s ease-in-out;
}

.segment:hover {
  transform: scale(1.1);
}

.highlight {
  position: absolute;
  width: 20px;
  height: 20px;
  background: red;
  opacity: 0.7;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform-origin: center center;
  pointer-events: none;
  z-index: 10;
}

#bet-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 30px;
}

#bet-number {
  padding: 8px 12px;
  font-size: 14px;
  background: #222;
  color: #fff;
  border: 1px solid #333;
  border-radius: 5px;
  margin-right: 10px;
}

#wager-container {
  display: flex;
  align-items: center;
}

#wager {
  padding: 8px 12px;
  font-size: 14px;
  width: 80px;
  background: #222;
  color: #fff;
  border: 1px solid #333;
  border-radius: 5px;
  text-align: center;
}

.wager-btn {
  padding: 8px 12px;
  font-size: 14px;
  background: #444;
  color: #fff;
  border: 1px solid #555;
  border-radius: 5px;
  margin: 0 5px;
  cursor: pointer;
}

.wager-btn:hover {
  background: #555;
}

.wager-btn:disabled {
  background: #7f8c8d;
  cursor: not-allowed;
  animation: none;
}

#spin {
  padding: 8px 12px;
  font-size: 14px;
  margin-top: 10px;
  background: #27ae60;
  color: #fff;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  animation: pulse 1.5s infinite;
}

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

#spin:hover {
  background: #2ecc71;
}

#spin:disabled {
  background: #7f8c8d;
  cursor: not-allowed;
  animation: none;
}

#popup {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  background: rgba(0, 0, 0, 0.8);
  border-radius: 10px;
  text-align: center;
  z-index: 100;
  display: none;
}

#popup.shake {
  display: block;
}

#popup-text {
  font-size: 24px;
  font-weight: bold;
}

#confetti-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 99;
}

@keyframes shake {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0;
  }
  5% {
    transform: translate(-2px, -2px) rotate(-1deg) scale(1.02);
    opacity: 0.3;
  }
  10% {
    transform: translate(2px, 1px) rotate(1deg) scale(1.01);
    opacity: 0.6;
  }
  20% {
    transform: translate(-3px, 0px) rotate(-1.5deg) scale(1.03);
    opacity: 0.8;
  }
  30% {
    transform: translate(3px, 2px) rotate(1.5deg) scale(1.02);
  }
  40% {
    transform: translate(1px, -1px) rotate(-1deg) scale(1.01);
  }
  50% {
    transform: translate(-1px, 2px) rotate(1deg) scale(1.02);
  }
  60% {
    transform: translate(1px, 1px) rotate(-0.5deg) scale(1.01);
  }
  70% {
    transform: translate(-1px, -2px) rotate(0.5deg) scale(1);
  }
  80% {
    transform: translate(2px, -1px) rotate(-0.3deg) scale(1.01);
  }
  90% {
    transform: translate(-2px, 1px) rotate(0.3deg) scale(1);
  }
  100% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 1;
  }
}

.shake {
  animation: shake 0.6s ease-in-out;
}

@media (max-width: 768px) {
  #bet-controls {
    flex-direction: column;
    align-items: stretch;
  }

  #bet-number,
  #wager-container,
  #spin {
    width: 100%;
    max-width: 300px;
  }

  .wager-btn {
    flex: 1;
  }

  #wager {
    flex: 2;
  }
}

/* When screen width is less than 400px, allow horizontal scroll */
@media (max-width: 399px) {
  body {
    overflow-x: auto;
  }
}
