/* === Shop === */

#view-shop {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    overflow-y: auto;
    height: 100%;
    box-sizing: border-box;
}

.shop-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.shop-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 1.2rem;
    color: var(--gold);
}

.shop-coins-display {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 1rem;
    font-weight: bold;
    color: var(--gold);
    white-space: nowrap;
}

/* Preview */
.shop-preview {
    display: flex;
    justify-content: center;
    padding: 8px 0;
}

.shop-avatar-preview .avatar-stack {
    width: 140px;
    height: 140px;
}

/* Tabs */
.shop-tabs {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.shop-tab {
    padding: 6px 14px;
    border-radius: 20px;
    border: 2px solid var(--border);
    background: var(--bg-card);
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.15s;
}

.shop-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Items grid */
.shop-items-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-bottom: 16px;
}

@media (min-width: 480px) {
    .shop-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Item card */
.shop-item-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 10px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-align: center;
    transition: border-color 0.15s;
}

.shop-item-card.owned {
    border-color: var(--primary);
}

.shop-item-card.equipped {
    border-color: var(--gold);
    background: color-mix(in srgb, var(--gold) 10%, var(--bg-card));
}

.shop-item-emoji {
    font-size: 2rem;
    line-height: 1;
}

.shop-item-name {
    font-size: 0.8rem;
    font-weight: bold;
    color: var(--text);
    line-height: 1.2;
}

.shop-item-price {
    font-size: 0.8rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 3px;
}

.shop-item-rarity {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.shop-item-rarity.rare   { color: #a78bfa; }
.shop-item-rarity.legendary { color: var(--gold); }

/* Buy / equip buttons */
.btn-buy {
    width: 100%;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s;
}

.btn-buy:active { transform: scale(0.96); }

.btn-buy--buy    { background: #22c55e; color: #fff; }
.btn-buy--poor   { background: var(--bg-card); color: var(--text-muted); border: 1px solid var(--border); cursor: not-allowed; }
.btn-buy--equip  { background: var(--primary); color: #fff; }
.btn-buy--unequip { background: #7c3aed; color: #fff; }

/* Buy flash animation */
@keyframes shopBuyFlash {
    0%   { transform: scale(1); }
    30%  { transform: scale(1.15); }
    60%  { transform: scale(0.95); }
    100% { transform: scale(1); }
}

.shop-item-card.bought-flash {
    animation: shopBuyFlash 0.4s ease;
}
