:root {
  --rose: #c43d6e;
  --rose-deep: #9a1f4d;
  --blush: #fff0f4;
  --cream: #fff8f5;
  --ink: #2a1520;
  --muted: #7a5564;
  --gold: #c9a227;
  --gold-soft: #f3e4a8;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(196, 61, 110, 0.16);
  --shadow: 0 24px 60px rgba(154, 31, 77, 0.14);
  --radius: 28px;
  --font: "Be Vietnam Pro", system-ui, sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffd6e4 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #ffe8c8 0%, transparent 45%),
    linear-gradient(165deg, #fff7f9 0%, #ffeef3 40%, #fff6ec 100%);
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.45;
  pointer-events: none;
  z-index: 0;
}

.bg-orb-1 {
  width: 280px;
  height: 280px;
  background: #ff9fbf;
  top: 18%;
  left: -80px;
  animation: float 9s ease-in-out infinite;
}

.bg-orb-2 {
  width: 340px;
  height: 340px;
  background: #ffd89a;
  bottom: -60px;
  right: -80px;
  animation: float 11s ease-in-out infinite reverse;
}

.bg-pattern {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(196, 61, 110, 0.08) 1px, transparent 0);
  background-size: 28px 28px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

.topbar,
.stage {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 40px 8px;
  max-width: 1200px;
  margin: 0 auto;
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(145deg, var(--rose), var(--rose-deep));
  color: white;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  box-shadow: 0 12px 28px rgba(154, 31, 77, 0.28);
}

.brand-kicker {
  margin: 0 0 2px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.stats {
  display: flex;
  gap: 10px;
}

.stat {
  min-width: 88px;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  text-align: center;
  box-shadow: 0 8px 24px rgba(154, 31, 77, 0.06);
}

.stat span {
  display: block;
  font-family: var(--display);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--rose-deep);
  line-height: 1;
}

.stat label {
  display: block;
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 500;
}

.stage {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 40px 48px;
}

.wheel-panel,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.wheel-panel {
  padding: 36px 32px 32px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stage-label {
  margin: 0 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.stage-label.accent {
  color: var(--rose);
}

.name-slot {
  width: min(100%, 520px);
  min-height: 84px;
  display: grid;
  place-items: center;
  padding: 18px 24px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #fff5f8);
  border: 1.5px solid rgba(196, 61, 110, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
  position: relative;
}

.name-slot.tall {
  min-height: 120px;
  border-color: rgba(196, 61, 110, 0.35);
  background:
    linear-gradient(180deg, rgba(255, 214, 228, 0.35), transparent),
    linear-gradient(180deg, #ffffff, #fff0f4);
}

.name-slot.spinning .name-text {
  animation: blurPulse 0.08s linear infinite;
}

.name-slot.winner {
  animation: winnerPop 0.7s cubic-bezier(0.2, 1.2, 0.3, 1);
  border-color: var(--gold);
  box-shadow:
    0 0 0 4px rgba(201, 162, 39, 0.18),
    0 18px 40px rgba(154, 31, 77, 0.16);
}

.name-text {
  font-family: var(--display);
  font-size: clamp(1.5rem, 3.4vw, 2.35rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--ink);
}

.arrow {
  margin: 14px 0;
  font-size: 1.4rem;
  color: var(--rose);
  opacity: 0.7;
  animation: bounce 1.6s ease-in-out infinite;
}

.controls {
  display: flex;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  position: relative;
  appearance: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 999px;
  padding: 16px 34px;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, #e2558a, var(--rose-deep));
  box-shadow: 0 14px 30px rgba(154, 31, 77, 0.32);
  overflow: hidden;
}

.btn.primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
}

.btn.primary:active:not(:disabled) {
  transform: translateY(0) scale(0.99);
}

.btn-glow {
  position: absolute;
  inset: -40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28), transparent);
  transform: translateX(-60%) rotate(18deg);
  animation: sheen 2.8s ease-in-out infinite;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.65);
  color: var(--rose-deep);
  border: 1px solid var(--line);
}

.btn.ghost:hover:not(:disabled) {
  transform: translateY(-1px);
  background: white;
}

.hint {
  margin: 16px 0 0;
  max-width: 420px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel {
  padding: 22px 22px 18px;
}

.panel.compact {
  flex: 1;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.panel-actions {
  display: flex;
  gap: 14px;
  flex-shrink: 0;
}

.panel h2 {
  margin: 0 0 10px;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.panel-head h2 {
  margin: 0;
}

.link-btn {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--rose);
  font-family: var(--font);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  padding: 4px 0;
}

.link-btn:hover {
  text-decoration: underline;
}

.results {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}

.results li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  align-items: start;
  padding: 12px 0;
  border-bottom: 1px dashed var(--line);
  animation: fadeUp 0.45s ease both;
}

.results .idx {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--gold-soft), #e8c96a);
  color: #5c4708;
  font-size: 0.75rem;
  font-weight: 800;
}

.results .pair-woman {
  font-weight: 700;
  font-size: 0.95rem;
}

.results .pair-man {
  margin-top: 2px;
  color: var(--rose-deep);
  font-size: 0.86rem;
  font-weight: 600;
}

.results .pair-man::before {
  content: "← ";
  opacity: 0.6;
}

.empty {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.empty.hidden,
.results:not(:empty) + .empty {
  display: none;
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-list li {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink);
}

.chip-list li.done {
  opacity: 0.4;
  text-decoration: line-through;
}

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

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(18px);
  }
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(6px);
  }
}

@keyframes sheen {
  0%,
  40% {
    transform: translateX(-70%) rotate(18deg);
  }
  70%,
  100% {
    transform: translateX(120%) rotate(18deg);
  }
}

@keyframes blurPulse {
  0%,
  100% {
    filter: blur(0);
    opacity: 1;
  }
  50% {
    filter: blur(1.5px);
    opacity: 0.85;
  }
}

@keyframes winnerPop {
  0% {
    transform: scale(0.94);
  }
  55% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 900px) {
  .topbar,
  .stage {
    padding-left: 20px;
    padding-right: 20px;
  }

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

  .stage {
    grid-template-columns: 1fr;
  }

  .stats {
    width: 100%;
  }

  .stat {
    flex: 1;
  }
}
