/* ====================== */
/* Spin Wheel Main Styles */
/* ====================== */

#spinwheel-container {
    display: grid;
    place-items: center;
    text-align: center;
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
}

/* Wheel Container */
#spinwheel {
    position: relative;
    margin: 0 auto;
    width: 430px;
    height: 430px;
}

/* Wheel Canvas */
#wheelCanvas {
    display: block;
    margin: 0 auto;
    transition: transform 0.1s ease-out;
    position: relative;
    z-index: 1;
    transform-origin: 50% 50%;
}

/* Default pointer style */
.wheel-pointer {
    position: absolute;
    top: 50%;
    right: -25px; /* your adjustment */
    transform: translateY(-50%);
    width: 100px;
    height: 100px;
    background: url('../images/pointer.svg') no-repeat center center;
    background-size: contain;
    z-index: 10;
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.3));
    transition: transform 0.2s ease;
}

h2.spinwheel-balance {
    color: #ca9826;
}

/* Wiggle / bounce animation */
@keyframes pointer-wiggle {
    0%   { transform: translateY(-50%) rotate(0deg); }
    25%  { transform: translateY(-50%) rotate(-8deg); }
    50%  { transform: translateY(-50%) rotate(0deg); }
    75%  { transform: translateY(-50%) rotate(8deg); }
    100% { transform: translateY(-50%) rotate(0deg); }
}

.wheel-pointer.animate {
    animation: pointer-wiggle 0.4s ease-in-out infinite;
}

/* Idle sway: small side-to-side wiggle */
@keyframes pointer-sway {
    0%   { transform: translateY(-50%) rotate(0deg); }
    25%  { transform: translateY(-50%) rotate(-3deg); }
    50%  { transform: translateY(-50%) rotate(0deg); }
    75%  { transform: translateY(-50%) rotate(3deg); }
    100% { transform: translateY(-50%) rotate(0deg); }
}

.wheel-pointer.idle {
    animation: pointer-sway 2.5s ease-in-out infinite;
}

#wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 30;
}


/* Spin Button */
#spinwheel-button {
    background: #070707;
    color: white;
    padding: 10px 10px;
    font-size: 17px;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s;
    width: 76px;
    height: 75px;
    border: 7px red;
    border-style: groove;
    text-transform: uppercase;
    font-weight: 700;
}

div#spin-button-wrapper {
    z-index: 9999;
    position: relative;
}

#spinwheel-button:hover {
    background: #e3ad25;
    transform: scale(1.05);
    color: #000000;
}

#spinwheel-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

/* Results Container */
#spinwheel-result {
    border: 5px #886100;
    border-style: outset;
    padding: 3px;
    min-height: 60px;
    margin-top: 20px;
    font-size: 18px;
    background: #e5b22b;
    border-radius: 10px;
    display: grid;
    align-items: center;
}

/* Result Messages */
.result-message {
    padding: 15px;
    border-radius: 5px;
    margin: 15px auto;
    max-width: 80%;
    text-align: center;
    font-weight: bold;
    animation: fadeIn 0.5s;
}

/* Win Message */
.result-message.congratulations {
    background: #2ecc71;
    color: white;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5);
}

/* No Win Message */
.result-message.try-again {
    background: #e74c3c;
    color: white;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.5);
    width: 100%;
}

/* Loading State */
.result-message.loading {
    color: #7f8c8d;
    background: transparent;
    box-shadow: none;
}

/* Error State */
.result-message.error {
    background: #e74c3c;
    color: white;
}

/* Login Notice */
.spinwheel-notice {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border-radius: 5px;
    text-align: center;
    margin: 20px auto;
    max-width: 80%;
}

/* ============= */
/* Animations */
/* ============= */

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(20px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

@keyframes bounce {
    0%, 100% { 
        transform: scale(1); 
    }
    50% { 
        transform: scale(1.05); 
    }
}


/* Notice */

.spinwheel-banner-box {
    background: #eafaf1;
    border: 2px solid #2ecc71;
    padding: 16px 20px;
    margin: 20px 0;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    font-size: 16px;
    color: #14532d;
    font-weight: 500;
    line-height: 1.6;
}

.spinwheel-banner-box strong {
    color: #27ae60;
}

.spinwheel-thankyou-wrap {
    margin-bottom: 25px;
    text-align: center;
}

.spinwheel-thankyou-button {
    background-color: #00ae21;
    color: #ffffff !important;
    padding: 14px 28px;
    font-size: 16px;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.spinwheel-thankyou-button:hover {
    background-color: #27ae60;
}

/* Make the wheel wrapper the positioning context */
#spinwheel.spinwheel-stage{
  position: relative !important;
  display: inline-block !important;
}

/* Center the button wrapper over the canvas */
#spinwheel.spinwheel-stage #spin-button-wrapper{
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 1000 !important;
  pointer-events: auto;
}

/* Center the whole section */
#spinwheel-container{
  display: grid;
  place-items: center;
  text-align: center;
  padding-bottom: 40px;
  border: 5px solid #ca9826;
  justify-content: center;
}

/* Responsive width for the wheel wrapper (desktop <= 520px, mobile <= 85% of viewport) */
/* Make the canvas scale to the wrapper */
#wheelCanvas{
  width: 400px;
  height: 400px;
  display: block;
  border-radius: 50%;
  margin-top: 15px;
}

img.absolute.inset-0.w-full.h-full.pointer-events-none.z-10 {
    position: absolute;
    width: 420px;
    height: 420px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9;
}

/* keep the centered button rules you already added */
#spin-button-wrapper{
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
}

/* adjustable speed for the idle spin */
:root { --wheel-idle-rot-duration: 120s; } /* 120s per revolution (very slow) */

@keyframes spinwheel-idle-rotate {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* idle rotation ON */
#spinwheel.idle-rotate #wheelCanvas{
  animation: spinwheel-idle-rotate var(--wheel-idle-rot-duration) linear infinite;
  transform-origin: 50% 50%;
  will-change: transform;
}

/* pause during the real spin */
#spinwheel.idle-rotate.pause-idle #wheelCanvas{
  animation-play-state: paused;
}

/* === Promo banner === */
.spinwheel-promo {
  display: flex;
  justify-content: center;
  margin: 12px 0 18px;
}

.spinwheel-promo p {
  /* core banner panel */
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 14px 26px;
  color: #fff;
  font-weight: 800;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-radius: 18px;
  border: 16px solid #9a1b0a;

  /* deep red glossy look */
  background:
    radial-gradient(120% 180% at 50% 0%, rgba(255,255,255,.25) 0%, rgba(255,255,255,0) 55%),
    linear-gradient(#b00000, #8e0000 55%, #6f0000);
  box-shadow:
    0 10px 26px rgba(0,0,0,.35),
    inset 0 -6px 0 rgba(0,0,0,.25),
    inset 0 2px 0 rgba(255,255,255,.25);
  filter: drop-shadow(0 0 10px rgba(255, 174, 0, .25));
  text-align: center;
  min-width: 294px;
    min-height: 95px;
    display: grid;
    align-content: center;
}

/* Big first line if you split lines with <br> */
.spinwheel-promo p { font-size: 22px; }
.spinwheel-promo p .amount { font-size: 28px; display: block; }

/* Bulb frame (top/bottom + left/right) */
.spinwheel-promo p::before,
.spinwheel-promo p::after {
  content: "";
  position: absolute;
  inset: -15px;                  /* pushes the bulbs outside the panel edge */
  border-radius: 24px;
  pointer-events: none;
}

/* Top & bottom bulbs in one layer */
.spinwheel-promo p::before {
  background:
    radial-gradient(circle, #fff9cf 0 6px, #ffd468 7px 9px, #8a5400 10px 11px, transparent 12px)
      top left / 34px 34px repeat-x,
    radial-gradient(circle, #fff9cf 0 6px, #ffd468 7px 9px, #8a5400 10px 11px, transparent 12px)
      bottom left / 34px 34px repeat-x;
  animation: bulbs-blink 1.8s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255,195,0,.9));
}

/* Left & right bulbs in another layer */
.spinwheel-promo p::after {
  background:
    radial-gradient(circle, #fff9cf 0 6px, #ffd468 7px 9px, #8a5400 10px 11px, transparent 12px)
      top left / 34px 34px repeat-y,
    radial-gradient(circle, #fff9cf 0 6px, #ffd468 7px 9px, #8a5400 10px 11px, transparent 12px)
      top right / 34px 34px repeat-y;
  animation: bulbs-blink-alt 1.8s linear infinite;
  filter: drop-shadow(0 0 6px rgba(255,195,0,.9));
}

/* Bulb frame wrapper — pull ring in a bit and match corner radius */
.spinwheel-promo p::before,
.spinwheel-promo p::after {
  inset: -16px;          /* was -14px */
  border-radius: 40px;  /* was 24px */
  margin: -3px;
}

/* TOP & BOTTOM bulbs — ~50% of previous size */
.spinwheel-promo p::before {
  background:
    radial-gradient(circle,
      #fff9cf 0 3px,           /* core (was 6px) */
      #ffd468 4px 4.5px,       /* inner glow (was 7–9px) */
      #8a5400 5.5px 6px,       /* rim (was 10–11px) */
      transparent 6.5px        /* outer radius (was 12px) */
    )
      top left / 22px 22px repeat-x,  /* grid spacing (was 34x34) */
    radial-gradient(circle,
      #fff9cf 0 3px,
      #ffd468 4px 4.5px,
      #8a5400 5.5px 6px,
      transparent 6.5px
    )
      bottom left / 22px 22px repeat-x;
  filter: drop-shadow(0 0 4px rgba(255,195,0,.9)); /* slightly softer */
}

/* LEFT & RIGHT bulbs — same sizes */
.spinwheel-promo p::after {
  background:
    radial-gradient(circle,
      #fff9cf 0 3px,
      #ffd468 4px 4.5px,
      #8a5400 5.5px 6px,
      transparent 6.5px
    )
      top left / 22px 22px repeat-y,
    radial-gradient(circle,
      #fff9cf 0 3px,
      #ffd468 4px 4.5px,
      #8a5400 5.5px 6px,
      transparent 6.5px
    )
      top right / 22px 22px repeat-y;
  filter: drop-shadow(0 0 4px rgba(255,195,0,.9));
}


/* Alternating “marquee” blink */
@keyframes bulbs-blink {
  0%   { opacity: 1; }
  50%  { opacity: .55; }
  100% { opacity: 1; }
}
@keyframes bulbs-blink-alt {
  0%   { opacity: .55; }
  50%  { opacity: 1; }
  100% { opacity: .55; }
}

/* Optional: make it responsive */
@media (max-width: 480px) {
  .spinwheel-promo p { font-size: 18px; padding: 12px 18px; }
  .spinwheel-promo p .amount { font-size: 24px; }
}

/* Keep scoping tight */
#spinwheel-container * { box-sizing: border-box; }

#spinwheel-container {
  --size: 20px;
  position: relative;           /* create stacking context */
  display: grid;
  place-items: center;
  background: hsl(0 0% 6%);     /* normal background for content */
  overflow: visible;             /* hide the pseudo-element overflow */
}

/* Animated background layer */
#spinwheel-container::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;                   /* sit behind content */
  background: conic-gradient(
    from 180deg at 50% 70%,
    hsla(0,0%,98%,1) 0deg,
    #eec32d 72.0000010728836deg,
    #ec4b4b 144.0000021457672deg,
    #709ab9 216.00000858306885deg,
    #4dffbf 288.0000042915344deg,
    hsla(0,0%,98%,1) 1turn
  );

  /* Mask only this layer, not the children */
  mask:
    radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / var(--size) var(--size),
    url("https://assets.codepen.io/605876/noise-mask.png") 256px 50% / 256px 256px;
  mask-composite: intersect;

  /* WebKit compatibility */
  -webkit-mask:
    radial-gradient(circle at 50% 50%, white 2px, transparent 2.5px) 50% 50% / var(--size) var(--size),
    url("https://assets.codepen.io/605876/noise-mask.png") 256px 50% / 256px 256px;
  -webkit-mask-composite: source-in; /* closest to 'intersect' */

  animation: spinwheel-flicker 20s infinite linear;
  pointer-events: none;         /* don’t block clicks */
}

/* Ensure all direct children render above the bg layer */
#spinwheel-container > * {
  position: relative;
  z-index: 1;
}

@keyframes spinwheel-flicker {
  to {
    mask-position: 50% 50%, 0 50%;
    -webkit-mask-position: 50% 50%, 0 50%;
  }
}




/* optional: slightly smaller hub button on very small screens */
@media (max-width: 480px){
  #spinwheel-button.spin-btn{
    width: 74px;
    height: 74px;
    font-size: 16px;
  }
  
  #spinwheel.spinwheel-stage{
  width: clamp(260px, 85vw, 520px);  /* min 260px, prefer 85vw, cap at 520px */
  margin: 0 auto;
  position: relative;                /* keep from earlier */
  display: inline-block;
}
  
  #spinwheel.spinwheel-stage #spin-button-wrapper {
    top: 42% !important;
}

.wheel-pointer {
    top: 41.5%;
}

#wheelCanvas{
  width: 320px;
  height: 320px;
  display: block;
  border-radius: 50%;
  margin-top: 15px;
}

img.absolute.inset-0.w-full.h-full.pointer-events-none.z-10 {
    top: 41%;
}

#spinwheel-container{
  padding-bottom: 00px;
}

  
}


