/* ==================== SHOP POPUP STYLES ==================== */
/* Theme: Dark-space fantasy + gold reward accents */

.shop-overlay {
    --shop-gold: #FFD66E;
    --shop-gold-soft: #ffef9f;
    --shop-orange: #ff8c00;
    --shop-ink: #0f0b1c;
    --shop-violet-1: #1e2260;
    --shop-violet-2: #2f1b67;
    --shop-violet-3: #4a146e;
    --shop-cyan: #7cf2ff;
    --shop-text-main: #f4efff;
    --shop-text-muted: #c8bfdf;
    --shop-text-on-gold: #3f255d;

    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    opacity: 1;
    transition: opacity 0.25s ease;
}

.shop-overlay.hidden {
    display: none;
    opacity: 0;
}

.shop-container {
    position: relative;
    width: min(92vw, 460px);
    height: min(90vh, 860px);
    border-radius: 30px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-top: 78px;
    font-family: 'Outfit', sans-serif;
    background:
        url('./assets/slots/common/shop_character.png'),
        radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0) 34%),
        radial-gradient(circle at 100% 24%, rgba(196, 118, 255, 0.14) 0%, rgba(196, 118, 255, 0) 40%),
        linear-gradient(180deg, rgba(9, 8, 26, 0.14), rgba(9, 8, 26, 0.3)),
        linear-gradient(180deg, #5b356f 0%, #6a3f91 44%, #6433a4 100%);
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat;
    background-size: 120px auto, auto, auto, 100% 100%, 100% 100%;
    background-position: left 5px top 10px, center top, right top, center center, center center;
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow:
        0 10px 40px rgba(0, 0, 0, 0.5),
        0 0 0 2px rgba(255, 255, 255, 0.1) inset;
}

.shop-container::before {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    pointer-events: none;
}

.shop-container::after {
    content: '';
    position: absolute;
    top: 86px;
    left: 50px;
    right: 50px;
    height: 1px;
    background: linear-gradient(90deg, rgba(255, 214, 110, 0), rgba(255, 214, 110, 0.58), rgba(255, 214, 110, 0));
    pointer-events: none;
}

.shop-content {
    flex: 1;
    padding: 8px 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow-y: auto;
    overflow-x: hidden;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.shop-title {
    position: absolute;
    top: 35px;
    left: 105px;
    right: 78px;
    margin: 0;
    min-width: 0;
    height: 42px;
    padding: 0 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 30px;
    font-weight: 900;
    color: #f3d890;
    background: transparent;
    border: none;
    border-radius: 10px;
    box-shadow: none;
    text-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    z-index: 11;
    transform: translateY(5px);
}

.shop-title::after {
    content: none;
}

.shop-title::before {
    content: none;
}

.shop-products-grid {
    width: 100%;
    padding-bottom: 16px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
    margin-top: auto;
}

.shop-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 208px;
    padding: 34px 11px 12px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.09);
    background:
        radial-gradient(circle at 82% 12%, rgba(148, 128, 186, 0.14) 0%, rgba(148, 128, 186, 0) 42%),
        linear-gradient(165deg, rgba(53, 43, 78, 0.9) 0%, rgba(41, 33, 64, 0.94) 55%, rgba(30, 24, 50, 0.97) 100%);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
    color: var(--shop-text-main);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.2s ease;
    isolation: isolate;
    transform-origin: center;
    position: relative;
}

.shop-product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 70%;
    height: 100%;
    background: linear-gradient(95deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
    transform: skewX(-22deg);
    transition: left 0.45s ease;
    pointer-events: none;
    z-index: -1;
}

.shop-product-card::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    top: 10px;
    height: 12px;
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.shop-product-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 214, 110, 0.35);
    box-shadow:
        0 16px 32px rgba(0, 0, 0, 0.44),
        0 0 14px rgba(132, 114, 168, 0.16);
}

.shop-product-card:hover::before {
    left: 145%;
}

.shop-product-card:active {
    transform: translateY(-1px) scale(0.99);
}

.shop-product-card:has(.shop-price-btn:disabled):hover {
    transform: none;
    border-color: rgba(255, 255, 255, 0.09);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.35),
        0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.shop-badge {
    position: absolute;
    top: 8px;
    left: 11px;
    height: 23px;
    padding: 0 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff7043 0%, #ff4500 100%);
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 4px 10px rgba(255, 69, 0, 0.28);
}

.shop-badge-text {
    font-size: 10px;
    font-weight: 800;
    color: #fff8e9;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.shop-product-image {
    width: 100%;
    height: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    margin-bottom: 0;
}

.shop-product-image img {
    width: auto;
    height: 100%;
    object-fit: contain;
    filter:
        drop-shadow(0 2px 0 rgba(255, 255, 255, 0.18)) drop-shadow(0 0 12px rgba(255, 215, 0, 0.45));
    animation: shopGemPulse 1.9s ease-in-out infinite;
}

.shop-gem-amount {
    margin: 0;
    text-align: center;
    font-size: 20px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.3px;
    color: var(--shop-text-main);
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.6);
    margin-bottom: 2px;
}

.shop-price-btn {
    width: 100%;
    height: 34px;
    margin-top: auto;
    border: 0;
    border-radius: 11px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.16s ease, filter 0.18s ease, box-shadow 0.2s ease;
    background: linear-gradient(135deg, #FFD66E 0%, #FFBE3F 100%);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.28) inset;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.28);
}

.shop-price-btn::before {
    content: '';
    position: absolute;
    left: 3px;
    right: 3px;
    top: 2px;
    height: 45%;
    border-radius: 9px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0));
    pointer-events: none;
}

.shop-price-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.06);
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.38),
        0 0 0 1px rgba(255, 255, 255, 0.28) inset;
}

.shop-price-btn:active:not(:disabled) {
    transform: translateY(2px);
    box-shadow: 0 3px 9px rgba(0, 0, 0, 0.3);
}

.shop-price-btn:disabled {
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
    filter: saturate(0.2);
}

.shop-price-text {
    font-size: 14px;
    font-weight: 900;
    letter-spacing: 0.5px;
    color: var(--shop-text-on-gold);
    text-transform: uppercase;
}

.shop-price-btn:disabled .shop-price-text {
    color: #9f97b8;
}

.shop-close-btn {
    position: absolute;
    top: 17px;
    right: 17px;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 50%;
    padding: 0;
    z-index: 12;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0.08));
    box-shadow: 0 10px 14px rgba(0, 0, 0, 0.35);
    transition: transform 0.16s ease, filter 0.16s ease;
}

.shop-close-btn img {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

.shop-close-btn:hover {
    transform: translateY(-1px) scale(1.03);
    filter: brightness(1.05);
}

.shop-close-btn:active {
    transform: translateY(2px) scale(0.98);
}

#shop-icon-wrapper {
    cursor: pointer;
}

#shop-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#shop-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.18s ease, filter 0.2s ease;
    filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.35));
}

#shop-icon-wrapper:hover #shop-icon img {
    transform: scale(1.08);
    filter:
        drop-shadow(0 4px 8px rgba(0, 0, 0, 0.45)) drop-shadow(0 0 10px rgba(255, 215, 0, 0.58));
}

.shop-content::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.shop-product-card[data-product-id="1"] {
    order: -1;
    border-color: rgba(255, 214, 110, 0.5);
    background:
        radial-gradient(circle at 84% 8%, rgba(148, 128, 186, 0.16) 0%, rgba(148, 128, 186, 0) 48%),
        linear-gradient(165deg, rgba(58, 47, 86, 0.92) 0%, rgba(46, 37, 72, 0.95) 56%, rgba(34, 28, 56, 0.98) 100%);
    box-shadow:
        0 16px 30px rgba(0, 0, 0, 0.42),
        0 0 24px rgba(255, 215, 0, 0.22);
}

.shop-product-card[data-product-id="1"] .shop-price-btn:not(:disabled) {
    background: linear-gradient(135deg, #FFD66E 0%, #FFBE3F 100%);
    box-shadow:
        0 4px 10px rgba(0, 0, 0, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.28) inset;
}

.shop-product-card[data-product-id="1"] .shop-price-btn:not(:disabled) .shop-price-text {
    color: var(--shop-text-on-gold);
}

@keyframes shopGemPulse {
    0% {
        transform: translateY(0) scale(1);
    }

    50% {
        transform: translateY(-2px) scale(1.04);
    }

    100% {
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 600px) {
    .shop-container {
        width: min(95vw, 440px);
        height: min(92vh, 760px);
        padding-top: 72px;
        background-size: 100px auto, auto, auto, 100% 100%, 100% 100%;
        background-position: left 6px top 12px, center top, right top, center center, center center;
    }

    .shop-content {
        padding: 6px 14px 18px;
    }

    .shop-title {
        top: 14px;
        left: 14px;
        right: 60px;
        height: 38px;
        padding: 0 10px;
        font-size: 30px;
    }

    .shop-products-grid {
        gap: 10px;
    }

    .shop-product-card {
        height: 192px;
        padding: 30px 9px 10px;
    }

    .shop-product-image {
        height: 72px;
    }

    .shop-gem-amount {
        font-size: 18px;
    }

    .shop-close-btn {
        width: 38px;
        height: 38px;
        top: 14px;
        right: 14px;
    }
}
