.score-backdrop[hidden] {
  display: none !important;
}

.score-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(0, 0, 0, 0.72);
}

.score-panel {
  width: min(460px, 100%);
  background: #003b4f;
  border: 4px solid #000;
  border-radius: 2px;
  box-shadow: 0 0 0 2px #0d546d, 0 22px 50px rgba(0, 0, 0, 0.6);
  padding: 22px;
  color: #e6e6e6;
  font-family: 'm6x11', 'Courier New', monospace;
  font-size: 16px;
  line-height: 1.45;
}

.score-panel h2 {
  margin: 0 0 10px;
  color: #fff;
  font-size: 26px;
  font-weight: normal;
  letter-spacing: 1px;
  text-shadow: 2px 2px 0 #000;
}

.score-panel p {
  margin: 8px 0;
}

.score-panel .score-meta {
  color: #9fb4bd;
  font-size: 14px;
}

.score-panel .score-run {
  margin: 12px 0 16px;
  padding: 10px 12px;
  background: #002b3a;
  border: 2px solid #000;
  color: #e6e6e6;
  font-size: 15px;
}

.score-panel .score-run strong {
  color: #ffe066;
  font-weight: normal;
}

.score-panel label {
  display: block;
  margin: 12px 0 6px;
  color: #9fb4bd;
  font-size: 14px;
}

.score-panel input[type="text"] {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  background: #002b3a;
  border: 2px solid #000;
  border-radius: 2px;
  color: #fff;
  font-family: inherit;
  font-size: 18px;
  outline: none;
}

.score-panel input[type="text"]:focus {
  border-color: #6fd1e8;
  box-shadow: 0 0 0 1px #6fd1e8;
}

.score-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.score-actions button,
.score-actions a.score-link {
  display: inline-block;
  padding: 10px 16px;
  background: #0d546d;
  border: 3px solid #000;
  border-radius: 2px;
  color: #e6e6e6;
  font-family: inherit;
  font-size: 18px;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  text-align: center;
}

.score-actions button:hover,
.score-actions a.score-link:hover {
  background: #0d3652;
}

.score-actions button:disabled {
  opacity: 0.5;
  cursor: default;
}

.score-actions .score-secondary {
  background: #27323a;
}

.score-status {
  min-height: 22px;
  margin-top: 12px;
  font-size: 15px;
}

.score-status.error {
  color: #ff7777;
}

.score-status.success {
  color: #9fe0a0;
}

.score-link-row {
  margin-top: 12px;
  font-size: 14px;
}

.score-link-row a {
  color: #ffe066;
}

@media (max-width: 480px) {
  .score-panel {
    padding: 16px;
  }

  .score-panel h2 {
    font-size: 22px;
  }

  .score-actions button,
  .score-actions a.score-link {
    flex: 1 1 auto;
  }
}

/* In-game leaderboard */
.leaderboard-panel {
    width: min(620px, 100%);
    max-height: min(90vh, 640px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.leaderboard-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.leaderboard-head h2 {
    margin-bottom: 4px;
}

.leaderboard-head .score-meta {
    margin: 0 0 4px;
}

.leaderboard-close {
    flex: 0 0 auto;
}

.leaderboard-status {
    min-height: 20px;
    margin: 10px 0 6px;
    color: #9fb4bd;
    font-size: 14px;
}

.leaderboard-status.error {
    color: #ff7777;
}

.leaderboard-table-wrap {
    min-height: 100px;
    overflow: auto;
    border: 2px solid #000;
    background: #002b3a;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #123d4d;
    text-align: left;
    white-space: nowrap;
}

.leaderboard-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #07394a;
    color: #9fb4bd;
    font-size: 13px;
    font-weight: normal;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.leaderboard-table tr:last-child td {
    border-bottom: 0;
}

.leaderboard-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.025);
}

.leaderboard-table .lb-rank {
    width: 42px;
    text-align: center;
    color: #9fb4bd;
}

.leaderboard-table .lb-name {
    color: #fff;
}

.leaderboard-table .lb-score {
    color: #ffe066;
    text-align: right;
}

.leaderboard-table .lb-cash {
    color: #9fe0a0;
    text-align: right;
}

.leaderboard-empty {
    padding: 24px 12px !important;
    color: #9fb4bd;
    text-align: center !important;
    white-space: normal !important;
}

.leaderboard-foot {
    margin: 10px 0 0;
    color: #9fb4bd;
    font-size: 13px;
}

@media (max-width: 520px) {
    .leaderboard-panel {
        max-height: calc(100vh - 24px);
    }

    .leaderboard-table th,
    .leaderboard-table td {
        padding: 7px 6px;
        font-size: 13px;
    }

    .leaderboard-table .lb-cash,
    .leaderboard-table .lb-keeper {
        display: none;
    }

    .leaderboard-table .lb-rank {
        width: 30px;
    }
}

.leaderboard-close {
    display: inline-block;
    padding: 8px 14px;
    background: #27323a;
    border: 3px solid #000;
    border-radius: 2px;
    color: #e6e6e6;
    font-family: inherit;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.leaderboard-close:hover {
    background: #0d3652;
}

.leaderboard-close:disabled {
    opacity: .5;
    cursor: default;
}
