/* Live leaderboard: six server categories in a dry Black Rain dossier. */
html.survival-portrait body:has(#rating.popup[style*="display:block"]) .game .frame_city > .survival-city-identity,
html.survival-portrait body:has(#rating.popup[style*="display: block"]) .game .frame_city > .survival-city-identity {
  visibility: hidden !important;
}
html.survival-portrait body #rating.popup:not(#coinPopup):not(#goldPopup):not(#energyPopup):not(#payRobo):not(#companyDailyQuest):not(#eventHunting) {
  left: var(--dossier-x,0px) !important;
  top: var(--dossier-y,0px) !important;
  width: calc(100% - 2 * var(--dossier-x,0px)) !important;
  height: calc(100% - var(--dossier-y,0px) - var(--dossier-foot,0px)) !important;
  overflow: visible !important;
  background: linear-gradient(165deg,#142936,#0b1a27) !important;
  border: 1px solid #a08767 !important;
  border-radius: 11px !important;
  box-shadow: 0 9px 23px #030d16dd,inset 0 1px #e4c29449 !important;
}
html.survival-portrait body #rating > .survival-rating-header {
  display: none;
}
html.survival-portrait body #rating.popup > .h1,
html.survival-portrait body #rating.popup:not(#coinPopup):not(#goldPopup):not(#energyPopup):not(#payRobo):not(#companyDailyQuest):not(#eventHunting) > .h1 {
  display: block !important;
  left: 48px !important;
  top: calc(40px + var(--dossier-offset,0px)) !important;
  width: calc(100% - 86px) !important;
  height: 29px !important;
  color: #fff1dc !important;
  font: 900 20px/29px var(--br-display) !important;
  text-transform: uppercase !important;
  text-shadow: none !important;
  overflow: visible !important;
}
html.survival-portrait body #rating.popup > .h1::before {
  content: '';
  position: absolute;
  left: -36px;
  top: -2px;
  width: 30px;
  height: 32px;
  background: url('../img/ui/survival/kit/rating.webp') center / contain no-repeat;
}
html.survival-portrait body #rating.popup > .close,
html.survival-portrait body #rating.popup:not(#coinPopup):not(#goldPopup):not(#energyPopup):not(#payRobo):not(#companyDailyQuest):not(#eventHunting) > .close {
  top: calc(37px + var(--dossier-offset,0px)) !important;
  right: 9px !important;
  width: 34px !important;
  height: 34px !important;
  box-shadow: 0 1px 2px #0007 !important;
}
html.survival-portrait body #rating.popup > .leftMenu {
  left: 10px !important;
  right: 10px !important;
  top: calc(74px + var(--rating-scene, 0px) + var(--dossier-offset,0px)) !important;
  width: auto !important;
  height: var(--rating-tabs-height,72px) !important;
  grid-template-columns: repeat(3,minmax(0,1fr)) !important;
  grid-auto-rows: var(--rating-tab-height,34px) !important;
  gap: 4px !important;
}
html.survival-portrait body #rating.popup > .leftMenu > .btn:not(.hide) {
  height: var(--rating-tab-height,34px) !important;
  padding: 0 3px !important;
  border: 1px solid transparent !important;
  border-radius: 5px !important;
  background: transparent url('../img/ui/survival/kit/button_secondary.webp') center / 100% 100% no-repeat !important;
  color: #ecf1ee !important;
  font: 800 12px/var(--rating-tab-line,32px) var(--br-display) !important;
  text-transform: uppercase;
  text-shadow: 0 1px 2px #06111c !important;
}
html.survival-portrait body #rating.popup > .leftMenu > .btn.active {
  border-color: transparent !important;
  background: transparent url('../img/ui/survival/kit/button_primary.webp') center / 100% 100% no-repeat !important;
  color: #fff1dc !important;
  box-shadow: none !important;
  text-shadow: 0 1px 2px #06111c !important;
}
html.survival-portrait body #rating.popup > .rating-your {
  left: 10px !important;
  right: 10px !important;
  top: calc(var(--rating-position-top,152px) + var(--rating-scene, 0px) + var(--dossier-offset,0px)) !important;
  width: auto !important;
  height: 34px !important;
  padding: 0 9px !important;
  background: #1a1e1e url('../img/ui/survival/kit/reward_card.webp') center / 100% 100% no-repeat !important;
  border: 1px solid transparent !important;
  border-radius: 2px !important;
  color: #f5e5ce !important;
  font: 800 12px/32px Arial,sans-serif !important;
  text-align: left !important;
  text-shadow: none !important;
  box-shadow: inset 0 1px #efc49c44,0 2px 5px #0007 !important;
}
html.survival-portrait body #rating.popup > .ratingBoard {
  left: 10px !important;
  right: 10px !important;
  top: calc(var(--rating-board-top,193px) + var(--rating-scene, 0px) + var(--dossier-offset,0px)) !important;
  bottom: var(--rating-board-foot,7px) !important;
  width: auto !important;
  height: auto !important;
  padding: 0 1px 3px !important;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  scrollbar-width: thin;
  scrollbar-color: #bd8752 #1d3541 !important;
}
html.survival-portrait body #rating.popup > .ratingBoard > .rating-item {
  display: grid !important;
  grid-template-columns: 29px 35px minmax(0,1fr) !important;
  gap: 5px !important;
  align-items: center !important;
  min-height: 36px !important;
  height: 36px !important;
  margin: 0 0 3px !important;
  box-sizing: border-box !important;
  padding: 1px 3px !important;
  background: #1b1e1d url('../img/ui/survival/kit/reward_card.webp') center / 100% 100% no-repeat !important;
  border: 1px solid transparent !important;
  border-radius: 2px !important;
  box-shadow: inset 0 1px #b7a58124 !important;
}
html.survival-portrait body #rating.popup > .ratingBoard > .rating-item > .avatar {
  display: block !important;
  grid-column: 2;
  grid-row: 1;
  width: 30px !important;
  height: 30px !important;
  border-color: #81715a !important;
  border-radius: 2px !important;
}
html.survival-portrait body #rating.popup > .ratingBoard > .rating-item > .lvl,
html.survival-portrait body #rating.popup > .ratingBoard > .guildItem.rating-guild-item > .lvl {
  display: block !important;
  position: static !important;
  grid-column: 1;
  grid-row: 1;
  flex: 0 0 27px !important;
  width: 27px !important;
  height: 29px !important;
  margin: 0 !important;
  border: 1px solid transparent !important;
  border-radius: 2px !important;
  background: url('../img/ui/survival/kit/icon_slot.webp') center / 100% 100% no-repeat !important;
  color: #fff0dc !important;
  font: 800 12px/27px var(--br-display) !important;
  text-align: center !important;
  box-sizing: border-box !important;
}
html.survival-portrait body #rating.popup > .ratingBoard > :is(.rating-item,.guildItem):nth-child(-n+9) > .lvl::before { content: '0'; }
html.survival-portrait body #rating.popup > .ratingBoard > :is(.rating-item,.guildItem):nth-child(-n+3) > .lvl { border-color: #d2a36d !important; }
html.survival-portrait body #rating.popup > .ratingBoard > .rating-item > .rating-info {
  position: relative !important;
  inset: auto;
  display: grid !important;
  grid-template-columns: minmax(0,1fr) max-content;
  grid-column: 3;
  grid-row: 1;
  align-items: center !important;
  gap: 6px !important;
  min-width: 0 !important;
  padding-top: 18px;
  color: #e7ece9 !important;
  font: 700 10px/13px Arial,sans-serif !important;
}
html.survival-portrait body #rating.popup .rating-info > .rating-nick {
  min-width: 0 !important;
  color: #d5dcda !important;
  font: 600 10px/13px Arial,sans-serif !important;
  overflow: visible !important;
  white-space: normal !important;
}
html.survival-portrait body #rating.popup .rating-info > .rating-nick b {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  display: block;
  max-width: 100%;
  color: #fff1df !important;
  font: 800 12px/17px Arial,sans-serif !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
html.survival-portrait body #rating.popup .rating-info > .rating-nick > br { display: none; }
html.survival-portrait body #rating.popup .rating-info > div:empty { display: none; }
html.survival-portrait body #rating.popup .rating-info > .rating-lvl {
  width: auto !important;
  float: none;
  color: #d8d6cc !important;
  font: 600 10px/13px Arial,sans-serif !important;
  text-align: right !important;
  white-space: nowrap !important;
}
html.survival-portrait body #rating.popup .rating-info > .rating-lvl b {
  color: #f6c68b !important;
  font: 800 12px/15px Arial,sans-serif !important;
}
html.survival-portrait body #rating.popup > .ratingBoard > .guildItem.rating-guild-item {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
  min-height: 52px !important;
  height: 52px !important;
  margin: 0 0 5px !important;
  padding: 4px !important;
  background: #1b1e1d url('../img/ui/survival/kit/reward_card.webp') center / 100% 100% no-repeat !important;
  border: 1px solid transparent !important;
  border-radius: 2px !important;
  box-shadow: none !important;
}
html.survival-portrait body #rating.popup .rating-guild-item > .rating-guild-emblem { flex: 0 0 26px !important; width: 26px !important; height: 26px !important; }
html.survival-portrait body #rating.popup .rating-guild-item > .guildName { flex: 1 1 auto !important; min-width: 0 !important; font: 800 12px/16px Arial,sans-serif !important; }
html.survival-portrait body #rating.popup .rating-guild-item > .guildName > .float-right { float: none !important; display: block !important; color: #d2d7d4 !important; font: 600 10px/13px Arial,sans-serif !important; }
html.survival-portrait body #rating.popup .rating-guild-item > .guildPersons { flex: 0 0 39px !important; width: 39px !important; font: 700 11px/15px Arial,sans-serif !important; }
html.survival-portrait body #rating.popup .rating-guild-item > .guildActive { flex: 0 0 38px !important; width: 38px !important; color: #f6c68b !important; font: 800 12px/16px Arial,sans-serif !important; }

html.survival-portrait #rating:has(#rating_guild_btn.active) { --rating-scene: 241px; --dossier-close-art: url('../img/ui/survival/kit/button_back.webp'); --rating-board-foot: 57px; --rating-board-top: 219px; }

html.survival-portrait #rating:not(:has(#rating_guild_btn.active)) { --dossier-x: 7px; --dossier-y: 124px; --dossier-foot: 101px; --rating-tab-height: 23px; --rating-tab-line: 21px; --rating-tabs-height: 50px; --rating-position-top: 128px; --rating-board-top: 164px; --dossier-offset: -34px; }
html.survival-portrait #rating:not(:has(#rating_guild_btn.active)) > .br-wallet { display: none; }

.rating-to-city,.rating-clans-label { display: none; }
html.survival-portrait #rating:has(#rating_guild_btn.active) > .rating-clans-label {
  display: block; position: absolute; left: 9px; right: 9px; top: calc(194px + var(--rating-scene));
  border-bottom: 1px solid #806b53; color: #ece1d0; font: italic 800 12px/18px var(--br-display); text-transform: uppercase;
}
html.survival-portrait #rating:has(#rating_guild_btn.active) > .rating-to-city {
  display: block; position: absolute; left: 8px; bottom: 21px; width: calc(100% - 16px); height: 34px;
  background: var(--survival-primary-art) center / 100% 100% no-repeat; border: 0;
  color: #2a190d; font: 800 13px/32px var(--br-display); cursor: pointer;
}
