/* Wheel of Fortune Styles */

.wheel-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(10, 10, 20, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.wheel-machine {
    background: linear-gradient(145deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 20px;
    padding: 24px;
    max-width: 400px;
    width: 95%;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(100, 100, 255, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Header */
.wheel-header {
    text-align: center;
    margin-bottom: 20px;
}

.wheel-title {
    font-size: 1.5rem;
    margin: 0 0 12px 0;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #fbbf24 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(251, 191, 36, 0.3);
    animation: shimmer 3s infinite;
}

.wheel-karma-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 1.2rem;
    position: relative;
}

.wheel-karma-display .karma-icon {
    font-size: 1.4rem;
}

.wheel-karma-display .karma-delta {
    position: absolute;
    right: -30px;
    font-size: 0.9rem;
    font-weight: bold;
    opacity: 0;
    transition: all 0.3s;
}

.wheel-karma-display .karma-delta.show {
    opacity: 1;
    animation: deltaFloat 1.5s ease forwards;
}

.wheel-karma-display .karma-delta.positive { color: #4ade80; }
.wheel-karma-display .karma-delta.negative { color: #ef4444; }

/* Wheel Stage */
.wheel-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.wheel-container {
    position: relative;
    width: 320px;
    height: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

#wheel-canvas {
    border-radius: 50%;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 0 20px rgba(0, 0, 0, 0.3);
}

/* Pointer */
.wheel-pointer {
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 15px solid transparent;
    border-right: 15px solid transparent;
    border-top: 35px solid #fbbf24;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
    z-index: 10;
    transition: transform 0.1s ease;
}

.wheel-pointer::after {
    content: '';
    position: absolute;
    top: -35px;
    left: -10px;
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 25px solid #f59e0b;
}

.wheel-pointer-shadow {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 15px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    filter: blur(5px);
    z-index: 9;
}

/* Center hub */
.wheel-center {
    position: absolute;
    width: 60px;
    height: 60px;
    background: linear-gradient(145deg, #2a2a4e 0%, #1a1a2e 100%);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        inset 0 2px 4px rgba(255, 255, 255, 0.1);
    border: 3px solid #333;
    z-index: 5;
}

.wheel-center-inner {
    font-size: 1.8rem;
    opacity: 0.8;
}

/* Result display */
.wheel-result {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 200px;
    height: 200px;
    display: flex;
    justify-content: center;
    align-items: center;
    pointer-events: none;
    opacity: 0;
    z-index: 20;
}

.wheel-result.show {
    animation: resultPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.result-content {
    text-align: center;
    background: rgba(20, 20, 40, 0.95);
    padding: 20px 30px;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.result-icon {
    font-size: 3rem;
    margin-bottom: 8px;
}

.result-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 4px;
}

.result-value {
    font-size: 1.8rem;
    font-weight: bold;
}

/* Result variants */
.result-icon.bust { animation: bustShake 0.5s ease; }
.result-text.bust { color: #ef4444; }
.result-value.bust { color: #ef4444; }

.result-icon.jackpot { animation: jackpotPulse 0.5s ease infinite; }
.result-text.jackpot { 
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}
.result-value.jackpot { 
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.5);
}

.result-icon.win { animation: winBounce 0.5s ease; }
.result-text.win { color: #4ade80; }

/* Controls */
.wheel-controls {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.wheel-spin-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 16px 48px;
    font-size: 1.3rem;
    font-weight: bold;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: #000;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 
        0 4px 15px rgba(251, 191, 36, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.wheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 
        0 6px 20px rgba(251, 191, 36, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.wheel-spin-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.wheel-spin-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
    box-shadow: none;
}

.wheel-spin-btn.spinning {
    animation: pulseGlow 1s ease infinite;
}

.spin-text {
    font-size: 1.3rem;
}

.spin-cost {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Stats */
.wheel-stats {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: #888;
}

.wheel-stats .stat {
    background: rgba(0, 0, 0, 0.2);
    padding: 4px 12px;
    border-radius: 10px;
}

/* Footer */
.wheel-footer {
    display: flex;
    justify-content: center;
}

.wheel-btn-secondary {
    padding: 10px 20px;
    font-size: 0.9rem;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.wheel-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Particle container */
.wheel-particles {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
}

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

@keyframes shimmer {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.2); }
}

@keyframes deltaFloat {
    0% { 
        transform: translateY(0);
        opacity: 1;
    }
    100% {
        transform: translateY(-20px);
        opacity: 0;
    }
}

@keyframes resultPop {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    70% {
        transform: translate(-50%, -50%) scale(1.1);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes bustShake {
    0%, 100% { transform: rotate(0); }
    20% { transform: rotate(-15deg); }
    40% { transform: rotate(15deg); }
    60% { transform: rotate(-10deg); }
    80% { transform: rotate(10deg); }
}

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

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

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 4px 15px rgba(251, 191, 36, 0.4); }
    50% { box-shadow: 0 4px 25px rgba(251, 191, 36, 0.6); }
}

/* Shared particles (if not already defined in shared CSS) */
.wheel-particles .particle {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: particleFly 1s ease-out forwards;
}

.wheel-particles .firework {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    animation: fireworkBurst 0.8s ease-out forwards;
}

@keyframes particleFly {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.3);
    }
}

@keyframes fireworkBurst {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(var(--dx), var(--dy)) scale(0.2);
    }
}

/* Screen flash */
.screen-flash {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
    animation: flashFade 0.4s ease-out forwards;
}

@keyframes flashFade {
    0% { opacity: 0.3; }
    100% { opacity: 0; }
}

/* Mega shake */
.mega-shake {
    animation: megaShake 0.5s ease;
}

@keyframes megaShake {
    0%, 100% { transform: translateX(0); }
    10% { transform: translateX(-10px) rotate(-1deg); }
    20% { transform: translateX(10px) rotate(1deg); }
    30% { transform: translateX(-8px) rotate(-1deg); }
    40% { transform: translateX(8px) rotate(1deg); }
    50% { transform: translateX(-5px); }
    60% { transform: translateX(5px); }
    70% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
    90% { transform: translateX(-1px); }
}

/* Responsive */
@media (max-width: 420px) {
    .wheel-machine {
        padding: 16px;
    }
    
    .wheel-container {
        width: 280px;
        height: 280px;
    }
    
    #wheel-canvas {
        width: 280px;
        height: 280px;
    }
    
    .wheel-title {
        font-size: 1.3rem;
    }
    
    .wheel-spin-btn {
        padding: 12px 36px;
        font-size: 1.1rem;
    }
}
