:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --text: #1f2937;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --muted: #6b7280;
  --header-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --ball-placeholder-bg: #e5e7eb;
  --ball-placeholder-text: #9ca3af;
}

[data-theme="dark"] {
  --bg: #111827;
  --surface: #1f2937;
  --text: #f9fafb;
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --muted: #9ca3af;
  --header-grad: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  --ball-placeholder-bg: #374151;
  --ball-placeholder-text: #6b7280;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
}

.container {
  width: min(800px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  background: var(--header-grad);
  color: #fff;
  padding: 4rem 0;
  text-align: center;
  transition: background 0.3s ease;
}

.header-top {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.theme-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: background 0.2s;
}

.theme-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.site-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.hero {
  background: var(--surface);
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  margin: -4rem auto 2rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
  text-align: center;
  transition: background 0.3s ease;
}

.hero h2 {
  margin-top: 0;
  margin-bottom: 2rem;
  color: var(--muted);
  font-weight: 500;
}

.lotto-balls {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.ball, .ball-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ball-placeholder {
  background: var(--ball-placeholder-bg);
  color: var(--ball-placeholder-text);
  border: 2px dashed var(--ball-placeholder-text);
  box-shadow: none;
}

.ball-1 { background: #fbc02d; } 
.ball-2 { background: #1976d2; } 
.ball-3 { background: #d32f2f; } 
.ball-4 { background: #7b1fa2; } 
.ball-5 { background: #388e3c; } 

#generateButton {
  border: none;
  background: var(--primary);
  color: white;
  padding: 1rem 2.5rem;
  border-radius: 999px;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 10px 15px -3px rgba(79, 70, 229, 0.4);
}

#generateButton:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 12px 20px -3px rgba(79, 70, 229, 0.5);
}

.site-footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--muted);
}

@media (max-width: 600px) {
  .site-header {
    padding: 3rem 0;
  }
  .header-top {
    flex-direction: column;
    gap: 0.5rem;
  }
  .ball, .ball-placeholder {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}
