.ranking-history {
  --history-accent: #285a72;
  --history-accent-dark: #204b61;
  --history-accent-soft: #eaf1f5;
  --history-border: #dce4e9;
  --history-heading: #26343d;
  --history-muted: #65737c;
  background: #f5f8fa;
  color: var(--history-heading);
  margin-top: 91px;
  min-height: 70vh;
  padding: 3rem 1rem 4rem;
}
.ranking-history__container { margin: 0 auto; max-width: 1120px; }

.ranking-history__hero,
.ranking-history__filters,
.ranking-history__panel {
  background: #fff;
  border: 1px solid var(--history-border);
  border-radius: 13px;
  box-shadow: 0 10px 28px rgba(35, 57, 69, .06);
}

.ranking-history__hero {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 1.75rem 2rem;
}

.ranking-history__back-link {
  align-items: center;
  color: var(--history-accent);
  display: inline-flex;
  font-size: .82rem;
  font-weight: 700;
  gap: .45rem;
  margin-bottom: 1rem;
  text-decoration: none;
}

.ranking-history__back-link:hover { color: var(--history-accent-dark); }

.ranking-history__eyebrow {
  color: var(--history-accent);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  margin: 0 0 .25rem;
  text-transform: uppercase;
}

.ranking-history__title {
  color: var(--history-heading);
  font-family: "Montserrat", Arial, sans-serif;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.ranking-history__subtitle { color: var(--history-muted); margin: .65rem 0 0; }

.ranking-history__hero-icon {
  align-items: center;
  background: var(--history-accent-soft);
  border-radius: 14px;
  color: var(--history-accent);
  display: inline-flex;
  flex: 0 0 62px;
  font-size: 1.55rem;
  height: 62px;
  justify-content: center;
  margin-left: 1.5rem;
  width: 62px;
}

.ranking-history__filters { margin-bottom: 1.25rem; padding: 1.5rem; }
.ranking-history__section-heading { align-items: center; display: flex; gap: .8rem; min-width: 0; }
.ranking-history__section-heading h2 { color: var(--history-heading); font-family: "Montserrat", Arial, sans-serif; font-size: 1.15rem; font-weight: 700; margin: 0; }

.ranking-history__section-icon {
  align-items: center;
  background: var(--history-accent-soft);
  border-radius: 9px;
  color: var(--history-accent);
  display: inline-flex;
  flex: 0 0 44px;
  height: 44px;
  justify-content: center;
  width: 44px;
}

.ranking-history__form { margin-top: 1.25rem; }
.ranking-history__filter-grid { align-items: end; display: grid; gap: .8rem; grid-template-columns: .65fr 1.4fr 1fr auto; }
.ranking-history__field { min-width: 0; }
.ranking-history__field label { color: var(--history-heading); display: block; font-size: .82rem; font-weight: 700; margin-bottom: .5rem; }

.ranking-history__select {
  background: #fff;
  border: 1px solid #c9d8df;
  border-radius: 8px;
  color: var(--history-heading);
  font: inherit;
  height: 42px;
  min-width: 0;
  padding: .55rem .75rem;
  width: 100%;
}

.ranking-history__submit,
.ranking-history__page-link {
  align-items: center;
  border-radius: 8px;
  display: inline-flex;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: .78rem;
  font-weight: 700;
  gap: .45rem;
  justify-content: center;
  min-height: 42px;
  padding: .55rem .85rem;
}

.ranking-history__submit {
  background: var(--history-accent);
  border: 1px solid var(--history-accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
}

.ranking-history__submit:hover { background: var(--history-accent-dark); border-color: var(--history-accent-dark); }
.ranking-history__panel { min-width: 0; overflow: hidden; }

.ranking-history__results-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  padding: 1.5rem;
}

.ranking-history__count {
  background: var(--history-accent-soft);
  border-radius: 999px;
  color: var(--history-accent);
  font-size: .75rem;
  font-weight: 700;
  padding: .4rem .7rem;
  white-space: nowrap;
}

.ranking-history__table-wrap { overflow-x: auto; width: 100%; }
.ranking-history__table { border-collapse: collapse; margin: 0; width: 100%; }

.ranking-history__table th {
  background: #246985;
  border-bottom: 1px solid var(--history-border);
  border-top: 1px solid var(--history-border);
  color: #fff;
  font-family: "Montserrat", Arial, sans-serif;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .055em;
  padding: .8rem 1rem;
  text-align: left;
  text-transform: uppercase;
}

.ranking-history__table td {
  border-bottom: 1px solid #e7edef;
  color: var(--history-heading);
  padding: .85rem 1rem;
  text-align: left;
  vertical-align: middle;
}

.ranking-history__table tbody tr:last-child td { border-bottom: 0; }
.ranking-history__table tbody tr:hover { background: #f8fafb; }
.ranking-history__position { white-space: nowrap; }
.ranking-history__position-number,
.ranking-history__score { color: var(--history-heading); font-family: "Montserrat", Arial, sans-serif; font-weight: 700; }

.ranking-history__movement {
  align-items: center;
  border-radius: 999px;
  display: inline-flex;
  font-size: .68rem;
  font-weight: 700;
  gap: .2rem;
  margin-left: .35rem;
  padding: .18rem .38rem;
}

.ranking-history__movement--up { background: #e6f5ed; color: #267449; }
.ranking-history__movement--down { background: #fceceb; color: #a23c35; }
.ranking-history__movement--same { background: #eef2f4; color: #738089; }
.ranking-history__player { align-items: center; display: flex; gap: .7rem; min-width: 0; }
.ranking-history__avatar-link { flex: 0 0 auto; }

.ranking-history__avatar {
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--history-border);
  display: block;
  height: 42px;
  object-fit: cover;
  width: 42px;
}

.ranking-history__player-link { color: var(--history-heading); font-weight: 700; overflow-wrap: anywhere; text-decoration: none; }
.ranking-history__player-link:hover,
.ranking-history__history-link:hover { color: var(--history-accent-dark); }
.ranking-history .ranking-history__table td.ranking-history__club { color: var(--history-muted); font-weight: 700; overflow-wrap: anywhere; }
.ranking-history__club-logo { height: 28px; object-fit: contain; vertical-align: middle; width: 28px; }
.ranking-history .ranking-history__table td.ranking-history__history-cell { text-align: right; }

.ranking-history__history-link {
  align-items: center;
  color: var(--history-accent);
  display: inline-flex;
  font-size: .78rem;
  font-weight: 700;
  gap: .35rem;
  text-decoration: none;
  white-space: nowrap;
}

.ranking-history__pagination {
  align-items: center;
  border-top: 1px solid var(--history-border);
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr auto 1fr;
  padding: 1rem 1.5rem;
}

.ranking-history__next-page { justify-self: end; }
.ranking-history__page-link { background: #fff; border: 1px solid #c9d8df; color: var(--history-accent); cursor: pointer; }
.ranking-history__page-link:hover { background: var(--history-accent-soft); color: var(--history-accent-dark); }
.ranking-history__page-status { color: var(--history-muted); font-size: .78rem; font-weight: 700; }

.ranking-history__empty { border-top: 1px solid var(--history-border); color: var(--history-muted); padding: 3rem 1rem; text-align: center; }
.ranking-history__empty-icon { align-items: center; background: var(--history-accent-soft); border-radius: 12px; color: var(--history-accent); display: inline-flex; font-size: 1.25rem; height: 52px; justify-content: center; width: 52px; }
.ranking-history__empty h3 { color: var(--history-heading); font-family: "Montserrat", Arial, sans-serif; font-size: 1rem; margin: .8rem 0 .3rem; }
.ranking-history__empty p { margin: 0; }

.ranking-history__select:focus { border-color: var(--history-accent); box-shadow: 0 0 0 3px rgba(40, 90, 114, .15); outline: 0; }
.ranking-history__back-link:focus-visible,
.ranking-history__submit:focus-visible,
.ranking-history__page-link:focus-visible,
.ranking-history__player-link:focus-visible,
.ranking-history__history-link:focus-visible,
.ranking-history__avatar-link:focus-visible { outline: 3px solid rgba(40, 90, 114, .28); outline-offset: 3px; }

@media (max-width: 850px) {
  .ranking-history__filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranking-history__submit { width: 100%; }
}

@media (max-width: 760px) {
  .ranking-history { padding: 1.5rem .75rem 3rem; }
  .ranking-history__hero,
  .ranking-history__filters,
  .ranking-history__results-header { padding: 1.2rem; }
  .ranking-history__hero,
  .ranking-history__filters,
  .ranking-history__panel { border-radius: 10px; }
  .ranking-history__results-header { align-items: flex-start; flex-direction: column; }
  .ranking-history__table-wrap { overflow: visible; padding: 0 1rem 1rem; }

  .ranking-history__table,
  .ranking-history__table tbody,
  .ranking-history__table tr,
  .ranking-history__table td { display: block; width: 100%; }

  .ranking-history__table thead {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
  }

  .ranking-history__table tr {
    border: 1px solid var(--history-border);
    border-radius: 10px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: .75rem;
    overflow: hidden;
  }

  .ranking-history__table td { border: 0; min-width: 0; padding: .7rem .8rem; }
  .ranking-history__table td::before { color: var(--history-muted); content: attr(data-label); display: block; font-size: .65rem; font-weight: 700; letter-spacing: .04em; margin-bottom: .25rem; text-transform: uppercase; }
  .ranking-history__table td:nth-child(3),
  .ranking-history__club,
  .ranking-history__history-cell { border-top: 1px solid #e7edef; grid-column: 1 / -1; }
  .ranking-history .ranking-history__table td.ranking-history__history-cell { background: #f8fafb; padding: 0; text-align: left; }
  .ranking-history .ranking-history__table td.ranking-history__history-cell::before { display: none; }
  .ranking-history__history-link { justify-content: center; padding: .7rem .8rem; width: 100%; }
  .ranking-history__pagination { gap: .65rem; padding: 1rem; }
}

@media (max-width: 520px) {
  .ranking-history__hero-icon { display: none; }
  .ranking-history__filter-grid { grid-template-columns: 1fr; }
  .ranking-history__submit { margin-top: .2rem; }
  .ranking-history__pagination { grid-template-columns: 1fr 1fr; }
  .ranking-history__page-status { grid-column: 1 / -1; grid-row: 1; text-align: center; }
}
