/* Public guild leaderboards hub */
:root {
    --boards-bg: #0b0b0d;
    --boards-panel: #141418;
    --boards-panel-2: #1a1a20;
    --boards-border: #2a2a32;
    --boards-text: #f2f2f5;
    --boards-muted: #9b9ba8;
    --boards-accent: #5865f2;
    --boards-accent-soft: rgba(88, 101, 242, 0.16);
    --boards-gold: #f0c14a;
    --boards-silver: #c5c8d0;
    --boards-bronze: #c98a4b;
    --boards-radius: 14px;
    --boards-font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

body.boards-page {
    margin: 0;
    background:
        radial-gradient(1200px 500px at 50% -10%, rgba(88, 101, 242, 0.12), transparent 60%),
        var(--boards-bg);
    color: var(--boards-text);
    font-family: var(--boards-font);
    line-height: 1.45;
    min-height: 100vh;
}

.boards-shell {
    max-width: 880px;
    margin: 0 auto;
    padding: 0 1.1rem 2.75rem;
}

/* —— Hero —— */
.boards-hero {
    position: relative;
    border-radius: 0 0 var(--boards-radius) var(--boards-radius);
    overflow: hidden;
    margin: 0 -1.1rem 1.5rem;
    background: var(--boards-panel);
    border-bottom: 1px solid var(--boards-border);
}

.boards-hero__banner {
    height: 112px;
    background-size: cover;
    background-position: center;
    background-color: #15151c;
    background-image: linear-gradient(135deg, #1a1a28 0%, #121218 100%);
}

.boards-hero__banner[style*="background-image: url"] {
    background-image: inherit;
}

.boards-hero__body {
    display: flex;
    align-items: flex-end;
    gap: 1rem;
    padding: 0 1.35rem 1.25rem;
    margin-top: -36px;
}

.boards-hero__icon {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    object-fit: cover;
    border: 3px solid var(--boards-panel);
    background: #2a2a32;
    flex-shrink: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.boards-hero__icon--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #c8c8d0;
    background: linear-gradient(145deg, #2c2c36, #3a3a46);
}

.boards-hero__title {
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 0.15rem;
}

.boards-hero__title h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.boards-hero__title p {
    margin: 0.25rem 0 0;
    color: var(--boards-muted);
    font-size: 0.9rem;
}

.boards-hero__members {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    padding: 0.45rem 0.85rem;
    margin-bottom: 0.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--boards-border);
    flex-shrink: 0;
}

.boards-hero__members-value {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.15;
}

.boards-hero__members-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--boards-muted);
}

/* —— Nav / segments —— */
.boards-nav {
    margin-bottom: 1rem;
}

.boards-seg {
    display: inline-flex;
    gap: 0.2rem;
    padding: 0.28rem;
    border-radius: 12px;
    background: var(--boards-panel);
    border: 1px solid var(--boards-border);
}

.boards-seg--sm {
    padding: 0.2rem;
}

.boards-seg__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 1rem;
    border-radius: 9px;
    color: var(--boards-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.15s ease, color 0.15s ease;
}

.boards-seg--sm .boards-seg__btn {
    padding: 0.35rem 0.8rem;
    font-size: 0.8rem;
}

.boards-seg__btn:hover {
    color: var(--boards-text);
    background: rgba(255, 255, 255, 0.04);
}

.boards-seg__btn.is-active {
    color: #fff;
    background: var(--boards-accent);
}

/* —— Panel —— */
.boards-panel {
    background: var(--boards-panel);
    border: 1px solid var(--boards-border);
    border-radius: var(--boards-radius);
    padding: 1.15rem 1.15rem 0.85rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.22);
}

.boards-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.9rem;
}

.boards-panel__title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.boards-context {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 1rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    background: var(--boards-panel-2);
    border: 1px solid var(--boards-border);
}

.boards-context__item {
    flex: 1 1 120px;
    min-width: 0;
}

.boards-context__value {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
}

.boards-context__label {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--boards-muted);
}

.boards-streamer-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 0.9rem;
}

.boards-streamer {
    text-decoration: none;
    color: var(--boards-muted);
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: 8px;
    border: 1px solid var(--boards-border);
    background: transparent;
}

.boards-streamer.is-active {
    color: #fff;
    border-color: #9147ff;
    background: rgba(145, 71, 255, 0.18);
}

/* —— Table —— */
.boards-table-wrap {
    overflow-x: auto;
    margin: 0 -1.15rem -0.85rem;
    border-radius: 0 0 calc(var(--boards-radius) - 1px) calc(var(--boards-radius) - 1px);
}

.boards-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.boards-table th,
.boards-table td {
    padding: 0.85rem 1.15rem;
    text-align: left;
    border-bottom: 1px solid var(--boards-border);
    vertical-align: middle;
}

.boards-table th {
    color: var(--boards-muted);
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(0, 0, 0, 0.18);
    position: sticky;
    top: 0;
    z-index: 1;
}

.boards-table tbody tr:last-child td {
    border-bottom: none;
}

.boards-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.boards-row--top1 td {
    background: rgba(240, 193, 74, 0.06);
}

.boards-row--top2 td {
    background: rgba(197, 200, 208, 0.05);
}

.boards-row--top3 td {
    background: rgba(201, 138, 75, 0.06);
}

.boards-table__pos {
    width: 3.25rem;
    color: var(--boards-muted);
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.boards-rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.65rem;
    height: 1.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 800;
    color: #111;
}

.boards-rank--1 { background: var(--boards-gold); }
.boards-rank--2 { background: var(--boards-silver); }
.boards-rank--3 { background: var(--boards-bronze); color: #1a1208; }

.boards-table__user {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.boards-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #2a2a32;
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.boards-avatar--placeholder {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: #c8c8d0;
    background: linear-gradient(135deg, #2f2f38, #3d3d48);
}

.boards-user-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
}

.boards-table__points {
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.boards-table th:last-child,
.boards-table td:last-child {
    text-align: right;
}

.boards-table th:nth-last-child(2),
.boards-table td.boards-table__points:not(:last-child) {
    text-align: right;
}

.boards-table__points--muted {
    font-weight: 600;
    color: var(--boards-muted);
}

.boards-empty,
.boards-error {
    color: var(--boards-muted);
    padding: 1.75rem 0.5rem;
    text-align: center;
    margin: 0;
}

.boards-error { color: #f87171; }

.boards-footer {
    margin-top: 2rem;
    text-align: center;
    font-size: 0.8rem;
}

.boards-footer a {
    color: var(--boards-muted);
    text-decoration: none;
}

.boards-footer a:hover {
    color: var(--boards-accent);
}

@media (max-width: 640px) {
    .boards-hero__body {
        flex-wrap: wrap;
        align-items: center;
        margin-top: -28px;
    }

    .boards-hero__icon {
        width: 64px;
        height: 64px;
    }

    .boards-hero__title h1 {
        font-size: 1.25rem;
    }

    .boards-hero__members {
        margin-left: auto;
    }

    .boards-panel {
        padding: 1rem 0.85rem 0.65rem;
    }

    .boards-table-wrap {
        margin-left: -0.85rem;
        margin-right: -0.85rem;
    }

    .boards-table th,
    .boards-table td {
        padding: 0.7rem 0.85rem;
    }

    .boards-context__value {
        font-size: 1.15rem;
    }
}
