:root {
  color-scheme: dark;
  font-family: system-ui, sans-serif;
  color: #f9f4ff;
  background: #181429;
  --muted: #c3b9d1;
  --line: #473b57;
  --panel: #211a33;
  --accent: #ddc2ff;
  --ink: #271839;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 15% 0%, #38264a 0%, transparent 57%), #181429;
}

button, textarea { font: inherit; }

.shell {
  width: min(1056px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(24px, 5vw, 58px) 0 42px;
}

.masthead { margin-bottom: clamp(20px, 3vw, 32px); }

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: .95rem;
  font-weight: 720;
  letter-spacing: .025em;
}

.brand-mark { font-size: 1.35rem; color: #e8bafa; }

h1 {
  margin: 12px 0 0;
  font-family: Georgia, serif;
  font-size: clamp(2.4rem, 6vw, 4.65rem);
  font-weight: 400;
  line-height: .98;
  letter-spacing: -.052em;
}

.headline-break { display: none; }

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  align-items: start;
  gap: 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 22px;
}

.wheel-panel {
  display: grid;
  justify-items: center;
  padding: clamp(20px, 4vw, 34px) 20px 20px;
}

.wheel-frame {
  position: relative;
  width: min(100%, 400px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.disc {
  position: absolute;
  inset: 0;
  border: 6px solid #f2dfff;
  border-radius: 50%;
  box-shadow: 0 0 0 5px #4c3a61, 0 12px 30px #0e0a1e80;
  overflow: hidden;
}

canvas { display: block; width: 100%; height: 100%; }

.pointer {
  position: absolute;
  z-index: 1;
  top: -11px;
  width: 29px;
  height: 34px;
  background: #fff3ff;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

.hub {
  z-index: 1;
  display: grid;
  place-items: center;
  width: 15%;
  aspect-ratio: 1;
  border: 2px solid #f2dfff;
  border-radius: 50%;
  background: #261b39;
  color: #fff0ff;
  font-size: clamp(1.05rem, 3.3vw, 1.7rem);
  box-shadow: 0 3px 12px #160e2b55;
}

.button {
  min-height: 44px;
  border-radius: 9px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 720;
}

.button:disabled { opacity: .53; cursor: default; }
.button:focus-visible, .remove:focus-visible, textarea:focus-visible {
  outline: 2px solid #fff4ff;
  outline-offset: 3px;
}

.spin-button {
  margin-top: 24px;
  width: min(100%, 260px);
  padding: 11px 20px;
  background: var(--accent);
  color: var(--ink);
}

.spin-button:hover:enabled { background: #eddaff; }

.result {
  margin-top: 12px;
  color: var(--muted);
  min-height: 1.45em;
  text-align: center;
  overflow-wrap: anywhere;
}

.result strong { color: #fff2ff; }

.list-panel { padding: clamp(18px, 3vw, 28px); }

.list-heading {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -.025em;
}

.count { color: var(--muted); font-size: .875rem; white-space: nowrap; }

form { display: grid; gap: 9px; margin-top: 19px; }
label { font-size: .92rem; font-weight: 650; }

textarea {
  display: block;
  width: 100%;
  min-height: 68px;
  padding: 11px 12px;
  color: inherit;
  background: #191327;
  border: 1px solid #5b4a70;
  border-radius: 9px;
  resize: vertical;
}

textarea::placeholder { color: #b7aac8; opacity: 1; }

.add-button {
  justify-self: start;
  padding: 7px 14px;
  background: #39294c;
  border-color: #705584;
  color: #f8edff;
}

.add-button:hover:enabled, .remove:hover:enabled { background: #503764; }

.feedback, .empty {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: .9rem;
}

.feedback:empty, .series:empty { display: none; }

.series {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  max-height: 365px;
  overflow-y: auto;
  scrollbar-color: #705584 transparent;
}

.series li {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  border-top: 1px solid var(--line);
}

.swatch { width: 9px; height: 9px; border-radius: 50%; }
.series-title { padding: 5px 0; overflow-wrap: anywhere; }

.remove {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 1.25rem;
  cursor: pointer;
}

.remove:focus-visible { outline-offset: -3px; }

@media (max-width: 700px) {
  .shell { width: min(480px, calc(100% - 32px)); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .wheel-frame { width: min(92%, 345px); }
  .headline-break { display: initial; }
}
