.ranking-head {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 180px 62px;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 10px;
  color: #7b8ca2;
  font-size: 8px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.ranking-head > span:last-child { text-align: right; }

.tally-head {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  text-align: center;
}

.tally-head i { font-style: normal; }

.rank {
  grid-template-columns: 42px 6px minmax(0, 1fr) 180px 62px !important;
  min-height: 61px;
}

.rank-school {
  min-width: 0;
}

.rank-school b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.medal-tally {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.medal-tally > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  height: 30px;
  padding: 4px 8px 4px 5px;
  border: 1px solid transparent;
  border-radius: 10px;
  font-size: 11px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.medal-tally i {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 8px;
  font-style: normal;
  font-weight: 900;
}

.medal-tally b { font-size: 12px !important; }

.medal-tally .gold {
  color: #765000;
  border-color: #f1d272;
  background: linear-gradient(135deg, #fffaf0, #fff0b4);
}

.medal-tally .gold i {
  color: #6d4500;
  background: linear-gradient(135deg, #fff5a5, #eeb20d);
  box-shadow: 0 3px 8px rgba(205,146,0,.25);
}

.medal-tally .silver {
  color: #475b70;
  border-color: #d5dee7;
  background: linear-gradient(135deg, #fbfdff, #e7edf3);
}

.medal-tally .silver i {
  color: #3e5265;
  background: linear-gradient(135deg, #fff, #b9c7d4);
  box-shadow: 0 3px 8px rgba(71,91,112,.18);
}

.medal-tally .bronze {
  color: #783d1e;
  border-color: #ebc4a9;
  background: linear-gradient(135deg, #fff9f4, #f4d5c0);
}

.medal-tally .bronze i {
  color: #fff;
  background: linear-gradient(135deg, #df9a68, #a84d22);
  box-shadow: 0 3px 8px rgba(154,68,28,.22);
}

.rank-points {
  text-align: right;
  white-space: nowrap;
}

@media (max-width: 1180px) {
  .ranking-head { grid-template-columns: 52px minmax(0,1fr) 144px 58px; }
  .rank { grid-template-columns: 42px 6px minmax(0,1fr) 144px 58px !important; }
  .medal-tally > span { padding-right: 5px; }
}

@media (max-width: 650px) {
  .ranking-head { display: none; }
  .rank {
    grid-template-columns: 36px 5px minmax(0,1fr) auto !important;
    gap: 7px !important;
    padding-block: 11px !important;
  }
  .medal-tally {
    grid-column: 3 / 5;
    width: min(225px, 100%);
  }
  .rank-points {
    grid-column: 4;
    grid-row: 1;
  }
  .medal-tally > span { height: 27px; }
  .medal-tally i { width: 18px; height: 18px; }
}
