/* ─── Reward Shop Page ────────────────────────────────────────────────────── */

.shop-page {
    padding-top: 130px;
    padding-bottom: 10rem;
}

/* Header */
.shop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.shop-header h1 {
    font-size: 3rem;
    font-weight: 900;
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

.shop-header p {
    color: var(--text-dim);
    font-size: 1.05rem;
}

.shop-balance {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--radius-lg);
    padding: 1.2rem 2rem;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.shop-balance i {
    font-size: 2rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.5));
}

.balance-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.balance-amount {
    display: block;
    font-size: 1.5rem;
    font-weight: 900;
    color: var(--accent);
    font-family: 'Outfit', sans-serif;
}

/* Tabs */
.shop-tabs {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.shop-tab {
    padding: 0.6rem 1.4rem;
    border-radius: 99px;
    border: 1px solid var(--border-bright);
    background: rgba(255, 255, 255, 0.02);
    color: var(--text-dim);
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--tr-spring);
}

.shop-tab:hover {
    border-color: var(--primary);
    color: var(--primary-light);
    background: rgba(99, 102, 241, 0.08);
}

.shop-tab.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 5px 20px var(--primary-glow);
}

/* Shop Grid */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.8rem;
    margin-bottom: 4rem;
}

/* Shop Item */
.shop-item {
    background: var(--glass-surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: var(--tr-spring);
    position: relative;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2), var(--glass-inner-glow);
    display: flex;
    flex-direction: column;
}

.shop-item:hover {
    transform: translateY(-8px);
    border-color: var(--item-glow, var(--primary));
    box-shadow: var(--shadow-lg), 0 0 30px color-mix(in srgb, var(--item-glow, var(--primary)) 40%, transparent);
}

.shop-item.owned {
    border-color: rgba(16, 185, 129, 0.4);
    opacity: 0.9;
}

.shop-item.cant-afford {
    opacity: 0.55;
}

.shop-item.cant-afford:hover {
    transform: none;
}

/* Preview Area */
.shop-item-preview {
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.shop-item-emoji {
    font-size: 3.5rem;
    filter: drop-shadow(0 4px 15px rgba(0,0,0,0.4));
    z-index: 2;
    position: relative;
    transition: transform 0.3s var(--tr-spring);
}

.shop-item:hover .shop-item-emoji {
    transform: scale(1.2) rotate(-5deg);
}

/* Item Body */
.shop-item-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.shop-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
}

.shop-item-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
}

.rarity-badge {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.7rem;
    border-radius: 99px;
    border: 1px solid;
    white-space: nowrap;
    flex-shrink: 0;
}

.shop-item-desc {
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.5;
    flex: 1;
}

.shop-item-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.shop-item-price {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
}

.shop-buy-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
}

.shop-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.owned-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--secondary);
    padding: 0.4rem 0.9rem;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 99px;
}

/* Sound play button overlay */
.play-sound-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(0,0,0,0.6);
    border: 1px solid var(--border-bright);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition: var(--tr-fast);
    backdrop-filter: blur(8px);
}

.play-sound-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

/* Owned Section */
.owned-section {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
    box-shadow: var(--shadow-md), var(--glass-inner-glow);
}

.owned-section h3 {
    font-size: 1.3rem;
    font-weight: 800;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.owned-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.owned-item-chip {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1.2rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-bright);
    border-radius: 99px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-dim);
    transition: var(--tr-spring);
    cursor: pointer;
}

.owned-item-chip:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.owned-item-chip.active {
    background: rgba(16, 185, 129, 0.15);
    border-color: var(--secondary);
    color: var(--text-white);
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.chip-action {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.05);
    margin-right: 8px;
    opacity: 0.7;
    white-space: nowrap;
}

.owned-item-chip.active .chip-action {
    background: var(--secondary);
    color: white;
    opacity: 1;
}

.no-owned {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ─── Purchase Modal ──────────────────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    z-index: 5000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.visible {
    opacity: 1;
}

.modal-card {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(24px);
    border: 1px solid var(--border-bright);
    border-radius: var(--radius-xl);
    padding: 3rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.6), var(--glass-inner-glow);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}

.modal-overlay.visible .modal-card {
    transform: translateY(0) scale(1);
}

.modal-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

.modal-card h3 {
    font-size: 1.6rem;
    font-weight: 900;
    margin-bottom: 0.75rem;
}

.modal-desc {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.modal-price {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.3rem;
    font-weight: 900;
    color: var(--accent);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 0.6rem 1.5rem;
    border-radius: 99px;
    margin-bottom: 2rem;
    font-family: 'Outfit', sans-serif;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.modal-actions .btn {
    flex: 1;
}

@media (max-width: 1024px) {
    .shop-header { padding-top: 2rem; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

@media (max-width: 768px) {
    .shop-page { padding-top: 100px; padding-bottom: 8rem; }
    .shop-header { flex-direction: column; text-align: center; gap: 1.5rem; }
    .shop-header h1 { font-size: 2.2rem; }
    .shop-balance { width: 100%; justify-content: center; padding: 1rem 1.5rem; }
    .shop-tabs { justify-content: center; gap: 0.5rem; }
    .shop-tab { padding: 0.5rem 1rem; font-size: 0.85rem; }
    .shop-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; }
    .modal-card { padding: 2rem 1.5rem; width: 95%; }
}

@media (max-width: 480px) {
    .shop-header h1 { font-size: 1.8rem; }
    .balance-amount { font-size: 1.3rem; }
    .shop-grid { grid-template-columns: 1fr; }
    .shop-item-preview { height: 100px; }
    .shop-item-emoji { font-size: 3rem; }
}

