:root {
  --bg: #f4f6fb;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --subtitle: #5a6172;
  --accent: #4361ee;
  --accent-hover: #3a4fd0;
  --shadow: rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] {
  --bg: #14161f;
  --card-bg: #1e212e;
  --text: #f0f2f8;
  --subtitle: #9aa0b4;
  --accent: #6c8cff;
  --accent-hover: #587bff;
  --shadow: rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Segoe UI", "Apple SD Gothic Neo", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease, color 0.3s ease;
  padding: 24px;
}

.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 14px var(--shadow);
  transition: transform 0.2s ease;
}

.theme-toggle:hover {
  transform: scale(1.1);
}

.container {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 40px 32px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  box-shadow: 0 10px 40px var(--shadow);
}

h1 {
  font-size: 28px;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--subtitle);
  font-size: 14px;
  margin-bottom: 28px;
}

.balls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  min-height: 56px;
  margin-bottom: 28px;
}

.ball {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  color: #fff;
  animation: pop 0.4s ease;
}

@keyframes pop {
  0% { transform: scale(0); opacity: 0; }
  70% { transform: scale(1.15); }
  100% { transform: scale(1); opacity: 1; }
}

/* 번호 구간별 색상 (실제 로또 공 색상 규칙) */
.range-1 { background: #fbc400; }
.range-2 { background: #69c8f2; }
.range-3 { background: #ff7272; }
.range-4 { background: #aaaaaa; }
.range-5 { background: #b0d840; }

.draw-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.draw-btn:hover {
  background: var(--accent-hover);
}

.draw-btn:active {
  transform: scale(0.97);
}

.history {
  margin-top: 32px;
  text-align: left;
}

.history h2 {
  font-size: 15px;
  color: var(--subtitle);
  margin-bottom: 12px;
}

#history-list {
  list-style: none;
}

#history-list li {
  font-size: 14px;
  color: var(--text);
  padding: 8px 0;
  border-top: 1px solid var(--shadow);
}
