/* --- Main Timeline Container --- */
.timeline-container {
    display: grid;
    grid-auto-columns: 210px;
    grid-auto-flow: column;
    grid-template-rows: auto auto;
    row-gap: 40px;
    padding: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; 
}

/* --- Container for each event card --- */
.timeline-event {
    width: 420px;
    grid-column: span 2;
    padding: 0 10px;
    box-sizing: border-box;
}

/* Make the whole card a cursor-pointer EXCEPT for the champion-link */
.timeline-event[data-champion-id="TBA"],
.timeline-event:not(:has(.champion-link:hover)) {
    cursor: pointer;
}

.timeline-event.odd { grid-row: 1; }
.timeline-event.even { grid-row: 2; }

/* --- The main content card for each event --- */
.timeline-content {
    padding: 20px;
    background-color: rgba(17, 24, 39, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    position: relative;
    border-radius: 8px;
    border: 1px solid rgba(59, 130, 246, 0.3);
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 260px;
    justify-content: space-between;
    overflow: hidden;
}

.timeline-event:hover .timeline-content {
    transform: scale(1.03);
    box-shadow: 0 8px 35px rgba(59, 130, 246, 0.2);
}

.timeline-main-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.timeline-text-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.timeline-avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid #3b82f6;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.timeline-content h3 {
    font-family: 'Russo One', sans-serif;
    font-size: 1.75rem;
    color: #e2e8f0;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.champion-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}
.champion-link:hover {
    color: #93c5fd;
    cursor: pointer;
}

.timeline-content .date-range {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.timeline-content .duration-tag {
    display: inline-block;
    background-color: rgba(59, 130, 246, 0.2);
    color: #bfdbfe;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 700;
    align-self: flex-start;
}

/* --- Styling for Community Average Section --- */
.roster-container {
    padding-top: 0.75rem;
    border-top: 1px solid rgba(59, 130, 246, 0.2);
    text-align: center;
}

.roster-container h4 {
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.roster-details-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.roster-detail {
    display: flex;
    flex-direction: column;
}

.roster-label {
    font-size: 0.7rem;
    color: #94a3b8;
    margin-bottom: 0.1rem;
}

.roster-value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #e2e8f0;
}

.roster-value.not-on-roster {
    color: #64748b;
    font-style: italic;
    font-size: 0.9rem;
    width: 100%;
}


@media screen and (max-width: 768px) {
    .timeline-container {
        display: block;
        overflow-x: hidden;
        padding: 0;
    }
    .timeline-event {
        width: 100%;
        padding: 0 1rem 1.5rem 1rem;
        grid-column: auto;
        grid-row: auto;
    }
    .timeline-content h3 { font-size: 1.5rem; }
}

.timeline-content::before {
    content: '+';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background-color: rgba(59, 130, 246, 0.8);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
    transition: all 0.3s ease;
    z-index: 2;
}

.timeline-event:hover .timeline-content::before {
    transform: scale(1.1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 1);
    background-color: #3b82f6;
}

.timeline-event[data-champion-id="TBA"] .timeline-content::before {
    display: none;
}

/* Modern Scrollbar Styling */
.timeline-container {
    scrollbar-width: thin;
    scrollbar-color: #3b82f6 rgba(17, 24, 39, 0.8);
}
.timeline-container::-webkit-scrollbar {
    height: 12px;
}
.timeline-container::-webkit-scrollbar-track {
    background: rgba(17, 24, 39, 0.8);
    border-radius: 10px;
}
.timeline-container::-webkit-scrollbar-thumb {
    background-color: #3b82f6;
    border-radius: 10px;
    border: 3px solid rgba(17, 24, 39, 0.8);
}
.timeline-container::-webkit-scrollbar-thumb:hover {
    background-color: #60a5fa;
}

/* --- NEW: Star Rating Visual Styles --- */
.roster-stars {
    font-size: 1.25rem;
    line-height: 1;
}

.star-icon {
    color: #4b5563; /* Color for an inactive/empty star */
    transition: color 0.2s ease-in-out;
}

/* Style for an active/filled star */
.star-icon.active {
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

/* Color definitions for each tier */
.tier-white .star-icon.active { color: #d1d5db; }
.tier-blue .star-icon.active { color: #3b82f6; }
.tier-purple .star-icon.active { color: #8b5cf6; }
.tier-gold .star-icon.active { color: #f59e0b; }
.tier-red .star-icon.active { color: #ef4444; }