/* One badge language across account, public profile and member preview. */
.achievement-collection {
    --badge-text: var(--pa-text, #eef2f7);
    --badge-muted: var(--pa-muted, #a6b0be);
    --badge-border: var(--pa-border, #2a3038);
    --badge-surface: var(--pa-surface, #14181e);
    min-width: 0;
    color: var(--badge-text);
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.achievement-badge {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 14px 6px 12px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: transparent;
    color: var(--badge-text);
    font: inherit;
    text-align: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 180ms ease, border-color 180ms ease;
}

.achievement-art {
    display: block;
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    overflow: visible;
    filter: drop-shadow(0 3px 3px rgb(0 0 0 / 24%));
    transition: transform 200ms ease, filter 200ms ease;
}

.achievement-badge:hover,
.achievement-badge[aria-pressed="true"] {
    border-color: color-mix(in srgb, var(--badge-color) 40%, transparent);
    background: color-mix(in srgb, var(--badge-color) 8%, transparent);
}

.achievement-badge:is(:hover, :focus-visible) .achievement-art {
    transform: translateY(-3px) scale(1.08);
    filter: drop-shadow(0 4px 8px color-mix(in srgb, var(--badge-color) 30%, transparent));
}

.achievement-badge:focus-visible {
    outline: 2px solid var(--pa-accent, #8ac5ff);
    outline-offset: 2px;
}

.achievement-name {
    max-width: 100%;
    color: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.achievement-mark {
    position: absolute;
    top: 8px;
    right: 6px;
    color: var(--badge-color);
    font-size: 11px;
    line-height: 1;
}

.achievement-badge.is-locked {
    color: var(--badge-muted);
}

.achievement-badge.is-locked .achievement-art {
    opacity: .55;
    filter: saturate(.25);
}

.achievement-badge.is-locked .achievement-mark {
    color: var(--badge-muted);
}

.achievement-detail {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    min-height: 128px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid var(--badge-border);
    border-radius: 12px;
    background: var(--badge-surface);
}

.achievement-detail > .achievement-art {
    width: 44px;
    height: 44px;
}

.achievement-detail-copy {
    flex: 1;
    min-width: 0;
    overflow-wrap: anywhere;
}

.achievement-detail-title {
    display: block;
    color: var(--badge-text);
    font-size: 13px;
    line-height: 1.5;
}

.achievement-description,
.achievement-empty {
    margin: 4px 0 0;
    color: var(--badge-muted);
    font-size: 12px;
    line-height: 1.7;
}

.achievement-status {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 10px;
    color: var(--badge-muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.achievement-detail progress {
    display: block;
    appearance: none;
    width: 100%;
    height: 4px;
    margin-top: 8px;
    overflow: hidden;
    border: 0;
    border-radius: 4px;
    background: var(--badge-border);
    accent-color: var(--badge-color);
}

.achievement-detail progress::-webkit-progress-bar {
    background: var(--badge-border);
}

.achievement-detail progress::-webkit-progress-value {
    background: var(--badge-color);
}

.achievement-detail progress::-moz-progress-bar {
    background: var(--badge-color);
}

.achievement-shelf {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 3px;
}

.achievement-mini .achievement-art {
    width: 24px;
    height: 24px;
    filter: none;
}

.profile-achievements:has(> .achievement-collection) {
    display: block;
}

@media (min-width: 1100px) {
    .profile-achievements .achievement-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 359px) {
    .achievement-grid {
        gap: 4px;
    }

    .achievement-art {
        width: 44px;
        height: 44px;
    }

    .achievement-name {
        font-size: 10px;
    }

    .achievement-detail {
        gap: 12px;
        padding: 12px;
    }
}
