/* LEADERBOARD MODAL */
#lb-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: var(--frame-x);
}

#lb-modal.open {
  display: flex;
}

.lb-box {
  background: #111;
  border: clamp(2px, calc(2px * var(--ui-scale)), 4px) solid #fff;
  width: min(calc(var(--app-width) - (var(--frame-x) * 2)), clamp(260px, calc(340px * var(--ui-scale)), 620px));
  max-height: calc(var(--app-height) - (var(--frame-y) * 2));
  padding: clamp(22px, calc(30px * var(--ui-scale)), 42px) clamp(18px, calc(22px * var(--ui-scale)), 34px);
  overflow: auto;
  animation: modalIn 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes modalIn {
  0% { transform: scale(0.8) translateY(30px); opacity: 0; }
  100% { transform: none; opacity: 1; }
}

.lb-head {
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(14px, calc(16px * var(--ui-scale)), 30px);
  color: #fff;
  text-align: center;
  margin-bottom: var(--space-md);
  letter-spacing: clamp(2px, calc(3px * var(--ui-scale)), 6px);
}

.lb-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: clamp(10px, calc(10px * var(--ui-scale)), 18px) 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(10px, calc(11px * var(--ui-scale)), 20px);
  color: #fff;
}

.lb-row.you {
  color: #E3F925;
}

.lb-close {
  width: 100%;
  min-height: clamp(50px, calc(58px * var(--ui-scale)), 96px);
  margin-top: var(--space-md);
  background: #fff;
  color: #000;
  border: none;
  font-family: 'Press Start 2P', monospace;
  font-size: clamp(11px, calc(11px * var(--ui-scale)), 22px);
  padding: clamp(14px, calc(14px * var(--ui-scale)), 20px);
  cursor: pointer;
  letter-spacing: clamp(2px, calc(3px * var(--ui-scale)), 6px);
}
