:root {
  --bg-color: #0f172a;
  --card-bg: rgba(255, 255, 255, 0.05);
  --card-border: rgba(255, 255, 255, 0.1);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;

  /* 로또 공 고유 색상 */
  --c10: #fbc400; /* 노랑 */
  --c20: #69c8f2; /* 파랑 */
  --c30: #ff7272; /* 빨강 */
  --c40: #aaaaaa; /* 회색 */
  --c50: #b0d840; /* 초록 */
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family:
    "Pretendard",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    "Helvetica Neue",
    Arial,
    sans-serif;
  background: radial-gradient(
    circle at center,
    #1e293b 0%,
    var(--bg-color) 100%
  );
  color: var(--text-primary);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  animation: fadeIn 1s ease-out;
}

.background-animation {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.background-animation::before,
.background-animation::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.15) 0%,
    rgba(139, 92, 246, 0) 70%
  );
  animation: float 10s infinite alternate ease-in-out;
}

.background-animation::after {
  background: radial-gradient(
    circle,
    rgba(56, 189, 248, 0.15) 0%,
    rgba(56, 189, 248, 0) 70%
  );
  width: 400px;
  height: 400px;
  right: -100px;
  bottom: -100px;
  animation-delay: -5s;
}

@keyframes float {
  0% {
    transform: translate(0, 0);
  }
  100% {
    transform: translate(50px, 50px);
  }
}

.container {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: 3rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  text-align: center;
  width: 100%;
  max-width: 600px;
  transition: transform 0.3s ease;
}

header {
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.25rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, #f8fafc, #94a3b8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
}

p {
  color: var(--text-secondary);
  font-size: 1.125rem;
  font-weight: 400;
}

.balls-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  min-height: 80px;
  margin-bottom: 3rem;
  perspective: 1000px;
}

.empty-state {
  color: var(--text-secondary);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 80px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 12px;
  border: 1px dashed var(--card-border);
}

.lotto-ball {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
  box-shadow:
    inset -5px -5px 10px rgba(0, 0, 0, 0.3),
    inset 5px 5px 10px rgba(255, 255, 255, 0.4),
    0 4px 6px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: scale(0.5) translateY(20px) rotateX(-90deg);
  animation: popIn 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes popIn {
  to {
    opacity: 1;
    transform: scale(1) translateY(0) rotateX(0deg);
  }
}

.generate-btn {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: white;
  border: none;
  border-radius: 12px;
  padding: 1rem 2.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  outline: none;
}

.generate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.generate-btn:active {
  transform: translateY(1px);
}

.generate-btn:disabled {
  background: #475569;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

@media (max-width: 640px) {
  .container {
    padding: 2rem 1.5rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }
  .lotto-ball {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}
