/*
###################################################################
##        [KSK] Multigaming eSports Clan e.V. – Profilseite        ##
###################################################################
*/

.carousel-indicators { display: none !important; }
.landing-wrapper { height: 0px !important; min-height: 0px !important; margin-bottom: 25px !important; }
.home-wrapper { display: none; }

.container-profile {
    --profile-accent: var(--template-color, #faffa9);
    --profile-panel: #1d1d1d;
    --profile-line: #47483a;
    --profile-muted: #9a9a9a;
    color: #e8e8e8;
}

/* ---------- Kopf: Bild, Name, Status, Rang ---------- */
.profile-hero {
    position: relative;
    display: flex;
    align-items: center;
    gap: 28px;
    margin-top: 24px;
    padding: 24px 28px;
    background-color: var(--profile-panel);
    border-bottom: 2px solid var(--profile-accent);
}

.profile-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.profile-avatar {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--profile-line);
    background-color: #131313;
}

.profile-online {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 20px;
    height: 20px;
    border: 3px solid var(--profile-panel);
    border-radius: 50%;
    background-color: #6fdc6f;
}

.profile-identity {
    flex: 1 1 auto;
    min-width: 0;
}

.profile-name {
    margin: 0;
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

.profile-realname {
    margin-top: 2px;
    color: var(--profile-muted);
    font-size: 15px;
}

.profile-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 12px;
}

.profile-status {
    display: inline-block;
    padding: 3px 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.profile-status-none { background-color: #2a2a2a; color: var(--profile-muted); }
.profile-status-trial { background-color: #5e4a1e; color: #fff; }
.profile-status-member { background-color: #1e3f5e; color: #fff; }
.profile-status-fullmember { background-color: var(--profile-accent); color: #131313; }

.profile-country {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #d3d3d3;
    font-size: 14px;
}

.profile-country .flag {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .25);
}

.profile-social {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

.profile-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--profile-line);
    color: #e8e8e8;
    font-size: 15px;
    transition: border-color .15s, color .15s;
}

.profile-social a:hover,
.profile-social a:focus-visible {
    border-color: var(--profile-accent);
    color: var(--profile-accent);
    text-decoration: none;
}

.profile-rank {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 120px;
}

.profile-rank-img {
    height: 96px;
    width: auto;
}

.profile-rank-name {
    color: var(--profile-accent);
    font-size: 14px;
    font-weight: 700;
    text-align: center;
}

/* „Profil bearbeiten“ oben rechts in der Karte (nur im eigenen Profil) */
.profile-hero.is-own .profile-rank {
    padding-top: 36px; /* Platz für den Button über dem Rang, Name bleibt oben */
}

.profile-edit-link {
    position: absolute;
    top: 14px;
    right: 16px;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid var(--profile-line);
    color: var(--profile-muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    text-transform: uppercase;
    transition: color .15s, border-color .15s;
}

.profile-edit-link:hover,
.profile-edit-link:focus {
    border-color: var(--profile-accent);
    color: var(--profile-accent);
    text-decoration: none;
}

/* ---------- Kennzahlen ---------- */
.profile-stats {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    margin: 1px 0 0;
    background-color: var(--profile-line);
}

.profile-stats > div {
    padding: 12px 18px;
    background-color: var(--profile-panel);
}

.profile-stats dt {
    color: var(--profile-muted);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.profile-stats dd {
    margin: 3px 0 0;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.profile-online-text {
    color: #6fdc6f;
}

/* ---------- Abschnitte ---------- */
.profile-section {
    margin-top: 30px;
}

.profile-h2 {
    margin: 0 0 14px;
    padding: 0 0 8px 10px;
    border-bottom: 1px solid var(--profile-line);
    border-left: 3px solid var(--profile-accent);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
}

.profile-h2 small {
    color: var(--profile-muted);
    font-size: 14px;
    font-weight: 400;
}

.profile-muted {
    color: var(--profile-muted);
}

/* ---------- Medaillen ---------- */
.profile-medals {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-medal {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 8px 12px;
    background-color: var(--profile-panel);
    text-align: center;
    outline: none;
    transition: transform .15s, background-color .15s;
}

.profile-medal:hover,
.profile-medal:focus-visible {
    background-color: #252525;
    transform: translateY(-4px);
}

/* Glanz, der beim Darüberfahren einmal über die Medaille läuft */
.profile-medal {
    position: relative;
    overflow: hidden;
}

.profile-medal::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: -120%;
    width: 40%;
    opacity: 0;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .16) 45%, rgba(250, 255, 169, .22) 50%, rgba(255, 255, 255, .16) 55%, transparent);
    transform: skewX(-18deg);
    pointer-events: none;
}

.profile-medal:hover::after,
.profile-medal:focus-visible::after {
    left: 140%;
    opacity: 1;
    transition: left .6s ease-out;
}

.profile-medal:hover .profile-medal-img,
.profile-medal:focus-visible .profile-medal-img {
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, .7)) brightness(1.08);
}

.profile-medal-img {
    transition: filter .2s;
}

.profile-medal-img {
    height: 90px;
    width: auto;
    margin-bottom: 6px;
    filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .6));
}

.profile-medal-name {
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.25;
}

.profile-medal-date {
    color: var(--profile-muted);
    font-size: 11px;
}

/* ---------- Über mich, Teams, Hardware ---------- */
.profile-columns {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 0 30px;
}

.profile-about {
    color: #d3d3d3;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.profile-teams {
    margin: 0;
    padding: 0;
    list-style: none;
}

.profile-teams li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #262626;
}

.profile-teams a {
    color: #e8e8e8;
    font-weight: 700;
}

.profile-teams a:hover,
.profile-teams a:focus-visible {
    color: var(--profile-accent);
}

.profile-hardware {
    margin: 0;
}

.profile-hardware > div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #262626;
}

.profile-hardware dt {
    color: var(--profile-muted);
    font-weight: 400;
}

.profile-hardware dd {
    margin: 0;
    color: #e8e8e8;
    overflow-wrap: anywhere;
}

/* ---------- Handy ---------- */
@media (max-width: 767px) {
    .profile-hero {
        flex-direction: column;
        text-align: center;
        padding: 22px 16px;
        gap: 16px;
    }

    .profile-tags,
    .profile-social,
    .profile-roles {
        justify-content: center;
    }

    .profile-name {
        font-size: 24px;
    }

    /* Handy: Button unter Name und Status statt oben rechts */
    .profile-hero.is-own .profile-rank {
        padding-top: 0;
    }

    .profile-edit-link {
        position: static;
        order: 1;
    }

    .profile-rank {
        order: 2;
    }

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

    .profile-hardware > div {
        grid-template-columns: 120px minmax(0, 1fr);
    }
}

/* ---------- Aufgaben in Teams (unter dem Namen) ---------- */
.profile-roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 18px;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.profile-roles li {
    color: var(--profile-accent);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.profile-roles li span {
    margin-left: 6px;
    color: var(--profile-muted);
    font-size: 10.5px;
    font-weight: 400;
    letter-spacing: .04em;
}

.profile-roles li.is-current span {
    color: #d3d3d3;
}

/* ---------- Übergang von der Teamseite („Akte öffnen“) ---------- */
@view-transition {
    navigation: auto;
}

.profile-from-team .profile-avatar {
    view-transition-name: ksk-profile-avatar;
}

/* Von der Teamseite öffnet nur der Kopfbereich, nicht zusätzlich die Seitenüberschrift (fx.css) */
.profile-from-team .ueberschrift,
.profile-from-team .ueberschrift::after {
    animation: none;
}

/* Kopfbereich wird von links nach rechts freigegeben … */
.profile-from-team .profile-hero {
    position: relative;
    animation: profile-file-open .6s cubic-bezier(.65, 0, .35, 1) both;
}

/* … ein gelber Balken läuft an der Kante mit und blendet am Ende aus */
.profile-from-team .profile-hero::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: -2px;
    left: 0;
    width: 6px;
    background-color: var(--profile-accent);
    box-shadow: 0 0 18px var(--profile-accent);
    pointer-events: none;
    animation: profile-file-bar .6s cubic-bezier(.65, 0, .35, 1) both, profile-file-bar-out .25s ease-out .6s forwards;
}

/* Der Rest bewegt sich nicht, er blendet nur ein, sobald die Akte offen ist */
.profile-from-team .profile-stats,
.profile-from-team .profile-section {
    animation: profile-fade-in .45s ease-out .5s both;
}

/* Status wird nach dem Öffnen wie ein Stempel aufgedrückt */
.profile-from-team .profile-status {
    animation: profile-stamp .45s cubic-bezier(.3, 1.4, .5, 1) .55s backwards;
}

/* Medaillen nacheinander leicht einblenden (ab der 12. gemeinsam) */
.profile-from-team .profile-medal {
    animation: profile-medal-in .4s ease-out backwards;
    animation-delay: calc(.6s + min(var(--i, 0), 12) * .07s);
}

@keyframes profile-file-open {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

@keyframes profile-file-bar {
    from { left: -6px; }
    to   { left: calc(100% - 6px); }
}

@keyframes profile-file-bar-out {
    to { opacity: 0; }
}

@keyframes profile-stamp {
    0%   { opacity: 0; transform: scale(2.4) rotate(-14deg); }
    55%  { opacity: 1; transform: scale(.94) rotate(-3deg); }
    100% { opacity: 1; transform: none; }
}

@keyframes profile-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes profile-medal-in {
    from { opacity: 0; transform: scale(.92); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .profile-from-team .profile-hero,
    .profile-from-team .profile-stats,
    .profile-from-team .profile-section,
    .profile-from-team .profile-medal,
    .profile-from-team .profile-status {
        animation: none;
    }

    .profile-medal {
        transition: none;
    }

    .profile-medal:hover::after,
    .profile-medal:focus-visible::after {
        opacity: 0;
        transition: none;
    }

    .profile-from-team .profile-hero::after {
        display: none;
    }
}

/* ---------- Zurück zur Teamseite ---------- */
.profile-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    color: var(--profile-muted);
    font-size: 14px;
    text-decoration: none;
}

.profile-back:hover,
.profile-back:focus {
    color: var(--profile-accent);
    text-decoration: none;
}

.profile-teams li.is-current a {
    color: var(--profile-accent);
}

/* ---------- Mein Profil (profil/bearbeiten) ---------- */
/* Sprungleiste zu den Bereichen, bleibt unter dem festen Seitenkopf (70px) stehen */
.profile-edit-nav {
    position: sticky;
    top: 70px;
    z-index: 900;
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 18px;
    padding: 8px 12px;
    background-color: var(--profile-panel);
    border-bottom: 1px solid var(--profile-line);
    box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}

.profile-edit-nav ul {
    display: flex;
    flex: 1 1 auto;
    gap: 4px;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.profile-edit-nav ul::-webkit-scrollbar { display: none; }

.profile-edit-nav li a {
    display: block;
    padding: 6px 12px;
    border-bottom: 2px solid transparent;
    color: var(--profile-muted);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
    transition: color .15s, border-color .15s;
}

.profile-edit-nav li a:hover,
.profile-edit-nav li a:focus,
.profile-edit-nav li a.is-active {
    border-bottom-color: var(--profile-accent);
    color: var(--profile-accent);
    text-decoration: none;
}

.profile-edit-nav .profile-edit-nav-view {
    position: static;
    flex: 0 0 auto;
}

/* Sprungziele nicht unter Seitenkopf und Leiste verstecken */
.container-profile .profile-edit-card {
    scroll-margin-top: 136px;
}

/* Profilbild: eigener Auswahl-Button statt Browser-Feld, Vorschau vor dem Hochladen */
.profile-avatar-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.profile-avatar-preview-note {
    color: var(--profile-accent);
    font-size: 12px;
    text-align: center;
}

.profile-avatar-preview [hidden] {
    display: none !important;
}

/* Ausschnitt und Zoom für das neue Profilbild: Bild verschieben, der Kreis zeigt das spätere Profilbild */
.profile-crop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    width: 240px;
    max-width: 100%;
}

.profile-crop-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background-color: #000;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.profile-crop-stage.is-dragging {
    cursor: grabbing;
}

.profile-crop-stage:focus-visible {
    outline: 2px solid var(--profile-accent);
    outline-offset: 3px;
}

.profile-crop-img {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    pointer-events: none;
}

/* Außerhalb des Kreises abdunkeln */
.profile-crop-stage::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 2px solid var(--profile-accent);
    border-radius: 50%;
    box-shadow: 0 0 0 200px rgba(0, 0, 0, .6);
    pointer-events: none;
}

.profile-crop-zoom {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    color: var(--profile-muted);
}

.profile-crop-zoom input {
    flex: 1 1 auto;
    min-width: 0;
    accent-color: var(--profile-accent);
}

.profile-crop-hint {
    margin: 0;
    color: var(--profile-muted);
    font-size: 12px;
    line-height: 1.4;
    text-align: center;
}

.profile-crop-reset {
    padding: 0;
    border: 0;
    background: none;
    color: var(--profile-accent);
    font-size: 12px;
    cursor: pointer;
}

.profile-crop-reset:hover,
.profile-crop-reset:focus-visible {
    text-decoration: underline;
}

.profile-file {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.profile-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.profile-file-button {
    margin: 0;
}

.profile-file-input:focus-visible + .profile-file-button {
    outline: 2px solid var(--profile-accent);
    outline-offset: 2px;
}

.profile-file-name {
    min-width: 0;
    color: var(--profile-muted);
    overflow-wrap: anywhere;
}

.profile-file-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.profile-edit-card {
    display: block;
    margin-top: 24px;
    padding: 20px 24px 22px;
    background-color: var(--profile-panel);
}

.profile-edit-card .profile-h2 {
    margin-bottom: 18px;
}

.profile-h3 {
    margin: 26px 0 10px;
    color: var(--profile-accent);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.profile-hint {
    margin: -6px 0 14px;
    color: var(--profile-muted);
    font-size: 13px;
}

.profile-hint-tight {
    margin-top: -10px;
}

.profile-alert {
    margin-bottom: 16px;
}

.profile-alert .fa {
    margin-right: 6px;
}

.profile-edit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 0 20px;
}

.profile-edit-avatar {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

.profile-edit-avatar-forms {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.profile-edit-avatar input[type="file"] {
    padding: 6px;
}

.profile-edit-country {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.profile-edit-flag {
    display: inline-flex;
    flex: 0 0 26px;
    justify-content: center;
    padding-top: 10px;
}

.profile-edit-country select {
    max-width: 360px;
}

.profile-edit-buttons {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
}

.profile-edit-current {
    margin-bottom: 14px;
    overflow-wrap: anywhere;
}

.profile-edit-pending {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    margin-bottom: 16px;
    padding: 10px 12px;
    border-left: 3px solid #c8a24a;
    background-color: #2a2516;
    overflow-wrap: anywhere;
}

.profile-edit-pending p {
    margin: 0;
}

/* ---------- Handy ---------- */
@media (max-width: 767px) {
    .profile-edit-card {
        padding: 16px 14px 18px;
    }

    .profile-edit-avatar {
        flex-direction: column;
        align-items: center;
    }

    .profile-edit-avatar-forms {
        width: 100%;
    }

    .profile-edit-nav {
        padding: 6px 8px;
        gap: 8px;
    }

    /* Handy: „Profil ansehen“ nur als Symbol */
    .profile-edit-nav .profile-edit-nav-view {
        padding: 6px 9px;
    }

    .profile-edit-nav-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }
}

/* ---------- Mein Profil: Punkteverlauf ---------- */
.profile-points-wrap {
    overflow-x: auto;
}

.profile-points {
    width: 100%;
    border-collapse: collapse;
}

.profile-points th {
    padding: 6px 10px;
    border-bottom: 1px solid var(--profile-line);
    color: var(--profile-muted);
    font-size: 12px;
    font-weight: 400;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
}

.profile-points td {
    padding: 8px 10px;
    border-bottom: 1px solid #262626;
    overflow-wrap: anywhere;
}

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

.profile-points .profile-points-num {
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.profile-points-num.is-plus { color: #6fdc6f; }
.profile-points-num.is-minus { color: #e06c6c; }
.profile-edit-current strong { color: #fff; }

/* ---------- Mein Profil: Mitgliedsbeitrag ---------- */
.profile-fee-status {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px;
    margin: 0 0 12px;
    padding: 10px 14px;
    border-left: 3px solid var(--profile-line);
    background: #1c1c1c;
}

.profile-fee-status i { margin-right: 2px; }
.profile-fee-status.is-ok { border-left-color: #6fdc6f; }
.profile-fee-status.is-ok i { color: #6fdc6f; }
.profile-fee-status.is-warn { border-left-color: #e0b84c; }
.profile-fee-status.is-warn i { color: #e0b84c; }
.profile-fee-status.is-bad { border-left-color: #e06c6c; }
.profile-fee-status.is-bad i { color: #e06c6c; }
.profile-fee-status strong { color: #fff; }

.profile-fee-way {
    display: inline-block;
    padding: 1px 8px;
    border: 1px solid var(--profile-line);
    font-size: 12px;
    white-space: nowrap;
}

.profile-fee-way-paypal { border-color: #3b7bbf; color: #8cc0f2; }
.profile-fee-way-bar { border-color: #8a7a3a; color: #e0c96c; }

.profile-fee-toggle { margin-top: 10px; }
.profile-fee-private { margin: 14px 0 0; }
.profile-fee-table { max-width: 720px; }
