.market-page {
    padding: 18px 0 40px;
    background: radial-gradient(circle at top center, rgba(28, 88, 140, 0.18), transparent 28%), linear-gradient(180deg, #07111c 0%, #071019 100%);
}

.market-shell {
    max-width: 1680px;
}

.market-layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr) 360px;
    gap: 14px;
    align-items: start;
}

.market-sidebar-left,
.market-center,
.market-sidebar-right {
    min-width: 0;
}

.market-sidebar-left,
.market-sidebar-right {
    position: sticky;
    top: 86px;
}

.steam-card {
    background: linear-gradient(180deg, rgba(12, 24, 39, 0.98), rgba(8, 18, 29, 0.98));
    border: 1px solid rgba(120, 170, 220, 0.10);
    border-radius: 10px;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.market-main-card,
.market-filter-card,
.market-cart-card,
.market-map-card,
.market-user-card {
    overflow: hidden;
}

.market-filter-card,
.market-cart-card,
.market-map-card,
.market-user-card {
    padding: 0;
}

.market-panel-head,
.market-main-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
    background: linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,0));
}

.market-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f3f7fb;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .3px;
    text-transform: uppercase;
}

.market-panel-icon {
    color: #4db3ff;
    font-size: 14px;
    line-height: 1;
}

.market-link-btn {
    background: transparent;
    border: none;
    color: #39a9ff;
    font-weight: 700;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
}

    .market-link-btn:hover {
        color: #72c6ff;
    }

.market-filter-card {
    padding-bottom: 16px;
}

.market-filter-group {
    padding: 0 16px;
    margin-top: 12px;
}

.market-label {
    display: block;
    margin-bottom: 6px;
    color: #d2dee9;
    font-size: 13px;
    font-weight: 600;
}

.market-price-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.market-input {
    width: 100%;
    height: 38px;
    border: 1px solid rgba(112, 150, 190, .14);
    background: linear-gradient(180deg, rgba(16, 33, 53, .98), rgba(12, 24, 39, .98));
    color: #eef5fb;
    border-radius: 6px;
    padding: 0 12px;
    outline: none;
    font-size: 14px;
    transition: .18s ease;
}

    .market-input:focus {
        border-color: rgba(70, 150, 255, .42);
        box-shadow: 0 0 0 2px rgba(70, 150, 255, .12);
    }

    .market-input::placeholder {
        color: rgba(220, 235, 248, .42);
    }

    .market-input option,
    .market-input optgroup {
        color: #111 !important;
        background: #fff !important;
    }

.market-btn {
    border: 1px solid rgba(255,255,255,.10);
    color: #fff;
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    transition: .18s ease;
    white-space: nowrap;
}

    .market-btn:hover {
        filter: brightness(1.08);
    }

.market-btn-full {
    width: calc(100% - 32px);
    margin: 16px auto 0;
}

.market-btn-primary {
    background: linear-gradient(180deg, #1262a9 0%, #0c4d87 100%);
    border-color: rgba(78, 160, 255, .22);
}

.market-btn-dark {
    background: linear-gradient(180deg, #1a2a3d 0%, #122131 100%);
    border-color: rgba(255,255,255,.08);
}

.market-btn-success {
    background: linear-gradient(180deg, #2e9d42 0%, #237935 100%);
    border-color: rgba(85, 210, 108, .22);
}

.market-btn-buy {
    min-width: 68px;
    background: linear-gradient(180deg, #0d62b1 0%, #0a4e8e 100%);
    border-color: rgba(92, 170, 255, .26);
    padding: 8px 12px;
}

.market-main-tabs {
    display: flex;
    gap: 8px;
    align-items: center;
}

.market-tab {
    background: transparent;
    border: none;
    color: rgba(225, 236, 247, .70);
    font-size: 14px;
    font-weight: 800;
    padding: 0 0 10px;
    margin-right: 18px;
    cursor: pointer;
    position: relative;
    text-transform: uppercase;
    letter-spacing: .4px;
}

    .market-tab.active {
        color: #ffffff;
    }

        .market-tab.active::after {
            content: "";
            position: absolute;
            left: 0;
            bottom: -17px;
            width: 100%;
            height: 2px;
            background: #38a7ff;
            border-radius: 999px;
        }

.market-main-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

.market-counter {
    color: rgba(223, 236, 248, .72);
    font-size: 14px;
    font-weight: 500;
}

.market-table-wrap {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 220px);
}

.market-table {
    width: 100%;
    min-width: 980px;
    border-collapse: collapse;
}

    .market-table thead th {
        position: sticky;
        top: 0;
        z-index: 5;
        background: #0c1827;
        color: rgba(213, 226, 239, .75);
        font-size: 13px;
        text-transform: uppercase;
        letter-spacing: .3px;
        font-weight: 700;
        text-align: left;
        border-bottom: 1px solid rgba(255,255,255,.07);
        padding: 13px 18px;
        cursor: pointer;
    }

    .market-table tbody td {
        color: #edf4fb;
        border-bottom: 1px solid rgba(255,255,255,.05);
        padding: 12px 18px;
        vertical-align: middle;
    }

    .market-table tbody tr {
        transition: background .15s ease;
    }

        .market-table tbody tr:hover {
            background: rgba(255,255,255,.03);
        }

.market-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

    .market-item img {
        width: 52px;
        height: 52px;
        object-fit: contain;
        border-radius: 4px;
        background: rgba(0,0,0,.26);
        border: 1px solid rgba(255,255,255,.10);
        padding: 4px;
        flex-shrink: 0;
    }

.market-item-meta {
    min-width: 0;
}

.market-item-name {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
    word-break: break-word;
}

.market-item-sub {
    margin-top: 4px;
    font-size: 13px;
    color: rgba(218, 231, 243, .58);
}

.market-stack-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(255, 205, 60, .16);
    color: #ffcf48;
    font-size: 11px;
    font-weight: 800;
    vertical-align: middle;
}

.market-price,
.market-price.sold {
    font-weight: 800;
    white-space: nowrap;
}

.market-price {
    color: #f6fbff;
}

    .market-price.sold {
        color: #43ff78;
    }

.market-socket-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
}

.market-socket-dot {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    display: inline-block;
    border: 1px solid rgba(255,255,255,.22);
    box-shadow: inset 0 0 0 2px rgba(0,0,0,.35);
}

    .market-socket-dot.red {
        background: #d94747;
    }

    .market-socket-dot.blue {
        background: #3ea3ff;
    }

    .market-socket-dot.green {
        background: #58c844;
    }

    .market-socket-dot.yellow {
        background: #d8ba43;
    }

.market-socket-empty {
    color: rgba(255,255,255,.35);
    font-weight: 700;
}

.market-table-footer {
    border-top: 1px solid rgba(255,255,255,.06);
    padding: 12px 18px;
    color: rgba(220, 232, 244, .56);
    font-size: 13px;
}

.market-cart-badge {
    min-width: 24px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.08);
    color: #dce9f7;
    border: 1px solid rgba(255,255,255,.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
}

#cartBox {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 360px;
    overflow: auto;
}

.cart-empty {
    padding: 18px;
    color: rgba(223, 236, 248, .56);
    text-align: center;
}

.cart-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255,255,255,.06);
}

.cart-left {
    flex: 1;
    min-width: 0;
}

.cart-item-head {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.cart-item-icon {
    width: 62px;
    height: 62px;
    object-fit: contain;
    border-radius: 4px;
    background: rgba(0,0,0,.28);
    border: 1px solid rgba(255,255,255,.10);
    padding: 4px;
    flex-shrink: 0;
}

.cart-item-name {
    color: #f4f8fc;
    font-weight: 800;
    font-size: 14px;
    line-height: 1.25;
    word-break: break-word;
}

.cart-left small {
    display: inline-block;
    margin-top: 6px;
    color: rgba(225, 236, 247, .84);
    font-size: 13px;
}

.cart-remove-btn {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border-radius: 4px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,.70);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: .15s ease;
}

    .cart-remove-btn:hover {
        background: rgba(255,255,255,.06);
        color: #fff;
    }

.cart-footer {
    padding: 18px;
    border-top: 1px solid rgba(255,255,255,.06);
}

.cart-total {
    color: #f4f9fd;
    font-size: 17px;
    font-weight: 800;
    margin-bottom: 14px;
}

.cart-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.market-map-card {
    margin-top: 14px;
}

.market-map {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    margin: 0 18px 14px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.06);
}

    .market-map img {
        display: block;
        width: 100%;
        height: auto;
    }

#sellerMarker {
    display: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #ff3b30;
    box-shadow: 0 0 0 4px rgba(255,59,48,.18), 0 0 18px rgba(255,59,48,.45);
    position: absolute;
    z-index: 20;
}

.market-map-legend {
    padding: 0 18px 18px;
    color: rgba(223, 236, 248, .74);
    font-size: 13px;
}

.legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    margin-right: 6px;
}

    .legend-dot.red {
        background: #ff3b30;
    }

.market-user-card {
    margin-top: 14px;
    padding: 16px 18px;
}

.market-user-name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 800;
}

.market-user-gold {
    margin-top: 6px;
    color: #f0c85b;
    font-size: 14px;
    font-weight: 700;
}

.store-toast-container {
    position: fixed;
    right: 20px;
    bottom: 20px;
    top: auto;
    left: auto;
    z-index: 2147483647;
    display: flex;
    flex-direction: column-reverse;
    gap: 10px;
    pointer-events: none;
    align-items: flex-end;
}

.store-toast {
    min-width: 280px;
    max-width: 420px;
    background: rgba(15,18,28,.96);
    color: #fff;
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 14px 40px rgba(0,0,0,.35);
    border-radius: 10px;
    padding: 14px 16px;
    opacity: 0;
    transform: translateY(-8px);
    transition: all .25s ease;
    font-weight: 600;
    white-space: pre-line;
    backdrop-filter: blur(10px);
}

    .store-toast.show {
        opacity: 1;
        transform: translateY(0);
    }

    .store-toast.error {
        border-color: rgba(255,80,80,.45);
    }

.market-table-wrap::-webkit-scrollbar,
#cartBox::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

.market-table-wrap::-webkit-scrollbar-track,
#cartBox::-webkit-scrollbar-track {
    background: rgba(255,255,255,.04);
}

.market-table-wrap::-webkit-scrollbar-thumb,
#cartBox::-webkit-scrollbar-thumb {
    background: rgba(90, 120, 150, .55);
    border-radius: 999px;
}

    .market-table-wrap::-webkit-scrollbar-thumb:hover,
    #cartBox::-webkit-scrollbar-thumb:hover {
        background: rgba(110, 145, 180, .75);
    }

@media (max-width: 1380px) {
    .market-layout {
        grid-template-columns: 220px minmax(0, 1fr) 320px;
    }
}

@media (max-width: 1200px) {
    .market-layout {
        grid-template-columns: 1fr;
    }

    .market-sidebar-left,
    .market-sidebar-right {
        position: static;
        top: unset;
    }

    .market-table-wrap {
        max-height: none;
    }
}

@media (max-width: 768px) {
    .market-page {
        padding-top: 12px;
    }

    .market-main-head,
    .market-panel-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .market-main-actions {
        width: 100%;
        justify-content: space-between;
    }

    .market-price-grid,
    .cart-actions {
        grid-template-columns: 1fr;
    }

    .market-table {
        min-width: 820px;
    }

    .store-toast-container {
        left: 12px;
        right: 12px;
        top: 95px;
    }

    .store-toast {
        min-width: unset;
        max-width: unset;
        width: 100%;
    }
}

.market-bless {
    color: #5dd6ff;
    font-weight: 800;
}

.market-bless-none {
    color: rgba(255,255,255,.45);
    font-weight: 700;
}
