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

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

.container {
  text-align: center;
  padding: 40px 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 20px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-width: 600px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

h1 {
  font-size: 2rem;
  margin-bottom: 40px;
  text-shadow: 0 0 20px rgba(255, 200, 0, 0.5);
  letter-spacing: 2px;
}

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

.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;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3), inset 0 -3px 6px rgba(0,0,0,0.2), inset 0 3px 6px rgba(255,255,255,0.3);
  transition: transform 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

.ball.placeholder {
  background: rgba(255, 255, 255, 0.1);
  border: 2px dashed rgba(255,255,255,0.3);
  color: rgba(255,255,255,0.4);
  box-shadow: none;
  font-size: 1.6rem;
}

.ball.placeholder::before {
  display: none;
}

/* 번호별 색상 (실제 로또 색상) */
.ball.range-1  { background: radial-gradient(circle at 35% 35%, #ffcc00, #e6b800); color: #333; }
.ball.range-2  { background: radial-gradient(circle at 35% 35%, #4da6ff, #1a7fe6); }
.ball.range-3  { background: radial-gradient(circle at 35% 35%, #ff6b6b, #e63030); }
.ball.range-4  { background: radial-gradient(circle at 35% 35%, #888, #555); }
.ball.range-5  { background: radial-gradient(circle at 35% 35%, #66bb6a, #388e3c); }

.ball.animate {
  animation: ballPop 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

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

button {
  padding: 14px 40px;
  border: none;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  letter-spacing: 1px;
  margin: 5px;
}

#drawBtn {
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #1a1a2e;
  box-shadow: 0 6px 20px rgba(255, 140, 0, 0.4);
}

#drawBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(255, 140, 0, 0.6);
}

#drawBtn:active {
  transform: translateY(0);
}

#drawBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#resetBtn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.3);
}

#resetBtn:hover {
  background: rgba(255,255,255,0.25);
  transform: translateY(-2px);
}

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

.history h2 {
  font-size: 1.1rem;
  color: rgba(255,255,255,0.6);
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 10px;
}

#historyList {
  list-style: none;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 4px;
}

#historyList::-webkit-scrollbar {
  width: 4px;
}

#historyList::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
}

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

.history-num {
  color: rgba(255,255,255,0.4);
  min-width: 24px;
  font-size: 0.8rem;
}

.history-balls {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.mini-ball.range-1 { background: radial-gradient(circle at 35% 35%, #ffcc00, #e6b800); color: #333; }
.mini-ball.range-2 { background: radial-gradient(circle at 35% 35%, #4da6ff, #1a7fe6); }
.mini-ball.range-3 { background: radial-gradient(circle at 35% 35%, #ff6b6b, #e63030); }
.mini-ball.range-4 { background: radial-gradient(circle at 35% 35%, #888, #555); }
.mini-ball.range-5 { background: radial-gradient(circle at 35% 35%, #66bb6a, #388e3c); }

.history-time {
  margin-left: auto;
  color: rgba(255,255,255,0.3);
  font-size: 0.75rem;
  white-space: nowrap;
}

.empty-history {
  color: rgba(255,255,255,0.3);
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}
