/* ======================
   Container & Layout
   ====================== */
.upm-wheel-container {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    font-family: inherit;
}

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

.upm-wheel-title {
    font-size: 32px;
    color: #fff;
    margin: 0 0 20px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.upm-user-info {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.upm-points-badge,
.upm-cost-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 25px;
    color: #fff;
    font-size: 14px;
    backdrop-filter: blur(10px);
}

.upm-points-badge strong,
.upm-cost-badge strong {
    font-size: 18px;
    margin-right: 5px;
}

/* ======================
   Wheel Wrapper
   ====================== */
.upm-wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    aspect-ratio: 1;
}

/* ======================
   Canvas
   ====================== */
#upm-wheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.3));
    transition: transform 0.3s ease;
}

#upm-wheel-canvas.spinning {
    pointer-events: none;
}

/* ======================
   Pin (Arrow)
   ====================== */
.upm-wheel-pin {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-top: 40px solid #fff;
    z-index: 10;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.upm-wheel-pin::after {
    content: '';
    position: absolute;
    top: -45px;
    left: -15px;
    width: 30px;
    height: 30px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* ======================
   Spin Button
   ====================== */
.upm-spin-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border: 5px solid #fff;
    border-radius: 50%;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 10;
    outline: none;
}

.upm-spin-button:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.upm-spin-button:active {
    transform: translate(-50%, -50%) scale(0.95);
}

.upm-spin-button.spinning {
    pointer-events: none;
    opacity: 0.7;
}

.upm-spin-button .spinner {
    display: none;
}

.upm-spin-button.spinning .spin-text {
    display: none;
}

.upm-spin-button.spinning .spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin-loader 1s linear infinite;
}

@keyframes spin-loader {
    to {
        transform: rotate(360deg);
    }
}

/* ======================
   Footer
   ====================== */
.upm-wheel-footer {
    text-align: center;
    margin-top: 30px;
}

.upm-wheel-note {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    margin: 0;
}

/* ======================
   Modal
   ====================== */
.upm-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.upm-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.upm-modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    position: relative;
    animation: slideUp 0.4s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.upm-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 32px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    transition: color 0.3s;
    line-height: 1;
}

.upm-modal-close:hover {
    color: #333;
}

/* ======================
   Result Content
   ====================== */
.upm-result-content,
.upm-alert-content {
    text-align: center;
}

.upm-result-icon,
.upm-alert-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.upm-result-icon.win::before {
    content: '🎉';
}

.upm-result-icon.lose::before {
    content: '😢';
}

.upm-alert-icon.warning::before {
    content: '⚠️';
}

.upm-alert-icon.error::before {
    content: '❌';
}

.upm-alert-icon.info::before {
    content: 'ℹ️';
}

.upm-result-title,
.upm-alert-title {
    font-size: 28px;
    margin: 0 0 20px 0;
    color: #333;
}

.upm-result-image {
    margin: 20px 0;
}

.upm-result-image img {
    max-width: 200px;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.upm-result-message,
.upm-alert-message {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
    margin: 20px 0;
}

.upm-modal-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.upm-modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

/* ======================
   Disabled State
   ====================== */
.upm-wheel-disabled {
    text-align: center;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 10px;
    color: #666;
    font-size: 16px;
}

/* ======================
   Responsive
   ====================== */
@media (max-width: 768px) {
    .upm-wheel-container {
        padding: 20px;
    }

    .upm-wheel-title {
        font-size: 24px;
    }

    .upm-modal-content {
        padding: 30px 20px;
    }

    .upm-spin-button {
        width: 80px;
        height: 80px;
        font-size: 16px;
    }
}

/* ======================
   RTL Support
   ====================== */
[dir="rtl"] .upm-modal-close {
    right: auto;
    left: 20px;
}
