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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  transition: background 0.3s ease;
}

.container {
  background: white;
  border-radius: 20px;
  padding: 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 600px;
  width: 100%;
}

h1 {
  color: #333;
  margin-bottom: 10px;
  font-size: 2.5em;
}

.subtitle {
  color: #666;
  margin-bottom: 40px;
  font-size: 1.1em;
}

.numbers-container {
  display: flex;
  justify-content: center;
  gap: 15px;
  margin: 40px 0;
  flex-wrap: wrap;
}

.number-ball {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: bold;
  color: white;
  background: linear-gradient(135deg, #ccc 0%, #999 100%);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  animation: bounce 0.5s ease;
}

.number-ball.show {
  animation: pop 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* 번호 범위별 색상 */
.number-ball.color-1 { background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%); }
.number-ball.color-2 { background: linear-gradient(135deg, #4a90e2 0%, #67b5ff 100%); }
.number-ball.color-3 { background: linear-gradient(135deg, #e74c3c 0%, #ff6b6b 100%); }
.number-ball.color-4 { background: linear-gradient(135deg, #95a5a6 0%, #b8c4c8 100%); }
.number-ball.color-5 { background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%); }

.generate-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  padding: 15px 50px;
  font-size: 18px;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

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

.history {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid #eee;
}

.history-item {
  background: #f8f9fa;
  padding: 15px;
  margin: 10px 0;
  border-radius: 10px;
  font-size: 14px;
}

.history-numbers {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 10px;
  flex-wrap: wrap;
}

.history-ball {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: white;
  font-size: 16px;
}

@keyframes pop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

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

/* 테마 토글 버튼 */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
}

.theme-toggle:hover {
  transform: scale(1.1) rotate(15deg);
  background: rgba(255, 255, 255, 0.3);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-icon {
  transition: transform 0.3s ease;
}

/* 다크모드 스타일 */
body.dark-mode {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .container {
  background: #0f3460;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode h1 {
  color: #e8e8e8;
}

body.dark-mode .subtitle {
  color: #b8b8b8;
}

body.dark-mode .history {
  border-top-color: #1a1a2e;
}

body.dark-mode .history-item {
  background: #1a1a2e;
  color: #e8e8e8;
}

body.dark-mode .generate-btn {
  background: linear-gradient(135deg, #e94560 0%, #533483 100%);
  box-shadow: 0 4px 15px rgba(233, 69, 96, 0.4);
}

body.dark-mode .generate-btn:hover {
  box-shadow: 0 6px 20px rgba(233, 69, 96, 0.6);
}

body.dark-mode .theme-toggle {
  background: rgba(15, 52, 96, 0.6);
}

body.dark-mode .theme-toggle:hover {
  background: rgba(15, 52, 96, 0.8);
}

@media (max-width: 600px) {
  .container {
    padding: 20px;
  }

  h1 {
    font-size: 2em;
  }

  .number-ball {
    width: 50px;
    height: 50px;
    font-size: 20px;
  }

  .theme-toggle {
    width: 50px;
    height: 50px;
    font-size: 20px;
    top: 15px;
    right: 15px;
  }
}
