/* ====================================================
   로또 매직 6/45 - 현대적 프리미엄 스타일시트
==================================================== */

:root {
  /* 테마 컬러 팔레트 */
  --bg-main: #0a0f1d;
  --bg-card: rgba(22, 30, 49, 0.82);
  --bg-card-hover: rgba(30, 41, 67, 0.9);
  --bg-input: #111827;
  --border-card: rgba(255, 255, 255, 0.08);
  --border-focus: #f59e0b;

  --text-main: #f8fafc;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --accent-gold: #fbbf24;
  --accent-gold-hover: #f59e0b;
  --accent-gold-gradient: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #d97706 100%);
  --accent-blue: #38bdf8;
  --accent-purple: #a855f7;
  --accent-green: #34d399;
  --accent-red: #f87171;

  /* 로또 볼 색상 (3D 음영 그라데이션) */
  --ball-yellow-bg: radial-gradient(circle at 35% 30%, #fff7a1 0%, #fbbf24 45%, #d97706 85%, #92400e 100%);
  --ball-blue-bg: radial-gradient(circle at 35% 30%, #bae6fd 0%, #38bdf8 45%, #0284c7 85%, #0369a1 100%);
  --ball-red-bg: radial-gradient(circle at 35% 30%, #fecaca 0%, #f87171 45%, #dc2626 85%, #991b1b 100%);
  --ball-gray-bg: radial-gradient(circle at 35% 30%, #f1f5f9 0%, #94a3b8 45%, #64748b 85%, #334155 100%);
  --ball-green-bg: radial-gradient(circle at 35% 30%, #bbf7d0 0%, #34d399 45%, #059669 85%, #065f46 100%);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 25px rgba(251, 191, 36, 0.3);

  --font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

/* Reset & 기본 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image: 
    radial-gradient(at 10% 15%, rgba(251, 191, 36, 0.08) 0px, transparent 40%),
    radial-gradient(at 90% 85%, rgba(56, 189, 248, 0.08) 0px, transparent 40%),
    radial-gradient(at 50% 50%, rgba(168, 85, 247, 0.05) 0px, transparent 50%);
  background-attachment: fixed;
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* 유틸리티 색상 & 타이포 */
.text-gold { color: var(--accent-gold); }
.text-blue { color: var(--accent-blue); }
.text-red { color: var(--accent-red); }
.text-green { color: var(--accent-green); }
.font-bold { font-weight: 700; }

/* ====================================================
   헤더 영역
==================================================== */
.site-header {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-card);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 20px;
}

.header-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gold-gradient);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #1e1b4b;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.4);
  animation: pulse-slow 3s infinite ease-in-out;
}

.logo-text h1 {
  font-size: 1.45rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-gold {
  font-size: 0.78rem;
  padding: 2px 7px;
  background: rgba(251, 191, 36, 0.2);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: 6px;
  font-weight: 700;
}

.tagline {
  font-size: 0.82rem;
  color: var(--text-sub);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dday-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.dday-title {
  font-size: 0.72rem;
  color: var(--text-sub);
}

.dday-time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-gold);
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.2);
}

/* ====================================================
   메인 컨테이너
==================================================== */
.main-container {
  max-width: 1000px;
  width: 100%;
  margin: 24px auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  flex: 1;
}

/* 카드 공통 스타일 */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-lg);
  padding: 26px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 8px;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.guide-text {
  font-size: 0.86rem;
  color: var(--text-sub);
}

/* 행운 배너 */
.lucky-banner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.lucky-item {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.88rem;
}

.highlight-num {
  font-size: 1.15rem;
  color: var(--accent-gold);
  margin-left: 4px;
}

.badge-mini {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  margin: 0 2px;
}
.badge-mini.yel {
  background: #f59e0b;
  color: #111;
}

/* ====================================================
   추천 모드 탭
==================================================== */
.mode-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 6px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  border: 1px solid var(--border-card);
}

.mode-tab {
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 12px 8px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.mode-tab i {
  font-size: 1.15rem;
  transition: transform 0.2s;
}

.mode-tab:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.mode-tab.active {
  background: var(--accent-gold-gradient);
  color: #1e1b4b;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
  font-weight: 700;
}

.mode-tab.active i {
  transform: scale(1.15);
}

.tab-chip {
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 0.65rem;
  background: #ef4444;
  color: white;
  padding: 1px 5px;
  border-radius: 4px;
}

/* 탭 패널 컨텐츠 */
.mode-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.mode-pane.active {
  display: block;
}

.pane-info-box {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  border-left: 4px solid var(--accent-gold);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 16px;
}

.pane-info-box i {
  font-size: 1.3rem;
  color: var(--accent-gold);
  margin-top: 3px;
}

.pane-info-box strong {
  display: block;
  font-size: 0.96rem;
  margin-bottom: 3px;
  color: var(--text-main);
}

.pane-info-box p {
  font-size: 0.86rem;
  color: var(--text-sub);
  margin: 0;
}

/* 필터 태그 */
.filter-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.filter-tag {
  background: rgba(56, 189, 248, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 서브 라디오 그룹 */
.sub-radio-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.radio-label {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.86rem;
  transition: all 0.2s;
}

.radio-label:hover {
  border-color: rgba(251, 191, 36, 0.4);
  background: rgba(30, 41, 59, 0.8);
}

.radio-label input[type="radio"] {
  accent-color: var(--accent-gold);
  width: 17px;
  height: 17px;
}

/* 고정수 / 제외수 선택 패널 */
.ball-selector-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.selection-status {
  font-size: 0.92rem;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-card);
  display: flex;
  align-items: center;
  gap: 10px;
}

.selection-status .divider {
  color: var(--text-muted);
}

.selection-buttons {
  display: flex;
  gap: 8px;
}

.btn-sm {
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border-card);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-sm:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-sm.active {
  background: var(--accent-gold);
  color: #111;
  border-color: var(--accent-gold);
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
}
.btn-ghost:hover {
  background: rgba(239, 68, 68, 0.15);
  color: var(--accent-red);
}

.active-picker-indicator {
  background: rgba(251, 191, 36, 0.1);
  border: 1px dashed var(--accent-gold);
  color: var(--accent-gold);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.82rem;
  margin-bottom: 14px;
  text-align: center;
}

/* 45개 번호 그리드 */
.balls-grid-45 {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 8px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.5);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
}

.pick-ball {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.pick-ball:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

/* 고정수 상태 */
.pick-ball.is-fixed {
  background: var(--ball-green-bg) !important;
  color: #064e3b !important;
  font-weight: 900;
  border-color: #34d399;
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.5);
  transform: scale(1.08);
}

/* 제외수 상태 */
.pick-ball.is-excluded {
  background: rgba(239, 68, 68, 0.25) !important;
  color: #fca5a5 !important;
  text-decoration: line-through;
  opacity: 0.5;
  border-color: rgba(239, 68, 68, 0.6);
}

/* 운세 폼 */
.fortune-form {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  padding: 20px;
  border-radius: var(--radius-md);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.85rem;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group input {
  background: var(--bg-input);
  border: 1px solid var(--border-card);
  padding: 10px 14px;
  border-radius: 8px;
  color: var(--text-main);
  font-size: 0.92rem;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ====================================================
   하단 게임 수 & 생성 버튼
==================================================== */
.generator-controls {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border-card);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.game-count-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.game-count-wrapper label {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-sub);
  display: flex;
  align-items: center;
  gap: 8px;
}

.count-button-group {
  display: flex;
  gap: 8px;
  background: rgba(15, 23, 42, 0.6);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border-card);
}

.count-btn {
  background: transparent;
  border: none;
  color: var(--text-sub);
  padding: 8px 16px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.count-btn:hover {
  color: var(--text-main);
}

.count-btn.active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--accent-gold);
  font-weight: 700;
}

.generate-btn {
  width: 100%;
  padding: 18px 24px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent-gold-gradient);
  color: #1a162b;
  font-family: inherit;
  font-size: 1.18rem;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(245, 158, 11, 0.35);
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.generate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 40px rgba(245, 158, 11, 0.5);
  filter: brightness(1.06);
}

.generate-btn:active {
  transform: translateY(1px);
}

.btn-sparkle {
  font-size: 1.25rem;
  animation: spin-slow 8s linear infinite;
}

.btn-arrow {
  transition: transform 0.2s;
}

.generate-btn:hover .btn-arrow {
  transform: translateX(4px);
}

/* ====================================================
   애니메이션 믹서 섹션 (볼 믹싱)
==================================================== */
.mixer-section {
  background: radial-gradient(circle at center, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(251, 191, 36, 0.3);
  text-align: center;
  padding: 24px;
}

.mixer-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-gold);
  margin-bottom: 20px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  background: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 10px #22c55e;
  animation: pulse-slow 1s infinite;
}

.mixer-stage {
  display: flex;
  justify-content: center;
  align-items: center;
}

.mixer-drum {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  border: 3px solid rgba(251, 191, 36, 0.4);
  background: radial-gradient(circle, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.9) 100%);
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.8), 0 0 30px rgba(251, 191, 36, 0.15);
  position: relative;
  overflow: hidden;
  margin: 0 auto;
}

.sim-ball {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  color: #111;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  animation: bounce-crazy 1.2s infinite alternate ease-in-out;
}

/* ====================================================
   결과 표시 카드
==================================================== */
.results-card {
  border-color: rgba(251, 191, 36, 0.3);
  background: linear-gradient(180deg, rgba(22, 30, 49, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4), 0 0 35px rgba(251, 191, 36, 0.08);
}

.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-card);
  margin-bottom: 20px;
}

.results-title-group h2 {
  font-size: 1.35rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-timestamp {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-top: 4px;
  display: block;
}

.results-actions {
  display: flex;
  gap: 8px;
}

.action-btn {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border-card);
  color: var(--text-main);
  padding: 8px 14px;
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.action-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.action-btn.btn-primary-outline {
  border-color: rgba(251, 191, 36, 0.4);
  color: var(--accent-gold);
}
.action-btn.btn-primary-outline:hover {
  background: rgba(251, 191, 36, 0.15);
}

/* 게임 리스트 */
.games-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.game-row {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  transition: transform 0.2s, border-color 0.2s;
}

.game-row:hover {
  border-color: rgba(251, 191, 36, 0.3);
  transform: translateY(-1px);
}

.game-label-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 90px;
}

.game-letter {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(251, 191, 36, 0.15);
  color: var(--accent-gold);
  border: 1px solid rgba(251, 191, 36, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
}

.game-mode-tag {
  font-size: 0.75rem;
  color: var(--text-sub);
}

/* 6개의 로또 볼 그룹 */
.game-balls-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
}

/* 개별 3D 로또 볼 */
.lotto-ball {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #111827;
  user-select: none;
  box-shadow: 
    0 6px 14px rgba(0, 0, 0, 0.4),
    inset -2px -2px 6px rgba(0, 0, 0, 0.3),
    inset 2px 2px 5px rgba(255, 255, 255, 0.6);
  position: relative;
  text-shadow: 0 1px 1px rgba(255, 255, 255, 0.3);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* 로또 볼 색상 클래스 */
.lotto-ball.ball-yellow { background: var(--ball-yellow-bg); color: #78350f; }
.lotto-ball.ball-blue   { background: var(--ball-blue-bg);   color: #075985; }
.lotto-ball.ball-red    { background: var(--ball-red-bg);    color: #7f1d1d; }
.lotto-ball.ball-gray   { background: var(--ball-gray-bg);   color: #1e293b; }
.lotto-ball.ball-green  { background: var(--ball-green-bg);  color: #064e3b; }

/* 작은 로또 볼 */
.lotto-ball.ball-sm {
  width: 32px;
  height: 32px;
  font-size: 0.85rem;
}

/* 게임 세부 통계 (홀짝, 합계) */
.game-metrics {
  display: flex;
  gap: 8px;
  align-items: center;
}

.metric-tag {
  font-size: 0.74rem;
  padding: 3px 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-card);
  border-radius: 4px;
  color: var(--text-sub);
}

.copy-single-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 4px;
  transition: all 0.2s;
}
.copy-single-btn:hover {
  color: var(--accent-gold);
  background: rgba(255, 255, 255, 0.06);
}

/* 모의 당첨 툴 바 */
.check-winning-tool {
  margin-top: 22px;
  padding: 16px 20px;
  background: rgba(251, 191, 36, 0.06);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: var(--radius-md);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}

.tool-info h4 {
  font-size: 0.96rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

.tool-info p {
  font-size: 0.82rem;
  color: var(--text-sub);
  margin-top: 3px;
}

.btn-gold {
  background: var(--accent-gold-gradient);
  color: #1a162b;
  border: none;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}
.btn-gold:hover {
  filter: brightness(1.1);
}

/* ====================================================
   모달 (가상 당첨 결과)
==================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.2s ease;
}

.modal-card {
  background: #151d30;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-lg);
  max-width: 600px;
  width: 100%;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
  animation: scaleUp 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-card);
}

.modal-close {
  background: transparent;
  border: none;
  color: var(--text-sub);
  font-size: 1.3rem;
  cursor: pointer;
  padding: 4px;
}
.modal-close:hover {
  color: var(--text-main);
}

.modal-footer {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}

/* 가상 당첨 번호 박스 */
.winning-target-box {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-card);
  padding: 16px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  text-align: center;
}

.winning-target-box .title {
  font-size: 0.85rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.target-balls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.bonus-plus {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--accent-gold);
  margin: 0 4px;
}

.sim-game-result {
  background: rgba(255, 255, 255, 0.04);
  padding: 12px 14px;
  border-radius: 8px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sim-game-result .rank-tag {
  font-size: 0.85rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
}

.rank-tag.is-win {
  background: #f59e0b;
  color: #111;
}

.rank-tag.is-loss {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

/* ====================================================
   히스토리 섹션
==================================================== */
.history-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.saved-counter {
  font-size: 0.85rem;
  color: var(--text-sub);
}

.btn-text-danger {
  background: transparent;
  border: none;
  color: var(--accent-red);
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.2s;
}
.btn-text-danger:hover {
  background: rgba(239, 68, 68, 0.15);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

/* 스크롤바 커스텀 */
.history-list::-webkit-scrollbar {
  width: 6px;
}
.history-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.empty-state {
  text-align: center;
  padding: 36px 20px;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 2.2rem;
  margin-bottom: 10px;
  opacity: 0.6;
}

.empty-state p {
  font-size: 0.9rem;
}

.history-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.history-item-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-item-date {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.history-item-del-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
}
.history-item-del-btn:hover {
  color: var(--accent-red);
}

/* ====================================================
   안내 및 당첨 테이블 가이드
==================================================== */
.color-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 22px;
}

.color-guide-item {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-card);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-sample {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #111;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.color-info strong {
  display: block;
  font-size: 0.88rem;
  color: var(--text-main);
}
.color-info span {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.winning-grade-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-card);
  margin-bottom: 16px;
}

.winning-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.winning-table th {
  background: rgba(15, 23, 42, 0.8);
  padding: 12px 16px;
  color: var(--text-sub);
  font-weight: 600;
  border-bottom: 1px solid var(--border-card);
}

.winning-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--text-main);
}

.winning-table tr:last-child td {
  border-bottom: none;
}

.badge-rank {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
}
.rank-1 { background: #f59e0b; color: #111; }
.rank-2 { background: #38bdf8; color: #111; }
.rank-3 { background: #a855f7; color: #fff; }
.rank-4 { background: #34d399; color: #111; }
.rank-5 { background: #94a3b8; color: #111; }

.notice-box {
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.84rem;
  color: var(--text-sub);
}
.notice-box i {
  font-size: 1.2rem;
  color: var(--accent-blue);
}

/* ====================================================
   푸터
==================================================== */
.site-footer {
  margin-top: auto;
  background: #080c16;
  border-top: 1px solid var(--border-card);
  padding: 24px 20px;
  text-align: center;
}

.footer-container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.footer-logo {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}
.footer-logo i {
  color: var(--accent-gold);
}

.copyright {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.footer-links {
  font-size: 0.78rem;
  color: var(--accent-gold);
}

/* ====================================================
   토스트 알림
==================================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--accent-gold);
  color: var(--text-main);
  padding: 12px 18px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideInRight 0.3s ease, fadeOut 0.3s ease 2.7s forwards;
  pointer-events: auto;
}

.toast i {
  color: var(--accent-gold);
}

/* ====================================================
   애니메이션 Keyframes
==================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes popIn {
  0% { transform: scale(0.3) rotate(-20deg); opacity: 0; }
  70% { transform: scale(1.15) rotate(5deg); }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

@keyframes bounce-crazy {
  0% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -40px) scale(1.1); }
  50% { transform: translate(-25px, 30px) scale(0.95); }
  75% { transform: translate(35px, 25px) scale(1.05); }
  100% { transform: translate(-10px, -35px) scale(1); }
}

@keyframes pulse-slow {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); }
}

/* ====================================================
   반응형 모바일 미디어 쿼리
==================================================== */
@media (max-width: 768px) {
  .site-header {
    padding: 10px 14px;
  }
  .logo-text h1 {
    font-size: 1.2rem;
  }
  .tagline {
    display: none;
  }
  .dday-card {
    padding: 4px 10px;
  }
  .dday-time {
    font-size: 0.78rem;
  }
  .card {
    padding: 18px 14px;
  }
  .mode-tabs {
    grid-template-columns: repeat(3, 1fr);
  }
  .balls-grid-45 {
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
  }
  .form-row {
    grid-template-columns: 1fr;
  }
  .game-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .game-balls-group {
    width: 100%;
    justify-content: space-between;
  }
  .lotto-ball {
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
  .game-metrics {
    width: 100%;
    justify-content: space-between;
  }
}

/* ====================================================
   인쇄 모드 (영수증 스타일)
==================================================== */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .site-header,
  .lucky-banner,
  .generator-card,
  .mixer-section,
  .results-actions,
  .check-winning-tool,
  .history-card,
  .guide-card,
  .site-footer,
  .toast-container {
    display: none !important;
  }
  .results-card {
    border: 2px dashed #000 !important;
    background: #fff !important;
    box-shadow: none !important;
    padding: 20px !important;
    display: block !important;
    color: #000 !important;
  }
  .game-row {
    background: #fff !important;
    border: 1px solid #ccc !important;
    color: #000 !important;
  }
  .lotto-ball {
    border: 2px solid #000 !important;
    background: #fff !important;
    color: #000 !important;
    box-shadow: none !important;
  }
}
