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

body {
  background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Segoe UI', sans-serif;
  color: #fff;
}

.container {
  text-align: center;
  padding: 40px 20px;
  max-width: 600px;
  width: 100%;
}

h1 {
  font-size: 2.4rem;
  margin-bottom: 8px;
  text-shadow: 0 0 20px rgba(255, 220, 0, 0.5);
}

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

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

.ball-slot {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  border: 2px dashed rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  transition: transform 0.3s;
}

.ball {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  font-weight: bold;
  color: #fff;
  box-shadow: inset -6px -6px 12px rgba(0,0,0,0.3), 0 6px 20px rgba(0,0,0,0.4);
  animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* 번호대별 색상 */
.ball.yellow  { background: radial-gradient(circle at 35% 35%, #ffe066, #f5a623); }
.ball.blue    { background: radial-gradient(circle at 35% 35%, #6ec6ff, #1565c0); }
.ball.red     { background: radial-gradient(circle at 35% 35%, #ff7070, #c62828); }
.ball.gray    { background: radial-gradient(circle at 35% 35%, #bdbdbd, #546e7a); }
.ball.green   { background: radial-gradient(circle at 35% 35%, #69f0ae, #2e7d32); }

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

.btn-group {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.draw-btn {
  background: linear-gradient(135deg, #f5a623, #f7c948);
  color: #1a1a2e;
  border: none;
  padding: 14px 36px;
  font-size: 1.1rem;
  font-weight: bold;
  border-radius: 50px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(245, 166, 35, 0.5);
  transition: transform 0.15s, box-shadow 0.15s;
}

.draw-btn.secondary {
  background: linear-gradient(135deg, #4a90d9, #6ec6ff);
  color: #fff;
  box-shadow: 0 4px 20px rgba(74, 144, 217, 0.5);
}

.draw-btn.secondary:hover {
  box-shadow: 0 8px 28px rgba(74, 144, 217, 0.7);
}

.draw-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(245, 166, 35, 0.7);
}

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

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

.history {
  margin-top: 50px;
  text-align: left;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.history h2 {
  font-size: 1rem;
  color: #aaa;
}

.clear-btn {
  background: none;
  border: 1px solid rgba(255,80,80,0.5);
  color: #ff6b6b;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

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

#historyList {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

#historyList li {
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

#historyList li .mini-balls {
  display: flex;
  gap: 6px;
}

.mini-ball {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: bold;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
  box-shadow: inset -3px -3px 6px rgba(0,0,0,0.3);
}

.mini-ball.yellow { background: radial-gradient(circle at 35% 35%, #ffe066, #f5a623); }
.mini-ball.blue   { background: radial-gradient(circle at 35% 35%, #6ec6ff, #1565c0); }
.mini-ball.red    { background: radial-gradient(circle at 35% 35%, #ff7070, #c62828); }
.mini-ball.gray   { background: radial-gradient(circle at 35% 35%, #bdbdbd, #546e7a); }
.mini-ball.green  { background: radial-gradient(circle at 35% 35%, #69f0ae, #2e7d32); }

.history-time {
  color: #777;
  font-size: 0.75rem;
  margin-left: auto;
  white-space: nowrap;
}
