:root {
  color-scheme: light;
  --bg-top: #fff8e8;
  --bg-bottom: #f2f6ff;
  --ink: #162033;
  --muted: #5a657a;
  --card: rgba(255, 255, 255, 0.8);
  --card-border: rgba(22, 32, 51, 0.08);
  --accent: #ff7a18;
  --accent-strong: #e04f16;
  --accent-soft: #ffe0b8;
  --blue-soft: #dce9ff;
  --shadow: 0 20px 50px rgba(23, 34, 60, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Trebuchet MS", "Noto Sans KR", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 172, 94, 0.35), transparent 28%),
    radial-gradient(circle at top right, rgba(126, 172, 255, 0.22), transparent 32%),
    linear-gradient(180deg, var(--bg-top), var(--bg-bottom));
}

.page-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.hero {
  text-align: center;
  padding: 24px 0 40px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.hero h1,
.panel-head h2 {
  margin: 0;
  line-height: 1.05;
}

.hero h1 {
  font-size: clamp(2.6rem, 6vw, 5rem);
}

.hero-copy {
  width: min(620px, 100%);
  margin: 18px auto 0;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 1.25fr 0.95fr;
  gap: 24px;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.draw-panel {
  padding: 28px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.draw-button {
  border: 0;
  border-radius: 999px;
  padding: 14px 24px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(224, 79, 22, 0.26);
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.draw-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 28px rgba(224, 79, 22, 0.3);
}

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

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

.ball-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin-top: 28px;
}

.ball {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  font-size: clamp(1.1rem, 3vw, 1.7rem);
  font-weight: 800;
  color: #fff;
  background: #9ea8ba;
  transform: scale(1);
}

.ball.show {
  animation: pop-in 340ms cubic-bezier(.21, 1.18, .61, .99);
}

.ball.placeholder {
  background: rgba(133, 146, 168, 0.24);
  color: rgba(22, 32, 51, 0.42);
}

.band-1 {
  background: linear-gradient(135deg, #f5b100, #ff8600);
}

.band-2 {
  background: linear-gradient(135deg, #2d8fff, #1d61ff);
}

.band-3 {
  background: linear-gradient(135deg, #ff5d73, #e32949);
}

.band-4 {
  background: linear-gradient(135deg, #7d55ff, #4f32d1);
}

.band-5 {
  background: linear-gradient(135deg, #19b865, #0b8f4c);
}

.bonus-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.bonus-label {
  font-weight: 700;
  color: var(--muted);
}

.bonus {
  width: 72px;
  aspect-ratio: 1;
  background: linear-gradient(135deg, #19253b, #40547a);
}

.draw-summary {
  margin: 24px 0 0;
  padding: 16px 18px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: #7b4205;
  line-height: 1.6;
}

.info-panel {
  padding: 28px;
  display: grid;
  gap: 28px;
}

.info-block {
  padding: 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.rule-list,
.history-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-entry {
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--blue-soft);
  color: var(--ink);
}

.history-empty {
  color: var(--muted);
}

@keyframes pop-in {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 840px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .panel-head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .page-shell {
    width: min(100% - 20px, 1080px);
    padding-top: 32px;
  }

  .draw-panel,
  .info-panel {
    padding: 20px;
  }

  .ball-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .bonus {
    width: 64px;
  }
}
