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

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

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

h1 {
  font-size: 2.4rem;
  margin-bottom: 8px;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

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

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

.ball {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 15px 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.2);
  position: relative;
  transition: transform 0.3s ease;
}

.ball:hover {
  transform: scale(1.1);
}

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

.ball.range-1 { background: linear-gradient(145deg, #ffc107, #e6a800); }
.ball.range-2 { background: linear-gradient(145deg, #42a5f5, #1e88e5); }
.ball.range-3 { background: linear-gradient(145deg, #ef5350, #d32f2f); }
.ball.range-4 { background: linear-gradient(145deg, #78909c, #546e7a); }
.ball.range-5 { background: linear-gradient(145deg, #66bb6a, #43a047); }

.bonus-separator {
  font-size: 1.8rem;
  font-weight: 700;
  color: #a0b4d0;
  margin: 0 4px;
}

.ball.pop-in {
  animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

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

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

.ball.bounce {
  animation: bounce 0.6s ease;
}

button {
  padding: 14px 36px;
  font-size: 1.1rem;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 0 8px;
}

#drawBtn {
  background: linear-gradient(135deg, #e94560, #c23152);
  color: #fff;
  box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

#drawBtn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(233, 69, 96, 0.6);
}

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

#drawBtn.drawing {
  opacity: 0.6;
  pointer-events: none;
}

#resetBtn {
  background: rgba(255, 255, 255, 0.1);
  color: #a0b4d0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#resetBtn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.history {
  margin-top: 48px;
  display: none;
}

.history.show {
  display: block;
}

.history h2 {
  font-size: 1.2rem;
  color: #a0b4d0;
  margin-bottom: 16px;
}

.history ul {
  list-style: none;
  max-height: 240px;
  overflow-y: auto;
}

.history li {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.history li .round {
  color: #a0b4d0;
  font-weight: 600;
  margin-right: 8px;
  white-space: nowrap;
}

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

.history .mini-separator {
  font-size: 0.9rem;
  color: #a0b4d0;
  font-weight: 700;
}

.comments-section {
  margin-top: 48px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  padding: 24px;
}

.comments-section h2 {
  font-size: 1.2rem;
  color: #a0b4d0;
  margin-bottom: 16px;
  text-align: center;
}

#disqus_thread {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  min-height: 200px;
}

.contact-link {
  display: inline-block;
  margin-top: 24px;
  color: #a0b4d0;
  text-decoration: none;
  font-size: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 10px 24px;
  border-radius: 50px;
  transition: all 0.3s ease;
}

.contact-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

@media (max-width: 480px) {
  h1 { font-size: 1.8rem; }
  .ball { width: 52px; height: 52px; font-size: 1.2rem; }
  .balls-container { gap: 8px; }
  button { padding: 12px 24px; font-size: 1rem; }
}
