:root {
  --background-gradient: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  --component-bg: rgba(255, 255, 255, 0.7);
  --component-border: rgba(255, 255, 255, 1);
  --text-color: #333;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --button-gradient: linear-gradient(45deg, #a18cd1, #fbc2eb);
  --button-gradient-hover: linear-gradient(45deg, #fbc2eb, #a18cd1);
  --button-text-color: #fff;
  --number-gradient: linear-gradient(45deg, #f093fb, #f5576c);
  --number-text-color: #fff;
}

[data-theme="dark"] {
  --background-gradient: linear-gradient(135deg, #2c3e50, #4ca1af);
  --component-bg: rgba(0, 0, 0, 0.2);
  --component-border: rgba(255, 255, 255, 0.2);
  --text-color: #f0f0f0;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --button-gradient: linear-gradient(45deg, #888, #555);
  --button-gradient-hover: linear-gradient(45deg, #555, #888);
  --number-gradient: linear-gradient(45deg, #ffc371, #ff5f6d);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  background: var(--background-gradient);
  color: var(--text-color);
  transition: background 0.5s ease, color 0.5s ease;
  overflow: hidden;
}

lotto-generator {
  background: var(--component-bg);
  border-radius: 20px;
  padding: 30px 40px;
  box-shadow: 0 10px 30px var(--shadow-color);
  backdrop-filter: blur(10px);
  border: 1px solid var(--component-border);
  text-align: center;
  max-width: 500px;
  width: 90%;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

h1 {
  font-size: 2.2em;
  margin-bottom: 25px;
  text-shadow: 0 2px 4px var(--shadow-color);
}

.numbers-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
  min-height: 80px; /* Ensure consistent height even if no numbers */
}

.lotto-number {
  width: 60px;
  height: 60px;
  background: var(--number-gradient);
  color: var(--number-text-color);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.8em;
  font-weight: bold;
  box-shadow: 0 4px 10px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  animation: popIn 0.5s ease forwards;
  opacity: 0;
}

.lotto-number:nth-child(2) { animation-delay: 0.1s; }
.lotto-number:nth-child(3) { animation-delay: 0.2s; }
.lotto-number:nth-child(4) { animation-delay: 0.3s; }
.lotto-number:nth-child(5) { animation-delay: 0.4s; }
.lotto-number:nth-child(6) { animation-delay: 0.5s; }


@keyframes popIn {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

button {
  background: var(--button-gradient);
  color: var(--button-text-color);
  border: none;
  padding: 12px 25px;
  border-radius: 30px;
  font-size: 1.1em;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 5px 15px var(--shadow-color);
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button:hover {
  background: var(--button-gradient-hover);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

button:active {
  transform: translateY(0);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
  lotto-generator {
    padding: 20px 25px;
  }

  h1 {
    font-size: 1.8em;
  }

  .lotto-number {
    width: 50px;
    height: 50px;
    font-size: 1.5em;
  }

  button {
    padding: 10px 20px;
    font-size: 1em;
  }
}