/* Reserve space for the brand artwork, then lay out the title and toolbar in order. */
body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] .wallet-dialog-content {
  padding-top: 10.6cqw;
}
body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] #wallet-dialog-title {
  position: static;
  width: auto;
  height: auto;
  margin: 0 0 .55cqw;
  line-height: 1.12;
}
body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] .lobby-leader-title {
  min-width: 0;
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
  text-align: center;
}
#wallet-dialog[data-kind="leaderboard"] .lbx-balk {
  flex-wrap: wrap;
}
#wallet-dialog[data-kind="settings"] .ranking-guide {
  margin: .75rem 0 1rem;
  line-height: 1.5;
}
.ranking-guide summary {
  color: #ffe2a1;
  cursor: pointer;
  font-weight: 600;
}
.ranking-guide p {
  max-width: 50ch;
  margin: .5rem 0;
}
@media (max-width: 650px) {
  body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] .wallet-dialog-content {
    padding-top: 82px;
  }
  body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] #wallet-dialog-title {
    margin-bottom: 12px;
  }
}

/* Move a ranking entry straight to its new slot so names never cross in transit. */
#wallet-dialog[data-kind="leaderboard"] .lbx-lijst .lbx-rij {
  transition-property: border-color, box-shadow;
}

/* Keep the controls inside the frame, below the ornaments in the top corners. */
@media (min-width: 651px) {
  #wallet-dialog[data-kind="leaderboard"] .dialog-close {
    top: 6.2cqw;
    right: 5.1cqw;
  }
  body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] .wallet-dialog-content {
    display: flex;
    flex-direction: column;
    height: 55.86cqw;
    padding-inline: 8.5cqw;
    padding-bottom: 2.5cqw;
  }
  #wallet-dialog[data-kind="leaderboard"] #wallet-dialog-body {
    flex: 1;
    min-height: 0;
  }
  #wallet-dialog[data-kind="leaderboard"] .lbx {
    height: 100%;
    min-height: 0;
  }
  #wallet-dialog[data-kind="leaderboard"] .lbx-lijst {
    flex: 1 1 0;
    min-height: 0;
  }
  #wallet-dialog[data-kind="leaderboard"] .lbx-voet {
    flex: none;
  }
}
@media (max-width: 650px) {
  #wallet-dialog[data-kind="leaderboard"] .dialog-close {
    top: 21px;
  }
}

@media (max-width: 650px) {
  body.lobby-native-263 #wallet-dialog[data-kind="leaderboard"] .wallet-dialog-content {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 20px);
    padding-bottom: max(14px, env(safe-area-inset-bottom));
  }
  #wallet-dialog[data-kind="leaderboard"] #wallet-dialog-body,
  #wallet-dialog[data-kind="leaderboard"] .lbx-lijst {
    flex: 1 1 0;
    min-height: 0;
  }
  #wallet-dialog[data-kind="leaderboard"] .lbx { height: 100%; min-height: 0; }
  #wallet-dialog[data-kind="leaderboard"] .lbx-lijst {
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  #wallet-dialog[data-kind="leaderboard"] .lbx-voet { flex: none; }
}

/* The lobby keeps profile, ranking and loyalty details one tap from an open game. */
@media (max-width: 550px) {
  body.wallet-playing #wallet-bar .wallet-loyalty,
  body.wallet-playing #wallet-bar .wallet-actions,
  body.wallet-playing #wallet-bar #wallet-breakdown { display: none; }
  body.wallet-playing #wallet-bar .wallet-bar-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 44px;
    padding-block: 4px;
  }
}

/* v0.2.268 Countries tab: rows keep a readable height and the list scrolls inside the frame. */
#wallet-dialog[data-kind="leaderboard"] .lbx-lijst[data-tab="countries"] {
  overflow-y: auto;
  overscroll-behavior: contain;
}
#wallet-dialog[data-kind="leaderboard"] .lbx-lijst[data-tab="countries"] :is(.lbx-pijl, .lbx-spel) { visibility: hidden; }
#wallet-dialog[data-kind="leaderboard"] .lbx-rij.is-land { cursor: pointer; }
#wallet-dialog[data-kind="leaderboard"] .lbx-rij.is-land .lbx-naam { gap: .45em; }
#wallet-dialog[data-kind="leaderboard"] .lbx-rij.is-onvolledig { opacity: .78; }
#wallet-dialog[data-kind="leaderboard"] .lbx-rij.is-onvolledig .lbx-medal { font-size: .78em; letter-spacing: 0; }
#wallet-dialog[data-kind="leaderboard"] .lbx-rij.is-onvolledig .lbx-score { color: #c9b98d; }
@media (max-width: 650px) {
  /* Three tabs share the row evenly on a phone. */
  #wallet-dialog[data-kind="leaderboard"] .lbx-tabs { display: flex; width: 100%; }
  #wallet-dialog[data-kind="leaderboard"] .lbx-tab { flex: 1 1 0; min-width: 0; padding-inline: 6px; white-space: normal; line-height: 1.15; }
}

#wallet-dialog[data-kind="leaderboard"] .lbx-kaart[aria-label="Country details"] {
  max-height: min(80dvh, 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
}
#wallet-dialog .lbx-kaart[aria-label="Country details"] .lbx-kaart-kop {
  min-height: 44px;
  margin-bottom: 8px;
}

#wallet-dialog .lbx-team {
  display: grid;
  gap: 5px;
  margin-bottom: 5px;
}
#wallet-dialog .lbx-team-speler {
  display: flex;
  align-items: center;
  gap: .6em;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #6d8cb77a;
  border-radius: 6px;
  background: linear-gradient(#203654, #101d36 70%, #17233c);
  color: #fff3d4;
  font: inherit;
  font-size: clamp(13px, 3.15cqw, 18px);
  text-align: left;
  cursor: pointer;
}
#wallet-dialog .lbx-team-naam { overflow-wrap: anywhere; }
#wallet-dialog .lbx-team-score {
  margin-left: auto;
  color: #ffdf94;
  font-variant-numeric: tabular-nums;
}
#wallet-dialog .lbx-team-speler::after {
  content: "";
  width: .4em;
  height: .4em;
  flex: none;
  border: solid #e6c679;
  border-width: 1.5px 1.5px 0 0;
  transform: rotate(45deg);
}
#wallet-dialog .lbx-team-speler:is(:hover, :focus-visible) {
  border-color: #ffdc80;
  outline: 1px solid #ffdc80;
}
#wallet-dialog .lbx:has(.lbx-lijst[data-tab="countries"]) .lbx-kaart {
  max-height: min(80dvh, 100%);
  overflow-y: auto;
  overscroll-behavior: contain;
}
