:root {
  --bg: linear-gradient(130deg, #0f172a, #1e293b 45%, #334155);
  --panel: #f8fafc;
  --text: #0f172a;
  --primary: #1d4ed8;
  --primary-hover: #1e40af;
  --secondary: #e2e8f0;
  --secondary-hover: #cbd5e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: grid;
  place-items: center;
  padding: 24px;
}

.app {
  width: min(820px, 100%);
  background: var(--panel);
  border-radius: 18px;
  padding: 28px;
  box-shadow: 0 20px 36px rgba(15, 23, 42, 0.32);
}

.app-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3vw, 2rem);
}

.app-header p {
  margin: 10px 0 0;
  color: #475569;
}

.controls {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 11px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

#draw-button {
  background: var(--primary);
  color: #fff;
}

#draw-button:hover {
  background: var(--primary-hover);
}

.secondary {
  background: var(--secondary);
  color: #0f172a;
}

.secondary:hover {
  background: var(--secondary-hover);
}

.result-panel {
  margin-top: 22px;
  padding-top: 10px;
}

.result-panel h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

#lotto-container {
  display: grid;
  gap: 10px;
}

.lotto-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: #eef2ff;
  border-radius: 12px;
  padding: 10px 12px;
}

.row-label {
  min-width: 38px;
  font-weight: 700;
  color: #1e3a8a;
}

.balls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lotto-ball {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  box-shadow: inset -2px -2px 5px rgba(0, 0, 0, 0.28), 0 2px 4px rgba(0, 0, 0, 0.18);
}

@media (max-width: 640px) {
  .app {
    padding: 20px;
  }

  .lotto-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .balls {
    justify-content: flex-start;
  }
}
