/* The global Leaderboard uses the same five Elite Five identities at every size.
   Slot controls horizontal placement. The report's competition rank sets height
   and metal, so tied agents share a finish on the same baseline. */
@layer stone-city {
  @media screen and (max-width:760px),
       screen and (orientation:landscape) and (max-width:960px) and (max-height:540px) {
    html #hub-main .hub-standings-first:has(.hub-leaderboard-podium) {
      padding-block-start: 8px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium {
      position: relative;
      margin: 0 !important;
      padding: 0 !important;
      border: 0 !important;
      border-radius: 0 !important;
      background: transparent !important;
      box-shadow: none !important;
      backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important;
      overflow: visible !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium > .hub-elite-header {
      position: absolute !important;
      inline-size: 1px; block-size: 1px;
      margin: -1px !important; padding: 0 !important; border: 0 !important;
      clip-path: inset(50%); overflow: hidden; white-space: nowrap;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-stage {
      display: grid !important;
      grid-template-columns: repeat(5,minmax(0,1fr)) !important;
      align-items: end !important;
      gap: 12px 4px !important;
      margin: 0 !important; padding: 4px 0 0 !important;
      border: 0 !important;
      list-style: none;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place {
      --plinth-height: max(24px,calc(var(--tier-mobile) * .74 - 44px));
      --plinth-edge: #b7a08b;
      --plinth-face: linear-gradient(100deg,#645248,#423532 58%,#362b2a);
      --plinth-light: #f1e7da;
      display: flex !important;
      flex-direction: column;
      position: relative;
      grid-column: var(--column) !important;
      grid-row: 1 !important;
      min-inline-size: 0; inline-size: 100%;
      border: 0 !important;
      text-align: center;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place[data-tier-rank="1"] {
      --plinth-edge: #e8c385;
      --plinth-face: linear-gradient(105deg,#913c4d,#651e35 55%,#42172a);
      --plinth-light: #ffe2a5;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place[data-tier-rank="2"] {
      --plinth-edge: #d7d1c7;
      --plinth-face: linear-gradient(105deg,#726c67,#514b49 58%,#373537);
      --plinth-light: #fff4e8;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place[data-tier-rank="3"] {
      --plinth-edge: #d1a386;
      --plinth-face: linear-gradient(105deg,#78533f,#50372f 58%,#392929);
      --plinth-light: #f6d9c5;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place .hub-elite-identity {
      display: grid !important;
      grid-template-columns: auto auto;
      grid-template-rows: auto auto auto;
      grid-template-areas: "medal rank" "name name" "amount amount";
      justify-content: center; justify-items: center; align-items: center;
      gap: 2px 4px !important;
      min-height: 44px;
      margin: 0 !important; padding: 2px 0 7px !important;
      border: 0 !important; border-radius: 5px !important;
      line-height: 1.16; text-align: center;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-identity:focus-visible {
      outline: 2px solid var(--sc-gold-light,#ffe1a1) !important;
      outline-offset: -1px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-medal {
      grid-area: medal;
      display: grid !important; place-items: center;
      justify-self: end;
      width: 20px !important; height: 20px !important;
      border: 1px solid var(--plinth-edge) !important;
      color: var(--plinth-light) !important;
      background: var(--plinth-face) !important;
      box-shadow: inset 0 1px 0 #fff3 !important;
      font-size: 12px !important; line-height: 1;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-medal svg {
      /* Keep the original unlayered desktop icon rules from outgrowing its badge. */
      display: block !important;
      width: 15px !important; height: 15px !important;
      max-width: 100% !important; max-height: 100% !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-position {
      grid-area: rank !important;
      justify-self: start;
      color: var(--plinth-light) !important;
      font-size: .75rem !important; font-weight: 750;
      line-height: 1.16 !important; letter-spacing: .025em;
      overflow-wrap: anywhere;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-name,
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-amount {
      display: block !important;
      width: fit-content; max-width: 100% !important; min-width: 0;
      min-height: 0 !important;
      white-space: normal !important; overflow-wrap: anywhere;
      text-align: center !important;
      text-shadow: 0 1px 4px #26191d;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-name {
      grid-area: name !important;
      font-size: clamp(.8125rem,3.4vw,1rem) !important; font-weight: 750;
      letter-spacing: .01em; line-height: 1.18 !important;
      color: var(--sc-text,#fff8ec) !important;
      text-transform: uppercase !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-amount {
      grid-area: amount !important;
      font-size: clamp(.875rem,3.7vw,1.0625rem) !important;
      line-height: 1.18 !important; letter-spacing: -.025em;
      color: var(--plinth-light) !important;
      font-variant-numeric: tabular-nums;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-platform {
      position: relative !important; inset: auto !important;
      width: 100% !important; height: var(--plinth-height) !important;
      border-radius: 0 !important; background: transparent !important;
      pointer-events: none;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-bar {
      box-sizing: border-box; display: grid !important; place-items: center;
      width: 100%; height: 100%;
      border: 1px solid var(--plinth-edge) !important; border-radius: 1px !important;
      background: var(--plinth-face) !important;
      box-shadow: inset 3px 0 0 #fff1,inset -4px 0 0 #2716214d !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-cap {
      height: 5px !important; top: -5px !important; left: -1px !important; right: -1px !important;
      border-radius: 0 !important;
      clip-path: polygon(6% 0,94% 0,100% 100%,0 100%);
      background: linear-gradient(90deg,var(--plinth-edge),var(--plinth-light) 47%,var(--plinth-edge));
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-bar > strong {
      color: var(--plinth-light) !important;
      font-size: clamp(17px,calc(var(--plinth-height) * .42),32px) !important;
      font-weight: 750; line-height: 1; text-shadow: 0 1px 2px #38262b;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-tie {
      margin-top: .625rem !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-summary {
      margin-block-start: .75rem !important;
      border-top: 1px solid var(--sc-line,#a78b72) !important;
    }
  }
  @media screen and (max-width:519px) {
    /* Give the five equal columns room inside the existing phone card. */
    html #hub-main .hub-board-podium:has(.hub-leaderboard-podium) {
      padding-inline: 8px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-stage {
      column-gap: 2px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place .hub-elite-identity {
      grid-template-columns: 18px minmax(0,1fr);
      justify-content: stretch;
      column-gap: 2px !important;
      padding-inline: 0 !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-medal {
      width: 18px !important; height: 18px !important;
      font-size: 11px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-medal svg {
      width: 14px !important; height: 14px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-position {
      min-inline-size: 0; max-inline-size: 100%;
      font-size: .6875rem !important;
      letter-spacing: 0;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-name {
      font-size: clamp(.75rem,3vw,.8125rem) !important;
      letter-spacing: 0;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-amount {
      font-size: clamp(.75rem,3vw,.8125rem) !important;
      letter-spacing: -.035em;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place:only-child {
      grid-column: 2 / 5 !important;
      max-inline-size: 12rem; justify-self: center;
    }
  }
  @media screen and (orientation:landscape) and (min-width:520px) and (max-width:960px) and (max-height:540px) {
    html #root #hub-main[data-hub-route-content="leaderboard"]:has(.hub-leaderboard-podium) {
      row-gap: 4px !important;
    }
    html #hub-main .hub-standings-first:has(.hub-leaderboard-podium) {
      padding-block-start: 2px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-stage {
      padding-top: 0 !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-place .hub-elite-identity {
      grid-template-columns: auto minmax(0,max-content);
      grid-template-rows: auto auto;
      grid-template-areas: "medal name" "rank amount";
      align-content: center; gap: 1px 5px !important;
      padding: 0 1px !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-medal,
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-position {
      justify-self: center;
    }
  }
  @media (forced-colors:active) {
    html #hub-main .hub-board-podium .hub-leaderboard-podium :is(.hub-elite-platform,.hub-elite-bar,.hub-elite-medal) {
      border: 1px solid CanvasText !important;
    }
    html #hub-main .hub-board-podium .hub-leaderboard-podium .hub-elite-identity:focus-visible {
      outline-color: Highlight !important;
    }
  }
}
