@import url('https://fonts.googleapis.com/css2?family=Gowun+Dodum&family=Jua&display=swap');

:root {
  --navy: #172554;
  --purple: #6d28d9;
  --purple-dark: #5b21b6;
  --paper: rgba(255, 255, 255, 0.94);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  color: var(--navy);
  font-family: "Gowun Dodum", sans-serif;
  background:
    radial-gradient(circle at 15% 20%, rgba(250, 204, 21, 0.45), transparent 25%),
    radial-gradient(circle at 85% 80%, rgba(167, 139, 250, 0.55), transparent 28%),
    linear-gradient(135deg, #fdf2f8, #ede9fe 50%, #dbeafe);
}

.lotto-card {
  width: min(680px, 100%);
  padding: clamp(30px, 7vw, 56px);
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  background: var(--paper);
  box-shadow: 0 24px 70px rgba(76, 29, 149, 0.18);
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--purple);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.2em;
}

h1 {
  margin: 0;
  font-family: "Jua", sans-serif;
  font-size: clamp(2rem, 7vw, 3.4rem);
  font-weight: 400;
  letter-spacing: -0.04em;
}

.description {
  margin: 12px 0 34px;
  color: #64748b;
  font-size: clamp(0.95rem, 3vw, 1.1rem);
}

.machine {
  min-height: 150px;
  display: grid;
  place-items: center;
  margin-bottom: 28px;
  padding: 30px 20px;
  overflow: hidden;
  border: 2px dashed #c4b5fd;
  border-radius: 24px;
  background: linear-gradient(145deg, #faf5ff, #f8fafc);
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.placeholder {
  color: #8b5cf6;
  font-weight: 700;
}

.ball {
  width: clamp(54px, 11vw, 68px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  color: white;
  font-family: "Jua", sans-serif;
  font-size: clamp(1.25rem, 4vw, 1.6rem);
  border: 3px solid rgba(255, 255, 255, 0.72);
  border-radius: 50%;
  box-shadow: inset -7px -9px 14px rgba(0, 0, 0, 0.14), 0 8px 16px rgba(30, 41, 59, 0.18);
  animation: pop 0.45s both;
}

.ball:nth-child(2) { animation-delay: 0.08s; }
.ball:nth-child(3) { animation-delay: 0.16s; }
.ball:nth-child(4) { animation-delay: 0.24s; }
.ball:nth-child(5) { animation-delay: 0.32s; }
.ball:nth-child(6) { animation-delay: 0.4s; }

.yellow { background: #eab308; }
.blue { background: #3b82f6; }
.red { background: #ef4444; }
.gray { background: #64748b; }
.green { background: #22a060; }

.draw-button {
  width: min(300px, 100%);
  padding: 16px 24px;
  color: white;
  font: 700 1.05rem "Gowun Dodum", sans-serif;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #8b5cf6, var(--purple));
  box-shadow: 0 12px 24px rgba(109, 40, 217, 0.28);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.draw-button:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px rgba(109, 40, 217, 0.35);
}

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

.draw-button:focus-visible {
  outline: 4px solid #facc15;
  outline-offset: 4px;
}

.draw-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.draw-count {
  min-height: 24px;
  margin: 18px 0 0;
  color: var(--purple-dark);
  font-weight: 700;
}

.notice {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 0.8rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(25px) scale(0.5) rotate(-20deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0);
  }
}

@media (max-width: 480px) {
  body { padding: 14px; }
  .lotto-card { padding: 32px 18px; border-radius: 24px; }
  .machine { min-height: 185px; padding-inline: 12px; }
  .number-list { gap: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
