/*
 * wheel.css - Daily Wheel und Special Effects für Rocket100 NFT Battle Mini App
 * Enthält: Daily Wheel, Spin Animation, Win Effects, Confetti
 */

/* --- Daily Wheel Card --- */
.daily-wheel-card {
    margin-bottom: 20px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 2px solid var(--primary-blue);
    position: relative;
    overflow: hidden;
}

.daily-wheel-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.05) 0%, transparent 70%);
    animation: wheelCardGlow 8s linear infinite;
    pointer-events: none;
}

/* --- Wheel Header --- */
.wheel-header {
    text-align: center;
    margin-bottom: 15px;
    z-index: 2;
    position: relative;
}

.wheel-title {
    font-family: 'Orbitron', monospace;
    font-size: 24px;
    font-weight: 900;
    color: var(--credit-gold);
    text-shadow: 
        0 0 15px var(--credit-glow),
        0 0 30px var(--credit-glow);
    margin-bottom: 8px;
    animation: wheelTitleGlow 3s ease-in-out infinite;
}

.wheel-subtitle {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
}

/* --- Wheel Container --- */
.wheel-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    z-index: 2;
    position: relative;
}

.wheel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wheel-svg {
    width: 280px;
    height: 280px;
    max-width: 280px;
    max-height: 280px;
    border-radius: 50%;
    box-shadow: 
        0 0 30px rgba(6, 110, 225, 0.5),
        0 0 60px rgba(255, 215, 0, 0.3),
        inset 0 0 30px rgba(255, 255, 255, 0.1);
    transition: transform 0.1s ease;
    filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.4));
}

/* --- Wheel Disc --- */
.wheel-disc {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background: conic-gradient(from -90deg,
        #00FF7F 0deg 45deg,      /* credits_1 */
        #FFD700 45deg 90deg,     /* credits_2 */
        #8A2BE2 90deg 135deg,    /* credits_3 */
        #00CED1 135deg 180deg,   /* free_spin */
        #FF4500 180deg 225deg,   /* battle_boost */
        #9370DB 225deg 270deg,   /* mystery_box */
        #00FF7F 270deg 315deg,   /* credits_1 */
        #FFD700 315deg 360deg    /* credits_2 */
    );
    border: 4px solid var(--primary-blue);
    box-shadow:
        0 0 40px rgba(6, 110, 225, 0.5),
        0 0 80px rgba(255, 215, 0, 0.35),
        inset 0 0 30px rgba(255, 255, 255, 0.08);
    overflow: hidden;
}

.wheel-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: conic-gradient(
        from 0deg,
        rgba(255, 255, 255, 0.18) 0 10deg,
        transparent 10deg 36deg
    );
    animation: ringSpin 6s linear infinite;
    pointer-events: none;
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.25));
}

.wheel-center {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 84px;
    height: 84px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: radial-gradient(closest-side, #0b0b0b 0%, #0a0a0a 60%, #000 100%);
    border: 3px solid #066EE1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 20px rgba(6, 110, 225, 0.5),
        inset 0 0 12px rgba(255, 215, 0, 0.25);
}

.wheel-center img {
    width: 48px;
    height: 48px;
}

/* NEW: Wheel Pointer */
.wheel-pointer {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.pointer-triangle {
    width: 0;
    height: 0;
    border-left: 18px solid transparent;
    border-right: 18px solid transparent;
    border-top: 30px solid #FF4500;
    filter: 
        drop-shadow(0 0 15px rgba(255, 69, 0, 0.9))
        drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    animation: pointerGlow 2s ease-in-out infinite;
    position: relative;
}

.pointer-triangle::after {
    content: '';
    position: absolute;
    top: -32px;
    left: -3px;
    width: 6px;
    height: 6px;
    background: #FF4500;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 69, 0, 0.8);
}

/* NEW: Sector Labels */
.wheel-sector-labels {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.sector-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform-origin: 0 0;
    font-size: 14px;
    font-weight: 900;
    color: white;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.9),
        0 0 8px rgba(255, 255, 255, 0.3);
    text-align: center;
    width: 70px;
    margin-left: -35px;
    margin-top: -12px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 8px;
    padding: 4px 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
}

.sector-label.sector-0 { transform: rotate(22.5deg) translateY(-80px) rotate(-22.5deg); }
.sector-label.sector-1 { transform: rotate(67.5deg) translateY(-80px) rotate(-67.5deg); }
.sector-label.sector-2 { transform: rotate(112.5deg) translateY(-80px) rotate(-112.5deg); }
.sector-label.sector-3 { transform: rotate(157.5deg) translateY(-80px) rotate(-157.5deg); }
.sector-label.sector-4 { transform: rotate(202.5deg) translateY(-80px) rotate(-202.5deg); }
.sector-label.sector-5 { transform: rotate(247.5deg) translateY(-80px) rotate(-247.5deg); }
.sector-label.sector-6 { transform: rotate(292.5deg) translateY(-80px) rotate(-292.5deg); }
.sector-label.sector-7 { transform: rotate(337.5deg) translateY(-80px) rotate(-337.5deg); }

.wheel-svg.spinning {
    transition: transform 3.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* --- Wheel Controls --- */
.wheel-controls {
    text-align: center;
    width: 100%;
}

.wheel-spin-btn {
    font-family: 'Orbitron', monospace;
    font-size: 16px;
    font-weight: 900;
    padding: 15px 30px;
    border-radius: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--credit-gold), #FFA500);
    color: var(--dark-bg);
    border: 3px solid var(--credit-gold);
    box-shadow: 
        var(--shadow-glow) var(--credit-glow),
        0 10px 30px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.wheel-spin-btn:not(:disabled):hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 
        var(--shadow-glow) rgba(255, 215, 0, 0.8),
        0 15px 40px rgba(0, 0, 0, 0.4);
}

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

.wheel-spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #666, #888);
    border-color: #666;
    box-shadow: none;
}

.wheel-spin-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.wheel-spin-btn:not(:disabled):hover::before {
    left: 100%;
}

.wheel-status {
    margin-top: 15px;
    font-family: 'Orbitron', monospace;
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
}

/* --- Wheel Result --- */
.wheel-result {
    text-align: center;
    padding: 25px;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 2px solid var(--credit-gold);
    border-radius: 20px;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
    animation: resultSlideIn 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wheel-result::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(circle at 50% 50%, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
    animation: resultGlow 2s ease-in-out infinite;
}

.result-icon {
    font-size: 48px;
    margin-bottom: 15px;
    animation: resultIconBounce 1s ease-in-out;
    z-index: 2;
    position: relative;
}

.result-text {
    font-family: 'Orbitron', monospace;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 10px;
    z-index: 2;
    position: relative;
}

.wheel-result-icon {
    font-size: 24px;
}

.wheel-result-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* --- Special Effects --- */
.wheel-win-effect {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9999;
}

.confetti {
    position: absolute;
    width: 8px;
    height: 8px;
    background: var(--credit-gold);
    animation: confettiFall 3s linear infinite;
    border-radius: 2px;
}

.confetti:nth-child(1) { left: 10%; animation-delay: 0s; background: var(--accent-gold); }
.confetti:nth-child(2) { left: 20%; animation-delay: 0.3s; background: var(--accent-green); }
.confetti:nth-child(3) { left: 30%; animation-delay: 0.6s; background: var(--accent-cyan); }
.confetti:nth-child(4) { left: 40%; animation-delay: 0.9s; background: var(--accent-purple); }
.confetti:nth-child(5) { left: 50%; animation-delay: 1.2s; background: var(--accent-gold); }
.confetti:nth-child(6) { left: 60%; animation-delay: 1.5s; background: var(--accent-green); }
.confetti:nth-child(7) { left: 70%; animation-delay: 1.8s; background: var(--accent-cyan); }
.confetti:nth-child(8) { left: 80%; animation-delay: 2.1s; background: var(--accent-purple); }
.confetti:nth-child(9) { left: 90%; animation-delay: 2.4s; background: var(--accent-gold); }

/* --- Credit Popup Effects --- */
.credit-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
}

.credit-popup-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.credit-popup-overlay.closing {
    opacity: 0;
    pointer-events: none;
}

.credit-popup {
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    border: 3px solid var(--accent-green);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    transform: scale(0.8) rotate(-5deg);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 20px 60px rgba(0, 255, 127, 0.2);
}

.credit-popup-overlay.active .credit-popup {
    transform: scale(1) rotate(0deg);
    opacity: 1;
}

.credit-popup.positive {
    border-color: var(--accent-green);
    box-shadow: 0 20px 60px rgba(0, 255, 127, 0.2);
}

.credit-popup.negative {
    border-color: var(--error-red);
    box-shadow: 0 20px 60px rgba(255, 69, 58, 0.2);
}

.credit-coin {
    font-size: 24px;
    animation: creditCoinFloat 2s ease-in-out infinite;
}

.credit-coin:nth-child(1) { animation-delay: 0s; }
.credit-coin:nth-child(2) { animation-delay: 0.3s; }
.credit-coin:nth-child(3) { animation-delay: 0.6s; }

/* --- Animations --- */
@keyframes wheelCardGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes wheelTitleGlow {
    0%, 100% { 
        text-shadow: 0 0 15px var(--credit-glow), 0 0 30px var(--credit-glow);
        transform: scale(1);
    }
    50% { 
        text-shadow: 0 0 25px var(--credit-glow), 0 0 50px var(--credit-glow);
        transform: scale(1.02);
    }
}

@keyframes ringSpin {
    to { transform: rotate(360deg); }
}

@keyframes resultSlideIn {
    from { 
        opacity: 0; 
        transform: translateY(30px) scale(0.9); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0) scale(1); 
    }
}

@keyframes resultGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

@keyframes resultIconBounce {
    0% { transform: scale(0) rotate(-180deg); }
    50% { transform: scale(1.2) rotate(-90deg); }
    100% { transform: scale(1) rotate(0deg); }
}

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

@keyframes creditCoinFloat {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-10px) rotate(180deg); 
    }
}

/* --- Credit Confetti --- */
.credit-confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    z-index: 9998;
}

.credit-confetti {
    position: absolute;
    top: -10px;
    width: 6px;
    height: 6px;
    background: var(--credit-gold);
    border-radius: 2px;
    animation: creditConfettiFall 2.5s linear infinite;
}

@keyframes creditConfettiFall {
    0% {
        transform: translateY(-20px) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(360deg);
        opacity: 0;
    }
}
