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

body {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
}

.container {
  text-align: center;
  max-width: 700px;
  width: 100%;
}

h1 {
  color: #ffd700;
  font-size: 2.8rem;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.subtitle {
  color: #aaa;
  font-size: 1rem;
  margin-bottom: 40px;
}

.balls-container {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
  min-height: 100px;
}

.ball-slot {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  border: 2px dashed #444;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  transition: all 0.3s ease;
}

.ball-slot.filled {
  border: none;
  box-shadow: 0 4px 15px rgba(0,0,0,0.4);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 번호 색상: 실제 로또 색상 기준 */
.ball-slot.range-1  { background: radial-gradient(circle at 35% 35%, #ffe066, #f4b400); color: #333; }
.ball-slot.range-2  { background: radial-gradient(circle at 35% 35%, #60aaff, #1a6fc4); }
.ball-slot.range-3  { background: radial-gradient(circle at 35% 35%, #ff7070, #c0392b); }
.ball-slot.range-4  { background: radial-gradient(circle at 35% 35%, #aaa, #555); }
.ball-slot.range-5  { background: radial-gradient(circle at 35% 35%, #6fff6f, #27ae60); }

.ball-slot.bonus {
  border: 2px dashed #ff6b6b;
}

.ball-slot.bonus.filled {
  box-shadow: 0 4px 20px rgba(255, 107, 107, 0.6);
}

.plus {
  color: #aaa;
  font-size: 1.8rem;
  font-weight: bold;
  margin: 0 4px;
}

@keyframes popIn {
  0% { transform: scale(0) rotate(-180deg); opacity: 0; }
  100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.draw-btn {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  border: none;
  padding: 16px 48px;
  font-size: 1.2rem;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.4);
  letter-spacing: 1px;
}

.draw-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
}

.draw-btn:active:not(:disabled) {
  transform: translateY(0);
}

.draw-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.history {
  margin-top: 50px;
  text-align: left;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  padding: 24px;
}

.history h2 {
  color: #ffd700;
  margin-bottom: 16px;
  font-size: 1.2rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 12px;
}

#historyList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  animation: fadeIn 0.3s ease;
}

.history-item .history-count {
  color: #888;
  font-size: 0.85rem;
  min-width: 32px;
}

.history-ball {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: bold;
  color: #fff;
}

.history-ball.range-1 { background: radial-gradient(circle at 35% 35%, #ffe066, #f4b400); color: #333; }
.history-ball.range-2 { background: radial-gradient(circle at 35% 35%, #60aaff, #1a6fc4); }
.history-ball.range-3 { background: radial-gradient(circle at 35% 35%, #ff7070, #c0392b); }
.history-ball.range-4 { background: radial-gradient(circle at 35% 35%, #aaa, #555); }
.history-ball.range-5 { background: radial-gradient(circle at 35% 35%, #6fff6f, #27ae60); }

.history-ball.bonus-ball {
  box-shadow: 0 0 8px rgba(255,107,107,0.7);
}

.history-plus {
  color: #888;
  font-size: 1rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.empty-msg {
  color: #666;
  font-size: 0.9rem;
  text-align: center;
  padding: 12px 0;
}
