:root {
  --bg: #0f172a;
  --bg-accent: #1e293b;
  --card: #111827;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --primary: #f97316;
  --primary-dark: #ea580c;
  --ring: rgba(249, 115, 22, 0.4);
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(248, 113, 113, 0.15), transparent 40%),
    radial-gradient(circle at 20% 20%, rgba(56, 189, 248, 0.18), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, #0b1120 100%);
  display: grid;
  place-items: center;
  padding: 32px 16px 48px;
}

.app {
  width: min(960px, 100%);
  display: grid;
  gap: 24px;
}

.hero {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8), rgba(15, 23, 42, 0.9));
  border-radius: 24px;
  padding: 28px 32px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.3em;
  font-size: 12px;
  margin: 0 0 8px;
  color: var(--muted);
}

h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
}

.sub {
  margin: 0;
  color: var(--muted);
}

.panel {
  background: rgba(15, 23, 42, 0.85);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.1);
  box-shadow: var(--shadow);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
}

.field {
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.field input {
  width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: var(--bg-accent);
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.buttons {
  display: flex;
  gap: 12px;
}

button {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #0b1120;
  box-shadow: 0 12px 30px rgba(249, 115, 22, 0.35);
}

.primary:hover {
  box-shadow: 0 16px 34px rgba(249, 115, 22, 0.45);
}

.ghost {
  background: rgba(148, 163, 184, 0.12);
  color: var(--text);
}

.results {
  margin-top: 20px;
  display: grid;
  gap: 16px;
}

.set {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.15);
}

.set-label {
  font-size: 13px;
  color: var(--muted);
  margin-right: 4px;
}

.ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  background: radial-gradient(circle at 30% 30%, #fef9c3, #facc15);
  color: #1e293b;
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.6),
    inset 0 -6px 12px rgba(234, 179, 8, 0.6);
  animation: pop 0.35s ease;
}

.ball.blue {
  background: radial-gradient(circle at 30% 30%, #e0f2fe, #38bdf8);
  color: #0f172a;
}

.ball.red {
  background: radial-gradient(circle at 30% 30%, #fee2e2, #f87171);
  color: #7f1d1d;
}

.ball.gray {
  background: radial-gradient(circle at 30% 30%, #e2e8f0, #94a3b8);
  color: #0f172a;
}

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

@media (max-width: 640px) {
  .controls {
    flex-direction: column;
    align-items: stretch;
  }

  .buttons {
    width: 100%;
  }

  .buttons button {
    flex: 1;
  }
}
