* {
    box-sizing: border-box;
}

:root {
    --bg: #050509;
    --panel: #0b0b12;
    --card: #11131a;
    --card2: #151020;
    --purple: #9d35ff;
    --purple-soft: #c084ff;
    --border: rgba(157, 53, 255, .28);
    --text: #f5f3ff;
    --muted: #a7a0b8;
    --green: #65ff9a;
    --blue: #8fc7ff;
    --gold: #f7c66a;
}

body {
    margin: 0;
    background:
        radial-gradient(circle at top, rgba(157,53,255,.13) 0, transparent 34%),
        var(--bg);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
}

header {
    padding: 38px 28px 30px;
    text-align: center;
    background: rgba(5,5,9,.96);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(12px);
}

header h1 {
    margin: 0 0 8px;
    font-size: 38px;
    color: #fff;
    text-shadow: 0 0 18px rgba(157,53,255,.65);
}

header .subtitle {
    margin: 0 0 18px;
    color: var(--purple-soft);
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 3px;
}

#status {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 13px;
}

#status span {
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(157,53,255,.08);
    border: 1px solid var(--border);
}

#container {
    max-width: 1760px;
    margin: 0 auto;
    padding: 34px 32px 70px;
}

.category-section {
    margin-bottom: 56px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.section-header h2 {
    margin: 0;
    font-size: 24px;
    color: #fff;
}

.section-header h2::before {
    content: "◆ ";
    color: var(--purple);
}

.section-header span {
    color: var(--gold);
    font-weight: 900;
}

.grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
}

.card {
    min-height: 205px;
    display: grid;
    grid-template-columns: 130px 1fr;
    background: linear-gradient(145deg, var(--card), var(--card2));
    border: 1px solid rgba(157,53,255,.22);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 18px 45px rgba(0,0,0,.55);
    transition: .18s ease;
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(192,132,255,.75);
    box-shadow: 0 24px 65px rgba(0,0,0,.75), 0 0 26px rgba(157,53,255,.22);
}

.card:nth-child(1) {
    border-color: rgba(247,198,106,.65);
}

.image-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle, rgba(157,53,255,.18), transparent 62%),
        #090911;
    border-right: 1px solid rgba(157,53,255,.18);
}

.item-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 14px;
    filter: drop-shadow(0 0 12px rgba(157,53,255,.25));
}

.image-placeholder {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--purple-soft);
    font-weight: 900;
    background: rgba(157,53,255,.08);
    border: 1px solid rgba(157,53,255,.35);
}

.card-body {
    position: relative;
    padding: 18px 18px 16px;
}

.rank {
    position: absolute;
    top: 14px;
    right: 16px;
    color: var(--gold);
    font-weight: 900;
}

.card h3 {
    margin: 0 48px 12px 0;
    color: #fff;
    font-size: 17px;
    line-height: 1.25;
}

.meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 13px;
}

.badge {
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    color: var(--purple-soft);
    background: rgba(157,53,255,.11);
    border: 1px solid rgba(157,53,255,.32);
}

.badge.sellers {
    color: var(--blue);
    background: rgba(143,199,255,.09);
    border-color: rgba(143,199,255,.25);
}

.badge.score {
    color: var(--purple-soft);
    background: rgba(157,53,255,.16);
    border-color: rgba(192,132,255,.4);
}
.badge.score.rating-splus {
    color: #ffffff;
    background: linear-gradient(135deg, #ff3b3b, #ff8a00);
    border-color: rgba(255,138,0,.7);
}

.badge.score.rating-s {
    color: #fff;
    background: linear-gradient(135deg, #ff7b00, #ffb347);
    border-color: rgba(255,179,71,.7);
}

.badge.score.rating-a {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6, #b794f4);
    border-color: rgba(183,148,244,.6);
}

.badge.score.rating-b {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
    border-color: rgba(96,165,250,.6);
}

.badge.score.rating-c {
    color: #fff;
    background: linear-gradient(135deg, #22c55e, #4ade80);
    border-color: rgba(74,222,128,.6);
}

.badge.score.rating-d {
    color: #fff;
    background: linear-gradient(135deg, #6b7280, #9ca3af);
    border-color: rgba(156,163,175,.6);
}

.badge.special {
    color: var(--text);
    background: rgba(255,255,255,.055);
    border-color: rgba(255,255,255,.12);
}

.badge.origin {
    color: var(--gold);
    background: rgba(247,198,106,.1);
    border-color: rgba(247,198,106,.28);
}

.price {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 13px;
    border-radius: 999px;
    color: var(--green);
    background: rgba(101,255,154,.1);
    font-size: 21px;
    font-weight: 900;
}

.price::before {
    content: "💎 ";
}

.actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid rgba(157,53,255,.18);
}

.actions a {
    color: var(--blue);
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.actions a:hover {
    color: #fff;
    text-decoration: underline;
}


.trade-rating-panel {
    max-width: 1760px;
    margin: 22px auto 0;
    display: grid;
    grid-template-columns: 1fr 1.25fr 1.55fr 1fr;
    gap: 0;
    text-align: left;
    background:
        linear-gradient(145deg, rgba(21,16,32,.88), rgba(9,9,17,.88));
    border: 1px solid rgba(157,53,255,.28);
    border-radius: 18px;
    box-shadow: 0 12px 38px rgba(0,0,0,.35), 0 0 16px rgba(157,53,255,.10);
    overflow: hidden;
}

.rating-column {
    padding: 13px 18px;
    border-right: 1px solid rgba(157,53,255,.16);
}

.rating-column:last-child {
    border-right: 0;
}

.rating-column h2 {
    margin: 0 0 7px;
    color: #fff;
    font-size: 13px;
    line-height: 1.2;
}

.rating-column p {
    margin: 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.rating-factors {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 0;
}

.rating-factors span {
    padding: 5px 8px;
    border-radius: 999px;
    color: var(--text);
    font-size: 11px;
    font-weight: 900;
    background: rgba(157,53,255,.10);
    border: 1px solid rgba(157,53,255,.24);
}

.rating-scale.compact {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 8px;
}

.rating-scale.compact span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.rating-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 26px;
    padding: 3px 7px;
    border-radius: 999px;
    color: #fff;
    font-size: 10px;
    font-weight: 900;
}

.rating-pill.rating-splus {
    background: linear-gradient(135deg, #ff3b3b, #ff8a00);
}

.rating-pill.rating-s {
    background: linear-gradient(135deg, #ff7b00, #ffb347);
}

.rating-pill.rating-a {
    background: linear-gradient(135deg, #8b5cf6, #b794f4);
}

.rating-pill.rating-b {
    background: linear-gradient(135deg, #3b82f6, #60a5fa);
}

.rating-pill.rating-c {
    background: linear-gradient(135deg, #22c55e, #4ade80);
}

.rating-pill.rating-d {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.rating-disclaimer {
    background: rgba(255,255,255,.022);
}

.rating-disclaimer h2 {
    color: var(--gold);
}

.error {
    color: #ff6b9b;
}

@media (max-width: 1400px) {
    .trade-rating-panel {
        grid-template-columns: repeat(2, 1fr);
    }

    .rating-column:nth-child(2) {
        border-right: 0;
    }

    .rating-column:nth-child(3),
    .rating-column:nth-child(4) {
        border-top: 1px solid rgba(157,53,255,.18);
    }

    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 1000px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 650px) {
    header {
        padding: 26px 14px 18px;
        position: static;
    }

    header h1 {
        font-size: 28px;
    }

    header .subtitle {
        font-size: 11px;
        letter-spacing: 2px;
        margin-bottom: 14px;
    }

    #status {
        gap: 8px;
        font-size: 11px;
    }

    #status span {
        padding: 6px 9px;
    }

    .trade-rating-panel {
        grid-template-columns: 1fr;
        margin: 16px 0 0;
        border-radius: 14px;
    }

    .rating-column {
        display: none;
        border: 0;
        padding: 10px 12px;
    }

    .rating-about,
    .rating-guide {
        display: block;
    }

    .rating-about {
        border-bottom: 1px solid rgba(157,53,255,.18);
    }

    .rating-about p {
        display: none;
    }

    .rating-column h2 {
        margin-bottom: 5px;
        font-size: 12px;
    }

    .rating-scale.compact {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    .rating-scale.compact span {
        font-size: 10px;
        gap: 4px;
    }

    .rating-pill {
        min-width: 24px;
        padding: 3px 6px;
        font-size: 9px;
    }

    #container {
        padding: 24px 16px 50px;
    }

    .grid {
        grid-template-columns: 1fr;
    }

    .card {
        grid-template-columns: 112px 1fr;
    }
}