/* Spin Wheel Popup - Centered */
.spin-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 480px;
    background: linear-gradient(to bottom, #ffffff, #f5f5f5);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
    padding: 40px 35px;
    z-index: 1000;
    border: 1px solid rgba(0, 0, 0, 0.1);
    animation: slideIn 0.5s ease-out;
    display: none;
}

@keyframes slideIn {
    from {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0;
    }
    to {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 24px;
    font-weight: 300;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #333;
}

.popup-header {
    text-align: center;
    margin-bottom: 30px;
}

.popup-header h2 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.popup-header p {
    color: #7f8c8d;
    font-size: 15px;
    font-weight: 400;
}

.wheel-container {
    position: relative;
    width: 340px;
    height: 340px;
    margin: 0 auto 30px;
}

.wheel {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 0 0 8px #34495e,
        0 0 0 12px #2c3e50,
        0 8px 30px rgba(0, 0, 0, 0.3),
        inset 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

.wheel-segment {
    position: absolute;
    width: 50%;
    height: 50%;
    transform-origin: 100% 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
    border-right: 1px solid rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.wheel-segment::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, rgba(0,0,0,0.1) 100%);
}

.segment-content {
    position: absolute;
    top: 8%;
    left: 69%;
    transform: rotate(-19.5deg) translateX(-50%);
    text-align: center;
    z-index: 1;
    width: 80px;
}

.coin-icon {
    font-size: 28px;
    display: block;
    margin-bottom: 5px;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.3));
}

.coin-amount {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 0.5px;
}

/* Center hub with metallic look */
.center-bolt {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70px;
    height: 70px;
    background: 
        radial-gradient(circle at 30% 30%, #ecf0f1, #95a5a6);
    border-radius: 50%;
    box-shadow: 
        0 0 0 4px #34495e,
        0 6px 20px rgba(0, 0, 0, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.5),
        inset 0 -2px 4px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #2c3e50;
    z-index: 10;
    letter-spacing: 1px;
}

.center-bolt::before {
    content: '';
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #bdc3c7, #7f8c8d);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.center-bolt-text {
    position: relative;
    z-index: 1;
}

/* Realistic metal pointer */
.pointer {
    position: absolute;
    top: -15px;
    left: 50%;
    transform: rotate(180deg) translateX(52%);
    width: 0;
    height: 0;
    /* border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 45px solid #e74c3c; */
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.4));
    z-index: 11;
}

.pointer::before {
    content: '';
    position: absolute;
    top: -45px;
    left: -18px;
    width: 36px;
    height: 45px;
    background: linear-gradient(to bottom, #c0392b 0%, #e74c3c 50%, #c0392b 100%);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.pointer::after {
    content: '';
    position: absolute;
    top: -38px;
    left: -3px;
    width: 6px;
    height: 30px;
    /* background: linear-gradient(to right, rgba(255,255,255,0.3), transparent); */
}

.spin-button {
    background: linear-gradient(to bottom, #ef7f1b, #be6618);
    color: white;
    border: none;
    padding: 16px 40px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    width: 100%;
    box-shadow: 
        0 4px 12px rgba(52, 152, 219, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.spin-button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(52, 152, 219, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(to bottom, #3ca3e6, #2980b9);
}

.spin-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 
        0 2px 8px rgba(52, 152, 219, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.spin-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    background: linear-gradient(to bottom, #95a5a6, #7f8c8d);
}

/* Win Animation Overlay */
.win-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 111;
}

.win-overlay.active {
    display: block;
}

.confetti {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #f39c12;
    animation: confettiFall 3s ease-out forwards;
    opacity: 0.9;
}

@keyframes confettiFall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.win-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: linear-gradient(to bottom, #ffffff, #f8f9fa);
    padding: 50px 70px;
    border-radius: 20px;
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(0, 0, 0, 0.1);
    text-align: center;
    z-index: 1111;
}

.win-message.show {
    animation: winPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

@keyframes winPop {
    0% {
        transform: translate(-50%, -50%) scale(0);
    }
    100% {
        transform: translate(-50%, -50%) scale(1);
    }
}

.win-message h3 {
    font-size: 32px;
    color: #27ae60;
    margin-bottom: 25px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.win-coins-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.win-coin-icon {
    font-size: 64px;
    animation: coinFlip 1s ease-in-out infinite;
}

@keyframes coinFlip {
    0%, 100% { transform: rotateY(0deg); }
    50% { transform: rotateY(180deg); }
}

.win-amount {
    font-size: 64px;
    color: #2c3e50;
    font-weight: 700;
    line-height: 1;
}

.win-subtext {
    color: #7f8c8d;
    font-size: 16px;
    margin-bottom: 30px;
}

.claim-button {
    background: linear-gradient(to bottom, #27ae60, #229954);
    color: white;
    border: none;
    padding: 16px 50px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 
        0 4px 12px rgba(39, 174, 96, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.claim-button:hover {
    transform: translateY(-1px);
    box-shadow: 
        0 6px 16px rgba(39, 174, 96, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(to bottom, #2ecc71, #27ae60);
}

/* Coin shower animation */
@keyframes coinShower {
    0% {
        transform: translateY(-100px) rotate(0deg) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(0) rotate(180deg) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg) scale(0.5);
        opacity: 0;
    }
}

.coin-shower {
    position: fixed;
    font-size: 32px;
    animation: coinShower 3s ease-out forwards;
    pointer-events: none;
    z-index: 2002;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

/* Glow effect for win */
@keyframes glow {
    0%, 100% {
        box-shadow: 
            0 30px 90px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(0, 0, 0, 0.1),
            0 0 30px rgba(39, 174, 96, 0.3);
    }
    50% {
        box-shadow: 
            0 30px 90px rgba(0, 0, 0, 0.4),
            0 0 0 1px rgba(0, 0, 0, 0.1),
            0 0 50px rgba(39, 174, 96, 0.6);
    }
}

.win-message.show {
    animation: winPop 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards,
               glow 2s ease-in-out infinite 0.6s;
}

/* Segment colors - professional palette */
.segment-1 { background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%); }
.segment-2 { background: linear-gradient(135deg, #3498db 0%, #2980b9 100%); }
.segment-3 { background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%); }
.segment-4 { background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%); }
.segment-5 { background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%); }
.segment-6 { background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%); }
.segment-7 { background: linear-gradient(135deg, #e67e22 0%, #d35400 100%); }
.segment-8 { background: linear-gradient(135deg, #c0392b 0%, #a93226 100%); }

.skip-btn,.retry-button{
    display: flex;
    width: 100%;
    justify-content: end;
    margin-top: 12px;
    color: #a6a3a3;
    font-weight: 500;
}

.retry-button{
    justify-content: center !important;
}