.Lindex-title {
    text-align: center;
}

.leagues-container {
    display: grid;
    gap: 1rem;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.league {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    border-bottom: 2px solid rgb(126, 124, 124);
    padding: 20px;
    align-items: center;
}

.league-header{
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    padding: 20px;
    color: #555;
    border-top: 2px solid rgb(170, 110, 110);
}

.league-name,
.league-points,
.league-members {
    text-align: center;
}

.league-name>a {
    color: rgb(162, 166, 198);
    font-weight: bold;
    text-decoration: none;
}

.league-name>a:hover {
    color: rgb(155, 164, 232);
}

.league:hover {
    background-color: antiquewhite;
}

/* show page */

.code {
    background-color: white;
    display: flex;
    justify-content: center;
    padding: 10px;
    gap: 10px;
    font-weight: bold;
}

.code-box {
    border: 2px solid rgb(179, 179, 243);
    border-radius: 5px;
}

.standings {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: center;
}

.standings .league-membership {
    width: 100%;
    max-width: 400px;
    text-align: left;
}

.member-name {
    font-weight: bold;
}

/* new*/

.new-form {
    display: flex;
    justify-content: center;
    align-items: center;
}

.name-input {
    background-color: #ffffff;
    border-color: #cccccc;
    color: #333333;
}

.create-league {
    background-color: rgb(184, 94, 94);
    color: #fff;
    font-weight: 200;
}

.create-league:hover {
    cursor: pointer;
    background-color: var(--primary);
}

/*forms*/
/* old form styles
.league-form-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.new-form {
    width: 100%;
    max-width: 600px;

    margin-bottom: 20px;

}

.new-form form {
    display: flex;
    align-items: center;
}

.new-form form label {
    width: 150px;

}

.new-form form .name-input {
    flex: 1;

    margin: 0 10px;

}

.new-form form .create-league {
    width: 150px;

}
*/ 
/* NEW DROPDOWN */

.league-actions {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

/* the toggle button itself */
.league-dropdown {
    position: relative;
}

.league-dropdown-toggle {
    display: inline-block;
    padding: 10px 10px;
    background-color: rgb(184, 94, 94);
    color: #fff;
    font-weight: bold;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
    list-style: none; 
}

.league-dropdown-toggle::-webkit-details-marker {
    display: none;
}

.league-dropdown-toggle:hover {
    background-color: var(--primary);
}

/* the panel that drops down when opened */
.league-dropdown-panel {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 340px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    padding: 16px;
    z-index: 10;
}

/* hide the actual radio inputs */
.league-tab-input {
    display: none;
}

/* tab labels row */
.league-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 16px;
}

.league-tab-label {
    flex: 1;
    text-align: center;
    padding: 8px 0;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.league-tab-label:hover {
    color: #666;
}

/* hide both panels by default, show the one matching the checked radio */
.league-tab-panel {
    display: none;
}

#tab-create:checked ~ .league-tabs label[for="tab-create"],
#tab-join:checked ~ .league-tabs label[for="tab-join"] {
    color: rgb(184, 94, 94);
    border-bottom-color: rgb(184, 94, 94);
}

#tab-create:checked ~ .league-tab-panel--create,
#tab-join:checked ~ .league-tab-panel--join {
    display: block;
}

/* forms inside the panel go vertical instead of the old horizontal row */
.league-tab-panel form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.league-tab-panel form label {
    font-weight: bold;
    width: auto;
}

.league-tab-panel .name-input {
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 8px;
    border-radius: 4px;
}

.league-tab-panel .create-league {
    width: 100%;
    padding: 8px 0;
    border-radius: 4px;
    border: none;
}

@media only screen and (max-width: 450px) {
    .league-dropdown-panel {
        width: 90vw;
        left: 50%;
    }
}

@media only screen and (max-width: 450px) {
    .new-form form label {
        width: 75px;

    }

    .new-form form .create-league {
        width: 100px;

    }

    .new-form form .name-input {
        width: 75px;

    }
}