/* RxStudio — тихий тёмный интерфейс: много воздуха, один фиолетовый акцент */
@font-face {
    font-family: "Manrope";
    src: url("assets/Manrope.ttf") format("truetype");
    font-weight: 200 800;
    font-display: swap;
}

:root {
    --bg: #0c0c0f;
    --panel: #141419;
    --panel-2: #1a1a21;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .13);
    --text: #f2f2f5;
    --sub: #a3a3ad;
    --muted: #6f6f7a;
    --accent: #9b51f5;
    --accent-2: #c28cff;
    --accent-soft: rgba(155, 81, 245, .15);
    --good: #2fbf71;
    --good-soft: rgba(47, 191, 113, .13);
    --bad: #ef4f4f;
    --bad-soft: rgba(239, 79, 79, .12);
    --sale: #ff7a45;
    --radius: 16px;
    --wrap: 1160px;
    --ease: cubic-bezier(.22, 1, .36, 1);
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.6 "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}
body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 420px;
    background: radial-gradient(600px 260px at 50% -60px, rgba(155, 81, 245, .2), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; flex: none; }
img { display: block; }
h1, h2, h3 { margin: 0; letter-spacing: -.02em; }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; padding-bottom: 60px; }

/* ---------- шапка ---------- */
.top {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(12, 12, 15, .82);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 28px; height: 64px; }
.brand img { border-radius: 9px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-size: 18px; font-weight: 600; }
.brand:hover { text-decoration: none; }
.brand b { font-weight: 800; color: var(--accent-2); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a {
    position: relative;
    padding: 7px 13px;
    border-radius: 10px;
    color: var(--sub);
    font-weight: 600;
    font-size: 14px;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.nav a.on { color: var(--text); background: var(--panel-2); }
.top-actions { display: flex; align-items: center; gap: 10px; }

.dot-count {
    display: inline-grid;
    place-items: center;
    min-width: 18px;
    height: 18px;
    margin-left: 6px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    vertical-align: 1px;
}

/* ---------- кнопки ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 18px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--panel);
    color: var(--text);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: var(--panel-2); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.primary { background: var(--accent); border-color: transparent; color: #fff; }
.btn.primary:hover { background: #8a3fe6; }
.btn.discord { background: #5865f2; border-color: transparent; color: #fff; height: 44px; }
.btn.discord:hover { background: #4752c4; text-decoration: none; }
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0 6px; color: var(--muted); font-size: 12.5px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line-strong); }
.btn.ghost { background: transparent; }
.btn.good { background: var(--good); border-color: transparent; color: #fff; }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn.small { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.wide { width: 100%; }
.btn svg { width: 17px; height: 17px; }

.me { position: relative; }
.me-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 14px 0 7px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--panel);
    font-weight: 700;
    cursor: pointer;
}
.me-btn img { border-radius: 6px; image-rendering: pixelated; }
.me-menu {
    position: absolute;
    right: 0;
    top: 48px;
    min-width: 210px;
    padding: 6px;
    border: 1px solid var(--line-strong);
    border-radius: 13px;
    background: var(--panel);
    box-shadow: 0 20px 50px rgba(0, 0, 0, .45);
}
.me-menu a, .me-menu button {
    display: block;
    width: 100%;
    padding: 9px 12px;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--text);
    text-align: left;
    font-size: 14px;
    cursor: pointer;
}
.me-menu a:hover, .me-menu button:hover { background: var(--panel-2); text-decoration: none; }

/* ---------- каталог ---------- */
.hero { padding: 64px 0 34px; text-align: center; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); line-height: 1.12; font-weight: 800; }
.hero h1 span { color: var(--accent-2); }
.hero p { max-width: 560px; margin: 14px auto 0; color: var(--sub); font-size: 16px; white-space: pre-line; }

.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 22px; }
.search {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 1 300px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--panel);
    color: var(--muted);
}
.search:focus-within { border-color: var(--accent); }
.search input, label.search input[type] { flex: 1; min-width: 0; min-height: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0; background: none; color: var(--text); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
    height: 36px;
    padding: 0 15px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background: transparent;
    color: var(--sub);
    font-weight: 600;
    font-size: 13.5px;
    cursor: pointer;
}
.chip:hover { color: var(--text); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    color: var(--text);
    transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); text-decoration: none; }
.cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #2a1245, #150a22);
    overflow: hidden;
}
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover .placeholder { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255, 255, 255, .22); }
.cover .placeholder svg { width: 46px; height: 46px; }
.badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 8px;
    background: var(--sale);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}
.badge.owned { left: auto; right: 10px; background: var(--good); }
.badge.hidden-badge { left: auto; right: 10px; background: #555; }
.card-body { display: flex; flex-direction: column; flex: 1; gap: 6px; padding: 15px 16px 16px; }
.card-cat { color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.card h3 { font-size: 17px; font-weight: 800; }
.card p { margin: 0; flex: 1; color: var(--sub); font-size: 13.5px; line-height: 1.5; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.card-foot .ver { color: var(--muted); font-size: 12.5px; }

.price { display: flex; align-items: baseline; gap: 8px; font-weight: 800; font-size: 17px; }
.price s { color: var(--muted); font-weight: 600; font-size: 13.5px; }
.price.free { color: var(--good); }

.empty { padding: 60px 0; text-align: center; color: var(--muted); }

/* ---------- страница плагина ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 28px 0 18px; color: var(--sub); font-weight: 600; font-size: 14px; }
.back:hover { color: var(--text); text-decoration: none; }
.plugin { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 26px; align-items: start; }
.plugin .cover { border-radius: var(--radius); border: 1px solid var(--line); }
.plugin-head { margin: 22px 0 6px; }
.plugin-head h1 { font-size: 32px; font-weight: 800; }
.plugin-head p { margin: 6px 0 0; color: var(--sub); font-size: 16px; }
.desc { margin-top: 22px; color: #d6d6dc; line-height: 1.75; }
.desc h3 { margin: 22px 0 8px; font-size: 18px; color: var(--text); }
.desc p { margin: 0 0 12px; }
.desc ul { margin: 0 0 12px; padding-left: 20px; }
.desc code { padding: 1px 6px; border-radius: 6px; background: var(--panel-2); font-size: 13px; }
.side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 14px; }
.box { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.box .price { font-size: 28px; }
.box .price s { font-size: 16px; }
.sale-note { margin: 4px 0 0; color: var(--sale); font-size: 13px; font-weight: 700; }
.box .btn { margin-top: 16px; }
.box-note { margin: 12px 0 0; color: var(--muted); font-size: 12.5px; text-align: center; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }
.features { margin: 0; padding: 0; list-style: none; display: grid; gap: 9px; }
.features li { display: flex; gap: 10px; font-size: 14px; color: #d6d6dc; }
.features svg { margin-top: 3px; width: 16px; height: 16px; color: var(--good); }
.box h4 { margin: 0 0 12px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- мои плагины ---------- */
.page-title { margin: 36px 0 20px; font-size: 26px; font-weight: 800; }
.my-list { display: grid; gap: 10px; }
.row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--panel);
}
.row .thumb { width: 74px; aspect-ratio: 16 / 9; flex: none; border-radius: 8px; overflow: hidden; background: linear-gradient(135deg, #221c3d, #15131f); }
.row .thumb img { width: 100%; height: 100%; object-fit: cover; }
.row-main { flex: 1; min-width: 0; }
.row-main b { display: block; font-size: 15px; }
.row-main span { color: var(--muted); font-size: 13px; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.status { padding: 3px 10px; border-radius: 8px; font-size: 12.5px; font-weight: 700; }
.status.new { background: var(--accent-soft); color: var(--accent-2); }
.status.done { background: var(--good-soft); color: var(--good); }
.status.rejected { background: var(--bad-soft); color: var(--bad); }
.section-label { margin: 26px 0 10px; color: var(--muted); font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }

/* ---------- админка ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; padding: 5px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); width: max-content; max-width: 100%; }
.tabs button {
    height: 36px;
    padding: 0 14px;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--sub);
    font-weight: 700;
    font-size: 13.5px;
    cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--panel-2); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.toolbar .grow { flex: 1; }
.list { display: grid; gap: 8px; }
.muted { color: var(--muted); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 7px; background: var(--panel-2); color: var(--sub); font-size: 12px; font-weight: 700; }
.tag.sale { background: rgba(255, 122, 69, .14); color: var(--sale); }
.tag.off { background: var(--bad-soft); color: var(--bad); }
.tag.admin { background: var(--accent-soft); color: var(--accent-2); }

.form { display: grid; gap: 14px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label { display: grid; gap: 6px; color: var(--sub); font-size: 13px; font-weight: 600; }
input:not([type=checkbox]):not([type=file]), select, textarea {
    width: 100%;
    min-height: 42px;
    padding: 9px 13px;
    border: 1px solid var(--line-strong);
    border-radius: 11px;
    background: var(--bg);
    color: var(--text);
    font-size: 14.5px;
    outline: 0;
}
textarea { resize: vertical; min-height: 110px; line-height: 1.55; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
.check { display: flex; align-items: center; gap: 9px; color: var(--text); font-size: 14px; cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--accent); }
.field-note { color: var(--muted); font-size: 12px; font-weight: 500; }
.upload { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px dashed var(--line-strong); border-radius: 12px; }
.upload .thumb { width: 96px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--panel-2); flex: none; }
.upload .thumb img { width: 100%; height: 100%; object-fit: cover; }
.upload-info { flex: 1; min-width: 0; font-size: 13px; color: var(--sub); }
.progress { height: 4px; margin-top: 6px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; margin-top: 6px; }
.form-actions .right { display: flex; gap: 10px; margin-left: auto; }

.discount-row { display: grid; grid-template-columns: minmax(0, 1fr) 110px 190px auto; gap: 10px; align-items: center; }

.user-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.user-head img { border-radius: 10px; image-rendering: pixelated; }
.user-head b { font-size: 20px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 8px 14px; font-size: 14px; margin-bottom: 18px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- окна ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, .62);
    backdrop-filter: blur(4px);
    overflow-y: auto;
    animation: fade .2s var(--ease);
}
.modal-card {
    position: relative;
    width: 100%;
    max-width: 640px;
    padding: 26px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .5);
    animation: rise .3s var(--ease);
}
.modal-card.narrow { max-width: 420px; }
.modal-card.wide-card { max-width: 760px; }
.modal-card h3 { font-size: 21px; margin-bottom: 4px; }
.modal-x {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: none;
    color: var(--muted);
    cursor: pointer;
}
.modal-x:hover { background: var(--panel-2); color: var(--text); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-right: 40px; border-radius: 12px; background: var(--bg); }
.seg button { height: 36px; border: 0; border-radius: 9px; background: none; color: var(--sub); font-weight: 700; cursor: pointer; }
.seg button.on { background: var(--panel-2); color: var(--text); }
.hint { margin: 14px 0; color: var(--sub); font-size: 13.5px; }
.hint.small { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; }
form[data-form] { display: grid; gap: 12px; }
.form-error { min-height: 1em; margin: 0; color: var(--bad); font-size: 13px; }

.contact {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--bg);
}
.contact > svg { width: 22px; height: 22px; }
.contact.tg > svg { color: #2aa3e0; }
.contact.ds > svg { color: #6f7cff; }
.contact div { flex: 1; }
.contact b { display: block; }
.contact span { color: var(--muted); font-size: 12.5px; }
.contacts { display: grid; gap: 8px; margin: 16px 0; }
.message {
    position: relative;
    padding: 12px 46px 12px 14px;
    border-radius: 12px;
    background: var(--bg);
    border: 1px solid var(--line);
    font-size: 13.5px;
    color: #d6d6dc;
    white-space: pre-line;
}
.message .btn { position: absolute; top: 8px; right: 8px; width: 32px; padding: 0; }
.countries { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.steps { margin: 14px 0 0; padding-left: 20px; color: var(--sub); font-size: 13.5px; display: grid; gap: 4px; }

.toast {
    position: fixed;
    left: 50%;
    bottom: 26px;
    z-index: 60;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    padding: 11px 18px;
    border-radius: 12px;
    background: var(--panel-2);
    border: 1px solid var(--line-strong);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
    font-weight: 600;
    font-size: 14px;
    animation: rise .3s var(--ease);
}
.toast.bad { border-color: rgba(239, 79, 79, .45); color: #ff9c9c; }
.toast.ok { border-color: rgba(47, 191, 113, .4); }

.foot { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.foot-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; padding: 22px 20px; }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.toast { animation-name: toastIn; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } }

@media (max-width: 860px) {
    .plugin { grid-template-columns: 1fr; }
    .side { position: static; }
    .discount-row { grid-template-columns: 1fr 1fr; }
    .discount-row > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
    .wrap { padding: 0 16px; }
    .top-row { gap: 12px; }
    .brand span { display: none; }
    .nav a { padding: 7px 9px; }
    .icon-only span { display: none; }
    .icon-only { width: 40px; padding: 0; }
    .me-btn span { display: none; }
    .me-btn { padding: 0 7px; }
    .hero { padding: 40px 0 24px; }
    .form-grid { grid-template-columns: 1fr; }
    .row { flex-wrap: wrap; }
    .row-actions { width: 100%; justify-content: flex-start; }
    .kv { grid-template-columns: 1fr; }
    .modal-card { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
}
