﻿.rp-bracket {
    --rp-bg: #f5f6f8;
    --rp-card: #ffffff;
    --rp-border: #e1e4e9;
    --rp-text: #1c2733;
    --rp-muted: #8d96a3;
    --rp-blue: #0047ab;
    --rp-green: #00CC00;
    --rp-red: #CC0000;
    --rp-yellow: #f2c22e;
    --rp-gold: #ffd700;
    --rp-silver: #dcdcdc;
    --rp-bronze: #CD7F32;
    --rp-win-bg: #eef6ec;
    --rp-win-text: #1c8a3c;
    --rp-light: #eeeeee;
    --rp-dark: #222222;
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    background: var(--rp-bg);
    border-radius: 0.75rem;
    padding: 1rem;
    color: var(--rp-text);
}

    .rp-bracket .rp-title {
        background: var(--rp-muted);
        color: var(--rp-light);
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        text-align: center;
        border-radius: 0.5rem;
        padding: 0.6rem 1rem;
        margin-bottom: 1rem;
        font-size: clamp(0.85rem, 1.6vw, 1.15rem);
    }

.rp-title.M {
    background: var(--rp-blue);
    color: var(--rp-silver);
}

.rp-title.X {
    background: var(--rp-green);
    color: var(--rp-light);
}

.rp-title.F {
    background: var(--rp-red);
    color: var(--rp-light);
}


.rp-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.5rem;
}

.rp-track {
    display: flex;
    align-items: stretch;
    gap: 0;
    min-width: 900px;
}

.rp-round {
    flex: 1 1 0;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    padding: 0 0.6rem;
}

.rp-round-header {
    text-align: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rp-muted);
    padding: 0.4rem 0 0.75rem;
}

.rp-matches {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    gap: 0.75rem;
}

.rp-card {
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: 0.4rem;
    overflow: hidden;
    position: relative;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.rp-line {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.6rem;
    gap: 0.5rem;
    font-size: 0.85rem;
    text-align: left;
}

    .rp-line + .rp-line {
        border-top: 1px solid var(--rp-border);
    }

    .rp-line.win {
        background: var(--rp-win-bg);
        font-weight: 700;
    }

        .rp-line.win .rp-name {
            color: var(--rp-win-text);
        }

.rp-seed {
    color: var(--rp-muted);
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.1em;
    text-align: center;
    flex-shrink: 0;
}

.rp-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--rp-text);
    font-weight: 600;
}

    .rp-name.rp-pending {
        color: var(--rp-muted);
        font-style: italic;
        font-weight: 400;
    }

.rp-score {
    font-weight: 800;
    min-width: 1.4em;
    text-align: center;
    flex-shrink: 0;
    color: var(--rp-text);
}

.rp-line.win .rp-score {
    color: var(--rp-win-text);
}

.rp-connectors {
    flex-shrink: 0;
    width: 28px;
    position: relative;
}

.rp-conn-pair {
    flex: 1;
    position: relative;
}

    .rp-conn-pair::before,
    .rp-conn-pair::after {
        content: "";
        position: absolute;
        left: 0;
        width: 50%;
        border-color: var(--rp-border);
        border-style: solid;
        border-width: 0;
    }

    .rp-conn-pair::before {
        top: 0;
        height: 50%;
        border-right-width: 2px;
        border-bottom-width: 2px;
        border-bottom-right-radius: 8px;
    }

    .rp-conn-pair::after {
        bottom: 0;
        height: 50%;
        border-right-width: 2px;
        border-top-width: 2px;
        border-top-right-radius: 8px;
    }

.rp-conn-out {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

    .rp-conn-out::before {
        content: "";
        display: block;
        height: 2px;
        background: var(--rp-border);
        width: 100%;
    }

@media (max-width: 992px) {
    .rp-track {
        min-width: 0;
        flex-wrap: wrap;
    }

    .rp-round {
        flex: 1 1 100%;
        min-width: 0;
        padding: 0;
        margin-bottom: 1.25rem;
    }

    .rp-connectors {
        display: none;
    }

    .rp-matches {
        gap: 1rem;
    }
}

.rp-labeled-card {
    display: flex;
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: 0.4rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.rp-vlabel {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);
    background: #f0f2f5;
    border-right: 1px solid var(--rp-border);
    color: var(--rp-muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.rp-hlabel {
    background: #f0f2f5;
    border-right: 1px solid var(--rp-border);
    color: var(--rp-muted);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0.5rem 0.3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 1.5rem;
    flex-shrink: 0;
    white-space: nowrap;
}

.rp-labeled-body {
    flex: 1;
    min-width: 0;
}

.rp-ranking-wrap {
    margin-top: 1.25rem;
}

.rp-ranking-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--rp-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.25rem;
}

.rp-ranking {
    background: var(--rp-card);
    border: 1px solid var(--rp-border);
    border-radius: 0.4rem;
    overflow: hidden;
}

.rp-ranking-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
}

    .rp-ranking-row:not(:last-child) {
        border-bottom: 1px solid var(--rp-border);
    }

    .rp-ranking-row:nth-child(odd) {
        background: #fafbfc;
    }

.rp-pos {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--rp-blue);
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.rp-ranking-row:first-child .rp-pos {
    background: var(--rp-gold);
    color: #4a3a00;
}

.rp-ranking-row:nth-child(2) .rp-pos {
    background: var(--rp-silver);
    color: #4a3a00;
}

.rp-ranking-row:nth-child(3) .rp-pos {
    background: var(--rp-bronze);
    color: #4a3a00;
}

.rp-ranking-row .rp-team-final {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
