:root {
  --bg: linear-gradient(135deg, #0f172a, #1e293b 45%, #334155);
  --card: rgba(255, 255, 255, 0.1);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --accent: #22d3ee;
  --accent-2: #0ea5e9;
  --line-bg: rgba(15, 23, 42, 0.45);
  --line-border: rgba(148, 163, 184, 0.25);
  --line-title: #a5f3fc;
  --hint: #cbd5e1;
  --button-text: #082f49;
  --app-border: rgba(255, 255, 255, 0.15);
  --app-shadow: 0 20px 50px rgba(2, 6, 23, 0.35);
  --toggle-bg: rgba(255, 255, 255, 0.16);
  --toggle-text: #f8fafc;
  --toggle-border: rgba(255, 255, 255, 0.25);
  --select-bg: rgba(255, 255, 255, 0.95);
  --select-text: #0f172a;
}

:root[data-theme="light"] {
  --bg: linear-gradient(135deg, #f8fafc, #e2e8f0 45%, #cbd5e1);
  --card: rgba(255, 255, 255, 0.85);
  --text: #0f172a;
  --muted: #334155;
  --accent: #0ea5e9;
  --accent-2: #0284c7;
  --line-bg: rgba(226, 232, 240, 0.8);
  --line-border: rgba(100, 116, 139, 0.3);
  --line-title: #0369a1;
  --hint: #475569;
  --button-text: #f8fafc;
  --app-border: rgba(148, 163, 184, 0.35);
  --app-shadow: 0 20px 45px rgba(15, 23, 42, 0.15);
  --toggle-bg: rgba(203, 213, 225, 0.8);
  --toggle-text: #0f172a;
  --toggle-border: rgba(100, 116, 139, 0.35);
  --select-bg: #f8fafc;
  --select-text: #0f172a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "Noto Sans KR", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 20px;
}

.app {
  width: min(760px, 100%);
  background: var(--card);
  border: 1px solid var(--app-border);
  backdrop-filter: blur(10px);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--app-shadow);
}

h1 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2rem);
}

.desc {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.controls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 18px;
}

label {
  font-weight: 600;
  font-size: 0.92rem;
}

select, button {
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.95rem;
}

select {
  background: var(--select-bg);
  color: var(--select-text);
  min-width: 90px;
}

button {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: var(--button-text);
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s ease;
}

button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px); }

.result-list {
  display: grid;
  gap: 10px;
}

.line {
  background: var(--line-bg);
  border: 1px solid var(--line-border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.line-title {
  width: 56px;
  color: var(--line-title);
  font-weight: 700;
  font-size: 0.9rem;
}

.ball {
  width: 36px;
  aspect-ratio: 1;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: #e2e8f0;
  color: #0f172a;
  box-shadow: inset 0 -4px 0 rgba(15, 23, 42, 0.15);
}

.ball.n1 { background: #fde047; }
.ball.n2 { background: #93c5fd; }
.ball.n3 { background: #fca5a5; }
.ball.n4 { background: #c4b5fd; }
.ball.n5 { background: #86efac; }

.hint {
  margin-top: 14px;
  font-size: 0.83rem;
  color: var(--hint);
}

.theme-btn {
  margin-left: auto;
  background: var(--toggle-bg);
  color: var(--toggle-text);
  border: 1px solid var(--toggle-border);
  font-weight: 700;
}
