:root {
    --config-panel-width: 270px;
    --result-panel-width: 270px;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    border-radius: 6px;
    -webkit-border-radius: 6px;
    background-color: #ffffff27;
}

::-webkit-scrollbar-thumb {
    -webkit-border-radius: 6px;
    border-radius: 6px;
    background: #ffffffbe;
}

::-webkit-scrollbar-thumb:window-inactive {
    background: #ffffff96;
}

body {
    width: 100vw;
    height: 100vh;
    background-color: #000000;
    color: #FFFFFF;
    font-family: "Roboto", serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-variation-settings: "wdth" 100;
    display: flex;
    flex-flow: row nowrap;
    overflow: hidden;
}

.hidden {
    display: none !important;
}

.transparent {
    opacity: 0 !important;
}

.collapse {
    height: 0;
    overflow: hidden;
    transition: height 0.2s ease-in-out;
}

.collapse.show {
    height: auto;
}

.collapse-icon {
    transition: transform 0.2s linear;
    transform: rotate(90deg);
}

.collapsed .collapse-icon {
    transform: rotate(0deg);
}


a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.1s ease, text-shadow 0.1s ease;
    user-select: none;
}

a:hover {
    opacity: 1.0;
    text-shadow: 0 0 0.3em #FFFFFFA0;
    color: #FFFFFF;
}

a:active {
    font-weight: 800;
    text-shadow: 0 0 0.5em #FFFFFFA0;
}

.btn {
    display: inline-block;
    padding: 0.3rem 0.5rem;
    color: #FFFFFF;
    background-color: #FFFFFF29;
    border: 1px solid #535353;
    border-radius: 0.3rem;
    transition:
        background-color 0.1s ease,
        box-shadow 0.1s ease;
}

.btn:hover {
    background-color: #FFFFFF40;
    box-shadow: 0 0 3px #ffffff50;
}

.btn:disabled {
    pointer-events: none;
    cursor: auto;
    box-shadow: none;
    opacity: 0.5 !important;
    color: #f1f1f19a;
}

.btn.btn-sm {
    padding: 0.1rem 0.5rem;
}

.btn-round {
    border-radius: 2rem;
}

.btn .btn-spinner {
    display: none;
}

.btn:disabled .btn-label {
    display: none;
}

.btn:disabled .btn-spinner {
    display: inline;
}

.btn-purple {
    background-color: #b31aea4f;
    border: 1px solid #9540b34f;
}

.btn-purple:hover {
    background-color: #b410f086;
}

.btn-purple:active {
    background-color: #bb00ffb6;
    transition: none;
}

.btn-green {
    background-color: #04b81336;
    border: 1px solid #04ca154b;
}

.btn-green:hover {
    background-color: #04b81354;
}

.btn-green:active {
    background-color: #05c41571;
    transition: none;
}

.btn-red {
    background-color: #b8040436;
    border: 1px solid #ad08084b;
}

.btn-red:hover {
    background-color: #b8040454;
}

.btn-red:active {
    background-color: #c4050571;
    transition: none;
}

.btn-orange {
    background-color: #b8550436;
    border: 1px solid #ad4a084b;
}

.btn-orange:hover {
    background-color: #b8550454;
}

.btn-orange:active {
    background-color: #c4510571;
    transition: none;
}

.btn-group {
    display: flex;
    flex-flow: row nowrap;
}

.btn-group.large {
    width: 100%;
}

.btn-group .btn,
.btn.btn-toggle {
    padding: 0.1rem 0.3rem;
    font-size: 0.7rem;
    opacity: 0.8;
    font-weight: 600;
    color: #B9B9B9;
    transition: background-color 0.1s ease, box-shadow 0.1s ease;
}

.btn-group .btn.active,
.btn.btn-toggle.active {
    color: #FFFFFF;
    background-color: #FFFFFF50;
    opacity: 1;
    box-shadow: inset 0 0 0.5em #FFFFFF50;
}

.btn-group .btn:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    margin-left: -1px;
}

.btn-group .btn:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.btn-group.large .btn {
    flex-grow: 1;
}

.toggle {
    position: relative;
    width: 1.8em;
    height: 1.4em;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.1s ease;
    user-select: none;
}

.toggle:hover {
    opacity: 1.0;
}

.toggle .toggle-on,
.toggle .toggle-off {
    position: absolute;
    top: 0;
    height: 1.4em;
    transition: opacity 0.15s ease;
}

.toggle .toggle-on {
    opacity: 0;
}

.toggle.active .toggle-on {
    opacity: 1;
}

.toggle .toggle-off {
    opacity: 1;
}

.toggle.active .toggle-off {
    opacity: 0;
}

.separator {
    text-align: center;
    color: #ffffff0f;
}

.helptext {
    position: fixed;
    top: 0rem;
    left: 50%;
    max-width: 40%;
    transform: translateX(-50%);
    background-color: #08274b;
    opacity: 0;
    padding: 1rem 1.5rem;
    border-radius: 1.2rem;
    box-shadow: 0 0 0.8rem 0.1rem #000000F0;
    transition: top, opacity;
    transition-duration: 0.3s;
    transition-timing-function: ease;
    pointer-events: none;
}

.helptext.show {
    top: 1rem;
    opacity: 0.95;
}

.helptext-icon {
    font-size: 2rem;
    text-align: center;
}

.helptext-content {
    text-align: center;
}

.overlay {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    display: none;
}

.popup-open .overlay {
    display: block;
}

.popup-input {
    display: none;
    position: fixed;
    left: calc(var(--config-panel-width) + 10px);
    top: 50vh;
    transform: translateY(-50%);
    background-color: #011c3d;
    border-radius: 0.5rem;
    box-shadow: 0px 0px 5px 3px #040716b8;
    padding: 0.6rem;
}

.popup-open .popup-input {
    display: block;
}

.popup-input-arrow {
    position: absolute;
    width: 15px;
    height: 15px;
    top: 50%;
    left: 0;
    background-color: #011c3d;
    transform: translate(-40%, -50%) rotate(45deg);
}

.popup-input-body {
    position: relative;
    background-color: #011c3d;
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    gap: 0.3em;
}

.popup-input-body input {
    width: 5rem;
    height: 2rem;
    background-color: #010d1b;
    border: 1px solid #062c5a;
    outline: none;
    color: #FFFFFF;
    border-radius: 0.3rem;
    padding: 0.2rem 0.5rem;
    text-align: center;
}

.popup-input-unit {
    display: none;
    height: 2rem;
    background-color: #021730;
    border: 1px solid #062c5a;
    border-radius: 0.3rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    margin-left: -1px;
}

.popup-input-body.has-unit input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

.popup-input-body.has-unit .popup-input-unit {
    display: inline-block;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.popup-input-body .btn {
    height: calc(2rem - 4px);
    font-size: 80%;
}

.popup-input-control-container {
    display: flex;
    flex-flow: row nowrap;
    gap: 0;
}

.popup-input.auto .popup-input-control-container {
    opacity: 0.5;
}

.config-panel {
    max-width: var(--config-panel-width);
    min-width: var(--config-panel-width);
    background-color: #000b18;
    font-size: 0.8rem;
    padding: 0.5rem;
    display: flex;
    flex-flow: column nowrap;
    gap: 0.5rem;
    box-shadow: 0 0 10px #0000003d;
    z-index: 10;
}

.title {
    position: relative;
    color: #F0F0F0;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 0;
    align-self: center;
    user-select: none;
}

.title-beta {
    font-size: 0.6rem;
    color: #FFFFFF;
    background-color: #a10909;
    padding: 0.1rem 0.5rem;
    border-radius: 2rem;
    position: absolute;
    right: -1.2rem;
    bottom: -0.3rem;
    user-select: none;
}

.main-actions {
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
    align-self: center;
    font-size: 80%;
    display: flex;
    flex-flow: row wrap;
    gap: 0.5rem;
}

.config,
.stats {
    position: relative;
    overflow-y: auto;
    flex: 1;
}

.config-title-container {
    margin-bottom: -0.5rem;
}

.config-title,
.btn-download-config {
    margin-bottom: 0;
    color: #ABF12F;
}

.btn-download-config:hover {
    color: #ABF12F;
}

.config-content,
.stats-content {
    width: 100%;
    height: 100%;
}

.config.loading .config-content,
.stats.loading .stats-content {
    display: none;
}

.config-loading-container,
.config-disabled,
.stats-loading-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    justify-content: center;
    align-items: center;
    display: none;
}

.config-loading-container {
    background-color: #000b18;
}

.config-disabled {
    background-color: #000b1898;
    display: block;
    pointer-events: all;
}

.config.loading .config-loading-container,
.stats.loading .stats-loading-container {
    display: flex;
}

.config-category {
    margin-bottom: 0.5rem;
}

.config-category.collapsed {
    margin-bottom: 0;
}

.config-category-title {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.2rem;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.1s linear;
    user-select: none;
}

.config-category.collapsed .config-category-title {
    opacity: 0.4;
}

.config-category .config-category-title:hover {
    opacity: 1;
}

.config-subcategory {
    margin-left: 0.3rem;
    margin-bottom: 0.2rem;
    transition: margin-bottom 0.2s linear;
}

.config-subcategory.collapsed {
    margin-bottom: 0;
}

.config-subcategory-title {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.1rem;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.1s linear;
    user-select: none;
}

.config-subcategory.collapsed .config-subcategory-title {
    opacity: 0.6;
    margin-bottom: 0;
}

.config-subcategory .config-subcategory-title:hover {
    opacity: 1;
}

.config-subcategory-content {
    margin-left: 0.5rem;
}

.config-option {
    margin-bottom: 0.2rem;
    margin-left: 0.6rem;
    display: flex;
    flex-flow: row wrap;
    gap: 0.5rem;
}

.config-label {
    opacity: 0.8;
}

.config-float-value,
.config-int-value {
    text-decoration: underline;
}

.config-float-value.auto,
.config-int-value.auto {
    opacity: 0.5;
    font-style: italic;
}

.btn-generate {
    width: 100%;
    font-size: 110%;
    font-weight: 500;
}

.render-panel {
    background-color: #001023;
    flex-grow: 1;
    position: relative;
}

.render-container {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.render-panel:not(.empty) .render-container {
    cursor: grab;
}

.render-stack {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transform-origin: top left;
    user-select: none;
    pointer-events: none;
    transition: filter 0.3s ease, opacity 0.3s ease;
}

.render-stack.animate-transform {
    transition: transform 0.1s linear;
}

.render-stack-hidden {
    filter: blur(10px);
    opacity: 0.5;
}

.render-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.render-svg.focused {
    z-index: 1;
    filter: brightness(120%);
}

.render-svg.unfocused {
    filter: brightness(40%);
}

.render-svg.selected {
    z-index: 1;
}

.render-welcome-container,
.render-loading-container,
.render-placeholder-container,
.render-nav-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
    pointer-events: none;
}

.render-panel:not(.empty) .render-placeholder-container {
    display: none;
}

.render-welcome-content {
    max-width: 80%;
    text-align: center;
}

.render-welcome-content-1 {
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 150%;
}

.render-welcome-content-2 {
    margin-bottom: 5rem;
}

.render-loading-container {
    transition: opacity 1s ease;
}

.render-nav-container {
    justify-content: end;
}

.render-panel.empty .render-nav-container {
    display: none;
}

.render-nav-buttons-container {
    display: flex;
    flex-flow: row nowrap;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.render-nav-button {
    cursor: pointer;
    pointer-events: all;
}

.render-placeholder,
.render-loading {
    height: 300px;
    width: 300px;
    max-width: 80%;
    stroke-width: 1.5;
}

.render-placeholder {
    stroke: #00040e36;
}

.render-loading {
    stroke: #FFFFFFA0;
    stroke-dasharray: 450;
    stroke-dashoffset: 450;
}

.render-loading.animate {
    animation: render-loading 1s ease infinite alternate;
}

@keyframes render-loading {
    from {
        stroke-dashoffset: 450;
    }
    to {
        stroke-dashoffset: 0;
    }
  }

.render-error-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-flow: column nowrap;
    justify-content: center;
    align-items: center;
}

.render-error {
    max-width: 80%;
    background-color: #5c1414d4;
    border: 1px solid #721313;
    border-radius: 1em;
    padding: 0.8em;
    text-align: center;
}

.render-error-icon {
    text-align: center;
    font-size: 2em;
}

.render-error-message-1,
.render-error-message-3 {
    font-weight: 600;
}

.results-panel {
    position: relative;
    min-width: var(--result-panel-width);
    max-width: var(--result-panel-width);
    background-color: #00142b;
    font-size: 0.8rem;
    padding: 0.5rem;
    padding-top: 0.8rem;
    display: flex;
    flex-flow: column nowrap;
    box-shadow: 0 0 10px #0000003d;
    z-index: 10;
    transition: min-width 0.3s ease, max-width 0.3s ease, padding 0.3s linear;
}

.results-panel.folded {
    min-width: 0;
    max-width: 0;
    padding: 0;
}

.results-panel-handle {
    position: absolute;
    width: 1.8rem;
    height: 1.8rem;
    left: -0.9rem;
    top: calc(50% - 0.9rem);
    background-color: #001938;
    border-radius: 0.9rem;
    border: 1px solid #001731;;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition:
        background-color 0.1s linear,
        width 0.1s linear,
        left 0.1s linear,
        transform 0.3s ease;
}

.results-panel-handle:hover {
    background-color: #011c41;
}

.results-panel.folded .results-panel-handle {
    transform: rotate(180deg);
    width: 2.2rem;
    left: -1.1rem;
    justify-content: end;
    padding-right: 0.3rem;
}

.results-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 0.5rem;
}

.layers-container {
    margin-bottom: 0.5rem;
}

.layers-title {
    color: #19F7E2;
}

.layers-commands {
    display: flex;
    flex-flow: row wrap;
    justify-content: space-evenly;
    margin-bottom: 0.2rem;
}

.layer-item {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
}

.layer-item-label {
    opacity: 0.7;
    cursor: pointer;
    padding: 0.1rem;
}

.layer-item-label:hover {
    opacity: 1;
    text-shadow: 0 0 0.3em #FFFFFFA0;
}

.layer-item-label.selected {
    opacity: 0.9;
    font-weight: 800;
    text-shadow: 0 0 0.3em #FFFFFF80;
}

.config-title-container,
.layers-title-container,
.stats-title-container,
.results-downloads-title-container {
    display: flex;
    flex-flow: row nowrap;
    align-items: center;
    margin-bottom: 0.4rem;
}

.config-title-container {
    margin-bottom: 0;
}

.config-title,
.layers-title,
.stats-title,
.results-downloads-title {
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    flex: 1;
    user-select: none;
    margin-bottom: 0;
}

.results-downloads-disclaimer {
    text-align: center;
    font-weight: 600;
    color: #f8ab04;
    margin-top: -0.2rem;
    margin-bottom: 0.2rem;
}

.stats-title-container {
    margin-top: 0.3rem;
}

.results-stats-disclaimer,
.stats-title,
.btn-download-stats {
    color: #ff5151;
}

.btn-download-stats:hover {
    color: #ff5151;
}

.results-panel.folded .stats-title {
    display: none;
}

.stats-loading-container {
    background-color: #00142b;
}

.stats-item {
    display: flex;
    flex-flow: row nowrap;
    justify-content: space-between;
    margin-bottom: 0.2rem;
}

.stats-item-label {
    opacity: 0.8;
}

.stats-item-value {
    font-weight: 500;
}

.results-downloads {
    display: flex;
    flex-flow: column nowrap;
    align-items: center;
    gap: 0.3em;
}

.results-download-buttons {
    display: flex;
    flex-flow: row wrap;
    gap: 0.4em;
    width: 100%;
}

.stats-title,
.stats,
.results-downloads {
    transition: opacity 0.1s linear;
}

.results-panel.folded .stats-title,
.results-panel.folded .stats,
.results-panel.folded .results-downloads {
    opacity: 0;
}

.results-downloads-title {
    color: #ab72ff;
    margin-bottom: 0.1rem;
}

.btn-download {
    font-size: 110%;
    font-weight: 500;
    flex: 1;
}

.btn-download-config,
.btn-download-stats {
    opacity: 0.6;
}