.spt-profile {
    --spt-profile-border: var(--bs-border-color, #cbd5e1);
    --spt-profile-surface: var(--bs-tertiary-bg, #f5f7fa);
    --spt-profile-accent: var(--bs-primary, #0d6efd);
    --spt-profile-muted: var(--bs-secondary-color, #495057);
    min-width: 0;
    margin-block: 1rem 2rem;
}

.spt-profile .spt-profile-header {
    padding: clamp(1rem, 4vw, 1.75rem);
    border: 1px solid var(--spt-profile-border);
    border-radius: .75rem;
    background: var(--spt-profile-surface);
}

.spt-player-details .spt-profile-header {
    display: flex;
    align-items: flex-start;
    gap: clamp(.75rem, 3vw, 1.25rem);
}

.spt-profile .spt-profile-avatar {
    flex: none;
    width: clamp(3rem, 14vw, 5rem);
}

.spt-profile .spt-profile-avatar img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    border-radius: 50%;
    object-fit: cover;
}

.spt-profile .spt-profile-identity {
    min-width: 0;
}

.spt-profile .spt-profile-header h2 {
    margin: 0;
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.spt-profile .spt-profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 2rem;
    margin: .875rem 0 0;
}

.spt-profile .spt-profile-meta dt {
    color: var(--spt-profile-muted);
    font-size: .875rem;
    font-weight: 500;
}

.spt-profile .spt-profile-meta dd {
    margin: .125rem 0 0;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.spt-profile .spt-profile-ranking-help {
    display: inline-block;
    vertical-align: top;
}

.spt-profile .spt-profile-ranking-help summary {
    display: inline-grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--spt-profile-muted);
    border-radius: 50%;
    font-size: .875rem;
    cursor: pointer;
}

.spt-profile .spt-profile-ranking-help p {
    max-width: 28ch;
    margin: .375rem 0 0;
    font-size: .875rem;
    font-weight: 400;
}

.spt-profile .spt-profile-medals {
    display: flex;
    flex-wrap: wrap;
    gap: .375rem .5rem;
    margin: .875rem 0 0;
    padding: 0;
    list-style: none;
}

.spt-profile .spt-profile-medals + .spt-profile-medals {
    margin-top: .5rem;
}

.spt-profile .spt-profile-medal {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    margin: 0;
    padding: .25rem .625rem;
    border: 1px solid var(--spt-medal-border);
    border-radius: 999px;
    background-color: var(--spt-medal-bg);
    color: var(--spt-medal-text);
    font-size: .875rem;
    line-height: 1.35;
}

.spt-profile-medal--gold {
    --spt-medal-border: #e8c972;
    --spt-medal-bg: #fff3ce;
    --spt-medal-text: #644500;
    --spt-trophy-metal: #9c6500;
}

.spt-profile-medal--silver {
    --spt-medal-border: #c8d1da;
    --spt-medal-bg: #edf1f5;
    --spt-medal-text: #344253;
    --spt-trophy-metal: #657487;
}

.spt-profile-medal--bronze {
    --spt-medal-border: #e4b99a;
    --spt-medal-bg: #f9e7db;
    --spt-medal-text: #663a23;
    --spt-trophy-metal: #945331;
}

.spt-profile .spt-profile-trophy-icon {
    position: relative;
    display: inline-grid;
    place-items: start center;
    flex: none;
    width: 1.375rem;
    height: 1.375rem;
    background:
        linear-gradient(var(--spt-trophy-metal), var(--spt-trophy-metal)) center bottom / .75rem .125rem no-repeat,
        linear-gradient(var(--spt-trophy-metal), var(--spt-trophy-metal)) center bottom / .1875rem .625rem no-repeat;
}

.spt-profile .spt-profile-trophy-icon::before {
    position: absolute;
    inset: .125rem 0 auto;
    height: .625rem;
    box-sizing: border-box;
    border: .125rem solid var(--spt-trophy-metal);
    border-radius: .125rem .125rem .5rem .5rem;
    content: "";
}

.spt-profile .spt-profile-trophy-icon > span {
    position: relative;
    display: grid;
    place-items: center;
    width: .875rem;
    height: .9375rem;
    border-radius: .125rem .125rem .5rem .5rem;
    background: var(--spt-trophy-metal);
    color: #fff;
    font-size: .625rem;
    font-weight: 700;
    line-height: 1;
}

.spt-profile .spt-profile-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin-block: 1rem;
    border-bottom: 1px solid var(--spt-profile-border);
}

.spt-profile .spt-profile-tabs button {
    min-height: 44px;
    padding: .625rem .875rem;
    border: 0;
    border-bottom: 3px solid transparent;
    border-radius: .375rem .375rem 0 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    cursor: pointer;
}

.spt-profile .spt-profile-tabs button:hover,
.spt-profile .spt-profile-tabs button[aria-selected="true"] {
    background: var(--spt-profile-surface);
}

.spt-profile .spt-profile-tabs button[aria-selected="true"] {
    border-bottom-color: var(--spt-profile-accent);
}

.spt-profile :is(button, summary, [tabindex="0"]):focus-visible {
    outline: 2px solid var(--spt-profile-accent);
    outline-offset: -2px;
}

.spt-profile [data-tab-label] {
    margin-block: 1rem;
}

.spt-profile [data-tab-label][hidden] {
    display: none;
}

.spt-profile [data-tab-label] > h3 {
    margin: 0 0 .75rem;
    font-size: 1.25rem;
}

.spt-profile .spt-profile-group {
    margin-block: .5rem;
    border: 1px solid var(--spt-profile-border);
    border-radius: .5rem;
}

.spt-profile .spt-profile-group > summary {
    padding: .75rem 1rem;
    font-weight: 600;
    cursor: pointer;
    overflow-wrap: anywhere;
}

.spt-profile .spt-profile-group[open] > summary {
    border-bottom: 1px solid var(--spt-profile-border);
    background: var(--spt-profile-surface);
}

.spt-profile .spt-profile-group > .spt-profile-group {
    margin: .75rem;
}

.spt-profile .spt-profile-table {
    max-width: 100%;
    overflow-x: auto;
}

.spt-profile [data-tab-label] > .spt-profile-table {
    border: 1px solid var(--spt-profile-border);
    border-radius: .5rem;
}

.spt-profile .spt-profile-table table {
    width: 100%;
    margin: 0;
    font-size: .9375rem;
}

.spt-profile .spt-profile-table :is(th, td) {
    padding: .625rem .75rem;
    text-align: start;
    vertical-align: middle;
}

.spt-profile .spt-profile-table thead th {
    background: var(--spt-profile-surface);
    color: inherit;
}

.spt-profile .spt-profile-table .spt-profile-number {
    text-align: end;
    font-variant-numeric: tabular-nums;
}

.spt-profile .spt-profile-date {
    white-space: nowrap;
}

.spt-profile .spt-profile-context {
    margin: 0 0 .75rem;
    color: var(--spt-profile-muted);
}

.spt-profile .spt-profile-roster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.spt-profile .spt-profile-roster li {
    margin: 0;
    padding: .625rem .875rem;
    border: 1px solid var(--spt-profile-border);
    border-radius: .5rem;
    overflow-wrap: anywhere;
}

.spt-profile .spt-profile-empty {
    margin: 0;
    padding: .75rem 1rem;
    border-radius: .5rem;
    background: var(--spt-profile-surface);
    color: var(--spt-profile-muted);
}
