.profile-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 24px 88px;
    background: transparent;
}

.profile-hero {
    padding: 72px 0 28px;
}

.profile-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: stretch;
}

.profile-hero-card,
.profile-level-card,
.profile-badges-card,
.profile-stat-card {
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow: none;
}

.profile-hero-card {
    position: relative;
    overflow: hidden;
    padding: 28px 30px;
}

.profile-hero-card::before,
.profile-badges-card::before,
.profile-level-card::before {
    content: none;
}

.profile-hero-card::before {
    right: -60px;
    top: -60px;
}

.profile-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 20px;
    align-items: center;
}

.profile-avatar-wrap {
    position: relative;
    width: 124px;
    height: 124px;
    flex: 0 0 auto;
}

.profile-avatar {
    width: 124px;
    height: 124px;
    border-radius: 999px;
    object-fit: cover;
    border: 4px solid rgba(255, 200, 224, 0.42);
    box-shadow: none;
}

.profile-level-pill {
    position: absolute;
    right: 4px;
    bottom: 4px;
    min-width: 42px;
    height: 42px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 14px;
    background: linear-gradient(135deg, #ff8fbf 0%, #b89cff 100%);
    color: #241d2f;
    font-size: 14px;
    font-weight: 900;
    border: 3px solid #2b2735;
}

.profile-kicker,
.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 999px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 158, 199, 0.24);
    background: rgba(255, 158, 199, 0.08);
    color: #ffc3dd;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.profile-kicker {
    margin-bottom: 12px;
}

.profile-name {
    margin: 0;
    font-size: clamp(40px, 5vw, 62px);
    line-height: 0.94;
    font-weight: 900;
    color: #f4eff8;
}

.profile-global-name {
    margin: 8px 0 0;
    color: rgba(227, 220, 233, 0.7);
    font-size: 17px;
}

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

.profile-stat-card {
    padding: 20px 22px;
    min-width: 0;
}

.profile-stat-value {
    display: block;
    margin-top: 8px;
    color: #f4eff8;
    font-size: clamp(22px, 2.4vw, 28px);
    line-height: 1;
    font-weight: 900;
    overflow-wrap: anywhere;
}

.profile-stat-label {
    display: block;
    margin-top: 6px;
    color: rgba(227, 220, 233, 0.68);
    font-size: 13px;
    line-height: 1.45;
}

.profile-stat-value-id {
    font-size: clamp(16px, 1.5vw, 22px);
    letter-spacing: -0.03em;
    white-space: nowrap;
    overflow-wrap: normal;
}

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
}

.profile-level-card,
.profile-badges-card {
    position: relative;
    overflow: hidden;
    padding: 30px;
}

.profile-level-card::before {
    left: auto;
    right: -100px;
    bottom: -120px;
}

.profile-badges-card::before {
    left: -80px;
    bottom: -120px;
}

.profile-section-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 20px;
}

.profile-section-title {
    margin: 0;
    color: #f2eef6;
    font-size: 32px;
    line-height: 1.06;
    font-weight: 900;
}

.profile-section-subtitle {
    margin: 10px 0 0;
    color: rgba(227, 220, 233, 0.72);
    font-size: 15px;
    line-height: 1.7;
}

.profile-section-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.profile-count-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #ffc5de;
    font-size: 13px;
    font-weight: 700;
}

.profile-manage-btn {
    width: 46px;
    height: 46px;
    padding: 0;
}

.profile-level-meta {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 22px;
}

.profile-level-meta-card {
    padding: 18px 20px;
    border-radius: 22px;
    background: rgba(17, 15, 23, 0.44);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-level-meta-card span {
    display: block;
    color: rgba(227, 220, 233, 0.62);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.profile-level-meta-card strong {
    display: block;
    margin-top: 10px;
    color: #f4eff8;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
}

.profile-progress-track {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 18px;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-progress-fill {
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #ff9ec7 0%, #c0a3ff 100%);
    box-shadow: none;
}

.profile-progress-caption {
    position: relative;
    z-index: 1;
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: rgba(227, 220, 233, 0.72);
    font-size: 14px;
    line-height: 1.6;
}

.profile-progress-caption strong {
    color: #f4eff8;
}

.profile-badges-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.profile-badge-card {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    padding: 22px 18px;
    border-radius: 24px;
    background: rgba(17, 15, 23, 0.46);
    border: 1px solid rgba(255, 255, 255, 0.06);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.profile-badge-card:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 158, 199, 0.22);
    box-shadow: none;
}

.profile-badge-icon-wrap {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 24px;
    background: rgba(255, 158, 199, 0.08);
    border: 1px solid rgba(255, 158, 199, 0.14);
}

.profile-badge-icon {
    font-size: 40px;
    line-height: 1;
}

.profile-badge-icon-img {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.profile-badge-name {
    margin: 16px 0 8px;
    color: #f4eff8;
    font-size: 18px;
    line-height: 1.24;
    font-weight: 800;
}

.profile-badge-description {
    margin: 0;
    color: rgba(227, 220, 233, 0.72);
    font-size: 14px;
    line-height: 1.65;
}

.profile-badge-rarity {
    margin-top: auto;
    padding-top: 14px;
    color: #ffc7df;
    font-size: 13px;
    font-weight: 700;
}

.profile-empty {
    position: relative;
    z-index: 1;
    padding: 44px 24px;
    text-align: center;
    border-radius: 26px;
    background: rgba(17, 15, 23, 0.42);
    border: 1px dashed rgba(255, 255, 255, 0.12);
}

.profile-empty-icon {
    font-size: 54px;
    color: #ff9ec7;
}

.profile-empty h3 {
    margin: 18px 0 10px;
    color: #f4eff8;
    font-size: 28px;
    line-height: 1.08;
    font-weight: 900;
}

.profile-empty p {
    margin: 0;
    color: rgba(227, 220, 233, 0.72);
    font-size: 15px;
    line-height: 1.8;
}

.profile-empty p + p {
    margin-top: 10px;
}

.profile-scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #ff9ec7 0%, #b99dff 100%);
    z-index: 120;
    transition: width 0.1s ease;
}

.profile-cookie-consent {
    position: fixed;
    left: 18px;
    right: 18px;
    bottom: 18px;
    z-index: 80;
    border-radius: 24px;
    padding: 18px 22px;
    background: rgba(31, 27, 39, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.profile-cookie-inner {
    max-width: 1180px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
}

.profile-cookie-consent p {
    margin: 0;
    color: rgba(227, 220, 233, 0.76);
    font-size: 14px;
    line-height: 1.7;
}

.profile-cookie-consent a {
    color: #ff9ec7;
}

.profile-cookie-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-hidden {
    display: none !important;
}

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 130;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(7, 6, 11, 0.72);
}

.profile-modal-card {
    width: min(560px, 100%);
    max-height: min(90vh, 760px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    border-radius: 28px;
    background: #22202b;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: none;
}

.profile-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 24px 16px;
}

.profile-modal-header h3 {
    margin: 0;
    color: #f4eff8;
    font-size: 26px;
    line-height: 1.08;
    font-weight: 900;
}

.profile-modal-close {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: rgba(227, 220, 233, 0.82);
    cursor: pointer;
    transition: 0.18s ease;
}

.profile-modal-close:hover {
    border-color: rgba(255, 158, 199, 0.2);
    color: #ffc5de;
}

.profile-modal-body {
    padding: 0 24px 24px;
    overflow: auto;
}

.profile-modal-list {
    padding: 14px;
    border-radius: 22px;
    background: rgba(15, 13, 19, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.profile-modal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.profile-modal-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 120px;
    padding: 16px 12px;
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
    color: #f4eff8;
    cursor: pointer;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.profile-modal-option:hover,
.profile-modal-option.is-selected {
    transform: translateY(-2px);
    border-color: rgba(255, 158, 199, 0.24);
    background: rgba(255, 158, 199, 0.08);
}

.profile-modal-option-name {
    font-weight: 800;
    font-size: 14px;
}

.profile-modal-emoji {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.profile-modal-emoji img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}

.profile-modal-preview {
    margin-top: 14px;
    padding: 18px;
    border-radius: 22px;
    background: rgba(15, 13, 19, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.06);
    text-align: center;
}

.profile-modal-preview h4 {
    margin: 10px 0 6px;
    color: #f4eff8;
    font-size: 20px;
    font-weight: 900;
}

.profile-modal-preview p {
    margin: 0;
    color: rgba(227, 220, 233, 0.72);
    font-size: 14px;
    line-height: 1.7;
}

.profile-modal-preview small {
    display: block;
    margin-top: 8px;
    color: rgba(227, 220, 233, 0.54);
}

.profile-modal-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.profile-modal-status {
    margin-top: 14px;
    min-height: 20px;
    color: rgba(227, 220, 233, 0.78);
    font-size: 14px;
    text-align: center;
}

.profile-loading-state,
.profile-error-state {
    padding: 24px 12px;
    text-align: center;
    font-size: 14px;
}

.profile-loading-state {
    color: rgba(227, 220, 233, 0.66);
}

.profile-error-state {
    color: #ffb3d5;
}

@media (max-width: 1080px) {
    .profile-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .profile-badges-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .profile-page {
        padding: 0 16px 76px;
    }

    .profile-hero {
        padding: 44px 0 22px;
    }

    .profile-hero-card,
    .profile-level-card,
    .profile-badges-card,
    .profile-stat-card {
        border-radius: 24px;
    }

    .profile-hero-card,
    .profile-level-card,
    .profile-badges-card {
        padding: 22px;
    }

    .profile-hero-inner {
        grid-template-columns: auto minmax(0, 1fr);
        text-align: left;
        gap: 16px;
    }

    .profile-avatar-wrap {
        margin: 0;
        width: 96px;
        height: 96px;
    }

    .profile-avatar {
        width: 96px;
        height: 96px;
    }

    .profile-level-pill {
        width: 36px;
        min-width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .profile-stats {
        grid-template-columns: 1fr;
    }

    .profile-level-meta,
    .profile-progress-caption {
        grid-template-columns: 1fr;
        display: grid;
    }

    .profile-section-header {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-badges-grid,
    .profile-modal-grid {
        grid-template-columns: 1fr;
    }

    .profile-cookie-inner,
    .profile-modal-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .profile-section-title {
        font-size: 26px;
    }

    .profile-cookie-consent {
        left: 12px;
        right: 12px;
        bottom: 12px;
        padding: 16px;
    }

    .profile-modal {
        padding: 16px;
    }
}
