:root {
    --border-radius-inputs: 17px;
    --border-thickness: 2px;
    --border-color: #131517;
    --placeholder-font-weight: 400;
    --placeholder-font-size: 13.5px;
    --placeholder-font-color: #757575;
    --box-shadow: rgba(0, 0, 0, 0.34) 0px 2px 2px;
    --default-hover-transition: 0.3s ease;
    --cooltipz-border-width: 50;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Lato', sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #dbdbdb;
    background-image: linear-gradient(to bottom, rgba(211, 211, 211, 0.65), rgba(255, 255, 255, 0.831)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 182px;
    line-height: 25px;
    animation-name: fadein;
    animation-duration: 1s;
    animation-iteration-count: 1;
    animation-fill-mode: forwards;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    padding: 10px;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 55px;
    padding-left: 20px;
    padding-right: 20px;
}

.logo {
    height: 80px;
    width: auto;
}

.btn {
    font-family: 'Lato', sans-serif;
    background-color: #131517;
    color: #ffffff;
    border: none;
    padding: 0 30px;
    cursor: pointer;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    margin-left: 5px;
    margin-right: 5px;
    margin-top: 5.5px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    line-height: 1;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
}

.btn:hover {
    transform: scale(1.05);
}

.btn:active {
    transform: scale(0.95);
}

.placeholder-text {
    font-size: var(--placeholder-font-size);
    font-weight: var(--placeholder-font-weight);
    color: var(--placeholder-font-color);
    line-height: normal;
}

.download-link {
    text-decoration: none;
}

.intro-text {
    padding-left: 35px;
    padding-right: 35px;
    margin-bottom: 70px;
    font-weight: 400;
    text-align: center;
}

.highlight {
    padding: 2px 5px;
    font-weight: 600;
}

.intro-badge {
    background: #131517;
    color: #ffffff;
    padding: 7px 10px;
    border-radius: 5px;
    margin: 0 2px;
    -webkit-box-decoration-break: clone;
    -moz-background-inline-policy: clone;
    box-decoration-break: clone;
}

#guide.highlight {
    background-color: white;
    color: #131517;
    font-weight: 900;
}

.input-row {
    display: flex;
    justify-content: space-between;
    gap: 60px;
    margin-bottom: 25px;
}

.input-row .input-group {
    flex: 1;
    margin-bottom: 0;
}

.input-row .input-wrapper {
    display: flex;
    height: 45px;
}

.input-group {
    margin-bottom: 25px;
}

.input-group label {
    display: block;
    margin-bottom: -10px;
    font-weight: 300;
    font-size: 16px;
}

.input-wrapper {
    display: flex;
    border-radius: var(--border-radius-inputs);
    overflow: hidden;
    border: var(--border-thickness) solid var(--border-color);
    transition: border-color 0.3s ease;
    align-items: stretch;
    box-shadow: var(--box-shadow);
    position: relative;
}

#model-pose-list-error,
#morph-list-error {
    margin-top: 1em;
}

.pose-list {
    border: none;
    border-spacing: 0;
    text-align: left;
    width: 100%;
    margin-top: 0;
}

.viseme-popup-wrapper {
    width: 128px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    transition: var(--default-hover-transition);
}

.viseme-popup {
    position: absolute;
    top: 50px;
    z-index: 10000;
    background-color: white;
    border-style: solid;
    border-radius: var(--border-radius-inputs);
    border-color: var(--border-color);
    border-width: var(--border-thickness);
    padding: 1em;
    cursor: default;
}

.pose-row-td {
    padding: 0.5em 0;
}

.viseme-selector-image {
    width: 60px;
    text-align: center;
    background: no-repeat center/100%;
    image-rendering: pixelated;
}

.already-mapped * {
    filter: saturate(0);
    opacity: 0.25;
}

.viseme-selector-image-title {
    margin-top: -10px;
}

.viseme-preview-image {
    background: no-repeat center/100%;
    height: 64px;
    width: 64px;
    image-rendering: pixelated;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: var(--border-radius-inputs);
    border-color: var(--border-color);
    border-width: var(--border-thickness);
    border-style: solid;
    transition: var(--default-hover-transition);
    cursor: pointer;
    box-shadow: var(--box-shadow);
}

.viseme-preview-image:hover {
    transform: scale(1.15);
}

.viseme-preview-image .placeholder-text {
    padding-left: 1em;
    padding-right: 1em;
}

.viseme-selector-image-wrapper {
    background: transparent;
    border: 0;
    color: inherit;
    font: inherit;
    padding: 4px;
    border-radius: var(--border-radius-inputs);
    transition: var(--default-hover-transition);
    cursor: pointer;
}

.viseme-selector-image-wrapper.active-viseme {
    border-style: solid;
    border-width: var(--border-thickness);
    border-color: var(--border-color);
    box-shadow: var(--box-shadow);
}

.viseme-selector-image-wrapper:hover {
    transform: scale(1.15);
    box-shadow: var(--box-shadow);
}

.viseme-row {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.viseme-row:not(:last-child) {
    margin-bottom: 1em;
}

.viseme-mouth-column {
    width: 128px;
    text-align: center;
}

.texture-type-select {
    border: none;
    box-shadow: none !important;
    width: auto !important;
    margin-left: 10px;
}

select.texture-type-select {
    padding: 0;
}

.texture-path-input {
    padding-left: 5px !important;
}

.pose-column {
    max-width: 125px;
}

.dropdown-height,
.dropdown {
    height: 45px;
}

.dropdown-wrapper {
    height: 60px;
}

.dropdown {
    outline: none;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    border-width: var(--border-thickness);
    border-color: var(--border-color);
    padding: 0 10px;
    border-radius: 12px;
    box-shadow: var(--box-shadow);
    line-height: 1;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    letter-spacing: 0.02em;
}

.input-field,
.textarea-field {
    flex-grow: 1;
    padding: 10px;
    border: none;
    border-radius: 12px 0 0 12px;
    font-family: 'Lato', sans-serif;
    font-weight: 400;
    outline: none;
    height: 100%;
}

.input-field::placeholder {
    font-weight: var(--placeholder-font-weight);
    font-size: var(--placeholder-font-size);
}

.input-field {
    height: 28px;
}

.textarea-field {
    resize: none;
    overflow-y: auto;
}

input[type="number"] {
    -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#last-mouth-duration {
    width: 90px;
    height: 43px;
    font-size: 16px;
    text-align: center;
    padding: 0 5px;
    border: none;
    outline: none;
}

#last-mouth-duration-wrapper {
    width: auto;
    display: inline-flex;
}

.paste-btn {
    height: 33px;
    width: 85px;
}

.upload-btn {
    height: 33px;
    width: 140px;
}

#visemes-timeline {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 0;
}

.paste-btn:hover {
    transform: scale(1.05);
}

.paste-btn:active {
    transform: scale(0.95);
}

.error {
    border-color: #d65959;
    border-width: 2px;
}

.input-wrapper.success {
    border-color: #6bd151;
    border-width: 2px;
}

#done-btn {
    display: block;
    margin: 20px auto;
    margin-left: 0;
    margin-top: 50px;
    transition: all 0.3s ease;
    width: 170px;
    height: 47px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--box-shadow);
}

#done-btn.success {
    background: linear-gradient(to right, #70d059, #3da870);
}

#done-btn.switchBack {
    background-color: #131517;
    animation-name: BackToBlack;
    animation-duration: 0.8s;
}

@keyframes BackToBlack {
    from {
        background: linear-gradient(to right, #70d059, #3da870);
    }

    to {
        background-color: #131517;
    }
}

.video-section {
    margin-top: 100px;
    text-align: center;
    font-weight: 900;
    font-size: 28px;
}

.video-section h2 {
    font-weight: 700;
    margin-bottom: -20px;
}

.video-container {
    position: relative;
    padding-bottom: 56.25%;
}

.video-container iframe {
    position: absolute;
    width: 80%;
    height: 80%;
    border-radius: 14px;
    filter: drop-shadow(0px 3px 2px #999999);
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    margin: auto;
}

.logos {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: 40px;
}

.logo-img {
    height: 30px;
}

.chryfi-logo {
    width: 110px;
    height: auto;
}

.bb-logo {
    width: 120px;
    height: auto;
}

.footer {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8em;
    font-weight: 400;
    text-decoration: none;
}

.impressum,
.datenschutz,
.donation {
    text-decoration: none;
    color: #131517;
}

.copyright-year {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    margin: 0;
    box-shadow: none;
}

.error-message {
    color: #d65959;
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
    height: 15px;
}

.button-group {
    font-family: 'Lato', sans-serif;
    float: right;
    padding-top: 20px;
}

.button-group a.presets {
    color: #ffffff;
    background-color: #131517;
    display: block;
    margin: 0 auto 20px 0;
    transition: all 0.3s ease;
    width: 170px;
    height: 47px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: var(--box-shadow);
    text-decoration: none;
    float: right;
    line-height: 47px;
    text-align: center;
}

.button-group a.help-btn {
    font-family: 'Lato', sans-serif;
    text-decoration: none;
    color: #131517;
    padding: 10px 0;
    display: inline-block;
    transition: all 0.3s ease;
    font-weight: 300;
}

.seperator,
.separator {
    color: rgb(202, 202, 202);
    background: transparent;
    padding: 10px 10px;
    font-style: normal;
}

.presets:hover,
.help-btn:hover {
    transform: scale(1.05);
}

.presets:active,
.help-btn:active {
    transform: scale(0.95);
}

#prefs-popup {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: white;
    background-image: linear-gradient(to bottom, rgba(184, 184, 184, 0.674), rgba(255, 255, 255, 0.715)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 10000;
    max-width: 300px;
}

#prefs-popup p {
    margin: 0 0 15px 0;
    font-size: 14px;
}

#prefs-popup button {
    background-color: #131517;
    color: #fff;
    border: none;
    padding: 10px 20px;
    margin-right: 10px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

#prefs-popup button:hover {
    background-color: #333;
}

#decline-prefs {
    background-color: #888 !important;
}

#decline-prefs:hover {
    background-color: #666 !important;
}

.prefs-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    backdrop-filter: blur(1px);
}

.guide-section {
    margin-top: 60px;
    margin-bottom: 100px;
    background-color: #131517;
    padding-top: 20px;
    padding-left: 40px;
    padding-right: 5px;
    border-radius: 27px;
    padding-bottom: 20px;
    background-image: linear-gradient(to bottom, rgba(19, 21, 23, 0.883), rgba(19, 21, 23, 0.883)), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 182px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    margin-left: 10px;
    margin-right: 10px;
}

.guide-item {
    display: flex;
    align-items: center;
    margin-bottom: 0;
    margin-left: -43px;
    margin-top: -5.5px;
}

.guide-item.reverse {
    flex-direction: row-reverse;
    text-align: right;
}

.guide-image {
    width: 350px;
    height: 250px;
    background-color: #ddd;
    margin-right: 25px;
    flex-shrink: 0;
    margin-left: 18px;
    border-radius: var(--border-radius-inputs);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 122%;
    transition: transform 0.5s ease;
    box-shadow: var(--box-shadow);
}

.guide-image:hover {
    -webkit-transform: scale(1.05);
    transform: scale(1.05);
    box-shadow: 0 10px 10px rgba(0,0,0,0.2);
}

#image01.guide-image {
    background-image: url(../assets/images/01.avif);
    background-size: 450px;
    background-position-x: left;
}

#image02.guide-image {
    background-image: url(../assets/images/02.avif);
    background-size: 450px;
    background-position-x: left;
}

#image03.guide-image {
    background-image: url(../assets/images/03.avif);
    background-size: 450px;
    background-position-x: left;
}

#image04.guide-image {
    background-image: url(../assets/images/04.avif);
    background-size: 450px;
    background-position-x: left;
}

.guide-item.reverse .guide-image {
    margin-right: 10px;
    margin-left: 20px;
}

.guide-image.reverse {
    float: right;
}

.guide-content {
    flex-grow: 1;
    font-weight: 300;
    color: #ffffff;
    padding-left: 40px;
    padding-right: 40px;
}

.guide-content h3 {
    font-size: 24px;
    margin-bottom: 10px;
}

.guide-content p {
    font-size: 16px;
    line-height: 1.5;
}

.help-section {
    margin-top: 100px;
}

.help-title {
    text-align: center;
    font-weight: 900;
    font-size: 30px;
    margin-bottom: 110px;
}

.reference-image {
    text-decoration: underline;
    color: white;
}

#lectorLipsForm {
    padding-left: 35px;
    padding-right: 35px;
    margin-top: 100px;
    margin-bottom: 100px;
}

.centered-container {
    align-items: center;
    text-align: center;
    margin-bottom: 62px;
    margin-top: -70px;
    transform: rotate(90deg);
    margin-left: 10px;
}

.link {
    color: #131517;
    cursor: pointer;
    font-weight: 400;
    text-decoration: none;
}

.link--arrowed {
    display: inline-block;
    height: 2rem;
    line-height: 2rem;
}

.link--arrowed .arrow-icon {
    position: relative;
    top: -1px;
    transition: transform 0.5s ease;
    vertical-align: middle;
}

.link--arrowed:hover .arrow-icon {
    transform: translate3d(7px, 0, 0);
}

.tooltip-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    color: #131517;
    font-size: 14px;
    font-weight: 900;
    margin-left: 10px;
    cursor: help;
    border-radius: 1000px;
}

.generate-actions {
    display: flex;
    align-items: center;
    margin-top: 50px;
    margin-bottom: 20px;
}

.generate-mode-toggle {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: stretch;
    width: 410px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: #eceef3;
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

.generate-toggle-pill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 50%;
    border-radius: 16px;
    background: #131517;
    transition: left 0.28s ease, right 0.28s ease, background 0.28s ease;
    will-change: left, right, background;
    z-index: 0;
    font-style: normal;
}

.generate-mode-toggle.is-bbs .generate-toggle-pill {
    left: 50%;
    right: 0;
}

.generate-mode-toggle.is-single {
    grid-template-columns: 1fr;
    width: 190px;
    background: transparent;
}

.generate-mode-toggle.is-single .generate-toggle-pill {
    left: 0;
    right: 0;
}

.generate-mode-toggle.is-success .generate-toggle-pill {
    background: linear-gradient(to right, #70d059, #3da870);
}

.generate-mode-toggle.is-switching-back .generate-toggle-pill {
    animation-name: BackToBlack;
    animation-duration: 0.8s;
}

.generate-toggle-option,
.generate-mode-toggle #done-btn,
.generate-mode-toggle #done-bbs-btn {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    min-width: 0;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 16px;
    background: transparent;
    box-shadow: none;
    color: #131517;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1;
    cursor: pointer;
    transition: color 0.28s ease, transform 0.2s ease;
}

.generate-toggle-option:hover {
    transform: scale(1.02);
}

.generate-toggle-option:active {
    transform: scale(0.98);
}

.generate-toggle-option.is-active {
    color: #ffffff;
}

.generate-mode-toggle:not(.is-bbs) #done-btn,
.generate-mode-toggle.is-single #done-btn {
    color: #ffffff !important;
}

.generate-mode-toggle:not(.is-bbs) #done-bbs-btn {
    color: #131517 !important;
}

.generate-mode-toggle.is-bbs #done-btn {
    color: #131517 !important;
}

.generate-mode-toggle.is-bbs #done-bbs-btn {
    color: #ffffff !important;
}

.generate-mode-toggle.is-success #done-btn,
.generate-mode-toggle.is-success #done-bbs-btn {
    color: #ffffff !important;
}

.generate-toggle-option.is-active .rainbow-bbs,
.generate-mode-toggle.is-bbs .rainbow-bbs {
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.35);
    filter: brightness(1.2) saturate(1.15);
}

.generate-toggle-option:not(.is-active) {
    color: #131517;
}

.generate-toggle-option[hidden],
.generate-bbs-option[hidden] {
    display: none;
}

.rainbow-bbs {
    display: inline-block;
    margin-left: 0;
    background: linear-gradient(90deg, #ff3b3b, #ff9f1c, #f6e84a, #42d66b, #35b9ff, #7b61ff, #ff4fd8);
    background-size: 420% 100%;
    background-position: 0% 50%;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font-weight: 800;
    animation: rainbowShift 2.6s ease-out infinite;
}

@keyframes rainbowShift {
    0% {
        background-position: 0% 50%;
    }

    92% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@media (max-width: 768px) {
    .guide-item,
    .guide-item.reverse {
        flex-direction: column;
    }

    .guide-image {
        margin-right: 0;
        margin-bottom: 20px;
    }

    .guide-item.reverse .guide-image {
        margin-left: 0;
    }
}
