/*
 * Spin Wheel Custom Styles
 * Noob Alliance - Prize Wheel Page
 * 
 * Design: Cyberpunk Gaming Theme
 * Colors: Golden Yellow Primary with Dark Background
 */

/* ========================================
   CSS CUSTOM PROPERTIES
   ======================================== */
:root {
    /* Spin Wheel Colors */
    --sw-primary: #F1C40F;
    --sw-primary-hover: #E6B800;
    --sw-primary-light: #FFDD44;
    
    /* Accent Colors */
    --sw-purple: #8B5CF6;
    --sw-pink: #EC4899;
    --sw-cyan: #00D4FF;
    
    /* Backgrounds */
    --sw-bg-dark: #000000;
    --sw-bg-card: #1a1a1a;
    --sw-bg-elevated: #2a2a2a;
    
    /* Text */
    --sw-text-primary: #FFFFFF;
    --sw-text-secondary: rgba(255, 255, 255, 0.8);
    --sw-text-muted: rgba(255, 255, 255, 0.6);
    
    /* Effects */
    --sw-glow: 0 0 30px rgba(241, 196, 15, 0.6);
    --sw-glow-strong: 0 0 50px rgba(241, 196, 15, 0.8);
    --sw-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
    
    /* Transitions */
    --sw-transition: all 0.3s ease;
    --sw-transition-slow: all 0.5s ease;
    
    /* Border Radius */
    --sw-radius: 12px;
    --sw-radius-large: 20px;
    --sw-radius-round: 50%;
}

/* ========================================
   BASE CONTAINER
   ======================================== */
.spinwheel-main-container {
    background-color: var(--sw-bg-dark);
    color: var(--sw-text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    overflow: hidden;
    font-family: 'Urbanist', sans-serif;
}

/* Particle Background */
.spinwheel-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.spinwheel-content {
    top: 30px;
    margin-bottom: 30px;
    margin-top: 30px;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 600px;
}

/* ========================================
   HEADER SECTION
   ======================================== */
.spinwheel-header {
    text-align: center;
    margin-bottom: 1rem;
    padding-top: 0rem;
}

.spinwheel-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--sw-primary);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin: 0 0 1rem 0;
    line-height: 1.2;
}

/* Glitch Effect */
.spinwheel-title-glitch {
    position: relative;
    display: inline-block;
}

.spinwheel-title-glitch::before,
.spinwheel-title-glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
}

.spinwheel-title-glitch::before {
    color: var(--sw-cyan);
    animation: sw-glitch-1 3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
}

.spinwheel-title-glitch::after {
    color: var(--sw-pink);
    animation: sw-glitch-2 3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
}

@keyframes sw-glitch-1 {
    0%, 90%, 100% { opacity: 0; transform: translateX(0); }
    92%, 94% { opacity: 0.8; transform: translateX(-5px); }
}

@keyframes sw-glitch-2 {
    0%, 90%, 100% { opacity: 0; transform: translateX(0); }
    91%, 93% { opacity: 0.8; transform: translateX(5px); }
}

.spinwheel-subtitle {
    font-size: 1.1rem;
    color: var(--sw-text-secondary);
    margin: 0;
    font-weight: 400;
}

/* ========================================
   WHEEL CONTAINER
   ======================================== */
.spinwheel-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
    margin: 1rem 0 2rem 0;
}

/* Outer Decorative Ring */
.spinwheel-outer-ring {
    position: absolute;
    top: -15px;
    left: -15px;
    right: -15px;
    bottom: -15px;
    border-radius: var(--sw-radius-round);
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-hover) 50%, var(--sw-primary-light) 100%);
    padding: 4px;
    box-shadow: var(--sw-glow-strong);
}

.spinwheel-outer-ring::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    border-radius: var(--sw-radius-round);
    background: var(--sw-bg-dark);
}

/* Light Bulbs Around Wheel */
.spinwheel-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--sw-radius-round);
}

.spinwheel-light {
    position: absolute;
    width: 12px;
    height: 12px;
    border-radius: var(--sw-radius-round);
    background: var(--sw-primary);
    box-shadow: 0 0 10px var(--sw-primary), 0 0 20px var(--sw-primary);
    top: 50%;
    left: 50%;
    transform-origin: center;
    transform: 
        rotate(calc(var(--light-index) * 15deg)) 
        translateY(calc(-50% - 220px)) 
        translateX(-50%);
    animation: sw-light-blink 1s ease-in-out infinite;
    animation-delay: calc(var(--light-index) * 0.05s);
}

@keyframes sw-light-blink {
    0%, 100% { 
        opacity: 1; 
        box-shadow: 0 0 10px var(--sw-primary), 0 0 20px var(--sw-primary);
    }
    50% { 
        opacity: 0.4; 
        box-shadow: 0 0 5px var(--sw-primary);
    }
}

/* When spinning, lights chase */
.spinwheel-container.spinning .spinwheel-light {
    animation: sw-light-chase 0.3s linear infinite;
}

@keyframes sw-light-chase {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* Wheel Wrapper */
.spinwheel-wheel-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--sw-radius-round);
    overflow: hidden;
    box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

/* Canvas */
.spinwheel-canvas {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 5s cubic-bezier(0.17, 0.67, 0.12, 0.99);
}

/* Center Cap */
.spinwheel-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: var(--sw-radius-round);
    background: linear-gradient(135deg, var(--sw-bg-elevated) 0%, var(--sw-bg-card) 100%);
    border: 4px solid var(--sw-primary);
    box-shadow: var(--sw-glow), inset 0 0 20px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.spinwheel-center-inner {
    width: 60px;
    height: 60px;
    border-radius: var(--sw-radius-round);
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.5);
}

.spinwheel-center-logo {
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--sw-bg-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   POINTER
   ======================================== */
.spinwheel-pointer {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 80px;
    z-index: 20;
    filter: drop-shadow(0 0 10px rgba(241, 196, 15, 0.8));
    animation: sw-pointer-pulse 2s ease-in-out infinite;
}

@keyframes sw-pointer-pulse {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.05); }
}

.spinwheel-pointer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(180deg);
}

/* ========================================
   SPIN BUTTON
   ======================================== */
.spinwheel-button-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.spinwheel-spin-btn {
    position: relative;
    padding: 1rem 3rem;
    font-size: 1.2rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--sw-bg-dark);
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-hover) 100%);
    border: none;
    border-radius: var(--sw-radius);
    cursor: pointer;
    overflow: hidden;
    transition: var(--sw-transition);
    box-shadow: var(--sw-glow);
    font-family: 'Urbanist', sans-serif;
}

.spinwheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: var(--sw-glow-strong);
}

.spinwheel-spin-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.spinwheel-spin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.spinwheel-btn-text {
    position: relative;
    z-index: 2;
}

.spinwheel-btn-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: translateX(-100%);
    transition: none;
}

.spinwheel-spin-btn:hover:not(:disabled) .spinwheel-btn-glow {
    animation: sw-btn-shine 0.6s ease-out;
}

@keyframes sw-btn-shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Sound Toggle */
.spinwheel-sound-toggle {
    width: 48px;
    height: 48px;
    border-radius: var(--sw-radius);
    background: var(--sw-bg-card);
    border: 2px solid var(--sw-primary);
    color: var(--sw-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--sw-transition);
}

.spinwheel-sound-toggle:hover {
    background: var(--sw-primary);
    color: var(--sw-bg-dark);
}

.spinwheel-sound-toggle svg {
    width: 24px;
    height: 24px;
}

.spinwheel-sound-toggle.muted .sound-on-icon {
    display: none;
}

.spinwheel-sound-toggle.muted .sound-off-icon {
    display: block;
}

/* Already Spun Message */
.spinwheel-already-spun {
    text-align: center;
    padding: 1.5rem;
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid var(--sw-primary);
    border-radius: var(--sw-radius);
    margin-top: 1rem;
}

.spinwheel-already-spun p {
    margin: 0;
    color: var(--sw-text-secondary);
    font-size: 1rem;
}

/* ========================================
   WIN MODAL
   ======================================== */
.spinwheel-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--sw-transition);
}

.spinwheel-modal.active {
    opacity: 1;
    visibility: visible;
}

.spinwheel-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
}

.spinwheel-modal-content {
    position: relative;
    width: 90%;
    max-width: 500px;
    transform: scale(0.8) translateY(30px);
    transition: var(--sw-transition-slow);
}

.spinwheel-modal.active .spinwheel-modal-content {
    transform: scale(1) translateY(0);
}

.spinwheel-modal-inner {
    position: relative;
    background: linear-gradient(135deg, var(--sw-bg-card) 0%, var(--sw-bg-elevated) 100%);
    border: 2px solid var(--sw-primary);
    border-radius: var(--sw-radius-large);
    padding: 3rem 2rem;
    box-shadow: var(--sw-glow-strong), 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

/* Confetti Canvas */
.spinwheel-confetti {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

/* Close Button */
.spinwheel-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: var(--sw-radius-round);
    background: transparent;
    border: 2px solid var(--sw-text-muted);
    color: var(--sw-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--sw-transition);
    z-index: 10;
}

.spinwheel-modal-close:hover {
    border-color: var(--sw-primary);
    color: var(--sw-primary);
    transform: rotate(90deg);
}

.spinwheel-modal-close svg {
    width: 20px;
    height: 20px;
}

/* Win Content */
.spinwheel-win-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.spinwheel-win-badge {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    border-radius: var(--sw-radius-round);
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sw-glow);
    animation: sw-badge-bounce 1s ease-in-out infinite;
}

@keyframes sw-badge-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.spinwheel-win-icon {
    font-size: 2.5rem;
}

.spinwheel-win-title {
    font-size: 2rem;
    font-weight: 900;
    color: var(--sw-primary);
    margin: 0 0 0.5rem 0;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.spinwheel-win-subtitle {
    font-size: 1rem;
    color: var(--sw-text-muted);
    margin: 0 0 1.5rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Prize Display */
.spinwheel-prize-display {
    margin-bottom: 2rem;
}

.spinwheel-prize-image-container {
    width: 180px;
    height: 180px;
    margin: 0 auto 1rem;
    border-radius: var(--sw-radius);
    background: var(--sw-bg-dark);
    border: 2px solid var(--sw-primary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--sw-glow);
}

.spinwheel-prize-image-container.no-image {
    display: none;
}

.spinwheel-prize-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.spinwheel-prize-name {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--sw-text-primary);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 0 20px rgba(241, 196, 15, 0.5);
}

/* Claim Button */
.spinwheel-claim-btn {
    padding: 1rem 2.5rem;
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--sw-bg-dark);
    background: linear-gradient(135deg, var(--sw-primary) 0%, var(--sw-primary-hover) 100%);
    border: none;
    border-radius: var(--sw-radius);
    cursor: pointer;
    transition: var(--sw-transition);
    box-shadow: var(--sw-glow);
    font-family: 'Urbanist', sans-serif;
}

.spinwheel-claim-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--sw-glow-strong);
}

/* Featured Prizes */
.spinwheel-featured-section {
    width: 100%;
    max-width: 700px;
    margin: 2rem auto 0;
    padding: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border-radius: var(--sw-radius);
    border: 1px solid rgba(241, 196, 15, 0.2);
    box-shadow: var(--sw-glow);
}

.spinwheel-featured-copy {
    text-align: center;
    margin-top: 20px;
    /* margin-bottom: 1.5rem; */
    /* position: absolute;
    bottom: 0;
    right: 24%; */
}

.spinwheel-featured-eyebrow {
    margin: 0;
    font-size: 13px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--sw-primary);
    font-weight: 700;
}

.spinwheel-featured-description {
    margin: 0.5rem 0 0;
    font-size: 1rem;
    color: var(--sw-text-muted);
}

.spinwheel-featured-grid {
    display: flex;
    justify-content: center;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
}

.spinwheel-featured-card {
    text-align: center;
}

.spinwheel-featured-image {
    width: 140px;
    height: 140px;
    margin: 0 auto 1rem;
    border-radius: var(--sw-radius);
    background: var(--sw-bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px solid var(--sw-primary);
}

.spinwheel-featured-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.spinwheel-featured-name {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--sw-text-primary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ========================================
   SPINNING STATE
   ======================================== */
.spinwheel-container.spinning .spinwheel-pointer {
    animation: sw-pointer-shake 0.1s linear infinite;
}

@keyframes sw-pointer-shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-50%) rotate(2deg); }
    75% { transform: translateX(-50%) rotate(-2deg); }
}

.spinwheel-container.spinning .spinwheel-center {
    animation: sw-center-pulse 0.5s ease-in-out infinite;
}

@keyframes sw-center-pulse {
    0%, 100% { box-shadow: var(--sw-glow), inset 0 0 20px rgba(0, 0, 0, 0.5); }
    50% { box-shadow: var(--sw-glow-strong), inset 0 0 20px rgba(0, 0, 0, 0.5); }
}

.spinwheel-center-logo img {
    top: 9px;
    position: relative;
}
/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media only screen and (min-width: 769px) {
    .spinwheel-hero {
        display: none;
    }
}
@media (max-width: 768px) {
    .spinwheel-center-logo img {
        top: 7px;
        position: relative;
        width: 30px;
        height: 25px;
    }

    .spinwheel-main-container {
        padding: 1.5rem 1rem;
        min-height: unset;
        /* min-height: calc(100vh - 225px); */
    }
    
    .spinwheel-title {
        font-size: 2rem;
        letter-spacing: 2px;
    }
    
    .spinwheel-subtitle {
        font-size: 0.95rem;
    }
    
    .spinwheel-container {
        max-width: 320px;
    }
    
    .spinwheel-outer-ring {
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }
    
    .spinwheel-light {
        width: 8px;
        height: 8px;
        transform: 
            rotate(calc(var(--light-index) * 15deg)) 
            translateY(calc(-50% - 160px)) 
            translateX(-50%);
    }
    
    .spinwheel-center {
        width: 60px;
        height: 60px;
    }
    
    .spinwheel-center-inner {
        width: 45px;
        height: 45px;
    }
    
    .spinwheel-center-logo {
        font-size: 1.1rem;
    }
    
    .spinwheel-pointer {
        width: 40px;
        height: 65px;
        top: -22px;
    }
    
    .spinwheel-spin-btn {
        padding: 10px 10px;
        font-size: 12px;
    }
    
    .spinwheel-button-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .spinwheel-modal-inner {
        padding: 2rem 1.5rem;
    }

    .spinwheel-featured-section {
        padding: 1.5rem;
        margin-top: 1.5rem;
    }

    .spinwheel-featured-grid {
        gap: 1rem;
    }
    
    .spinwheel-win-title {
        font-size: 1.5rem;
    }
    
    .spinwheel-prize-image-container {
        width: 140px;
        height: 140px;
    }
    
    .spinwheel-prize-name {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .spinwheel-title {
        font-size: 1.6rem;
    }
    
    .spinwheel-container {
        max-width: 280px;
    }
    
    .spinwheel-light {
        transform: 
            rotate(calc(var(--light-index) * 15deg)) 
            translateY(calc(-50% - 140px)) 
            translateX(-50%);
    }
    
    .spinwheel-center {
        width: 50px;
        height: 50px;
    }
    
    .spinwheel-center-inner {
        width: 38px;
        height: 38px;
    }
    
    .spinwheel-center-logo {
        font-size: 1rem;
    }
}

/* ========================================
   REDUCED MOTION SUPPORT
   ======================================== */
@media (prefers-reduced-motion: reduce) {
    .spinwheel-title-glitch::before,
    .spinwheel-title-glitch::after,
    .spinwheel-light,
    .spinwheel-pointer,
    .spinwheel-btn-glow,
    .spinwheel-win-badge {
        animation: none !important;
    }
    
    .spinwheel-canvas {
        transition-duration: 2s !important;
    }
}

/* ========================================
   HIGH CONTRAST MODE
   ======================================== */
@media (prefers-contrast: high) {
    .spinwheel-outer-ring {
        border: 3px solid var(--sw-primary);
    }
    
    .spinwheel-modal-inner {
        border-width: 3px;
    }
    
    .spinwheel-spin-btn,
    .spinwheel-claim-btn {
        border: 2px solid var(--sw-bg-dark);
    }
}

