/* ==================== ТОКЕНЫ ==================== */
:root {
    --void: #14151a;
    --slate: #1c1e25;
    --slate-2: #262932;
    --slate-border: #34373f;
    --bone: #ece9e2;
    --bone-dim: #9b9da8;

    --common: #a6acb8;
    --rare: #4fc8e8;
    --epic: #c77dff;
    --legendary: #f2b84b;
    --success: #6fcf7a;
    --danger: #e8615d;

    --font-display: 'Silkscreen', monospace;
    --font-body: 'Golos Text', 'Segoe UI', sans-serif;

    --radius-s: 8px;
    --radius-m: 14px;
    --radius-l: 22px;
}

/* ==================== БАЗА ==================== */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

html, body {
    height: 100%;
}

body {
    margin: 0;
    background: var(--void);
    color: var(--bone);
    font-family: var(--font-body);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.site-header { flex: none; }
main { flex: 1 0 auto; }
.site-footer { flex: none; }

a { color: inherit; text-decoration: none; }

.wrap {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

img { max-width: 100%; display: block; }

/* Фоновое сияние — единственный декоративный акцент на весь сайт */
.bg-glow {
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(650px 420px at 82% -6%, rgba(199, 125, 255, 0.16), transparent 60%),
        radial-gradient(550px 380px at 12% 8%, rgba(79, 200, 232, 0.10), transparent 60%);
    pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
    .item-card, .btn, .online-pill__dot, .cart-drawer, .cart-overlay { transition-duration: 180ms; }
}

/* ==================== ШАПКА ==================== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(20, 21, 26, 0.86);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--slate-border);
}

.site-header__row {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 68px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 15px;
    letter-spacing: 0.5px;
    margin-right: auto;
}

.brand__mark {
    color: var(--legendary);
    font-size: 18px;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 24px;
    font-size: 15px;
    font-weight: 600;
}

.main-nav a {
    color: var(--bone-dim);
    padding: 6px 0;
    border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.is-active {
    color: var(--bone);
    border-bottom-color: var(--legendary);
}

.main-nav__soon {
    color: #565963;
    cursor: default;
    font-size: 13px;
}

.auth-pill {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 14px;
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bone-dim);
    white-space: nowrap;
}

.auth-pill:hover { border-color: var(--rare); color: var(--bone); }

.auth-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--rare);
    flex: none;
}

.online-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--bone-dim);
    white-space: nowrap;
}

.online-pill__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
}

.online-pill__dot.is-online { background: var(--success); box-shadow: 0 0 8px var(--success); }
.online-pill__dot.is-offline { background: var(--danger); }

.cart-toggle {
    position: relative;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-s);
    background: var(--slate);
    border: 1px solid var(--slate-border);
    color: var(--bone);
    font-size: 18px;
    cursor: pointer;
}

.cart-toggle:hover { border-color: var(--legendary); }

.cart-toggle__count {
    position: absolute;
    top: -6px;
    right: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--legendary);
    color: var(--void);
    font-size: 11px;
    font-weight: 800;
    display: grid;
    place-items: center;
    font-family: var(--font-display);
}

/* ==================== КНОПКИ ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: var(--radius-s);
    border: 1px solid transparent;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    transition: transform 120ms ease, filter 120ms ease;
}

.btn:hover { filter: brightness(1.08); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; filter: none; }

.btn--legendary {
    background: var(--legendary);
    color: #24170a;
}

.btn--ghost {
    background: transparent;
    border-color: var(--slate-border);
    color: var(--bone);
}

.btn--block { width: 100%; }
.btn--small { padding: 9px 14px; font-size: 13px; }

/* ==================== HERO ==================== */
.hero {
    padding: 64px 0 56px;
}

.hero__row {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 48px;
    align-items: center;
}

.eyebrow {
    font-family: var(--font-display);
    font-size: 12px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--rare);
    display: block;
    margin-bottom: 18px;
}

.hero h1 {
    font-size: 44px;
    line-height: 1.12;
    margin: 0 0 18px;
    letter-spacing: -0.5px;
}

.hero h1 em {
    font-style: normal;
    color: var(--legendary);
}

.hero p {
    color: var(--bone-dim);
    font-size: 17px;
    max-width: 46ch;
    margin: 0 0 30px;
}

.hero__actions {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

/* Витрина из трёх карточек редкости — фирменный элемент сайта */
.loot-stack {
    position: relative;
    height: 340px;
}

.loot-card {
    position: absolute;
    width: 220px;
    padding: 20px;
    border-radius: var(--radius-m);
    background: linear-gradient(180deg, var(--slate-2), var(--slate));
    border: 1px solid var(--slate-border);
    box-shadow: 0 30px 60px -20px rgba(0,0,0,0.6);
}

.loot-card__glyph {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-s);
    display: grid;
    place-items: center;
    font-size: 22px;
    margin-bottom: 14px;
}

.loot-card__tier {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 4px;
}

.loot-card__name { font-weight: 700; font-size: 15px; margin: 0; }

.loot-card--common { left: 0; top: 40px; transform: rotate(-6deg); z-index: 1; }
.loot-card--rare { left: 110px; top: 0; transform: rotate(2deg); z-index: 2; }
.loot-card--legendary { left: 210px; top: 60px; transform: rotate(9deg); z-index: 3; }

.loot-card--common { box-shadow: 0 20px 50px -20px rgba(166,172,184,0.25); }
.loot-card--rare { box-shadow: 0 24px 60px -18px rgba(79,200,232,0.35); border-color: rgba(79,200,232,0.4); }
.loot-card--legendary { box-shadow: 0 28px 70px -16px rgba(242,184,75,0.4); border-color: rgba(242,184,75,0.5); }

.loot-card--common .loot-card__glyph { background: rgba(166,172,184,0.15); color: var(--common); }
.loot-card--rare .loot-card__glyph { background: rgba(79,200,232,0.15); color: var(--rare); }
.loot-card--legendary .loot-card__glyph { background: rgba(242,184,75,0.18); color: var(--legendary); }

.loot-card--common .loot-card__tier { color: var(--common); }
.loot-card--rare .loot-card__tier { color: var(--rare); }
.loot-card--legendary .loot-card__tier { color: var(--legendary); }

/* ==================== СЕКЦИИ / ЗАГОЛОВКИ ==================== */
.section { padding: 40px 0; }

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.section-head h2 { font-size: 26px; margin: 0; }
.section-head p { color: var(--bone-dim); margin: 4px 0 0; font-size: 15px; }

/* ==================== ФИЛЬТРЫ ТИРОВ ==================== */
.tier-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.tier-filter {
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid var(--slate-border);
    background: var(--slate);
    color: var(--bone-dim);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.tier-filter.is-active { color: var(--void); background: var(--bone); border-color: var(--bone); }

/* ==================== СЕТКА ТОВАРОВ ==================== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 18px;
}

.item-card {
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-m);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--tier-color, var(--common));
}

.item-card[data-tier="common"] { --tier-color: var(--common); }
.item-card[data-tier="rare"] { --tier-color: var(--rare); }
.item-card[data-tier="epic"] { --tier-color: var(--epic); }
.item-card[data-tier="legendary"] { --tier-color: var(--legendary); }

.item-card:hover { border-color: var(--tier-color, var(--slate-border)); }

.item-card__media {
    width: 100%;
    aspect-ratio: 1;
    border-radius: var(--radius-s);
    background: var(--slate-2);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.item-card__media img { width: 100%; height: 100%; object-fit: contain; padding: 10px; }

.item-card__media .fallback-glyph {
    font-size: 30px;
    color: var(--tier-color, var(--common));
}

.item-card__tier {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--tier-color, var(--common));
    margin: 0;
}

.item-card__name {
    font-weight: 700;
    font-size: 16px;
    margin: 0;
}

.item-card__desc {
    color: var(--bone-dim);
    font-size: 13px;
    margin: -6px 0 0;
    flex: 1;
}

.item-card__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.item-card__price {
    font-family: var(--font-display);
    font-size: 16px;
    color: var(--legendary);
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--bone-dim);
    border: 1px dashed var(--slate-border);
    border-radius: var(--radius-m);
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.order-card {
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-m);
    padding: 16px 18px;
}

.order-card__head {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.order-card__id { font-weight: 700; font-size: 14px; }
.order-card__date { color: var(--bone-dim); font-size: 13px; }
.order-card__cost {
    margin-left: auto;
    font-family: var(--font-display);
    color: var(--legendary);
    font-size: 15px;
}

.order-card__items {
    margin: 0;
    padding-left: 18px;
    color: var(--bone-dim);
    font-size: 14px;
}

.order-card__items li { margin: 2px 0; }

/* ==================== КОРЗИНА ==================== */
.cart-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 13, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 30;
}

.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(400px, 100vw);
    background: var(--slate);
    border-left: 1px solid var(--slate-border);
    z-index: 31;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 220ms ease;
}

.cart-drawer.is-open { transform: translateX(0); }

.cart-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--slate-border);
}

.cart-drawer__head h2 { margin: 0; font-size: 18px; }

.cart-drawer__close {
    background: none;
    border: none;
    color: var(--bone-dim);
    font-size: 18px;
    cursor: pointer;
}

.cart-drawer__items {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
}

.cart-empty { color: var(--bone-dim); font-size: 14px; }

.cart-line {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--slate-border);
}

.cart-line__name { flex: 1; font-size: 14px; font-weight: 600; }
.cart-line__price { color: var(--bone-dim); font-size: 13px; }

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-control button {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    border: 1px solid var(--slate-border);
    background: var(--slate-2);
    color: var(--bone);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
}

.cart-drawer__foot {
    padding: 20px;
    border-top: 1px solid var(--slate-border);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--legendary);
}

.cart-form { display: flex; flex-direction: column; gap: 12px; }

.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--bone-dim); }

.field input {
    background: var(--slate-2);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-s);
    padding: 11px 12px;
    color: var(--bone);
    font-family: var(--font-body);
    font-size: 14px;
}

.field textarea,
.field select {
    background: var(--slate-2);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-s);
    padding: 11px 12px;
    color: var(--bone);
    font-family: var(--font-body);
    font-size: 14px;
    resize: vertical;
}

.field input:focus,
.tier-filter:focus-visible,
.btn:focus-visible,
.cart-toggle:focus-visible,
a:focus-visible {
    outline: 2px solid var(--rare);
    outline-offset: 2px;
}

.field--checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--bone-dim);
}

.field--checkbox input {
    margin-top: 2px;
    accent-color: var(--legendary);
    flex: none;
}

.checkout-error {
    background: rgba(232, 97, 93, 0.12);
    border: 1px solid rgba(232, 97, 93, 0.4);
    color: #ffb4b1;
    padding: 10px 12px;
    border-radius: var(--radius-s);
    font-size: 13px;
}

/* ==================== ПОДДЕРЖКА / ТИКЕТЫ ==================== */
.support-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 36px;
    align-items: start;
}

.ticket-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ticket-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-s);
    font-size: 14px;
    font-weight: 600;
}

.ticket-row:hover { border-color: var(--rare); }

.ticket-row__subject { flex: 1; }

.status-badge {
    font-family: var(--font-display);
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-badge--open { background: rgba(79, 200, 232, 0.15); color: var(--rare); }
.status-badge--in_progress { background: rgba(242, 184, 75, 0.15); color: var(--legendary); }
.status-badge--closed { background: rgba(166, 172, 184, 0.15); color: var(--common); }

.ticket-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ticket-msg {
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-m);
    padding: 14px 16px;
    max-width: 85%;
}

.ticket-msg--admin {
    align-self: flex-end;
    background: rgba(79, 200, 232, 0.08);
    border-color: rgba(79, 200, 232, 0.3);
}

.ticket-msg__meta {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
    color: var(--bone-dim);
    margin-bottom: 6px;
}

.ticket-msg__body {
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 720px) {
    .support-layout { grid-template-columns: 1fr; }
    .ticket-msg { max-width: 100%; }
}

/* ==================== СТАТИЧНЫЙ КОНТЕНТ (правила и т.п.) ==================== */
.prose { max-width: 70ch; }
.prose h1 { font-size: 32px; margin-bottom: 22px; }
.prose h2 { font-size: 20px; margin: 32px 0 12px; }
.prose p, .prose li { color: var(--bone-dim); font-size: 15px; }
.prose ul { padding-left: 20px; }

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 13, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 50;
}

.confirm-overlay.is-open { opacity: 1; pointer-events: auto; }

.confirm-dialog {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -46%);
    width: min(340px, calc(100vw - 32px));
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-radius: var(--radius-m);
    padding: 22px;
    z-index: 51;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
}

.confirm-dialog.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
}

.confirm-dialog p {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--bone);
}

.confirm-dialog__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* ==================== МОДАЛКА ТОВАРА ==================== */
.item-card[data-view-product] { cursor: pointer; }

.product-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 13, 0.6);
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease;
    z-index: 40;
}

.product-modal-overlay.is-open { opacity: 1; pointer-events: auto; }

.product-modal {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--slate);
    border: 1px solid var(--slate-border);
    border-top-left-radius: var(--radius-l);
    border-top-right-radius: var(--radius-l);
    padding: 24px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 41;
    opacity: 0;
    pointer-events: none;
    transform: translateY(100%);
    transition: opacity 200ms ease, transform 220ms ease;
}

.product-modal.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.product-modal::-webkit-scrollbar { width: 8px; }
.product-modal::-webkit-scrollbar-track { background: transparent; }
.product-modal::-webkit-scrollbar-thumb {
    background: var(--slate-border);
    border-radius: 999px;
}
.product-modal::-webkit-scrollbar-thumb:hover { background: var(--legendary); }
.product-modal { scrollbar-width: thin; scrollbar-color: var(--slate-border) transparent; }

.product-modal__close {
    position: sticky;
    top: 0;
    float: right;
    background: var(--slate-2);
    border: 1px solid var(--slate-border);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    color: var(--bone-dim);
    font-size: 16px;
    cursor: pointer;
    z-index: 1;
}

.product-modal__media {
    width: 100%;
    max-height: 45vh;
    min-height: 120px;
    border-radius: var(--radius-s);
    background: var(--slate-2);
    display: grid;
    place-items: center;
    margin-bottom: 14px;
    overflow: hidden;
    font-size: 32px;
    color: var(--bone-dim);
    clear: both;
}

.product-modal__media img { width: 100%; height: auto; max-height: 45vh; object-fit: contain; display: block; }

.product-modal__name { font-size: 20px; margin: 4px 0 10px; overflow-wrap: anywhere; }

.product-modal__desc {
    color: var(--bone-dim);
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    margin: 0 0 20px;
}

.product-modal__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

/* ==================== ФУТЕР ==================== */
.site-footer {
    border-top: 1px solid var(--slate-border);
    padding: 24px 0;
    margin-top: 40px;
}

.site-footer__row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 20px;
    color: var(--bone-dim);
    font-size: 13px;
}

.site-footer__links {
    display: flex;
    gap: 16px;
}

.site-footer__links a:hover { color: var(--bone); }

/* ==================== АДАПТИВ ==================== */
@media (max-width: 860px) {
    .main-nav { display: none; }
    .hero__row { grid-template-columns: 1fr; }
    .loot-stack { height: 260px; margin-top: 20px; }
    .hero h1 { font-size: 32px; }
}

@media (max-width: 480px) {
    .site-header__row { gap: 8px; }
    .online-pill span:last-child { display: none; }
    .loot-stack { display: none; }
    .hero { padding: 40px 0; }
}

@media (max-width: 380px) {
    .auth-pill { display: none; }
}
