.profile {
    width: 100%;
    margin: 30px auto 0;
}

.profile-feed {
    max-width: 800px;
    margin: 0 auto;
}

.profile-feed .block-header {
    justify-content: center;
    text-align: center;
    margin: 56px 0 28px;
    padding-bottom: 0;
}

    .profile-header {
        margin-top: 40px;
    }

    .profile-buttons {
        display: flex;
        gap: 20px;
        justify-content: center;
        margin-top: 10px;
        margin-bottom: 40px;
    }

.profile-form-page {
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.profile-form {
    margin-top: 12px;
}

.profile-form-name {
    justify-content: center;
    gap: 16px;
    margin: 8px auto 36px;
}

.profile-form-name label {
    font-size: 180%;
    font-weight: 700;
    white-space: nowrap;
}

.profile-form-name-field {
    flex: 0 1 420px;
    width: 420px;
    min-width: 0;
    text-align: left;
}

.profile-form-name input[type="text"] {
    font-size: 160%;
    font-weight: 600;
    padding: 12px 16px;
}

.profile-form .form-group label,
.profile-form-place .form-group label {
    text-align: center;
}

.profile-form-avatar .image-upload {
    flex-direction: column;
    align-items: center;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.profile-form-avatar .image-upload-file input[type="file"] {
    width: auto;
}

.profile-form-place {
    margin-bottom: 24px;
}

.profile-form-place .form-group {
    margin-bottom: 0;
}

.profile-form-place .form-help {
    margin-top: 8px;
    text-align: center;
}

.profile-form-bio textarea {
    min-height: 4.5em;
}

.profile-form .form-actions {
    justify-content: center;
    border-top: none;
    padding-top: 8px;
}

.welcome-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin: 8px 0 36px;
}

.welcome-agreements {
    gap: 16px;
    margin-top: 80px;
    text-align: left;
    font-size: 120%;
    line-height: 1.4;
}

.welcome-agreement {
    gap: 12px;
    cursor: pointer;
}

.welcome-agreement input[type="checkbox"] {
    width: calc(1.15em * 1.5);
    height: calc(1.15em * 1.5);
    flex-shrink: 0;
    cursor: pointer;
}

.welcome-agreement a {
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

@media only screen and (max-width: 600px) {
    .profile-form-name {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        gap: 10px;
    }

    .profile-form-name-field {
        width: 100%;
    }
}

.login-options {
    gap: 12px;
    padding: 10px 0 30px;
}

    .login-option-icon {
        font-size: 22px;
        line-height: 1;
    }

.profile-block {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
    width: 100%;
}

.profile-person {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    min-width: 0;
}

.image-upload {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px 16px;
}

.image-upload-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--highlight-bg);
    color: var(--muted-color);
}

.image-upload-file input[type=file] {
    width: auto;
}

.image-upload .form-error {
    flex-basis: 100%;
}

.profile-avatar {
    flex-shrink: 0;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.profile-info {
    min-width: 0;
}

.profile-name {
    font-size: 220%;
    font-weight: 700;
    line-height: 1.15;
}

.profile-edit,
.profile-edit:visited {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: inherit;
    font-size: 55%;
    vertical-align: middle;
    opacity: 0.45;
    text-decoration: none;
}

.profile-edit:hover {
    opacity: 0.9;
}

.profile-place {
    margin-top: 10px;
    font-size: 120%;
    font-weight: 500;
}

.profile-club,
.profile-club:visited {
    margin-left: 0.12em;
    color: inherit;
    font-size: 1.05em;
    font-weight: 400;
    line-height: 1;
    text-decoration: none;
    vertical-align: -0.02em;
    opacity: 0.85;
}

.profile-club:hover {
    opacity: 1;
}

.profile-comment-source,
.profile-comment-source:visited {
    display: block;
    margin-bottom: 12px;
    overflow-wrap: anywhere;
    color: inherit;
    font-weight: 700;
    text-decoration: none;
    opacity: 0.75;
}

.profile-comment-source:hover {
    opacity: 1;
}

.profile-comment-source .item-tag-separator {
    margin: 0 4px;
}

.profile-bio {
    margin-top: 10px;
}

.profile-stats {
    flex-shrink: 0;
    align-items: flex-end;
    gap: 6px;
    text-align: right;
}

.profile-stat-rating {
    font-size: 300%;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

a.profile-stat-rating,
a.profile-stat-rating:visited {
    text-decoration: none;
}

a.profile-stat-rating:hover {
    opacity: 0.75;
}

.rating-history {
    gap: 18px;
}

.rating-history-row {
    gap: 16px 24px;
}

.rating-history-change {
    font-size: 140%;
    font-weight: 700;
    line-height: 1.2;
    font-variant-numeric: tabular-nums;
}

.rating-history-reason {
    flex: 1;
    min-width: 0;
    font-size: 120%;
}

.rating-history-date {
    opacity: 0.55;
    font-size: 90%;
    white-space: nowrap;
}

.rating-history-empty {
    margin: 0;
    opacity: 0.7;
}

@media only screen and (max-width: 600px) {
    .rating-history-row {
        gap: 8px 16px;
    }
}

.profile-stat {
    font-variant-numeric: tabular-nums;
}

@media only screen and (max-width: 600px) {
    .profile-block {
        flex-direction: column;
        gap: 20px;
    }

    .profile-person {
        flex-direction: column;
    }

    .profile-stats {
        align-items: flex-start;
        text-align: left;
    }
}

/* Compact user links */

.user-badge,
.user-badge:visited {
    display: inline-flex;
    align-items: center;
    color: var(--text-color);
    text-decoration: none;
}

.user-badge .avatar {
    flex-shrink: 0;
}

.user-badge-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-badge-small {
    gap: 8px;
    max-width: 100%;
    font-weight: 500;
}

.user-badge-small .avatar {
    width: 32px;
    height: 32px;
}

.user-badge-small .user-badge-name,
.user-badge-small .rating {
    font-size: 108%;
}

.user-badge-tiny {
    gap: 6px;
    vertical-align: middle;
    font-weight: 700;
}

.user-badge-tiny .avatar {
    width: 20px;
    height: 20px;
}

.user-badge-tiny .user-badge-name {
    min-width: 0;
}

