.header-profile-button .header-profile-chevron {
    transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
    transform-origin: center center;
}

.header-profile-button .header-profile-chevron::before {
    transition: transform .22s ease, border-color .22s ease, filter .22s ease;
    transform-origin: center center;
}

.header-profile-button:hover .header-profile-chevron,
.header-profile-button.profile-menu-open .header-profile-chevron,
.header-profile-chevron.profile-chevron-open {
    border-color: rgba(182, 235, 255, .98);
    background: radial-gradient(circle at 35% 25%, rgba(151, 229, 255, .34), rgba(4, 24, 52, .96));
    box-shadow: 0 0 18px rgba(95, 207, 255, .48), inset 0 0 14px rgba(121, 219, 255, .18);
}

.header-profile-button.profile-menu-open .header-profile-chevron,
.header-profile-chevron.profile-chevron-open {
    transform: rotate(180deg);
}

.header-profile-button.profile-menu-open .header-profile-chevron::before,
.header-profile-chevron.profile-chevron-open::before {
    filter: drop-shadow(0 0 8px rgba(160, 238, 255, .98));
}

.profile-menu-popover.profile-menu-popover-open {
    animation: profileMenuOpen .16s ease-out;
}

@keyframes profileMenuOpen {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-profile-button .header-profile-chevron,
    .header-profile-button .header-profile-chevron::before,
    .profile-menu-popover.profile-menu-popover-open {
        transition: none;
        animation: none;
    }
}

.profile-menu-popover {
    position: fixed;
    z-index: 120;
    width: min(360px, calc(100vw - 28px));
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(113, 204, 255, 0.42);
    background: linear-gradient(180deg, rgba(6, 18, 34, 0.98), rgba(2, 8, 17, 0.98));
    box-shadow: 0 20px 36px rgba(0, 0, 0, 0.34), 0 0 26px rgba(64, 176, 255, 0.20), inset 0 0 22px rgba(94, 184, 255, 0.06);
}

.profile-menu-popover::before {
    content: "";
    position: absolute;
    right: 54px;
    top: -7px;
    width: 13px;
    height: 13px;
    transform: rotate(45deg);
    border-left: 1px solid rgba(113, 204, 255, 0.42);
    border-top: 1px solid rgba(113, 204, 255, 0.42);
    background: rgba(6, 18, 34, 0.98);
}

.profile-menu-user {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 18px;
    border: 1px solid rgba(94, 184, 255, 0.22);
    background: linear-gradient(90deg, rgba(11, 37, 68, 0.86), rgba(3, 12, 24, 0.92));
    overflow: hidden;
}

.profile-menu-avatar,
.profile-details-avatar,
.profile-stats-avatar {
    width: 58px;
    height: 58px;
    min-width: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 50%;
    border: 1px solid rgba(125, 213, 255, 0.58);
    background: radial-gradient(circle at 35% 28%, rgba(104, 204, 255, 0.24), rgba(5, 16, 31, 0.98));
    box-shadow: 0 0 18px rgba(78, 184, 255, 0.25), inset 0 0 11px rgba(255, 255, 255, 0.06);
    font-size: 1.65rem;
}

.profile-menu-avatar img,
.profile-details-avatar img,
.profile-stats-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.profile-menu-user strong {
    display: block;
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.15;
    max-width: 230px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-menu-user small {
    display: block;
    color: rgba(207, 225, 246, 0.70);
    font-weight: 800;
    margin-top: 4px;
    max-width: 230px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.profile-menu-actions {
    display: grid;
    gap: 8px;
    margin-top: 12px;
}

.profile-menu-action {
    min-height: 46px;
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    border-radius: 15px;
    border: 1px solid rgba(116, 198, 255, 0.22);
    background: linear-gradient(180deg, rgba(8, 29, 54, 0.88), rgba(3, 12, 24, 0.96));
    color: rgba(238, 248, 255, 0.94);
    cursor: pointer;
    text-align: left;
    font-weight: 900;
}

.profile-menu-action span {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: rgba(84, 176, 255, 0.10);
    box-shadow: inset 0 0 0 1px rgba(116, 198, 255, 0.16);
}

.profile-menu-action:hover {
    border-color: rgba(92, 207, 255, 0.74);
    box-shadow: 0 0 14px rgba(56, 175, 255, 0.18), inset 0 0 16px rgba(79, 212, 255, 0.06);
}

.profile-menu-action-danger {
    border-color: rgba(255, 102, 102, 0.30);
}

.profile-menu-action-danger span {
    background: rgba(255, 86, 86, 0.12);
    box-shadow: inset 0 0 0 1px rgba(255, 124, 124, 0.16);
}

.profile-modal-content {
    width: min(720px, 94vw);
    padding: 26px;
    border-radius: 24px;
    box-shadow: 0 0 34px rgba(42, 166, 255, 0.20), inset 0 0 20px rgba(71, 176, 255, 0.06);
}

.profile-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 18px;
}

.profile-modal-head h3 {
    margin: 0;
    font-size: 1.35rem;
    color: #ffffff;
}

.profile-modal-close {
    width: 40px;
    height: 40px;
    border-radius: 13px;
    border: 1px solid rgba(116, 198, 255, 0.34);
    background: rgba(3, 12, 24, 0.72);
    color: rgba(236, 247, 255, 0.96);
    font-size: 1.35rem;
    font-weight: 950;
    cursor: pointer;
}

.profile-details-card,
.profile-stats-userline {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 16px;
    border-radius: 19px;
    border: 1px solid rgba(83, 174, 255, 0.26);
    background: linear-gradient(90deg, rgba(9, 31, 56, 0.92), rgba(4, 14, 29, 0.94));
    margin-bottom: 16px;
}

.profile-details-card strong,
.profile-stats-userline strong {
    display: block;
    color: #ffffff;
    font-size: 1.15rem;
}

.profile-details-card span,
.profile-stats-userline small {
    display: block;
    margin-top: 4px;
    color: rgba(207, 225, 246, 0.72);
    font-weight: 850;
}

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

.profile-details-grid div,
.profile-stats-grid div {
    min-height: 82px;
    padding: 14px;
    border-radius: 17px;
    border: 1px solid rgba(126, 204, 255, 0.20);
    background: linear-gradient(180deg, rgba(8, 22, 40, 0.94), rgba(4, 11, 21, 0.96));
}

.profile-details-grid small,
.profile-stats-grid small {
    display: block;
    color: rgba(205, 225, 246, 0.70);
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 7px;
}

.profile-details-grid strong,
.profile-stats-grid strong {
    display: block;
    color: #ffffff;
    font-size: 1.18rem;
    overflow-wrap: anywhere;
}

.profile-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.profile-stats-loading {
    padding: 18px;
    border-radius: 16px;
    border: 1px solid rgba(126, 204, 255, 0.18);
    background: rgba(5, 16, 31, 0.68);
    color: rgba(218, 236, 255, 0.82);
    font-weight: 850;
}

@media (max-width: 640px) {
    .profile-details-grid,
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }

    .profile-modal-actions {
        justify-content: stretch;
    }

    .profile-modal-actions button {
        flex: 1 1 180px;
    }
}

/* Step 88: Profilmenü-SVG-Icons ohne PNG-Freistellung */
.profile-menu-action-icon {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(84, 176, 255, 0.10);
    box-shadow: inset 0 0 0 1px rgba(116, 198, 255, 0.16), 0 0 10px rgba(54, 175, 255, 0.08);
    overflow: hidden;
}

.profile-menu-action-img {
    width: 28px;
    height: 28px;
    display: block;
    filter: drop-shadow(0 0 8px rgba(75, 188, 255, 0.28));
}

.profile-menu-action-avatar-icon img,
.profile-menu-action-avatar-icon .avatar-emoji {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.profile-menu-action-avatar-icon {
    border-radius: 50%;
    padding: 2px;
}

.profile-menu-action-logout-icon {
    color: rgba(255, 215, 215, 0.94);
    font-size: 1.1rem;
}

.profile-badges-modal-content {
    width: min(640px, 94vw);
}

.profile-badges-empty-card {
    display: grid;
    justify-items: center;
    text-align: center;
    gap: 10px;
    padding: 26px 18px;
    border-radius: 20px;
    border: 1px solid rgba(126, 204, 255, 0.22);
    background: linear-gradient(180deg, rgba(8, 22, 40, 0.94), rgba(4, 11, 21, 0.96));
}

.profile-badges-empty-card strong {
    color: #ffffff;
    font-size: 1.12rem;
}

.profile-badges-empty-card small {
    color: rgba(207, 225, 246, 0.72);
    font-weight: 850;
    max-width: 420px;
}

.profile-badges-main-icon {
    width: 78px;
    height: 78px;
    filter: drop-shadow(0 0 16px rgba(72, 188, 255, 0.28));
}

/* Step 90: Profil-Abzeichen mit Freischaltstatus */
.header-profile-active-badge,
.profile-menu-selected-badge,
.profile-details-selected-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-left: 8px;
    border-radius: 50%;
    border: 1px solid rgba(144, 223, 255, 0.68);
    background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.28), rgba(21, 108, 194, 0.72), rgba(3, 14, 30, 0.98));
    box-shadow: 0 0 15px rgba(72, 188, 255, 0.34), inset 0 0 10px rgba(255, 255, 255, 0.09);
    vertical-align: middle;
    font-size: 0.92rem;
    line-height: 1;
}

.header-profile-active-badge span,
.profile-menu-selected-badge span,
.profile-details-selected-badge span {
    transform: translateY(-1px);
}

.header-profile-active-badge {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
    flex: 0 0 auto;
}

.profile-badges-modal-content {
    width: min(1040px, 96vw);
    max-height: min(86vh, 900px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#profile-badges-content {
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
}

.profile-badges-summary {
    display: grid;
    grid-template-columns: 80px minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 20px;
    border: 1px solid rgba(126, 204, 255, 0.26);
    background: linear-gradient(90deg, rgba(10, 36, 65, 0.94), rgba(4, 13, 27, 0.96));
    box-shadow: inset 0 0 18px rgba(84, 176, 255, 0.06), 0 0 20px rgba(46, 168, 255, 0.12);
    margin-bottom: 16px;
}

.profile-badges-summary-icon {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: rgba(84, 176, 255, 0.10);
    box-shadow: inset 0 0 0 1px rgba(116, 198, 255, 0.16), 0 0 16px rgba(54, 175, 255, 0.12);
}

.profile-badges-summary strong {
    display: block;
    color: #ffffff;
    font-size: 1.24rem;
    line-height: 1.15;
}

.profile-badges-summary small {
    display: block;
    margin-top: 5px;
    color: rgba(207, 225, 246, 0.74);
    font-weight: 850;
}

.profile-badges-category-list {
    display: grid;
    gap: 18px;
}

.profile-badges-category {
    padding: 14px;
    border-radius: 22px;
    border: 1px solid rgba(98, 184, 255, 0.18);
    background: linear-gradient(180deg, rgba(5, 17, 33, 0.78), rgba(3, 10, 20, 0.86));
}

.profile-badges-category h4 {
    margin: 0 0 12px 2px;
    color: #ffffff;
    font-size: 1.02rem;
    letter-spacing: 0.02em;
}

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

.profile-badge-card {
    position: relative;
    min-height: 128px;
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    border-radius: 19px;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.profile-badge-card::before {
    content: "";
    position: absolute;
    inset: -35% -20% auto auto;
    width: 150px;
    height: 150px;
    border-radius: 50%;
    pointer-events: none;
}

.profile-badge-card.is-unlocked {
    border: 1px solid rgba(126, 220, 255, 0.58);
    background: linear-gradient(135deg, rgba(15, 65, 112, 0.96), rgba(5, 18, 36, 0.98));
    box-shadow: 0 0 20px rgba(72, 188, 255, 0.18), inset 0 0 18px rgba(116, 215, 255, 0.06);
}

.profile-badge-card.is-unlocked::before {
    background: radial-gradient(circle, rgba(140, 231, 255, 0.20), transparent 65%);
}

.profile-badge-card.is-unlocked:hover {
    transform: translateY(-2px);
    border-color: rgba(174, 236, 255, 0.88);
    box-shadow: 0 0 26px rgba(76, 195, 255, 0.28), inset 0 0 18px rgba(116, 215, 255, 0.08);
}

.profile-badge-card.is-locked {
    border: 1px solid rgba(126, 204, 255, 0.12);
    background: linear-gradient(135deg, rgba(6, 16, 30, 0.82), rgba(2, 7, 15, 0.94));
    opacity: 0.62;
}

.profile-badge-card.is-selected {
    border-color: rgba(255, 236, 155, 0.92);
    box-shadow: 0 0 28px rgba(255, 210, 86, 0.22), 0 0 22px rgba(72, 188, 255, 0.16), inset 0 0 18px rgba(255, 232, 139, 0.08);
}

.profile-badge-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(157, 226, 255, 0.40);
    background: radial-gradient(circle at 35% 24%, rgba(255, 255, 255, 0.22), rgba(37, 128, 205, 0.42), rgba(3, 14, 30, 0.95));
    box-shadow: 0 0 16px rgba(72, 188, 255, 0.20), inset 0 0 12px rgba(255, 255, 255, 0.06);
    z-index: 1;
}

.profile-badge-card.is-locked .profile-badge-icon {
    filter: grayscale(1);
    opacity: 0.74;
}

.profile-badge-icon span {
    font-size: 1.85rem;
    line-height: 1;
    transform: translateY(-1px);
}

.profile-badge-body {
    min-width: 0;
    z-index: 1;
}

.profile-badge-title-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.profile-badge-title-row strong {
    color: #ffffff;
    font-size: 1rem;
    line-height: 1.15;
}

.profile-badge-body p {
    margin: 7px 0 8px;
    color: rgba(218, 236, 255, 0.82);
    font-size: 0.82rem;
    line-height: 1.35;
    font-weight: 750;
}

.profile-badge-body small {
    display: block;
    color: rgba(178, 207, 232, 0.70);
    font-size: 0.74rem;
    font-weight: 850;
    line-height: 1.35;
}

.profile-badge-action {
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(126, 220, 255, 0.50);
    background: rgba(8, 35, 70, 0.90);
    color: rgba(236, 249, 255, 0.96);
    font-size: 0.72rem;
    font-weight: 950;
    cursor: pointer;
    white-space: nowrap;
}

.profile-badge-action:hover {
    border-color: rgba(178, 238, 255, 0.92);
    box-shadow: 0 0 13px rgba(72, 188, 255, 0.22);
}

.profile-badge-action.is-active {
    border-color: rgba(255, 232, 142, 0.88);
    background: linear-gradient(180deg, rgba(181, 121, 25, 0.95), rgba(77, 46, 8, 0.98));
    color: #ffffff;
}

.profile-badge-lock {
    width: 30px;
    height: 30px;
    min-width: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(126, 204, 255, 0.14);
    background: rgba(2, 8, 17, 0.72);
    filter: grayscale(1);
    opacity: 0.78;
}

@media (max-width: 760px) {
    .profile-badges-grid {
        grid-template-columns: 1fr;
    }

    .profile-badges-summary {
        grid-template-columns: 58px minmax(0, 1fr);
    }

    .profile-badges-summary-icon {
        width: 54px;
        height: 54px;
    }

    .profile-badges-main-icon {
        width: 52px;
        height: 52px;
    }

    .profile-badge-card {
        grid-template-columns: 54px minmax(0, 1fr);
    }

    .profile-badge-icon {
        width: 52px;
        height: 52px;
    }

    .profile-badge-icon span {
        font-size: 1.55rem;
    }
}
