.bubble {
    transition: background-color 0.125s, border-color 0.125s, filter 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    background: var(--background-2);
    border-radius: 0.75rem;
    border-width: 0px;
}

.simple-bubble{
    background: var(--background-2);
    border-radius: 0.75rem;
}

.with-backdrop{
    backdrop-filter: blur(15px);
}

button.with-backdrop, input.with-backdrop{
    backdrop-filter: blur(6px);
}

.diminished-background {
    background: var(--background-4);
    border-color: var(--background-2);
}

button.with-backdrop:disabled, input.with-backdrop:disabled{
    opacity: 1;
    background: rgb(180 180 180 / 45%);
}

button.with-backdrop:disabled > *{
    transition: opacity 0.5s;
    opacity: 0.5;
}


.no-pointer-events {
    pointer-events: none;
}

.black-bubble {
    background: #000000a1;
    border-radius: 1rem;
    backdrop-filter: blur(6px);
}

.black-bubble > span, .black-bubble > code, .black-bubble > h1, .black-bubble > h2, .black-bubble > h3 {
    color: white;
    text-shadow: none;
    font-weight: bold;
    filter: none;
}

.black-bubble > svg {
    fill: white;
}

.shiny-border {
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.bubble > span, .bubble > code, .bubble > h1, .bubble > h2, .bubble > h3 {
    color: var(--foreground);
    text-shadow: none;
    border-radius: 0.5rem;
}

.icon {
    display: inline-block;
    height: 1.5rem;
    aspect-ratio: 1;
    background-size: 1.5rem;
    background-repeat: no-repeat;
    background-position: center;
}

.icon.small {
    height: 1rem;
}

.icon.smallish {
    height: 1.25rem;
}

.icon.large, svg.large {
    height: calc(2rem + 4px); /* two lines of text + line-gap */
}

@media (max-width: 768px) {
    .icon.large, svg.large {
        height: 2rem;
    }
}


.hidden-button, .hidden-icon-button {
    background: transparent;
    border-color: transparent;
}

.hidden-icon-button {
    aspect-ratio: 1;
    padding: 0.25rem;
}

.icon-button {
    aspect-ratio: 1;
    padding: 0.25rem;
}

.tile-button {
    padding: 1rem;
    align-items: center;
    flex-direction: column;
    text-shadow: none;
}

.tile-button > span {
    text-shadow: none;
    color: red !important;
}

.mini-button {
    padding: 0.125rem;
    align-items: center;
    flex-direction: column;
    min-height: unset;
}

.with-shadow {
    color: white;
    fill: white;
    filter: drop-shadow(2px 2px 2px black) drop-shadow(0px 0 2px black);
}

.clickable {
    cursor: pointer;
}

.clickable:hover {
    filter: brightness(1.25);
}

.as-annotation, .as-annotation-bottom {
    justify-self: end;
    z-index: 1;
    margin-right: -0.75rem;
}


.as-annotation {
    align-self: start;
    margin-top: -0.75rem;
}

.as-annotation-bottom {
    align-self: end;
    margin-bottom: -0.75rem;
}

.icon.as-annotation.smallish {
    margin-right: -0.625rem;
    margin-top: -0.625rem;
}

.icon.as-annotation-bottom.smallish {
    margin-right: -0.625rem;
    margin-bottom: -0.625rem;
}

.flex-col-line-height-gap {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 4px;
}

.flex-col-two-pixel-gap {
    display: flex;
    flex-direction: column;
    align-items: center;
    row-gap: 2px;
}

.one-block-height {
    min-height: calc(2rem + 4px); /* two lines of text + line-gap */
}

.one-and-a-half-block-height {
    min-height: calc(3rem + 8px); /* two lines of text + line-gap */
}

@media (max-width: 768px) {
    .one-and-a-half-block-height {
        min-height: calc(3rem + 4px); /* two lines of text + line-gap */
    }
}

@media (max-width: 420px) {
    .one-and-a-half-block-height {
        min-height: calc(2rem + 2px); /* two lines of text + line-gap */
    }
}

.two-block-height {
    min-height: calc(4rem + 4px); /* height of 2 buttons, input, etc with gaps */
}

.three-block-height {
    min-height: 7.75rem; /* height of 3 buttons, input, etc with gaps */
}

.hidden {
    visibility: hidden;
}

.opacity-zero {
    opacity: 0;
}

.active {
    background: var(--background-4);
}

.accent-border {
    border-color: var(--accent);
}

.accent-border:hover {
    border-color: var(--accent);
}

.active-selection-highlight {
    background-color: var(--foreground);
    border-color: var(--foreground);
    color: var(--background-1);
    fill: var(--background-1);
    font-weight: bold;
}

.active-selection-highlight > span {
    color: var(--background-1);
}

.active-selection-highlight:hover {
    background-color: var(--foreground);
    border-color: var(--foreground);
    filter: brightness(1.25);
}

.warning {
    color: var(--yellow);
}

.error {
    color: var(--red);
}

.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1;
}


/*animation*/

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


.fade-in-scale {
    animation: fadeInScale 0.4s both;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

.fade-out-scale {
    animation: fadeOutScale 0.4s both;
    animation-timing-function: cubic-bezier(0.25, 1, 0.5, 1);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.95);
        clip-path: inset(20% 2% 20% 2% round 0.25rem);
    }

    to {
        opacity: 1;
        transform: scale(1);
        clip-path: inset(0% 0% 0% 0% round 0.25rem);
    }
}

@keyframes fadeOutScale {
    0% {
        opacity: 1;
        clip-path: inset(0% 0% 0% 0% round 0.25rem);
    }

    100% {
        opacity: 0;
        clip-path: inset(4rem 4rem 4rem 4rem round 0.5rem);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }

    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.5s;
}

.fade-out {
    animation: fadeOut 0.5s;
}

.fade-in-from-left {
    animation: fadeInFromLeft 0.5s both;
}

.fade-in-from-right {
    animation: fadeInFromRight 0.5s both;
}

@keyframes fadeInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }

    to {
        opacity: 1;
        transform: translateX(0%);
    }
}

@keyframes fadeInFromRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0%);
    }
}

.fade-in-slow {
    animation: fadeIn 1.3s both;
}

.large-input > button:first-child, .large-input > button:last-child{
    min-width: 2rem;
}

.enclosed-bubble {
    gap: 0;
    align-items: stretch;
}

.enclosed-bubble > input, .enclosed-bubble > button {
    border-radius: 0;
}

.enclosed-bubble > input:first-child, .enclosed-bubble > button:first-child {
    border-top-left-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
}

.enclosed-bubble > input:first-child, .enclosed-bubble > button:last-child {
    border-top-right-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

@media (min-width: 769px) {
    .enclosed-responsive-bubble > input, .enclosed-responsive-bubble > button {
        border-radius: 0;
    }

    .enclosed-responsive-bubble > input:first-child, .enclosed-responsive-bubble > button:first-child {
        border-top-left-radius: 0.5rem;
        border-bottom-left-radius: 0.5rem;
    }

    .enclosed-responsive-bubble > input:first-child, .enclosed-responsive-bubble > button:last-child {
        border-top-right-radius: 0.5rem;
        border-bottom-right-radius: 0.5rem;
    }
}
@media (max-width: 768px) {
    .enclosed-responsive-bubble{
        gap: 0.5rem;
    }
    .enclosed-responsive-bubble > input, .enclosed-responsive-bubble > button {
        border-radius: 0.5rem;
    }
}

.enclosed-vertical-bubble > * {
    border-radius: 0;
}

.enclosed-vertical-bubble > *:first-child {
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
}

.enclosed-vertical-bubble > *:last-child {
    border-bottom-left-radius: 1rem;
    border-bottom-right-radius: 1rem;
}