.lobby-page,
.setup-page {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    padding: 1.625rem 1.375rem 2rem;
}

.page-brand {
    margin: 0 0 .5rem;
    color: #66717c;
    font-size: .875rem;
}

.lobby-page h1,
.setup-page h1 {
    margin: 0;
    font-size: 1.625rem;
    font-weight: 500;
    letter-spacing: -.025rem;
    overflow-wrap: anywhere;
}

.lobby-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .625rem;
    margin-bottom: 1.75rem;
}

.lobby-page .btn,
.setup-page .btn,
.direct-join-form .form-control,
.setup-page .form-control {
    min-height: 3rem;
    font-size: 1rem;
    border-radius: .4375rem;
}

.lobby-heading .btn {
    display: inline-flex;
    align-items: center;
    padding: .625rem .8125rem;
    white-space: nowrap;
}

.lobby-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .625rem;
    margin-bottom: .75rem;
}

.lobby-section-heading h2 {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}

.game-count,
.lobby-empty {
    color: #66717c;
    font-size: .875rem;
}

.lobby-games {
    display: grid;
    gap: .75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lobby-game {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    width: 100%;
    min-height: 4.875rem;
    padding: .875rem 1rem;
    text-align: left;
}

.lobby-game > span {
    min-width: 0;
}

.lobby-game-name {
    display: block;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.lobby-game-id {
    display: block;
    margin-top: .25rem;
    font-size: .8125rem;
    letter-spacing: .02rem;
    opacity: .9;
}

.lobby-game > .bi {
    flex-shrink: 0;
    font-size: 1.1875rem;
}

.lobby-empty {
    padding: 1rem 0;
}

.lobby-direct-join {
    margin-top: 1.625rem;
    padding-top: 1.125rem;
    border-top: 1px solid #e0e5e9;
}

.lobby-direct-join summary {
    display: flex;
    align-items: center;
    gap: .5rem;
    min-height: 2.75rem;
    color: #0d6efd;
    font-size: .875rem;
    cursor: pointer;
    list-style: none;
}

.lobby-direct-join summary::-webkit-details-marker {
    display: none;
}

.lobby-direct-join summary::before {
    content: "+";
    font-size: 1.125rem;
}

.lobby-direct-join[open] summary::before {
    content: "−";
}

.direct-join-form {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .625rem;
}

.direct-join-form .form-control {
    min-width: 0;
}

.setup-back {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    min-height: 2.75rem;
    margin: -.625rem 0 1rem;
    font-size: .875rem;
    text-decoration: none;
}

.setup-context {
    margin: .5rem 0 1.625rem;
    color: #66717c;
    font-size: .875rem;
}

.setup-page .form-label {
    font-size: .875rem;
    font-weight: 500;
}

.setup-name {
    margin-bottom: 1.5rem;
}

.setup-submit {
    width: 100%;
    margin-top: 1.625rem;
}

.setup-footnote {
    margin: .75rem 0 0;
    color: #66717c;
    font-size: .8125rem;
    text-align: center;
}

.deck-color-picker {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    container-type: inline-size;
}

.deck-color-legend {
    display: flex;
    float: none;
    align-items: baseline;
    justify-content: space-between;
    gap: .625rem;
    width: 100%;
    margin: 0 0 .75rem;
    padding: 0;
    font-size: .875rem;
    font-weight: 500;
}

.deck-color-selection {
    color: #66717c;
    font-weight: 400;
}

.deck-color-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .5rem;
}

.deck-color-choice {
    position: relative;
    min-width: 0;
}

.deck-color-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.deck-color-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .4375rem;
    width: 100%;
    min-height: 4.6875rem;
    padding: .5625rem .125rem;
    border: 1px solid #e0e5e9;
    border-radius: .5rem;
    background: #fff;
    cursor: pointer;
}

.deck-color-input:checked + .deck-color-tile {
    border-color: #0d6efd;
    background: #edf4ff;
    box-shadow: inset 0 0 0 1px #0d6efd;
}

.deck-color-input:focus-visible + .deck-color-tile {
    outline: 2px solid #0d6efd;
    outline-offset: 3px;
}

.deck-color-swatch {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.875rem;
    height: 1.875rem;
    border-radius: 50%;
    background: var(--deck-color);
    color: #fff;
}

.deck-color-dark-ink {
    color: #212529;
}

.deck-color-swatch .bi {
    font-size: 1.125rem;
    visibility: hidden;
}

.deck-color-input:checked + .deck-color-tile .bi {
    visibility: visible;
}

.deck-color-name {
    color: #212529;
    font-size: .8125rem;
    line-height: 1.2;
    text-align: center;
}

.deck-color-picker:disabled .deck-color-tile {
    opacity: .6;
    cursor: default;
}

@container (max-width: 18rem) {
    .deck-color-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 430px) {
    .lobby-page,
    .setup-page {
        padding: 1.375rem 1.125rem 1.625rem;
    }
}

@media (max-width: 359.98px) {
    .deck-color-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
