/* ============================================
   🎱 로또 번호 분석 & 생성기 — Design System
   ============================================ */

/* ---- Google Fonts ---- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ---- CSS Variables ---- */
:root {
  /* Background */
  --bg-primary: #0a0a1a;
  --bg-secondary: #111128;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-glass: rgba(255, 255, 255, 0.06);
  --bg-glass-strong: rgba(255, 255, 255, 0.1);

  /* Text */
  --text-primary: #f0f0ff;
  --text-secondary: rgba(240, 240, 255, 0.65);
  --text-muted: rgba(240, 240, 255, 0.4);

  /* Accent */
  --accent-primary: #7c5cfc;
  --accent-secondary: #a78bfa;
  --accent-glow: rgba(124, 92, 252, 0.35);
  --accent-gradient: linear-gradient(135deg, #7c5cfc 0%, #a78bfa 50%, #c4b5fd 100%);

  /* Lotto Ball Colors */
  --ball-yellow: #FBC400;
  --ball-yellow-shadow: rgba(251, 196, 0, 0.4);
  --ball-blue: #69C8F2;
  --ball-blue-shadow: rgba(105, 200, 242, 0.4);
  --ball-red: #FF7272;
  --ball-red-shadow: rgba(255, 114, 114, 0.4);
  --ball-gray: #AAAAAA;
  --ball-gray-shadow: rgba(170, 170, 170, 0.4);
  --ball-green: #B0D840;
  --ball-green-shadow: rgba(176, 216, 64, 0.4);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.12);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 50%;

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.25s ease;
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

/* ---- Background Decoration ---- */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(124, 92, 252, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(105, 200, 242, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(251, 196, 0, 0.04) 0%, transparent 40%);
  z-index: 0;
  pointer-events: none;
  animation: bgFloat 20s ease-in-out infinite alternate;
}

@keyframes bgFloat {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-2%, -2%) rotate(3deg); }
}

/* ---- Main Container ---- */
.app-container {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
  min-height: 100vh;
}

/* ---- Header ---- */
.app-header {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-xl);
}

.app-header__icon {
  font-size: 3rem;
  margin-bottom: var(--space-sm);
  animation: iconBounce 2s ease-in-out infinite;
  display: inline-block;
}

@keyframes iconBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.app-header__title {
  font-family: 'Outfit', sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: var(--space-xs);
  letter-spacing: -0.5px;
}

.app-header__subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ---- Glass Card ---- */
.glass-card {
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-xl);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  transition: var(--transition-base);
}

.glass-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.16);
}

.card-title {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.card-title__icon {
  font-size: 1rem;
}

/* ---- Mode Selector ---- */
.mode-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.mode-btn {
  background: var(--bg-card);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-sm);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  position: relative;
  overflow: hidden;
}

.mode-btn__icon {
  font-size: 1.4rem;
  transition: var(--transition-bounce);
}

.mode-btn:hover {
  background: var(--bg-glass-strong);
  border-color: rgba(124, 92, 252, 0.3);
  color: var(--text-primary);
  transform: translateY(-2px);
}

.mode-btn:hover .mode-btn__icon {
  transform: scale(1.15);
}

.mode-btn.active {
  background: rgba(124, 92, 252, 0.15);
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 20px var(--accent-glow);
}

.mode-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 30px;
  height: 3px;
  background: var(--accent-gradient);
  border-radius: 3px 3px 0 0;
}

.mode-btn__desc {
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.3;
}

/* ---- Slider ---- */
.slider-container {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.slider-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.slider-wrapper {
  flex: 1;
  position: relative;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(to right, var(--accent-primary) 0%, rgba(124, 92, 252, 0.2) 100%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 0 12px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
  transition: var(--transition-base);
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 20px var(--accent-glow), 0 2px 12px rgba(0,0,0,0.4);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--accent-primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  border: none;
  box-shadow: 0 0 12px var(--accent-glow), 0 2px 8px rgba(0,0,0,0.3);
}

.slider-value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--accent-secondary);
  min-width: 40px;
  text-align: center;
}

.slider-marks {
  display: flex;
  justify-content: space-between;
  padding: var(--space-xs) 2px 0;
}

.slider-marks span {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ---- Exclude & Lock Numbers ---- */
.number-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.number-picker__btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.number-picker__btn:hover {
  border-color: rgba(124, 92, 252, 0.4);
  background: var(--bg-glass-strong);
  transform: scale(1.1);
}

.number-picker__btn.excluded {
  background: rgba(255, 114, 114, 0.15);
  border-color: var(--ball-red);
  color: var(--ball-red);
  text-decoration: line-through;
}

.number-picker__btn.locked {
  background: rgba(124, 92, 252, 0.2);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
  box-shadow: 0 0 10px var(--accent-glow);
}

.picker-controls {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.picker-mode-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
}

.picker-mode-btn:hover {
  background: var(--bg-glass-strong);
}

.picker-mode-btn.active {
  background: rgba(124, 92, 252, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

.picker-info {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
  text-align: center;
}

/* ---- Generate Button ---- */
.generate-btn {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: var(--radius-lg);
  background: var(--accent-gradient);
  color: white;
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.generate-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.6s ease;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px var(--accent-glow);
}

.generate-btn:hover::before {
  left: 100%;
}

.generate-btn:active {
  transform: translateY(0);
  box-shadow: 0 4px 15px var(--accent-glow);
}

.generate-btn.generating {
  pointer-events: none;
  animation: pulse 0.6s ease infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ---- Results Area ---- */
.results-container {
  min-height: 80px;
}

.result-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-subtle);
  opacity: 0;
  transform: translateY(20px);
  animation: rowAppear 0.5s ease forwards;
}

.result-row:last-child {
  border-bottom: none;
}

@keyframes rowAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-row__label {
  font-family: 'Outfit', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 35px;
}

.result-row__balls {
  display: flex;
  gap: var(--space-sm);
  flex: 1;
}

.result-row__actions {
  display: flex;
  gap: var(--space-xs);
}

.copy-row-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  gap: 4px;
}

.copy-row-btn:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  border-color: var(--accent-primary);
}

.copy-row-btn.copied {
  border-color: #4ade80;
  color: #4ade80;
}

/* ---- Lotto Ball ---- */
.lotto-ball {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #1a1a2e;
  position: relative;
  cursor: default;
  transition: var(--transition-base);
  opacity: 0;
  transform: scale(0) rotate(-180deg);
  animation: ballPop 0.4s var(--transition-bounce) forwards;
}

.lotto-ball::before {
  content: '';
  position: absolute;
  top: 6px;
  left: 10px;
  width: 12px;
  height: 8px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transform: rotate(-20deg);
}

.lotto-ball:hover {
  transform: translateY(-4px) scale(1.08);
}

@keyframes ballPop {
  0% {
    opacity: 0;
    transform: scale(0) rotate(-180deg);
  }
  60% {
    transform: scale(1.2) rotate(10deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0deg);
  }
}

/* Ball colors */
.ball-yellow {
  background: linear-gradient(145deg, #FFD54F, var(--ball-yellow), #F9A825);
  box-shadow: 0 4px 15px var(--ball-yellow-shadow), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball-blue {
  background: linear-gradient(145deg, #81D4FA, var(--ball-blue), #4FC3F7);
  box-shadow: 0 4px 15px var(--ball-blue-shadow), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball-red {
  background: linear-gradient(145deg, #FF8A80, var(--ball-red), #EF5350);
  box-shadow: 0 4px 15px var(--ball-red-shadow), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball-gray {
  background: linear-gradient(145deg, #BDBDBD, var(--ball-gray), #9E9E9E);
  box-shadow: 0 4px 15px var(--ball-gray-shadow), inset 0 -3px 6px rgba(0,0,0,0.15);
}

.ball-green {
  background: linear-gradient(145deg, #C5E17A, var(--ball-green), #9CCC65);
  box-shadow: 0 4px 15px var(--ball-green-shadow), inset 0 -3px 6px rgba(0,0,0,0.15);
}

/* Small ball variant for number picker */
.lotto-ball--small {
  width: 36px;
  height: 36px;
  font-size: 0.8rem;
}

.lotto-ball--small::before {
  top: 4px;
  left: 7px;
  width: 9px;
  height: 6px;
}

/* ---- Frequency Chart ---- */
.freq-chart {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.freq-chart__row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  height: 24px;
}

.freq-chart__number {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 24px;
  text-align: right;
}

.freq-chart__bar-wrapper {
  flex: 1;
  height: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.freq-chart__bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  min-width: 2px;
}

.freq-chart__bar::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 80%, rgba(255,255,255,0.15));
}

.freq-chart__count {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 28px;
  text-align: left;
}

/* Chart bar colors */
.freq-bar-yellow { background: linear-gradient(90deg, rgba(251, 196, 0, 0.3), var(--ball-yellow)); }
.freq-bar-blue { background: linear-gradient(90deg, rgba(105, 200, 242, 0.3), var(--ball-blue)); }
.freq-bar-red { background: linear-gradient(90deg, rgba(255, 114, 114, 0.3), var(--ball-red)); }
.freq-bar-gray { background: linear-gradient(90deg, rgba(170, 170, 170, 0.3), var(--ball-gray)); }
.freq-bar-green { background: linear-gradient(90deg, rgba(176, 216, 64, 0.3), var(--ball-green)); }

/* Chart sort controls */
.chart-controls {
  display: flex;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}

.chart-sort-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
}

.chart-sort-btn:hover {
  background: var(--bg-glass-strong);
}

.chart-sort-btn.active {
  background: rgba(124, 92, 252, 0.15);
  border-color: var(--accent-primary);
  color: var(--accent-secondary);
}

/* ---- History ---- */
.history-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 400px;
  overflow-y: auto;
}

.history-list::-webkit-scrollbar {
  width: 4px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--border-glass);
  border-radius: 4px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  transition: var(--transition-base);
}

.history-item:hover {
  background: var(--bg-glass-strong);
}

.history-item__meta {
  display: flex;
  flex-direction: column;
  min-width: 60px;
}

.history-item__mode {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent-secondary);
}

.history-item__time {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.history-item__balls {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}

.history-item .lotto-ball {
  width: 30px;
  height: 30px;
  font-size: 0.7rem;
  opacity: 1;
  transform: none;
  animation: none;
}

.history-item .lotto-ball::before {
  top: 3px;
  left: 6px;
  width: 7px;
  height: 5px;
}

.history-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: var(--space-xl) 0;
}

.history-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-md);
}

.clear-history-btn {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 114, 114, 0.3);
  background: rgba(255, 114, 114, 0.1);
  color: var(--ball-red);
  font-family: 'Inter', sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-base);
}

.clear-history-btn:hover {
  background: rgba(255, 114, 114, 0.2);
  border-color: var(--ball-red);
}

/* ---- Sound Toggle ---- */
.sound-toggle {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass);
  color: var(--text-secondary);
  font-size: 1.2rem;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.sound-toggle:hover {
  background: var(--bg-glass-strong);
  color: var(--text-primary);
  transform: scale(1.1);
}

.sound-toggle.muted {
  color: var(--text-muted);
}

/* ---- Toast Notification ---- */
.toast {
  position: fixed;
  bottom: var(--space-xl);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--bg-glass-strong);
  backdrop-filter: blur(20px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-lg);
  color: var(--text-primary);
  font-size: 0.85rem;
  font-weight: 500;
  pointer-events: none;
  transition: var(--transition-smooth);
  z-index: 200;
  opacity: 0;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ---- Collapsible Sections ---- */
.collapse-toggle {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.75rem;
  margin-left: auto;
  padding: var(--space-xs);
  transition: var(--transition-base);
}

.collapse-toggle:hover {
  color: var(--text-primary);
}

.collapsible {
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.3s ease;
  max-height: 2000px;
  opacity: 1;
}

.collapsible.collapsed {
  max-height: 0;
  opacity: 0;
}

/* ---- Empty state ---- */
.empty-results {
  text-align: center;
  padding: var(--space-2xl) 0;
  color: var(--text-muted);
}

.empty-results__icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.4;
}

.empty-results__text {
  font-size: 0.9rem;
}

/* ---- Latest Draw Card ---- */
.latest-draw-card {
  background: linear-gradient(135deg, rgba(124, 92, 252, 0.12) 0%, rgba(105, 200, 242, 0.08) 100%);
  border-color: rgba(124, 92, 252, 0.3);
  position: relative;
  overflow: hidden;
}

.latest-draw-card::after {
  content: '';
  position: absolute;
  top: -60px; right: -60px;
  width: 180px; height: 180px;
  background: radial-gradient(circle, rgba(124,92,252,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.latest-draw__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.latest-draw__round-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.latest-draw__round {
  font-family: 'Outfit', sans-serif;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.latest-draw__date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.latest-draw__countdown {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.countdown__label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.countdown__value {
  font-family: 'Outfit', sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

.latest-draw__prize {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
  padding: var(--space-sm) var(--space-md);
  background: rgba(251, 196, 0, 0.08);
  border: 1px solid rgba(251, 196, 0, 0.2);
  border-radius: var(--radius-md);
}

.prize__label {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.prize__amount {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: #FBC400;
}

.latest-draw__balls-wrap {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.latest-draw__balls {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.latest-draw__plus {
  font-size: 1.3rem;
  color: var(--text-muted);
  font-weight: 300;
  padding: 0 4px;
}

.latest-draw__bonus {
  display: flex;
}

.latest-draw__bonus .lotto-ball {
  opacity: 1;
  transform: none;
  animation: none;
  border: 2px dashed rgba(255,255,255,0.3);
}

/* ---- Recent 5 Draws ---- */
.recent-draws-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.recent-draw-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  transition: var(--transition-base);
}

.recent-draw-item:hover {
  background: var(--bg-glass-strong);
}

.recent-draw-item__info {
  display: flex;
  flex-direction: column;
  min-width: 56px;
}

.recent-draw-item__round {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent-secondary);
}

.recent-draw-item__date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.recent-draw-item__balls {
  display: flex;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
  align-items: center;
}

.recent-draw-item .lotto-ball {
  width: 32px;
  height: 32px;
  font-size: 0.75rem;
  opacity: 1;
  transform: none;
  animation: none;
}

.recent-draw-item .lotto-ball::before {
  top: 3px; left: 6px;
  width: 8px; height: 5px;
}

.recent-plus {
  font-size: 0.9rem;
  color: var(--text-muted);
  padding: 0 2px;
}

.recent-bonus .lotto-ball {
  border: 1.5px dashed rgba(255,255,255,0.3);
}

/* ---- Match Indicator (내 번호 당첨 확인) ---- */
.match-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

.match-badge--none  { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.match-badge--3     { background: rgba(105,200,242,0.15); color: var(--ball-blue); border: 1px solid rgba(105,200,242,0.3); }
.match-badge--4     { background: rgba(176,216,64,0.15);  color: var(--ball-green); border: 1px solid rgba(176,216,64,0.3); }
.match-badge--5     { background: rgba(251,196,0,0.15);   color: var(--ball-yellow); border: 1px solid rgba(251,196,0,0.3); }
.match-badge--5b    { background: rgba(255,114,114,0.15); color: var(--ball-red); border: 1px solid rgba(255,114,114,0.3); }
.match-badge--6     { background: rgba(124,92,252,0.25);  color: var(--accent-secondary); border: 1px solid var(--accent-primary); animation: pulse 1s ease infinite; }

/* ---- Footer ---- */
.app-footer {
  text-align: center;
  padding: var(--space-2xl) 0 var(--space-lg);
  color: var(--text-muted);
  font-size: 0.75rem;
}

.app-footer a {
  color: var(--accent-secondary);
  text-decoration: none;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .app-container {
    padding: var(--space-md) var(--space-sm);
  }

  .app-header {
    padding: var(--space-lg) 0 var(--space-md);
  }

  .app-header__title {
    font-size: 1.7rem;
  }

  .mode-selector {
    grid-template-columns: repeat(2, 1fr);
  }

  .mode-btn {
    padding: var(--space-sm);
  }

  .lotto-ball {
    width: 40px;
    height: 40px;
    font-size: 0.95rem;
  }

  .lotto-ball::before {
    top: 5px;
    left: 8px;
    width: 10px;
    height: 7px;
  }

  .result-row {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .result-row__balls {
    gap: 6px;
  }

  .glass-card {
    padding: var(--space-md);
    border-radius: var(--radius-lg);
  }

  .number-picker__btn {
    width: 32px;
    height: 32px;
    font-size: 0.7rem;
  }

  .sound-toggle {
    bottom: var(--space-md);
    right: var(--space-md);
    width: 38px;
    height: 38px;
    font-size: 1rem;
  }
}

@media (max-width: 400px) {
  .app-header__title {
    font-size: 1.4rem;
  }

  .lotto-ball {
    width: 36px;
    height: 36px;
    font-size: 0.85rem;
  }
}

/* ---- Utility / Animation delays ---- */
.delay-1 { animation-delay: 0.05s; }
.delay-2 { animation-delay: 0.1s; }
.delay-3 { animation-delay: 0.15s; }
.delay-4 { animation-delay: 0.2s; }
.delay-5 { animation-delay: 0.25s; }
.delay-6 { animation-delay: 0.3s; }

.row-delay-1 { animation-delay: 0s; }
.row-delay-2 { animation-delay: 0.15s; }
.row-delay-3 { animation-delay: 0.3s; }
.row-delay-4 { animation-delay: 0.45s; }
.row-delay-5 { animation-delay: 0.6s; }
