:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #172026;
  --muted: #66737f;
  --line: #dfe5ea;
  --accent: #00a884;
  --accent-dark: #00785f;
  --gold: #d9a441;
  --shadow: 0 24px 70px rgba(23, 32, 38, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(0, 168, 132, 0.10), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f7faf9 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 20;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.draw-panel,
.participants-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.draw-panel {
  min-height: 100%;
  border-radius: 8px;
  padding: clamp(24px, 5vw, 52px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand-logo {
  width: min(220px, 46vw);
  height: auto;
  object-fit: contain;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 5.6rem);
  line-height: 0.95;
}

h2 {
  font-size: 1.35rem;
}

.winner-stage {
  display: grid;
  gap: 16px;
  padding: 38px 0;
}

.stage-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
}

.winner-name {
  min-height: clamp(96px, 13vw, 150px);
  display: flex;
  align-items: center;
  padding: 22px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: clamp(2.3rem, 7vw, 6.4rem);
  font-weight: 900;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.winner-name.is-spinning {
  color: var(--accent-dark);
}

.winner-name.is-final {
  animation: winnerColor 950ms linear infinite, winnerPop 520ms ease both;
}

.stage-helper {
  min-height: 1.5rem;
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.draw-button,
.reset-button {
  min-height: 52px;
  border-radius: 8px;
  padding: 0 22px;
  font-weight: 800;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.draw-button {
  --bs-btn-bg: var(--accent);
  --bs-btn-border-color: var(--accent);
  --bs-btn-hover-bg: var(--accent-dark);
  --bs-btn-hover-border-color: var(--accent-dark);
  --bs-btn-active-bg: var(--accent-dark);
  --bs-btn-active-border-color: var(--accent-dark);
  box-shadow: 0 14px 30px rgba(0, 168, 132, 0.26);
}

.reset-button {
  --bs-btn-color: var(--ink);
  --bs-btn-border-color: var(--line);
  --bs-btn-hover-bg: #f7faf9;
  --bs-btn-hover-color: var(--ink);
  --bs-btn-hover-border-color: #cdd6dd;
}

.draw-button:hover,
.reset-button:hover {
  transform: translateY(-1px);
}

.draw-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.stats {
  margin-top: 32px;
}

.stat-box {
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  background: #fbfcfc;
}

.stats strong {
  display: block;
  font-size: 2rem;
  line-height: 1;
}

.stats span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.participants-panel {
  max-height: calc(100vh - 48px);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.participants-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
}

.pill {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(217, 164, 65, 0.14);
  color: #8a5e00;
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 800;
}

.participants-list {
  margin: 0;
  padding: 10px;
  list-style: none;
  overflow: auto;
}

.participants-list li {
  border-radius: 7px;
  padding: 10px 12px;
  color: #29343b;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.participants-list li:nth-child(odd) {
  background: #f7faf9;
}

.participants-list li.is-winner {
  background: rgba(0, 168, 132, 0.12);
  color: var(--accent-dark);
  font-weight: 900;
}

@keyframes winnerColor {
  0% {
    color: #00a884;
    text-shadow: 0 0 0 rgba(0, 168, 132, 0);
  }

  25% {
    color: #d9a441;
    text-shadow: 0 8px 26px rgba(217, 164, 65, 0.20);
  }

  50% {
    color: #1683ff;
    text-shadow: 0 8px 26px rgba(22, 131, 255, 0.18);
  }

  75% {
    color: #e0528d;
    text-shadow: 0 8px 26px rgba(224, 82, 141, 0.18);
  }

  100% {
    color: #00a884;
    text-shadow: 0 0 0 rgba(0, 168, 132, 0);
  }
}

@keyframes winnerPop {
  0% {
    transform: scale(0.96);
  }

  65% {
    transform: scale(1.025);
  }

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

@media (max-width: 860px) {
  .draw-panel {
    min-height: 560px;
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .participants-panel {
    max-height: 520px;
  }
}

@media (max-width: 520px) {
  .draw-panel {
    padding: 20px;
  }

  .draw-button,
  .reset-button {
    width: 100%;
  }
}
