/* tournament_matches.css */

.page-grid {
    display: grid;
    grid-template-rows: auto auto auto;
    gap: 0.5rem;
    align-items: start;
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Initial 4-column layout */
    gap: 1.5rem;
}

.round-column {
   /* NO grid-column definition here.  Layout is handled by .matches-grid */

   /*  EXAMPLE STYLES for .round-column (These are NOT required for the grid) */
   /*  Add any styling that applies to ALL round columns, regardless of screen size. */
   padding: 10px; /* Example: Add some padding */
   border: 1px solid #eee; /* Example: Add a subtle border*/
}

.match-card {
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem; /* Add margin-bottom to match cards */

}

.match-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.match-link {
    display: block;
    padding: 1rem;
    color: #0056b3;
    text-decoration: none;
    font-weight: 600;
    flex-grow: 1;
}

.match-link:hover {
    text-decoration: underline;
    background-color: #f0f8ff;
}

.match-names {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 1rem;
}

.match-details {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.match-details p {
    margin: 0;
    font-size: 0.875rem;
}
.player-name{
  text-align: center;
}
.no-matches {
    grid-column: 1 / -1;
    padding: 1.5rem;
    color: #777;
    text-align: center;
    font-style: italic;
}

.back-link {
    display: block;
    margin-top: 0;
    padding: 0.75rem 1.25rem;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 0.375rem;
    transition: background-color 0.2s ease-in-out;
    text-align: center;
}

.back-link:hover {
    background-color: #0056b3;
}

.round-winner {
    text-align: center;
    margin-top: 10px;
    background-color: #4a90e2;
    color: white;
    padding: 2px 5px;
    font-weight: bold;
    display: inline-block;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .matches-grid {
        grid-template-columns: repeat(2, 1fr); /* Two columns on medium screens */
    }
     .round-column {
        grid-column: auto; /* Let the grid handle placement */
    }
}

@media (max-width: 768px) {
    .matches-grid {
        grid-template-columns: 1fr; /* Single column on small screens */
    }
    .round-column {
        grid-column: 1;  /* Force all rounds into the single column */
    }
}

@media (max-width: 600px) {
    /*  No specific changes needed here, 1 column is already set above */
      .back-link {
        width: 240px;
        margin-bottom: 1rem;
    }
}