/* RETAKEAXIS buy menu (icon mode) — presentation layer only.
   Pure CSS chrome: no backdrop-filter, no particles, no keyframe loops.
   Colors follow the in-game UI tokens declared in index.html. */

#cs-buymenu {
    position: fixed;
    inset: 0;
    z-index: 2147483645;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.62);
    font-family: var(--ui-font, system-ui, sans-serif);
    color: var(--text, #f2f2f2);
    -webkit-user-select: none;
    user-select: none;
}

#cs-buymenu.open { display: flex; }

/* the status badge / resume escape hatch would overlap this panel while open */
body.cs-buy-open #cs-badge-wrap { display: none !important; }

.cs-bm-panel {
    width: min(1120px, 94vw);
    height: min(680px, 90vh);
    display: flex;
    flex-direction: column;
    background: #101112;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.75);
    overflow: hidden;
}

/* ---------- top bar ---------- */
.cs-bm-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-bottom: 1px solid #232323;
    background: linear-gradient(180deg, #17181a 0%, #121314 100%);
}

.cs-bm-title { display: flex; flex-direction: column; gap: 2px; flex: 1 1 auto; min-width: 0; }
.cs-bm-title b { font-size: 20px; font-weight: 800; letter-spacing: 0.02em; }
.cs-bm-title span { font-size: 10px; letter-spacing: 0.22em; color: #8a8f95; }

.cs-bm-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    background: #141516;
    white-space: nowrap;
}
.cs-bm-stat i {
    font-style: normal;
    font-size: 10px;
    letter-spacing: 0.14em;
    color: #8a8f95;
}
.cs-bm-stat b { font-size: 15px; font-weight: 800; color: var(--accent, #f6b265); font-variant-numeric: tabular-nums; }
.cs-bm-stat.dim b { color: #6d7278; }

.cs-bm-x {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #17181a;
    color: #cfd3d7;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    font-size: 17px;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.cs-bm-x:hover { background: #1f2022; color: #fff; border-color: #3a3a3a; }

/* ---------- body ---------- */
.cs-bm-body {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
}

/* left: categories */
.cs-bm-cats {
    flex: 0 0 250px;
    border-right: 1px solid #232323;
    padding: 12px 10px;
    overflow-y: auto;
    background: #121314;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.cs-bm-cats::-webkit-scrollbar { width: 0; height: 0; display: none; }
.cs-bm-rows { scrollbar-width: none; -ms-overflow-style: none; }
.cs-bm-rows::-webkit-scrollbar { width: 0; height: 0; display: none; }

.cs-bm-cat {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 4px;
    border: 1px solid transparent;
    border-left: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease;
}
.cs-bm-cat:hover { background: #191a1c; border-color: #2a2a2a; }
.cs-bm-cat.sel {
    background: #1d1a16;
    border-color: #3a3126;
    border-left-color: var(--accent, #f6b265);
}
.cs-bm-cat .n {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #333;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: #9aa0a6;
    background: #17181a;
}
.cs-bm-cat.sel .n { color: #101010; background: var(--accent, #f6b265); border-color: var(--accent, #f6b265); }
.cs-bm-cat .t { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cs-bm-cat .t b { font-size: 13.5px; font-weight: 700; color: #e7e9eb; }
.cs-bm-cat.sel .t b { color: var(--accent, #f6b265); }
.cs-bm-cat .t span { font-size: 9.5px; letter-spacing: 0.12em; color: #7f858b; }

/* middle: weapon list */
.cs-bm-list {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #232323;
}

.cs-bm-list-head {
    padding: 14px 18px 10px;
    display: flex;
    align-items: baseline;
    gap: 10px;
    border-bottom: 1px solid #1d1d1d;
}
.cs-bm-list-head b { font-size: 16px; font-weight: 800; }
.cs-bm-list-head span { font-size: 10px; letter-spacing: 0.18em; color: #8a8f95; }

.cs-bm-rows { flex: 1 1 auto; overflow-y: auto; padding: 8px 10px 12px; }

.cs-bm-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    margin-bottom: 6px;
    border: 1px solid #202020;
    border-radius: 8px;
    background: #161718;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, transform 120ms ease;
}
.cs-bm-row:hover { background: #1b1c1e; border-color: #333; }
.cs-bm-row.sel {
    background: #1d1a16;
    border-color: var(--accent, #f6b265);
    transform: translateX(2px);
}
.cs-bm-row.poor { opacity: 0.42; }
.cs-bm-row .n {
    width: 20px;
    flex: 0 0 auto;
    text-align: center;
    font-size: 11.5px;
    font-weight: 700;
    color: #8a8f95;
}
.cs-bm-row.sel .n { color: var(--accent, #f6b265); }
.cs-bm-row .ic {
    width: 74px;
    height: 30px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cs-bm-row .ic img { max-width: 100%; max-height: 100%; display: block; }
.cs-bm-row .ic .badge {
    font-size: 9px;
    letter-spacing: 0.1em;
    color: #9aa0a6;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px 5px;
    background: #17181a;
}
.cs-bm-row .nm { flex: 1 1 auto; min-width: 0; font-size: 13.5px; font-weight: 600; color: #e7e9eb; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-bm-row .pr { flex: 0 0 auto; font-size: 13px; font-weight: 700; color: var(--accent, #f6b265); font-variant-numeric: tabular-nums; }

/* right: preview */
.cs-bm-view {
    flex: 0 0 320px;
    display: flex;
    flex-direction: column;
    padding: 16px;
    background: #121314;
}
.cs-bm-view .pic {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #232323;
    border-radius: 10px;
    background: #151617;
    margin-bottom: 12px;
}
.cs-bm-view .pic img { max-width: 92%; max-height: 92%; display: block; }
.cs-bm-view .pic .badge { font-size: 11px; letter-spacing: 0.16em; color: #8a8f95; }
.cs-bm-view h3 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: 0.01em; }
.cs-bm-view .sub { margin: 3px 0 12px; font-size: 10.5px; letter-spacing: 0.16em; color: #8a8f95; }
.cs-bm-view .prline {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 12px;
    border-top: 1px solid #232323;
}
.cs-bm-view .prline .lbl { font-size: 10.5px; letter-spacing: 0.16em; color: #8a8f95; }
.cs-bm-view .prline .val { font-size: 24px; font-weight: 800; color: var(--accent, #f6b265); font-variant-numeric: tabular-nums; }
.cs-bm-buy {
    margin-top: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 14px;
    border: 1px solid var(--accent, #f6b265);
    border-radius: 9px;
    background: rgba(246, 178, 101, 0.12);
    color: var(--accent, #f6b265);
    font: 800 14px var(--ui-font, system-ui, sans-serif);
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease;
}
.cs-bm-buy:hover { background: var(--accent, #f6b265); color: #101010; }
.cs-bm-buy em { font-style: normal; font-size: 10px; letter-spacing: 0.14em; opacity: 0.8; }

/* ---------- bottom hint bar ---------- */
.cs-bm-foot {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 18px;
    border-top: 1px solid #232323;
    background: #121314;
    font-size: 11px;
    color: #8a8f95;
}
.cs-bm-foot b { color: #d6d9dc; font-weight: 700; }
.cs-bm-foot .sep { color: #333; }

/* toast on purchase */
.cs-bm-toast {
    position: absolute;
    left: 50%;
    bottom: 58px;
    transform: translateX(-50%);
    padding: 8px 14px;
    border: 1px solid #3a3126;
    border-radius: 8px;
    background: #1d1a16;
    color: var(--accent, #f6b265);
    font-size: 12.5px;
    font-weight: 700;
    opacity: 0;
    transition: opacity 140ms ease;
    pointer-events: none;
}
.cs-bm-toast.show { opacity: 1; }

@media (max-width: 900px) {
    .cs-bm-view { display: none; }
    .cs-bm-cats { flex-basis: 200px; }
}
