/* ============================================================================
   SISTEMA SUIZO - ESTILOS OPTIMIZADOS Y COMPACTOS
   ============================================================================ */

/* Variables y Contenedor Principal */
.swiss-system-container {
    display: flex;
    justify-content: center;
    width: 100%;
    padding: 3rem;
}

.swiss-main-layout {
    display: flex;
    gap: 5rem;
    align-items: start;
}

.swiss-rounds-column {
    overflow: hidden;
}

.swiss-standings-column {
    display: flex;
}

/* ============================================================================
   ESTADO VACÍO
   ============================================================================ */
.swiss-empty-state {
    text-align: center;
    padding: 2rem 1rem;
    background: var(--panel);
    border-radius: var(--radius);
    border: 2px dashed var(--borders);
    margin: 1rem 0;
}

.swiss-empty-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
    filter: grayscale(50%);
}

.swiss-empty-text {
    font-size: 0.938rem;
    font-weight: 700;
    color: var(--txt);
    margin-bottom: 0.25rem;
}

.swiss-empty-description {
    font-size: 0.813rem;
    color: var(--muted);
    margin-top: 0.25rem;
}

/* ============================================================================
   RONDAS Y BLOQUES
   ============================================================================ */
.swiss-rounds-wrapper {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    width: 100%;
}

.swiss-round {
    width: 320px;
    flex-shrink: 0;
}

.swiss-round-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.875rem;
    padding-bottom: 0.625rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 1rem;
    border-bottom: 2px solid var(--hover);
    background: var(--panel);
    border-radius: 12px;
}

.swiss-round-title-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.swiss-round-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--txt);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.swiss-round-number {
    background: linear-gradient(135deg, var(--accent), #c70020);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.swiss-round-badge,
.swiss-block-badge {
    padding: 0.188rem 0.438rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.swiss-round-badge {
    background: var(--accent);
    color: white;
}

.swiss-block-badge {
    background: var(--hover);
    color: var(--txt);
    border: 1px solid var(--borders);
}

.swiss-round-meta,
.swiss-round-matches-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 600;
}

.swiss-blocks-container {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.swiss-block{
    background: var(--panel);
    border-radius: 12px;
    padding: 1rem;
}

.swiss-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
    background: var(--accent);
    padding: 0.5rem 0.8rem;
    border-radius: 6px;
}

.swiss-block-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 700;
}

.swiss-block-icon {
    font-size: 0.938rem;
    color: white;
}

/* ============================================================================
   GRID Y TARJETAS DE PARTIDOS
   ============================================================================ */
.swiss-matches-grid {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.swiss-match-card {
    background: var(--panel);
    border-radius: var(--radius);
    padding: 0.75rem;
    border: 2px solid var(--borders);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.4s ease-out backwards;
}

.swiss-match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.625rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--borders);
}

.swiss-match-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--muted);
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.swiss-match-series {
    padding: 0.188rem 0.375rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid var(--borders);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Series Colors */
.swiss-series-bo1,
.swiss-series-bo2,
.swiss-series-bo3,
.swiss-series-bo5 {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 700;
}


/* ============================================================================
   EQUIPOS
   ============================================================================ */
.swiss-teams-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.swiss-team {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem;
    background: var(--panel-2);
    border: 1px solid var(--borders);
}

.swiss-team-winner {
    border-left: 2px solid var(--accent);
}

.swiss-team-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.swiss-team-avatar {
    width: 30px;
    height: 30px;
    border-radius: calc(var(--radius) * 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.688rem;
    flex-shrink: 0;
    border: 2px solid transparent;
    overflow: hidden;
    position: relative;
}

/* Logos en avatares de partidos */
.swiss-team-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.swiss-team-initials {
    display: inline-block;
    position: relative;
    z-index: 1;
}

.swiss-avatar-blue {
    color: white;
}

.swiss-avatar-red {
    color: white;
}

.swiss-team-name {
    font-weight: 600;
    font-size: 0.813rem;
    color: var(--txt);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swiss-team-score {
    font-weight: 800;
    min-width: 32px;
    text-align: center;
    color: var(--txt);
    font-variant-numeric: tabular-nums;
}

.swiss-team-winner .swiss-team-score {
    color: var(--accent);
}

/* ============================================================================
   FOOTER Y ESTADOS
   ============================================================================ */
.swiss-match-footer {
    margin-top: 0.625rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--borders);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.swiss-match-status {
    display: flex;
    align-items: center;
    gap: 0.313rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border: 1px solid var(--borders);
}

.swiss-status-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.swiss-status-pendiente {
    background: rgba(100, 116, 139, 0.1);
    color: var(--muted);
}


.swiss-status-en-juego {
    background: rgba(100, 116, 139, 0.1);
    color: var(--muted);
    animation: statusPulse 2s ease-in-out infinite;
}

.swiss-status-finalizado {
    background: rgba(100, 116, 139, 0.1);
    color: var(--muted);
}

.swiss-match-date {
    font-size: 0.75rem;
    color: var(--muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.swiss-date-icon {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ============================================================================
   TABLA CLASIFICATORIA
   ============================================================================ */
.swiss-standings-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    background: var(--panel);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}

.swiss-standings-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--borders);
}

.swiss-standings-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--txt);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.swiss-standings-title i {
    color: var(--accent);
}

.swiss-standings-section {
    margin-bottom: 1rem;
}

.swiss-standings-section:last-child {
    margin-bottom: 0;
}

.swiss-standings-section-header {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.8rem 0;
    border-radius: 6px;
    margin-bottom: 0.5rem;
    color: var(--muted);
}

.swiss-standings-list {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.swiss-standings-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem;
    background: var(--panel-2);
    border: 1px solid var(--borders);
    transition: all 0.2s ease;
}

.swiss-standings-item:hover {
    background: var(--hover);
}

.swiss-item-qualified {
    border-left: 3px solid #10b981;
}

.swiss-item-eliminated {
    border-left: 3px solid var(--hover);
}

.swiss-standings-rank {
    font-size: 0.813rem;
    font-weight: 800;
    color: var(--muted);
    min-width: 20px;
    text-align: center;
}

.swiss-item-qualified .swiss-standings-rank {
    color: #10b981;
}

.swiss-standings-team-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}

.swiss-standings-avatar {
    width: 28px;
    height: 28px;
    border-radius: calc(var(--radius) * 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.688rem;
    flex-shrink: 0;
    color: white;
    overflow: hidden;
    position: relative;
}

.swiss-standings-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.swiss-standings-avatar span {
    position: relative;
    z-index: 1;
}

.swiss-standings-team-name {
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--txt);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.swiss-standings-record {
    display: flex;
    align-items: center;
    gap: 0.188rem;
    font-size: 0.688rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.swiss-record-wins {
    color: #10b981;
}

.swiss-record-losses {
    color: #ef4444;
}

.swiss-record-separator {
    color: var(--muted);
    opacity: 0.5;
}

.swiss-standings-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 1.25rem;
    color: var(--muted);
    font-size: 0.75rem;
    font-style: italic;
    text-align: center;
}

.swiss-standings-empty i {
    font-size: 1rem;
    opacity: 0.5;
}

/* ============================================================================
   ANIMACIONES
   ============================================================================ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes statusPulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(255, 165, 0, 0.4); }
    50% { opacity: 0.8; box-shadow: 0 0 0 3px rgba(255, 165, 0, 0); }
}

@keyframes indicatorPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.swiss-match-card:nth-child(1) { animation-delay: 0.05s; }
.swiss-match-card:nth-child(2) { animation-delay: 0.1s; }
.swiss-match-card:nth-child(3) { animation-delay: 0.15s; }
.swiss-match-card:nth-child(4) { animation-delay: 0.2s; }
.swiss-match-card:nth-child(5) { animation-delay: 0.25s; }
.swiss-match-card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================================================
   RESPONSIVE
   ============================================================================ */
@media (max-width: 1200px) {
    .swiss-main-layout {
        grid-template-columns: 1fr 280px;
    }
}

@media (max-width: 968px) {
    .swiss-main-layout {
        grid-template-columns: 1fr;
    }

    .swiss-standings-column {
        position: static;
        max-height: none;
        order: -1;
        margin-bottom: 1rem;
    }

    .swiss-rounds-wrapper {
        flex-direction: column;
    }
    
    .swiss-round {
        min-width: auto;
    }
}

@media (max-width: 768px) {
    .swiss-round {
        padding: 0.75rem;
    }

    .swiss-round-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .swiss-system-container {
        font-size: 13px;
    }

    .swiss-team-avatar {
        width: 28px;
        height: 28px;
        font-size: 0.625rem;
    }

    .swiss-match-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.375rem;
    }
}