/* ========== МАГАЗИН КОСМЕТИКИ ========== */

/* === ОПТИМИЗАЦИЯ ДЛЯ ANDROID === */
html[data-platform="android"] .rarity-common,
html[data-platform="android"] .rarity-uncommon,
html[data-platform="android"] .rarity-rare,
html[data-platform="android"] .rarity-epic,
html[data-platform="android"] .rarity-legendary {
    box-shadow: none !important;
}

html[data-platform="android"] .rarity-legendary {
    background: none !important;
}

html[data-platform="android"] .cosmetic-item,
html[data-platform="android"] .cosmetic-preview {
    transition: none !important;
    transform: none !important;
}

html[data-platform="android"] .cosmetic-item:active,
html[data-platform="android"] .cosmetic-preview:active {
    transform: none !important;
}

/* Фон экрана магазина - роскошный фиолетовый */
#shop-screen {
    min-height: 100vh;
    background:
        url('../assets/bg-shop.svg') center top / cover no-repeat fixed,
        linear-gradient(180deg, #1a0a1a 0%, #2d1b3d 50%, #150a18 100%) !important;
}

/* ========== ВКЛАДКИ МАГАЗИНА ========== */
.shop-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    overflow: hidden;
}

.shop-tab-btn {
    background: transparent;
    color: #888;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    padding: 10px 12px;
    border-radius: 8px;
    flex: 1 1 0;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.95rem;
    letter-spacing: -0.3px;
}

.shop-tab-btn:active {
    transform: scale(0.95);
}

.shop-tab-btn.active {
    background: linear-gradient(145deg, #ffd700, #f0c000);
    color: #1a1a1a;
}

.shop-tab-content {
    animation: shopFadeIn 0.3s ease;
}

@keyframes shopFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========== ПРЕВЬЮ КОСМЕТИКИ ========== */
.cosmetic-preview {
    transition: all 0.3s ease;
}

.cosmetic-preview:active {
    transform: scale(1.05);
}

/* ========== РЕДКОСТИ КОСМЕТИКИ ========== */
.rarity-common {
    border: 2px solid #9ca3af !important;
    box-shadow: 0 0 10px rgba(156, 163, 175, 0.3);
}

.rarity-uncommon {
    border: 2px solid #3b82f6 !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.rarity-rare {
    border: 2px solid #8b5cf6 !important;
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.5);
}

.rarity-epic {
    border: 2px solid #f59e0b !important;
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.6);
}

.rarity-legendary {
    border: 2px solid #fbbf24 !important;
    box-shadow: 0 0 30px rgba(251, 191, 36, 0.7);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.1), rgba(245, 158, 11, 0.1));
}

/* ========== СТАТУСЫ ПРЕДМЕТОВ ========== */
.cosmetic-item.owned {
    opacity: 0.9;
}

.cosmetic-item.active-item {
    border-width: 3px !important;
    transform: scale(1.05);
}

/* ========== КАРТОЧКА ТОВАРА ========== */
.cosmetic-item {
    position: relative;
    border-radius: 12px;
    padding: 12px;
    background: rgba(30, 30, 40, 0.9);
    /* backdrop-filter убран для производительности Android */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cosmetic-item:active {
    transform: scale(0.98);
}

/* Бейдж редкости */
.cosmetic-item .rarity-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.5);
}

/* Название товара */
.cosmetic-item .item-name {
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 8px;
    text-align: center;
}

/* Цена товара */
.cosmetic-item .item-price {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 6px;
    font-weight: 700;
    color: #ffd700;
}

/* Кнопка покупки */
.cosmetic-item .buy-btn {
    width: 100%;
    margin-top: 10px;
    padding: 8px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    background: linear-gradient(145deg, #ffd700, #f0c000);
    color: #1a1a1a;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.cosmetic-item .buy-btn:active {
    transform: scale(0.95);
}

.cosmetic-item .buy-btn:disabled {
    background: #444;
    color: #888;
    cursor: not-allowed;
}

/* Статус "Куплено" / "Активно" */
.cosmetic-item .status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
}

.cosmetic-item .status-badge.owned-badge {
    background: rgba(34, 197, 94, 0.8);
    color: white;
}

.cosmetic-item .status-badge.active-badge {
    background: linear-gradient(145deg, #ffd700, #f0c000);
    color: #1a1a1a;
}

/* ========== БУСТЕРЫ (ЗЕЛЬЯ) ========== */
.shop-booster-card {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: rgba(31, 41, 55, 0.8);
    /* fallback for bg-gray-800/80 */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 12px;
}

.shop-booster-card .buy-booster-btn {
    width: 100%;
    margin-top: auto;
    padding: 10px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    color: white;
    cursor: pointer;
}