:root {
  --ink: #19192c;
  --muted: #77778b;
  --paper: #fffcf7;
  --cream: #f6efe3;
  --coral: #f36d63;
  --purple: #5546a8;
  --line: #e7dfd4;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  font-family: "DM Sans", sans-serif;
  background: var(--paper);
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(360px, .8fr);
}

.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 64px 32px 35px;
  overflow: hidden;
  text-align: center;
  background:
    radial-gradient(circle at 12% 17%, rgba(243, 109, 99, .15) 0 65px, transparent 66px),
    radial-gradient(circle at 88% 85%, rgba(85, 70, 168, .13) 0 100px, transparent 101px),
    var(--cream);
}

.hero::before, .hero::after {
  position: absolute;
  z-index: 0;
  content: "";
  width: 15px;
  height: 15px;
  border: 3px solid #f5b830;
  transform: rotate(45deg);
}
.hero::before { top: 18%; right: 11%; }
.hero::after { bottom: 13%; left: 10%; border-color: var(--coral); }
.hero > * { position: relative; z-index: 1; }

.eyebrow { margin: 0 0 7px; color: var(--purple); font-size: 11px; font-weight: 700; letter-spacing: .16em; }
h1, h2 { margin: 0; font-family: Fraunces, Georgia, serif; line-height: 1; }
h1 { font-size: clamp(42px, 5vw, 68px); letter-spacing: -.055em; }
h1 em { color: var(--coral); font-style: normal; }
.intro { margin: 14px 0 24px; color: var(--muted); font-size: 15px; }

.wheel-stage { position: relative; width: min(66vh, 485px); max-width: 82vw; aspect-ratio: 1; margin: auto 0 17px; }
.wheel-rim {
  width: 100%; height: 100%; overflow: hidden; border: 10px solid #fffdf9; border-radius: 50%;
  box-shadow: 0 0 0 3px #28283f, 0 15px 0 #28283f, 0 19px 28px rgba(37, 31, 51, .22);
  background: #e8dfd5;
}
#wheel { display: block; width: 100%; height: 100%; }
.pointer {
  position: absolute; z-index: 4; top: -3px; left: 50%; width: 44px; height: 54px;
  transform: translateX(-50%); clip-path: polygon(0 0,100% 0,50% 100%); background: #28283f;
  filter: drop-shadow(0 3px 1px rgba(0,0,0,.15));
}
.pointer span { position: absolute; top: 7px; left: 50%; width: 12px; height: 12px; border-radius: 50%; transform: translateX(-50%); background: #f5b830; }
.wheel-hub {
  position: absolute; z-index: 3; top: 50%; left: 50%; width: 68px; height: 68px; display: grid; place-items: center;
  color: #fffaf0; font-size: 24px; border: 7px solid #fffdf9; border-radius: 50%; transform: translate(-50%, -50%);
  background: var(--purple); box-shadow: 0 2px 0 #29224c;
}

.spin-button, .primary-button, .secondary-button {
  border: 0; border-radius: 999px; font-weight: 700; transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.spin-button {
  min-width: 230px; padding: 15px 25px; color: white; background: var(--coral); box-shadow: 0 5px 0 #bd4d4b, 0 9px 18px rgba(243,109,99,.27);
}
.spin-button:hover:not(:disabled), .primary-button:hover { transform: translateY(-2px); }
.spin-button:active:not(:disabled), .primary-button:active { transform: translateY(3px); box-shadow: none; }
.spin-button:disabled { cursor: not-allowed; opacity: .5; box-shadow: 0 4px 0 #b2a6a3; }
.button-spark { margin-right: 6px; color: #ffe59a; }
.wheel-status { min-height: 20px; margin: 15px 0 0; color: var(--muted); font-size: 13px; }

.names-panel { display: flex; flex-direction: column; min-height: 100vh; padding: 61px clamp(28px, 5vw, 72px) 38px; background: #fffdf9; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.panel-heading h2 { font-size: 36px; letter-spacing: -.045em; }
.count-pill { margin-top: 5px; padding: 6px 10px; color: var(--purple); font-size: 12px; font-weight: 700; border-radius: 20px; background: #ede9fb; }
.add-form { display: flex; gap: 9px; margin: 22px 0 18px; }
.add-form input, .bulk-add textarea { width: 100%; color: var(--ink); outline: none; border: 1.5px solid #ddd6cc; border-radius: 10px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.add-form input { min-width: 0; padding: 12px 14px; }
.add-form input:focus, .bulk-add textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 3px #ece9fa; }
.add-form button { flex: 0 0 45px; color: white; font-size: 25px; line-height: 1; border: 0; border-radius: 10px; background: var(--purple); }
.bulk-add { position: relative; padding: 15px; border: 1px solid var(--line); border-radius: 12px; background: #fbf8f2; }
.bulk-add label { display: block; margin-bottom: 7px; font-size: 12px; font-weight: 700; }
.bulk-add textarea { display: block; min-height: 72px; padding: 8px 10px; resize: vertical; font-size: 13px; }
.text-button { padding: 0; margin-top: 9px; color: var(--purple); font-size: 12px; font-weight: 700; border: 0; background: transparent; }
.text-button:hover { text-decoration: underline; }
.names-list { flex: 1; margin: 23px 0 10px; overflow: auto; }
.name-item { display: flex; align-items: center; gap: 11px; min-height: 46px; padding: 8px 3px 8px 9px; border-bottom: 1px solid #eee9e1; animation: enter .25s ease both; }
.name-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; }
.name-label { overflow: hidden; flex: 1; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 500; }
.remove-name { width: 29px; height: 29px; color: #a09aa0; border: 0; border-radius: 50%; background: transparent; font-size: 20px; line-height: 1; }
.remove-name:hover { color: #c94d4d; background: #fff0ef; }
.empty-list { margin: 27px 0 auto; color: #a09ba0; text-align: center; font-size: 13px; }
.clear-button { align-self: flex-start; margin-top: 18px; padding: 0; color: #a09ba0; font-size: 12px; font-weight: 600; border: 0; background: transparent; }
.clear-button:hover { color: #c94d4d; }

.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(25, 25, 44, .5); backdrop-filter: blur(4px); }
.modal[hidden] { display: none; }
.modal-card { position: relative; width: min(100%, 470px); padding: 43px 35px 33px; text-align: center; border: 4px solid #28283f; border-radius: 20px; background: #fffdf9; box-shadow: 0 14px 0 #28283f, 0 28px 50px rgba(0,0,0,.25); animation: pop .38s cubic-bezier(.2,1.45,.45,1) both; }
.modal-card h2 { margin: 10px 0; font-size: clamp(36px, 7vw, 54px); letter-spacing: -.06em; }
.modal-card h2 span { display: block; color: var(--coral); overflow-wrap: anywhere; }
.modal-card p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 14px; }
.modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 28px; }
.primary-button, .secondary-button { padding: 12px 16px; font-size: 13px; }
.primary-button { color: white; background: var(--purple); box-shadow: 0 4px 0 #382c78; }
.secondary-button { color: var(--purple); border: 1.5px solid #d8d1f2; background: #f4f1fc; }
.secondary-button:hover { background: #ece7fb; }
.confetti { position: absolute; z-index: 11; font-size: 28px; animation: float 1.2s ease-in-out infinite alternate; }
.confetti-one { top: 18%; left: 19%; color: #f5b830; }.confetti-two { right: 18%; bottom: 20%; color: #f36d63; animation-delay: -.5s; }.confetti-three { top: 16%; right: 20%; color: #aa8de1; animation-delay: -.85s; }
@keyframes enter { from { opacity: 0; transform: translateX(6px); } to { opacity: 1; transform: translateX(0); } }
@keyframes pop { from { opacity: 0; transform: scale(.78); } to { opacity: 1; transform: scale(1); } }
@keyframes float { to { transform: translateY(-11px) rotate(15deg); } }

.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; }
@media (max-width: 800px) { .app-shell { grid-template-columns: 1fr; }.hero { min-height: 680px; padding-top: 45px; }.names-panel { min-height: auto; padding: 42px 25px; }.wheel-stage { width: min(52vh, 435px); }.names-list { max-height: 300px; min-height: 80px; } }
@media (max-width: 420px) { .hero { min-height: 620px; padding-inline: 18px; }.wheel-stage { max-width: 89vw; }.modal-actions { flex-direction: column-reverse; }.primary-button, .secondary-button { width: 100%; } }
