/* Koło fortuny — affiliate CTA (bison-casino.pl) */

/* Theme bridge — betting sites without --bc-* tokens */
.bc-spin-hero,
.bc-spin-modal__panel,
.bc-spin-win__panel,
.bc-wheel-wrap,
.bc-spin-fab {
  --bc-border: var(--border, rgba(255, 255, 255, 0.15));
  --bc-radius: var(--radius, 12px);
  --bc-radius-sm: 6px;
  --bc-radius-lg: 16px;
  --bc-radius-pill: 999px;
  --bc-cream: var(--text-light, #f0f0f0);
  --bc-muted: var(--muted, #888);
  --bc-text-muted: var(--muted, #888);
  --bc-gold: var(--gold, #f5b942);
  --bc-gold-bright: var(--gold, #e8bc3a);
  --bc-surface: var(--pitch, #121929);
  --bc-spin-bg: var(--pitch, var(--bc-surface, #0f3d5c));
  --bc-font-display: var(--font-display, system-ui, sans-serif);
}

.bc-spin-hero-section {
  padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1rem, 3vw, 1.5rem);
}

.bc-spin-hero-section .bc-container {
  max-width: var(--max, 1120px);
  margin-inline: auto;
  width: 100%;
}

.bc-spin-hero {
  display: grid;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 4vw, 2rem);
  background: var(--bc-spin-bg);
  color: var(--text-light, var(--bc-cream, #f0f0f0));
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
}

@media (min-width: 900px) {
  .bc-spin-hero {
    grid-template-columns: 1fr min(380px, 42vw);
  }
}

.bc-spin-hero__copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-self: center;
}

.bc-spin-hero__copy h2 {
  margin: 0 0 0.75rem;
  font-family: var(--bc-font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  color: var(--text-light, var(--bc-cream, #f0f0f0));
}

.bc-spin-hero__offer {
  margin: 0 0 1.25rem;
  color: var(--on-pitch-muted, var(--bc-text-muted, #a8c4d4));
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 42ch;
}

.bc-spin-hero__timer {
  margin: 1rem 0 0;
  font-size: 0.9rem;
  color: var(--bc-muted);
}

.bc-spin-hero__timer-label {
  margin-right: 0.35rem;
}

.bc-spin-hero__fine,
.bc-spin-modal__fine {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: var(--bc-muted);
  line-height: 1.4;
}

.bc-spin-hero__wheel {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  padding-block: 0.75rem;
}

/* Wheel */
.bc-wheel-wrap {
  position: relative;
  --bc-wheel-size: min(360px, 92vw);
  width: var(--bc-wheel-size);
  aspect-ratio: 1;
  overflow: visible;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  margin-inline: auto;
  margin-block: 0.5rem;
}

.bc-wheel__pointer {
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 12px solid transparent;
  border-right: 12px solid transparent;
  border-bottom: 22px solid #f1c40f;
  z-index: 4;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
}

.bc-wheel__rotor {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  transition: transform 2.8s cubic-bezier(0.15, 0.85, 0.2, 1);
  transform: rotate(0deg);
  backface-visibility: hidden;
  will-change: auto;
}

.bc-wheel__rotor.is-spinning {
  will-change: transform;
  transition-duration: 2.8s;
  transition-timing-function: cubic-bezier(0.12, 0.9, 0.15, 1);
}

.bc-wheel-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.bc-wheel-svg__labels text {
  pointer-events: none;
  user-select: none;
}

.bc-wheel__hub {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 50%;
  border: 3px solid #3498db;
  background: #0d0d0d;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 0 12px rgba(52, 152, 219, 0.35);
}

.bc-wheel__hub:hover:not(:disabled) {
  filter: brightness(1.15);
}

.bc-wheel__hub:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.bc-wheel__hub.is-cooldown {
  font-size: 0.72rem;
  letter-spacing: -0.02em;
}

/* Result (modal) */
.bc-spin-result {
  margin-top: 1rem;
  padding: 1rem;
  background: rgba(201, 162, 39, 0.1);
  border: 1px solid var(--bc-gold);
  border-radius: var(--bc-radius-sm);
}

.bc-spin-result__title {
  margin: 0 0 0.35rem;
  font-weight: 700;
  color: var(--bc-cream);
}

.bc-spin-result__offer {
  margin: 0 0 0.5rem;
  font-size: 1.15rem;
  color: var(--bc-gold-bright);
}

.bc-spin-result__note {
  margin: 0 0 1rem;
  font-size: 0.8rem;
  color: var(--bc-muted);
}

/* Modal */
.bc-spin-modal[hidden] {
  display: none;
}

.bc-spin-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
  overscroll-behavior: contain;
}

.bc-spin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
}

.bc-spin-modal__panel {
  position: relative;
  width: min(920px, calc(100vw - 2rem));
  max-width: 100%;
  max-height: min(95vh, 100dvh - 2rem);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.25rem;
  box-sizing: border-box;
  background: var(--bc-surface);
  border: 1px solid var(--bc-border);
  border-radius: var(--bc-radius);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
}

.bc-spin-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  z-index: 2;
  background: none;
  border: none;
  color: var(--bc-cream);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.25rem;
}

.bc-spin-hero--modal .bc-spin-hero__copy .bc-spin-result:not([hidden]) ~ .bc-spin-hero__offer {
  display: none;
}

.bc-spin-modal .bc-spin-hero {
  min-width: 0;
}

.bc-spin-modal .bc-spin-hero__wheel {
  min-width: 0;
  overflow: hidden;
}

@media (max-width: 899px) {
  .bc-spin-modal .bc-spin-hero {
    grid-template-columns: 1fr;
  }
}

/* Win popup — po zatrzymaniu koła */
.bc-spin-win[hidden] {
  display: none;
}

.bc-spin-win {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.bc-spin-win__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.78);
}

.bc-spin-win__panel {
  position: relative;
  width: min(360px, 94vw);
  padding: 1.75rem 1.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, #c0392b 0%, #922b21 100%);
  border: 3px solid #2ecc71;
  border-radius: var(--bc-radius-lg);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.55);
}

.bc-spin-win__close {
  position: absolute;
  top: -0.65rem;
  right: -0.65rem;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #8e44ad;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.bc-spin-win__gift {
  position: relative;
  margin: 0 auto 0.5rem;
  width: min(200px, 70vw);
}

.bc-spin-win__gift-svg {
  display: block;
  width: 100%;
  height: auto;
}

.bc-spin-win__badge {
  position: absolute;
  left: 50%;
  bottom: 18%;
  transform: translateX(-50%);
  display: inline-block;
  padding: 0.45rem 1rem;
  background: linear-gradient(180deg, #3ddc84 0%, #27ae60 100%);
  border: 2px solid #1e8449;
  border-radius: var(--bc-radius-sm);
  color: #fff;
  font-weight: 800;
  font-size: clamp(0.95rem, 3.5vw, 1.15rem);
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

.bc-spin-win__title {
  margin: 0.75rem 0 0.35rem;
  font-family: var(--bc-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
}

.bc-spin-win__text {
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  line-height: 1.45;
}

.bc-spin-win__cta {
  display: block;
  width: 100%;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(180deg, #3ddc84 0%, #27ae60 100%);
  border: 2px solid #1e8449;
  border-radius: var(--bc-radius-pill);
  color: #fff !important;
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  text-transform: none;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.bc-spin-win__cta:hover {
  filter: brightness(1.08);
  color: #fff !important;
}

.bc-spin-win__fine {
  margin: 1rem 0 0;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.35;
}

html.bc-scroll-lock,
body.bc-scroll-lock {
  overflow: hidden;
  overscroll-behavior: none;
}

body.bc-win-open {
  overflow: hidden;
}

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

/* Floating widget — lewy dolny róg */
.bc-spin-fab {
  position: fixed;
  left: max(1rem, env(safe-area-inset-left, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 120;
  width: 4.25rem;
  height: 4.25rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  contain: layout;
}

.bc-spin-fab:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.55);
}

.bc-spin-fab:focus-visible {
  outline: 2px solid var(--bc-gold-bright, #e8bc3a);
  outline-offset: 3px;
}

.bc-spin-fab__svg {
  display: block;
  width: 100%;
  height: 100%;
  transform-origin: center center;
  animation: bc-spin-fab-idle 12s linear infinite;
}

@keyframes bc-spin-fab-idle {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bc-spin-fab__svg {
    animation: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bc-wheel__rotor {
    transition: none;
  }
}
