:root {
    --bg: #0b0f14;
    --panel: rgba(255, 255, 255, 0.06);
    --panel-2: rgba(255, 255, 255, 0.04);
    --stroke: rgba(255, 255, 255, 0.12);
    --text: #e5e7eb;
    --muted: #94a3b8;
    --accent: #60a5fa;
    --accent2: #22c55e;
    --accent3: #f59e0b;
    --danger: #f87171;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(1200px 800px at 20% -10%,
            rgba(96, 165, 250, 0.12),
            transparent 60%),
        radial-gradient(1200px 800px at 90% 10%,
            rgba(34, 197, 94, 0.1),
            transparent 55%),
        radial-gradient(900px 700px at 50% 120%,
            rgba(234, 179, 8, 0.08),
            transparent 60%),
        var(--bg);
    font-family:
        system-ui,
        -apple-system,
        Segoe UI,
        Roboto,
        sans-serif;
}

a {
    color: inherit;
}

.header {
    padding: 16px 18px 10px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    position: relative;
    z-index: 5;
}

.leftHead {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
}

.homeBtn,
.statsBtn {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    border: 1px solid var(--stroke);
    background: rgba(255, 255, 255, 0.06);
    color: #2dff00;
    text-decoration: none;
    transition: all 0.15s ease;
    flex: 0 0 auto;
}

.homeBtn:hover,
.statsBtn:hover {
    background: rgba(96, 165, 250, 0.22);
    border-color: rgba(96, 165, 250, 0.55);
    transform: translateY(-2px);
}

h1 {
    margin: 0;
    font-size: 22px;
    letter-spacing: 0.2px;
}

.sub {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    max-width: 920px;
    line-height: 1.45;
}

.rightHead {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.searchWrap {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 14px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(6px);
}

.searchWrap svg {
    opacity: 0.9;
    flex: 0 0 auto;
}

#searchInput,
#sortSelect {
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    font-size: 14px;
}

#searchInput {
    width: 300px;
    max-width: 42vw;
}

#sortSelect {
    min-width: 170px;
}

#searchInput::placeholder {
    color: var(--muted);
}

#searchInput:focus,
#sortSelect:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.75);
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.16);
}

.pageMain {
    padding: 0 18px 18px;
}

.heroPanel,
.cardsPanel {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.03));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

.heroPanel {
    padding: 16px;
    margin-bottom: 16px;
}

.heroStats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}

.heroStat {
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 14px;
}

.heroStatLabel {
    color: var(--muted);
    font-size: 12px;
}

.heroStatValue {
    margin-top: 6px;
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}

.cardsPanelHead {
    padding: 14px 16px 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.cardsPanelTitle {
    margin: 0;
    font-size: 16px;
}

.cardsPanelSub {
    margin-top: 4px;
    font-size: 12px;
    color: var(--muted);
}

.cardsPanelBody {
    padding: 16px;
}

.countPill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
    font-size: 12px;
    color: var(--muted);
}

.collectionsGrid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.collectionCard {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.05),
            rgba(255, 255, 255, 0.03));
    padding: 14px;
    transition:
        transform 0.15s ease,
        border-color 0.15s ease,
        background 0.15s ease;
}

.collectionCard:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.35);
    background: linear-gradient(180deg,
            rgba(255, 255, 255, 0.07),
            rgba(255, 255, 255, 0.04));
}

.cardTop {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
}

.cardTitle {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    color: var(--accent);
}

.cardTitleLink {
    text-decoration: none;
}

.cardTitleLink:hover {
    color: var(--muted);
}

.cardSlug {
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
    word-break: break-word;
}

.cardStats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 14px;
}

.miniStat {
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px;
}

.miniStatLabel {
    font-size: 11px;
    color: var(--muted);
}

.miniStatValue {
    margin-top: 5px;
    font-size: 18px;
    font-weight: 700;
}

.cardBadges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    color: #e5f2ff;
    background: rgba(96, 165, 250, 0.18);
    border: 1px solid rgba(96, 165, 250, 0.28);
}

.typeBadge {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.28);
}

.modeBadge {
    background: rgba(245, 158, 11, 0.14);
    border-color: rgba(245, 158, 11, 0.26);
}

.cardActions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 14px;
}

.ctaBtn,
.ghostBtn {
    height: 36px;
    border: 1px solid var(--stroke);
    color: var(--text);
    border-radius: 10px;
    padding: 0 12px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.15s ease;
}

.ctaBtn {
    background: rgba(96, 165, 250, 0.18);
    border-color: rgba(96, 165, 250, 0.35);
}

.ctaBtn:hover {
    background: rgba(96, 165, 250, 0.26);
    border-color: rgba(96, 165, 250, 0.55);
}

.ghostBtn {
    background: rgba(255, 255, 255, 0.06);
}

.ghostBtn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.emptyState,
.loadingState,
.errorState {
    padding: 28px 18px;
    font-size: 14px;
    color: var(--muted);
}

.errorState {
    color: #fca5a5;
}

.pageFooter {
    padding: 0 18px 18px;
    color: var(--muted);
    font-size: 12px;
}

@media (max-width: 1100px) {
    .collectionsGrid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .heroStats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .header {
        padding: 14px 14px 10px;
    }

    .pageMain,
    .pageFooter {
        padding-left: 10px;
        padding-right: 10px;
    }

    .sub {
        display: none;
    }

    .rightHead {
        width: 100%;
    }

    .searchWrap {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr;
    }

    #searchInput,
    #sortSelect {
        width: 100%;
        max-width: none;
    }

    .collectionsGrid,
    .heroStats {
        grid-template-columns: 1fr;
    }

}

/* Remove native styling */
#sortSelect {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    padding-right: 36px;
    /* space for arrow */
    cursor: pointer;

    /* custom arrow */
    background-image: url("data:image/svg+xml;utf8,<svg fill='%23e5e7eb' height='20' viewBox='0 0 20 20' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M5 7l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
}

/* Hover (match your UI style) */
#sortSelect:hover {
    background: rgba(96, 165, 250, 0.14);
    border-color: rgba(96, 165, 250, 0.35);
}

#sortSelect option {
    background: #0f172a;
    color: #e5e7eb;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #5b6b84 #1e2430;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e2430;
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5b6b84, #3e4b61);
    border-radius: 8px;
    border: 2px solid #1e2430;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #7a8ca8, #55647d);
}

::-webkit-scrollbar-corner {
    background: #1e2430;
}

.badgeGroup {
    display: flex;
    align-items: center;
    gap: 6px;
}

.badgeLabel {
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}