.sg-page {
    position: relative;
    z-index: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 1260px;
    margin: 0 auto 46px;
}

.sg-bg {
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background: #0b1420;
}

.sg-bg__image {
    position: absolute;
    inset: -42px;
    background-size: cover;
    background-position: center;
    filter: blur(26px) saturate(1.08);
    opacity: 0.34;
    transform: scale(1.04);
}

.sg-bg__fade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 18% 16%, rgba(59, 130, 246, 0.18), transparent 28%),
        radial-gradient(circle at 78% 12%, rgba(16, 185, 129, 0.12), transparent 28%),
        linear-gradient(180deg, rgba(12, 18, 32, 0.62), #0d1824 62%, #0d1824);
}

.sg-hero {
    display: grid;
    grid-template-columns: minmax(280px, 390px) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
    padding: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 8px;
    background:
        linear-gradient(135deg, rgba(20, 31, 46, 0.88), rgba(13, 27, 39, 0.76)),
        rgba(15, 23, 42, 0.72);
    box-shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
    overflow: hidden;
}

.sg-hero__art {
    position: relative;
    display: block;
    height: 154px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(2, 6, 23, 0.42);
    color: rgba(255, 255, 255, 0.7);
    isolation: isolate;
}

.sg-hero__art-bg,
.sg-hero__art-img,
.sg-item__image span {
    position: absolute;
    inset: 0;
    background-position: center;
    background-repeat: no-repeat;
}

.sg-hero__art-bg {
    background-size: cover;
    filter: blur(12px) saturate(1.12);
    opacity: 0.48;
    transform: scale(1.1);
}

.sg-hero__art-img {
    background-size: contain;
    z-index: 1;
}

.sg-hero__art > i {
    display: grid;
    place-items: center;
    height: 100%;
    font-size: 3rem;
}

.sg-hero__body {
    min-width: 0;
}

.sg-hero h1 {
    margin: 0;
    max-width: 760px;
    color: #fff;
    font-size: clamp(1.55rem, 2.1vw, 1.85rem);
    line-height: 1.06;
    letter-spacing: 0;
    overflow-wrap: anywhere;
}

.sg-item__badges span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    padding: 4px 9px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 6px;
    background: rgba(15, 23, 42, 0.42);
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.sg-summary {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin-top: 14px;
    color: var(--text-muted);
}

.sg-summary__item {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 78px;
    padding: 1px 14px 1px 0;
}

.sg-summary__item + .sg-summary__item {
    padding-left: 14px;
}

.sg-summary__item + .sg-summary__item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    bottom: 7px;
    width: 1px;
    background: linear-gradient(180deg, transparent, rgba(148, 163, 184, 0.34), transparent);
}

.sg-summary__item > svg,
.sg-summary__item > i {
    width: 14px;
    height: 14px;
    color: rgba(56, 189, 248, 0.72);
    filter: drop-shadow(0 0 10px rgba(56, 189, 248, 0.16));
}

.sg-summary__item span {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sg-summary strong {
    color: #fff;
    font-size: 1.05rem;
    line-height: 1;
    text-shadow: 0 0 22px rgba(59, 130, 246, 0.2);
}

.sg-summary em {
    color: var(--text-muted);
    font-style: normal;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
}

.sg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.sg-filter-tabs,
.sg-sort-tabs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(16, 29, 42, 0.76);
}

.sg-filter-tabs {
    margin-right: auto;
}

.sg-filter-tabs button,
.sg-sort-tabs button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 30px;
    padding: 0 11px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    font: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.sg-filter-tabs button svg,
.sg-filter-tabs button i,
.sg-sort-tabs button svg,
.sg-sort-tabs button i {
    width: 14px;
    height: 14px;
    font-size: 0.86rem;
}

.sg-filter-tabs button.is-active,
.sg-sort-tabs button.is-active {
    color: #fff;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.92), rgba(14, 165, 233, 0.86));
    box-shadow: 0 10px 26px rgba(14, 165, 233, 0.22);
}

.sg-list-shell {
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 8px;
    background: rgba(16, 29, 42, 0.74);
    overflow: hidden;
}

.sg-list-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.sg-list-head h2 {
    margin: 0;
    color: #fff;
    font-size: 0.98rem;
    font-weight: 700;
}

.sg-list {
    min-height: 72px;
}

.sg-list:empty {
    min-height: 0;
}

.sg-list.is-loading {
    opacity: 0.58;
}

.sg-item {
    position: relative;
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr) max-content max-content;
    align-items: center;
    gap: 12px;
    min-height: 74px;
    padding: 10px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.12);
    background: linear-gradient(90deg, rgba(13, 25, 38, 0.72), rgba(13, 25, 38, 0.44));
    overflow: hidden;
    transition: background 0.16s ease, border-color 0.16s ease;
}

.sg-item:hover {
    background: linear-gradient(90deg, rgba(18, 32, 48, 0.82), rgba(13, 25, 38, 0.58));
}

.sg-item::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 3px;
    background: var(--primary);
    opacity: 0;
    transition: opacity 0.16s ease;
    z-index: 2;
}

.sg-item:hover::before {
    opacity: 0.9;
}

.sg-item__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.055;
    filter: blur(4px) saturate(1.16);
    pointer-events: none;
}

.sg-item:last-child {
    border-bottom: 0;
}

.sg-item--private {
    background: linear-gradient(90deg, rgba(30, 41, 59, 0.76), rgba(13, 25, 38, 0.42));
}

.sg-item__image {
    position: relative;
    z-index: 1;
    display: block;
    width: 116px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background-color: rgba(2, 6, 23, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sg-item__image span {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transition: transform 0.18s ease;
}

.sg-item:hover .sg-item__image span {
    transform: scale(1.035);
}

.sg-item__main {
    position: relative;
    z-index: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.sg-item__title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
}

.sg-item__title {
    flex: 0 1 auto;
    min-width: 90px;
    max-width: 100%;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.22;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-item__title:hover {
    color: var(--primary);
}

.sg-item__title--private {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.sg-item__badges {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    max-width: 45%;
    min-width: 0;
    overflow: hidden;
    flex-shrink: 0;
}

.sg-item__badges .ga-tag {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 92px;
    padding: 2px 6px;
    font-size: 0.6rem;
    letter-spacing: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-item__badges .ga-tag i {
    flex-shrink: 0;
}

.sg-item__meta,
.sg-item__stats,
.sg-item__creator {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px 11px;
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 500;
}

.sg-item__meta span,
.sg-item__stats span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    line-height: 1.2;
    white-space: nowrap;
}

.sg-item__meta i,
.sg-item__stats i,
.sg-item__creator i {
    font-size: 0.8rem;
}

.sg-item__status--active {
    color: #34d399;
}

.sg-item__status--ended {
    color: #cbd5e1;
}

.sg-item__stats {
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: 0;
    padding: 0 12px;
    border-inline: 1px solid rgba(148, 163, 184, 0.12);
}

.sg-item__stats span:first-child {
    color: #fbbf24;
}

.sg-item__stats span:nth-child(2) {
    color: #a5b4fc;
}

.sg-item__creator {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.sg-item__creator-avatar {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.sg-item__creator-avatar .avatar-svg {
    display: block;
}

.sg-item__creator-level {
    position: absolute;
    left: 50%;
    bottom: -6px;
    transform: translateX(-50%);
    padding: 0 4px;
    border-radius: 4px;
    background: rgba(2, 6, 23, 0.88);
    border: 1px solid rgba(148, 163, 184, 0.22);
    color: #fff;
    font-size: 0.56rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
}

.sg-item__creator-text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    text-align: right;
}

.sg-item__creator-text > span:last-child {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: nowrap;
}

.sg-item__creator-name {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 138px;
    color: #fff;
    font-size: 0.82rem;
    font-weight: 650;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sg-item__creator-name:hover {
    color: var(--primary);
}

.sg-empty {
    display: grid;
    place-items: center;
    gap: 8px;
    min-height: 96px;
    padding: 22px 16px;
    color: var(--text-muted);
}

.sg-empty[hidden] {
    display: none !important;
}

.sg-empty i {
    font-size: 1.2rem;
}

.sg-empty strong {
    color: #fff;
    font-size: 0.92rem;
    font-weight: 650;
}

.sg-pagination {
    padding: 0;
    margin-top: -4px;
}

.sg-pagination:empty {
    display: none;
}

@media (max-width: 980px) {
    .sg-hero {
        grid-template-columns: 1fr;
    }

    .sg-summary {
        width: 100%;
        min-width: 0;
    }

    .sg-item {
        grid-template-columns: 100px minmax(0, 1fr) minmax(128px, auto);
    }

    .sg-item__image {
        width: 100px;
    }

    .sg-item__creator {
        grid-column: 2 / 4;
        justify-content: flex-start;
        padding-top: 2px;
    }

    .sg-item__creator-text {
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .sg-page {
        gap: 14px;
    }

    .sg-hero {
        padding: 14px;
    }

    .sg-hero__art {
        height: 138px;
    }

    .sg-hero h1 {
        font-size: 1.65rem;
    }

    .sg-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .sg-filter-tabs,
    .sg-sort-tabs {
        width: 100%;
    }

    .sg-filter-tabs button,
    .sg-sort-tabs button {
        flex: 1;
    }

    .sg-item {
        grid-template-columns: 86px minmax(0, 1fr);
        align-items: start;
        gap: 10px;
    }

    .sg-item__image {
        width: 86px;
        height: 44px;
    }

    .sg-item__title-row {
        align-items: center;
        flex-direction: row;
    }

    .sg-item__stats,
    .sg-item__creator {
        grid-column: 1 / -1;
        justify-content: flex-start;
        min-width: 0;
        padding: 0;
        border-inline: 0;
    }

    .sg-item__creator-text {
        align-items: flex-start;
    }
}
