:root {
    color-scheme: dark;
    --bg: #181b1a;
    --panel: #101b2d;
    --panel-2: #172233;
    --text: #f4f7ff;
    --muted: #9fb0c8;
    --line: rgba(255, 255, 255, .11);
    --accent: #3158a4;
    --accent-bright: #45d7ff;
    --green: #5df06e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background:
        linear-gradient(105deg, rgba(49, 88, 164, .1) 0 1px, transparent 1px 100%) 0 0 / 140px 140px,
        radial-gradient(circle at 78% 16%, rgba(49, 88, 164, .28), transparent 28rem),
        #181b1a;
}

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

.page {
    width: min(1640px, calc(100% - 32px));
    margin: 0 auto;
    padding: 16px 0 56px;
}

.topbar {
    min-height: 100px;
    display: flex;
    align-items: center;
    gap: 34px;
    padding: 0 48px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 50px;
    background: rgba(31, 34, 33, .96);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.03);
}

.brand,
.nav,
.shop-link {
    display: flex;
    align-items: center;
}

.brand {
    gap: 14px;
    font-size: 18px;
    font-weight: 900;
}

.brand img,
.hero-logo {
    object-fit: contain;
}

.nav {
    gap: 38px;
    margin-left: 28px;
    color: #fff;
    font-weight: 800;
}

.nav a {
    opacity: .96;
}

.shop-link {
    margin-left: auto;
    min-height: 46px;
    padding: 0 22px;
    border-radius: 999px;
    background: #fff;
    color: #171a19;
    font-weight: 900;
}

.hero {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: center;
    min-height: 390px;
    margin-top: 34px;
    padding: 44px;
    border-radius: 42px;
    overflow: hidden;
    background:
        linear-gradient(90deg, rgba(12, 24, 46, .88), rgba(13, 25, 48, .62)),
        radial-gradient(circle at 74% 45%, rgba(49, 88, 164, .5), transparent 22rem),
        linear-gradient(135deg, #172843, #0b1424);
    border: 1px solid rgba(255,255,255,.08);
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
    background-size: 58px 58px;
    mask-image: linear-gradient(90deg, rgba(0,0,0,.65), rgba(0,0,0,.18));
    pointer-events: none;
}

.hero-center,
.champion {
    position: relative;
    z-index: 1;
}

.hero-center {
    display: grid;
    justify-items: center;
    text-align: center;
}

.hero-logo {
    width: 86px;
    height: 86px;
    margin-bottom: 16px;
}

h1,
h2 {
    margin: 0;
    line-height: 1.05;
}

h1 {
    font-size: clamp(54px, 7vw, 84px);
    font-weight: 950;
}

h2 {
    font-size: 28px;
}

.hero p {
    max-width: 680px;
    margin: 18px 0 0;
    color: #d5deef;
    font-size: 18px;
}

.hero-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 46px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 294px;
    min-height: 82px;
    padding: 0 34px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
}

.online-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 8px rgba(93, 240, 110, .13);
}

.online-text {
    color: #fff;
    font-size: 22px;
    font-weight: 900;
}

.champion {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 260px;
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(13, 20, 32, .58);
}

.champion img,
.row img,
.best-row img,
.profile img {
    image-rendering: pixelated;
    border-radius: 7px;
    box-shadow: 0 14px 24px rgba(0,0,0,.26);
}

.champion h2 {
    margin-top: 14px;
}

.champion p,
.rankline,
.name span {
    color: var(--rank-color, var(--accent-bright));
    font-weight: 900;
}

.crown {
    margin-bottom: 16px;
    color: #101010;
    background: #ffdc66;
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    margin: 22px 0;
}

.stats-grid div {
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(180deg, rgba(26, 37, 54, .98), rgba(19, 29, 45, .98));
}

.stats-grid b {
    display: block;
    font-size: 27px;
}

.stats-grid span,
.mini,
.value span,
.board-head > span {
    color: var(--muted);
}

.tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 8px 0 16px;
    scrollbar-color: #8b8b86 #333;
}

.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
    padding: 13px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #222934;
    color: #b9c9e2;
    font-weight: 900;
}

.tabs a.active {
    color: #06101d;
    background: var(--accent-bright);
}

.tabs .epos-tab {
    border-color: rgba(255, 213, 102, .35);
    color: #ffe39a;
}

.tabs .epos-tab.active {
    color: #17130a;
    background: #f4d06f;
}

.tabs a span {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    font-weight: 950;
}

.tabs svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.search {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(16, 27, 45, .78);
}

.search input {
    flex: 1;
    min-width: 180px;
    min-height: 52px;
    padding: 0 18px;
    border: 1px solid var(--line);
    border-radius: 16px;
    outline: none;
    background: #222934;
    color: var(--text);
    font: inherit;
    font-weight: 800;
}

.search input::placeholder {
    color: var(--muted);
}

.search button,
.search a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-radius: 16px;
    background: var(--accent-bright);
    color: #06101d;
    font: inherit;
    font-weight: 950;
    cursor: pointer;
}

.search a {
    background: rgba(255,255,255,.09);
    color: var(--text);
    border: 1px solid var(--line);
}

.search-results {
    margin-bottom: 16px;
}

.layout {
    display: block;
}

.epos-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 28px;
    margin-top: 22px;
    margin-bottom: 22px;
    padding: 38px;
    border: 1px solid rgba(244, 208, 111, .32);
    border-radius: 18px;
    background:
        linear-gradient(115deg, rgba(20, 34, 55, .98), rgba(29, 25, 34, .96)),
        #101b2d;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}

.epos-hero h2 {
    font-size: 42px;
    color: #ffe7a7;
}

.epos-hero p:not(.eyebrow) {
    max-width: 850px;
    margin: 16px 0 0;
    color: #c9d3e3;
    font-size: 17px;
    line-height: 1.65;
}

.epos-reward {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 22px;
    padding: 13px 17px;
    border: 1px solid rgba(244, 208, 111, .28);
    border-radius: 12px;
    background: rgba(244, 208, 111, .08);
}

.epos-reward strong {
    color: #ffe39a;
    white-space: nowrap;
}

.epos-reward span {
    color: #b9c5d8;
    font-size: 14px;
}

.epos-countdown {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-top: 12px;
    padding: 13px 17px;
    border: 1px solid rgba(69, 215, 255, .28);
    border-radius: 12px;
    background: rgba(69, 215, 255, .08);
}

.epos-countdown strong {
    color: #9cedff;
    white-space: nowrap;
}

.epos-countdown span {
    color: #c6d4e7;
    font-size: 14px;
}

.epos-countdown b {
    color: #fff;
}

.epos-mark {
    display: grid;
    place-items: center;
    width: 124px;
    height: 124px;
    border: 1px solid rgba(244, 208, 111, .42);
    border-radius: 50%;
    color: #ffe39a;
    background: rgba(244, 208, 111, .08);
    font-size: 18px;
    font-weight: 950;
    letter-spacing: .14em;
}

.epos-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.epos-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    min-height: 265px;
    padding: 34px 22px 24px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: linear-gradient(145deg, #152238, #101927);
    position: relative;
}

.epos-card:hover {
    border-color: rgba(244, 208, 111, .45);
    transform: translateY(-2px);
}

.epos-card.active-legend {
    border-color: rgba(93, 240, 110, .38);
    box-shadow: inset 0 0 0 1px rgba(93, 240, 110, .08);
}

.epos-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 126px;
    height: 126px;
    border: 1px solid rgba(244, 208, 111, .34);
    border-radius: 20px;
    background:
        radial-gradient(circle at 50% 35%, rgba(244, 208, 111, .18), transparent 65%),
        rgba(6, 12, 21, .62);
    box-shadow: 0 18px 34px rgba(0, 0, 0, .3);
}

.epos-avatar::before {
    content: "";
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 14px;
    pointer-events: none;
}

.epos-avatar img {
    width: 104px;
    height: 104px;
    image-rendering: pixelated;
    border-radius: 12px;
}

.epos-avatar span {
    position: absolute;
    bottom: -10px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #07140d;
    background: var(--green);
    font-size: 10px;
    font-weight: 950;
    text-transform: uppercase;
}

.epos-player {
    min-width: 0;
}

.epos-card h3 {
    margin: 0;
    color: #fff2c7;
    font-size: 21px;
}

.epos-card p {
    margin: 7px 0;
    color: #aebbd0;
}

.epos-card small {
    color: #7f94b2;
}

.epos-place {
    position: absolute;
    top: 14px;
    right: 16px;
    color: #f4d06f;
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.epos-empty {
    grid-column: 1 / -1;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
}

.board,
.best-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel);
    overflow: hidden;
}

.board-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid var(--line);
}

.board-head.compact {
    padding-bottom: 20px;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--accent-bright);
    text-transform: uppercase;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .12em;
}

.rows {
    display: grid;
}

.row {
    display: grid;
    grid-template-columns: 76px 48px minmax(150px, 1fr) 140px minmax(170px, .65fr);
    gap: 16px;
    align-items: center;
    min-height: 80px;
    padding: 14px 24px;
    border-bottom: 1px solid var(--line);
}

.row:hover,
.best-row:hover {
    background: rgba(69, 215, 255, .07);
}

.place {
    color: var(--accent-bright);
    font-size: 20px;
}

.name b,
.value b {
    display: block;
    font-size: 18px;
}

.value {
    text-align: right;
}

.mini,
.value span {
    font-size: 13px;
}

.best-list {
    display: grid;
}

.best-row {
    display: grid;
    grid-template-columns: 34px 34px minmax(90px, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 62px;
    padding: 12px 18px;
    border-bottom: 1px solid var(--line);
}

.best-row > span {
    color: var(--accent-bright);
    font-weight: 950;
}

.best-row b {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.best-row em {
    grid-column: 3;
    margin-top: -8px;
    color: var(--rank-color, var(--muted));
    font-size: 12px;
    font-style: normal;
    font-weight: 900;
}

.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 18px;
    border-top: 1px solid var(--line);
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #222934;
    color: #c7d7ef;
    font-weight: 950;
}

.pagination a.active {
    background: var(--accent-bright);
    color: #06101d;
}

.pagination a.disabled {
    pointer-events: none;
    opacity: .45;
}

.empty {
    padding: 42px;
    color: var(--muted);
    text-align: center;
}

.empty.small {
    padding: 24px;
}

.back {
    display: inline-flex;
    margin-top: 22px;
    margin-bottom: 18px;
    color: var(--accent-bright);
    font-weight: 900;
}

.profile {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 34px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: var(--panel);
}

.profile-grid {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 1120px) {
    .topbar {
        padding: 18px 24px;
        border-radius: 30px;
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        width: 100%;
        margin-left: 0;
        justify-content: center;
    }

    .hero,
    .layout {
        grid-template-columns: 1fr;
    }

    .epos-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .page {
        width: min(100% - 20px, 1640px);
        padding-top: 10px;
    }

    .topbar {
        gap: 16px;
    }

    .nav {
        gap: 16px;
        overflow-x: auto;
        justify-content: flex-start;
    }

    .shop-link {
        width: 100%;
        justify-content: center;
    }

    .search {
        flex-wrap: wrap;
    }

    .search input,
    .search button,
    .search a {
        width: 100%;
    }

    .hero {
        min-height: 0;
        padding: 28px 18px;
        border-radius: 28px;
    }

    .epos-hero {
        grid-template-columns: 1fr;
        padding: 26px;
    }

    .epos-mark {
        display: none;
    }

    .epos-reward,
    .epos-countdown {
        align-items: flex-start;
        flex-direction: column;
    }

    .epos-grid {
        grid-template-columns: 1fr;
    }

    h1 {
        font-size: 44px;
    }

    .button {
        min-width: 0;
        width: 100%;
        min-height: 58px;
        font-size: 17px;
    }

    .stats-grid,
    .profile-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .row {
        grid-template-columns: 48px 42px 1fr;
        gap: 12px;
        padding: 14px;
    }

    .value {
        grid-column: 3;
        text-align: left;
    }

    .mini {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }

    .profile,
    .board-head {
        align-items: flex-start;
        flex-direction: column;
    }
}
