/* ==========================================================================
   wheel-kit.css — SHARED visual components for all wheel-based tools.
   Used by Decision Wheel and the lighter wheel tools (Food/Name/Yes-No).
   Tool-specific styles live in each tool's own stylesheet.
   ========================================================================== */

/* ---- Wheel stage --------------------------------------------------------- */
.wheel-stage {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}
.wheel-canvas {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  box-shadow: var(--shadow-3);
  background: var(--surface);
  transition: filter var(--dur-med) var(--ease-standard);
}
.wheel-stage.is-spinning .wheel-canvas { filter: saturate(1.1); }

.wheel-pointer {
  position: absolute;
  top: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 16px solid transparent;
  border-right: 16px solid transparent;
  border-top: 26px solid var(--on-surface);
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.35));
  z-index: 2;
}

.wheel-spin {
  position: absolute;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: none;
  background: var(--brand);
  color: var(--on-brand);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  cursor: pointer;
  box-shadow: var(--shadow-2);
  z-index: 3;
  transition: transform var(--dur-fast) var(--ease-emphasized),
              background-color var(--dur-fast) var(--ease-standard);
}
.wheel-spin:hover { background: var(--brand-strong); }
.wheel-spin:active { transform: scale(0.9); }
.wheel-spin:disabled { opacity: 0.5; cursor: default; }
.wheel-spin:focus-visible { outline: 3px solid var(--brand); outline-offset: 3px; }

/* ---- Options editor ------------------------------------------------------ */
.opt-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-bottom: var(--sp-3);
}
.opt-count { margin-left: auto; align-self: center; font-size: var(--fs-sm); color: var(--on-surface-faint); }

.opt-list { display: flex; flex-direction: column; gap: var(--sp-2); }

.opt-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.opt-row.dragging { opacity: 0.6; border-color: var(--brand); }
.opt-row__handle {
  cursor: grab;
  color: var(--on-surface-faint);
  display: grid; place-items: center;
  width: 32px; height: 40px;
  touch-action: none;
}
.opt-row__swatch { width: 14px; height: 14px; border-radius: 4px; flex: 0 0 auto; }
.opt-row input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--on-surface);
  font-size: var(--fs-md);
  padding: var(--sp-2);
  border-radius: var(--r-sm);
  outline: none;
}
.opt-row input:focus { background: var(--surface-2); }
.opt-row__del {
  width: 40px; height: 40px;
  border: none; background: transparent;
  color: var(--on-surface-faint);
  border-radius: var(--r-full);
  cursor: pointer;
}
.opt-row__del:hover { color: var(--error); background: var(--surface-2); }

.paste-area {
  width: 100%;
  min-height: 130px;
  resize: vertical;
  padding: var(--sp-3);
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--on-surface);
  font-family: inherit;
  font-size: var(--fs-md);
  outline: none;
}
.paste-area:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* ---- Result dialog ------------------------------------------------------- */
.result-dialog {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: var(--sp-5);
  background: var(--overlay);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-med) var(--ease-standard);
}
.result-dialog.is-open { opacity: 1; pointer-events: auto; }
.result-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border-radius: var(--r-xl);
  padding: var(--sp-6);
  text-align: center;
  box-shadow: var(--shadow-3);
  transform: scale(0.9);
  transition: transform var(--dur-med) var(--ease-emphasized);
}
.result-dialog.is-open .result-card { transform: scale(1); }
.result-card__label {
  font-size: var(--fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--on-surface-muted);
  margin-bottom: var(--sp-2);
}
.result-card__winner {
  font-size: var(--fs-2xl);
  font-weight: var(--fw-bold);
  word-break: break-word;
  margin-bottom: var(--sp-5);
  color: var(--brand);
}
.result-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); margin-bottom: var(--sp-4); }
.result-actions .icon-btn { width: 100%; height: 48px; background: var(--surface-2); border-radius: var(--r-md); flex-direction: column; gap: 2px; font-size: 0.62rem; color: var(--on-surface-muted); }

/* ---- Confetti ------------------------------------------------------------ */
.confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
}
