.character-control-panel {
    width: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-evenly;
    gap: 0.3rem;
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    background: var(--gradient-bgc);
    box-shadow: var(--shadow);
    padding: 0.5rem;
    z-index: 5;
}

.close-character {
    border: var(--border-thick);
    border-radius: var(--border-radius-custom);
    color: #e2850c;
    background: rgb(226, 133, 12, 0.1);
    padding: 0.9rem;
    transition: all 0.3s ease;
}

.close-character:hover {
    border: 2px solid #e2850c;
    background: rgb(226, 133, 12, 0.5);
}

.filter-character {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.3rem;
    padding: 0.5rem;
    overflow-x: auto;
}

.filter-character img {
    width: 30px;
    height: 30px;
    aspect-ratio: 1/1;
    background: #e2850c;
    border-radius: var(--border-radius-rounded);
    cursor: pointer;
}

.filter-character h3 {
    margin: 0;
    font-size: 0.9rem;
    font-family: var(--my-font);
}

.filter-character button {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: #e2850c;
    background: rgba(226, 133, 12, 0.1);
    border-radius: var(--border-radius-custom);
    border: var(--border-thick);
    padding: 0.3rem 0.5rem;
    font-family: var(--my-font);
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.filter-character button:hover {
    background: rgba(226, 133, 12, 0.5);
    border: 2px solid #e2850c;
    transform: translateY(-2px);
}

.filter-character button.active-filter {
    background: rgba(226, 133, 12, 0.5);
    color: #e2850c;
}

.filter-character button {
    padding: 0.3rem 0.5rem;
}

.character-settings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: var(--accent-color);
    border-radius: var(--border-radius-custom);
    border: 1px solid thin var(--accent-color);
    overflow: hidden;
}

.faction {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: var(--border-thin);
    padding: 0.9rem;
    border-radius: var(--border-radius-custom);
    color: var(--static-color);
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--content-bgc);
    border: 1px solid #e2850c;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 3px;
    background: #e2850c;
    transition: .4s;
}

input:checked+.slider {
    background: rgb(226, 133, 12, 0.5);
}

input:focus+.slider {
    box-shadow: 0 0 1px var(--accent-color);
}

input:checked+.slider:before {
    -webkit-transform: translateX(26px);
    -ms-transform: translateX(26px);
    transform: translateX(26px);
}

.slider.round {
    border-radius: var(--border-radius-custom);
}

.slider.round:before {
    border-radius: var(--border-radius-custom);
}

.character-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-direction: column;
    position: relative;
    width: 100%;
    min-height: 100vh;
    overflow: hidden;
}

.character-wrapper h2 {
    font-family: var(--my-font);
}

.character-container {
    display: flex;
    align-items: end;
    gap: 1rem;
    max-width: 100vw;
    padding: 1rem;
    position: relative;
    z-index: 3;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    opacity: 1;
    visibility: visible;
}

.character-container.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.character-background,
.character-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
}

.character-background {
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
}

.character-overlay {
    background: linear-gradient(var(--accent) 0%, transparent 50%),
        radial-gradient(circle at 10% 30%, rgba(0, 150, 255, 0.5) 0%, transparent 50%);
    transition: opacity 0.3s ease;
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}

.character-slider {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    flex: 1;
    width: 100%;
    min-width: auto;
    max-width: 100%;
    overflow: hidden;
}

.carousel-view {
    flex: 1;
    max-width: 100%;
    padding: 0.9rem 0;
    overflow: hidden;
}

.character-cards-wrapper {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
    will-change: transform;
}

.character-card {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 0 0 130px;
    min-width: 254px;
    max-width: 254px;
    height: 450px;
    background: var(--content-bgc);
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    border: var(--border-thick);
    border-radius: var(--border-radius-custom);
    overflow: hidden;
    backface-visibility: visible;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease;
    opacity: 1;
}

.character-card.card-hidden {
    opacity: 0;
}

.character-card:hover {
    z-index: 10;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.character-card.clicked {
    color: var(--accent);
    border: 2px solid var(--accent);
}

.character-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: filter 0.3s ease;
    cursor: pointer;
}

.character-card img.not-ready {
    filter: grayscale(100%);
}

.overlay {
    position: absolute;
    bottom: 0;
    width: 100%;
    height: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.9));
    color: var(--text-default);
    box-shadow: inset 0 0 0 0 var(--accent);
    text-align: center;
    padding: 0.5rem;
    transition: box-shadow 0.5s ease-out, height 0.3s ease-in-out, opacity 0.9s ease-in-out;
    pointer-events: none;
    overflow: hidden;
}

.overlay p {
    margin: 0;
}

.character-name {
    color: var(--static-color);
    font-family: var(--my-font);
    font-size: 1.3rem;
}

.overlay p,
.character-name {
    text-shadow: 0 0 3px #0a0a0a;
}

p.title {
    color: var(--accent);
    font-size: 0.9rem;
}

.character-card:hover .overlay {
    box-shadow: inset 0px -50px 50px -50px var(--accent);
    height: 100%;
    opacity: 0;
}

.character-card.clicked .overlay {
    box-shadow: inset 0px -50px 50px -50px var(--accent);
    height: 25%;
    opacity: 1;
}

.character-card.clicked .overlay .character-name {
    color: var(--accent);
}

.character-card.clicked:hover .overlay {
    box-shadow: inset 0px -50px 50px -50px var(--accent);
    height: 20%;
    opacity: 1;
}

.character-action {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
}

.carousel-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e2850c;
    background: rgba(226, 133, 12, 0.1);
    border: var(--border-thick);
    border-radius: var(--border-radius-custom);
    padding: 0.5rem;
    font-size: 1.2rem;
}

.left-btn,
.right-btn {
    transition: all 0.3s ease;
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
}

.left-btn:hover,
.right-btn:hover {
    background: var(--default-overlay);
}

.close-btn-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    width: 100%;
}

.close-btn {
    width: 40px;
    height: 40px;
    aspect-ratio: 1/1;
    color: var(--accent, var(--accent-color));
    border: 2px solid var(--accent, var(--accent-color));
    border-radius: var(--border-radius-rounded);
    padding: 0.5rem;
    font-size: 1rem;
    transition: all 0.5s ease;
}

.close-btn:hover {
    transform: rotate(360deg) scale(1.1);
}

.character-info {
    color: var(--accent);
    backdrop-filter: var(--blur-effect);
    -webkit-backdrop-filter: var(--blur-effect);
    background: var(--gradient-bgc);
    border: var(--border-thin);
    border-radius: var(--border-radius-custom);
    max-width: 40%;
    min-width: 40%;
    padding: 1rem;
    backface-visibility: visible;
    transform-style: preserve-3d;
    transition: opacity 0.4s cubic-bezier(.4, 2, .6, 1);
    animation: slideInRight 0.5s ease;
    opacity: 1;
    overflow: hidden;
}

.info-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.5;
    z-index: -1;
}

.character-info.fading {
    opacity: 0.3;
}

.character-info h2 {
    margin: 0.5rem 0;
    padding: 0.5rem;
    color: var(--accent, var(--accent-color));
    border-bottom: 3px solid var(--accent, var(--accent-color));
    text-align: center;
    transition: 0.3s ease, background-color 0.2s ease, color 0.3s ease, border 0.2s ease;
}

.character-info h3 {
    color: var(--accent, var(--accent-color));
}

.character-info strong {
    background: var(--default-overlay);
    color: var(--accent, var(--accent-color));
    border: 1px solid var(--accent, var(--accent-color));
    border-left: 5px solid var(--accent, var(--accent-color));
    border-right: 3px solid var(--accent, var(--accent-color));
    border-radius: var(--border-radius-custom);
    padding: 0.4rem 0.6rem;
}

.character-info content {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-radius: var(--border-radius-custom);
    color: var(--accent, var(--accent-color));
}

.character-info info {
    background: var(--default-overlay);
    border: 1px solid var(--accent, var(--accent-color));
    border-radius: var(--border-radius-custom);
    padding: 0.4rem 0.6rem;
}

.character-info p {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    border-radius: var(--border-radius-custom);
    text-align: justify;
    line-height: 1.7;
}

.character-info-wrapper {
    position: relative;
    border-radius: var(--border-radius-custom);
    border: var(--border-thin);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.character-info-scrollable {
    height: 370px;
    padding: 0 1rem;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--accent, var(--accent-color)) transparent;
}

#background.info-section {
    line-height: 1.7;
    text-align: justify;
}

.role {
    display: flex;
    gap: 0.3rem;
    margin: 0.3rem;
    position: absolute;
    pointer-events: none;
}

.role img {
    width: 50px;
    height: 50px;
    background: var(--accent);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius-custom);
    opacity: 0.8;
    z-index: 1;
}

#elemental h3 {
    width: 100%;
    border: var(--border-thin);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius-custom);
    padding: 0.7rem;
    margin: 0;
}

#elemental,
#affiliates p,
#likes p,
#dislikes p {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

#basic-info-scrollable,
#abilities,
#weapon,
#affiliates,
#likes,
#dislikes {
    border-bottom: 1px solid var(--accent);
}

#elemental img {
    width: 50px;
    height: 50px;
    margin: 0 0 0.5rem 0;
    aspect-ratio: 1/1;
    border: var(--border-thin);
    box-shadow: var(--shadow);
    border-radius: var(--border-radius-custom);
}

@media screen and (min-width: 2560px) {
    .character-container {
        flex-direction: column-reverse;
    }

    .character-info {
        max-width: 100%;
        min-width: 100%;
    }
}

@media screen and (max-width: 500px) {
    .character-container {
        flex-direction: column;
        justify-content: center;
    }

    .character-card {
        max-width: 100%;
        min-width: 100%;
        min-height: 370px;
    }

    .character-info {
        max-width: 100%;
        min-width: 100%;
    }

    .role img {
        width: 50px;
        height: 50px;
    }

    .character-info h3 {
        font-size: 1rem;
    }

    .character-info strong,
    .character-info info {
        font-size: 0.8rem;
    }

    #elemental img {
        width: 45px;
        height: 45px;
    }
}