* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --background: #d20a2e;
    --background-dark: #570914;

    --surface: #11151b;
    --surface-hover: #181d24;
    --surface-light: #1c222a;

    --border: rgba(255, 255, 255, 0.1);

    --text: #ffffff;
    --muted: #c1c6ce;
    --muted-dark: #9299a4;

    --green: #39ff88;
}

html {
    min-height: 100%;
    background: var(--background);
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at 50% 0%,
            rgba(255, 255, 255, 0.07),
            transparent 35%
        ),
        linear-gradient(
            180deg,
            var(--background),
            var(--background-dark)
        );

    color: var(--text);

    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Main container */

.item-rap {
    font: inherit;
    font-weight: inherit;
    color: inherit;
    line-height: inherit;
}

.container {
    width: min(
        1500px,
        calc(100% - 48px)
    );

    margin: 0 auto;

    padding:
        48px
        0
        80px;
}

.item-image-wrapper {
    position: relative;
}

.item-quantity {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Marketplace header */

.page-header {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 24px;

    margin-bottom: 28px;
}

.page-header h1 {
    color: #ffffff;

    font-size: 34px;
    font-weight: 800;

    line-height: 1.1;

    letter-spacing: -0.8px;

    text-shadow:
        0 2px 12px rgba(0, 0, 0, 0.25);
}

.page-header p {
    margin-top: 8px;

    color: #d1d5db;

    font-size: 14px;
    line-height: 1.5;
}

.item-count {
    flex-shrink: 0;

    color: #ffffff;

    font-size: 13px;
    font-weight: 600;

    text-shadow:
        0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Toolbar */

.toolbar {
    display: flex;

    align-items: center;

    gap: 12px;

    margin-bottom: 28px;
}

.search-wrapper {
    position: relative;

    flex: 1;

    min-width: 0;
}

.search-icon {
    position: absolute;

    top: 50%;
    left: 16px;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 16px;
    height: 16px;

    transform: translateY(-50%);

    color: #aeb5bf;

    pointer-events: none;
}

.search-icon i {
    font-size: 13px;
}

.search-wrapper input,
.toolbar select {
    width: 100%;
    height: 46px;

    border: 1px solid var(--border);
    border-radius: 11px;

    outline: none;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.04),
            transparent
        ),
        #11151b;

    color: #ffffff;

    font: inherit;
    font-size: 13px;

    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.18);

    transition:
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.search-wrapper input {
    padding:
        0
        16px
        0
        43px;
}

.search-wrapper input::placeholder {
    color: #9ca3ad;
}

.search-wrapper input:focus,
.toolbar select:focus {
    border-color:
        rgba(255, 255, 255, 0.2);

    background: #181d24;

    box-shadow:
        0 10px 30px rgba(0, 0, 0, 0.24);
}

.toolbar select {
    width: 190px;

    flex-shrink: 0;

    padding:
        0
        14px;

    cursor: pointer;

    appearance: none;

    background-image:
        linear-gradient(
            45deg,
            transparent 50%,
            #b9c0c9 50%
        ),
        linear-gradient(
            135deg,
            #b9c0c9 50%,
            transparent 50%
        );

    background-position:
        calc(100% - 18px) 19px,
        calc(100% - 13px) 19px;

    background-size:
        5px 5px,
        5px 5px;

    background-repeat: no-repeat;
}

.toolbar select option {
    background: #11151b;
    color: #ffffff;
}

/* Items grid */

.items-grid {
    display: grid;

    grid-template-columns:
        repeat(
            5,
            minmax(0, 1fr)
        );

    gap: 18px;
}

/* Item card */

.item-card {
    position: relative;

    min-width: 0;

    overflow: hidden;

    border-radius: 14px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.035),
            transparent
        ),
        #11151b;

    cursor: pointer;

    box-shadow:
        0 12px 35px
        rgba(0, 0, 0, 0.22);

    transition:
        transform 0.18s ease,
        border-color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.item-card:hover {
    transform: translateY(-3px);

    border-color:
        rgba(255, 255, 255, 0.18);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.045),
            transparent
        ),
        #181d24;

    box-shadow:
        0 18px 45px
        rgba(0, 0, 0, 0.3);
}

/* Item image */

.item-image-wrapper {
    position: relative;

    width: 100%;

    aspect-ratio: 1 / 1;

    overflow: hidden;

    background:
        radial-gradient(
            circle at 50% 35%,
            rgba(255, 255, 255, 0.06),
            transparent 55%
        ),
        #0b0f13;
}

.item-image-wrapper::after {
    position: absolute;

    right: 0;
    bottom: 0;
    left: 0;

    height: 25%;

    content: "";

    background:
        linear-gradient(
            180deg,
            transparent,
            rgba(0, 0, 0, 0.18)
        );

    pointer-events: none;
}

.item-image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;

    padding: 0;

    transition:
        transform 0.2s ease;
}

.item-card:hover .item-image {
    transform: scale(1.025);
}

.item-image-placeholder {
    display: flex;

    align-items: center;
    justify-content: center;

    width: 100%;
    height: 100%;

    color: #9299a4;

    font-size: 24px;
}

/* Item information */

.item-info {
    position: relative;

    min-width: 0;

    padding: 15px;

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.02),
            transparent
        ),
        #11151b;
}

.item-name-row {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    min-width: 0;

    margin-bottom: 5px;
}

.item-name-row h2 {
    min-width: 0;

    overflow: hidden;

    color: #ffffff;

    font-size: 14px;
    font-weight: 700;

    line-height: 1.3;

    letter-spacing: -0.15px;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.creator {
    overflow: hidden;

    color: #c1c6ce;

    font-size: 11px;
    font-weight: 500;

    line-height: 1.4;

    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Owned badge */

.owned {
    display: inline-flex;

    align-items: center;

    gap: 5px;

    flex-shrink: 0;

    padding:
        5px
        8px;

    border:
        1px solid
        rgba(57, 255, 136, 0.18);

    border-radius: 7px;

    background:
        rgba(57, 255, 136, 0.11);

    color: var(--green);

    font-size: 9px;
    font-weight: 700;

    line-height: 1;

    text-transform: uppercase;

    letter-spacing: 0.3px;
}

.owned i {
    font-size: 8px;
}

/* Item stats */

.item-stats {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 13px;
}

.stat {
    min-width: 0;

    padding: 10px;

    border-radius: 9px;

    background:  #1c222a

    box-shadow
        0 6px 18px
        rgba(0, 0, 0, 0.14)
}

.stat span {
    display: block;

    margin-bottom: 5px;

    color: #aeb5bf;

    font-size: 9px;
    font-weight: 700;

    line-height: 1;

    text-transform: uppercase;

    letter-spacing: 0.45px;
}

.stat strong {
    display: flex;

    align-items: center;

    gap: 5px;

    min-width: 0;

    overflow: hidden;

    color: #ffffff;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.2;

    text-overflow: ellipsis;
    white-space: nowrap;
}

.stat strong i {
    flex-shrink: 0;

    color: #ffffff;

    font-size: 9px;
}

/* Loading */

.loading-more {
    padding:
        30px
        0
        10px;

    color:
        rgba(255, 255, 255, 0.75);

    font-size: 12px;

    text-align: center;
}

.empty {
    grid-column: 1 / -1;

    padding: 70px 20px;

    border:
        1px solid
        rgba(255, 255, 255, 0.1);

    border-radius: 14px;

    background:
        #11151b;

    color: #c1c6ce;

    font-size: 14px;

    text-align: center;
}

/* Skeleton */

.skeleton {
    position: relative;

    overflow: hidden;

    background:
        rgba(255, 255, 255, 0.065);
}

.skeleton::after {
    position: absolute;

    inset: 0;

    content: "";

    transform: translateX(-100%);

    background:
        linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.065),
            transparent
        );

    animation:
        skeleton-loading
        1.4s infinite;
}

.skeleton-card {
    cursor: default;

    pointer-events: none;
}

.skeleton-card:hover {
    transform: none;

    border-color:
        rgba(255, 255, 255, 0.1);

    background:
        linear-gradient(
            180deg,
            rgba(255, 255, 255, 0.035),
            transparent
        ),
        #11151b;

    box-shadow:
        0 12px 35px
        rgba(0, 0, 0, 0.22);
}

.skeleton-card .item-image-wrapper {
    background:
        rgba(255, 255, 255, 0.045);
}

.skeleton-title {
    width: 65%;

    height: 15px;

    margin-bottom: 9px;

    border-radius: 5px;
}

.skeleton-creator {
    width: 40%;

    height: 10px;

    border-radius: 4px;
}

.skeleton-stats {
    display: grid;

    grid-template-columns:
        repeat(
            2,
            minmax(0, 1fr)
        );

    gap: 8px;

    margin-top: 13px;
}

.skeleton-stat {
    width: 100%;

    height: 42px;

    border-radius: 9px;
}

@keyframes skeleton-loading {
    100% {
        transform: translateX(100%);
    }
}

/* Responsive */

@media (max-width: 1250px) {
    .items-grid {
        grid-template-columns:
            repeat(
                4,
                minmax(0, 1fr)
            );
    }
}

@media (max-width: 950px) {
    .items-grid {
        grid-template-columns:
            repeat(
                3,
                minmax(0, 1fr)
            );
    }
}

@media (max-width: 700px) {
    .container {
        width: min(
            100% - 28px,
            1500px
        );

        padding-top: 28px;
    }

    .page-header {
        align-items: flex-start;

        flex-direction: column;

        gap: 8px;
    }

    .page-header h1 {
        font-size: 28px;
    }

    .toolbar {
        align-items: stretch;

        flex-direction: column;
    }

    .toolbar select {
        width: 100%;
    }

    .items-grid {
        grid-template-columns:
            repeat(
                2,
                minmax(0, 1fr)
            );

        gap: 12px;
    }

    .item-info {
        padding: 12px;
    }

    .item-name-row h2 {
        font-size: 13px;
    }

    .owned {
        padding:
            4px
            6px;

        font-size: 8px;
    }
}

@media (max-width: 430px) {
    .items-grid {
        grid-template-columns:
            1fr;
    }

    .item-image {
        padding: 0;
    }
}

.item-image-wrapper {
    position: relative;
}

.item-quantity {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    white-space: nowrap;
}

/* ============================================================
   Site Header
   ============================================================ */

.site-header {
    position: sticky;
    top: 0;
    z-index: 50;

    width: 100%;

    border-bottom: 1px solid var(--border);

    background: #11151b;

    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.site-header-inner {
    display: flex;
    align-items: center;

    gap: 24px;

    width: min(
        1500px,
        calc(100% - 48px)
    );

    margin: 0 auto;

    padding: 14px 0;
}

/* Logo */

.site-logo {
    display: inline-flex;
    align-items: center;

    gap: 10px;

    color: #ffffff;

    font-size: 15px;
    font-weight: 700;

    letter-spacing: -0.2px;

    text-decoration: none;

    transition: opacity 0.18s ease;
}

.site-logo:hover {
    opacity: 0.85;
}

.site-logo-image {
    display: block;

    width: 28px;
    height: 28px;

    border-radius: 7px;

    object-fit: cover;

    background: rgba(255, 255, 255, 0.06);

    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3);
}

.site-logo-text {
    white-space: nowrap;
}

/* Nav */

.site-nav {
    display: flex;
    align-items: center;

    gap: 22px;

    margin-left: auto;
}

.site-nav-link {
    display: inline-flex;
    align-items: center;

    gap: 7px;

    color: #d1d5db;

    font-size: 13px;
    font-weight: 600;

    line-height: 1;

    letter-spacing: -0.1px;

    text-decoration: none;

    transition: color 0.18s ease;
}

.site-nav-link i {
    font-size: 12px;

    color: #9299a4;

    transition: color 0.18s ease;
}

.site-nav-link:hover {
    color: #ffffff;
}

.site-nav-link:hover i {
    color: #ffffff;
}

/* Discord accent */

.site-nav-discord {
    margin-left: 18px;
}

.site-nav-discord i {
    color: #5865f2;
}

.site-nav-discord:hover i {
    color: #7289ff;
}

/* Responsive header */

@media (max-width: 700px) {
    .site-header-inner {
        width: min(
            100% - 28px,
            1500px
        );

        gap: 12px;

        padding: 12px 0;
    }

    .site-logo-text {
        display: none;
    }

    .site-nav {
        gap: 16px;
    }

    .site-nav-link {
        font-size: 12px;
    }

    .site-nav-link span {
        display: none;
    }

    .site-nav-link i {
        font-size: 15px;
    }
}

