/* ============================================
   Lucky Draw Page — Generic Theme
   Uses CSS variables from client config.
   Fallback values use a neutral purple/blue theme.
   ============================================ */

/* 1. PAGE LAYOUT */
.lucky-draw-page {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px 15px 40px;
    min-height: auto;
}

.lucky-draw-header {
    text-align: center;
    margin-bottom: 20px;
}

.lucky-draw-title {
    font-family: 'Dangrek', system-ui, sans-serif;
    font-size: 28px;
    color: var(--color-brand-primary, #6C63FF);
    margin: 0 0 4px;
    text-shadow: 0 2px 8px rgba(108, 99, 255, 0.3);
}

.lucky-draw-subtitle {
    color: #aaa;
    font-size: 14px;
    margin: 0;
}

/* 1b. GUEST LOGIN NOTICE */
.guest-login-notice {
    text-align: center;
    padding: 14px 20px;
    margin-bottom: 20px;
    background: rgba(108, 99, 255, 0.1);
    border: 1px solid rgba(108, 99, 255, 0.3);
    border-radius: 12px;
    color: var(--color-brand-primary, #6C63FF);
    font-size: 14px;
    font-weight: 600;
}

.guest-login-notice p {
    margin: 0;
}

/* 2. SPIN INFO PANEL */
.spin-info-panel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 24px;
}

.spin-info-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
}

.spin-info-label {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spin-info-value {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
}

/* 3. WHEEL */
.wheel-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.wheel-pointer-container {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.wheel-pointer {
    font-size: 28px;
    color: var(--color-brand-primary, #6C63FF);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
    animation: pointerBounce 1.5s ease-in-out infinite;
}

@keyframes pointerBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(4px); }
}

.wheel-container {
    border-radius: 50%;
    box-shadow:
        0 0 20px rgba(108, 99, 255, 0.3),
        0 0 40px rgba(108, 99, 255, 0.1),
        inset 0 0 10px rgba(0, 0, 0, 0.2);
    border: 4px solid var(--color-brand-primary, #6C63FF);
    overflow: hidden;
}

#spinWheel {
    display: block;
}

/* 4. SPIN BUTTON */
.spin-button-container {
    text-align: center;
    margin-bottom: 24px;
}

.spin-btn {
    background: linear-gradient(135deg, var(--color-brand-primary, #6C63FF), var(--color-brand-primary-hover, #5A52D5));
    color: #fff;
    border: none;
    padding: 14px 48px;
    font-size: 18px;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 99, 255, 0.4);
    min-width: 200px;
}

.spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 99, 255, 0.6);
}

.spin-btn:active:not(:disabled) {
    transform: translateY(0);
}

.spin-btn:disabled {
    background: linear-gradient(135deg, #555, #444);
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.7;
}

.spin-btn.spinning {
    animation: spinPulse 0.8s ease-in-out infinite;
}

@keyframes spinPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.spin-cost-info {
    color: #888;
    font-size: 13px;
    margin: 10px 0 0;
}

/* 5. PRIZE MODAL */
.prize-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.prize-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.prize-modal {
    background: linear-gradient(145deg, var(--color-background-section, #1a1a2e), #2d2d4e);
    border: 2px solid var(--color-brand-primary, #6C63FF);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    max-width: 320px;
    width: 90%;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    box-shadow: 0 0 30px rgba(108, 99, 255, 0.3);
}

.prize-modal-overlay.show .prize-modal {
    transform: scale(1);
}

.prize-modal-icon {
    font-size: 48px;
    margin-bottom: 12px;
    animation: prizeGlow 1s ease-in-out infinite alternate;
}

@keyframes prizeGlow {
    from { transform: scale(1); }
    to { transform: scale(1.1); }
}

.prize-modal-title {
    color: var(--color-brand-primary, #6C63FF);
    font-family: 'Dangrek', system-ui, sans-serif;
    font-size: 24px;
    margin: 0 0 8px;
}

.prize-modal-text {
    color: #fff;
    font-size: 16px;
    margin: 0 0 20px;
}

.prize-modal-btn {
    background: linear-gradient(135deg, var(--color-brand-primary, #6C63FF), var(--color-brand-primary-hover, #5A52D5));
    color: #fff;
    border: none;
    padding: 10px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.prize-modal-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.4);
}

/* 6. SPIN HISTORY */
.spin-history {
    margin-top: 10px;
}

.spin-history-title {
    font-family: 'Dangrek', system-ui, sans-serif;
    color: var(--color-brand-primary, #6C63FF);
    font-size: 18px;
    margin: 0 0 12px;
}

.spin-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 10px;
    margin-bottom: 8px;
}

.spin-history-prize {
    display: flex;
    align-items: center;
    gap: 10px;
}

.spin-history-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.spin-history-badge--points {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.spin-history-badge--wallet {
    background: rgba(77, 208, 225, 0.15);
    color: #4DD0E1;
}

.spin-history-label {
    color: #ccc;
    font-size: 13px;
}

.spin-history-meta {
    text-align: right;
}

.spin-history-type {
    display: block;
    font-size: 12px;
    color: #888;
}

.spin-history-time {
    display: block;
    font-size: 11px;
    color: #666;
}

/* 7. RESPONSIVE */
@media (max-width: 360px) {
    .spin-info-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .lucky-draw-title {
        font-size: 24px;
    }

    #spinWheel {
        width: 280px;
        height: 280px;
    }
}
