/* ============================================
   KendoCraft :: Store — refined visual pass
   Same palette: #8a2be2 / #b967ff / #16111f
   ============================================ */

:root {
    --accent-1: #8a2be2;
    --accent-2: #b967ff;
    --surface: #16111f;
    --surface-soft: rgba(185, 103, 255, 0.06);
    --border-soft: rgba(185, 103, 255, 0.25);
    --border-strong: rgba(185, 103, 255, 0.55);
    --glow: 0 0 24px rgba(185, 103, 255, 0.35);
}

/* ---------- Section & title ---------- */

@font-face {
    font-family: 'Minecraft';
    src: url('../fonts/MinecraftTen.ttf') format('truetype');
    font-display: swap;
}

.store-section {
    padding: 70px 0 90px;
    position: relative;
}

.store-title {
    position: relative;
    text-align: center;
    font-family: 'Minecraft Ten', sans-serif;
    font-size: 3rem;
    letter-spacing: 0.08em;
    margin-bottom: 16px;
    color: #fff;
    text-shadow: 0 0 40px rgba(185, 103, 255, 0.25);
}

/* pixel-block accent under the title, nodding to the game's own UI grain */
.store-title::after {
    content: "";
    display: block;
    width: 96px;
    height: 6px;
    margin: 22px auto 0;
    background: repeating-linear-gradient(
        90deg,
        var(--accent-1) 0 14px,
        var(--accent-2) 14px 28px
    );
    clip-path: polygon(
        0 0, 14% 0, 14% 100%, 28% 100%, 28% 0,
        42% 0, 42% 100%, 56% 100%, 56% 0,
        70% 0, 70% 100%, 84% 100%, 84% 0,
        100% 0, 100% 100%, 0 100%
    );
    opacity: 0.85;
}

/* ---------- Grid & cards ---------- */

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
}

.store-card {
    position: relative;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 25px;
    text-align: center;
    overflow: hidden;
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
}

/* soft gradient wash that fades in on hover, sitting behind the content */
.store-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 0%, rgba(185, 103, 255, 0.16), transparent 65%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.store-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-soft);
    background: rgba(255, 255, 255, 0.045);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(185, 103, 255, 0.12);
}

.store-card:hover::before {
    opacity: 1;
}

.store-card img {
    width: 180px;
    height: 180px;
    object-fit: contain;
    margin-bottom: 15px;
    position: relative;
    filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
    transition: transform 0.35s ease, filter 0.35s ease;
}

.store-card:hover img {
    transform: scale(1.05);
    filter: drop-shadow(0 10px 22px rgba(185, 103, 255, 0.35));
}

.store-card h3 {
    position: relative;
    font-size: 1.7rem;
    margin-bottom: 10px;
    color: #f1ecf9;
    letter-spacing: 0.01em;
}

.store-price {
    position: relative;
    display: block;
    color: var(--accent-2);
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 15px;
    text-shadow: 0 0 18px rgba(185, 103, 255, 0.45);
}

.store-card p {
    position: relative;
    color: #ccc;
    min-height: 70px;
}

/* Buttons inside cards are styled via .buy-btn / .info-btn below —
   intentionally not re-declared as ".store-card button" to avoid a
   specificity clash: a class+element selector like that would silently
   beat ".buy-btn" and undo its hover/shine effects. */
.store-card .card-buttons {
    position: relative;
}

/* ---------- Tabs ---------- */

.store-tabs {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 44px;
    flex-wrap: wrap;
    position: relative;
}

.store-tab {
    position: relative;
    padding: 12px 32px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    background: rgba(185, 103, 255, 0.04);
    color: #e9e2f5;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    cursor: pointer;
    overflow: hidden;
    isolation: isolate;
    transition: border-color 0.35s ease, color 0.35s ease, transform 0.25s ease, box-shadow 0.35s ease;
}

.store-tab::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    opacity: 0;
    transition: opacity 0.35s ease;
}

.store-tab:hover {
    border-color: var(--accent-2);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: var(--glow);
}

.store-tab.active {
    border-color: transparent;
    color: #fff;
    box-shadow: 0 6px 20px rgba(138, 43, 226, 0.45);
}

.store-tab.active::before {
    opacity: 1;
}

/* fade-in when a tab section becomes visible */
.store-section-content {
    display: none;
}

.store-section-content.active {
    display: block;
    animation: fadeUp 0.45s ease both;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- Card buttons ---------- */

.card-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.buy-btn {
    position: relative;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.3s ease;
}

.buy-btn::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.buy-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(138, 43, 226, 0.45);
}

.buy-btn:hover::after {
    left: 130%;
}

.buy-btn:active {
    transform: translateY(0);
}

.info-btn {
    width: 100%;
    padding: 11px;
    border: 1px solid var(--border-soft);
    border-radius: 12px;
    cursor: pointer;
    background: transparent;
    color: var(--accent-2);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.info-btn:hover {
    background: var(--surface-soft);
    border-color: var(--accent-2);
    box-shadow: inset 0 0 0 1px var(--border-soft);
}

/* ---------- Modal ---------- */

.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(8, 5, 14, 0.82);
    backdrop-filter: blur(6px);
    z-index: 9999;
    animation: modalIn 0.25s ease both;
}

@keyframes modalIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(90%, 700px);
    max-height: 80vh;
    background: linear-gradient(180deg, #1c1628, var(--surface));
    border: 1px solid var(--border-soft);
    border-radius: 20px;
    padding: 32px 28px 26px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(185,103,255,0.08);
}

.modal-content::before {
    content: "";
    position: absolute;
    top: -40%;
    right: -20%;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(185,103,255,0.25), transparent 70%);
    pointer-events: none;
}

.modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    background: linear-gradient(135deg, #fff, var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 4px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-soft);
}

.modal-scroll {
    max-height: 58vh;
    overflow-y: auto;
    margin-top: 16px;
    padding-right: 8px;
    color: #d8d2e6;
    line-height: 1.75;
    font-family: 'MinecraftFont', sans-serif;
}

.modal-scroll::-webkit-scrollbar {
    width: 6px;
}

.modal-scroll::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 6px;
}

.modal-scroll ul {
    padding-left: 20px;
    list-style: none;
}

.modal-scroll li {
    position: relative;
    margin-bottom: 9px;
    padding-left: 18px;
}

.modal-scroll li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.6em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 0 8px rgba(185,103,255,0.7);
}

.modal-scroll strong {
    color: var(--accent-2);
}

.close-btn {
    position: absolute;
    top: 18px;
    right: 22px;
    cursor: pointer;
    font-size: 28px;
    color: #9b91ad;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

/* ============================================
   Purchase confirmation overlay (store_buy.js)
   ============================================ */

.buy-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 4, 11, 0.82);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: modalIn 0.2s ease both;
}

.buy-modal {
    position: relative;
    width: min(92%, 400px);
    background: linear-gradient(180deg, #1c1628, var(--surface));
    border: 1px solid var(--border-soft);
    border-radius: 22px;
    padding: 34px 28px 28px;
    text-align: center;
    font-family: 'Exo 2', sans-serif;
    color: #fff;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(185, 103, 255, 0.08);
    animation: buyModalIn 0.32s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes buyModalIn {
    from { opacity: 0; transform: scale(0.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.buy-modal.shake {
    animation: buyShake 0.4s ease;
}

@keyframes buyShake {
    0%, 100% { transform: translateX(0); }
    20%      { transform: translateX(-8px); }
    40%      { transform: translateX(7px); }
    60%      { transform: translateX(-5px); }
    80%      { transform: translateX(3px); }
}

/* rotating ambient glow behind the modal */
.buy-modal::before {
    content: "";
    position: absolute;
    top: -60%;
    left: 50%;
    width: 320px;
    height: 320px;
    transform: translateX(-50%);
    background: radial-gradient(circle, rgba(185, 103, 255, 0.28), transparent 70%);
    pointer-events: none;
}

/* orb icon at the top, marking "you're about to spend" */
.buy-modal__icon {
    position: relative;
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 10px 28px rgba(138, 43, 226, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.buy-modal__icon::before {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 1px solid var(--border-soft);
    animation: buySpin 6s linear infinite;
}

.buy-modal__icon svg {
    width: 24px;
    height: 24px;
    fill: #fff;
}

@keyframes buySpin {
    to { transform: rotate(360deg); }
}

.buy-modal__eyebrow {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-2);
    opacity: 0.85;
    margin-bottom: 6px;
}

.buy-modal h3 {
    margin: 0 0 14px;
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    color: #fff;
}

.buy-modal__price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    margin: 0 0 20px;
    border-radius: 999px;
    background: var(--surface-soft);
    border: 1px solid var(--border-soft);
    color: var(--accent-2);
    font-weight: 700;
    font-size: 0.95rem;
    text-shadow: 0 0 14px rgba(185, 103, 255, 0.4);
}

.buy-modal__sub {
    color: #a79bb8;
    margin: 0 0 18px;
    font-size: 0.85rem;
    line-height: 1.5;
}

.buy-input-wrap {
    position: relative;
    margin-bottom: 8px;
}

.buy-input-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 13px 16px;
    background: #0d0a14;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    color: #fff;
    font-size: 15px;
    font-family: 'Exo 2', sans-serif;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.buy-input-wrap input::placeholder {
    color: #6e6480;
}

.buy-input-wrap input:focus {
    border-color: var(--accent-2);
    box-shadow: 0 0 0 3px rgba(185, 103, 255, 0.16), 0 0 18px rgba(185, 103, 255, 0.25);
}

.buy-input-wrap input.invalid {
    border-color: #f55b6c;
    box-shadow: 0 0 0 3px rgba(245, 91, 108, 0.15);
}

.buy-error {
    color: #f5798a;
    font-size: 13px;
    min-height: 18px;
    margin: 0 0 16px;
    text-align: left;
    padding-left: 2px;
}

.buy-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.buy-cancel {
    padding: 12px 22px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #a79bb8;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Exo 2', sans-serif;
    transition: all 0.25s ease;
}

.buy-cancel:hover {
    border-color: rgba(255, 255, 255, 0.3);
    color: #fff;
}

.buy-confirm {
    position: relative;
    flex: 1;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    color: #fff;
    cursor: pointer;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Exo 2', sans-serif;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.3s ease, opacity 0.2s ease;
}

.buy-confirm::after {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s ease;
}

.buy-confirm:hover:not(:disabled)::after {
    left: 130%;
}

.buy-confirm:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 26px rgba(138, 43, 226, 0.45);
}

.buy-confirm:disabled {
    opacity: 0.75;
    cursor: default;
}

.buy-spinner {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    animation: buySpin 0.7s linear infinite;
}

/* success state, shown briefly before redirecting to payment */
.buy-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 10px 0 4px;
    animation: fadeUp 0.35s ease both;
}

.buy-success__check {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-1), var(--accent-2));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.08), 0 10px 28px rgba(138, 43, 226, 0.5);
}

.buy-success__check svg {
    width: 26px;
    height: 26px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
}

.buy-success p {
    margin: 0;
    color: #cfc7dd;
    font-size: 0.9rem;
}

.discount-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #ff4444, #cc0000);
    color: #fff;
    font-family: 'Minecraft', sans-serif;
    font-size: 15px;
    font-weight: 700;
    padding: 6px 14px;
    border-radius: 20px;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
    z-index: 2;
}

.store-price-old {
    text-decoration: line-through;
    color: #888;
    font-size: 22px;
    margin-right: 6px;
}

/* ============================================
   Recent purchases ticker
   Sits below the tabs, above the store grid.
   Content is duplicated once in the HTML so the
   loop can wrap seamlessly at -50%.
   ============================================ */

.purchases-ticker {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 36px;
    padding: 18px 0;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

/* fade the edges so items don't appear to cut off abruptly */
.purchases-ticker::before,
.purchases-ticker::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 70px;
    z-index: 2;
    pointer-events: none;
}

.purchases-ticker::before {
    left: 0;
    background: linear-gradient(90deg, var(--surface), transparent);
}

.purchases-ticker::after {
    right: 0;
    background: linear-gradient(270deg, var(--surface), transparent);
}

.purchases-track {
    display: flex;
    width: max-content;
    gap: 16px;
    animation: purchasesScroll 15s linear infinite;
    will-change: transform;
}

/* pause on hover so a curious player can actually read an entry */
.purchases-ticker:hover .purchases-track {
    animation-play-state: paused;
}

@keyframes purchasesScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.purchase-item {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 0 0 auto;
    padding: 10px 18px 10px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-soft);
    border-radius: 14px;
    white-space: nowrap;
    transition: border-color 0.25s ease, background 0.25s ease;
}

.purchase-item:hover {
    border-color: var(--border-strong);
    background: var(--surface-soft);
}

.purchase-item img {
    width: 40px;
    height: 40px;
    object-fit: contain;
    border-radius: 8px;
    filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.35));
}

.purchase-item__text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.purchase-item__nick {
    color: #fff;
    font-weight: 700;
    font-size: 0.9rem;
}

.purchase-item__detail {
    font-size: 0.78rem;
    color: #a79bb8;
}

.purchase-item__detail strong {
    color: var(--accent-2);
    font-weight: 600;
}

/* Чуть крупнее лента для десктопов — на телефонах оставляем как есть,
   чтобы не занимала лишнее место на маленьком экране. */
@media (min-width: 1024px) {
    .purchases-ticker {
        padding: 48px 0;
    }

    .purchases-track {
        gap: 36px;
    }

    .purchase-item {
        gap: 26px;
        padding: 30px 44px 30px 24px;
        border-radius: 26px;
    }

    .purchase-item img {
        width: 130px;
        height: 130px;
        border-radius: 18px;
    }

    .purchase-item__nick {
        font-size: 2.1rem;
    }

    .purchase-item__detail {
        font-size: 1.5rem;
    }
}