/* Koło fortuny / Spin the Wheel — scoped to this form */
#calc-kolo-fortuny-form {
  display: flex;
  flex-direction: column;
}
#calc-kolo-fortuny-form > h2 { order: 0; }
#calc-kolo-fortuny-form .wheel-stage { order: 1; }
#calc-kolo-fortuny-form .form-actions-row { order: 2; }
#calc-kolo-fortuny-form > label { order: 3; }
#calc-kolo-fortuny-form .wheel-count { order: 4; }
#calc-kolo-fortuny-form .wheel-presets { order: 5; }
#calc-kolo-fortuny-form .calc-optional { order: 6; }

#calc-kolo-fortuny-form .wheel-count {
  margin: 0.35rem 0 0.85rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

#calc-kolo-fortuny-form .wheel-presets {
  margin: 0 0 0.95rem;
}

#calc-kolo-fortuny-form .wheel-presets-label {
  margin: 0 0 0.25rem;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

#calc-kolo-fortuny-form .wheel-presets-hint {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  line-height: 1.45;
  color: var(--text-muted);
}

#calc-kolo-fortuny-form .wheel-preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

#calc-kolo-fortuny-form .wheel-preset {
  margin: 0;
  padding: 0.4rem 0.7rem;
  font-size: 0.8125rem;
}

#calc-kolo-fortuny-form .checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 0.55rem;
  cursor: pointer;
  font-weight: 500;
}

#calc-kolo-fortuny-form .checkbox-label input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}

#calc-kolo-fortuny-form.is-busy .btn {
  pointer-events: none;
  opacity: 0.7;
}

#calc-kolo-fortuny-form textarea#wheel-opts {
  min-height: 10.5rem;
  font-family: var(--font-mono);
  line-height: 1.45;
}

.wheel-stage {
  position: relative;
  width: min(300px, 100%);
  aspect-ratio: 1;
  margin: 0.15rem auto 1.1rem;
}

.wheel-pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  z-index: 3;
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-top: 22px solid #dc2626;
  transform: translateX(-50%);
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.35));
}

[data-theme="light"] .wheel-pointer {
  border-top-color: #b91c1c;
}

.wheel-disc {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  overflow: hidden;
  border: 6px solid #1a1a1f;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.28),
    inset 0 0 0 2px rgba(255, 255, 255, 0.12);
  transform: rotate(0deg);
  will-change: transform;
}

[data-theme="light"] .wheel-disc {
  border-color: #1f2937;
  box-shadow:
    0 10px 24px rgba(15, 23, 42, 0.16),
    inset 0 0 0 2px rgba(255, 255, 255, 0.35);
}

.wheel-disc.is-spinning {
  transition: transform 3.35s cubic-bezier(0.12, 0.72, 0.16, 1);
}

.wheel-disc-fill {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--border);
}

.wheel-labels {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.wheel-labels text {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  fill: #fff;
  paint-order: stroke fill;
  stroke: rgba(0, 0, 0, 0.35);
  stroke-width: 2.5px;
}

.wheel-hub {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(circle at 35% 30%, #fff 0, #f8fafc 28%, #e2e8f0 70%, #94a3b8 100%);
  border: 3px solid #111827;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] .wheel-hub {
  background:
    radial-gradient(circle at 35% 30%, #f8fafc 0, #cbd5e1 38%, #64748b 100%);
  border-color: #0b0b0e;
}

.wheel-stage.is-winner .wheel-disc {
  box-shadow:
    0 0 0 4px rgba(245, 158, 11, 0.35),
    0 12px 28px rgba(0, 0, 0, 0.3);
}

.wheel-history {
  margin-top: 1rem;
}

.wheel-history-title {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
}

.wheel-history ol {
  margin: 0;
  padding-left: 1.2rem;
}

.wheel-history li {
  margin: 0 0 0.25rem;
  line-height: 1.4;
}

#wheel-copy {
  margin-top: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .wheel-disc.is-spinning {
    transition-duration: 0.01ms;
  }
}

@media (max-width: 420px) {
  .wheel-stage {
    width: min(260px, 100%);
  }
  .wheel-labels text {
    font-size: 11px;
  }
}
