/* KC Wheelspin — Viper Vape · Kush & Coil */

:root {
  --kcws-black: #0e0e0e;
  --kcws-surface: #141816;
  --kcws-green: #2f7a2c;
  --kcws-green-bright: #52b84a;
  --kcws-gold: #f4c430;
  --kcws-gold-soft: #ffe89e;
  --kcws-bone: #f7f7f5;
  --kcws-muted: #a6b0a6;
  --kcws-ff-display: 'Inter Tight', system-ui, -apple-system, sans-serif;
  --kcws-ff-body: 'Inter', system-ui, -apple-system, sans-serif;
}

/* ── Floating Corner Launcher ───────────────────────────────────────────── */

.kc-ws-launcher-wrap {
  position: fixed;
  bottom: 22px;
  z-index: 9990;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px) scale(0.92);
  transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.kc-ws-launcher-wrap.kc-ws-pos-right { right: 22px; }
.kc-ws-launcher-wrap.kc-ws-pos-left  { left: 22px; }

.kc-ws-launcher-wrap.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.kc-ws-launcher {
  pointer-events: auto;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 5px;
  border-radius: 999px;
  border: 1.5px solid rgba(244, 196, 48, 0.55);
  background: rgba(14, 14, 14, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45),
              0 0 0 1px rgba(255, 255, 255, 0.06) inset,
              0 0 24px rgba(82, 184, 74, 0.22);
  color: #ffffff;
  cursor: pointer;
  font-family: var(--kcws-ff-body);
  text-align: left;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.25s ease,
              border-color 0.25s ease,
              padding 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.kc-ws-pos-left .kc-ws-launcher {
  flex-direction: row;
}

.kc-ws-pos-right .kc-ws-launcher {
  flex-direction: row-reverse;
}

.kc-ws-launcher:hover,
.kc-ws-launcher:focus-visible {
  border-color: var(--kcws-gold);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.55),
              0 0 28px rgba(244, 196, 48, 0.32);
  outline: none;
}

.kc-ws-launcher:focus-visible {
  box-shadow: 0 0 0 3px rgba(82, 184, 74, 0.5), 0 16px 38px rgba(0, 0, 0, 0.55);
}

@media (prefers-reduced-motion: no-preference) {
  .kc-ws-launcher-wrap.is-visible .kc-ws-launcher {
    animation: kc-ws-bob 3.6s ease-in-out infinite;
  }
  .kc-ws-launcher:hover {
    animation-play-state: paused;
    transform: translateY(-3px) scale(1.03);
  }
}

@keyframes kc-ws-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

.kc-ws-launcher-glow {
  position: absolute;
  inset: -4px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(82, 184, 74, 0.28) 0%, rgba(244, 196, 48, 0.14) 55%, transparent 72%);
  pointer-events: none;
  z-index: -1;
}

.kc-ws-launcher-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  flex-shrink: 0;
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.kc-ws-launcher-icon img {
  display: block;
  width: 58px;
  height: 58px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}

@media (prefers-reduced-motion: no-preference) {
  .kc-ws-launcher:hover .kc-ws-launcher-icon {
    transform: rotate(32deg) scale(1.06);
  }
}

/* Status indicator dot */
.kc-ws-launcher-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--kcws-green-bright);
  border: 2px solid var(--kcws-black);
  box-shadow: 0 0 10px rgba(82, 184, 74, 0.9);
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

.kc-ws-pos-left .kc-ws-launcher-dot {
  right: auto;
  left: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  .kc-ws-launcher-dot.is-ready {
    animation: kc-ws-pulse 2s ease-out infinite;
  }
}

@keyframes kc-ws-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(82, 184, 74, 0.75); }
  70%  { box-shadow: 0 0 0 10px rgba(82, 184, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(82, 184, 74, 0); }
}

.kc-ws-launcher-dot.is-cooldown {
  background: var(--kcws-gold);
  box-shadow: 0 0 6px rgba(244, 196, 48, 0.5);
  animation: none;
}

/* Expanding label pill */
.kc-ws-launcher-pill {
  display: flex;
  flex-direction: column;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  white-space: nowrap;
  transition: max-width 0.3s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.22s ease,
              padding 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.kc-ws-launcher:hover .kc-ws-launcher-pill,
.kc-ws-launcher:focus-visible .kc-ws-launcher-pill,
.kc-ws-launcher.is-peeking .kc-ws-launcher-pill {
  max-width: 175px;
  opacity: 1;
  padding-inline: 12px 6px;
}

.kc-ws-pos-left .kc-ws-launcher:hover .kc-ws-launcher-pill,
.kc-ws-pos-left .kc-ws-launcher:focus-visible .kc-ws-launcher-pill,
.kc-ws-pos-left .kc-ws-launcher.is-peeking .kc-ws-launcher-pill {
  padding-inline: 6px 12px;
}

.kc-ws-pill-title {
  font-family: var(--kcws-ff-display);
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 0.01em;
  color: var(--kcws-gold);
  line-height: 1.15;
}

.kc-ws-pill-sub {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.82);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}

/* ── Native <dialog> Modal & Top-Layer Transitions ────────────────────────── */

.kc-ws-dialog {
  padding: 0;
  margin: auto;
  border: none;
  background: transparent;
  color: #ffffff;
  max-width: min(880px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  width: 100%;
  overflow: visible;
  opacity: 0;
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.28s;
  transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  .kc-ws-dialog {
    transform: scale(0.94) translateY(10px);
  }
}

.kc-ws-dialog:modal {
  overscroll-behavior: contain;
}

.kc-ws-dialog::backdrop {
  background-color: rgba(8, 10, 8, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.28s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

.kc-ws-dialog[open]:where(:not([data-closing])) {
  display: block;
  opacity: 1;
}

@starting-style {
  .kc-ws-dialog[open]:where(:not([data-closing])) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .kc-ws-dialog[open]:where(:not([data-closing])) {
    transform: scale(1) translateY(0);
  }
  @starting-style {
    .kc-ws-dialog[open]:where(:not([data-closing])) {
      transform: scale(0.94) translateY(10px);
    }
  }
}

.kc-ws-dialog[open]:where(:not([data-closing]))::backdrop {
  background-color: rgba(6, 9, 6, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@starting-style {
  .kc-ws-dialog[open]:where(:not([data-closing]))::backdrop {
    background-color: rgba(6, 9, 6, 0);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .kc-ws-dialog,
  .kc-ws-dialog::backdrop {
    transition-duration: 0.1s;
  }
}

/* ── Modal Card Shell ───────────────────────────────────────────────────── */

.kc-ws-modal-shell {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #0b0d0b;
  background-image:
    radial-gradient(circle at 28% 50%, rgba(47, 122, 44, 0.22), transparent 60%),
    linear-gradient(155deg, rgba(10, 12, 10, 0.72) 0%, rgba(10, 12, 10, 0.88) 100%),
    var(--kc-ws-bg-webp, var(--kc-ws-bg-jpg));
  background-size: cover;
  background-position: center;
  border: 1.5px solid rgba(244, 196, 48, 0.38);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75),
              0 0 0 1px rgba(255, 255, 255, 0.06) inset,
              0 0 48px rgba(47, 122, 44, 0.2);
  font-family: var(--kcws-ff-body);
}

.kc-ws-confetti {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 20;
}

.kc-ws-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 30;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(14, 14, 14, 0.72);
  color: rgba(255, 255, 255, 0.86);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.kc-ws-close:hover,
.kc-ws-close:focus-visible {
  background: rgba(244, 196, 48, 0.18);
  border-color: var(--kcws-gold);
  color: #ffffff;
  outline: none;
}

.kc-ws-layout {
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(320px, 415px) 1fr;
  gap: 28px;
  align-items: center;
  padding: 34px 36px;
}

/* ── Wheel Stage ────────────────────────────────────────────────────────── */

.kc-ws-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 14px;
}

.kc-ws-pointer {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  transform-origin: 50% 24%;
  z-index: 12;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.65));
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: none;
}

.kc-ws-pointer.is-tick {
  transform: translateX(-50%) rotate(-22deg);
  transition-duration: 0.05s;
}

.kc-ws-wheel-frame {
  position: relative;
  width: min(370px, 78vw);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72),
              0 0 38px rgba(82, 184, 74, 0.2),
              0 0 18px rgba(244, 196, 48, 0.16);
}

#kc-ws-canvas {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.kc-ws-hub-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 92px;
  height: 92px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 10;
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1), filter 0.22s ease;
}

.kc-ws-hub-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.75));
}

.kc-ws-hub-btn:not(:disabled):hover,
.kc-ws-hub-btn:not(:disabled):focus-visible {
  transform: translate(-50%, -50%) scale(1.08);
  filter: brightness(1.08);
  outline: none;
}

.kc-ws-hub-btn:not(:disabled):active {
  transform: translate(-50%, -50%) scale(0.96);
}

.kc-ws-hub-btn:disabled {
  cursor: default;
  opacity: 0.92;
}

/* ── Right Info / Result Panel ──────────────────────────────────────────── */

.kc-ws-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.kc-ws-brand-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(82, 184, 74, 0.15);
  border: 1px solid rgba(82, 184, 74, 0.4);
  color: #8ee085;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kc-ws-title {
  margin: 0;
  font-family: var(--kcws-ff-display);
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  font-weight: 800;
  line-height: 1.08;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.kc-ws-sub {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: rgba(247, 247, 245, 0.78);
}

.kc-ws-state-area {
  margin-top: 4px;
}

.kc-ws-loading {
  padding: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--kcws-muted);
  font-size: 0.88rem;
  text-align: center;
}

/* Primary Action Buttons */
.kc-ws-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 22px;
  border-radius: 12px;
  border: none;
  font-family: var(--kcws-ff-display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.2s ease, background-color 0.2s ease, filter 0.2s ease;
}

.kc-ws-btn-primary {
  background: linear-gradient(135deg, #f4c430 0%, #e0ae14 100%);
  color: #0e0e0e;
  box-shadow: 0 10px 26px rgba(244, 196, 48, 0.28), 0 1px 0 rgba(255, 255, 255, 0.45) inset;
}

.kc-ws-btn-primary:hover:not(:disabled),
.kc-ws-btn-primary:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.06);
  box-shadow: 0 14px 32px rgba(244, 196, 48, 0.4);
  color: #0e0e0e;
  outline: none;
}

.kc-ws-btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.kc-ws-btn-green {
  background: linear-gradient(135deg, #52b84a 0%, #2f7a2c 100%);
  color: #ffffff;
  box-shadow: 0 8px 22px rgba(47, 122, 44, 0.35);
}

.kc-ws-btn-green:hover:not(:disabled) {
  filter: brightness(1.08);
  color: #ffffff;
}

.kc-ws-btn-ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.kc-ws-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.kc-ws-btn-sm {
  padding: 9px 14px;
  font-size: 0.85rem;
  border-radius: 9px;
}

/* Prize preview chips (before spin / guest) */
.kc-ws-preview-note {
  margin: 10px 0 0;
  font-size: 0.8rem;
  color: var(--kcws-muted);
  text-align: center;
}

/* Win Celebration Card */
.kc-ws-win-card {
  padding: 18px 20px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(47, 122, 44, 0.26) 0%, rgba(14, 14, 14, 0.85) 100%);
  border: 1.5px solid rgba(244, 196, 48, 0.6);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

.kc-ws-win-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--kcws-gold);
  margin-bottom: 4px;
}

.kc-ws-win-prize {
  margin: 0 0 6px;
  font-family: var(--kcws-ff-display);
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  line-height: 1.15;
}

.kc-ws-win-desc {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.5;
  color: rgba(247, 247, 245, 0.88);
}

.kc-ws-coupon-box {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px dashed rgba(244, 196, 48, 0.65);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kc-ws-coupon-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.12rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--kcws-gold);
}

.kc-ws-coupon-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.kc-ws-apply-msg {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: #8ee085;
}

/* Cooldown Card */
.kc-ws-cooldown-card {
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  text-align: center;
}

.kc-ws-cd-label {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--kcws-muted);
  margin-bottom: 6px;
}

.kc-ws-cd-timer {
  font-family: var(--kcws-ff-display);
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--kcws-gold);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.kc-ws-cd-last {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.84);
}

.kc-ws-cd-last strong {
  color: #8ee085;
}

/* Active Rewards Shelf */
.kc-ws-rewards-shelf {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.kc-ws-shelf-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--kcws-gold);
  margin: 0 0 8px;
}

.kc-ws-shelf-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.kc-ws-shelf-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9);
}

.kc-ws-shelf-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(82, 184, 74, 0.2);
  color: #8ee085;
  white-space: nowrap;
}

.kc-ws-shelf-copy {
  background: rgba(244, 196, 48, 0.16);
  border: 1px solid rgba(244, 196, 48, 0.45);
  color: var(--kcws-gold);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}

.kc-ws-error-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(192, 57, 43, 0.22);
  border: 1px solid rgba(231, 76, 60, 0.5);
  color: #ffd4cf;
  font-size: 0.86rem;
  margin-bottom: 10px;
}

.kc-ws-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.55);
}

.kc-ws-sound-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 3px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.kc-ws-sound-btn:hover {
  border-color: var(--kcws-gold);
  color: #ffffff;
}

/* ── Mobile Responsive ──────────────────────────────────────────────────── */

@media (max-width: 780px) {
  .kc-ws-launcher-wrap {
    bottom: 16px;
  }
  .kc-ws-launcher-wrap.kc-ws-pos-right { right: 16px; }
  .kc-ws-launcher-wrap.kc-ws-pos-left  { left: 16px; }

  .kc-ws-launcher-icon,
  .kc-ws-launcher-icon img {
    width: 50px;
    height: 50px;
  }

  .kc-ws-layout {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 24px 18px 22px;
  }

  .kc-ws-wheel-frame {
    width: min(300px, 76vw);
  }

  .kc-ws-hub-btn {
    width: 74px;
    height: 74px;
  }

  .kc-ws-panel {
    text-align: center;
  }

  .kc-ws-brand-eyebrow {
    align-self: center;
  }

  .kc-ws-coupon-actions {
    grid-template-columns: 1fr;
  }
}
