/* --- КНОПКА-КУЛЬКА (ВИКЛИК НА САЙТІ) --- */
.roulette-bubble {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 9999;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #f97316, #ea580c);
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(249, 115, 22, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.15);
}

.roulette-bubble:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(249, 115, 22, 0.6);
}

.roulette-icon-wrapper { position: relative; font-size: 30px; }

.roulette-badge {
    position: absolute;
    top: -10px; right: -10px;
    background: #ef4444; color: white;
    font-size: 11px; font-weight: 900;
    width: 22px; height: 22px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid #0f0f11;
    animation: pulseBadge 2s infinite;
}

@keyframes pulseBadge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* --- ПОВНОЕКРАННЕ МОДАЛЬНЕ ВІКНО (ДЛЯ ГОСТЕЙ) --- */
.roulette-fullscreen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at center, rgba(30, 30, 35, 0.95) 0%, rgba(10, 10, 12, 0.98) 100%);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    font-family: 'Manrope', sans-serif;
}

.roulette-fullscreen.active {
    opacity: 1;
    visibility: visible;
}

.fs-close-btn {
    position: absolute;
    top: 30px; right: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-size: 30px;
    width: 50px; height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
    display: flex; align-items: center; justify-content: center;
}

.fs-close-btn:hover {
    background: #f97316;
    border-color: #f97316;
    transform: rotate(90deg);
}

/* Контент центру */
.fs-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 600px;
    padding: 20px;
}

.fs-header { text-align: center; margin-bottom: 40px; }
.fs-subtitle { color: #f97316; font-size: 1.2rem; font-weight: 800; text-transform: uppercase; letter-spacing: 2px; }
.fs-title { color: #fff; font-size: 3.5rem; font-weight: 900; margin: 10px 0 0; line-height: 1.1; text-shadow: 0 0 20px rgba(249, 115, 22, 0.3); }

/* Колесо */
.fs-wheel-wrapper {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1 / 1;
    margin-bottom: 40px;
}

.fs-pointer {
    position: absolute;
    top: -25px; left: 50%;
    transform: translateX(-50%) rotate(180deg);
    width: 50px; height: 50px;
    z-index: 10;
    filter: drop-shadow(0 -5px 10px rgba(0,0,0,0.5));
}

canvas[id^="rouletteCanvas"] {
    width: 100%; height: 100%;
    border-radius: 50%;
    box-shadow: 0 0 0 10px #1f1f22, 0 20px 60px rgba(0,0,0,0.8);
    transition: transform 4s cubic-bezier(0.15, 0.85, 0.15, 1);
}

/* Футер */
.fs-footer {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.fs-message {
    color: #cbd5e1;
    font-size: 1.2rem;
    min-height: 35px;
}

.fs-spin-btn {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    padding: 20px 60px;
    border-radius: 100px;
    font-weight: 900;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: 0.3s;
    box-shadow: 0 10px 30px rgba(249, 115, 22, 0.4);
    width: 100%;
    max-width: 400px;
}

.fs-spin-btn:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 40px rgba(249, 115, 22, 0.6);
}

.fs-spin-btn.disabled {
    background: #2a2a2e; color: #666;
    cursor: not-allowed; transform: none; box-shadow: none;
}

/* Кнопки вибору товару / бонусів */
.choice-btn-group {
    display: flex;
    gap: 15px;
    width: 100%;
    max-width: 550px;
    margin-top: 10px;
    justify-content: center;
}

.choice-btn-group .fs-spin-btn {
    width: 50%;
    padding: 18px 10px;
    font-size: 0.95rem;
    line-height: 1.2;
    border-radius: 15px;
}

.btn-take {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    box-shadow: 0 10px 30px rgba(34, 197, 94, 0.3);
}

.btn-take:hover {
    box-shadow: 0 15px 40px rgba(34, 197, 94, 0.5);
}

.btn-exchange {
    background: linear-gradient(135deg, #f97316, #ea580c);
}


/* --- ІГРОВА ЗОНА В ОСОБИСТОМУ КАБІНЕТІ --- */
.games-hub-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    padding: 20px 0;
    font-family: 'Manrope', sans-serif;
}

@media(min-width: 992px) {
    .games-hub-container {
        grid-template-columns: 280px 1fr;
    }
}

.games-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #131316;
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 20px;
    border-radius: 20px;
    height: fit-content;
}

.game-nav-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    color: #94a3b8;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.game-nav-item:hover, .game-nav-item.active {
    background: rgba(249, 115, 22, 0.1);
    color: #fff;
    border-color: rgba(249, 115, 22, 0.2);
}

.game-nav-item .game-icon {
    font-size: 20px;
}

/* ПЕРЕМИКАЧ РУЛЕТОК (Щоденна / Преміум) */
.roulette-type-selector {
    display: flex;
    gap: 10px;
    background: rgba(255, 255, 255, 0.03);
    padding: 6px;
    border-radius: 100px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.type-btn {
    flex: 1;
    background: transparent;
    border: none;
    color: #94a3b8;
    padding: 12px 20px;
    border-radius: 100px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.type-btn.active {
    background: #f97316;
    color: white;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

.type-btn .badge {
    background: rgba(255,255,255,0.1);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
}

.type-btn.active .badge {
    background: white;
    color: #f97316;
}

.active-game-viewport {
    background: radial-gradient(circle at center, #1e1e23 0%, #0f0f12 100%);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.active-game-viewport .fs-title {
    font-size: 2.5rem;
}

.active-game-viewport .fs-wheel-wrapper {
    max-width: 380px;
    margin-bottom: 30px;
}

.active-game-viewport .fs-pointer {
    top: -20px;
    width: 44px;
    height: 44px;
}

.active-game-viewport .fs-spin-btn {
    font-size: 1.1rem;
    padding: 16px 40px;
    max-width: 350px;
}


/* --- КРИТИЧНА АДАПТИВНІСТЬ ДЛЯ МОБІЛЬНИХ ПРИСТРОЇВ (SMARTPHONES) --- */
@media (max-width: 768px) {
    /* Налаштування повноекранного контейнера */
    .fs-content {
        padding: 10px;
        justify-content: center;
        max-width: 100%;
    }

    .fs-header {
        margin-bottom: 20px;
    }

    .fs-subtitle {
        font-size: 0.95rem;
        letter-spacing: 1px;
    }

    .fs-title {
        font-size: 2.2rem;
        line-height: 1.2;
    }

    /* Адаптація та гнучкість Колеса на маленьких екранах */
    .fs-wheel-wrapper {
        max-width: 290px; /* Затискаємо максимальний розмір коліщатка */
        margin-bottom: 25px;
        width: 85vw; /* Займає 85% ширини екрану мобільного */
    }

    .fs-pointer {
        top: -18px;
        width: 38px;
        height: 38px;
    }

    /* Оновлення стилю кнопок та текстових повідомлень */
    .fs-message {
        font-size: 1rem;
        min-height: auto;
        margin-bottom: 5px;
        padding: 0 10px;
    }

    .fs-spin-btn {
        font-size: 1.1rem;
        padding: 14px 30px;
        max-width: 100%;
        border-radius: 50px;
    }

    /* Перебудова кнопок вибору (Забрати приз / Обміняти на бонуси) */
    .choice-btn-group {
        flex-direction: column; /* Ставимо кнопки одну під одну замість рядка */
        gap: 10px;
        width: 100%;
        padding: 0 15px;
    }

    .choice-btn-group .fs-spin-btn {
        width: 100%; /* Кожна кнопка займає повну ширину */
        padding: 14px 10px;
        font-size: 1rem;
    }

    /* Адаптація блоку в особистому кабінеті */
    .active-game-viewport {
        padding: 25px 15px;
        border-radius: 16px;
    }

    .active-game-viewport .fs-title {
        font-size: 1.8rem;
    }

    .active-game-viewport .fs-wheel-wrapper {
        max-width: 260px;
    }

    /* Мобільний перемикач типів рулеток (Щоденна / Преміум) */
    .roulette-type-selector {
        flex-direction: row; /* Залишаємо в рядок, але зменшуємо відступи */
        padding: 4px;
        margin-bottom: 20px;
    }

    .type-btn {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .type-btn .badge {
        padding: 1px 6px;
        font-size: 0.7rem;
    }

    .fs-close-btn {
        top: 15px;
        right: 15px;
        width: 38px;
        height: 38px;
        font-size: 22px;
    }
}

/* Додатковий фікс для супер-маленьких екранів (iPhone SE, старі телефони) */
@media (max-width: 375px) {
    .fs-title {
        font-size: 1.8rem;
    }
    .fs-wheel-wrapper {
        max-width: 240px;
    }
    .type-btn {
        font-size: 0.75rem;
        padding: 8px 6px;
    }
}