/**
 * Spin the wheel page
 */

.page-spin {
  --home-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --home-body: "DM Sans", system-ui, -apple-system, sans-serif;
  --home-primary: #589fdc;
  --home-primary-deep: #3a7db5;
  --home-primary-soft: rgba(88, 159, 220, 0.12);
  --home-gold: #f0b429;
  --home-gold-deep: #c48a00;
  --home-success: #2f9e62;
  --home-danger: #d6534e;
  --home-ink: #0f1c2e;
  --home-muted: #5f6d82;
  --home-cream: #fafbfd;
  --home-white: #ffffff;
  --home-line: rgba(15, 28, 46, 0.08);
  --home-radius: 1.125rem;
  --home-radius-lg: 1.375rem;
  --home-shadow: 0 20px 50px rgba(15, 28, 46, 0.1);
}

body.page-spin,
body.page-spin .spin-page {
  font-family: var(--home-body);
  color: var(--home-ink);
  background: var(--home-cream);
}

.spin-page {
  padding: 1.25rem 0 3.5rem;
}

/* Breadcrumb & hero */

.spin-page__breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  color: var(--home-muted);
}

.spin-page__breadcrumb li {
  display: inline-flex;
  align-items: center;
}

.spin-page__breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: rgba(15, 28, 46, 0.28);
}

.spin-page__breadcrumb a {
  color: inherit;
  text-decoration: none;
}

.spin-page__breadcrumb a:hover {
  color: var(--home-primary-deep);
}

.spin-page__hero {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .spin-page__hero {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 1.5rem;
  }
}

.spin-page__hero-copy {
  max-width: 42rem;
}

.spin-page__eyebrow {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--home-primary-deep);
}

.spin-page__title {
  margin: 0 0 0.75rem;
  font-family: var(--home-display);
  font-size: clamp(2rem, 5vw, 2.75rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.spin-page__intro {
  margin: 0;
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--home-muted);
}

.spin-page__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spin-page__badges li {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--home-line);
  border-radius: 999px;
  background: var(--home-white);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--home-muted);
  white-space: nowrap;
}

/* Main workspace */

.spin-workspace {
  display: grid;
  gap: 1.25rem;
  margin-bottom: 2rem;
}

@media (min-width: 992px) {
  .spin-workspace {
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    align-items: start;
    gap: 1.5rem;
  }

  .spin-stage__card {
    position: sticky;
    top: 1.25rem;
  }
}

.spin-stage__card,
.spin-sidebar__card {
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-lg);
  background: var(--home-white);
  box-shadow: var(--home-shadow);
}

.spin-stage__card {
  padding: 1.35rem;
  overflow: hidden;
}

@media (min-width: 768px) {
  .spin-stage__card {
    padding: 1.75rem;
  }
}

/* Logged-in header */

.spin-stage__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
}

.spin-stage__counter {
  margin: 0;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(88, 159, 220, 0.14) 0%, rgba(88, 159, 220, 0.06) 100%);
  border: 1px solid rgba(88, 159, 220, 0.2);
  font-family: var(--home-body);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--home-primary-deep);
}

.spin-stage__counter span {
  font-weight: inherit;
}

.spin-stage__counter strong {
  font-family: inherit;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.spin-stage__welcome {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--home-muted);
}

/* Guest gate */

.spin-stage__guest {
  margin-bottom: 1.15rem;
  padding: 1.15rem;
  border-radius: var(--home-radius);
  background: linear-gradient(145deg, #f5f8fc 0%, #e8f3fb 100%);
  text-align: center;
}

.spin-stage__guest-icon {
  font-size: 2rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.spin-stage__guest-title {
  margin: 0 0 0.45rem;
  font-size: 1.125rem;
}

.spin-stage__guest-text {
  margin: 0 0 0.95rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--home-muted);
}

.spin-stage__guest-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.spin-stage__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7.5rem;
  padding: 0.7rem 1.1rem;
  border-radius: 999px;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.spin-stage__btn--primary {
  border: 0;
  background: linear-gradient(135deg, var(--home-primary) 0%, var(--home-primary-deep) 100%);
  color: #fff;
}

.spin-stage__btn--ghost {
  border: 1px solid var(--home-line);
  background: var(--home-white);
  color: var(--home-ink);
}

.spin-stage__btn:hover {
  transform: translateY(-1px);
}

/* Wheel shell */

.spin-wheel-shell {
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 1.15rem;
  padding: 1rem 0 0.5rem;
}

.spin-wheel-shell__glow {
  position: absolute;
  inset: 10% 8% 12%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(88, 159, 220, 0.22) 0%, rgba(88, 159, 220, 0) 70%);
  pointer-events: none;
}

.spin-wheel {
  position: relative;
  width: min(100%, 26rem);
  aspect-ratio: 1;
  filter: drop-shadow(0 16px 32px rgba(15, 28, 46, 0.14));
}

#spin-wheel-canvas {
  display: block;
  width: 100%;
  height: auto;
}

.spin-wheel__pointer {
  position: absolute;
  top: 50%;
  right: -0.15rem;
  transform: translateY(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
}

.spin-wheel__pointer-cap {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 50%;
  background: var(--home-danger);
  box-shadow: 0 2px 6px rgba(214, 83, 78, 0.45);
  margin-right: -0.15rem;
  z-index: 2;
}

.spin-wheel__pointer-tip {
  width: 0;
  height: 0;
  border-top: 0.95rem solid transparent;
  border-bottom: 0.95rem solid transparent;
  border-right: 1.45rem solid var(--home-danger);
  filter: drop-shadow(-2px 0 4px rgba(0, 0, 0, 0.18));
}

.spin-wheel__btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: clamp(4.75rem, 22vw, 6.5rem);
  height: clamp(4.75rem, 22vw, 6.5rem);
  padding: 0;
  border: 0.4rem solid #fff;
  border-radius: 50%;
  background: linear-gradient(145deg, #ffe066 0%, #ff9f1a 55%, #f77f00 100%);
  box-shadow:
    0 10px 24px rgba(247, 127, 0, 0.35),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
  font: inherit;
  cursor: pointer;
  z-index: 10;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    opacity 0.2s ease;
}

.spin-wheel__btn span {
  display: block;
  font-size: clamp(0.95rem, 3.5vw, 1.2rem);
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.spin-wheel__btn:hover:not(:disabled) {
  transform: translate(-50%, -50%) scale(1.06);
  box-shadow:
    0 14px 28px rgba(247, 127, 0, 0.42),
    inset 0 2px 4px rgba(255, 255, 255, 0.45);
}

.spin-wheel__btn:active:not(:disabled) {
  transform: translate(-50%, -50%) scale(0.96);
}

.spin-wheel__btn:disabled,
.spin-wheel__btn.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.spin-wheel__btn.is-spinning span {
  animation: spin-btn-pulse 0.8s ease-in-out infinite alternate;
}

@keyframes spin-btn-pulse {
  from { transform: scale(1); }
  to { transform: scale(0.92); }
}

/* Messages */

.spin-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding: 0.95rem 1rem;
  border-radius: var(--home-radius);
  font-size: 0.9375rem;
  line-height: 1.55;
}

.spin-message__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.spin-message__body p {
  margin: 0;
}

.spin-message__body a {
  color: inherit;
  font-weight: 700;
}

.spin-message--info {
  background: var(--home-primary-soft);
  color: var(--home-primary-deep);
  border: 1px solid rgba(88, 159, 220, 0.22);
}

.spin-message--info .spin-message__icon {
  background: rgba(88, 159, 220, 0.18);
}

.spin-message--pending {
  background: rgba(240, 180, 41, 0.14);
  color: #8a6400;
  border: 1px solid rgba(240, 180, 41, 0.28);
}

.spin-message--pending .spin-message__icon {
  background: rgba(240, 180, 41, 0.22);
  animation: spin-message-spin 1s linear infinite;
}

@keyframes spin-message-spin {
  to { transform: rotate(360deg); }
}

.spin-message--success {
  background: rgba(47, 158, 98, 0.12);
  color: #1f7048;
  border: 1px solid rgba(47, 158, 98, 0.24);
}

.spin-message--success .spin-message__icon {
  background: rgba(47, 158, 98, 0.18);
}

.spin-message--error {
  background: rgba(214, 83, 78, 0.1);
  color: #9b2f2b;
  border: 1px solid rgba(214, 83, 78, 0.24);
}

.spin-message--error .spin-message__icon {
  background: rgba(214, 83, 78, 0.16);
}

.spin-message__coupon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
}

.spin-message__code {
  display: inline-flex;
  padding: 0.35rem 0.65rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.65);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.spin-message__copy {
  padding: 0.35rem 0.7rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 700;
  color: inherit;
  cursor: pointer;
  opacity: 0.85;
}

.spin-message__copy:hover {
  opacity: 1;
}

.spin-stage__footnote {
  margin: 0;
  text-align: center;
  font-size: 0.75rem;
  color: var(--home-muted);
}

/* Sidebar */

.spin-sidebar {
  display: grid;
  gap: 1rem;
}

.spin-sidebar__card {
  padding: 1.25rem;
}

.spin-sidebar__title {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
}

.spin-sidebar__text {
  margin: 0 0 0.85rem;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--home-muted);
}

.spin-prize-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.spin-prize-list__item {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
}

.spin-prize-list__item--discount {
  background: rgba(88, 159, 220, 0.12);
  color: var(--home-primary-deep);
  border: 1px solid rgba(88, 159, 220, 0.2);
}

.spin-prize-list__item--gift {
  background: rgba(240, 180, 41, 0.14);
  color: #9a7200;
  border: 1px solid rgba(240, 180, 41, 0.24);
}

.spin-steps {
  margin: 0 0 0.85rem;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.spin-steps li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--home-muted);
}

.spin-steps li span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--home-primary-soft);
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--home-primary-deep);
  flex-shrink: 0;
}

.spin-sidebar__link {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--home-primary-deep);
  text-decoration: none;
}

.spin-sidebar__link:hover {
  text-decoration: underline;
}

.spin-sidebar__card--cta {
  background: linear-gradient(145deg, #f5f8fc 0%, #e8f3fb 100%);
}

.spin-sidebar__shop {
  display: inline-flex;
  width: 100%;
  justify-content: center;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--home-primary) 0%, var(--home-primary-deep) 100%);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition:
    transform 0.15s ease,
    box-shadow 0.2s ease;
}

.spin-sidebar__shop:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(58, 125, 181, 0.28);
  color: #fff;
}

/* Below workspace — full-width sections aligned with game area */

.spin-below {
  display: grid;
  gap: 2rem;
  width: 100%;
}

.spin-section-head {
  margin-bottom: 1.15rem;
}

.spin-section-head__title {
  margin: 0 0 0.45rem;
  font-family: var(--home-display);
  font-size: clamp(1.35rem, 3vw, 1.65rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.spin-section-head__intro {
  margin: 0;
  max-width: 42rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--home-muted);
}

/* Earn spins — three ways */

.spin-earn {
  width: 100%;
}

.spin-ways {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 768px) {
  .spin-ways {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

.spin-ways__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.35rem 1.15rem;
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-lg);
  background: var(--home-white);
  text-align: center;
  box-shadow: var(--home-shadow);
}

.spin-ways__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.75rem;
  border-radius: 0.85rem;
}

.spin-ways__icon--blue {
  background: rgba(88, 159, 220, 0.14);
  color: var(--home-primary-deep);
}

.spin-ways__icon--green {
  background: rgba(47, 158, 98, 0.14);
  color: var(--home-success);
}

.spin-ways__icon--gold {
  background: rgba(240, 180, 41, 0.16);
  color: var(--home-gold-deep);
}

.spin-ways__badge {
  display: inline-flex;
  margin-bottom: 0.55rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--home-cream);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--home-muted);
}

.spin-ways__title {
  margin: 0 0 0.4rem;
  font-size: 1.0625rem;
  line-height: 1.25;
}

.spin-ways__text {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--home-muted);
}

/* Guide accordions */

.spin-guide {
  width: 100%;
}

.spin-guide__grid {
  display: grid;
  gap: 0.75rem;
}

.spin-accordion {
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius-lg);
  background: var(--home-white);
  box-shadow: var(--home-shadow);
  overflow: hidden;
}

.spin-accordion summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.15rem;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.spin-accordion summary::-webkit-details-marker {
  display: none;
}

.spin-accordion summary::after {
  content: "+";
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--home-primary-deep);
}

.spin-accordion[open] summary::after {
  content: "−";
}

.spin-accordion__body {
  padding: 0 1.15rem 1.15rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--home-muted);
}

.spin-accordion__body p {
  margin: 0;
}

/* Confetti */

.spin-confetti {
  position: fixed;
  width: 10px;
  height: 16px;
  top: 50%;
  left: 50%;
  opacity: 1;
  pointer-events: none;
  z-index: 10002;
  border-radius: 3px;
  animation: spin-confetti-fly 2.5s ease-out forwards;
}

@keyframes spin-confetti-fly {
  0% {
    transform: translate(0, 0) rotate(0deg);
    opacity: 1;
  }

  100% {
    transform: translate(var(--tx), var(--ty)) rotate(var(--rot));
    opacity: 0;
  }
}

/* Win modal */

.spin-win-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.spin-win-modal[hidden] {
  display: none !important;
}

.spin-win-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 28, 46, 0.55);
  backdrop-filter: blur(4px);
}

.spin-win-modal__dialog {
  position: relative;
  width: min(100%, 22rem);
  padding: 1.75rem 1.5rem 1.5rem;
  border-radius: var(--home-radius-lg);
  background: var(--home-white);
  box-shadow: 0 28px 60px rgba(15, 28, 46, 0.22);
  text-align: center;
  animation: spin-win-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes spin-win-pop {
  from {
    opacity: 0;
    transform: translateY(1.5rem) scale(0.94);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.spin-win-modal__close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--home-cream);
  font-size: 1.35rem;
  line-height: 1;
  color: var(--home-muted);
  cursor: pointer;
}

.spin-win-modal__close:hover {
  color: var(--home-ink);
}

.spin-win-modal__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--home-success);
}

.spin-win-modal__title {
  margin: 0 0 0.5rem;
  font-family: var(--home-display);
  font-size: 1.65rem;
  line-height: 1.15;
}

.spin-win-modal__message {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--home-muted);
}

.spin-win-modal__coupon {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.spin-win-modal__coupon[hidden] {
  display: none !important;
}

.spin-win-modal__code {
  display: inline-flex;
  padding: 0.55rem 0.85rem;
  border-radius: 0.65rem;
  background: var(--home-cream);
  border: 1px dashed rgba(88, 159, 220, 0.35);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--home-primary-deep);
}

.spin-win-modal__copy {
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--home-line);
  border-radius: 999px;
  background: var(--home-white);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--home-muted);
  cursor: pointer;
}

.spin-win-modal__copy:hover {
  border-color: var(--home-primary);
  color: var(--home-primary-deep);
}

.spin-win-modal__actions {
  display: grid;
  gap: 0.55rem;
}

.spin-win-modal__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--home-success) 0%, #268652 100%);
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.spin-win-modal__cta:hover {
  color: #fff;
}

.spin-win-modal__dismiss {
  padding: 0.55rem;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--home-muted);
  cursor: pointer;
}

.spin-win-modal__dismiss:hover {
  color: var(--home-ink);
}

body.spin-modal-open {
  overflow: hidden;
}
