/* ===== CSS 변수 (라이트/다크) ===== */
:root {
  --bg: #f0f4ff;
  --surface: #ffffff;
  --surface2: #f8faff;
  --border: #e2e8f7;
  --text: #1a1f36;
  --text-sub: #5a6080;
  --accent: #4f46e5;
  --accent2: #7c3aed;
  --accent-glow: rgba(79,70,229,0.15);
  --header-bg: linear-gradient(135deg, #1a1f36 0%, #2d3561 50%, #1a1f36 100%);
  --btn-bg: linear-gradient(135deg, #4f46e5, #7c3aed);
  --btn-shadow: rgba(79,70,229,0.4);
  --card-shadow: 0 4px 24px rgba(79,70,229,0.10);
  --bonus-border: #f59e0b;
  --toggle-bg: #e8ecf8;
  --toggle-text: #4f46e5;
}

body.dark {
  --bg: #0d0f1a;
  --surface: #161928;
  --surface2: #1e2235;
  --border: #2a2f4a;
  --text: #e8eaf6;
  --text-sub: #8890b5;
  --accent: #818cf8;
  --accent2: #a78bfa;
  --accent-glow: rgba(129,140,248,0.15);
  --header-bg: linear-gradient(135deg, #070810 0%, #12163a 50%, #070810 100%);
  --btn-bg: linear-gradient(135deg, #4338ca, #6d28d9);
  --btn-shadow: rgba(99,102,241,0.5);
  --card-shadow: 0 4px 24px rgba(0,0,0,0.4);
  --bonus-border: #fbbf24;
  --toggle-bg: #1e2235;
  --toggle-text: #818cf8;
}

/* ===== 기본 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, color 0.3s;
}

/* ===== 테마 토글 ===== */
#theme-toggle {
  position: fixed;
  top: 14px;
  right: 16px;
  z-index: 100;
  padding: 8px 18px;
  border: none;
  border-radius: 50px;
  background: var(--toggle-bg);
  color: var(--toggle-text);
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#theme-toggle:hover { opacity: 0.85; transform: scale(1.04); }

/* ===== 헤더 ===== */
.site-header {
  background: var(--header-bg);
  padding: 48px 24px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.header-inner { position: relative; z-index: 2; }

.logo {
  font-size: 32px;
  font-weight: 900;
  color: #ffffff;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.logo span {
  background: linear-gradient(90deg, #fbbf24, #f59e0b, #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  margin-top: 8px;
  font-size: 14px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 1px;
}

/* 헤더 장식 볼 */
.header-deco {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 1;
}
.ball-deco {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  opacity: 0.12;
  animation: floatBall 6s ease-in-out infinite;
}
.b1 { background:#fbc400; top:20%; left:8%;  animation-delay:0s;   width:52px; height:52px; }
.b2 { background:#69c8f2; top:60%; left:15%; animation-delay:1.2s; }
.b3 { background:#ff7272; top:25%; right:12%;animation-delay:2.4s; width:56px; height:56px; }
.b4 { background:#aaaaaa; top:65%; right:8%; animation-delay:0.8s; }
.b5 { background:#b0d840; top:45%; left:50%; animation-delay:3s;   width:38px; height:38px; }

@keyframes floatBall {
  0%,100% { transform: translateY(0px) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(10deg); }
}

/* ===== 메인 컨테이너 ===== */
.container {
  max-width: 780px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 16px 48px;
  flex: 1;
}

/* ===== 인포 배너 ===== */
.info-banner {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.info-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-sub);
  box-shadow: var(--card-shadow);
}
.info-item strong { color: var(--accent); }

/* ===== 추천 버튼 ===== */
.generate-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 36px;
}

.generate-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 48px;
  background: var(--btn-bg);
  color: #fff;
  border: none;
  border-radius: 60px;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 32px var(--btn-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 1px;
}
.generate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px var(--btn-shadow);
}
.generate-btn:active { transform: translateY(0px); }
.btn-icon { font-size: 24px; }

/* ===== 결과 그리드 ===== */
.results-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== 로또 카드 ===== */
.lotto-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 20px 24px;
  box-shadow: var(--card-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  animation: slideIn 0.4s ease both;
  transition: background 0.3s, border 0.3s;
}

.lotto-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px var(--accent-glow);
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
.lotto-card:nth-child(1) { animation-delay: 0.05s; }
.lotto-card:nth-child(2) { animation-delay: 0.12s; }
.lotto-card:nth-child(3) { animation-delay: 0.19s; }
.lotto-card:nth-child(4) { animation-delay: 0.26s; }
.lotto-card:nth-child(5) { animation-delay: 0.33s; }

.card-game {
  min-width: 60px;
  text-align: center;
}
.game-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-sub);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.game-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--accent);
  line-height: 1.2;
}

.card-divider {
  width: 1px;
  height: 48px;
  background: var(--border);
}

.card-numbers {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
}

.bonus-sep {
  font-size: 18px;
  color: var(--text-sub);
  font-weight: 300;
  margin: 0 2px;
}

/* ===== 번호 볼 ===== */
.ball {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  box-shadow: inset 0 -3px 6px rgba(0,0,0,0.2), 0 2px 6px rgba(0,0,0,0.15);
  position: relative;
  flex-shrink: 0;
}
.ball::after {
  content: '';
  position: absolute;
  top: 6px;
  left: 10px;
  width: 12px;
  height: 6px;
  background: rgba(255,255,255,0.35);
  border-radius: 50%;
  transform: rotate(-30deg);
}

/* 번호대별 색상 (실제 로또 색상) */
.ball.range-1  { background: radial-gradient(circle at 40% 35%, #fdd835, #f9a825); } /* 1~10 노랑 */
.ball.range-11 { background: radial-gradient(circle at 40% 35%, #42b0e8, #1976d2); } /* 11~20 파랑 */
.ball.range-21 { background: radial-gradient(circle at 40% 35%, #ef5350, #c62828); } /* 21~30 빨강 */
.ball.range-31 { background: radial-gradient(circle at 40% 35%, #9e9e9e, #616161); } /* 31~40 회색 */
.ball.range-41 { background: radial-gradient(circle at 40% 35%, #aed940, #689f38); } /* 41~45 초록 */

/* 보너스 볼 */
.ball.bonus {
  box-shadow: 0 0 0 2.5px var(--bonus-border), inset 0 -3px 6px rgba(0,0,0,0.2);
}
.ball.bonus::before {
  content: '★';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--bonus-border);
}

/* ===== 공지 ===== */
.notice {
  margin-top: 36px;
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.8;
}

/* ===== 푸터 ===== */
.site-footer {
  text-align: center;
  padding: 20px;
  font-size: 13px;
  color: var(--text-sub);
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

/* ===== 반응형 ===== */
@media (max-width: 520px) {
  .lotto-card { flex-direction: column; align-items: flex-start; gap: 12px; }
  .card-divider { width: 100%; height: 1px; }
  .card-game { display: flex; gap: 8px; align-items: baseline; }
  .generate-btn { padding: 16px 36px; font-size: 16px; }
  .ball { width: 36px; height: 36px; font-size: 13px; }
}
