.team-timeline {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0 -2rem;
    padding: 1rem 0.5rem 0.5rem;
    gap: 0.5rem;
}

.team-timeline__viewport {
    flex: 1 1 auto;
    overflow: hidden;
    padding: 0 0.25rem;
}

.team-timeline__chevron {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 50%;
    border: none;
    background: rgba(var(--app-white-rgb), 0.08);
    color: var(--app-ink);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease-out, opacity 0.15s ease-out;
}

.team-timeline__chevron:hover:not(:disabled) {
    background: rgba(var(--app-white-rgb), 0.18);
}

.team-timeline__chevron:disabled {
    opacity: 0.25;
    cursor: not-allowed;
}

.team-timeline__track {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: max-content;
    padding-top: 1rem;
    transition: transform 0.25s ease-out;
    will-change: transform;
}

/* Set for one frame when older games are prepended, so the track can jump to
   where the visible games now sit before it slides on. */
.team-timeline__track--instant {
    transition: none;
}

.team-timeline__track::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 3px;
    background: var(--app-surface-muted);
    z-index: 0;
}

.team-timeline__item {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    min-width: 78px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    border-bottom: none;
}

.team-timeline__item--future {
    opacity: 0.5;
}

.team-timeline__item--cup .team-timeline__emblem-wrapper::after {
    content: "\f091"; /* fa-trophy */
    font-family: FontAwesome, sans-serif;
    position: absolute;
    bottom: -4px;
    right: -4px;
    font-size: 10px;
    color: var(--app-cup-gold);
    background: rgba(var(--app-black-rgb), 0.75);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-timeline__emblem-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.team-timeline__emblem-wrapper svg,
.team-timeline__emblem-wrapper img {
    width: 100%;
    height: 100%;
}

.team-timeline__badge {
    font-size: 14px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    color: var(--app-ink-on-accent);
}

.team-timeline__badge--clickable {
    cursor: pointer;
}

.team-timeline__badge--clickable:hover {
    filter: brightness(1.25);
}

.team-timeline__badge--win {
    background: var(--bs-success);
}

.team-timeline__badge--loss {
    background: var(--bs-danger);
}

.team-timeline__badge--draw {
    background: var(--bs-secondary);
}

.team-timeline__badge--upcoming {
    background: transparent;
    border: 1px dashed rgba(var(--app-white-rgb), 0.4);
    color: rgba(var(--app-white-rgb), 0.6);
}

.team-timeline__empty {
    color: rgba(var(--app-white-rgb), 0.5);
    font-style: italic;
    padding: 1rem 0.5rem;
}

/* Head-to-head overlay */
.head-to-head-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.5rem 0 1rem;
}

.head-to-head-team {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.head-to-head-team-name {
    font-weight: 600;
    margin-top: 0.25rem;
    font-size: 0.9rem;
    overflow-wrap: break-word;
}

.head-to-head-summary {
    flex: 1 1 0;
    text-align: center;
    min-width: 0;
}

.head-to-head-record {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 1.6rem;
    font-weight: 700;
}

.head-to-head-record-labels {
    display: flex;
    justify-content: center;
    gap: 1rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--bs-secondary);
    margin-top: 0.1rem;
}

.head-to-head-record-labels > span,
.head-to-head-record > span {
    flex: 1 1 0;
    text-align: center;
}

.head-to-head-wins {
    color: var(--app-positive);
}

.head-to-head-draws {
    color: var(--bs-secondary);
}

.head-to-head-losses {
    color: var(--bs-danger);
}

.head-to-head-goals {
    margin-top: 0.5rem;
    font-size: 0.95rem;
    color: var(--bs-secondary-color);
}

.head-to-head-toggle {
    margin: 0.75rem 0 0.25rem;
}

.head-to-head-toggle .form-check-input {
    cursor: pointer;
}

.head-to-head-toggle .form-check-label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
}

.head-to-head-table th,
.head-to-head-table td {
    font-size: 0.9rem;
}

/* Admin-only balance editor inside the team info table */
.admin-balance-group {
    max-width: 200px;
    margin-left: auto;
}
