:root {
    --bs-primary: #4285f4;
    --bs-primary-rgb: 66, 133, 244;

    --bs-dark: #041E48;
    --bs-dark-rgb: 4, 30, 72;
}

.navbar {
    --bs-navbar-padding-y: 0.75rem;
    --bs-navbar-brand-padding-y: 0;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

.alerts-wrapper {
    padding-block: 0.75rem;
}

.small-container {
    max-width: 480px;
}

.alerts-wrapper:not(:has(.alert:not(.d-none))) {
    display: none;
}

.navbar-ergometer-title,
.navbar-ergometer-serial {
    font-size: 0.875rem;
    line-height: 1rem;
    margin-bottom: 0;
}

.navbar-ergometer-serial {
    font-size: 0.75rem;
}

.navbar-participant-name {
    font-size: 1rem;
    line-height: 1.25rem;
}

.navbar-participant-secret {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.participants-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding-left: 0;
}

.participants-list li {
    background-color: #fff;
    border-radius: 6px;
    padding: 0.5rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.participants-list li>span {
    display: flex;
    align-items: center;
}

.participants-list li .icon {
    width: 1.25rem;
    height: 1.25rem;
}

.participants-list li.is-self {
    color: var(--bs-success-text-emphasis);
    background-color: var(--bs-success-bg-subtle);
}

.participants-list li ul {
    width: 100%;
    list-style-type: none;
    padding-inline-start: 0.5rem;
}

.participants-list li ul li {
    padding-block: 0.25rem;
}

.signal-icon .signal-bar {
    opacity: .5;
}

.signal-icon.has-bar-1 .signal-bar-1,
.signal-icon.has-bar-2 .signal-bar-2,
.signal-icon.has-bar-3 .signal-bar-3,
.signal-icon.has-bar-4 .signal-bar-4 {
    opacity: 1;
}

.lobby_connected:has(.tracker:not(.d-none)) .lobby-panel {
    padding: 0 !important;
}

.feature-webhid-required .wrap {
    animation: delay-reveal 1s linear forwards;
}

.modal-dialog.modal-webhid {
    --webhid-vertical-offset: 0px;

    position: absolute;
    top: 130px;
    left: 575px;
    max-width: min(calc(100% - 590px), 550px);
}

.img-webhid {
    width: 100%;
}

.img-webhid-arrow-1 {
    position: absolute;
    top: 75px;
    left: 578px;
}

.img-webhid-arrow-2 {
    position: absolute;
    top: 494px;
    left: 380px;
    transform: rotate(270deg) scaleX(-1);
}

.webhid-step {
    position: absolute;
    color: white;
    font-size: 1.5em;
    font-family: 'Architects Daughter', cursive;
    text-align: left;
    z-index: 1;
}

.webhid-step span {
    display: inline-block;
    width: 38px;
    height: 38px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
    text-align: center;
    background: var(--bs-primary);
    color: #fff;
    border-radius: 19px;
}

.webhid-step-1 {
    top: 68px;
    left: 636px;
}

.webhid-step-1 span {
    margin-right: 5px;
}

.webhid-step-2 {
    top: 528px;
    left: 220px;
}

.webhid-step-2 span {
    margin-left: 5px;
}

.edg .img-webhid-arrow-2 {
    top: 260px;
}

.edg .webhid-step-2 {
    top: 300px;
}

@media (min-width: 750px) {
    .edg .modal-dialog.modal-webhid {
        left: 615px;
    }

    .edg .img-webhid-arrow-1 {
        left: 615px;
    }

    .edg .webhid-step-1 {
        left: 672px;
    }

    .edg .img-webhid-arrow-2 {
        left: 360px;
    }

    .edg .webhid-step-2 {
        left: 200px;
    }

    .mac .img-webhid-arrow-2 {
        left: 460px;
    }

    .mac .webhid-step-2 {
        left: 300px;
    }
}

@media (max-width: 750px) {
    .modal-dialog.modal-webhid {
        display: none;
    }

    .img-webhid-arrow-1 {
        left: -20px;
        transform: scaleX(-1);
    }

    .webhid-step-1 {
        left: 10px;
        width: 90px;
    }

    .webhid-step-2 {
        left: 230px;
    }

    .img-webhid-arrow-2 {
        left: 335px;
        transform: rotate(90deg);
    }

    .edg .img-webhid-arrow-1 {
        left: 10px;
        transform: scaleX(-1);
    }

    .edg .webhid-step-1 {
        left: 40px;
        width: 90px;
    }

    .mac .img-webhid-arrow-2 {
        left: 420px;
    }

    .mac .webhid-step-2 {
        left: 310px;
    }

}

@media screen and (max-height: 540px) {

    /*
    When the height is very small, hide the lobby header when the tracker is visible
    */
    .lobby_connected:has(.tracker:not(.d-none)) .lobby-header {
        display: none;
    }
}

/*
Utility classes
*/

.icon {
    fill: currentcolor;
}

.spin {
    --webkit-animation: spin 1s infinite linear;
    animation: spin 1s infinite linear;
}

.min-h-0 {
    min-height: 0;
}

.justify-content-center {
    justify-content: center !important;
    justify-content: safe center !important;
}

/*
Keyframes
*/

@keyframes spin {
    0% {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }

    100% {
        -webkit-transform: rotate(359deg);
        transform: rotate(359deg);
    }
}

@keyframes delay-reveal {
    0% {
        opacity: 0;
    }

    79% {
        opacity: 0;
    }

    80% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    90% {
        transform: translate3d(0, 0, 0) scale(1.05);
    }

    100% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }
}
