.leagues-layout {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
}

.league-card {
    flex: 1;
    background: #161b22;
    padding: 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border);
}

.league-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
}

.private-actions {
    margin-top: 1.5rem;
}

.empty-state {
    opacity: 0.7;
    font-size: 0.9rem;
}

@media (max-width: 800px) {
    .leagues-layout {
        flex-direction: column;
    }
}

#group-code {
    width: 100%;
    max-width: 14rem;

    background: #ffffff;                 /* bright white so it stands out */
    color: #000000;

    border: 2px solid rgba(255,255,255,0.35);  /* visible on dark background */
    border-radius: 0.5rem;

    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;

    box-sizing: border-box;
    margin-top: 1rem;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#group-code:focus {
    border-color: var(--accent-hover);   /* blue focus ring */
    outline: none;
    box-shadow: 0 0 0 3px rgba(88,166,255,0.25);
}

.league-description {
    margin: 1.5rem auto 2rem;
    max-width: 700px;

    background: #161b22;                 /* same as .container */
    border: 1px solid var(--border);
    border-radius: 0.75rem;

    padding: 1.25rem 1.5rem;
    text-align: left;

    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

#scroll-dynamic-text {
    color: var(--text);
    font-size: 0.95rem;
    line-height: 1.45;
}

.username-highlight {
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.league-description {
    position: relative;
}

.league-description::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: var(--accent);
    border-radius: 0.75rem 0.75rem 0 0;
}
/* Main panel wrapper */
.league-main-panel {
    background: #161b22;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.75rem;
    margin: 2rem auto;
    max-width: 900px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Panel title */
.league-main-panel > h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    font-size: 1.4rem;
    color: var(--text-strong);
}

/* Subsections (Public / Your Leagues) */
.league-subsection {
    margin-bottom: 1.75rem;
}

.league-subsection h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    color: var(--text);
}

/* Dropdowns */
.league-subsection select {
    width: 100%;
    max-width: 20rem;
    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;

    background: #ffffff;
    color: #000000;

    border: 1px solid rgba(255,255,255,0.35);
    border-radius: 0.5rem;

    box-sizing: border-box;
}

/* Shared Join/Leave button */
#group-action-form {
    margin-top: 1rem;
}

#group-button {
    margin-top: 0.5rem;
    width: 100%;
    max-width: 12rem;
}

.private-league-panel {
    background: #161b22;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.75rem;
    margin: 2rem auto;
    max-width: 900px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

/* Title */
.private-league-panel > h2 {
    margin-top: 0;
    margin-bottom: 1.25rem;
    font-size: 1.4rem;
    color: var(--text-strong);
}

/* Invite code field */
#group-code {
    width: 100%;
    max-width: 16rem;

    background: #ffffff;
    color: #000000;

    border: 2px solid rgba(255,255,255,0.35);
    border-radius: 0.5rem;

    padding: 0.55rem 0.75rem;
    font-size: 0.95rem;

    box-sizing: border-box;
    margin-bottom: 1rem;

    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

#group-code:focus {
    border-color: var(--accent-hover);
    outline: none;
    box-shadow: 0 0 0 3px rgba(88,166,255,0.25);
}

/* Join Private League button */
#private-join-button {
    width: 100%;
    max-width: 12rem;
    margin-bottom: 1.25rem;
}

/* Create League button wrapper */
.private-league-panel .button-wrapper {
    margin-top: 1rem;
}

.league-main-panel,
.private-league-panel {
    position: relative;
}

.league-main-panel::before,
.private-league-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 4px;
    width: 100%;
    background: var(--accent);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Shared horizontal control layout */
.league-controls-row {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap; /* allows clean stacking on mobile */
}

/* Make controls consistent width */
.league-controls-row select,
.league-controls-row input[type="text"] {
    flex: 1;
    min-width: 12rem;
}

/* Buttons in the row */
.league-controls-row .btn {
    flex-shrink: 0;
}
.labels-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.labels-row h3 {
    margin: 0;
    font-size: 1rem;
    color: var(--text);
}

/* Make both dropdowns the same width behavior */
.league-controls-row select {
    flex: 1;
    max-width: 16rem;   /* keeps them tidy and equal */
    min-width: 12rem;
}

.league-card {
    max-width: 600px;      /* shrink the panel */
    margin: 2rem auto;     /* center it horizontally */
    padding: 1.75rem;
}

/* Wrap both panels in a flex container */
.league-panels-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2rem; /* controls horizontal spacing between panels */
    margin-top: 1.5rem;
}

/* Each panel gets a fixed width */
.league-card {
    flex: 0 0 520px;
    max-width: 520px;
    margin: 0; /* remove vertical stacking gap */
}

.league-card {
    float: none;
    margin-left: 0;
    margin-right: 0;
}

.league-panels-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 2rem;
    width: 100%;
}

#group-code {
    height: 2.1rem;
    line-height: 2.1rem;
    padding: 0 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.labels-row {
    display: flex;
    justify-content: flex-start;
    gap: 7rem; /* adjust spacing between the two labels */
}

.labels-row h3 {
    text-align: left;
}
