/* modal-bg-common.css - Общие стили для всех модальных окон с фоновым изображением */

/* ============ БАЗОВЫЕ СТИЛИ ЭКРАНОВ ============ */

.modal-bg-screen,
.wizard-tower-screen,
.blessing-tower-screen,
.arcane-lab-screen,
.time-generator-screen,
.pvp-arena-screen,
.guild-screen,
.shop-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-bg-screen.active,
.wizard-tower-screen.active,
.blessing-tower-screen.active,
.arcane-lab-screen.active,
.time-generator-screen.active,
.pvp-arena-screen.active,
.guild-screen.active,
.shop-screen.active {
    opacity: 1;
}

/* ============ ФОНОВЫЕ ИЗОБРАЖЕНИЯ ============ */

.modal-bg-image,
.tower-bg-image,
.blessing-bg-image,
.lab-bg-image,
.generator-bg-image,
.arena-bg-image,
.guild-bg-image,
.shop-bg-image {
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    image-rendering: crisp-edges;
    image-rendering: -webkit-optimize-contrast;
    user-select: none;
    pointer-events: none;
    animation: modalBgFadeIn 0.3s ease;
}

/* ============ ОВЕРЛЕИ ДЛЯ UI ============ */

.modal-ui-overlay,
.tower-ui-overlay,
.blessing-ui-overlay,
.lab-ui-overlay,
.generator-ui-overlay,
.arena-ui-overlay,
.guild-ui-overlay,
.shop-ui-overlay {
    position: absolute;
    pointer-events: none;
}

/* Со скроллом */
.guild-ui-overlay,
.shop-ui-overlay {
    overflow-y: auto;
    overflow-x: hidden;
}

.modal-ui-overlay > *,
.tower-ui-overlay > *,
.blessing-ui-overlay > *,
.lab-ui-overlay > *,
.generator-ui-overlay > *,
.arena-ui-overlay > *,
.guild-ui-overlay > *,
.shop-ui-overlay > * {
    pointer-events: auto;
}

/* ============ АНИМАЦИЯ ============ */

@keyframes modalBgFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ============ АДАПТАЦИЯ ============ */

@media (max-width: 768px) {
    .modal-bg-image,
    .tower-bg-image,
    .blessing-bg-image,
    .lab-bg-image,
    .generator-bg-image,
    .arena-bg-image,
    .guild-bg-image,
    .shop-bg-image {
        max-width: 95vw;
        max-height: 95vh;
    }
}

@media (max-height: 600px) {
    .modal-bg-image,
    .tower-bg-image,
    .blessing-bg-image,
    .lab-bg-image,
    .generator-bg-image,
    .arena-bg-image,
    .guild-bg-image,
    .shop-bg-image {
        max-width: 95vw;
        max-height: 95vh;
    }
}

/* ============ КНОПКИ В ОВЕРЛЕЯХ ============ */

.modal-ui-overlay button,
.tower-ui-overlay button,
.blessing-ui-overlay button,
.lab-ui-overlay button,
.generator-ui-overlay button,
.arena-ui-overlay button,
.guild-ui-overlay button,
.shop-ui-overlay button {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.modal-ui-overlay button:focus,
.tower-ui-overlay button:focus,
.blessing-ui-overlay button:focus,
.lab-ui-overlay button:focus,
.generator-ui-overlay button:focus,
.arena-ui-overlay button:focus,
.guild-ui-overlay button:focus,
.shop-ui-overlay button:focus {
    outline: none;
}

.modal-ui-overlay button:active,
.tower-ui-overlay button:active,
.blessing-ui-overlay button:active,
.lab-ui-overlay button:active,
.generator-ui-overlay button:active,
.arena-ui-overlay button:active,
.guild-ui-overlay button:active,
.shop-ui-overlay button:active {
    transform: scale(0.95) !important;
}

.modal-ui-overlay button:not(:disabled):hover,
.tower-ui-overlay button:not(:disabled):hover,
.blessing-ui-overlay button:not(:disabled):hover,
.lab-ui-overlay button:not(:disabled):hover,
.generator-ui-overlay button:not(:disabled):hover,
.arena-ui-overlay button:not(:disabled):hover,
.guild-ui-overlay button:not(:disabled):hover,
.shop-ui-overlay button:not(:disabled):hover {
    filter: brightness(1.2);
    transform: scale(1.02);
    transition: all 0.2s;
}

/* ============ СКРОЛЛБАР ============ */

.guild-ui-overlay::-webkit-scrollbar,
.shop-ui-overlay::-webkit-scrollbar {
    width: 6px;
}

.guild-ui-overlay::-webkit-scrollbar-track,
.shop-ui-overlay::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 3px;
}

.guild-ui-overlay::-webkit-scrollbar-thumb,
.shop-ui-overlay::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.5);
    border-radius: 3px;
}

.guild-ui-overlay::-webkit-scrollbar-thumb:hover,
.shop-ui-overlay::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.7);
}

/* ============ СПЕЦИФИЧНЫЕ СТИЛИ МАГАЗИНА ============ */

/* Карточка товара */
.shop-item-card {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-item-card:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}

.shop-item-card.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.shop-item-card.disabled:hover {
    transform: none;
}

/* Табы категорий */
.shop-tab {
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
}

.shop-tab:hover {
    background: rgba(255, 255, 255, 0.2);
}

.shop-tab.active {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    border-color: #ffd700;
    color: #1a1a2e;
    font-weight: bold;
}

/* Кнопка покупки */
.shop-buy-btn {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    border: none;
    border-radius: 8px;
    color: white;
    padding: 8px 16px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s ease;
}

.shop-buy-btn:hover {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    transform: scale(1.05);
}

.shop-buy-btn.premium {
    background: linear-gradient(135deg, #a855f7, #7c3aed);
}

.shop-buy-btn.premium:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
}

.shop-buy-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}
