.fftt-match-block {
    border-radius: 8px;
    padding: 0;
    margin: 16px 0;
    background: #fff;
}

.fftt-match-score {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 16px;
    margin-bottom: 12px;
}

.fftt-team {
    flex: 1 1 auto;
}

.fftt-team:last-child {
    text-align: right;
}

.fftt-score {
    font-size: 20px;
}

.fftt-parties-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fftt-parties-table th,
.fftt-parties-table td {
    border: 1px solid #d0d7de;
    padding: 8px;
}

.fftt-parties-table th {
    background: #f6f8fa;
    text-align: left;
}

.fftt-sets {
    display: inline-flex;
    flex-wrap: nowrap;
    gap: 4px;
}

.fftt-set-score {
    display: inline-block;
    min-width: 3ch;
    padding: 2px 4px;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace;
    font-variant-numeric: tabular-nums;
    background: #f6f8fa;
    border-radius: 4px;
}

.fftt-parties-table td:last-child {
    white-space: nowrap;
}

.fftt-parties-wrap {
    position: relative;
}

.fftt-parties-wrap.is-collapsed .fftt-partie-hidden {
    display: none;
}

.fftt-parties-fade {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 30px;
    height: 52px;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), #ffffff 80%);
}

.fftt-parties-wrap.is-collapsed .fftt-parties-fade {
    display: block;
}

.fftt-parties-toggle {
    position: relative;
    z-index: 2;
    margin-top: 6px;
    width: 100%;
    border: 0;
    padding: 10px 0;
    background: transparent;
    color: #000;
    font-size: 14px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
}

.fftt-parties-toggle:hover {
    color: #2f3845;
}

.fftt-parties-toggle:focus-visible {
    outline: 2px solid #9aa4b2;
    outline-offset: 2px;
}

.fftt-parties-toggle-arrow {
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-top: -3px;
}

.fftt-parties-wrap:not(.is-collapsed) .fftt-parties-toggle-arrow {
    transform: rotate(-135deg);
    margin-top: 3px;
}

@media (max-width: 640px) {
    .fftt-match-score {
        font-size: 13px;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
    }

    .fftt-team {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .fftt-team:last-child {
        text-align: right;
    }

    .fftt-score {
        font-size: 16px;
        flex: 0 0 auto;
        font-weight: 700;
    }

    .fftt-parties-table {
        border-collapse: separate;
        border-spacing: 0;
    }

    .fftt-parties-table thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    .fftt-parties-table,
    .fftt-parties-table tbody {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .fftt-parties-table tr {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 0;
        border: 1px solid #d0d7de;
        border-radius: 8px;
        background: #fff;
        margin-bottom: 8px;
        overflow: hidden;
    }

    .fftt-parties-table td {
        border: 0;
        border-right: 1px solid #edf0f2;
        padding: 7px 8px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        white-space: normal;
        box-sizing: border-box;
    }

    .fftt-parties-table td:nth-child(3) {
        border-right: 0;
    }

    .fftt-parties-table td:nth-child(4) {
        grid-column: 1 / -1;
        border-right: 0;
        border-top: 1px solid #edf0f2;
    }

    .fftt-parties-table td:nth-child(2) {
        background: #f8fafc;
        font-weight: 700;
        font-variant-numeric: tabular-nums;
        color: #111827;
    }

    .fftt-parties-table td .fftt-sets {
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .fftt-parties-fade {
        bottom: 34px;
    }

    .fftt-parties-toggle {
        font-size: 13px;
        padding: 6px 0;
    }
}

@media (max-width: 400px) {
    .fftt-match-score {
        font-size: 13px;
        gap: 4px;
    }

    .fftt-score {
        font-size: 16px;
    }

    .fftt-parties-table tr {
        border-radius: 6px;
    }

    .fftt-parties-table td {
        padding: 6px 7px;
        gap: 8px;
    }

    .fftt-parties-table td::before {
        font-size: 11px;
    }

    .fftt-set-score {
        min-width: 2.6ch;
        padding: 1px 3px;
        font-size: 12px;
    }

    .fftt-parties-toggle {
        font-size: 12px;
    }
}
