/*
 * Tournament Simulator - styles for wp-admin and public pages.
 * Colours use currentColor and transparency so they fit light and dark themes.
 */

/* Bracket */
.tsim-bracket {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    padding-bottom: 1em;
    margin: 1em 0;
}
.tsim-round {
    display: flex;
    flex-direction: column;
    min-width: 230px;
    flex: 0 0 auto;
}
.tsim-round-title {
    margin: 0 0 .5em;
    font-size: 14px;
    font-weight: 600;
}
.tsim-round-matches {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-around;
}
.tsim-match {
    border: 1px solid rgba(128, 128, 128, .45);
    border-radius: 4px;
    margin: 6px 0;
    font-size: 14px;
    line-height: 1.4;
}
.wp-admin .tsim-match {
    background: #fff;
}
.tsim-player {
    display: flex;
    gap: 6px;
    padding: 4px 8px;
}
.tsim-player + .tsim-player,
.tsim-meta {
    border-top: 1px solid rgba(128, 128, 128, .2);
}
.tsim-player.is-winner {
    font-weight: 600;
}
.tsim-player.is-loser,
.tsim-seed,
.tsim-meta,
.tsim-empty,
.tsim-muted {
    opacity: .7;
}
.tsim-seed {
    min-width: 18px;
    font-size: 12px;
}
.tsim-name {
    flex: 1;
}
.tsim-games {
    min-width: 22px;
    text-align: right;
}
.tsim-meta {
    font-size: 11px;
    padding: 2px 8px 4px;
}
.tsim-empty {
    font-style: italic;
}

/* Public pages */
.tsim-public table.tsim-table {
    width: 100%;
    border-collapse: collapse;
    margin: .5em 0 1.5em;
}
.tsim-public .tsim-table th,
.tsim-public .tsim-table td {
    text-align: left;
    padding: 6px 8px;
    border-bottom: 1px solid rgba(128, 128, 128, .3);
}
.tsim-public .tsim-table .tsim-number {
    text-align: right;
}
.tsim-public .tsim-search {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 0 0 1em;
}
.tsim-public .tsim-search input[type="search"] {
    flex: 1;
    min-width: 200px;
}
.tsim-public .tsim-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin: 1em 0 1.5em;
}
.tsim-public .tsim-stat {
    border: 1px solid rgba(128, 128, 128, .35);
    border-radius: 4px;
    padding: 10px 12px;
}
.tsim-public .tsim-stat-value {
    display: block;
    font-size: 1.5em;
    font-weight: 600;
}
.tsim-public .tsim-stat-label {
    font-size: .85em;
    opacity: .75;
}
.tsim-public .tsim-win {
    font-weight: 600;
}
.tsim-public .tsim-pagination {
    display: flex;
    justify-content: space-between;
}
.tsim-public .tsim-table-wrap {
    overflow-x: auto;
}

/* Scheduled tournaments */
.tsim-when {
    float: right;
    font-weight: 600;
}
.tsim-live-message {
    padding: 6px 10px;
    border-left: 4px solid currentColor;
    background: rgba(128, 128, 128, .12);
}
.tsim-rating {
    opacity: .7;
    font-weight: normal;
}

/* League */
.tsim-league-rounds {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px 24px;
    margin: 1em 0;
}
.tsim-league-table {
    max-width: 720px;
}
.tsim-league-table .tsim-final-spot td {
    font-weight: 600;
}
.tsim-final {
    max-width: 420px;
    margin-bottom: 1.5em;
}
.tsim-final .tsim-sets {
    min-width: 30px;
    font-weight: 600;
    border-left: 1px solid rgba(128, 128, 128, .3);
}
