:root {
    --faction-panel: #013244;
    --faction-panel-2: #01475F;
    --faction-border: rgba(90, 153, 176, 0.45);
    --faction-ice: #2F84B4;
    --faction-ice-light: #5AB4DC;
    --faction-fire: #DE9526;
    --faction-fire-light: #F0A32B;
    --faction-rank-top: #53085A;
    --faction-rank-bottom: #A664BA;
    --faction-rank-ink: #E9B7FD;
    --faction-rank-border-top:#4d0253;
    --faction-rank-border-bottom: #0a1924;
    --faction-bar-height: 42px;
}


.min-w-0 {
    min-width: 0;
}

@media (min-width: 768px) {
    .md\:px-8 {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}


.faction-headline {
    color: var(--color-gold-mid);
    font-size: 1.5rem;
    line-height: 1.2;
    text-align: center;
}

.faction-countdown {
    color: #fff;
    font-size: 1.25rem;
    line-height: 1.2;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.faction-countdown span + span {
	margin-left: 0.15em;
}

.faction-countdown-label {
    margin-right: 0.15em;
}

.faction-countdown-sm {
    font-size: 1.125rem;
}

@media (min-width: 768px) {
    .faction-headline {
        font-size: 1.75rem;
    }

    .faction-countdown {
        font-size: 1.5rem;
    }

    .faction-countdown-sm {
        font-size: 1.5rem;
    }
}


.faction-versus {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 0.25rem 0.75rem;
    margin-top: 0.5rem;
}

.faction-versus-name {
    font-size: 1.25rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faction-versus-name--right {
    text-align: right;
}

@media (min-width: 768px) {
    .faction-versus-name {
        font-size: 1.75rem;
    }
}


.faction-bar-wrap {
    margin-top: 0;
}

.faction-bar-wrap--marker {
    margin-top: 2.25rem;
}

.faction-bar {
    display: flex;
    width: 100%;
    height: var(--faction-bar-height);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.25);
}

.faction-bar-part {
    position: relative;
    display: flex;
    align-items: center;
    min-width: 0;
}

.faction-bar-part + .faction-bar-part {
    transition-delay: 150ms;
}

.faction-bar-value {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 700;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.faction-bar-part {
    justify-content: flex-end;
    padding-right: 1.125rem;
}

.faction-bar-part + .faction-bar-part {
    justify-content: flex-start;
    padding-right: 0;
    padding-left: 1.125rem;
}

.faction-bar-value {
    flex-direction: row-reverse;
}

.faction-bar-part + .faction-bar-part .faction-bar-value {
    flex-direction: row;
}

.faction-bar-trophy {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.45));
}

.faction-bar-icon {
    display: none;
    position: absolute;
    top: 50%;
    left: 0.375rem;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    pointer-events: none;
}

.faction-bar-part + .faction-bar-part .faction-bar-icon {
    left: auto;
    right: 0.375rem;
}

@media (max-width: 767px) {
    .faction-bar-icon {
        display: block;
    }
}

.faction-bar-bolt {
    position: absolute;
    top: 21px;
    width: 21px;
    height: auto;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 2;
    transition: left 900ms ease-out;
}

.faction-bar-marker {
    position: absolute;
    left: var(--marker-pos, 50%);
    bottom: calc(100% + 9px);
    width: max-content;
    max-width: min(90%, 20rem);
    transform: translateX(calc(-1 * var(--marker-pos, 50%)));
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.875rem;
    border-radius: 8px;
    background: #fff;
    color: var(--color-dark-blue);
    font-size: 0.8125rem;
    line-height: 1.2;
    font-weight: 700;
    white-space: normal;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    transition: left 900ms ease-out;
}

.faction-bar-marker-check {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
}

.faction-bar-marker::before {
    content: '';
    position: absolute;
    left: clamp(14px, var(--marker-pos, 50%), calc(100% - 14px));
    bottom: -7px;
    margin-left: -7px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 7px solid #fff;
}

@media (max-width: 767px) {
    .faction-bar-marker {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
    }
}


.faction-bar-percent {
    padding: 0.375rem 0;
    margin: -0.375rem 0;
    cursor: help;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.faction-bar-percent:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 1px;
    border-radius: 4px;
}

.faction-bar-xptip {
    position: absolute;
    left: var(--xptip-pos, 50%);
    top: calc(100% + 9px);
    z-index: 5;
    width: max-content;
    max-width: min(90%, 20rem);
    transform: translateX(calc(-1 * var(--xptip-pos, 50%)));
    padding: 0.375rem 0.75rem;
    border-radius: 8px;
    background: var(--color-light-blue2);
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.2;
    font-weight: 400;
    text-align: center;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    pointer-events: none;
    transform-origin: clamp(14px, var(--xptip-pos, 50%), calc(100% - 14px)) top;
    animation: faction-xptip-in 140ms ease-out;
}

@keyframes faction-xptip-in {
    from {
        opacity: 0;
        transform: translateX(calc(-1 * var(--xptip-pos, 50%))) scale(0.7);
    }

    to {
        opacity: 1;
        transform: translateX(calc(-1 * var(--xptip-pos, 50%))) scale(1);
    }
}

.faction-bar-xptip::before {
    content: '';
    position: absolute;
    left: clamp(14px, var(--xptip-pos, 50%), calc(100% - 14px));
    top: -7px;
    margin-left: -7px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 7px solid var(--color-light-blue2);
}

@media (max-width: 767px) {
    .faction-bar-xptip {
        padding: 0.3125rem 0.625rem;
        font-size: 0.75rem;
    }
}


.faction-bar-hint {
	margin-bottom: 1.5rem;
	color: var(--color-blue_light);
	font-size: 0.75rem;
	line-height: 1.3;
	text-align: center;
}


.faction-cta-grid {
    max-width: 22rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 768px) {
    .faction-cta-grid {
        max-width: none;
    }

    .faction-cta-grid--single {
        max-width: 22rem;
    }
}


.faction-party-grid {
    margin-top: 0.75rem;
}

@media (min-width: 768px) {
    .faction-party-grid {
        margin-top: 0;
    }
}

.faction-party {
	display: flex;
	align-items: flex-start;
	gap: 1.5rem;
	padding: 0 12px;
}

.faction-party-body {
	padding-top: 0.5rem;
}

.faction-flag {
	position: relative;
	z-index: 1;
	flex: 0 0 auto;
	align-self: flex-start;
	width: var(--faction-flag-width, 74px);
	aspect-ratio: var(--faction-flag-ratio, 148 / 300);
	background: var(--faction-flag) top center / 100% 100% no-repeat;
	margin-top: 13px;
}

.faction-flag--ice {
    --faction-flag: url("../assets/factions/flag_ice.webp");
    --faction-flag-ratio: 148 / 300;
}

.faction-flag--fire {
    --faction-flag: url("../assets/factions/flag_fire.webp");
    --faction-flag-ratio: 148 / 308;
}

#stats #fractionswrapper .table-header {
	padding-top: 0rem;
}

@media (min-width: 768px) {
    .faction-flag {
        margin-top: calc(-1 * var(--faction-bar-height, 42px));
    }

    .faction-party:last-child {
        flex-direction: row-reverse;
    }
}

.faction-party-name {
    font-size: 1.25rem;
    line-height: 1.2;
}

.faction-party-text {
    margin-top: 0.375rem;
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.35;
    font-weight: 300;
}

.faction-divider {
    height: 1px;
    background: linear-gradient(90deg, rgba(90, 153, 176, 0) 0%, rgba(90, 153, 176, 0.55) 50%, rgba(90, 153, 176, 0) 100%);
}


.faction-rank-label {
    color: #fff;
    font-size: 1rem;
    line-height: 1.2;
}

.faction-panel {
    border-radius: 10px;
    background: linear-gradient(180deg, rgba(1, 71, 95, 0.75) 0%, rgba(1, 50, 68, 0.75) 100%);
    border: 1px solid var(--faction-border);
}

.faction-reward-panel {
    background: rgba(90, 153, 176, 0.20);
    border: none;
    padding: 8px 16px;
}

.faction-rank-badge {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    width: 5.25em;
    padding: 0.85em 0.25em 0.4em;
    border-radius: 0.5em;
    font-size: 1rem;

    border: 2px solid transparent;
    background-image:
        linear-gradient(180deg, var(--faction-rank-top) 0%, var(--faction-rank-bottom) 100%),
        linear-gradient(180deg, var(--faction-rank-border-top, #fff) 0%, var(--faction-rank-border-bottom, var(--faction-rank-bottom)) 100%);
    background-origin: padding-box, border-box;
    background-clip: padding-box, border-box;

    --faction-rank-trophy: url("../assets/factions/rank_trophy.svg");
}

.faction-rank-badge-trophy {
    flex: 0 0 auto;
    width: 2.75em;
    height: 2.5em;
    background-color: var(--faction-rank-ink);
    -webkit-mask: var(--faction-rank-trophy) center / contain no-repeat;
    mask: var(--faction-rank-trophy) center / contain no-repeat;
}

.faction-rank-badge-range {
    font-family: 'TobiBlack';
    font-size: 1em;
    line-height: 1;
    color: var(--faction-rank-ink);
    white-space: nowrap;
}

.faction-reward-img {
    flex: 0 0 auto;
    width: 32px;
    height: auto;
}

.faction-reward-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    color: #fff;
    font-size: 0.8125rem;
    line-height: 1.1;
    font-weight: 700;
}

.faction-reward-item > span {
    min-width: 0;
    overflow-wrap: break-word;
}

.faction-reward-tier {
    display: flex;
    align-items: stretch;
    gap: 0.5rem;
    height: 100%;
}

.faction-reward-tier .faction-panel {
    flex: 1 1 auto;
    min-width: 0;
}


.faction-bonus {
    border-radius: 8px;
    overflow: hidden;
    background: rgba(90, 153, 176, 0.25);
}

.faction-bonus-head {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    text-align: center;
}

.faction-bonus-head .so-title {
    min-width: 0;
    max-width: 100%;
    background-image: url("../img/so_winter_header.svg");
    color: #fff;
}

.faction-bonus-body {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem 1rem;
}

.faction-bonus-items {
    display: flex;
    align-items: stretch;
}

.faction-bonus-img {
    flex: 0 0 auto;
    max-width: 100%;
}

.faction-bonus-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0 1.5rem;
}

.faction-bonus-item + .faction-bonus-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(180deg, rgba(237, 149, 244, 0.00) 0%, #ED95F4 50%, rgba(237, 149, 244, 0.00) 100%);
}

.faction-bonus-factor {
    color: #fff;
    font-size: 1.75rem;
    line-height: 1;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.faction-bonus-caption {
    color: var(--color-blue_light);
    line-height: 1.2;
    text-align: center;
}

.faction-bonus--winner {
    border-color: #2B002F;
    background:url(../assets/factions/prize_bg.webp) no-repeat center center;
    background-size: cover;
}

.faction-bonus--winner .faction-bonus-head .so-title {
    background-image: url("../assets/factions/so_faction_winner_header.svg");
}

.faction-bonus--winner .faction-bonus-body {
    position: relative;
    background: none;
}

.faction-bonus--winner .faction-bonus-caption {
    position: relative;
    color: #ED95F4;
}

.faction-bonus--winner .faction-bonus-items {
    position: relative;
}


.faction-search input[type=text] {
    display: block;
    padding-top: 1px;
    padding-bottom: 0;
    line-height: normal;
}

.faction-search-icon,
.faction-search-clear {
    top: 0;
    bottom: 0;
    height: auto;
    transform: none;
    display: flex;
    align-items: center;
    line-height: 1;
}


.faction-w-rank {
	width: 84px;
	min-width: 84px;
}

.faction-w-xp {
    width: 110px;
    min-width: 110px;
}

.faction-w-name {
    width: calc(100% - 180px);
    min-width: 0;
    overflow: hidden;
}

@media (max-width: 767px) {
    .faction-w-rank {
        width: 46px;
        min-width: 46px;
    }

    .faction-w-xp {
        width: 84px;
        min-width: 84px;
    }

    .faction-w-name {
        width: calc(100% - 130px);
        max-width: calc(100% - 130px);
    }

    .table-header .faction-w-name {
        justify-content: center;
    }
}

.faction-list-name {
    margin-bottom: 0.375rem;
    font-size: 1.125rem;
    line-height: 1.2;
}

.faction-player-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faction-player-guild {
    flex: 0 1 auto;
    min-width: 0;
    margin-left: 0.35rem;
    font-size: 0.6875rem;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0.85;
}

@media (min-width: 768px) {
    .faction-player-guild {
        font-size: 0.75rem;
    }
}

@media (min-width: 768px) {
    .order-desktop-fixed {
        order: var(--order-desktop);
    }
}

.loadmore-wrapper-mobile {
	position: relative;
	z-index: 40;
	overflow: visible;
	top: -30px;
}

.loadmore-wrapper-mobile::before {
	content: "";
	position: absolute;
	width: 100%;
	height: 124px;
	left: 0;
	bottom: 100%;
	pointer-events: none;
	background: linear-gradient(180deg, rgba(20, 98, 128, 0.00) 0%, rgba(20, 98, 128, 0.00) 30%, #002F40 100%);
	z-index: -1;
	bottom: 20px;
}


.faction-icon {
    display: block;
    flex: 0 0 auto;
    line-height: 0;
}

.faction-icon > div[class*="sprite-"],
.faction-icon > div[class*="sprite-"]::after {
    max-width: none;
    max-height: none;
    width: 100%;
}

.faction-icon-sm {
    width: 30px;
}

.faction-icon-md {
    width: 56px;
}

.faction-icon-lg {
    width: 64px;
}

.faction-icon-xl {
    width: 76px;
}


[class*="faction-ph-"] {
    position: relative;
    display: block;
    flex: 0 0 auto;
    aspect-ratio: 1 / 1;
}

.faction-ph-chest::before {
    content: '';
    position: absolute;
    left: 6%;
    right: 6%;
    top: 16%;
    bottom: 12%;
    background: url(../assets/factions/chest.webp) center/contain no-repeat;
}

.faction-ph-gem {
    clip-path: polygon(50% 0%, 100% 34%, 50% 100%, 0% 34%);
    background: url(../assets/factions/gem.webp) center/contain no-repeat;
}

.faction-ph-item {
    border-radius: 6px;
    background: rgba(1, 50, 68, 0.9);
    border: 1px dashed rgba(239, 187, 73, 0.7);
}

.faction-ph-item::after {
    content: '';
    position: absolute;
    inset: 28%;
    border-radius: 50%;
    background: rgba(239, 187, 73, 0.45);
}
