:root {
  --bg-color: #f0f2f5;
  --container-bg: rgba(255, 255, 255, 0.9);
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --ball-shadow: rgba(0,0,0,0.1);
  --header-gradient: linear-gradient(135deg, #e0e7ff 0%, #f3f4f6 100%);
  
  /* Lotto Ball Colors (Bright) */
  --ball-1: #fbbf24;
  --ball-2: #3b82f6;
  --ball-3: #ef4444;
  --ball-4: #9ca3af;
  --ball-5: #10b981;
}

body.dark {
  --bg-color: #111827;
  --container-bg: rgba(31, 41, 55, 0.95);
  --primary-color: #818cf8;
  --primary-hover: #6366f1;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --ball-shadow: rgba(0,0,0,0.4);
  --header-gradient: linear-gradient(135deg, #1e1b4b 0%, #111827 100%);
}

body {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: var(--header-gradient);
  font-family: 'Pretendard', sans-serif;
  color: var(--text-main);
  transition: background 0.3s ease;
}

.theme-toggle {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 100;
}

#theme-btn {
  background: var(--container-bg);
  border: 1px solid var(--text-muted);
  font-size: 1.5rem;
  padding: 0.5rem;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.container {
  background: var(--container-bg);
  backdrop-filter: blur(10px);
  padding: 2.5rem;
  border-radius: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 90%;
  max-width: 550px;
  transition: background 0.3s ease;
}

header h1 {
  margin: 0;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-main);
}

header p {
  margin: 0.5rem 0 1.5rem;
  color: var(--text-muted);
}

.ball-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.5rem 0;
}

.lotto-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding-bottom: 0.8rem;
  border-bottom: 1px dashed var(--text-muted);
}

.lotto-row:last-child {
  border-bottom: none;
}

.placeholder {
  color: var(--text-muted);
  font-style: italic;
  justify-content: center;
  padding: 2rem;
}

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  box-shadow: inset -3px -3px 5px rgba(0,0,0,0.1), 
              inset 3px 3px 5px rgba(255,255,255,0.4),
              0 3px 6px var(--ball-shadow);
  animation: ball-pop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  opacity: 0;
}

.ball.range-1 { background: radial-gradient(circle at 30% 30%, #fcd34d, var(--ball-1)); }
.ball.range-2 { background: radial-gradient(circle at 30% 30%, #60a5fa, var(--ball-2)); }
.ball.range-3 { background: radial-gradient(circle at 30% 30%, #f87171, var(--ball-3)); }
.ball.range-4 { background: radial-gradient(circle at 30% 30%, #d1d5db, var(--ball-4)); }
.ball.range-5 { background: radial-gradient(circle at 30% 30%, #34d399, var(--ball-5)); }

@keyframes ball-pop {
  from {
    transform: scale(0.5) translateY(20px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

.controls {
  margin-top: 1.5rem;
}

button#generate-btn {
  background-color: var(--primary-color);
  color: white;
  border: none;
  padding: 0.8rem 2.5rem;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

button#generate-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}
