:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --text: #1b1f2a;
  --muted: #4a5568;
  --primary: #2563eb;
  --primary-contrast: #ffffff;
  --border: #e2e8f0;
  --chip: #eef2ff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

:root[data-theme="dark"] {
  --bg: #0b1020;
  --surface: #141a2b;
  --text: #e5e7eb;
  --muted: #9aa4b2;
  --primary: #22c55e;
  --primary-contrast: #0b1020;
  --border: #273142;
  --chip: #1f2937;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Pretendard", "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top, rgba(37, 99, 235, 0.12), transparent 45%),
    var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 32px 20px 60px;
  transition: background 0.3s ease, color 0.3s ease;
}

.app-header {
  width: min(720px, 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 36px);
}

.app {
  width: min(720px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.btn {
  border: none;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 16px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--primary);
  color: var(--primary-contrast);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.25);
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
}

.lotto-number {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--chip);
  border: 1px solid var(--border);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.form-section {
  width: 100%;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-section h2 {
  margin: 0;
  font-size: 20px;
}

.form-description {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.partner-form {
  display: grid;
  gap: 14px;
}

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

.form-field input,
.form-field textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  padding: 12px 14px;
  font-size: 15px;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

@media (max-width: 520px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .app {
    padding: 22px;
  }
}
