/* ====================== */
/* 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;
}

/* 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);
}

/* 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;
}


/* 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;
}

  
}


