:root {
    --bg: #fafafa;
    --surface: #ffffff;
    --text: #111111;
    --muted: #6b6b70;
    --line: #eaeaea;
    --line-strong: #dcdcdc;
    --accent: #e3001b;
    --accent-soft: rgba(227, 0, 27, 0.07);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 1px 2px rgba(17, 17, 17, 0.05);
}

@media (prefers-color-scheme: dark) {
    .date-chip {
        color: #0c0c0e;
    }

    :root {
        --bg: #0c0c0e;
        --surface: #151518;
        --text: #f4f4f5;
        --muted: #9a9aa2;
        --line: #26262c;
        --line-strong: #34343c;
        --accent: #ff3b4e;
        --accent-soft: rgba(255, 59, 78, 0.14);
        --shadow: none;
    }
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

.page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 20px 72px;
}

/* ---------- header ---------- */

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

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

.page-title h1 {
    margin: 0;
    font-size: clamp(26px, 5vw, 34px);
    font-weight: 650;
    letter-spacing: -0.02em;
}

.sub {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 13.5px;
}

.sub .dot {
    margin: 0 6px;
    color: var(--line-strong);
}

.head-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.updated {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.field input {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    min-width: 132px;
}

.field input:focus-visible,
.btn:focus-visible,
.tab:focus-visible,
.member-card:focus-visible,
.live:focus-visible,
.back:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    cursor: pointer;
    transition: background 120ms ease, border-color 120ms ease, opacity 120ms ease;
}

.btn:hover {
    border-color: var(--accent);
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    opacity: 0.9;
}

.btn[hidden] {
    display: none;
}

.back {
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    padding: 0 0 14px;
    cursor: pointer;
}

.back:hover {
    color: var(--accent);
}

/* ---------- views ---------- */

.view {
    display: none;
}

.view.is-active {
    display: block;
}

.home-tabs {
    margin-top: 24px;
}

.home-pane {
    display: none;
}

.home-pane.is-active {
    display: block;
}

.live-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.live-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    text-align: left;
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 120ms ease, transform 120ms ease;
}

.live-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.lc-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.lc-id {
    min-width: 0;
    flex: 1;
}

.lc-member {
    display: block;
    font-size: 15px;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lc-title {
    display: block;
    margin-top: 1px;
    font-size: 12.5px;
    color: var(--muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- banner ---------- */

.banner {
    margin-top: 20px;
    padding: 12px 16px;
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--text);
    font-size: 13px;
}

.banner strong {
    color: var(--accent);
}

/* ---------- KPI ---------- */

.kpi {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 24px 0 8px;
}

.kpi-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    min-height: 84px;
}

.kpi-label {
    margin: 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--muted);
}

.kpi-value {
    margin: 8px 0 0;
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}

.kpi-value.accent {
    color: var(--accent);
}

/* ---------- section head ---------- */

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
}

.section-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.select {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 7px 10px;
    cursor: pointer;
}

.select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.select[hidden] {
    display: none;
}

.search {
    font: inherit;
    font-size: 13px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    min-width: 190px;
}

.search:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.section-head h2 {
    margin: 0;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.meta {
    margin: 0;
    font-size: 12.5px;
    color: var(--muted);
}

/* ---------- member cards ---------- */

.member-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.member-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    text-align: left;
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 16px 18px;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: border-color 120ms ease, transform 120ms ease;
}

.member-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.mc-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mc-id {
    min-width: 0;
    flex: 1;
}

.mc-name {
    display: block;
    font-size: 15px;
    font-weight: 650;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mc-sub {
    display: block;
    font-size: 12px;
    color: var(--muted);
}

.rp-star {
    font-size: 0.72em;
    font-weight: 600;
    vertical-align: super;
    margin-left: 1px;
    opacity: 0.85;
}

.date-chip {
    flex: 0 0 auto;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: #ffffff;
    background: var(--accent);
    border: 1px solid var(--accent);
    border-radius: 999px;
    padding: 3px 10px;
    white-space: nowrap;
}

.mc-gold {
    font-size: 24px;
    font-weight: 650;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
    line-height: 1.2;
}

.mc-idr {
    margin-top: 2px;
    font-size: 12.5px;
    color: var(--accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.bar {
    display: block;
    height: 4px;
    border-radius: 999px;
    background: var(--line);
    overflow: hidden;
}

.bar > span {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: 999px;
}

.mc-top {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 5px;
    font-size: 13px;
}

.mc-top li {
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 8px;
    color: var(--muted);
}

.mc-top .nm {
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mc-top .g {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    color: var(--text);
}

.mc-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--line);
    font-size: 12px;
    color: var(--muted);
}

.mc-foot .go {
    color: var(--accent);
    font-weight: 600;
}

/* ---------- avatar ---------- */

.av {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.02em;
    overflow: hidden;
    flex: 0 0 auto;
}

.av img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.av-lg {
    width: 64px;
    height: 64px;
    font-size: 18px;
}

/* ---------- hero ---------- */

.hero {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.hero-main {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hero h2 {
    margin: 0;
    font-size: 21px;
    font-weight: 650;
    letter-spacing: -0.01em;
}

.hero-sub {
    margin: 4px 0 0;
    font-size: 12.5px;
    color: var(--muted);
}

.stat-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.tile {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
}

.tile span {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
}

.tile strong {
    display: block;
    margin-top: 4px;
    font-size: 16px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}

.tile.accent strong {
    color: var(--accent);
}

.live-hero {
    flex-direction: row;
    align-items: center;
    gap: 16px;
}

.live-thumb-lg {
    width: 96px;
    height: 96px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--line);
    flex: 0 0 auto;
}

.live-hero-main {
    min-width: 0;
}

.eyebrow-sm {
    margin: 0 0 4px;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--accent);
}

/* ---------- tabs ---------- */

.tabs {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    border-bottom: 1px solid var(--line);
}

.tab {
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    padding: 0 0 10px;
    margin-bottom: -1px;
    cursor: pointer;
}

.tab.is-active {
    color: var(--text);
    border-bottom-color: var(--accent);
}

.pane {
    display: none;
}

.pane.is-active {
    display: block;
}

.center {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 16px 0 0;
}

.freshness {
    color: var(--text);
}

/* ---------- table ---------- */

.table-wrap {
    overflow-x: auto;
    margin-top: 14px;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--bg);
    text-align: right;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}

thead th.left,
tbody td.left {
    text-align: left;
}

tbody td {
    text-align: right;
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

tbody tr:hover {
    background: var(--surface);
}

.rank {
    width: 40px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.rank.medal {
    font-size: 16px;
}

.person {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.person .who {
    min-width: 0;
}

.person .who strong {
    display: block;
    font-weight: 600;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.person .who small {
    display: block;
    color: var(--muted);
    font-size: 11.5px;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gold {
    font-weight: 600;
}

/* ---------- lives list ---------- */

.lives {
    margin-top: 14px;
    display: grid;
    gap: 8px;
}

.live {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    width: 100%;
    text-align: left;
    font: inherit;
    color: inherit;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 10px 14px;
    cursor: pointer;
    transition: border-color 120ms ease;
}

.live:hover {
    border-color: var(--accent);
}

.live-thumb {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
    background: var(--line);
    flex: 0 0 auto;
}

.live-title {
    display: block;
    font-weight: 600;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-meta {
    margin: 2px 0 0;
    font-size: 12px;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.live-gold {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.live-gold strong {
    display: block;
    font-size: 14px;
}

.live-gold small {
    color: var(--muted);
    font-size: 11.5px;
}

/* ---------- states ---------- */

.empty {
    padding: 28px 4px;
    color: var(--muted);
    font-size: 13.5px;
    text-align: center;
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius);
    margin-top: 14px;
}

.error {
    color: var(--accent);
    font-weight: 500;
}

.skeleton {
    background: linear-gradient(90deg, var(--line) 25%, var(--surface) 50%, var(--line) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.3s linear infinite;
    border-radius: var(--radius);
}

.card-skeleton {
    height: 190px;
}

.row-skeleton {
    height: 52px;
    margin-top: 8px;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .skeleton {
        animation: none;
    }
}

.foot {
    margin-top: 48px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 12.5px;
}

.foot p {
    margin: 0 0 6px;
}

/* ---------- responsive ---------- */

@media (max-width: 640px) {
    .page {
        padding: 28px 14px 56px;
    }

    .page-head {
        align-items: flex-start;
    }

    .toolbar,
    .head-meta {
        width: 100%;
    }

    .head-meta {
        justify-content: space-between;
    }

    .field {
        flex: 1 1 132px;
    }

    .field input {
        width: 100%;
        min-width: 0;
    }

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

    .kpi-card {
        padding: 13px 14px;
        min-height: 74px;
    }

    .kpi-value {
        font-size: 20px;
    }

    .member-grid,
    .live-grid {
        grid-template-columns: 1fr;
    }

    .section-head {
        flex-wrap: wrap;
    }

    .section-tools {
        width: 100%;
        justify-content: flex-start;
    }

    .search {
        flex: 1 1 100%;
        min-width: 0;
    }

    .select {
        flex: 1 1 0;
        min-width: 0;
    }

    .col-hide {
        display: none;
    }

    tbody td,
    thead th {
        padding: 9px 8px;
    }

    .person .who strong,
    .person .who small {
        max-width: 130px;
    }

    .live {
        grid-template-columns: auto 1fr;
    }

    .live-gold {
        grid-column: 2;
        text-align: left;
        display: flex;
        align-items: baseline;
        gap: 6px;
    }

    .live-hero {
        flex-direction: column;
        align-items: flex-start;
    }

    .live-thumb-lg {
        width: 72px;
        height: 72px;
    }
}
