:root {
  --bg-color: #f0f2f5;
  --text-color: #333;
  --btn-bg: #007bff;
  --btn-hover: #0056b3;
  --ball-bg: #ff6b6b;
  --ball-text: white;
  --toggle-bg: #ddd;
  --toggle-text: #333;
}

[data-theme="dark"] {
  --bg-color: #18191a;
  --text-color: #e4e6eb;
  --btn-bg: #3a3b3c;
  --btn-hover: #4e4f50;
  --ball-bg: #ff4757;
  --ball-text: white;
  --toggle-bg: #333;
  --toggle-text: #f0f0f0;
}

body {
  font-family: 'Arial', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

h1 {
  color: var(--text-color);
  margin-bottom: 30px;
}

#theme-toggle {
  position: absolute;
  top: 20px;
  right: 20px;
  padding: 10px 15px;
  font-size: 14px;
  background-color: var(--toggle-bg);
  color: var(--toggle-text);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#theme-toggle:hover {
  opacity: 0.8;
}

#generate-button {
  padding: 12px 25px;
  font-size: 16px;
  color: white;
  background-color: var(--btn-bg);
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.3s ease;
  margin-bottom: 30px;
}

#generate-button:hover {
  background-color: var(--btn-hover);
}

.container {
  max-width: 650px;
  width: 100%;
  padding: 40px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-top: 40px;
}

.subtitle {
  color: var(--text-color);
  opacity: 0.7;
  margin-top: -20px;
  margin-bottom: 30px;
  font-size: 15px;
}

#numbers-display {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 10px 0;
  margin-top: 10px;
}

.game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background-color: rgba(0, 0, 0, 0.02);
  border: 1px solid rgba(0, 0, 0, 0.04);
  border-radius: 12px;
  transition: transform 0.2s ease, background-color 0.2s ease;
}

[data-theme="dark"] .game-row {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.game-row:hover {
  transform: translateY(-1px);
  background-color: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .game-row:hover {
  background-color: rgba(255, 255, 255, 0.04);
}

.game-label {
  font-weight: bold;
  font-size: 16px;
  color: var(--text-color);
  opacity: 0.9;
}

.balls-container {
  display: flex;
  gap: 10px;
}

.lottery-number {
  width: 42px;
  height: 42px;
  background-color: var(--ball-bg);
  color: var(--ball-text);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 16px;
  font-weight: bold;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.3s ease;
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.6) rotate(-90deg);
  }
  to {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* 로또 번호 대역별 5가지 색상 (대한민국 공식 로또 기준) */
.ball-color-1 {
  background: linear-gradient(135deg, #fef08a 0%, #facc15 100%) !important; /* 1 ~ 10: 노랑 */
  color: #2c2c2c !important;
  text-shadow: none !important;
  box-shadow: 0 4px 8px rgba(234, 179, 8, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.4);
}
.ball-color-2 {
  background: linear-gradient(135deg, #93c5fd 0%, #2563eb 100%) !important; /* 11 ~ 20: 파랑 */
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}
.ball-color-3 {
  background: linear-gradient(135deg, #fca5a5 0%, #dc2626 100%) !important; /* 21 ~ 30: 빨강 */
  box-shadow: 0 4px 8px rgba(220, 38, 38, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}
.ball-color-4 {
  background: linear-gradient(135deg, #d1d5db 0%, #4b5563 100%) !important; /* 31 ~ 40: 회색 */
  box-shadow: 0 4px 8px rgba(75, 85, 99, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}
.ball-color-5 {
  background: linear-gradient(135deg, #86efac 0%, #16a34a 100%) !important; /* 41 ~ 45: 초록 */
  box-shadow: 0 4px 8px rgba(22, 163, 74, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

@media (max-width: 500px) {
  .game-row {
    flex-direction: column;
    gap: 12px;
    padding: 15px;
  }
  .balls-container {
    gap: 6px;
  }
  .lottery-number {
    width: 36px;
    height: 36px;
    font-size: 14px;
  }
}
