/* =========================
   Joker Machine Popup
========================= */
#joker-machine-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: radial-gradient(circle, #492171 0%, #2c1746 100%);
    padding: 70px;
    border-radius: 15px;
    color: #fff;
    text-align: center;
    z-index: 10000;
    box-shadow: 0 0 40px rgba(0,0,0,0.8);
    border: 6px solid #a087aa;
    max-width: 500px;
    width: 90%;
    box-sizing: border-box;
    height: auto;           /* allows dynamic height */
    max-height: 90vh;       /* prevent popup from exceeding viewport */
    overflow-y: auto;       /* scroll if content exceeds max-height */
}

/* Tablet devices */
@media (max-width: 768px) {
    #joker-machine-popup {
        padding: 50px;
        max-width: 400px;
        max-height: 85vh;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    #joker-machine-popup {
        padding: 30px;
        max-width: 350px;
        width: 95%;
        max-height: 80vh;
    }
}

/* Overlay stays the same */
#joker-machine-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
}

/* =========================
   Reels
========================= */
.reels-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

/* Outer reel (container) */
.reel {
    width: 50px;
    height: 70px;
    overflow: hidden;
    border: 3px solid #a087aa;
    border-radius: 10px;
    margin: 0 5px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;

    /* promote to its own layer for smoother rendering */
    transform: translateZ(0);
    will-change: transform;
    box-sizing: border-box;
}

/* fixed gradient pinned to the reel container (won't move during animation) */

.reel-inner::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: linear-gradient(180deg, #492171, #6a359c);
    border-radius: 10px;
    z-index: -1; /* behind symbols */
    pointer-events: none;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* The moving symbols container */
.reel-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 300%;
    border-radius: 10px;
    z-index: 2;
    background: transparent; /* make real element transparent */
}

/* Symbols on top */
.reel-symbol {
    height: 70px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    font-weight: bold;
    color: #7eff78;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
    position: relative;
    z-index: 3;
    background: linear-gradient(180deg, #492171, #6a359c); /* fixed gradient */
    backface-visibility: hidden;
}


.reel-symbol img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.6));
}

/* =========================
   Spin Button
========================= */
#spin-btn {
    padding: 10px 20px;
    background: linear-gradient(180deg, #3b1f5a, #492171); /* darker gradient of #492171 */
    border: 3px solid #a087aa;
    border-radius: 10px;
    color: #fff;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.4);
    font-family: Arial, Helvetica, sans-serif;
    transition: all 0.2s ease;
    margin-top: 20px;   /* space above button */
    margin-bottom: 20px; /* space below button */
}

#spin-btn:hover {
    background: #7e42d1; /* brighter purple for hover */
    border-color: #492171; /* keep the border same for contrast */
    box-shadow: 0 6px 8px rgba(0,0,0,0.6);
}
/* =========================
   Voucher Box
========================= */
#voucher-box {
    margin-top: 20px;
    padding: 15px;
    border: 2px dashed #FFD700;
    border-radius: 10px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    text-align: center;
    font-family: 'Courier New', monospace;
}

#voucher-box p {
    margin: 0 0 10px;
    font-size: 16px;
    color: #FFD700;
}

.voucher-amount {
    font-size: 26px;
    font-weight: bold;
    margin-bottom: 10px;
    color: #FFD700;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.8);
}

#copy-voucher {
    padding: 6px 14px;
    border: 2px solid #FFD700;
    border-radius: 8px;
    background: #7b4f2d;
    color: #fff;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

#copy-voucher:hover {
    background: #a16f45;
    color: #FFD700;
}

/* =========================
   Titles
========================= */
.slot-title {
    font-size: 18px;
    margin: 30px 30px 30px 30px;
    color: #fff;
    font-family: Arial, Helvetica, sans-serif, sans-serif;
}

/* =========================
   Confetti
========================= */
.confetti-splash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.confetti-piece {
  position: absolute;
  top: 0; left: 0;
  opacity: 0.9;
}

@keyframes confetti-burst {
  0%   { transform: translate(0,0) scale(1); opacity: 1; }
  80%  { transform: translate(var(--tx), var(--ty)) scale(0.9); opacity: 1; }
  100% { transform: translate(var(--tx), var(--ty)) scale(0.4); opacity: 0; }
}


/* =========================
   Joker Badge Icon
========================= */

#joker-machine-icon {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 150px;
    height: 150px;
    z-index: 10000;
    cursor: pointer; /* hand cursor */
}


.joker-badge-image {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto;
}

.joker-ring {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 160px;      /* bigger than image */
    height: 160px;
    transform: translate(-50%, -50%);
    border: 6px solid #492171; /* adjust thickness */
    border-radius: 50%;
    z-index: 1;
}


/* Purple circular background behind the image */
.joker-bg-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;        /* diameter of the circle */
    height: 140px;
    background-color: #492171;  /* purple */
    border-radius: 50%;         /* makes it a perfect circle */
    transform: translate(-50%, -50%);
    z-index: 1;                 /* behind the image */
}

/* Joker image on top */
.joker-center {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;       /* image size */
    height: 100px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;         /* above the purple circle */
}

/* Orbiting text above the background circle */
.orbit-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    animation: rotateOrbit 10s linear infinite;
    transform-origin: 50% 50%;
    z-index: 3;         /* above the background */
}

.orbit-text textPath {
    font-family: Arial, Helvetica, sans-serif, sans-serif;
    font-size: 18px;
    fill: #7eff78;     /* green text */
    font-weight: bold;
}

@keyframes rotateOrbit {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* =========================
   Popup Joker Image (Slot Machine Window)
========================= */
.joker-image-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.joker-image-wrapper img.joker-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 4px solid #7eff78;
    box-shadow: 0 0 14px 4px rgba(126, 255, 120, 0.8); /* slightly larger glow */
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: greenGlow 3s infinite alternate; /* animated glow */
}

@keyframes greenGlow {
    0% {
        box-shadow: 0 0 12px 3px rgba(126, 255, 120, 0.6);
    }
    50% {
        box-shadow: 0 0 16px 5px rgba(126, 255, 120, 0.9);
    }
    100% {
        box-shadow: 0 0 12px 3px rgba(126, 255, 120, 0.6);
    }
}


/* Subtle shadow for the popup icon's purple background */
.joker-bg-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 140px;
    height: 140px;
    background-color: #492171;  /* purple */
    border-radius: 50%;         
    transform: translate(-50%, -50%);
    z-index: 1;                 /* behind the image */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4); /* small shadow */
}
.euro-symbol {
    color: #FFD700; /* gold */
    font-size: 30px;
    font-weight: bold;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.7);
}
