/* #region 1: ÖN YÜZ VİTRİN KAPSAYICISI */
.card-front {
    padding: 0 4.5cqw 4.5cqw 4.5cqw;
    transform: translateZ(2px);
}

/* Sağ Kenar: Ribbon / Flag Butonları */
.card-flags-wrapper {
    position: absolute;
    top: 36px;
    left: 100%;
    margin-left: -2px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 35;
    pointer-events: auto;
    transition: left 0.32s var(--ease-spring),
                right 0.32s var(--ease-spring),
                transform 0.32s var(--ease-spring),
                opacity 0.25s ease;
}

.card-flag-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 42px;
    padding: 0;
    border-radius: 0 12px 12px 0;
    border: none;
    cursor: pointer;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: transform 0.32s var(--ease-spring),
                border-radius 0.32s var(--ease-smooth),
                width 0.32s var(--ease-spring),
                height 0.32s var(--ease-spring),
                box-shadow 0.22s ease,
                filter 0.22s ease;
    user-select: none;
    outline: none;
}

.card-flag-btn .flag-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
    transition: transform 0.3s ease;
}

/* 🟥 Trophies Canlı Kırmızı/Yakut Ribbon */
.card-flag-btn.flag-trophies {
    background: linear-gradient(135deg, #ff3b56 0%, #e03131 65%, #c92a2a 100%);
    box-shadow: 4px 4px 14px rgba(224, 49, 49, 0.45), 2px 2px 6px rgba(0, 0, 0, 0.4);
}

.card-flag-btn.flag-trophies:hover {
    transform: translateX(4px) scale(1.04);
    box-shadow: 6px 4px 20px rgba(255, 59, 86, 0.65), 2px 2px 8px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

.stage.has-companion-open.is-trophies-active .card-flag-btn.flag-trophies {
    transform: translateX(3px);
    box-shadow: 0 0 24px rgba(255, 59, 86, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    filter: brightness(1.15);
}

/* 🟦 Showcase Canlı Mavi/Safir Ribbon */
.card-flag-btn.flag-showcase {
    background: linear-gradient(135deg, #228be6 0%, #1c7ed6 60%, #1864ab 100%);
    box-shadow: 4px 4px 14px rgba(34, 139, 230, 0.45), 2px 2px 6px rgba(0, 0, 0, 0.4);
}

.card-flag-btn.flag-showcase:hover {
    transform: translateX(4px) scale(1.04);
    box-shadow: 6px 4px 20px rgba(34, 139, 230, 0.65), 2px 2px 8px rgba(0, 0, 0, 0.4);
    filter: brightness(1.1);
}

.stage.has-companion-open.is-showcase-active .card-flag-btn.flag-showcase {
    transform: translateX(3px);
    box-shadow: 0 0 24px rgba(34, 139, 230, 0.8), inset 0 0 10px rgba(255, 255, 255, 0.3);
    filter: brightness(1.15);
}

/* 🔄 FLIP DURUMU 1: Masaüstü (Taşma Yokken) -> Havada Asılı Dairesel Forma Dönüşüm */
.card-container.is-flipped:not(.flags-inward) .card-flags-wrapper {
    transform: translateX(12px) translateZ(40px);
}

.card-container.is-flipped:not(.flags-inward) .card-flag-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.card-container.is-flipped:not(.flags-inward) .card-flag-btn:hover {
    transform: scale(1.12);
}

/* 📐 TAŞMA DURUMU (Masaüstünde Pencere Daraldığında KART İÇİNE DOĞRU DÖNÜŞ) */
.card-container.flags-inward .card-flags-wrapper {
    left: auto;
    right: 12px;
    top: 24px;
    margin-left: 0;
    gap: 8px;
}
.card-container.flags-inward .card-flag-btn {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.card-container.is-flipped.flags-inward .card-flags-wrapper {
    opacity: 0;
    pointer-events: none;
    transform: translateZ(-20px) scale(0.9);
}

/* 📱 MOBİL (<= 899px): Ribbon butonlar tamamen gizlenir, yerini 3 nokta göstergesine bırakır */
@media (max-width: 899px) {
    .card-flags-wrapper {
        display: none !important;
    }
}
/* #endregion */

/* #region 2: 1. BÖLGE — ÜST KİMLİK (BANNER, AVATAR, İSİM, UNVAN) */
.identity-zone {
    flex-shrink: 0;
    margin: 0 -4.5cqw 0 -4.5cqw;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.banner-box {
    width: 100%;
    height: 28cqh;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.banner-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar-box {
    width: 25cqw;
    height: 25cqw;
    border-radius: var(--radius-circle);
    margin-top: -11cqw;
    position: relative;
    z-index: 10;
    border: 3.5px solid var(--bg-card);
    box-shadow: var(--shadow-avatar);
    overflow: hidden;
    background: var(--bg-card);
}

.avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.profile-name {
    margin-top: 2cqh;
    width: 90%;
    font-family: var(--font-display, var(--font-sans));
    font-size: var(--cq-fs-name);
    font-weight: 750;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.02em;
}

.profile-title {
    margin-top: 0.6cqh;
    width: 85%;
    font-size: var(--cq-fs-subtitle);
    font-weight: 500;
    color: var(--text-tertiary);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* #endregion */

/* #region 3: 2. BÖLGE — ESNEK GÖVDE (BİO / ALINTI) */
.bio-zone {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5cqh 3cqw;
    text-align: center;
    overflow: hidden;
}

.profile-bio {
    font-size: var(--cq-fs-body);
    line-height: 1.6;
    color: var(--text-secondary);
    font-weight: 450;
    text-align: center;
    max-width: 96%;
    word-break: break-word;
    white-space: pre-wrap;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    max-height: calc(1.6em * 5 + 4px);
    padding: 2px 8px;
    box-sizing: border-box;
    overflow: hidden;
}
/* #endregion */

/* #region 4: 3. BÖLGE — TABAN (TAG IZGARASI) */
.tags-zone {
    margin-top: auto;
    flex-shrink: 0;
    width: 100%;
    position: relative;
}

.tags-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 1.8cqw;
}

@media (max-width: 899px) {
    body.is-owner .tag-add-pill {
        display: none !important;
    }
    body.is-owner .tag-remove-btn {
        display: none !important;
    }
    body.is-owner .tags-zone {
        cursor: pointer;
    }
}

.tag-pill {
    padding: 1.2cqw 3.5cqw;
    background: var(--bg-pill);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-pill);
    font-size: var(--cq-fs-pill);
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    white-space: nowrap;
    width: auto;
    max-width: 100%;
    position: relative;
    overflow: visible;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.tag-pill:hover {
    background: var(--bg-pill-hover);
    color: var(--text-primary);
}
/* #endregion */
