:root {
  --game-ui-font: "Segoe UI", "Malgun Gothic", Tahoma, Arial, sans-serif;
}

.glue-screen,
.overlay,
.console,
.panel h2,
.status .name,
.base,
.act-mission,
.hero-panel,
.sc-text.readable-text {
  font-family: var(--game-ui-font);
}

.sc-text.readable-text {
  display: block;
  max-width: 100%;
  image-rendering: auto;
  font-weight: 600;
  line-height: 1.16;
  text-shadow: 0 1px 2px #000;
}

.readable-line {
  display: block;
  min-height: 1em;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.hud .console .status .readable-line {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hud .console .status :is(.hp, .shields, .energy) .readable-line {
  text-align: center !important;
}

.glue-options.sc .language-row,
:is(.overlay, .glue-options).sc .audio .slider {
  grid-template-columns: 62px minmax(0, 1fr);
}

:is(.overlay, .glue-options).sc .audio .slider.speed {
  grid-template-columns: 62px minmax(0, 1fr) 92px;
}

.glue-options .language-row:first-child .language-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.glue-screen .leaderboard-menu-button {
  position: absolute;
  right: 24px;
  top: 248px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #e9eacb;
  border-color: #887b51;
  background: #11181be8;
  cursor: pointer;
}

.glue-screen .leaderboard-menu-button:is(:hover, :focus-visible) {
  color: #fff4bd;
  border-color: #f2d883;
  background: #21251c;
}

.leaderboard-trophy {
  display: inline-grid;
  place-items: center;
  line-height: 1;
  pointer-events: none;
}

.leaderboard-float {
  position: fixed;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  font-size: 23px;
  border: 1px solid #ac955d;
  border-radius: 12px;
  background: linear-gradient(150deg, #28394a, #0a131f 74%);
  box-shadow: 0 3px 12px #000b, inset 0 0 0 2px #0005;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.leaderboard-float:is(:hover, :focus-visible, .is-dragging) {
  border-color: #f2d883;
  background-color: #26384b;
}

.leaderboard-float.is-dragging {
  cursor: grabbing;
}

.leaderboard-dialog {
  box-sizing: border-box;
  width: min(620px, calc(100% - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  color: #eaf0f7;
  border: 1px solid #667e98;
  border-radius: 12px;
  background: #111c2a;
  box-shadow: 0 20px 80px #000a, inset 0 0 0 2px #263a4e;
  font: 14px/1.45 var(--game-ui-font);
}

.leaderboard-dialog::backdrop {
  background: #03080dbb;
}

.leaderboard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #334659;
  background: #172639;
}

.leaderboard-header .leaderboard-trophy {
  font-size: 25px;
}

.leaderboard-intro {
  flex: 1;
  min-width: 0;
}

.leaderboard-intro h2 {
  margin: 0;
  color: #f8e1a9;
  font-size: 20px;
  line-height: 1.2;
}

.leaderboard-intro p {
  margin: 4px 0 0;
  color: #bacadb;
}

.leaderboard-close {
  flex: 0 0 36px;
  height: 36px;
  padding: 0;
  color: #eaf0f7;
  border: 1px solid #567089;
  border-radius: 6px;
  background: #0d1723;
  font: 24px/1 var(--game-ui-font);
  cursor: pointer;
}

.leaderboard-close:hover {
  background: #2b4057;
}

.leaderboard-float:focus-visible,
.leaderboard-close:focus-visible {
  outline: 2px solid #ffe5a1;
  outline-offset: 2px;
}

.leaderboard-empty {
  margin: 0;
  padding: 30px 16px;
  color: #c5d2e0;
  text-align: center;
}

.leaderboard-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-bottom: 1px solid #334659;
}

.leaderboard-name,
.leaderboard-action {
  box-sizing: border-box;
  min-height: 34px;
  padding: 4px 8px;
  color: inherit;
  border: 1px solid #567089;
  border-radius: 5px;
  background: #0d1723;
  font: inherit;
}

.leaderboard-name:focus-visible,
.leaderboard-action:focus-visible {
  outline: 2px solid #ffe5a1;
  outline-offset: 2px;
}

.leaderboard-name {
  min-width: 0;
  width: 100%;
}

.leaderboard-action {
  cursor: pointer;
}

.leaderboard-action:hover:not(:disabled) {
  background: #2b4057;
}

.leaderboard-action:disabled {
  opacity: .45;
  cursor: default;
}

.leaderboard-feedback {
  grid-column: 1 / -1;
  color: #ffd492;
}

.leaderboard-feedback:empty {
  display: none;
}

.leaderboard-pages {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px;
  color: #bdcfe1;
  text-align: center;
}

.leaderboard-sync {
  margin: 0 12px 10px;
  color: #ffd492;
}

.leaderboard-scroller {
  max-height: min(390px, 60dvh);
  overflow: auto;
}

.leaderboard-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.leaderboard-table :is(th, td) {
  padding: 9px 12px;
  border-bottom: 1px solid #2a3b4d;
  text-align: left;
}

.leaderboard-table th {
  position: sticky;
  top: 0;
  color: #bdcfe1;
  background: #172639;
  font-weight: 600;
}

.leaderboard-table :is(th, td):first-child {
  text-align: center;
}

.leaderboard-table :is(th, td):nth-child(3),
.leaderboard-table :is(th, td):nth-child(4),
.leaderboard-table :is(th, td):nth-child(5) {
  text-align: right;
}

.leaderboard-table tbody tr:first-child td:is(:first-child, :nth-child(3)) {
  color: #ffe095;
  font-weight: 700;
}

.leaderboard-player {
  overflow-wrap: anywhere;
}

.leaderboard-detail {
  display: block;
  color: #b4c4d6;
}

.leaderboard-result.victory {
  color: #8be5b3;
}

.leaderboard-result.defeat {
  color: #ffafa6;
}

@media (max-width: 460px) {
  .leaderboard-dialog {
    font-size: 12px;
  }

  .leaderboard-header {
    gap: 8px;
    padding: 12px;
  }

  .leaderboard-intro h2 {
    font-size: 18px;
  }

  .leaderboard-profile {
    padding-inline: 10px;
  }

  .leaderboard-table :is(th, td) {
    padding-inline: 6px;
  }
}
