* { box-sizing: border-box; margin: 0; padding: 0; }

/* ── 테마 변수 ── */
:root {
  --bg: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  --text: #fff;
  --subtitle: #aaa;
  --plus-color: #aaa;
  --btn-clear-border: #555;
  --btn-clear-color: #aaa;
  --btn-clear-hover: #fff;
  --history-border: #ffffff10;
  --history-title: #888;
  --mini-plus: #666;
  --row-num: #555;
  --scrollbar: #333;
  --tab-bg: rgba(255,255,255,0.06);
  --tab-border: rgba(255,255,255,0.12);
  --tab-active-bg: rgba(255,255,255,0.14);
  --tab-color: #aaa;
  --tab-active-color: #fff;
  --card-bg: rgba(255,255,255,0.05);
  --card-border: rgba(255,255,255,0.1);
  --label: #ccc;
  --input-bg: rgba(255,255,255,0.07);
  --input-border: rgba(255,255,255,0.15);
  --input-focus: #f7c948;
  --input-text: #fff;
  --input-placeholder: #666;
  --select-bg: #16213e;
  --privacy: #666;
  --theme-btn-bg: rgba(255,255,255,0.1);
  --theme-btn-border: rgba(255,255,255,0.2);
  --theme-btn-color: #ccc;
}

body.light {
  --bg: linear-gradient(135deg, #f0f4ff 0%, #e8eef8 50%, #dce6f5 100%);
  --text: #1a1a2e;
  --subtitle: #666;
  --plus-color: #999;
  --btn-clear-border: #ccc;
  --btn-clear-color: #777;
  --btn-clear-hover: #1a1a2e;
  --history-border: #00000012;
  --history-title: #999;
  --mini-plus: #bbb;
  --row-num: #bbb;
  --scrollbar: #ccc;
  --tab-bg: rgba(0,0,0,0.05);
  --tab-border: rgba(0,0,0,0.1);
  --tab-active-bg: rgba(0,0,0,0.1);
  --tab-color: #888;
  --tab-active-color: #1a1a2e;
  --card-bg: rgba(255,255,255,0.85);
  --card-border: rgba(0,0,0,0.08);
  --label: #444;
  --input-bg: #fff;
  --input-border: #d0d8e8;
  --input-focus: #f7b731;
  --input-text: #1a1a2e;
  --input-placeholder: #bbb;
  --select-bg: #fff;
  --privacy: #aaa;
  --theme-btn-bg: rgba(0,0,0,0.07);
  --theme-btn-border: rgba(0,0,0,0.15);
  --theme-btn-color: #555;
}

body {
  min-height: 100vh;
  background: var(--bg);
  font-family: 'Segoe UI', sans-serif;
  color: var(--text);
  transition: background 0.4s, color 0.3s;
}

/* ── 테마 토글 ── */
.theme-toggle {
  position: fixed;
  top: 18px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--theme-btn-border);
  background: var(--theme-btn-bg);
  color: var(--theme-btn-color);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(6px);
  transition: background 0.3s, border-color 0.3s, transform 0.2s;
  z-index: 100;
}
.theme-toggle:hover { transform: scale(1.12); }

/* ── 탭 네비게이션 ── */
.tab-nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 28px 20px 0;
}

.tab-btn {
  padding: 10px 26px;
  font-size: 0.92rem;
  font-weight: 600;
  border-radius: 50px;
  border: 1.5px solid var(--tab-border);
  background: var(--tab-bg);
  color: var(--tab-color);
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
  backdrop-filter: blur(4px);
}
.tab-btn:hover { transform: translateY(-2px); }
.tab-btn.active {
  background: var(--tab-active-bg);
  color: var(--tab-active-color);
  border-color: rgba(247,201,72,0.5);
  box-shadow: 0 0 0 1px rgba(247,201,72,0.2);
}

/* ── 탭 섹션 ── */
.tab-section { display: none; }
.tab-section.active { display: block; }

/* ── 공통 컨테이너 ── */
.container {
  text-align: center;
  padding: 40px 30px 60px;
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
}

.container--form {
  text-align: left;
  max-width: 640px;
  padding-top: 30px;
}

/* ── 타이틀 ── */
h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 8px;
  background: linear-gradient(90deg, #f7c948, #ff6b6b);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
}

.subtitle {
  color: var(--subtitle);
  font-size: 0.9rem;
  margin-bottom: 40px;
  line-height: 1.6;
  transition: color 0.3s;
}

/* ════════════════════════════
   로또
════════════════════════════ */
.balls-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  min-height: 90px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.ball {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4), inset 0 -4px 8px rgba(0,0,0,0.3), inset 0 4px 8px rgba(255,255,255,0.3);
  opacity: 0;
  transform: scale(0) rotate(360deg);
  transition: opacity 0.4s, transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.ball.show { opacity: 1; transform: scale(1) rotate(0deg); }

.ball.y1, .mini-ball.y1 { background: radial-gradient(circle at 35% 35%, #ffdd57, #f7b731); }
.ball.y2, .mini-ball.y2 { background: radial-gradient(circle at 35% 35%, #74b9ff, #0984e3); }
.ball.y3, .mini-ball.y3 { background: radial-gradient(circle at 35% 35%, #fd79a8, #e84393); }
.ball.y4, .mini-ball.y4 { background: radial-gradient(circle at 35% 35%, #a29bfe, #6c5ce7); }
.ball.y5, .mini-ball.y5 { background: radial-gradient(circle at 35% 35%, #55efc4, #00b894); }

.bonus-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 14px;
  margin-bottom: 50px;
  min-height: 80px;
}

.plus-sign {
  font-size: 2rem;
  color: var(--plus-color);
  font-weight: 300;
  opacity: 0;
  transition: opacity 0.4s, color 0.3s;
}
.plus-sign.show { opacity: 1; }

.bonus-label {
  font-size: 0.75rem;
  color: #f7c948;
  font-weight: 700;
  letter-spacing: 1px;
  opacity: 0;
  margin-bottom: 6px;
  transition: opacity 0.4s;
}
.bonus-label.show { opacity: 1; }
.bonus-col { text-align: center; }

.btn {
  padding: 16px 60px;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(90deg, #f7c948, #ff6b6b);
  color: #1a1a2e;
  letter-spacing: 1px;
  box-shadow: 0 8px 24px rgba(247,201,72,0.35);
  transition: transform 0.15s, box-shadow 0.15s;
  margin: 0 8px 16px;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(247,201,72,0.5); }
.btn:active { transform: translateY(0); }

.btn-clear {
  background: transparent;
  border: 2px solid var(--btn-clear-border);
  color: var(--btn-clear-color);
  box-shadow: none;
  font-size: 0.95rem;
  padding: 14px 40px;
  transition: transform 0.15s, border-color 0.3s, color 0.3s;
}
.btn-clear:hover { border-color: var(--btn-clear-hover); color: var(--btn-clear-hover); box-shadow: none; transform: none; }

.history-title {
  font-size: 0.85rem;
  color: var(--history-title);
  margin: 30px 0 14px;
  letter-spacing: 1px;
  text-transform: uppercase;
  transition: color 0.3s;
}
.history {
  max-height: 260px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--scrollbar) transparent;
}
.history-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--history-border);
  animation: fadeIn 0.3s ease;
  transition: border-color 0.3s;
}
.mini-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.mini-plus { color: var(--mini-plus); font-size: 1rem; transition: color 0.3s; }
.row-num { font-size: 0.75rem; color: var(--row-num); min-width: 24px; text-align: right; transition: color 0.3s; }

/* ════════════════════════════
   제휴 문의
════════════════════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 40px 36px;
  backdrop-filter: blur(12px);
  transition: background 0.4s, border-color 0.3s;
}
.card-header { margin-bottom: 32px; }
.card-header h1 { letter-spacing: 1px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: 18px;
}
label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--label);
  margin-bottom: 7px;
  transition: color 0.3s;
}
.required { color: #ff6b6b; margin-left: 2px; }

input, select, textarea {
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  color: var(--input-text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, background 0.3s, color 0.3s;
}
input::placeholder, textarea::placeholder { color: var(--input-placeholder); }
input:focus, select:focus, textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(247,201,72,0.15);
}
select {
  background-color: var(--select-bg);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
textarea { resize: vertical; min-height: 110px; }

.form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.privacy-note { font-size: 0.78rem; color: var(--privacy); transition: color 0.3s; }

.btn-submit {
  padding: 14px 40px;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  background: linear-gradient(90deg, #f7c948, #ff6b6b);
  color: #1a1a2e;
  letter-spacing: 0.5px;
  box-shadow: 0 6px 20px rgba(247,201,72,0.35);
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(247,201,72,0.5); }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.spinner {
  width: 16px; height: 16px;
  border: 2px solid rgba(26,26,46,0.3);
  border-top-color: #1a1a2e;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.success-msg {
  text-align: center;
  padding: 20px 0 10px;
}
.success-icon { font-size: 3rem; margin-bottom: 16px; }
.success-msg h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 10px; }
.success-msg p { color: var(--subtitle); font-size: 0.92rem; margin-bottom: 28px; }

.btn-reset {
  padding: 12px 36px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 2px solid var(--input-border);
  border-radius: 50px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.btn-reset:hover { border-color: #f7c948; color: #f7c948; }

/* ── 애니메이션 ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 반응형 ── */
@media (max-width: 520px) {
  .tab-btn { padding: 9px 18px; font-size: 0.85rem; }
  .container { padding: 30px 18px 50px; }
  .card { padding: 28px 18px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-footer { flex-direction: column; align-items: flex-start; }
  .btn-submit { width: 100%; justify-content: center; }
  .ball { width: 56px; height: 56px; font-size: 1.2rem; }
  .btn { padding: 14px 36px; }
}
