.run-hint {
  color: #91aabb;
  font-size: 13px;
  margin: 0 0 14px;
}
.run-table {
  min-width: 850px;
  width: 100%;
  border-collapse: separate;
  border-spacing: 0 6px;
}
.run-table th {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8da7b7;
  padding: 12px 16px;
}
.run-table td {
  padding: 15px 16px;
  background: #102430;
  border-top: 1px solid #233c4c;
  border-bottom: 1px solid #233c4c;
  vertical-align: middle;
}

.run-table tbody tr:nth-child(even) td {
    background: #142b38;
}

.run-table td:first-child {
  border-left: 1px solid #233c4c;
  border-radius: 5px 0 0 5px;
}
.run-table td:last-child {
  border-right: 1px solid #233c4c;
  border-radius: 0 5px 5px 0;
}

.run-table th:nth-child(1),
.run-table td:nth-child(1) {
    width: 1%;
    white-space: nowrap;
}

.run-table .run-winner td {
  background: #302c1a;
  border-color: #867038;
}
.run-table .run-winner td:first-child {
  border-left: 3px solid #efc659;
}

.run-table .rank {
    color: inherit;
}

.run-winner .run-rank,
.run-winner .run-time {
  color: #ffe49a;
}
.run-rank {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.run-date {
    white-space: nowrap;
    color: #aec1ce;
    font-size: 13px;
    line-height: 1.25;
    text-align: center;
}

.run-date-day,
.run-date-hour {
    display: block;
}

.run-date-hour {
    margin-top: 2px;
    color: #7896aa;
    font-size: 12px;
}

.run-table th:nth-child(2) {
    text-align: center;
}
.run-time {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.run-heroes,
.run-players {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.run-heroes {
  min-width: 116px;
  max-width: 240px;
}
.run-hero {
  padding: 0 !important;
  width: 52px;
  height: 44px;
  flex-shrink: 0;
  border: 1px solid #547182;
  border-radius: 4px;
  background: #09151e;
  overflow: hidden;
  cursor: pointer;
}
.run-hero img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.run-hero:hover,
.run-hero:focus-visible {
  border-color: #ebc567;
  outline: 2px solid #ebc567;
  outline-offset: 2px;
  transform: translateY(-1px);
}
.run-players {
  max-width: 350px;
}
.run-player {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #dceaf2;
  font-size: 13px;
  max-width: 155px;
}
.run-player img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid #4b6170;
}
.run-player span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.run-popup {
  position: fixed;
  inset: auto;
  margin: 0;
  width: 310px;
  max-width: calc(100vw - 20px);
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 16px;
  background: #0b1720;
  color: #dceaf2;
  border: 1px solid #7d7049;
  border-radius: 8px;
  box-shadow: 0 14px 45px #000b;
  z-index: 1000;
}
.run-popup::backdrop {
  background: transparent;
}
.run-popup-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #2b414d;
  padding-bottom: 12px;
}
.run-popup-heading strong {
  color: #f2d58f;
  font-size: 16px;
}
.run-popup-heading small {
  display: block;
  color: #9ab3c3;
  margin-top: 4px;
}
.run-popup-heading button {
  padding: 0 8px;
  background: transparent;
  border: 0;
  color: #b5c8d6;
  font-size: 24px;
  align-self: flex-start;
}
.run-loadout h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #9bb1bf;
  margin: 15px 0 9px;
}
.run-loadout p {
  font-size: 13px;
}
.run-abilities {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.run-abilities img {
  width: 42px;
  height: 42px;
  border: 1px solid #53606a;
  border-radius: 3px;
  object-fit: cover;
}
.run-inventory {
  display: grid;
  grid-template-columns: repeat(3, 56px) 44px;
  gap: 5px;
}
.run-slot {
  display: block;
  width: 56px;
  height: 40px;
  background: #142630;
  border: 1px solid #40515a;
  border-radius: 3px;
  box-shadow: inset 0 2px 8px #0008;
  overflow: hidden;
}
.run-slot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.run-slot:nth-child(4) {
  grid-column: 1;
}
.run-slot:nth-child(7) {
  grid-column: 1;
}
.run-slot.run-backpack {
  height: 28px;
  opacity: 0.75;
}
.run-slot.run-neutral {
  grid-column: 4;
  grid-row: 1 / span 2;
  align-self: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  margin-left: 5px;
  border-color: #8c7b49;
}

/* Compact leaderboard and build summary. */
.run-table {
  min-width: 610px;
  border-spacing: 0 4px;
}
.run-table td {
  padding: 5px 12px;
}
.run-table th {
  padding: 10px 12px;
}
.run-heroes {
  gap: 5px;
  min-width: 0;
  max-width: none;
  flex-wrap: nowrap;
}
.run-hero {
  width: 45px;
  height: 38px;
}
.run-players {
  gap: 6px;
  max-width: none;
  flex-wrap: nowrap;
}
.run-player {
  display: block;
  flex-shrink: 0;
}
.run-player img {
  display: block;
  width: 34px;
  height: 34px;
}


/* Instant player-name tooltip. */
.run-player {
  position: relative;
}

.run-player::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 7px);
  transform: translateX(-50%);
  padding: 6px 9px;
  border: 1px solid #405866;
  border-radius: 4px;
  background: #0b1720;
  color: #dceaf2;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  box-shadow: 0 5px 16px #0008;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 200;
}

.run-player:hover::after,
.run-player:focus-visible::after {
  opacity: 1;
  visibility: visible;
}
.run-popup-heading .run-popup-player {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
}
.run-popup-player img {
  width: 20px;
  height: 20px;
  border-radius: 3px;
  object-fit: cover;
}
.run-abilities {
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;
}
.run-abilities .run-passive {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border-color: #b29b65;
}
.run-abilities .run-passive + img:not(.run-passive) {
  margin-left: 3px;
}
.run-slot.run-backpack {
  opacity: 1;
  background: #081118;
  border-color: #273740;
}
.run-backpack img {
  filter: brightness(0.48) saturate(0.75);
}
.run-breakdown {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  margin: 0 0 18px;
  border: 1px solid #2b4554;
  border-radius: 6px;
  background: linear-gradient(110deg, #152d3c, #0c1b26);
}
.run-breakdown-title {
  flex: 0 0 205px;
}
.run-breakdown h3 {
  font-size: 15px;
  margin: 0 0 6px;
  color: #e5eef5;
}
.run-breakdown p {
  margin: 0;
  color: #9bb3c4;
  font-size: 13px;
}
.run-breakdown-title > small {
  display: block;
  margin-top: 5px;
  font-size: 11px;
  color: #7896aa;
}
.run-stat-groups {
  display: flex;
  flex: 1;
  min-width: 0;
  justify-content: space-around;
  gap: 24px;
}
.run-stat-group {
  min-width: 0;
}
.run-stat-group h4 {
  margin: 0 0 9px;
  font-size: 12px;
  color: #b9d5e6;
  white-space: nowrap;
}
.run-stat-icons {
  display: flex;
  gap: 7px;
  flex-wrap: nowrap;
}
.run-stat-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
}
.run-stat-icon img {
  width: 42px;
  height: 35px;
  object-fit: cover;
  border: 1px solid #506474;
  border-radius: 3px;
}
.run-stat-icon .run-passive {
  border-radius: 50%;
  width: 35px;
  height: 35px;
}
.run-stat-icon small {
  font-size: 11px;
  color: #b9cddd;
  font-variant-numeric: tabular-nums;
}
.run-stat-icon:focus-visible {
  outline: 1px solid #e9c468;
  outline-offset: 3px;
}

.run-stat-icon {
    position: relative;
}

.run-stat-icon::after {
    content: attr(data-tooltip);

    position: absolute;
    left: 50%;
    bottom: calc(100% + 8px);
    transform: translateX(-50%);

    padding: 6px 9px;
    border: 1px solid #405866;
    border-radius: 4px;

    background: #0b1720;
    color: #dceaf2;

    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;

    box-shadow: 0 5px 16px #0008;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    z-index: 100;
    transition: opacity 0.1s ease;
}

.run-stat-icon:hover::after,
.run-stat-icon:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.run-popup-close {
    display: none;
    margin: -5px -5px 0 8px;
    padding: 2px 7px;
    min-width: 0;

    border: 0;
    background: transparent;

    color: #9fb4c2;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;
}

.run-popup-close:hover,
.run-popup-close:focus-visible {
    color: #ffffff;
    background: transparent;
}

@media (max-width: 1250px) {

    .run-breakdown {
        gap: 14px;
        padding: 15px;
    }

    .run-breakdown-title {
        flex-basis: 155px;
    }

    .run-stat-groups {
        gap: 12px;
    }

    .run-stat-group h4 {
        font-size: 11px;
    }

    .run-stat-icons {
        gap: 4px;
    }

    .run-stat-icon img {
        width: 34px;
        height: 29px;
    }

    .run-stat-icon .run-passive {
        width: 29px;
        height: 29px;
    }

    .run-stat-icon small {
        font-size: 10px;
    }
}


/* Breakdown switches to vertical layout earlier,
   before the groups become too cramped. */

@media (max-width: 1000px) {

    .run-breakdown {
        display: block;
        padding: 18px;
    }

    .run-breakdown-title {
        margin-bottom: 14px;
        padding-bottom: 12px;
        border-bottom: 1px solid #294553;
        text-align: center;
    }

    .run-stat-groups {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        overflow: visible;
        padding: 0;
        margin: 0;
    }

    .run-stat-group {
        width: 100%;
        min-width: 0;
    }

    .run-stat-group h4 {
        margin: 0 0 7px;
        text-align: center;
    }

    .run-stat-icons {
        display: grid;
        grid-template-columns: repeat(6, 34px);
        gap: 8px;
        justify-content: center;
    }

    .run-stat-icon {
        min-width: 0;
    }

    .run-stat-icon img {
        width: 34px;
        height: 29px;
    }

    .run-stat-icon .run-passive {
        width: 29px;
        height: 29px;
    }

    .run-stat-icon small {
        font-size: 11px;
    }

    .run-popup-close {
      display: block;
    }
}


/* Phone leaderboard table */
@media (max-width: 800px) {

    .run-table td {
        padding: 7px 5px;
    }

    .run-table th {
        padding: 8px 5px;
    }

    .run-table th:nth-child(1),
    .run-table td:nth-child(1),
    .run-table th:nth-child(2),
    .run-table td:nth-child(2),
    .run-table th:nth-child(3),
    .run-table td:nth-child(3) {
        width: 1%;
        white-space: nowrap;
    }

    .run-table th:nth-child(1),
    .run-table td:nth-child(1) {
        padding-left: 5px;
        padding-right: 5px;
    }

    .run-table th:nth-child(2),
    .run-table td:nth-child(2) {
        padding-left: 4px;
        padding-right: 4px;
    }

    .run-table th:nth-child(3),
    .run-table td:nth-child(3) {
        padding-left: 5px;
        padding-right: 5px;
    }

    .run-rank {
        gap: 4px;
    }

    .run-rank svg {
        width: 15px;
        height: 15px;
    }

    .run-date {
        font-size: 11px;
    }

    .run-date-hour {
        font-size: 10px;
    }

    .run-time {
        font-size: 12px;
    }

    .run-table {
        min-width: 570px;
    }
}

@media (max-width: 700px) {

    /* ===== PAGE HEADING ===== */

    .page-heading {
        padding: 26px 0 10px;
    }

    .page-heading h1 {
        font-size: 30px;
        margin-bottom: 10px;
    }


    /* ===== GAME TABS ===== */

    .tabs {
        flex-wrap: nowrap;

        gap: 22px;
        margin: 14px 0 20px;

        overflow-x: auto;
        overflow-y: hidden;

        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .tabs::-webkit-scrollbar {
        display: none;
    }

    .tabs a {
        flex: 0 0 auto;
        padding: 10px 0;

        white-space: nowrap;
    }


    /* ===== LEADERBOARD SECTION HEADING ===== */

    .section-heading {
        margin-top: 14px;
        gap: 2px;
    }

    .section-heading h2 {
        margin: 0;
    }

    .section-heading span {
        margin: 0;
    }
}

/* Leaderboard page artwork and game navigation. */
.leaderboards-hero {
    background: url('leaderboards-hero.png') center 6% / cover no-repeat;
}
.leaderboards-hero::after { display: none; }
.leaderboards-hero__content { text-shadow: 0 2px 9px #06121c, 0 0 20px #06121c; }

.leaderboard-tabs {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 4px;
    margin: 18px 0 18px;
    border-bottom: 1px solid #356986;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.leaderboard-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    padding: 11px 17px 12px;
    margin-bottom: -1px;
    border: 1px solid #254b68;
    border-bottom-color: #356986;
    border-radius: 7px 7px 0 0;
    background: linear-gradient(#10283c, #0a1d2d);
    color: #c9dbeb;
    font-size: 14px;
    white-space: nowrap;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.leaderboard-tabs a img { display: block; width: 32px; height: 32px; flex: 0 0 32px; object-fit: contain; }
.leaderboard-tabs a:hover { border-color: #4b8eb9; background: linear-gradient(#173954, #0e2a43); color: #fff; }
.leaderboard-tabs a.active,
.leaderboard-tabs a[aria-current="page"] {
    border-color: #4a89b1;
    border-bottom: 1px solid #5da9d4;
    background: linear-gradient(to top, #246291 0%, #194b72 25%, #102e4b 58%, #0b2033 100%);
    color: #fff;
    font-weight: 700;
    box-shadow: inset 0 -9px 16px -13px #6ecaffaa;
}
.leaderboard-tabs a:focus-visible { outline: 2px solid #9cdeff; outline-offset: -3px; }

.filters.panel .leaderboard-show-rankings {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #35b8fb;
    background: linear-gradient(180deg, #139af2, #0751d4);
    box-shadow: inset 0 1px #ffffff55, 0 5px 15px #126cce55;
}
.leaderboard-filter-label { display: inline-flex; align-items: center; gap: 7px; }
.leaderboard-filter-label img { display: block; width: 17px; height: 17px; }
.leaderboard-show-rankings img { display: block; width: 21px; height: 21px; }
.filters.panel .leaderboard-show-rankings:hover { background: linear-gradient(180deg, #28aef9, #1165e0); border-color: #83d6ff; }

/* Summary and compact ranking rows. */
.run-breakdown {
    gap: 22px;
    border-color: #315a76;
    background: linear-gradient(110deg, #102c44, #091e31);
}
.run-breakdown-title { display: flex; align-items: center; gap: 15px; flex: 0 0 285px; min-width: 0; }
.run-breakdown-title > div { min-width: 0; }
.run-breakdown-icon { display: block; width: 54px; height: 54px; flex: 0 0 54px; filter: drop-shadow(0 0 8px #249cfa55); }
.run-breakdown-title > div > small { display: block; margin-top: 5px; color: #8fb3ce; font-size: 11px; }
.run-stat-groups { justify-content: flex-start; align-items: stretch; gap: 0; }
.run-stat-group { display: flex; flex: 1 1 0; flex-direction: column; justify-content: center; border-left: 1px solid #31536b; padding-left: 18px; }
.run-stat-group h4 { margin-bottom: 8px; color: #e0efff; }
.run-stat-icon img { width: 47px; height: 40px; border-color: #6b8da4; }
.run-stat-icon .run-passive { width: 40px; height: 40px; }
.run-hero { width: 38px; height: 32px; }
.run-player img { width: 29px; height: 29px; }

.run-table .run-winner { filter: none; }
.run-table .run-winner td {
    background: linear-gradient(180deg, #302c21, #282820);
    border-top: 1px solid #b99046;
    border-bottom: 1px solid #b99046;
}
.run-table .run-winner td:first-child { border-left: 1px solid #b99046; }
.run-table .run-winner td:last-child { border-right: 1px solid #b99046; }
.run-winner .run-rank { color: #ffe7a6; }
.run-winner .run-rank svg { color: #e7bd66; filter: none; }

@media (max-width: 1250px) {
    .run-breakdown-title { flex-basis: 225px; }
    .run-breakdown-icon { width: 47px; height: 47px; flex-basis: 47px; }
    .run-stat-icon img { width: 40px; height: 35px; }
    .run-stat-icon .run-passive { width: 35px; height: 35px; }
}
@media (max-width: 1000px) {
    .run-breakdown-title { justify-content: center; margin-bottom: 14px; text-align: left; }
    .run-stat-groups { gap: 12px; }
    .run-stat-group { border-left: 0; padding-left: 0; }
    .run-stat-group + .run-stat-group { border-top: 1px solid #31536b; padding-top: 12px; }
    .run-stat-icons { grid-template-columns: repeat(6, 40px); }
    .run-stat-icon img { width: 40px; height: 35px; }
    .run-stat-icon .run-passive { width: 35px; height: 35px; }
}
@media (max-width: 700px) {
    .leaderboard-tabs { gap: 3px; margin: 14px 0 18px; }
    .leaderboard-tabs a { gap: 7px; padding: 9px 12px 11px; font-size: 13px; }
    .leaderboard-tabs a img { width: 32px; height: 32px; flex-basis: 32px; }
    .run-stat-icons { grid-template-columns: repeat(6, 32px); gap: 6px; }
    .run-stat-icon img { width: 32px; height: 29px; }
    .run-stat-icon .run-passive { width: 29px; height: 29px; }
    .run-hero { width: 33px; height: 29px; }
    .run-player img { width: 25px; height: 25px; }
}

/* ===== LEADERBOARD FILTER PANEL ===== */

.filters.panel {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
    gap: 16px;
    align-items: end;

    padding: 20px;
    margin: 0 0 22px;

    border: 1px solid #284455;
    border-radius: 8px;

    background: linear-gradient(180deg, rgba(18, 41, 55, 0.96), rgba(10, 24, 35, 0.96));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.filters.panel label {
    display: flex;
    flex-direction: column;
    gap: 7px;

    min-width: 0;

    color: #9eb6c5;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.filters.panel select {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 0 14px;

    border: 1px solid #304d60;
    border-radius: 7px;

    background: #142a3b;
    color: #e7f1f8;

    font-size: 14px;
}

.filters.panel select:hover {
    border-color: #3a6179;
    background: linear-gradient(180deg, #1a364a, #142b3c);
}

.filters.panel select:focus {
    outline: none;
    border-color: #4aa8f0;
    box-shadow: 0 0 0 2px rgba(74, 168, 240, 0.16);
}

.filters.panel button {
    min-width: 170px;
    min-height: 48px;
    padding: 0 18px;

    border-radius: 7px;
    align-self: end;
    white-space: nowrap;
}

@media (max-width: 900px) {

    .filters.panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px;
    }

    .filters.panel button {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 700px) {

    .filters.panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));

        gap: 12px;
        padding: 16px;
        margin-bottom: 18px;

        border-radius: 7px;
    }

    .filters.panel label {
        gap: 6px;
        font-size: 11px;
    }

    .filters.panel select {
        min-height: 46px;
        padding: 0 12px;
        font-size: 13px;
    }

    .filters.panel button {
        width: 100%;
        min-width: 0;
        min-height: 46px;
        margin: 0;
        padding: 0 12px;
        font-size: 13px;
    }
}

/* ===== DARK NATIVE SELECT OPTIONS ===== */

.filters.panel select {
    color-scheme: dark;
}

.filters.panel select option {
    background: #142a3b;
    color: #e7f1f8;
}

.filters.panel select option:checked {
    background: #244762;
    color: #ffffff;
}

.filters.panel select option:disabled {
    background: #142a3b;
    color: #6f8797;
}

/* ===== PHONE ICON SIZES ===== */
@media (max-width: 700px) {

    .run-stat-icons {
        grid-template-columns: repeat(6, 32px);
        gap: 6px;
    }

    .run-stat-icon img {
        width: 32px;
        height: 29px;
    }

    .run-stat-icon .run-passive {
        width: 29px;
        height: 29px;
    }

    .run-hero {
        width: 33px;
        height: 29px;
    }

    .run-player img {
        width: 25px;
        height: 25px;
    }
}

