/* Общие стили карточки матча — используются на страницах Матчи и Группа турнира */

.match-card {
    display: grid;
    grid-template-columns: 50px minmax(80px, 1fr) minmax(min-content, auto) minmax(80px, 1fr) auto;
    grid-template-areas: "time winner score loser badges";
    align-items: center;
    gap: 0 1rem;
    padding: 0.75rem 0.5rem;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
    transition: background 0.2s;
    min-width: 0;
}
.match-card:hover {
    background: rgba(30, 58, 95, 0.2);
}
.match-card--clickable {
    cursor: pointer;
    position: relative;
}
.match-card--clickable .match-team-link,
.match-card--clickable .match-score-link {
    position: relative;
    z-index: 1;
}
.match-card .match-time {
    grid-area: time;
}
.match-card .match-badges-wrap {
    grid-area: badges;
}
.match-card .match-winner {
    grid-area: winner;
    text-align: right;
    min-width: 0;
}
.match-card .match-loser {
    grid-area: loser;
    text-align: left;
    min-width: 0;
}
.match-card .match-score-block {
    grid-area: score;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    min-width: 0;
}
.match-card .match-sets-points {
    text-align: center;
    font-size: 0.8rem;
    color: #94a3b8;
    margin-top: 0.25rem;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    align-self: stretch;
    width: 100%;
}
.match-card .match-sets-points:empty {
    display: none;
}
.match-card .match-sets-points .set-score {
    margin: 0 0.15rem;
    white-space: nowrap;
}
.match-card .match-sets-points .set-winner-pts {
    font-weight: 700;
    color: #22c55e;
}
.match-card .match-tech-defeat {
    text-align: center;
    max-width: 14rem;
    margin-top: 0.25rem;
}
.match-card .match-tech-defeat__label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #fbbf24;
}
.match-card .match-tech-defeat__reason {
    font-size: 0.72rem;
    color: #94a3b8;
    margin-top: 0.15rem;
    line-height: 1.35;
}
.match-card .match-team-name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #e2e8f0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.match-card .match-team-name--placeholder {
    font-weight: 500;
    font-size: 0.78rem;
    font-style: italic;
    color: #64748b;
}
.match-card .match-team-city {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.15rem;
}
.match-card .match-team-city:empty {
    display: none;
}

.match-time {
    font-size: 0.8rem;
    color: #64748b;
    text-align: center;
    font-weight: 500;
}
.match-score-block .match-sets-score {
    font-size: 0.875rem;
    font-weight: 700;
    color: #f87171;
    background: rgba(248, 113, 113, 0.15);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid rgba(248, 113, 113, 0.4);
    white-space: nowrap;
}
.match-score-link {
    color: inherit;
    text-decoration: none;
}
.match-score-link:hover {
    text-decoration: underline;
}
.match-badges-wrap {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.match-badges-wrap:empty {
    display: none;
}
.match-badges {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}
.match-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: rgba(148, 163, 184, 0.2);
    color: #94a3b8;
}
.match-badge--stats {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}
.match-badge--venue {
    background: rgba(100, 116, 139, 0.2);
}

@media (max-width: 640px) {
    .match-card {
        grid-template-columns: 36px minmax(60px, 1fr) minmax(min-content, auto) minmax(60px, 1fr) auto;
        gap: 0 0.35rem;
        padding: 0.75rem 0.25rem;
    }
    .match-card .match-time {
        padding: 0;
        font-size: 0.75rem;
    }
    .match-card .match-winner { text-align: center; }
    .match-card .match-loser { text-align: center; }
    .match-card .match-team-name {
        white-space: normal;
        word-break: break-word;
    }
}

@media (max-width: 383px) {
    .match-card {
        grid-template-columns: minmax(0, 1fr) minmax(min-content, auto) minmax(0, 1fr);
        grid-template-areas: "winner score loser";
        gap: 0 0.5rem;
        padding: 0.6rem 0.25rem;
    }
    .match-card .match-time,
    .match-card .match-badges-wrap {
        display: none;
    }
    .match-card .match-team-name {
        font-size: 0.85rem;
    }
    .match-card .match-team-name--placeholder {
        font-size: 0.72rem;
    }
    .match-card .match-team-city {
        font-size: 0.7rem;
        margin-top: 0.1rem;
    }
}
