/* Wheel Widget Base Styles */
.wheel-widget-container {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    display: none; /* Hidden by default, JS will show if eligible */
    transition: opacity 0.5s ease;
}
.wheel-widget-icon {
    width: 65px;
    height: 65px;
    background: linear-gradient(135deg, #1e40af 0%, #9333ea 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    position: relative;
    animation: pulseWheel 2s infinite;
    transition: 0.3s;
}
.wheel-widget-icon:hover {
    transform: scale(1.05);
}
@keyframes pulseWheel {
    0% { box-shadow: 0 0 0 0 rgba(147, 51, 234, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(147, 51, 234, 0); }
    100% { box-shadow: 0 0 0 0 rgba(147, 51, 234, 0); }
}
.wheel-widget-icon svg {
    color: white;
    animation: rotateIcon 10s linear infinite;
}
@keyframes rotateIcon {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
.wheel-tooltip {
    position: absolute;
    left: 75px;
    background: #fff;
    color: #0f172a;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    transform: translateX(-10px);
}
.wheel-tooltip::before {
    content: '';
    position: absolute;
    top: 50%;
    left: -6px;
    transform: translateY(-50%);
    border-width: 6px 6px 6px 0;
    border-style: solid;
    border-color: transparent #fff transparent transparent;
}
.wheel-widget-icon:hover .wheel-tooltip {
    opacity: 1;
    transform: translateX(0);
}

/* Modal Overlay */
.wheel-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.7);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    opacity: 0;
    pointer-events: none;
    transition: 0.3s ease;
}
.wheel-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Box */
.wheel-modal {
    background: #fff;
    width: 95%;
    max-width: 420px;
    border-radius: 24px;
    padding: 35px 30px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    transform: scale(0.9);
    transition: 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.wheel-modal-overlay.active .wheel-modal {
    transform: scale(1);
}

.wheel-close {
    position: absolute;
    top: 15px;
    right: 15px;
    width: 36px;
    height: 36px;
    background: #f1f5f9;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.2s;
    line-height: 1;
}
.wheel-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.wheel-header h3 {
    margin: 0;
    font-size: 30px;
    font-weight: 800;
    background: linear-gradient(135deg, #1e40af 0%, #9333ea 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.wheel-header p {
    color: #64748b;
    font-size: 15px;
    margin-top: 8px;
    margin-bottom: 30px;
    font-weight: 500;
}

/* Wheel Layout */
.wheel-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 0 auto;
}
.wheel-pointer {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0; 
    height: 0; 
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 30px solid #facc15; /* Golden pointer */
    z-index: 20;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.3));
}
.wheel-pointer::after {
    content: '';
    position: absolute;
    top: -30px;
    left: -12px;
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 20px solid #ca8a04;
    z-index: 21;
}

.wheel-canvas-wrap {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 0 0 8px #f8fafc, 0 10px 25px rgba(0,0,0,0.15), inset 0 0 10px rgba(0,0,0,0.5);
    position: relative;
    z-index: 10;
    will-change: transform;
}
#wheelCanvas {
    display: block;
}

.wheel-spin-btn {
    margin-top: 35px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 16px 45px;
    font-size: 20px;
    font-weight: 800;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(124, 58, 237, 0.3);
    transition: 0.3s;
    letter-spacing: 1px;
}
.wheel-spin-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 25px rgba(124, 58, 237, 0.4);
}
.wheel-spin-btn:active {
    transform: translateY(1px);
}
.wheel-spin-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: #94a3b8;
}

.wheel-result {
    margin-top: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 16px;
    border: 2px dashed #cbd5e1;
    animation: fadeIn 0.5s ease;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}
.wheel-result h4 {
    margin: 0;
    color: #0f172a;
    font-size: 22px;
    font-weight: 800;
}
.wheel-result p {
    color: #475569;
    font-size: 15px;
    margin: 10px 0;
    line-height: 1.5;
}
.wheel-result b {
    color: #1e40af;
}

.wheel-code-box {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 15px;
}
.wheel-code-box span {
    background: #e0e7ff;
    color: #4338ca;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 800;
    font-family: 'JetBrains Mono', monospace;
    font-size: 18px;
    letter-spacing: 1.5px;
    border: 1px solid #c7d2fe;
}
.wheel-code-box button {
    background: #1e293b;
    color: white;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: 0.2s;
}
.wheel-code-box button:hover {
    background: #0f172a;
    transform: scale(1.05);
}

@media (max-width: 480px) {
    .wheel-widget-container {
        left: 15px;
        top: auto;
        bottom: 25px;
        transform: none;
    }
    .wheel-tooltip {
        display: none;
    }
    .wheel-modal {
        padding: 25px 20px;
    }
    .wheel-container, .wheel-canvas-wrap {
        width: 250px;
        height: 250px;
    }
    .wheel-header h3 {
        font-size: 24px;
    }
    .wheel-header p {
        font-size: 13px;
    }
}
