.tournament-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 20px;
}
.tournament-list h2 {
    margin: 18px 0 8px;
    overflow-wrap: anywhere;
}
.tournament-empty {
    text-align: center;
    padding: 60px 24px;
}
.tournament-settings,
.tournament-entries {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}
.tournament-create {
    width: 100%;
    margin: auto;
}
.tournament-create .tournament-settings {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.draft-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 14px;
}
.draft-toolbar h2 {
    margin: 0;
    font-size: 21px;
    overflow-wrap: anywhere;
}
.draft-toolbar p {
    margin: 5px 0 0;
}
.draft-branch-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.draft-branch-actions .button {
    padding: 9px 12px;
    font-size: 12px;
}
.draft-match {
    overflow: visible;
}
.draft-player-row {
    display: flex;
    align-items: stretch;
    background: #f1f4ef;
    min-height: 40px;
}
.draft-player-row:first-child {
    border-radius: 8px 8px 0 0;
}
.draft-player-row:nth-child(2) {
    border-top: 1px solid white;
}
.draft-entry {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
    flex: 1;
}
.draft-entry label {
    font-size: 0;
    display: block;
}
.draft-entry input[data-opponent] {
    border: 0;
    border-radius: 0;
    background: transparent;
    padding: 10px;
    font-size: 12px;
    width: 100%;
    min-height: 40px;
    margin: 0;
}
.draft-entry input[data-opponent]:focus {
    background: white;
}
.draft-entry .doubles-player {
    border: 0;
    padding: 0;
    margin: 0;
    min-width: 0;
    border-top: 1px dashed #d7e2d5;
}
.draft-entry .doubles-player[hidden] {
    display: none;
}
.draft-entry .member-dropdown {
    border-radius: 0;
    margin: 0;
    max-height: 190px;
}
.draft-match-settings {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    font-size: 10px;
    border-top: 1px solid #e2e9df;
}
.draft-match-settings > span {
    flex: 1;
    color: #6c7e71;
}
.draft-match-settings button {
    border: 1px solid #d6e2d4;
    background: white;
    border-radius: 4px;
    width: 25px;
    height: 23px;
    color: var(--green);
    cursor: pointer;
}
.draft-match-settings button:disabled,
.draft-branch-actions button:disabled {
    opacity: 0.35;
    cursor: default;
}
.draft-save {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    border-top: 1px solid #dfe7dc;
    margin-top: 20px;
    padding-top: 20px;
}
.tournament-entry {
    border: 1px solid #d6e2d8;
    border-radius: 10px;
    padding: 18px;
    min-width: 0;
}
.tournament-entry legend {
    font-size: 12px;
    font-weight: 700;
    color: var(--green);
    padding: 0 8px;
}
.tournament-entry .doubles-player {
    border: 0;
    padding: 0;
    margin: 16px 0 0;
    min-width: 0;
}
.tournament-entry .doubles-player[hidden] {
    display: none;
}
.tournament-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 18px;
    margin: 0 0 24px;
    font-size: 13px;
}
.tournament-champion {
    color: #187542;
    padding: 9px 14px;
    background: #e8f6e8;
    border-radius: 8px;
}
.tournament-bracket {
    padding: 24px;
}
.bracket-scroll {
    overflow-x: auto;
    padding: 8px 0 16px;
}
.bracket-stage {
    position: relative;
    display: flex;
    gap: 48px;
    width: max-content;
    min-width: 100%;
}
.bracket-size-2 {
    min-height: 200px;
}
.bracket-size-4 {
    min-height: 270px;
}
.bracket-size-8 {
    min-height: 480px;
}
.bracket-size-16 {
    min-height: 920px;
}
.bracket-size-32 {
    min-height: 1800px;
}
.bracket-round {
    display: flex;
    flex-direction: column;
    width: 300px;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}
.bracket-round h2 {
    font-size: 11px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6e8276;
    margin: 0;
    height: 36px;
}
.bracket-round-matches {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 14px;
    flex: 1;
}
.bracket-match {
    border: 1px solid #d9e2d9;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}
.bracket-player {
    display: flex;
    align-items: stretch;
    min-height: 33px;
    background: #f1f4ef;
}
.bracket-player:nth-child(2) {
    border-top: 1px solid white;
}
.bracket-player-name {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 12px;
    text-align: left;
    color: #20372b;
    cursor: pointer;
}
.bracket-player-name small {
    font-size: 9px;
    color: #6e8276;
    min-width: 10px;
}
.bracket-player-name span {
    overflow-wrap: anywhere;
}
.bracket-player-name:focus-visible {
    outline: 2px solid #29874b;
    outline-offset: -2px;
}
.bracket-player-pending {
    padding: 8px 10px;
    flex: 1;
    font-size: 12px;
    color: #91a095;
}
.bracket-player.eliminated .bracket-player-name {
    color: #819087;
}
.bracket-scores {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 7px 9px;
    background: #e7ede5;
    font-size: 12px;
    font-weight: 700;
    min-width: 46px;
}
.set-won {
    color: #167638;
}
.set-lost {
    color: #c12929;
}
.inline-scores {
    gap: 2px;
    padding: 5px;
}
.inline-scores input {
    width: 22px;
    min-width: 0;
    height: 24px;
    min-height: 0;
    padding: 0;
    margin: 0;
    font: inherit;
    font-size: 12px;
    text-align: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    appearance: textfield;
}
.inline-scores input::-webkit-inner-spin-button,
.inline-scores input::-webkit-outer-spin-button {
    appearance: none;
    margin: 0;
}
.inline-scores input:hover,
.inline-scores input:focus {
    border-color: #a0bc91;
    background: white;
}
.inline-scores input.set-won {
    color: #167638;
}
.inline-scores input.set-lost {
    color: #c12929;
}
.inline-scores input[hidden],
[data-inline-wo][hidden],
.inline-result-winner[hidden] {
    display: none;
}
.inline-result-controls {
    display: flex;
    gap: 5px;
    align-items: center;
    padding: 5px 8px;
    border-top: 1px solid #dce5d9;
}
.inline-result-controls select {
    font-size: 10px;
    min-height: 25px;
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 3px 18px 3px 5px;
    border: 0;
    background-color: transparent;
    flex: 1;
}
.inline-result-controls button {
    background: transparent;
    border: 0;
    padding: 4px 0;
    color: var(--green);
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}
.inline-result-winner {
    padding: 7px 10px;
}
.inline-result-winner label {
    font-size: 10px;
}
.inline-result-winner select {
    font-size: 11px;
    min-height: 28px;
    padding: 4px;
    margin-top: 4px;
}
.inline-result-error {
    font-size: 10px;
    color: #ad2828;
    margin: 0;
    padding: 0 8px 5px;
}
.inline-result-error:empty {
    display: none;
}
.inline-name-cell {
    flex: 1;
    min-width: 0;
}
.inline-name-cell .bracket-player-name {
    width: 100%;
    min-height: 33px;
}
.inline-name-cell .bracket-player-name:hover {
    box-shadow: inset 0 0 0 1px #85ae72;
}
.inline-name-editor {
    padding: 2px;
}
.inline-name-editor input[type='text'] {
    margin: 0;
    width: 100%;
    padding: 5px 7px;
    min-height: 29px;
    font-size: 12px;
    border-radius: 0;
    border: 1px solid #79a668;
    background: white;
}
.inline-name-editor .member-dropdown {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    width: 100%;
    min-width: 0;
    border-radius: 0;
}
.inline-name-editor .member-option {
    font-size: 11px;
    padding: 7px;
}
.inline-name-editor .member-option small {
    font-size: 9px;
}
.inline-name-actions {
    padding: 5px 8px;
    border-top: 1px solid #dce5d9;
}
.inline-name-actions button {
    padding: 4px 5px;
    font-size: 10px;
    color: var(--green);
    border: 0;
    background: transparent;
    cursor: pointer;
}
.inline-name-editor[hidden],
.inline-name-actions[hidden],
.inline-name-cell button[hidden] {
    display: none;
}
.bracket-match-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 25px;
    padding: 4px 9px;
    border-top: 1px solid #e2e9df;
    font-size: 9px;
    color: #85948a;
}
.bracket-match-footer button {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--green);
    font-size: 10px;
    cursor: pointer;
}
.bracket-player.path-active {
    background: #d3f0be;
}
.bracket-player.path-active .bracket-player-name {
    color: #16472b;
    font-weight: 700;
}
.bracket-player.path-active .bracket-scores {
    background: #bde49f;
}
.bracket-connectors {
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: visible;
}
.bracket-connectors path {
    stroke: #a1afa3;
    stroke-width: 1.5;
    fill: none;
}
.bracket-connectors path.path-active {
    stroke: #399443;
    stroke-width: 3;
}
.bracket-round-tabs {
    display: none;
}
.tournament-result-dialog {
    width: min(740px, calc(100% - 24px));
    max-width: 740px;
}
.tournament-result-dialog h2 {
    font-size: 19px;
}
.tournament-result-dialog fieldset {
    border: 0;
    margin: 0;
    padding: 0;
    min-width: 0;
}
.tournament-result-dialog fieldset[hidden],
.result-sets [hidden] {
    display: none;
}
.result-sets {
    width: 100%;
}
.result-sets th {
    font-size: 11px;
    text-align: left;
}
.result-sets input {
    min-width: 48px;
    padding: 9px 5px;
    text-align: center;
    margin: 0;
}
@media (max-width: 700px) {
    .tournament-create .tournament-settings {
        grid-template-columns: 1fr;
    }
    .draft-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }
    .draft-branch-actions {
        gap: 8px;
    }
    .draft-branch-actions .button {
        padding: 8px 10px;
    }
    .tournament-settings,
    .tournament-entries {
        grid-template-columns: 1fr;
    }
    .tournament-summary {
        gap: 10px;
        font-size: 11px;
    }
    .tournament-bracket {
        padding: 14px;
    }
    .bracket-round-tabs {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-bottom: 18px;
    }
    .bracket-round-tabs button {
        border: 1px solid #d7e2d5;
        padding: 8px 10px;
        border-radius: 6px;
        color: var(--green);
        background: white;
        font-size: 11px;
    }
    .bracket-round-tabs button[aria-pressed='true'] {
        background: var(--green);
        color: white;
    }
    .bracket-stage {
        width: 100%;
        min-height: 0;
    }
    .bracket-round {
        display: none;
        width: 100%;
    }
    .bracket-round.mobile-round-active {
        display: flex;
    }
    .bracket-round-matches {
        gap: 16px;
    }
    .bracket-connectors {
        display: none;
    }
    .bracket-player-name {
        font-size: 13px;
    }
}
