:root {
  color-scheme: light;
  --ink: #202341;
  --muted: #656b87;
  --purple: #6243bf;
  --line: #e7e5f0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background:
    radial-gradient(ellipse at 75% 5%, #eae4ff, transparent 50%), #f8f7fc;
  color: var(--ink);
  line-height: 1.7;
}
.wheel-app {
  max-width: 1240px;
  padding: 28px;
  margin: auto;
}
.wheel-header {
  text-align: center;
  position: relative;
  margin-bottom: 32px;
}
.back-link {
  display: block;
  width: fit-content;
  color: var(--purple);
  text-decoration: none;
  font-size: 13px;
  margin-bottom: 20px;
}
.eyebrow {
  font-size: 12px;
  color: var(--purple);
  letter-spacing: 0.05em;
}
h1 {
  font-size: clamp(32px, 5vw, 50px);
  margin: 2px 0 6px;
  line-height: 1.4;
}
h2 {
  font-size: 21px;
  margin: 0;
}
.wheel-header p {
  margin: 0;
  color: var(--muted);
}
.wheel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 1fr);
  gap: 32px;
  align-items: start;
}
.wheel-stage {
  text-align: center;
  padding: 20px 24px;
  background: #ffffff85;
  border: 1px solid white;
  border-radius: 28px;
  min-width: 0;
}
.wheel-wrap {
  position: relative;
  width: min(100%, 500px);
  margin: 10px auto 22px;
  filter: drop-shadow(0 15px 22px #42307920);
}
canvas {
  display: block;
  width: 100%;
  height: auto;
  border: 10px solid white;
  border-radius: 50%;
  background: #eae7f4;
  outline: 1px solid #ddd8ee;
}
.wheel-pointer {
  position: absolute;
  top: -8px;
  left: calc(50% - 17px);
  width: 34px;
  height: 42px;
  background: #302250;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  z-index: 2;
}
.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 17%;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 5px solid #ffffffb8;
  border-radius: 50%;
  background: #fff;
  color: var(--purple);
  font-weight: bold;
  font-size: clamp(12px, 2vw, 18px);
  box-shadow: 0 4px 14px #23113a22;
}
.wheel-result {
  min-height: 90px;
  margin-bottom: 12px;
}
.wheel-result span {
  display: block;
  font-size: 13px;
  color: var(--muted);
}
.wheel-result strong {
  font-size: clamp(23px, 3vw, 34px);
  color: var(--purple);
  overflow-wrap: anywhere;
  display: block;
}
.panel {
  padding: 26px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 12px 30px #35285c05;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}
.count {
  border-radius: 30px;
  background: #f0eafd;
  color: var(--purple);
  padding: 4px 12px;
  font-size: 12px;
  white-space: nowrap;
}
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}
label {
  font-size: 14px;
  font-weight: bold;
}
.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 7px 0 12px;
}
textarea,
input,
button {
  font: inherit;
}
textarea {
  width: 100%;
  padding: 14px;
  border: 1px solid #dad5e7;
  border-radius: 12px;
  resize: vertical;
  min-height: 140px;
  color: var(--ink);
  background: #fcfbff;
  font-size: 14px;
}
.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}
.settings-row input {
  width: 76px;
  border: 1px solid #dad5e7;
  border-radius: 9px;
  padding: 7px;
  text-align: center;
}
.check {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  font-weight: normal;
  margin: 18px 0;
}
.check input {
  accent-color: var(--purple);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
button {
  border: 0;
  border-radius: 12px;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  touch-action: manipulation;
}
.primary {
  background: linear-gradient(120deg, #7152cb, #5233ac);
  color: white;
  box-shadow: 0 8px 20px #6443be30;
  min-width: 230px;
}
.secondary {
  background: #eee8fc;
  color: var(--purple);
}
.quiet {
  background: #f4f4f7;
  color: var(--muted);
}
button:hover {
  filter: brightness(0.96);
}
button:disabled,
fieldset:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid #a997e8;
  outline-offset: 4px;
}
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.privacy {
  font-size: 11px;
  color: var(--muted);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.error {
  font-size: 13px;
  color: #a52842;
  min-height: 1.7em;
  margin: 12px 0 0;
}
.participants {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  max-height: 240px;
  overflow: auto;
}
.participants li {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f7f6fb;
  padding: 5px 9px;
  border-radius: 8px;
  font-size: 12px;
  overflow-wrap: anywhere;
  max-width: 100%;
}
.swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: bold;
}
.timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 12px;
  color: var(--muted);
  height: 32px;
  margin-top: 10px;
}
progress {
  width: 160px;
  height: 5px;
  accent-color: var(--purple);
}
footer {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin: 28px 0 4px;
}
@media (max-width: 760px) {
  .wheel-app {
    padding: 18px 14px;
  }
  .wheel-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .wheel-stage {
    padding: 15px;
  }
  .panel {
    padding: 20px;
  }
  .wheel-header {
    margin-bottom: 22px;
  }
  .wheel-wrap {
    max-width: 420px;
  }
  .back-link {
    margin-bottom: 14px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto;
  }
}
