:root {
    --orange: #f7931a;
    --orange-2: #f5af19;
    --orange-dark: #ef5b2b;
    --text: #212529;
    --muted: #6b7280;
    --panel: rgba(255, 255, 255, .72);
    --panel-soft: rgba(255, 255, 255, .42);
    --line: rgba(245, 175, 25, .24);
    --green: #22c55e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: Arial, "Segoe UI", sans-serif;
    background: #f7e3c7 url("../../img/background.png") center top repeat;
}

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

a:hover {
    color: #e2a640;
}

.page {
    width: min(1180px, calc(100% - 30px));
    margin: 0 auto;
    padding: 16px 0 40px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 18px 0;
    background: rgba(255, 255, 255, .58);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(245, 175, 25, .18);
}

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

.brand {
    gap: 12px;
    margin-right: auto;
    font-size: 24px;
    font-weight: 900;
}

.brand img,
.hero-logo {
    object-fit: contain;
    border-radius: 8px;
}

.nav {
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.nav a,
.shop-link,
.button,
.search button,
.search a,
.pagination a,
.tabs a {
    border: 0;
    border-radius: 20px;
    padding: 9px 16px;
    color: #212529;
    background: rgba(211, 119, 10, .20);
    font-weight: 800;
    transition: .2s ease;
}

.nav a:hover,
.shop-link:hover,
.tabs a:hover,
.search a:hover,
.pagination a:hover {
    color: #fff;
    background: var(--orange);
}

.shop-link,
.button,
.search button,
.pagination a.active,
.tabs a.active {
    color: #fff;
    background: linear-gradient(to right, var(--orange), var(--orange-2));
}

.shop-link {
    margin-left: auto;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 20px;
    align-items: center;
    margin: 30px 0 20px;
    padding: 32px;
    border-radius: 8px;
    background: var(--panel-soft);
}

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

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

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

h1 {
    color: var(--orange-dark);
    font-size: clamp(38px, 6vw, 68px);
    font-weight: 950;
    text-shadow: 0 2px 0 rgba(255,255,255,.7);
}

h2 {
    font-size: 28px;
}

.hero p {
    max-width: 680px;
    margin: 14px 0 0;
    font-size: 17px;
    font-weight: 700;
}

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

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 22px;
}

.online-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 7px rgba(34, 197, 94, .14);
}

.online-text {
    font-weight: 900;
}

.champion {
    display: grid;
    place-items: center;
    text-align: center;
    min-height: 240px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
}

.champion img,
.row img,
.best-row img,
.profile img {
    image-rendering: pixelated;
    border-radius: 7px;
    box-shadow: 0 8px 18px rgba(190, 112, 20, .18);
}

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

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

.crown {
    margin-bottom: 14px;
    color: #fff;
    background: linear-gradient(to right, var(--orange), var(--orange-2));
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 12px;
    font-weight: 950;
    text-transform: uppercase;
}

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

.stats-grid div {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    text-align: center;
}

.stats-grid b {
    display: block;
    color: var(--orange-dark);
    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: var(--orange) rgba(211, 119, 10, .18);
}

.tabs a {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    white-space: nowrap;
}

.tabs .epos-tab {
    border: 1px solid rgba(245, 175, 25, .45);
}

.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: 8px;
    background: var(--panel-soft);
}

.search input {
    flex: 1;
    min-width: 180px;
    min-height: 48px;
    padding: 0 18px;
    border: 1px solid rgba(211, 119, 10, .28);
    border-radius: 20px;
    outline: none;
    background: #fff;
    color: var(--text);
    font: inherit;
    font-weight: 800;
}

.search input::placeholder {
    color: #9ca3af;
}

.search button,
.search a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 20px;
    font: inherit;
    cursor: pointer;
}

.search a {
    color: var(--text);
    background: rgba(211, 119, 10, .20);
}

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

.layout {
    display: block;
}

.epos-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 24px;
    margin: 18px 0;
    padding: 30px;
    border: 1px solid rgba(245, 175, 25, .35);
    border-radius: 8px;
    background: var(--panel);
}

.epos-hero h2 {
    color: var(--orange-dark);
    font-size: 38px;
}

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

.epos-reward,
.epos-countdown {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
    padding: 12px 15px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(245, 175, 25, .10);
}

.epos-reward strong,
.epos-countdown strong {
    color: var(--orange-dark);
    white-space: nowrap;
}

.epos-reward span,
.epos-countdown span {
    color: var(--muted);
    font-size: 14px;
}

.epos-mark {
    display: grid;
    place-items: center;
    width: 112px;
    height: 112px;
    border: 1px solid rgba(245, 175, 25, .45);
    border-radius: 50%;
    color: var(--orange-dark);
    background: rgba(245, 175, 25, .10);
    font-size: 17px;
    font-weight: 950;
    letter-spacing: .14em;
}

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

.epos-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-height: 255px;
    padding: 32px 20px 22px;
    text-align: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    transition: box-shadow .2s ease, border-color .2s ease;
}

.epos-card:hover {
    border-color: rgba(245, 175, 25, .55);
    box-shadow: 0 4px 20px 2px rgb(243, 201, 132);
}

.epos-avatar {
    position: relative;
    display: grid;
    place-items: center;
    width: 126px;
    height: 126px;
    border: 1px solid rgba(245, 175, 25, .34);
    border-radius: 8px;
    background: rgba(245, 175, 25, .08);
}

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

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

.epos-card h3 {
    color: var(--orange-dark);
    font-size: 21px;
}

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

.epos-card small {
    color: var(--muted);
}

.epos-place {
    position: absolute;
    top: 14px;
    right: 16px;
    color: var(--orange-dark);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
}

.epos-empty {
    grid-column: 1 / -1;
}

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

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

.eyebrow {
    margin: 0 0 10px;
    color: var(--orange-dark);
    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 22px;
    border-bottom: 1px solid var(--line);
}

.row:hover,
.best-row:hover {
    background: rgba(245, 175, 25, .10);
}

.place {
    color: var(--orange-dark);
    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(--orange-dark);
    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;
}

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

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

.back {
    display: inline-flex;
    margin: 22px 0 18px;
    border-radius: 20px;
    padding: 10px 16px;
    color: var(--text);
    background: rgba(211, 119, 10, .20);
    font-weight: 900;
}

.back:hover {
    color: #fff;
    background: var(--orange);
}

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

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

@media (max-width: 1120px) {
    .brand,
    .shop-link {
        margin: 0;
    }

    .topbar {
        padding: 18px 10px;
    }

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

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

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

    .nav {
        width: 100%;
        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 {
        padding: 24px 16px;
    }

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

    .epos-mark {
        display: none;
    }

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

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

    h1 {
        font-size: 42px;
    }

    .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;
    }
}
