.app-content--leaderboards {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 0;
}

body.body--leaderboards {
  overflow-y: hidden;
}

body.body--leaderboards #app {
  height: 100vh;
  height: 100dvh;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;
}

.leaderboards-screen {
  position: relative;
  min-height: 0;
  overflow: visible;
  padding: 4px 14px calc(var(--nav-height) + var(--safe-area-bottom) + 22px);
  display: grid;
  justify-items: center;
  align-content: start;
  background: transparent;
}

.leaderboards__sky {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: visible;
}

.leaderboards__cloud,
.leaderboards__cloud::before,
.leaderboards__cloud::after {
  position: absolute;
  content: "";
  display: block;
  background: rgba(255,255,255,.78);
  border-radius: 999px;
}

.leaderboards__cloud {
  width: 94px;
  height: 28px;
  filter: drop-shadow(0 8px 12px rgba(38, 84, 110, .12));
  animation: gameCloud 13s ease-in-out infinite;
}

.leaderboards__cloud::before {
  left: 14px;
  bottom: 8px;
  width: 44px;
  height: 44px;
}

.leaderboards__cloud::after {
  right: 8px;
  bottom: 7px;
  width: 56px;
  height: 56px;
}

.leaderboards__cloud--one {
  left: max(18px, calc(50vw - var(--mobile-shell-active-width) / 2 - 68px));
  top: 104px;
}

.leaderboards__cloud--two {
  right: max(18px, calc(50vw - var(--mobile-shell-active-width) / 2 - 54px));
  bottom: 118px;
  transform: scale(.78);
  animation-delay: -4s;
}

.leaderboards__tile {
  position: absolute;
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: var(--radius-tile);
  background: var(--brand-tile-bg);
  border: 3px solid var(--brand-tile-border);
  color: var(--brand-tile-text);
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 900;
  text-shadow: var(--brand-tile-text-shadow);
  box-shadow: 0 9px 14px rgba(47, 63, 93, .18), inset 0 -5px 0 rgba(152, 62, 29, .18);
  opacity: .8;
}

.leaderboards__tile--one {
  left: max(22px, calc(50vw - var(--mobile-shell-active-width) / 2 + 14px));
  bottom: 84px;
  rotate: -10deg;
}

.leaderboards__tile--two {
  right: max(22px, calc(50vw - var(--mobile-shell-active-width) / 2 + 14px));
  top: 210px;
  rotate: 12deg;
}

.leaderboards__shell {
  position: relative;
  z-index: 1;
  width: var(--mobile-panel-width);
  display: grid;
  gap: 12px;
  padding-bottom: 0;
}

.leaderboards__header {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 12px 10px;
  border-radius: var(--radius-control);
  background: var(--surface-pill);
  box-shadow: var(--shadow-game-control);
  text-align: center;
}

.leaderboards__eyebrow,
.leaderboards__section-label {
  justify-self: center;
  color: #5d6b84;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.leaderboards__title {
  margin: 0;
  color: #1d2a41;
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.leaderboards__controls {
  display: grid;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-panel);
  background: rgba(255,255,255,.34);
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: inset 0 2px 8px rgba(55, 79, 103, .08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Which word language the board covers: scores are not comparable across
   languages, so the scope has to be visible. */
.leaderboards__scope {
  display: flex;
  justify-content: center;
}

.leaderboards__scope-language {
  padding: 3px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(255, 255, 255, .55);
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: var(--color-text-muted, #4a6076);
}

.leaderboards__tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  padding: 6px;
  border-radius: var(--radius-control);
  background: rgba(255,255,255,.6);
  box-shadow: inset 0 -2px 0 rgba(36, 51, 70, .05);
}

.leaderboards__tab,
.leaderboards__mode-select-control {
  min-height: 46px;
  border-radius: var(--radius-control);
  background: rgba(255,255,255,.76);
  color: #314564;
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 900;
}

.leaderboards__tab {
  padding: 0 10px;
  box-shadow: inset 0 -3px 0 rgba(36, 51, 70, .08);
}

.leaderboards__tab--active {
  color: #ffffff;
  background: var(--gradient-action);
  box-shadow: inset 0 4px 0 rgba(255,255,255,.28), inset 0 -4px 0 rgba(124, 27, 44, .18), 0 10px 22px rgba(161, 74, 43, .18);
}

.leaderboards__mode-select {
  position: relative;
  display: grid;
  width: 100%;
}

.leaderboards__mode-select-icon {
  position: absolute;
  display: grid;
  place-items: center;
  left: 14px;
  top: 50%;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-icon-badge);
  background: var(--gradient-action-alt);
  border: 2px solid var(--brand-tile-border);
  transform: translateY(-50%) rotate(-7deg);
  pointer-events: none;
  z-index: 1;
}

.leaderboards__mode-select-icon .app-icon {
  width: 13px;
  height: 13px;
  color: #fff8db;
}

.leaderboards__mode-select::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 3px solid #526079;
  border-bottom: 3px solid #526079;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.leaderboards__mode-select-control {
  width: 100%;
  min-height: 50px;
  padding: 0 44px 0 48px;
  border: 0;
  outline: 0;
  appearance: none;
  box-shadow: 0 8px 18px rgba(42, 63, 98, .1), inset 0 -3px 0 rgba(36, 51, 70, .08);
  cursor: pointer;
}

.leaderboards__results {
  min-height: 160px;
}

.leaderboards__podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
  margin: 10px 0 16px;
  padding: 16px 12px 14px;
  border-radius: var(--radius-panel);
  background: rgba(255,255,255,.24);
  box-shadow: inset 0 2px 8px rgba(55, 79, 103, .12);
}

.podium__spot {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
  cursor: pointer;
}

.podium__spot--1 { order: 2; }
.podium__spot--2 { order: 1; }
.podium__spot--3 { order: 3; }

.podium__avatar {
  position: relative;
}

.podium__crown {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  color: #ffb52e;
  font-size: 20px;
  text-shadow: 0 2px 0 rgba(103, 59, 11, .24);
}

.podium__name,
.leaderboard__name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #17263d;
  font-weight: 900;
}

.podium__name {
  max-width: 5.75rem;
  font-size: .95rem;
}

.podium__score {
  color: #754414;
  font-family: var(--font-heading);
  font-size: .88rem;
  font-weight: 900;
}

.podium__pedestal {
  width: 100%;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px 16px 8px 8px;
  color: white;
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 900;
  box-shadow: inset 0 4px 0 rgba(255,255,255,.3), inset 0 -5px 0 rgba(35, 58, 87, .16);
}

.podium__spot--1 .podium__pedestal {
  min-height: 82px;
  background: linear-gradient(135deg, #ffd65a, #ff934b);
}

.podium__spot--2 .podium__pedestal {
  min-height: 62px;
  background: linear-gradient(135deg, #7bd7ea, #1b9bd7);
}

.podium__spot--3 .podium__pedestal {
  min-height: 52px;
  background: linear-gradient(135deg, #2dc6a1, #1b9bd7);
}

.leaderboards__list,
.leaderboards__your-rank {
  display: grid;
  gap: 10px;
}

.leaderboards__your-rank {
  margin-top: 12px;
}

.leaderboard__entry {
  min-width: 0;
  min-height: 68px;
  display: grid;
  grid-template-columns: 48px 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-control);
  background: var(--surface-card-strong);
  border: var(--surface-border);
  box-shadow: 0 9px 20px rgba(42, 63, 98, .12), inset 0 -3px 0 rgba(36, 51, 70, .08);
  cursor: pointer;
}

.leaderboard__entry--me,
.podium__spot--me .podium__pedestal {
  outline: 3px solid rgba(255, 214, 90, .8);
}

.leaderboard__rank {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: rgba(255, 244, 173, .86);
  color: #754414;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 900;
}

.leaderboard__info {
  min-width: 0;
}

.leaderboard__name {
  font-size: 1rem;
  line-height: 1.05;
}

.leaderboard__meta {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #526079;
  font-family: var(--font-heading);
  font-size: .82rem;
  font-weight: 900;
}

.leaderboard__score {
  display: grid;
  justify-items: end;
  gap: 1px;
  color: #164f70;
  font-family: var(--font-heading);
  line-height: 1;
}

.leaderboard__score strong {
  font-size: 1.45rem;
  font-weight: 900;
}

.leaderboard__score span {
  font-size: .75rem;
  font-weight: 900;
  text-transform: uppercase;
  color: #526079;
}

@media (max-width: 23.375rem) {
  .leaderboards-screen {
    padding-inline: 10px;
  }

  .leaderboards__tab,
  .leaderboards__mode-select-control {
    font-size: .88rem;
    min-height: 44px;
  }

  .leaderboard__entry {
    grid-template-columns: 38px 40px minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 64px;
    padding: 9px 10px;
  }

  .leaderboard__rank {
    width: 36px;
    height: 36px;
    font-size: 1rem;
  }

  .leaderboard__name {
    font-size: .94rem;
  }

  .leaderboard__score strong {
    font-size: 1.2rem;
  }
}

@media (min-width: 640px) {
  .leaderboards__shell {
    width: var(--mobile-panel-width);
    gap: 14px;
  }

  .leaderboards__title {
    font-size: 2.4rem;
  }

  .leaderboards__controls {
    gap: 12px;
    padding: 12px;
  }

  .leaderboards__tabs {
    gap: 9px;
    padding: 7px;
  }

  .leaderboards__tab,
  .leaderboards__mode-select-control {
    min-height: 56px;
    font-size: 1.12rem;
  }

  .leaderboards__mode-select-control {
    min-height: 58px;
  }

  .leaderboards__podium {
    gap: 12px;
    margin: 12px 0 18px;
    padding: 18px 14px 16px;
  }

  .podium__name {
    max-width: 7.5rem;
    font-size: 1.05rem;
  }

  .podium__score {
    font-size: .98rem;
  }

  .leaderboards__list,
  .leaderboards__your-rank {
    gap: 12px;
  }

  .leaderboard__entry {
    min-height: 78px;
    grid-template-columns: 54px 54px minmax(0, 1fr) auto;
    gap: 14px;
    padding: 12px 14px;
  }

  .leaderboards-screen .avatar--sm {
    width: 46px;
    height: 46px;
    font-size: 1.1rem;
  }

  .leaderboard__rank {
    width: 46px;
    height: 46px;
    border-radius: 15px;
    font-size: 1.3rem;
  }

  .leaderboard__name {
    font-size: 1.18rem;
  }

  .leaderboard__meta {
    font-size: .95rem;
  }

  .leaderboard__score strong {
    font-size: 1.85rem;
  }

  .leaderboard__score span {
    font-size: .82rem;
  }
}
