:root {
  --bg: #f4efe7;
  --panel: rgba(255, 255, 255, 0.76);
  --panel-strong: rgba(255, 255, 255, 0.92);
  --ink: #121212;
  --muted: #706976;
  --line: rgba(18, 18, 18, 0.08);
  --purple: #b100ff;
  --purple-deep: #7f00ff;
  --shadow: 0 24px 70px rgba(32, 15, 48, 0.12);
  --track-card-width: 150px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(177, 0, 255, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(127, 0, 255, 0.08), transparent 28%),
    linear-gradient(180deg, #faf7f1 0%, #f3eee6 100%);
}

button,
input {
  font: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 24px;
}

.topbar,
.stage-frame,
.winners-panel {
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow);
  border-radius: 24px;
}

.topbar {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand-logo {
  display: block;
  width: min(220px, 42vw);
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.count-input {
  width: 78px;
  height: 44px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  color: var(--ink);
  text-align: center;
  font-weight: 700;
}

button {
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, background 160ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.primary {
  color: #fff;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
  box-shadow: 0 14px 30px rgba(127, 0, 255, 0.24);
}

.ghost {
  color: var(--ink);
  background: rgba(18, 18, 18, 0.05);
}

.stage-frame {
  position: relative;
  margin-top: 16px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(11, 11, 16, 0.985), rgba(18, 18, 26, 0.985)),
    linear-gradient(90deg, rgba(177, 0, 255, 0.18), transparent 40%, rgba(177, 0, 255, 0.12));
  overflow: hidden;
}

.stage-glow {
  position: absolute;
  inset: auto 18% -34px;
  height: 90px;
  background: radial-gradient(circle, rgba(177, 0, 255, 0.34), transparent 68%);
  filter: blur(20px);
}

.track-viewport {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
}

.spinner-track {
  display: flex;
  gap: 10px;
  padding: 12px 16px;
  width: max-content;
  will-change: transform;
}

.entrant-card {
  width: var(--track-card-width);
  min-width: var(--track-card-width);
  border-radius: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.035));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #faf8ff;
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}

.entrant-card.active {
  transform: translateY(-2px) scale(1.02);
  border-color: rgba(177, 0, 255, 0.75);
  box-shadow: 0 0 0 1px rgba(177, 0, 255, 0.28), 0 16px 34px rgba(177, 0, 255, 0.2);
}

.entrant-name {
  display: block;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entrant-meta {
  margin-top: 8px;
  color: rgba(250, 248, 255, 0.68);
  font-size: 0.76rem;
}

.center-marker {
  position: absolute;
  left: 50%;
  top: 10px;
  bottom: 10px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(177, 0, 255, 1), rgba(255, 255, 255, 0));
  box-shadow: 0 0 18px rgba(177, 0, 255, 0.84);
  z-index: 2;
}

.center-marker::before,
.center-marker::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 14px;
  height: 14px;
  transform: translateX(-50%) rotate(45deg);
  background: rgba(177, 0, 255, 0.72);
  border: 2px solid rgba(255, 255, 255, 0.95);
}

.center-marker::before {
  top: -6px;
}

.center-marker::after {
  bottom: -6px;
}

.winners-panel {
  margin-top: 16px;
  padding: 12px;
  min-height: 88px;
}

.winner-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}

.winner-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.85), rgba(250, 243, 255, 0.96));
  border: 1px solid rgba(18, 18, 18, 0.05);
}

.winner-order {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  font-size: 0.92rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--purple-deep), var(--purple));
}

.winner-name {
  font-family: "Sora", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

@media (max-width: 860px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .brand-logo {
    width: min(220px, 62vw);
  }

  .topbar-controls {
    justify-content: stretch;
  }

  .count-input,
  button {
    flex: 1 1 0;
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 18px, 1180px);
    padding-top: 10px;
  }

  .topbar,
  .stage-frame,
  .winners-panel {
    border-radius: 20px;
  }

  .topbar {
    padding: 14px;
  }

  .stage-frame {
    padding: 12px;
  }

  .spinner-track {
    padding: 10px 12px;
  }

  .entrant-card {
    width: 132px;
    min-width: 132px;
    padding: 10px 12px;
  }

  .winner-item {
    padding: 10px 12px;
  }
}
