:root {
  --bg: #0f172a;
  --bg-gradient-start: #0f172a;
  --bg-gradient-end: #1e1b4b;
  --card: #1e293b;
  --field: #0f172a;
  --border: #334155;
  --text: #f1f5f9;
  --sub: #94a3b8;
  --accent: #fbbf24;
  --shadow: rgba(0, 0, 0, 0.4);
}

:root[data-theme="light"] {
  --bg: #f8fafc;
  --bg-gradient-start: #e0e7ff;
  --bg-gradient-end: #f8fafc;
  --card: #ffffff;
  --field: #f1f5f9;
  --border: #cbd5e1;
  --text: #1e293b;
  --sub: #64748b;
  --accent: #f59e0b;
  --shadow: rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

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

.app {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border-radius: 20px;
  padding: 32px 24px;
  box-shadow: 0 20px 50px var(--shadow);
  transition: background 0.2s ease;
}

.theme-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--field);
  color: var(--text);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.theme-toggle:hover {
  opacity: 0.85;
}

h1 {
  text-align: center;
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.desc {
  text-align: center;
  color: var(--sub);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.controls {
  display: flex;
  gap: 8px;
  margin-bottom: 24px;
}

.controls label {
  flex: 1;
  font-size: 0.85rem;
  color: var(--sub);
}

select,
button {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  border: none;
  font-size: 0.95rem;
}

select {
  background: var(--field);
  color: var(--text);
  border: 1px solid var(--border);
}

#generateBtn {
  display: block;
  width: 100%;
  padding: 14px;
  background: var(--accent);
  color: #1e1b4b;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  border-radius: 12px;
  transition: transform 0.1s ease, opacity 0.2s ease;
}

#generateBtn:hover {
  opacity: 0.9;
}

#generateBtn:active {
  transform: scale(0.98);
}

.sets {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.set-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--field);
  border-radius: 12px;
  padding: 10px 12px;
}

.set-index {
  color: var(--sub);
  font-size: 0.8rem;
  width: 20px;
  flex-shrink: 0;
}

.balls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: #fff;
  flex-shrink: 0;
}

.b1 { background: #fbbf24; color: #1e1b4b; }
.b2 { background: #38bdf8; }
.b3 { background: #f87171; }
.b4 { background: #94a3b8; color: #1e1b4b; }
.b5 { background: #34d399; color: #1e1b4b; }

.footer-note {
  margin-top: 20px;
  text-align: center;
  color: var(--sub);
  font-size: 0.75rem;
  line-height: 1.5;
}
