#league_page {
    width: 100%;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
}

#league_content {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: start;
}

#league_page h1 {
    font-size: 2.5rem;
    font-weight: bold;
    color: #5a5a5a;
    margin: 20px 0;
}

/* Styles for the user table */
#league_table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.league_table_row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 15px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.3s;
}

.league_table_row:hover {
    background: #f9f9f9;
}

.league_table_row.me {
    background: rgba(255, 255, 24, 0.2);
    border-left: 4px solid rgba(255, 255, 24, 0.7);
}

.league_table_user {
    width: 70%;
    display: flex;
    align-items: center;
}

.league_table_user img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 10px;
    border: 2px solid #ddd;
}

.league_table_points {
    width: 20%;
    font-weight: bold;
    color: #d9534f; /* bleeding points color, can be adjusted */
}

/* Styles for ordinal numbers in the user table */
.league_table_ordinal {
    width: 10%;
    text-align: center;
    font-weight: bold;
    margin-right: 10px;
}

/* Styles for scheduled matches */
#league_vs_section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 30px 0;
}

.league_vs_row {
    flex: 1 1 calc(50% - 20px);
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}

.league_vs_row:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

.league_vs_user {
    display: flex;
    align-items: center;
    flex-direction: column;
}

.league_vs_user.me {
    background: rgba(255, 255, 24, 0.3);
    border-radius: 50%;
    padding: 5px;
}

.league_vs_user img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 2px solid #ccc;
}

.league_vs_vs {
    font-size: 2rem;
    font-weight: bold;
    color: #5a5a5a;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
    position: relative;
}

/* Epic VS hover animation */
.league_vs_row:hover .league_vs_vs {
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); color: #5a5a5a; }
    50% { transform: scale(1.2); color: #d9534f; }
    100% { transform: scale(1); color: #5a5a5a; }
}

#league_history_section {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 30px 0;
    width: 60%;
    align-items: center;
    justify-content: start;
}

.league_history_item {
    width: 100%;
    background-color: rgba(24, 255, 197, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: 10px;
}

.league_history_item .player_panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 40%;
    height: 100%;
    background-color: rgba(5, 133, 101, 0.1);
    border-radius: 10px;
}
.league_history_item .player_panel img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    display: block;
}

.league_history_item .player_panel p {
    font-size: 1.5rem;
    font-weight: bold;
    width: 100%;
    height: 10%;
    text-align: center;
    margin: 10px 0;
}

.league_history_item .player_panel.winner {
    background-color: rgba(24, 255, 197, 0.3);
    animation: winnerPulse 2s infinite, winnerGlow 3s infinite;
}

@keyframes winnerPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes winnerGlow {
    0% {
        box-shadow: 0 0 5px rgba(24, 255, 197, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(24, 255, 197, 1);
    }
    100% {
        box-shadow: 0 0 5px rgba(24, 255, 197, 0.5);
    }
}

.league_history_item .player_panel.looser {
    background-color: rgba(255, 24, 24, 0.2);
    opacity: 0.7;
}

.inbetween_panel {
    width: 20%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.inbetween_panel div {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.inbetween_panel .VS {
    font-size: 2.5rem;
    font-weight: bold;
    color: #5a5a5a;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}
