/* Reset and base layout */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Trebuchet MS', sans-serif;
  color: #fff;
  background: linear-gradient(#0b0c28, #1b1e4b);
  background-image: url('https://cdn.pixabay.com/photo/2012/04/18/14/22/lottery-37205_1280.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  position: relative;
}

body::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 0;
}

.lottery-form {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.1);
  border: 3px solid #ffd700;
  border-radius: 15px;
  padding: 30px 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.5);
}

.lottery-form h1 {
  color: #ffd700;
  margin-bottom: 20px;
  font-size: 1.8em;
}

.lottery-form label {
  display: block;
  text-align: left;
  margin: 15px 0 5px;
  font-weight: bold;
}

.lottery-form input {
  width: 100%;
  padding: 12px;
  margin-bottom: 10px;
  border-radius: 8px;
  border: none;
  font-size: 1rem;
  background-color: #f7f7f7;
  color: #000;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.button-group button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s ease;
}

.button-group button[type="submit"] {
  background-color: #ffd700;
  color: #000;
}

.button-group button[type="submit"]:hover {
  background-color: #ffc107;
}

.button-group button[type="button"] {
  background-color: #dc3545;
  color: #fff;
}

.button-group button[type="button"]:hover {
  background-color: #c82333;
}

/* Result area */
#result {
  margin-top: 20px;
  padding: 1rem;
  background-color: rgba(255,255,255,0.8);
  border-radius: 8px;
  color: #000;
  font-weight: bold;
}

/* Ball styling */
#ballsContainer {
  margin-top: 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  position: relative;
}

.ball {
  width: 60px;
  height: 60px;
  background-color: #ffcc00;
  color: #000;
  font-size: 1.5rem;
  font-weight: bold;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
  animation: fall 1s ease forwards;
  opacity: 0;
}

.ball.mega {
  background-color: #ff4136;
  color: white;
}

@keyframes fall {
  0% {
    transform: translateY(-200px);
    opacity: 0;
  }
  100% {
    transform: translateY(0);
    opacity: 1;
  }
}
