:root {
  --bg-start: #1e3c72;
  --bg-end: #2a5298;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --muted: #6b7280;
  --accent: #2a5298;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: linear-gradient(135deg, var(--bg-start), var(--bg-end));
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--card-bg);
  border-radius: 20px;
  padding: 36px 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

h1 {
  margin: 0 0 8px;
  font-size: 1.8rem;
  text-align: center;
  color: var(--text);
}

.subtitle {
  margin: 0 0 28px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.controls label {
  font-size: 0.9rem;
  color: var(--muted);
}

.controls select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  font-size: 0.95rem;
}

#generate {
  padding: 10px 22px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
}

#generate:hover {
  box-shadow: 0 8px 20px rgba(42, 82, 152, 0.35);
}

#generate:active {
  transform: scale(0.97);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 40px;
}

.game-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border-radius: 12px;
  background: #f7f8fa;
}

.game-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 44px;
}

.ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  box-shadow: inset 0 -3px 4px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.ball.range-1 { background: #fbc400; } /* 1-10 노랑 */
.ball.range-2 { background: #69c8f2; } /* 11-20 파랑 */
.ball.range-3 { background: #ff7272; } /* 21-30 빨강 */
.ball.range-4 { background: #aaaaaa; } /* 31-40 회색 */
.ball.range-5 { background: #b0d840; } /* 41-45 초록 */

footer {
  margin-top: 24px;
  text-align: center;
}

footer p {
  font-size: 0.78rem;
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  :root {
    --card-bg: #1f2430;
    --text: #f1f1f1;
    --muted: #9ca3af;
  }

  .game-row {
    background: #2a2f3d;
  }

  .controls select {
    background: #2a2f3d;
    color: #f1f1f1;
    border-color: #3f4453;
  }
}
