/* HAVEN PROFILE NAVIGATION + RECORDS v0.1 */

.profile-tab-nav {
    display: flex;
    align-items: stretch;
    gap: 0;
    margin: 26px 0 30px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    background:
        linear-gradient(
            180deg,
            rgba(24, 30, 35, 0.96),
            rgba(15, 19, 23, 0.96)
        );
}

.profile-tab-button {
    appearance: none;
    position: relative;
    flex: 0 0 auto;
    min-height: 54px;
    padding: 0 17px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: transparent;
    color: rgba(255, 255, 255, 0.62);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    white-space: nowrap;
    cursor: pointer;
}

.profile-tab-button:hover {
    color: rgba(255, 255, 255, 0.92);
    background: rgba(255, 255, 255, 0.035);
}

.profile-tab-button.is-active {
    color: #ffffff;
    background: rgba(209, 106, 45, 0.08);
}

.profile-tab-button.is-active::after {
    content: "";
    position: absolute;
    left: 15px;
    right: 15px;
    bottom: 0;
    height: 2px;
    background: #d16a2d;
}

.profile-tab-button:focus-visible {
    outline: 2px solid #d16a2d;
    outline-offset: -3px;
}

[data-profile-tab-panel][hidden] {
    display: none !important;
}


/* HAVEN PERSONAL RECORDS */

.haven-records-section .profile-record-grid {
    display: grid;
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.profile-record-card {
    position: relative;
    padding: 22px 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(
            180deg,
            rgba(25, 31, 37, 0.93),
            rgba(15, 20, 24, 0.94)
        );
}

.profile-record-card::before {
    content: "";
    position: absolute;
    top: -1px;
    left: -1px;
    width: 42px;
    height: 2px;
    background: #d16a2d;
}

.profile-record-label {
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-record-distance {
    margin-bottom: 10px;
    color: #ffffff;
    font-size: clamp(1.65rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1;
}

.profile-record-detail {
    color: rgba(255, 255, 255, 0.72);
    line-height: 1.6;
}

.profile-record-detail strong {
    color: rgba(255, 255, 255, 0.94);
}

.profile-record-table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(255, 255, 255, 0.09);
}

.profile-record-table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.profile-record-table th,
.profile-record-table td {
    padding: 13px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.profile-record-table th {
    color: rgba(255, 255, 255, 0.54);
    background: rgba(255, 255, 255, 0.025);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.profile-record-table td {
    color: rgba(255, 255, 255, 0.84);
}

.profile-record-table tbody tr:last-child td {
    border-bottom: 0;
}

.profile-record-table .record-distance {
    color: #ffffff;
    font-variant-numeric: tabular-nums;
}

.profile-record-note {
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.78rem;
    line-height: 1.55;
}

@media (max-width: 760px) {

    .profile-tab-button {
        min-height: 50px;
        padding: 0 14px;
        font-size: 0.7rem;
    }

    .haven-records-section .profile-record-grid {
        grid-template-columns: 1fr;
    }

    .profile-record-card {
        padding: 19px 20px;
    }
}

/*
 * HAVEN PROFILE TABS v0.2
 *
 * Progressive enhancement:
 * generated HTML contains every panel in normal document flow.
 * Panels are hidden only after JavaScript has successfully
 * discovered and initialised the complete tab set.
 */

html.profile-tabs-enhanced
[data-profile-tab-panel][data-profile-active="false"] {
    display: none !important;
}

[data-profile-tab-target]:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}


/* HAVEN 61C: approved 58BA weapon thumbnails inside Personnel profiles. */
.player-profile-page-v3 .haven-weapon-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.player-profile-page-v3 .haven-weapon-labels {
    min-width: 0;
}
.player-profile-page-v3 .haven-weapon-art {
    display: block;
    object-fit: contain;
    object-position: center;
    background: transparent;
    border: 0;
    max-width: 100%;
    filter: drop-shadow(0 3px 9px rgba(0,0,0,.32));
}
.player-profile-page-v3 .haven-weapon-art-thumb {
    width: 66px;
    height: 44px;
    flex: 0 0 66px;
    border-radius: 3px;
}
@media (max-width: 760px) {
    .player-profile-page-v3 .haven-weapon-inline { gap: 7px; }
    .player-profile-page-v3 .haven-weapon-art-thumb {
        width: 45px;
        height: 34px;
        flex-basis: 45px;
    }
}


/* HAVEN 61E: compact ranked / recorded personnel map tables. */
.player-profile-page-v3 .profile-data-table tbody tr[hidden] {
    display: none !important;
}
.player-profile-page-v3 .haven-map-expand-61e {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 13px 17px;
    border: 1px solid rgba(255,255,255,.10);
    border-top: 0;
    background: rgba(18,23,28,.82);
}
.player-profile-page-v3 .haven-map-expand-count-61e {
    color: rgba(255,255,255,.64);
    font-size: .8rem;
}
.player-profile-page-v3 .haven-map-expand-button-61e {
    appearance: none;
    border: 1px solid #b56838;
    border-radius: 2px;
    background: rgba(209,106,45,.10);
    color: #fff;
    font: inherit;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .05em;
    padding: 9px 15px;
    cursor: pointer;
}
.player-profile-page-v3 .haven-map-expand-button-61e:hover {
    background: rgba(209,106,45,.22);
}
.player-profile-page-v3 .haven-map-expand-button-61e:focus-visible {
    outline: 2px solid #e58a4e;
    outline-offset: 2px;
}
@media (max-width: 600px) {
    .player-profile-page-v3 .haven-map-expand-61e { padding: 12px; }
}
