@charset "utf-8";

/* CSW bayrağı — ayarlar: theme/warforge/_config/csw_winner_flag_ui.php */
.hero-home-flagbar {
    position: relative;
    width: 100%;
    z-index: 4;
    overflow: visible;
    margin-top: auto;
}

.csw-winner-flag--home {
    position: absolute;
    left: var(--csw-flag-left, 0);
    bottom: 100%;
    z-index: 5;
    pointer-events: none;
    width: var(--csw-flag-width, clamp(293px, 36vw, 540px));
    margin-bottom: var(--csw-flag-mb, -4px);
    padding: 0;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.65));
}

.csw-flag-frame {
    position: relative;
    display: block;
    width: 100%;
    line-height: 0;
}

.csw-flag-img {
    display: block;
    width: 100%;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
}

.csw-flag-img--base {
    position: relative;
    z-index: 0;
    clip-path: polygon(
        0 0,
        calc(var(--csw-wave-split, 36) * 1%) 0,
        calc(var(--csw-wave-split, 36) * 1%) 100%,
        0 100%
    );
}

/* Kumaş şeritleri — gerçek bayrak dalgası */
.csw-flag-wave-layer {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    pointer-events: none;
    overflow: visible;
}

.csw-flag-strips {
    position: absolute;
    inset: 0;
}

.csw-flag-strip {
    position: absolute;
    top: 0;
    height: 100%;
    overflow: hidden;
    transform-origin: left center;
    will-change: transform;
}

.csw-flag-wave-on .csw-flag-strip {
    animation: cswFlagStripWave var(--csw-wave-dur, 3.2s) ease-in-out infinite;
}

.csw-flag-img--slice {
    position: absolute;
    top: 0;
    left: 0;
    max-width: none;
    height: auto;
    display: block;
}

.csw-flag-clan {
    position: absolute;
    left: var(--csw-text-left, 57%);
    top: var(--csw-text-top, 57%);
    transform: translate(-50%, -50%);
    max-width: var(--csw-text-max, 42%);
    padding: 0 2px;
    z-index: 3;
    font-family: 'Cinzel', 'Roboto Slab', serif;
    font-weight: 900;
    font-size: var(--csw-text-font, clamp(13px, 2vw, 23px));
    line-height: 1.05;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: center;
    color: #ffe08a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: auto;
    text-decoration: none;
    text-shadow:
        0 0 6px rgba(255, 120, 0, 0.95),
        0 0 14px rgba(255, 80, 0, 0.75),
        0 2px 4px rgba(0, 0, 0, 0.95),
        0 0 2px rgba(0, 0, 0, 1);
    animation: cswClanGlow 2.4s ease-in-out infinite alternate;
}

a.csw-flag-clan:hover {
    color: #fff4c4;
    filter: brightness(1.15);
    text-decoration: none;
}

/* Şerit dalgası — direkten kumaşa doğru zincirleme hareket */
@keyframes cswFlagStripWave {
    0%, 100% {
        transform: perspective(var(--csw-wave-persp, 500px))
            rotateY(0deg)
            rotateZ(0deg)
            skewY(0deg)
            translateY(0);
    }
    25% {
        transform: perspective(var(--csw-wave-persp, 500px))
            rotateY(calc(var(--csw-wave-ry, 14deg) * 0.55))
            rotateZ(calc(var(--csw-wave-strip-rot, 5deg) * 0.6))
            skewY(calc(var(--csw-wave-strip-skew, 3deg) * 0.5))
            translateY(-1px);
    }
    50% {
        transform: perspective(var(--csw-wave-persp, 500px))
            rotateY(calc(var(--csw-wave-ry, 14deg) * -0.25))
            rotateZ(calc(var(--csw-wave-strip-rot, 5deg) * -0.35))
            skewY(calc(var(--csw-wave-strip-skew, 3deg) * -0.4))
            translateY(1px);
    }
    75% {
        transform: perspective(var(--csw-wave-persp, 500px))
            rotateY(var(--csw-wave-ry, 14deg))
            rotateZ(var(--csw-wave-strip-rot, 5deg))
            skewY(var(--csw-wave-strip-skew, 3deg))
            translateY(-2px);
    }
}

@keyframes cswClanGlow {
    0% {
        text-shadow:
            0 0 5px rgba(255, 120, 0, 0.8),
            0 0 12px rgba(255, 80, 0, 0.6),
            0 2px 4px rgba(0, 0, 0, 0.95);
    }
    100% {
        text-shadow:
            0 0 10px rgba(255, 180, 60, 1),
            0 0 22px rgba(255, 100, 0, 0.9),
            0 2px 4px rgba(0, 0, 0, 0.95);
    }
}

@media (max-width: 991px) {
    .csw-winner-flag--home {
        left: var(--csw-m-flag-left, 0);
        width: var(--csw-m-flag-width, clamp(243px, 63vw, 360px));
        margin-bottom: var(--csw-m-flag-mb, -2px);
    }

    .csw-flag-clan {
        font-size: var(--csw-m-text-font, clamp(11px, 3.2vw, 16px));
        max-width: var(--csw-m-text-max, 44%);
    }

    .csw-flag-wave-on .csw-flag-strip {
        animation-name: cswFlagStripWaveMobile;
    }
}

@keyframes cswFlagStripWaveMobile {
    0%, 100% {
        transform: perspective(var(--csw-m-wave-persp, 420px)) rotateY(0deg) rotateZ(0deg) skewY(0deg);
    }
    50% {
        transform: perspective(var(--csw-m-wave-persp, 420px))
            rotateY(var(--csw-m-wave-ry, 10deg))
            rotateZ(var(--csw-m-wave-strip-rot, 4deg))
            skewY(var(--csw-m-wave-skew, 1.5deg));
    }
}

@media (max-width: 575px) {
    .csw-winner-flag--home {
        width: var(--csw-s-flag-width, clamp(216px, 72vw, 293px));
    }
}

.csw-flag-wave-off .csw-flag-wave-layer {
    display: none;
}

.csw-flag-wave-off .csw-flag-img--base {
    clip-path: none;
}

@media (prefers-reduced-motion: reduce) {
    .csw-flag-strip {
        animation: none !important;
    }

    .csw-flag-clan {
        animation: none;
    }
}
