.player-name,
.penalty-name {
  display: block;
  width: 100%;
  font-weight: 800;
  text-align: left;
  margin: 1rem 0 0.3rem;
}
.player-name input,
.penalty-name input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.4rem;
  border: 2px solid #ccd5df;
  border-radius: 0.75rem;
  background: #fff;
  color: #172238;
  font: inherit;
  font-size: 1rem;
  padding: 0.75rem;
}
.player-name input:focus,
.penalty-name input:focus {
  outline: 3px solid #ffcc3155;
  border-color: #ffcc31;
}
.penalty-name {
  margin: 0.3rem 0 1rem;
}
.penalty-name b {
  display: inline-grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  background: #142019;
  color: #fff;
  border-radius: 50%;
  margin-right: 0.4rem;
}
.leaderboards {
  margin: 3rem 0 7rem;
  padding: clamp(1.25rem, 4vw, 3.5rem);
  border-radius: 2rem;
  background: #111b30;
  color: #fff;
}
.leader-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: 2rem;
}
.leader-head h2 {
  font-size: clamp(2.6rem, 6vw, 5rem);
  margin: 0.25rem 0;
}
.leader-head > p:last-child {
  max-width: 25rem;
  color: #aebbd0;
}
.leader-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.leader-grid article {
  background: #fff;
  color: #172238;
  border-radius: 1.25rem;
  padding: 1rem;
}
.leader-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
}
.leader-title > span {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: #ffcc31;
  font-size: 1.35rem;
  font-weight: 900;
}
.leader-title h3 {
  margin: 0;
  font-size: 1.25rem;
}
.leader-title small {
  color: #718097;
}
.leader-grid ol {
  list-style: none;
  padding: 0;
  margin: 0.75rem 0 0;
  counter-reset: rank;
}
.leader-grid li {
  counter-increment: rank;
  display: grid;
  grid-template-columns: 2rem minmax(6rem, 1fr) minmax(5.8rem, auto) auto;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.5rem;
  border-top: 1px solid #e7ebf0;
}
.leader-grid li:before {
  content: counter(rank);
  display: grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: #edf1f6;
  font-weight: 900;
  font-size: 0.8rem;
}
.leader-grid li:nth-child(1):before {
  background: #ffcc31;
}
.leader-grid li:nth-child(2):before {
  background: #d9e0e8;
}
.leader-grid li:nth-child(3):before {
  background: #d9955a;
}
.leader-grid li b {
  overflow: hidden;
  text-overflow: ellipsis;
}
.leader-grid li span {
  font-size: 0.76rem;
  color: #718097;
}
.leader-grid li strong {
  font-size: 1.1rem;
}
.leader-grid .leader-loading,
.leader-grid .leader-empty {
  display: block;
  color: #718097;
  text-align: center;
}
.leader-grid .leader-loading:before,
.leader-grid .leader-empty:before {
  display: none;
}
.score-dialog {
  border: 0;
  border-radius: 1.5rem;
  padding: 0;
  max-width: 28rem;
  width: calc(100% - 2rem);
  box-shadow: 0 2rem 6rem #0008;
}
.score-dialog::backdrop {
  background: #0b1220bb;
  backdrop-filter: blur(4px);
}
.score-dialog form {
  position: relative;
  text-align: center;
  padding: 2rem;
}
.score-close {
  position: absolute;
  right: 0.8rem;
  top: 0.8rem;
  border: 0;
  background: #edf1f6;
  border-radius: 50%;
  width: 2.3rem;
  height: 2.3rem;
  font-size: 1.3rem;
  cursor: pointer;
}
.score-trophy {
  display: block;
  font-size: 4rem;
}
.score-dialog h2 {
  font-size: 2rem;
  margin: 0.4rem 0;
}
.score-dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-top: 1.4rem;
}
.score-dialog-actions button {
  border: 0;
  border-radius: 0.8rem;
  padding: 0.85rem;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  background: #edf1f6;
}
.score-dialog-actions .save-score {
  background: #168348;
  color: #fff;
}
#scoreSaveStatus {
  min-height: 1.3rem;
  font-weight: 700;
  color: #168348;
}
.dark .player-name input,
.dark .penalty-name input {
  background: #263247;
  color: #fff;
  border-color: #49566a;
}
.dark .leader-grid article {
  background: #202c42;
  color: #fff;
}
.dark .leader-grid li {
  border-color: #344158;
}
.dark .score-dialog {
  background: #202c42;
  color: #fff;
}
@media (max-width: 720px) {
  .leader-head {
    display: block;
  }
  .leader-grid {
    grid-template-columns: 1fr;
  }
  .leaderboards {
    margin-bottom: 4rem;
  }
}
@media (max-width: 480px) {
  .leader-grid li {
    grid-template-columns: 1.8rem 1fr auto;
  }
  .leader-grid li span {
    grid-column: 2/-1;
    grid-row: 2;
  }
}

/* Three-game leader board */
.leader-grid{grid-template-columns:repeat(3,1fr)}
@media(max-width:1050px){.leader-grid{grid-template-columns:1fr}}
