/* General styles */
body {
  margin: 0;
  padding: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  background-image: url("assets/background.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

/* Title bar */
.title-bar {
  width: 100%;
  text-align: center;
  padding: 15px 0;
  background: rgba(0,0,0,0.6);
  color: #ffdc00;
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 20;
}

.title-bar h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: bold;
  letter-spacing: 2px;
}

header {
  width: 100%;
  background: rgba(0, 0, 0, 0.5);
  padding: 10px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 60px; /* push below title */
  z-index: 15;
}

header button {
  background-color: #ffcc00;
  border: none;
  border-radius: 5px;
  padding: 10px 15px;
  font-size: 1rem;
  font-weight: bold;
  cursor: pointer;
  color: #333;
  transition: background-color 0.2s ease;
}

header button:hover {
  background-color: #ffd633;
}

header button:disabled {
  background-color: #888;
  cursor: not-allowed;
}

/* Speed control */
.speed-control {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: bold;
}

.speed-control input[type="range"] {
  width: 120px;
}

/* Main board container */
.board-container {
  width: 90%;
  max-width: 1000px;
  margin-top: 20px;
  background: rgba(0, 0, 0, 0.4);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

/* Drawn numbers history */
.history {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
  min-height: 40px;
  font-size: 0.9rem;
}

.history span {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 6px;
  border-radius: 4px;
  margin-right: 2px;
}

/* Current number display */
.current-number {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.current-number .number-circle {
  width: 150px;
  height: 150px;
  background: #ff5757;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 4rem;
  font-weight: bold;
  color: #fff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  /* Prepare for animation */
  animation: none;
}

/* Drop animation for the number ball */
@keyframes drop {
  0% {
    transform: translateY(-200px) scale(0.5);
    opacity: 0;
  }
  60% {
    transform: translateY(20px) scale(1.1);
    opacity: 1;
  }
  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.number-circle.drop {
  animation: drop 0.7s ease-out;
}

/* Number grid */
.grid {
  display: grid;
  /* Auto-fit columns so that the board adapts to screen width */
  grid-template-columns: repeat(auto-fit, minmax(40px, 1fr));
  gap: 5px;
}

.grid .cell {
  background: rgba(255, 255, 255, 0.15);
  padding: 10px 0;
  text-align: center;
  border-radius: 5px;
  font-size: 1.2rem;
  font-weight: bold;
  color: #fff;
  user-select: none;
}

.grid .cell.drawn {
  background-color: #00b300;
  color: #fff;
}

/* Confetti styles */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 100;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  background-color: red;
  opacity: 0.9;
  transform: rotate(0deg);
  animation: fall linear forwards;
}

@keyframes fall {
  0% {
    opacity: 1;
    transform: translateY(-20vh) rotate(0deg);
  }
  100% {
    opacity: 0;
    transform: translateY(120vh) rotate(720deg);
  }
}