/* WiK Members 3-tab V1.0. Uses the shared V2 header, hero, background, footer and language controller. */
.wik-members {
    --mem-bg: #070807;
    --mem-text: #F2F2F2;
    --mem-soft: #C8C8C4;
    --mem-gold: #D6AA4F;
    --mem-gold-light: #F3D27A
}

.mem-main {
    padding-bottom: 28px
}

.mem-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 0 10px
}

.mem-toolbar-labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0
}

.mem-server {
    display: inline-block;
    border: 1px solid rgba(214, 170, 79, .38);
    border-radius: 5px;
    padding: 3px 8px;
    margin-right: 9px;
    font-weight: 600;
    font-size: 11px;
    color: var(--mem-gold-light)
}

.mem-updated {
    color: var(--mem-soft);
    font-size: 10px
}

.mem-updated strong {
    color: var(--mem-text);
    font-weight: 500;
    margin-left: 4px
}

.mem-reload {
    min-height: 38px;
    border: 1px solid rgba(214, 170, 79, .55);
    border-radius: 9px;
    background: #191914;
    color: var(--mem-gold-light);
    font-size: 11px;
    white-space: nowrap;
    padding: 0 12px;
    margin-left: 8px
}

.mem-reload:disabled {
    opacity: .55;
    cursor: wait
}

.mem-live-status {
    min-height: 0;
    color: var(--mem-soft);
    font-size: 12px;
    line-height: 1.45
}

.mem-live-status:empty {
    display: none
}

.mem-live-status.is-error {
    color: #f0a68d;
    padding: 8px 0
}

.mem-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    padding: 4px;
    border: 1px solid rgba(214, 170, 79, .3);
    border-radius: 13px;
    background: #10110f;
    margin-bottom: 15px
}

.mem-tab {
    min-width: 0;
    min-height: 46px;
    padding: 8px 3px;
    border: 0;
    border-radius: 10px;
    color: var(--mem-soft);
    background: transparent;
    font-size: clamp(11px, 3.5vw, 14px);
    font-weight: 600;
    white-space: normal;
    overflow-wrap: anywhere
}

.mem-tab[aria-selected=true] {
    color: #18130c;
    background: linear-gradient(155deg, #F3D27A, #D6AA4F 69%, #A67632);
    box-shadow: 0 2px 8px rgba(214, 170, 79, .15)
}

.mem-panel[hidden] {
    display: none
}

.mem-kpis {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-bottom: 14px
}

.mem-kpi {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-width: 0;
    padding: 16px;
    border: 1px solid #403b2e;
    border-radius: 12px;
    background: linear-gradient(145deg, rgba(37, 34, 25, .9), rgba(13, 14, 12, .96))
}

.mem-kpi:nth-child(2n) {
    margin-left: 8px
}

.mem-kpi:nth-child(n+3) {
    margin-top: 8px
}

.mem-kpi span {
    color: var(--mem-soft);
    font-size: 11px;
    line-height: 1.4
}

.mem-kpi strong {
    color: var(--mem-gold-light);
    font-size: clamp(18px, 4.2vw, 23px);
    text-align: center;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis
}

.mem-card {
    border: 1px solid rgba(165, 145, 105, .26);
    border-radius: 15px;
    background: linear-gradient(155deg, #171915, #0e100e);
    padding: 15px;
    margin-top: 13px
}

.mem-heading {
    margin: 0;
    color: var(--mem-text);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: .005em
}

.mem-ranges {
    display: flex;
    margin: 14px 0 8px
}

.mem-ranges button {
    flex: 1 1 0;
    min-width: 0;
    min-height: 38px;
    border: 1px solid #444237;
    background: #10110f;
    color: var(--mem-soft);
    font-size: 11px;
    border-radius: 7px
}

.mem-ranges button+button {
    margin-left: 6px
}

.mem-ranges button[aria-pressed=true] {
    background: rgba(214, 170, 79, .17);
    color: var(--mem-gold-light);
    border-color: var(--mem-gold)
}

.mem-chart {
    width: 100%;
    min-height: 165px
}

.mem-chart-svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 252px;
    overflow: visible
}

.mem-chart-ylabel {
    fill: var(--mem-soft);
    font-family: Inter, "Noto Sans JP", system-ui, sans-serif;
    font-size: 14px;
    font-variant-numeric: tabular-nums
}

.mem-chart-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    color: var(--mem-soft);
    font-size: 11px
}

.mem-chart-foot strong {
    color: var(--mem-gold-light);
    font-size: 18px;
    font-variant-numeric: tabular-nums
}

.mem-empty {
    padding: 24px 5px;
    text-align: center;
    color: var(--mem-soft);
    font-size: 12px;
    line-height: 1.6
}

.mem-week-header,
.mem-roster-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    padding: 6px 1px 0
}

.mem-week-header .mem-heading {
    font-size: clamp(12px, 3.5vw, 14px)
}

.mem-week-period {
    margin-left: auto;
    padding-left: 6px;
    color: var(--mem-gold-light);
    font-size: clamp(10px, 2.7vw, 11px);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.mem-roster-head {
    margin-bottom: 14px
}

.mem-roster-head select {
    flex: 0 0 auto;
    max-width: 46%;
    min-width: 95px;
    min-height: 40px;
    margin-left: 8px;
    padding: 0 8px;
    background: #11130f;
    border: 1px solid #474337;
    color: var(--mem-text);
    border-radius: 9px;
    font-size: 12px
}

.mem-week-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    padding: 4px;
    margin-top: 14px;
    border: 1px solid rgba(214, 170, 79, .3);
    border-radius: 11px;
    background: #10110f
}

.mem-week-tabs button {
    min-width: 0;
    min-height: 46px;
    padding: 7px 3px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--mem-soft);
    font-size: clamp(10px, 2.8vw, 12px);
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
    white-space: normal
}

.mem-week-tabs button[aria-selected=true] {
    color: #18130c;
    background: linear-gradient(155deg, #F3D27A, #D6AA4F 69%, #A67632)
}

.mem-week-ranking[hidden] {
    display: none
}

.mem-week-ranking {
    margin-top: 8px
}

.mem-hint {
    color: var(--mem-soft);
    font-size: 11px;
    line-height: 1.6;
    margin: 8px 0
}

.mem-hint[hidden] {
    display: none
}

.mem-ranking {
    margin-top: 8px
}

.mem-rank-row {
    display: flex;
    align-items: center;
    min-width: 0;
    min-height: 52px;
    padding: 8px 1px;
    border-bottom: 1px solid #32332b
}

.mem-rank-row:last-child {
    border-bottom: 0
}

.mem-rank-no {
    flex: 0 0 30px;
    color: var(--mem-gold-light);
    text-align: center;
    font-variant-numeric: tabular-nums;
    font-size: 17px;
    font-weight: 700
}

.mem-rank-avatar {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    margin: 0 8px 0 2px;
    border: 0;
    border-radius: 7px
}

.mem-rank-avatar .mem-initial {
    font-size: 15px
}

.mem-rank-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--mem-text);
    font-size: 12px
}

.mem-rank-value {
    flex: 0 0 78px;
    color: var(--mem-gold-light);
    font-size: 12px;
    text-align: right;
    font-variant-numeric: tabular-nums
}

.mem-member {
    display: block;
    min-height: 76px;
    border: 1px solid #39392e;
    border-radius: 12px;
    padding: 10px;
    background: rgba(22, 24, 20, .94)
}

.mem-member+.mem-member {
    margin-top: 7px
}

.mem-member-top {
    display: flex;
    align-items: center;
    min-width: 0;
    width: 100%
}

.mem-avatar {
    position: relative;
    flex: 0 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    overflow: hidden;
    border: 0;
    border-radius: 10px;
    background: #24251d
}

.mem-avatar-img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover
}

.mem-initial {
    color: var(--mem-gold-light);
    font-size: 21px;
    font-weight: 700
}

.mem-member-center {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 10px
}

.mem-member-name {
    display: block;
    color: var(--mem-text);
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.mem-member-sub {
    display: block;
    font-size: 10px;
    color: var(--mem-soft);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.6
}

.mem-member-right {
    flex: 0 0 82px;
    text-align: right;
    min-width: 0;
    margin-left: 6px
}

.mem-member-right small {
    display: block;
    font-size: 10px;
    color: var(--mem-soft)
}

.mem-member-right strong {
    display: block;
    font-size: 15px;
    color: var(--mem-gold-light);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.mem-member-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    min-width: 0;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #35372e
}

.mem-member-stat {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    min-width: 0;
    padding-right: 8px
}

.mem-member-stat:nth-child(2n) {
    padding-right: 0;
    padding-left: 8px
}

.mem-stat-pill {
    display: inline-block;
    flex: 0 0 auto;
    max-width: 100%;
    padding: 2px 7px;
    color: #F3D27A;
    background: rgba(214, 170, 79, .12);
    border: 1px solid rgba(214, 170, 79, .58);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    white-space: nowrap
}

.mem-stat-value {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 5px;
    color: var(--mem-text);
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    line-height: 1.35;
    white-space: normal;
    overflow-wrap: anywhere
}

@media(min-width:700px) {
    .mem-shell {
        padding-left: 23px;
        padding-right: 23px
    }

    .mem-hero {
        padding-top: 45px;
        padding-bottom: 34px
    }

    .mem-kpis {
        grid-template-columns: repeat(4, minmax(0, 1fr))
    }

    .mem-kpi:nth-child(n) {
        margin-top: 0;
        margin-left: 8px
    }

    .mem-kpi:first-child {
        margin-left: 0
    }
}

@media(max-width:359px) {
    .mem-shell {
        padding: 0 10px
    }

    .mem-header {
        min-height: 68px
    }

    .mem-hero {
        padding-top: 23px
    }

    .mem-reload {
        padding: 0 9px
    }

    .mem-member {
        padding: 8px
    }

    .mem-avatar {
        flex-basis: 43px;
        width: 43px;
        height: 43px
    }

    .mem-member-center {
        margin-left: 7px
    }

    .mem-member-right {
        flex-basis: 68px;
        margin-left: 4px
    }

    .mem-member-right strong {
        font-size: 13px
    }

    .mem-member-name {
        font-size: 12px
    }

    .mem-member-sub {
        font-size: 9px
    }

    .mem-card {
        padding: 11px
    }

    .mem-kpi {
        padding: 12px
    }
}

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }
}

/* A main element inside the shared column flex container must span the parent. */
.wik-members-main {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 16px 10px 42px;
    min-width: 0;
    box-sizing: border-box
}

.wik-members .mem-tabs {
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr))
}

.wik-members .mem-panel[hidden] {
    display: none
}

.wik-members .mem-member-center {
    min-width: 0
}

.wik-members .mem-kpi strong {
    font-variant-numeric: tabular-nums
}

@media(max-width:359px) {
    .wik-members-main {
        padding: 12px 4px 28px
    }

    .wik-members .mem-member-right {
        flex-basis: 70px
    }

    .wik-members .mem-stat-pill {
        font-size: 9px;
        padding: 2px 5px
    }

    .wik-members .mem-stat-value {
        font-size: 9px;
        margin-left: 4px
    }

    .wik-members .mem-rank-value {
        flex-basis: 67px;
        font-size: 11px
    }
}