/* ==========================================
   1. PŁYWAJĄCY PRZYCISK (FAB) I DYMEK (STARY DOBRY STYL)
   ========================================== */
.kako-wheel-tooltip {
    position: absolute;
    right: 100px; 
    top: 50%;
    transform: translateY(-50%);
    background-color: #E60000;
    color: white;
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 5px 15px rgba(230, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.kako-wheel-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -8px; 
    transform: translateY(-50%);
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent #E60000;
}

.kako-wheel-tooltip.show-tooltip {
    opacity: 1;
    visibility: visible;
    animation: pulseTooltip 2s infinite alternate;
}

@keyframes pulseTooltip {
    0% { transform: translateY(-50%) scale(1); }
    100% { transform: translateY(-50%) scale(1.05); box-shadow: 0 8px 25px rgba(230, 0, 0, 0.6); }
}

@media (max-width: 400px) {
    .kako-wheel-tooltip { display: none; }
}

.kako-wheel-fab {
    position: fixed;
    bottom: 30px;
    right: 30px; 
    width: 85px;
    height: 85px;
    background: transparent;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 9990;
    animation: premiumFloat 3s ease-in-out infinite;
}

.wheel-svg-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 0 10px rgba(230, 0, 0, 0.8));
    transition: all 0.5s ease;
}

.rotating-wheel-part {
    animation: spinWheel 8s linear infinite;
}

.kako-wheel-fab:hover .wheel-svg-icon {
    transform: scale(1.15); 
    filter: drop-shadow(0 0 25px rgba(255, 20, 20, 1)); 
}

.kako-wheel-fab:hover .rotating-wheel-part {
    animation: spinWheel 2s linear infinite; 
}

@keyframes spinWheel {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes premiumFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ==========================================
   2. NAKŁADKA MODAL - NOWOCZESNY DESIGN (GLASSMORPHISM)
   ========================================== */
.kako-wheel-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(5, 5, 5, 0.6);
    backdrop-filter: blur(15px); /* Miękkie rozmycie tła */
    -webkit-backdrop-filter: blur(15px);
    z-index: 100000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden;
    transition: all 0.4s ease;
}

.kako-wheel-overlay.show {
    opacity: 1; visibility: visible;
}

.kako-wheel-box {
    background: rgba(15, 15, 15, 0.85); /* Półprzezroczyste ciemne tło */
    border: 1px solid rgba(255, 255, 255, 0.05); /* Subtelna krawędź */
    width: 95%;
    max-width: 550px; /* Zgrabniejszy rozmiar */
    border-radius: 32px;
    padding: 3rem 2.5rem;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    display: flex; flex-direction: column; align-items: center;
    transform: scale(0.95) translateY(20px);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.kako-wheel-overlay.show .kako-wheel-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* Przycisk zamknięcia */
.kako-wheel-close {
    position: absolute; top: 20px; right: 20px;
    background: transparent; border: none;
    width: 40px; height: 40px; border-radius: 50%;
    color: #888; font-size: 1.2rem; cursor: pointer;
    display: flex; justify-content: center; align-items: center;
    transition: all 0.3s ease;
}

.kako-wheel-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    transform: rotate(90deg);
}

/* Teksty w nagłówku */
.kako-wheel-header { text-align: center; margin-bottom: 2.5rem; }
.kako-wheel-header h2 {
    color: #ffffff;
    font-size: 2.2rem;
    margin: 0 0 0.5rem 0;
    font-weight: 800;
    letter-spacing: 1px;
}
.kako-wheel-header p {
    color: #aaaaaa; font-size: 0.95rem; margin: 0 auto;
    max-width: 90%; line-height: 1.5;
}

/* ==========================================
   3. ANIMACJA WYGRANEJ (EPIC POP)
   ========================================== */
/* Ten kod aktywuje się automatycznie, gdy wylosujesz nagrodę */
#wheelDesc strong {
    display: inline-block;
    color: #FF1A1A !important;
    font-size: 1.5rem !important;
    font-weight: 900;
    text-shadow: 0 0 20px rgba(230, 0, 0, 0.6);
    /* Wystrzałowa animacja sprężyny po wygranej */
    animation: epicWinPop 1.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes epicWinPop {
    0% { transform: scale(0.3) translateY(20px); opacity: 0; filter: brightness(2); }
    50% { transform: scale(1.2) translateY(-5px); filter: brightness(1.5); }
    100% { transform: scale(1) translateY(0); filter: brightness(1); opacity: 1; }
}

/* ==========================================
   4. MIŁE DLA OKA KOŁO FORTUNY
   ========================================== */
.kako-wheel-container {
    position: relative;
    width: 380px; 
    height: 380px;
    margin-bottom: 3rem;
    border-radius: 50%;
}

/* Subtelna, obracająca się poświata za kołem */
.kako-wheel-container::before {
    content: '';
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, transparent 0%, rgba(230,0,0,0.3) 50%, transparent 100%);
    animation: spinWheel 4s linear infinite;
    z-index: -1;
    filter: blur(15px);
}

/* Strzałka (Minimalistyczna) */
.kako-wheel-arrow {
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 45px;
    color: #E60000;
    z-index: 20;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
    animation: arrowBop 2s infinite ease-in-out;
}

@keyframes arrowBop {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(3px); }
}

/* Właściwe koło */
.kako-wheel {
    width: 100%; height: 100%;
    border-radius: 50%;
    border: 6px solid #1a1a1a;
    box-shadow: 0 15px 30px rgba(0,0,0,0.5), inset 0 0 20px rgba(0,0,0,0.8);
    position: relative;
    overflow: hidden;
    background: #121212;
    transition: transform 6.5s cubic-bezier(0.15, 0.85, 0.15, 1);
}

.wheel-slice span {
    position: absolute;
    transform: rotate(18deg) translateY(-120px);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 0 1px 3px rgba(0,0,0,1);
    text-align: center;
    width: 80px;
}

@media (max-width: 500px) {
    .kako-wheel-container { width: 280px; height: 280px; }
    .kako-wheel-header h2 { font-size: 1.8rem; }
    .wheel-slice span { transform: rotate(18deg) translateY(-85px); font-size: 0.75rem; }
}

/* ==========================================
   5. NOWOCZESNY PRZYCISK I TIMER
   ========================================== */
.wheel-spin-btn {
    width: 85%;
    padding: 18px;
    border-radius: 16px;
    background: #E60000;
    color: white;
    border: none;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 1px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    
    box-shadow: 0 8px 20px rgba(230, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.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.2), transparent);
    transition: left 0.5s ease;
}

.wheel-spin-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    background: #ff1a1a;
    
    box-shadow: 0 12px 25px rgba(230, 0, 0, 0.4);
}

.wheel-spin-btn:hover:not(:disabled)::before {
    left: 100%;
}

.wheel-spin-btn:active:not(:disabled) {
    transform: translateY(1px);
    box-shadow: 0 4px 10px rgba(230, 0, 0, 0.2);
}

.wheel-spin-btn:disabled {
    background: #2a2a2a;
    color: #666;
    box-shadow: none;
    text-align: center;
    justify-content: center;
    cursor: not-allowed;
}

/* Plakietka odliczania */
.wheel-timer {
    color: #E60000;
    font-size: 0.95rem;
    margin-top: 1.5rem;
    font-weight: 600;
    min-height: 20px; 
    display: flex; align-items: center; justify-content: center; text-align: center; 
    background: rgba(230, 0, 0, 0.05); 
    padding: 8px 20px;
    border-radius: 12px;
    margin-left: auto; margin-right: auto;
    max-width: 90%; line-height: 1.4;
}
/* ==========================================
   MOBILE RESPONSIVENESS (RWD) - WHEEL FAB 
   ========================================== */

/* 1. TABLETY POZIOMO I MNIEJSZE (do 1024px) */
@media (max-width: 1024px) {
    .kako-wheel-fab {
        width: 70px; /* Nieco mniejszy na tablecie */
        height: 70px;
        bottom: 25px;
        right: 25px;
    }
}

/* 2. TELEFONY (do 768px) */
@media (max-width: 768px) {
    .kako-wheel-fab {
        width: 55px; /* Znacznie mniejszy przycisk na telefonie */
        height: 55px;
        bottom: 20px;
        right: 15px; /* Bliżej krawędzi, by nie przeszkadzać */
    }

    /* Wyłączamy całkowicie Dymek na telefonie (na dotyk to i tak źle działa) */
    .kako-wheel-tooltip {
        display: none !important;
    }

    /* Zmniejszamy unoszenie się (float) przycisku, żeby na telefonie aż tak nie rzucało się w oczy */
    @keyframes premiumFloat {
        0%, 100% { transform: translateY(0); }
        50% { transform: translateY(-8px); }
    }
    
    /* Wyłączamy powiększanie ikony przy hover na telefonie (telefony tego nie obsługują poprawnie) */
    .kako-wheel-fab:hover .wheel-svg-icon {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(230, 0, 0, 0.8));
    }
}

/* 3. BARDZO MAŁE TELEFONY (do 480px) */
@media (max-width: 480px) {
    .kako-wheel-fab {
        width: 48px; /* Naprawdę kompaktowe na najmniejszych ekranach */
        height: 48px;
        bottom: 15px;
        right: 10px;
    }
}