.spin-hero__layout,
.spin-wheel__layout {
  align-items: stretch;
}

.spin-hero__actions,
.spin-wheel__buttons,
.spin-wheel__badges {
  flex-wrap: wrap;
}

.spin-hero__notice,
.spin-wheel__intro {
  max-width: 42rem;
}

.spin-preview {
  position: relative;
  width: min(24rem, 100%);
  aspect-ratio: 1;
  margin-inline: auto;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.spin-preview__disc {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: conic-gradient(from -90deg, var(--color-primary), var(--color-secondary), var(--color-accent-pink), var(--color-accent-orange), var(--color-accent-lime), var(--color-accent-turquoise), var(--color-primary));
  box-shadow: 0 0 2.5rem rgba(75, 141, 255, 0.35);
  animation: spin-preview 14s linear infinite;
}

.spin-preview__pointer,
.spin-wheel__pointer {
  position: absolute;
  top: -0.8rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 0.8rem solid transparent;
  border-right: 0.8rem solid transparent;
  border-bottom: 1.5rem solid var(--color-accent-lime);
  filter: drop-shadow(0 0 0.9rem rgba(198, 255, 75, 0.9));
  z-index: 3;
}

.spin-preview__center,
.spin-wheel__hub {
  position: absolute;
  width: 5.25rem;
  height: 5.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.12) 32%, rgba(4, 9, 26, 0.96) 70%), linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  box-shadow: 0 0 1.5rem rgba(75, 141, 255, 0.55);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  z-index: 2;
}

.spin-wheel__card {
  padding: var(--space-lg);
}

.spin-wheel__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--grid-gap-lg);
}

.spin-wheel__board,
.spin-wheel__panel {
  min-width: 0;
}

.spin-wheel {
  position: relative;
  width: min(100%, 26rem);
  aspect-ratio: 1;
  margin-inline: auto;
  cursor: pointer;
}

.spin-wheel__disc {
  --wheel-rotation: 0deg;
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  transform: rotate(var(--wheel-rotation));
  box-shadow: 0 0 2.75rem rgba(75, 141, 255, 0.28);
  border: 0.5rem solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  will-change: transform;
}

.spin-wheel__disc::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--wheel-gradient);
  z-index: 0;
}

.spin-wheel__disc::after {
  content: "";
  position: absolute;
  inset: 0.7rem;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 2rem rgba(0, 0, 0, 0.28);
  z-index: 1;
}

.spin-wheel__labels {
  position: absolute;
  inset: 0;
  z-index: 2;
}

.spin-wheel__label {
  position: absolute;
  width: 4.8rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

.spin-wheel__label-badge {
  display: inline-flex;
  min-width: 3.6rem;
  min-height: 3.6rem;
  padding: 0.35rem 0.3rem;
  flex-direction: column;
  gap: 0.15rem;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(5, 8, 22, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 0 1rem rgba(0, 0, 0, 0.22);
  font-family: var(--font-display);
  font-size: 0.95rem;
  line-height: 1;
}

.spin-wheel__label-icon {
  font-size: 0.95rem;
  line-height: 1;
}

.spin-wheel__label-text {
  display: block;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  line-height: 1;
}

.spin-wheel__hub {
  position: absolute;
  border: 0;
  color: var(--color-text);
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
}

.spin-wheel__hub span {
  pointer-events: none;
}

.spin-wheel__hub:focus-visible,
.spin-wheel:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring-shadow);
  border-radius: 50%;
}

.spin-wheel__legend {
  margin-top: var(--space-lg);
}

.spin-wheel__legend-list,
.spin-wheel__history-list,
.spin-wheel__feature-list,
.spin-wheel__steps {
  margin: 0;
  padding-left: 1.1rem;
}

.spin-wheel__legend-list {
  list-style: none;
  padding-left: 0;
  display: grid;
  gap: 0.5rem;
}

.spin-wheel__legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-md);
  background: rgba(5, 8, 22, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spin-wheel__legend-item.is-active {
  border-color: rgba(198, 255, 75, 0.9);
  box-shadow: 0 0 1rem rgba(198, 255, 75, 0.22);
}

.spin-wheel__legend-swatch {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  flex: 0 0 auto;
}

.spin-wheel__legend-main {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.spin-wheel__legend-title {
  font-weight: 600;
}

.spin-wheel__legend-tone {
  font-size: var(--text-xs);
  color: var(--color-text-muted, rgba(255, 255, 255, 0.7));
}

.spin-wheel__controls,
.spin-wheel__status {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.spin-wheel__status,
.spin-wheel__history {
  padding: var(--space-md);
}

.spin-wheel__play-note {
  margin-top: var(--space-md);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.8rem;
  align-items: start;
  padding: var(--space-md);
}

.spin-wheel__play-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(5, 8, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 1.3rem;
  box-shadow: 0 0 1rem rgba(75, 141, 255, 0.18);
}

.spin-wheel__play-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.spin-wheel__play-text {
  margin: 0;
}

.spin-wheel__hint {
  max-width: 30rem;
}

.spin-wheel__result {
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-md);
  background: rgba(5, 8, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-family: var(--font-mono);
}

.spin-wheel__history-list {
  list-style: none;
  padding-left: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 14rem;
  overflow-y: auto;
}

.spin-wheel__history-item {
  padding: 0.55rem 0.7rem;
  border-radius: var(--radius-sm);
  background: rgba(5, 8, 22, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.spin-wheel__history-item--highlight {
  border-color: rgba(75, 255, 158, 0.78);
  box-shadow: 0 0 1rem rgba(75, 255, 158, 0.2);
}

.spin-wheel__history-item--energy {
  border-color: rgba(255, 188, 75, 0.72);
}

.spin-wheel__history-item--calm {
  border-color: rgba(62, 242, 255, 0.72);
}

.spin-wheel__history-item--info {
  border-style: dashed;
}

.spin-wheel__disclaimer {
  margin-top: var(--space-md);
}

.spin-wheel__feature-list li,
.spin-wheel__steps li {
  margin-bottom: 0.45rem;
}

@keyframes spin-preview {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .spin-wheel__layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .spin-preview {
    width: min(20rem, 100%);
  }

  .spin-wheel {
    width: min(100%, 22rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spin-preview__disc {
    animation-duration: 28s;
  }

  .spin-wheel__disc {
    transition-duration: 0.01ms !important;
  }
}
