.history-hero {
    padding: 20px 0 26px;
}

.history-back {
    display: inline-block;
    color: var(--accent);
    font-weight: 700;
    font-size: .9rem;
    margin-bottom: 14px;
}

.history-hero h1 {
    font-size: clamp(1.9rem, 6vw, 2.7rem);
    letter-spacing: -.045em;
    line-height: 1.05;
    margin-bottom: 10px;
}

.history-hero p, .history-card__header p {
    color: var(--text-secondary);
}

.history-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-card);
}

.history-card__header {
    display: flex;
    gap: 16px;
    align-items: end;
    justify-content: space-between;
    padding: 22px;
    border-bottom: 1px solid var(--border);
}

.history-card__header h2 { font-size: 1.15rem; margin-bottom: 4px; }
.history-card__header p { font-size: .88rem; }

.history-select-label {
    display: grid;
    gap: 5px;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.history-select-label select {
    min-width: 130px;
    padding: 8px 30px 8px 10px;
    color: var(--text-primary);
    background: var(--bg-surface-raised);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font: inherit;
    text-transform: none;
}

.history-content { padding: 18px; }
.history-trend { margin-top: 18px; }
.season-highlights { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 18px; }
.season-highlight { padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-surface-raised); }
.season-highlight__league { display: block; color: var(--text-muted); font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.season-highlight strong { display: block; margin: 7px 0 3px; font-size: .98rem; }
.season-highlight small { color: var(--text-secondary); font-size: .76rem; }
.history-leagues { display: grid; gap: 16px; }

.history-league {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.history-league__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    background: var(--bg-surface-raised);
    font-size: .95rem;
    font-weight: 800;
}

.history-league__champion { color: var(--gold); font-size: .78rem; }
.history-row { display: grid; grid-template-columns: 32px 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--border); font-size: .9rem; }
.history-row__rank { color: var(--text-muted); font-weight: 800; }
.history-row__team { font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-row__points { color: var(--accent); font-weight: 800; }
.history-row__change { font-size: .73rem; font-weight: 800; padding: 3px 7px; border-radius: 999px; background: var(--bg-hover); color: var(--text-secondary); }
.history-row__change--up { color: #15803d; background: rgba(34, 197, 94, .15); }
.history-row__change--down { color: #e11d48; background: rgba(225, 29, 72, .12); }

.history-empty { padding: 42px 20px; text-align: center; color: var(--text-secondary); }
.history-empty__icon { display: block; font-size: 2rem; margin-bottom: 10px; }
.history-empty strong { display: block; color: var(--text-primary); margin-bottom: 6px; }
.trend-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin-bottom: 18px; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; background: var(--border); }
.trend-summary div { padding: 12px 14px; background: var(--bg-surface-raised); }
.trend-summary span { display: block; color: var(--text-muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; }
.trend-summary strong { display: block; margin-top: 3px; font-size: 1.08rem; }
.trend-chart { display: block; width: 100%; height: 220px; }
.trend-caption { display: flex; justify-content: space-between; gap: 16px; margin-top: 8px; color: var(--text-muted); font-size: .75rem; }

@media (max-width: 620px) {
    .history-card__header { align-items: start; flex-direction: column; }
    .history-select-label { width: 100%; }
    .history-select-label select { width: 100%; }
    .history-row { grid-template-columns: 25px 1fr auto; }
    .history-row__change { grid-column: 2 / -1; justify-self: start; }
    .season-highlights { grid-template-columns: 1fr; }
    .trend-summary { grid-template-columns: 1fr; }
}
